/* ===== 全局变量与重置 ===== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --bg-deep: #0b0f19;
    --bg-card: #0f172a;
    --bg-card-hover: #111c2d;
    --border-default: #1e293b;
    --border-hover: #334155;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-tertiary: #64748b;
    --accent-blue: #3b82f6;
    --accent-blue-soft: #60a5fa;
    --accent-green: #10b981;
    --accent-purple: #8b5cf6;
    --accent-amber: #f59e0b;
    --accent-rose: #f43f5e;
    --accent-teal: #14b8a6;
    --radius-lg: 24px;
    --radius-md: 16px;
    --radius-sm: 12px;
    --transition: 0.25s ease;
    --font-mono: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
}

body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--bg-deep);
    color: var(--text-primary);
    line-height: 1.7;
    letter-spacing: 0.01em;
    overflow-x: hidden;
}

/* ===== 导航栏（与首页统一） ===== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 76px;
    background: rgba(11, 15, 25, 0.88);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-default);
    z-index: 1000;
    display: flex;
    align-items: center;
}

.nav-container {
    width: 100%;
    max-width: 1320px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
}

.nav-logo img {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    object-fit: cover;
    border: none;
}

.nav-logo-text {
    font-size: 22px;
    font-weight: 900;
    color: #ffffff;
    letter-spacing: -0.02em;
}

.nav-right-group {
    display: flex;
    align-items: center;
    gap: 32px;
}

.nav-links {
    display: flex;
    gap: 28px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 15px;
    font-weight: 600;
    transition: all var(--transition);
    padding: 6px 0;
    position: relative;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--accent-blue);
}

.nav-links a.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--accent-blue);
    border-radius: 2px;
}

.github-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    color: #ffffff;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    transition: all var(--transition);
}

.github-btn:hover {
    background: #273549;
    border-color: var(--border-hover);
}

.github-btn svg {
    fill: currentColor;
    width: 16px;
    height: 16px;
}

/* ===== Hero 区域 ===== */
.rules-hero {
    padding: 160px 24px 40px 24px;
    max-width: 1320px;
    margin: 0 auto;
    text-align: center;
}

.rules-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    color: var(--accent-green);
    padding: 6px 16px;
    border-radius: 30px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 24px;
    font-family: var(--font-mono);
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background: var(--accent-green);
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 10px var(--accent-green);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.rules-hero h1 {
    font-size: 46px;
    font-weight: 900;
    color: #ffffff;
    letter-spacing: -0.04em;
    margin: 0 0 20px 0;
    line-height: 1.2;
}

.rules-hero h1 span {
    background: linear-gradient(135deg, var(--accent-green) 0%, var(--accent-teal) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-description {
    font-size: 17px;
    color: var(--text-secondary);
    max-width: 800px;
    margin: 0 auto 36px auto;
    line-height: 1.7;
    text-align: justify;
}

.hero-stats-row {
    display: flex;
    justify-content: center;
    gap: 40px;
    flex-wrap: wrap;
    margin-bottom: 32px;
}

.stat-highlight {
    text-align: center;
}

.stat-value {
    font-size: 28px;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 14px;
    color: var(--text-tertiary);
    font-weight: 500;
}

.update-status-bar {
    background: rgba(16, 185, 129, 0.05);
    border: 1px solid rgba(16, 185, 129, 0.15);
    border-radius: 30px;
    padding: 12px 24px;
    font-size: 14px;
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.text-green {
    color: var(--accent-green);
    font-weight: 700;
}

/* ===== 规则分类卡片 ===== */
.rules-category-section {
    max-width: 1320px;
    margin: 0 auto 80px auto;
    padding: 0 24px;
}

.section-header {
    text-align: center;
    margin-bottom: 48px;
}

.section-header h2 {
    font-size: 32px;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 12px;
}

.section-header p {
    font-size: 15px;
    color: var(--text-tertiary);
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
    margin-bottom: 40px;
}

.category-card {
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    padding: 36px 30px;
    transition: all var(--transition);
    display: flex;
    flex-direction: column;
}

.category-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(0,0,0,0.4);
}

.direct-card:hover { border-color: var(--accent-green); }
.proxy-card:hover { border-color: var(--accent-blue); }
.reject-card:hover { border-color: var(--accent-rose); }

.category-icon {
    font-size: 36px;
    margin-bottom: 16px;
}

.category-card h3 {
    font-size: 22px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 12px;
}

.category-card p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 20px;
    flex: 1;
}

.rule-examples {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 20px;
}

.rule-examples code {
    background: #090d16;
    padding: 6px 10px;
    border-radius: 6px;
    font-family: var(--font-mono);
    font-size: 12px;
    color: #cbd5e1;
    word-break: break-all;
}

.card-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border-default);
    padding-top: 16px;
    margin-top: auto;
}

.rule-count {
    font-size: 13px;
    color: var(--text-tertiary);
    font-weight: 600;
}

.download-link {
    font-size: 14px;
    font-weight: 700;
    color: var(--accent-blue);
    text-decoration: none;
    transition: gap 0.2s;
}

.download-link:hover {
    text-decoration: underline;
}

