/* ========== config.css — 配置教程专用样式（与首页风格底色完全一致） ========== */

:root {
    --primary: #1a6dd4;
    --primary-hover: #1255a8;
    --text: #1e1e2e;
    --text-secondary: #585861;
    --bg: #ffffff;
    --bg-soft: #f8f9fb;
    --border: #eaeaef;
    --radius: 10px;
    --shadow: 0 4px 12px rgba(0,0,0,0.05);
    --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: var(--font);
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ========== 导航栏（与首页一致） ========== */
header {
    position: sticky;
    top: 0;
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    z-index: 100;
}

.nav-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 72px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.35rem;
    color: var(--text);
}

.logo img {
    width: 32px;
    height: 32px;
}

nav {
    display: flex;
    gap: 28px;
    height: 100%;
    align-items: center;
}

nav a {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.2s;
    position: relative;
}

nav a:hover,
nav a.active {
    color: var(--primary);
}

nav a.active::after {
    content: "";
    position: absolute;
    bottom: -22px;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--primary);
    border-radius: 2px;
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.6rem;
    cursor: pointer;
    color: var(--text);
    padding: 8px;
}

/* ========== 页面标题区 ========== */
.page-hero {
    padding: 60px 0 40px;
    text-align: center;
    background: var(--bg-soft);
    border-bottom: 1px solid var(--border);
}

.hero-badge {
    display: inline-block;
    background: #eef4ff;
    color: var(--primary);
    padding: 6px 18px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 24px;
}

.page-hero h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 18px;
    color: var(--text);
}

.hero-sub {
    max-width: 800px;
    margin: 0 auto 30px;
    color: var(--text-secondary);
    font-size: 1.05rem;
    line-height: 1.7;
}

/* 快速跳转锚点 */
.anchor-strip {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 10px;
}

.anchor-strip span {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.anchor-strip a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    padding: 4px 10px;
    border-radius: 14px;
    transition: background 0.2s;
}

.anchor-strip a:hover {
    background: #eef4ff;
}

/* ========== 配置主体布局 ========== */
.config-body {
    padding: 70px 0;
}

.config-layout {
    display: flex;
    gap: 48px;
    align-items: flex-start;
}

/* 侧边目录 */
.toc-sidebar {
    flex: 0 0 240px;
    position: sticky;
    top: 100px;
}

.toc-box {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
}

.toc-box h3 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text);
}

.toc-box ol {
    list-style: none;
    padding: 0;
}

.toc-box li {
    margin-bottom: 10px;
}

.toc-box a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    display: block;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s;
}

.toc-box a:hover {
    color: var(--primary);
    background: #f4f6fb;
}

/* 主内容区 */
.config-content {
    flex: 1;
    min-width: 0;
}

/* ========== 配置章节块 ========== */
.config-block {
    margin-bottom: 50px;
    scroll-margin-top: 90px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
}

.block-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
}

.block-icon {
    font-size: 2rem;
}

.block-header h2 {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text);
}

.config-block > p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 24px;
    line-height: 1.7;
}

/* 步骤列表 (用于订阅章节) */
.steps-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin: 24px 0;
}

.step-item {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.step-num {
    width: 32px;
    height: 32px;
    background: var(--primary);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.step-item strong {
    display: block;
    margin-bottom: 4px;
    color: var(--text);
}

.step-item p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin: 0;
}

/* 信息面板 */
.info-panel {
    display: flex;
    gap: 14px;
    padding: 18px 20px;
    border-radius: var(--radius);
    background: #f0f6ff;
    border: 1px solid #d4e2fc;
    margin: 24px 0;
    font-size: 0.9rem;
}

.panel-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.info-panel strong {
    display: block;
    margin-bottom: 4px;
    color: var(--text);
}

.info-panel p {
    margin: 0;
    color: var(--text-secondary);
}

/* 路由规则卡片 */
.route-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin: 28px 0;
}

.route-card {
    background: #f9fafb;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    transition: box-shadow 0.2s;
}

.route-card:hover {
    box-shadow: var(--shadow);
}

.route-card h3 {
    font-size: 1.1rem;
    font-weight: 650;
    margin-bottom: 10px;
    color: var(--text);
}

.route-card p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 12px;
}

.code-tag {
    display: inline-block;
    background: #eef4ff;
    color: var(--primary);
    padding: 3px 10px;
    border-radius: 12px;
    font-family: monospace;
    font-size: 0.8rem;
    font-weight: 500;
}

/* 优先级说明 */
.priority-box {
    background: #fefaf0;
    border: 1px solid #f5e6b8;
    border-radius: var(--radius);
    padding: 20px;
    margin: 24px 0;
}

.priority-box h4 {
    font-size: 1rem;
    font-weight: 650;
    margin-bottom: 12px;
    color: var(--text);
}

