/* ===== 规则配置页专属样式 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: system-ui, -apple-system, 'Segoe UI', 'Roboto', 'Helvetica Neue', sans-serif;
    background: #f8fafc;
    color: #0f172a;
    line-height: 1.5;
    scroll-behavior: smooth;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ===== 头部导航 ===== */
.header {
    background: rgba(255,255,255,0.96);
    backdrop-filter: blur(8px);
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 50;
    border-bottom: 1px solid #e2e8f0;
}

.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    padding: 16px 0;
    gap: 16px;
}

.logo {
    font-size: 1.75rem;
    font-weight: 700;
    background: linear-gradient(135deg, #1e293b, #3b82f6);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    letter-spacing: -0.02em;
    text-decoration: none;
}

.nav-links {
    display: flex;
    gap: 28px;
    align-items: center;
    flex-wrap: wrap;
}

.nav-links a {
    text-decoration: none;
    font-weight: 500;
    color: #334155;
    transition: color 0.2s;
    font-size: 0.95rem;
    white-space: nowrap;
}

.nav-links a:hover,
.nav-links a.active {
    color: #3b82f6;
}

/* ===== Hero ===== */
.rules-hero {
    background: linear-gradient(145deg, #ffffff 0%, #f1f5f9 100%);
    padding: 60px 0 40px;
    text-align: center;
}

.rules-hero h1 {
    font-size: 2.6rem;
    font-weight: 800;
    margin-bottom: 16px;
}

.rules-hero h1 span {
    background: linear-gradient(to right, #2563eb, #7c3aed);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
}

.rules-hero p {
    color: #475569;
    font-size: 1.15rem;
    margin-bottom: 28px;
}

.hero-quick-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
}

.hero-quick-links a {
    background: white;
    border: 1px solid #e2e8f0;
    padding: 8px 20px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    color: #1e293b;
    transition: all 0.2s;
}

.hero-quick-links a:hover {
    background: #eff6ff;
    border-color: #3b82f6;
    color: #2563eb;
}

/* ===== 通用标题 ===== */
.section-title {
    text-align: center;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: #0f172a;
}

/* ===== 1. 规则基础认知 ===== */
.basics-section {
    padding: 64px 0;
    background: white;
}

.basics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
    margin-top: 32px;
}

.basics-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 28px 18px;
    text-align: center;
    transition: transform 0.2s;
}

.basics-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px -10px rgba(0,0,0,0.1);
}

.basics-emoji {
    font-size: 2.4rem;
    display: block;
    margin-bottom: 14px;
}

.basics-card h3 {
    font-size: 1.2rem;
    margin-bottom: 10px;
}

.basics-card p {
    font-size: 0.9rem;
    color: #475569;
}

/* ===== 2. 规则体系结构 ===== */
.structure-section {
    padding: 64px 0;
    background: #f1f5f9;
}

.structure-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 24px;
    margin-top: 32px;
}

.structure-category {
    background: white;
    border-radius: 20px;
    padding: 24px 16px;
    border: 1px solid #e2e8f0;
    text-align: center;
}

.structure-category h3 {
    margin-bottom: 16px;
}

.rule-tag {
    display: inline-block;
    background: #dbeafe;
    color: #1e40af;
    padding: 4px 12px;
    border-radius: 14px;
    font-size: 0.85rem;
    font-weight: 600;
    margin: 4px;
}

.structure-category p {
    margin-top: 16px;
    color: #475569;
    font-size: 0.9rem;
}

/* ===== 3. 场景化规则库 ===== */
.scenarios-section {
    padding: 64px 0;
    background: white;
}

.scenario-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 24px;
    margin-top: 32px;
}

.scenario-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 22px 16px;
    transition: all 0.2s;
}

