/* ===== 全局变量与重置 ===== */
*, *::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: 28px;
    --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 区域 ===== */
.guide-hero-dashboard {
    padding: 160px 24px 60px 24px;
    max-width: 1320px;
    margin: 0 auto;
}

.dashboard-meta-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
    color: var(--accent-blue);
    padding: 6px 14px;
    border-radius: 30px;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 24px;
    font-family: var(--font-mono);
}

.dashboard-meta-badge span {
    width: 6px;
    height: 6px;
    background: var(--accent-blue);
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 8px var(--accent-blue);
}

.guide-hero-dashboard h1 {
    font-size: 46px;
    font-weight: 900;
    color: #ffffff;
    letter-spacing: -0.04em;
    margin: 0 0 20px 0;
    line-height: 1.2;
}

.guide-hero-dashboard h1 span {
    background: linear-gradient(135deg, var(--accent-blue) 0%, var(--accent-blue-soft) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.guide-hero-dashboard p {
    font-size: 16px;
    color: var(--text-secondary);
    max-width: 880px;
    margin: 0 0 48px 0;
    text-align: justify;
}

/* 快速导航条 */
.anchor-stream-bar {
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    padding: 8px;
    display: flex;
    gap: 8px;
    overflow-x: auto;
    margin-bottom: 64px;
}

.anchor-stream-bar::-webkit-scrollbar {
    height: 0;
}

.anchor-node {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    padding: 10px 20px;
    border-radius: 10px;
    transition: all var(--transition);
    white-space: nowrap;
    font-family: var(--font-mono);
}

.anchor-node span {
    color: #475569;
    margin-right: 4px;
}

.anchor-node:hover {
    color: #ffffff;
    background: rgba(255,255,255,0.03);
}

.anchor-node.active {
    background: #1e293b;
    color: var(--accent-blue);
    border: 1px solid var(--border-hover);
}

/* ===== 文档区块布局 ===== */
.document-flow-layout {
    max-width: 1320px;
    margin: 0 auto 120px auto;
    padding: 0 24px;
    display: flex;
    flex-direction: column;
    gap: 64px;
}

.block-section {
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    padding: 50px;
    scroll-margin-top: 100px;
    position: relative;
}

.block-section h2 {
    font-size: 26px;
    font-weight: 800;
    color: #ffffff;
    margin: 0 0 16px 0;
    display: flex;
    align-items: center;
    gap: 16px;
}

.block-section h2 span {
    font-family: var(--font-mono);
    color: var(--accent-blue);
    font-size: 18px;
    background: rgba(59, 130, 246, 0.08);
    padding: 2px 10px;
    border-radius: 6px;
    border: 1px solid rgba(59, 130, 246, 0.15);
}

.section-intro {
    font-size: 15px;
    color: var(--text-secondary);
    margin: 0 0 32px 0;
    text-align: justify;
    max-width: 1000px;
}

.tech-spec-grid {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 40px;
    align-items: start;
}

.tech-spec-grid.reverse {
    grid-template-columns: 0.9fr 1.1fr;
}

.spec-text-panel h3 {
    font-size: 16px;
    font-weight: 700;
    color: #e2e8f0;
    margin: 0 0 12px 0;
}

.spec-text-panel p {
    font-size: 14px;
    color: #cbd5e1;
    margin: 0 0 16px 0;
    text-align: justify;
    line-height: 1.65;
}

.bullet-details {
    list-style: none;
    padding: 0;
    margin: 24px 0 0 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.bullet-details li {
    font-size: 14px;
    color: var(--text-secondary);
    padding-left: 18px;
    position: relative;
}

.bullet-details li::before {
    content: "•";
    color: var(--accent-blue);
    position: absolute;
    left: 0;
    font-weight: bold;
}

/* 代码面板 */
.code-panel {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.code-container {
    background: #090d16;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    padding: 24px;
    font-family: var(--font-mono);
    font-size: 13px;
    color: #38bdf8;
    overflow-x: auto;
    position: relative;
    white-space: pre-line;
}

.code-container::before {
    content: "CONFIG SNIPPET";
    position: absolute;
    top: 8px;
    right: 16px;
    font-size: 10px;
    color: #475569;
    font-weight: 700;
}

.code-container.terminal::before {
    content: "SETUP STEPS";
}

.code-container code span.comment {
    color: #64748b;
}

.code-container code span.keyword {
    color: #f43f5e;
}

.status-alert-box {
    background: rgba(16, 185, 129, 0.03);
    border: 1px solid rgba(16, 185, 129, 0.15);
    border-radius: 14px;
    padding: 20px;
    font-size: 13px;
    color: var(--accent-green);
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

/* 场景模板卡片 */
.template-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

.template-card {
    background: #090d16;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    padding: 20px;
    transition: all var(--transition);
}

.template-card:hover {
    border-color: var(--accent-blue);
}

.template-icon {
    font-size: 24px;
    margin-bottom: 8px;
}

.template-card h4 {
    font-size: 16px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 6px;
}

.template-card p {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.template-card code {
    font-family: var(--font-mono);
    font-size: 12px;
    color: #cbd5e1;
    background: #0f172a;
    padding: 8px;
    border-radius: 8px;
    display: block;
    line-height: 1.5;
}

/* 测速模拟面板 */
.speedtest-mock {
    background: #090d16;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    padding: 20px;
    font-family: var(--font-mono);
}

.mock-header {
    font-size: 14px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-default);
}

.mock-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid rgba(30,41,59,0.5);
    font-size: 13px;
    color: #cbd5e1;
}

.mock-row.best {
    background: rgba(59,130,246,0.05);
    border-radius: 8px;
    padding: 10px;
}

.node-name { font-weight: 600; min-width: 120px; }
.ping { color: #f59e0b; }
.bandwidth { color: var(--accent-green); }
.badge-recommend {
    background: var(--accent-blue);
    color: #ffffff;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    margin-left: auto;
}

/* FAQ 速查版块 */
.faq-quick-section {
    margin-top: 20px;
}

.section-title {
    text-align: center;
    margin-bottom: 40px;
}

.section-title h2 {
    font-size: 28px;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 12px;
}

.section-title p {
    font-size: 15px;
    color: var(--text-tertiary);
}

.faq-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    margin-bottom: 32px;
}

.faq-item {
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    padding: 28px 24px;
    transition: border-color var(--transition);
}

.faq-item:hover {
    border-color: var(--accent-blue);
}

.faq-item h4 {
    font-size: 18px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 12px;
}

.faq-item p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.faq-more-link {
    text-align: center;
}

.card-link {
    color: var(--accent-blue);
    text-decoration: none;
    font-weight: 700;
    font-size: 16px;
    transition: gap 0.2s;
}

.card-link:hover {
    text-decoration: underline;
}

/* ===== 页脚（与首页统一） ===== */
.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) {
    .tech-spec-grid, .tech-spec-grid.reverse {
        grid-template-columns: 1fr;
        gap: 32px;
    }
    .faq-grid {
        grid-template-columns: 1fr;
    }
    .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;
    }
    .guide-hero-dashboard {
        padding-top: 130px;
    }
    .guide-hero-dashboard h1 {
        font-size: 32px;
    }
    .block-section {
        padding: 32px;
    }
    .anchor-stream-bar {
        gap: 4px;
    }
    .anchor-node {
        padding: 8px 14px;
        font-size: 12px;
    }
    .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;
    }
}