.priority-box ol {
    padding-left: 20px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.8;
}

/* 实操步骤框 */
.howto-box {
    background: #f8faf9;
    border: 1px solid #c8e6d0;
    border-radius: var(--radius);
    padding: 20px;
    margin: 24px 0;
}

.howto-box h4 {
    font-size: 1rem;
    font-weight: 650;
    margin-bottom: 12px;
    color: var(--text);
}

/* 清单列表 */
.checklist {
    list-style: none;
    padding: 0;
}

.checklist li {
    position: relative;
    padding-left: 24px;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.checklist li::before {
    content: "☑️";
    position: absolute;
    left: 0;
    top: 0;
    color: var(--primary);
    font-weight: 700;
}

/* 代理模式对比卡片 */
.mode-comparison {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 24px;
    margin: 28px 0;
}

.mode-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    transition: box-shadow 0.2s;
    position: relative;
}

.mode-card.highlight {
    border-color: var(--primary);
    background: #f8fbff;
}

.mode-badge {
    position: absolute;
    top: -10px;
    right: 16px;
    background: var(--primary);
    color: #fff;
    padding: 3px 12px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.mode-card h3 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text);
}

.mode-card p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 14px;
}

.mode-card ul {
    list-style: none;
    padding: 0;
}

.mode-card li {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 6px;
    padding-left: 20px;
    position: relative;
}

.mode-card li::before {
    position: absolute;
    left: 0;
}

/* 负载策略列表 */
.strategy-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin: 28px 0;
}

.strategy-item {
    display: flex;
    gap: 18px;
    align-items: flex-start;
    background: #f9fafb;
    padding: 20px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.strategy-icon {
    font-size: 1.8rem;
    flex-shrink: 0;
}

.strategy-item h4 {
    font-size: 1.05rem;
    font-weight: 650;
    margin-bottom: 6px;
    color: var(--text);
}

.strategy-item p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0;
}

/* 进阶技巧网格 */
.tips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
    margin: 28px 0;
}

.mini-tip {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    transition: box-shadow 0.2s;
}

.mini-tip:hover {
    box-shadow: var(--shadow);
}

.mini-tip h4 {
    font-size: 0.95rem;
    font-weight: 650;
    margin-bottom: 8px;
    color: var(--text);
}

.mini-tip p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.5;
}

/* 底部导航按钮 */
.config-nav-bottom {
    display: flex;
    justify-content: space-between;
    margin-top: 50px;
    padding-top: 30px;
    border-top: 1px solid var(--border);
}

.btn-primary {
    background: var(--primary);
    color: #fff;
    padding: 12px 24px;
    border-radius: 25px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s;
    text-align: center;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-outline {
    background: #fff;
    color: var(--text);
    padding: 12px 24px;
    border-radius: 25px;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid var(--border);
    transition: background 0.2s;
    text-align: center;
}

.btn-outline:hover {
    background: var(--bg-soft);
}

/* ========== 页脚（与首页一致） ========== */
footer {
    background: #1a1a22;
    color: #ddd;
    padding: 56px 0 28px;
    font-size: 0.9rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 36px;
    margin-bottom: 40px;
    border-bottom: 1px solid #2e2e3a;
    padding-bottom: 36px;
}

.footer-col h4 {
    color: #fff;
    margin-bottom: 16px;
    font-size: 0.95rem;
    font-weight: 600;
}

.footer-col ul {
    list-style: none;
}

.footer-col li {
    margin-bottom: 10px;
}

.footer-col a {
    color: #aaa;
    text-decoration: none;
    transition: color 0.2s;
}

.footer-col a:hover {
    color: #fff;
}

.footer-about p {
    color: #aaa;
    line-height: 1.7;
    font-size: 0.85rem;
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    color: #777;
    font-size: 0.8rem;
}

/* ========== 响应式设计 ========== */
@media (max-width: 768px) {
    .nav-bar {
        flex-wrap: wrap;
        height: auto;
        padding: 16px 20px;
    }

    nav {
        display: none;
        width: 100%;
        flex-direction: column;
        gap: 10px;
        background: #fff;
        padding: 16px 0;
    }

    nav.nav-open {
        display: flex;
    }

    .nav-toggle {
        display: block;
    }

    nav a.active::after {
        display: none;
    }

    .page-hero h1 {
        font-size: 2rem;
    }

    .config-layout {
        flex-direction: column;
    }

    .toc-sidebar {
        position: static;
        width: 100%;
    }

    .config-block {
        padding: 24px;
    }

    .config-nav-bottom {
        flex-direction: column;
        gap: 12px;
    }

    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }

    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .footer-grid {
        grid-template-columns: 1fr;
    }
}