.download-all-bar {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.btn-primary {
    background: var(--accent-blue);
    color: #ffffff;
    text-decoration: none;
    padding: 16px 34px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 16px;
    transition: all var(--transition);
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.3);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary:hover {
    background: #2563eb;
    transform: translateY(-2px);
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    text-decoration: none;
    padding: 16px 34px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 16px;
    border: 1px solid var(--border-hover);
    transition: all var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-secondary:hover {
    background: var(--border-hover);
}

/* ===== 语法参考版块 ===== */
.syntax-reference-section {
    max-width: 1320px;
    margin: 0 auto 80px auto;
    padding: 0 24px;
}

.syntax-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

.syntax-item {
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    padding: 28px 24px;
    transition: border-color var(--transition);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.syntax-item:hover {
    border-color: var(--accent-blue);
}

.syntax-type {
    font-family: var(--font-mono);
    font-size: 18px;
    font-weight: 800;
    color: var(--accent-blue);
}

.syntax-desc {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.syntax-item code {
    background: #090d16;
    padding: 8px 12px;
    border-radius: 8px;
    font-family: var(--font-mono);
    font-size: 12px;
    color: #cbd5e1;
    word-break: break-all;
}

.compatibility {
    font-size: 11px;
    color: var(--text-tertiary);
    margin-top: auto;
}

/* ===== 社区验证流程 ===== */
.community-verify-section {
    max-width: 1320px;
    margin: 0 auto 80px auto;
    padding: 0 24px;
}

.verify-flow {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 0;
    flex-wrap: wrap;
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    padding: 40px 24px;
    margin-bottom: 32px;
}

.flow-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 160px;
}

.step-number {
    width: 40px;
    height: 40px;
    background: var(--accent-blue);
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 18px;
    margin-bottom: 12px;
}

.flow-step h4 {
    font-size: 16px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 8px;
}

.flow-step p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.flow-arrow {
    display: flex;
    align-items: center;
    color: var(--text-tertiary);
    font-size: 24px;
    margin: 0 10px;
    padding-top: 10px;
}

.contribute-call {
    text-align: center;
    font-size: 15px;
    color: var(--text-secondary);
}

.contribute-call a {
    color: var(--accent-blue);
    font-weight: 600;
    text-decoration: none;
}

.contribute-call a:hover {
    text-decoration: underline;
}

/* ===== 导入指引 ===== */
.import-guide-section {
    max-width: 1320px;
    margin: 0 auto 100px auto;
    padding: 0 24px;
}

.import-steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
}

.import-card {
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    padding: 36px 28px;
    text-align: center;
    transition: all var(--transition);
}

.import-card:hover {
    border-color: var(--accent-blue);
    transform: translateY(-3px);
}

.import-icon {
    font-size: 36px;
    color: var(--accent-blue);
    margin-bottom: 16px;
    font-weight: 900;
}

.import-card h3 {
    font-size: 20px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 12px;
}

.import-card p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ===== 页脚（与首页统一） ===== */
.footer-new {
    background-color: #090d16;
    border-top: 1px solid var(--border-default);
    padding: 80px 24px 60px 24px;
}

.footer-new-container {
    max-width: 1320px;
    margin: 0 auto;
}

.footer-main-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding-bottom: 50px;
    border-bottom: 1px solid var(--border-default);
    flex-wrap: wrap;
    gap: 48px;
}

.footer-brand-info {
    max-width: 420px;
}

.footer-brand-info h4 {
    color: #ffffff;
    font-size: 18px;
    font-weight: 800;
    margin: 0 0 12px 0;
}

.footer-brand-info p {
    color: var(--text-tertiary);
    font-size: 14px;
    margin: 0;
    line-height: 1.6;
}

.footer-links-group-wrapper {
    display: flex;
    gap: 60px;
    flex-wrap: wrap;
}

.footer-links-cluster {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.footer-links-cluster span {
    color: #ffffff;
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 4px;
}

.footer-links-cluster a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color var(--transition);
}

.footer-links-cluster a:hover {
    color: var(--accent-blue);
}

.footer-meta-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 36px;
    font-size: 13px;
    color: #475569;
    flex-wrap: wrap;
    gap: 24px;
}

.footer-meta-row a {
    color: #475569;
    text-decoration: none;
    margin-left: 24px;
    transition: color var(--transition);
}

.footer-meta-row a:hover {
    color: #64748b;
}

/* ===== 响应式 ===== */
@media (max-width: 1024px) {
    .category-grid {
        grid-template-columns: 1fr;
        max-width: 500px;
        margin-left: auto;
        margin-right: auto;
    }
    .syntax-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .import-steps {
        grid-template-columns: 1fr;
        max-width: 500px;
        margin-left: auto;
        margin-right: auto;
    }
    .verify-flow {
        flex-direction: column;
        align-items: center;
        gap: 24px;
    }
    .flow-arrow {
        transform: rotate(90deg);
        margin: 0;
    }
    .footer-main-row {
        flex-direction: column;
        text-align: center;
        align-items: center;
    }
    .footer-links-group-wrapper {
        justify-content: center;
        gap: 40px;
    }
}

@media (max-width: 768px) {
    .nav-container {
        padding: 0 16px;
    }
    .nav-links {
        display: none;
    }
    .rules-hero {
        padding-top: 130px;
    }
    .rules-hero h1 {
        font-size: 32px;
    }
    .hero-stats-row {
        gap: 20px;
    }
    .stat-value {
        font-size: 22px;
    }
    .syntax-grid {
        grid-template-columns: 1fr;
    }
    .footer-meta-row {
        flex-direction: column;
        text-align: center;
    }
    .footer-meta-row div:last-child {
        margin-top: 8px;
    }
    .footer-meta-row a {
        margin: 0 12px;
    }
}