.scenario-card:hover {
    box-shadow: 0 8px 20px -8px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.scenario-icon {
    font-size: 2rem;
    display: block;
    margin-bottom: 10px;
}

.scenario-card h3 {
    font-size: 1.15rem;
    margin-bottom: 8px;
}

.scenario-card p {
    font-size: 0.9rem;
    color: #475569;
    margin-bottom: 12px;
}

.scenario-card pre {
    background: #1e293b;
    color: #e2e8f0;
    padding: 12px;
    border-radius: 12px;
    font-size: 0.8rem;
    overflow-x: auto;
    margin-top: 8px;
}

.scenario-card code {
    background: transparent;
    color: inherit;
}

/* ===== 4. 实战模板 ===== */
.templates-section {
    padding: 64px 0;
    background: #f8fafc;
}

.template-box {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 24px;
    margin-bottom: 28px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.template-box h3 {
    margin-bottom: 12px;
    font-size: 1.2rem;
}

.template-box p {
    color: #475569;
    font-size: 0.9rem;
    margin-bottom: 16px;
}

.template-box pre {
    background: #0f172a;
    color: #f1f5f9;
    padding: 18px;
    border-radius: 16px;
    font-size: 0.85rem;
    overflow-x: auto;
}

.template-box code {
    color: #cbd5e1;
}

/* ===== 5. 场景解决方案 ===== */
.solution-section {
    padding: 64px 0;
    background: white;
}

.solution-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
    margin-top: 32px;
}

.solution-item {
    background: #fefce8;
    border: 1px solid #fde047;
    border-radius: 16px;
    padding: 20px;
}

.solution-item h3 {
    margin-bottom: 10px;
    font-size: 1.05rem;
}

.solution-item p {
    font-size: 0.9rem;
    color: #475569;
}

/* ===== 6. 常见错误规则 ===== */
.mistake-section {
    padding: 64px 0;
    background: #fef2f2;
}

.mistake-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
    margin-top: 32px;
}

.mistake-card {
    background: white;
    border: 1px solid #fecaca;
    border-radius: 16px;
    padding: 20px;
}

.mistake-card span {
    font-size: 1.5rem;
    margin-right: 8px;
}

.mistake-card strong {
    display: block;
    margin-bottom: 8px;
}

.mistake-card p {
    font-size: 0.9rem;
    color: #991b1b;
}

/* ===== 7. 一键规则包 ===== */
.pack-section {
    padding: 64px 0;
    background: white;
}

.pack-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    margin-top: 32px;
}

.pack-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 24px 16px;
    text-align: center;
    transition: all 0.2s;
}

.pack-card:hover {
    border-color: #3b82f6;
    transform: translateY(-2px);
    box-shadow: 0 8px 16px -6px rgba(37,99,235,0.15);
}

.pack-card h3 {
    font-size: 1.15rem;
    margin-bottom: 12px;
}

.pack-card p {
    font-size: 0.9rem;
    color: #475569;
    margin-bottom: 16px;
}

.pack-link {
    display: inline-block;
    background: #2563eb;
    color: white;
    padding: 8px 22px;
    border-radius: 24px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: background 0.2s;
}

.pack-link:hover {
    background: #1d4ed8;
}

/* ===== 底部 CTA ===== */
.cta-rules-download {
    background: #0f172a;
    padding: 48px 0;
    color: white;
    text-align: center;
}

.cta-rules-box p:first-child {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 8px;
}

.cta-rules-sub {
    color: #cbd5e1;
    margin-bottom: 24px;
}

.btn-cta-rules {
    display: inline-block;
    background: #2563eb;
    color: white;
    font-weight: 700;
    padding: 14px 38px;
    border-radius: 50px;
    text-decoration: none;
    font-size: 1.1rem;
    box-shadow: 0 10px 18px -8px rgba(37,99,235,0.5);
    transition: all 0.2s;
}

.btn-cta-rules:hover {
    background: #1d4ed8;
    transform: translateY(-2px);
}

/* ===== 页脚 ===== */
.footer {
    background: #0f172a;
    color: #cbd5e1;
    padding: 56px 0 32px;
    font-size: 0.9rem;
    border-top: 1px solid #1e293b;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-col h4 {
    color: white;
    margin-bottom: 16px;
    font-weight: 600;
    font-size: 0.95rem;
}

.footer-col a {
    display: block;
    color: #94a3b8;
    text-decoration: none;
    margin-bottom: 10px;
    transition: color 0.2s;
}

.footer-col a:hover {
    color: white;
}

.copyright {
    text-align: center;
    padding-top: 32px;
    border-top: 1px solid #1e293b;
    color: #64748b;
    font-size: 0.8rem;
}

/* ===== 响应式 ===== */
@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        align-items: flex-start;
    }
    .nav-links {
        gap: 18px;
        width: 100%;
        flex-wrap: wrap;
    }
    .rules-hero h1 {
        font-size: 2rem;
    }
}