/* ===== CSS 变量定义 ===== */
:root {
    --primary-color: #a855f7;
    --primary-hover: #9333ea;
    --accent-color: #ec4899;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --text-light: #94a3b8;
    --bg-white: #ffffff;
    --bg-light: #fdf8f6;
    --bg-card: #faf5ff;
    --border-color: #f1e4fc;
    --border-dark: #e2d4f0;
    --shadow-sm: 0 4px 14px rgba(168, 85, 247, 0.12);
    --shadow-md: 0 12px 24px -10px rgba(168, 85, 247, 0.15);
    --shadow-lg: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    --radius-md: 12px;
    --radius-lg: 20px;
    --max-width: 1000px;
    --transition-fast: 0.2s ease;
    --transition-smooth: 0.3s ease;
}

/* ===== 全局重置 ===== */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--text-main);
    background-color: var(--bg-white);
    line-height: 1.6;
    overflow-x: hidden;
    font-size: 16px;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

/* ===== 导航栏 ===== */
header {
    position: sticky;
    top: 0;
    background-color: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo-box {
    flex-shrink: 0;
}

.logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--text-main);
    font-weight: 700;
    font-size: 20px;
    gap: 12px;
}

.logo-img {
    width: 32px;
    height: 32px;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 32px;
}

.nav-item {
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 15px;
    transition: color var(--transition-fast);
    position: relative;
}

.nav-item::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: width var(--transition-fast);
}

.nav-item:hover,
.nav-item.active {
    color: var(--primary-color);
}

.nav-item:hover::after,
.nav-item.active::after {
    width: 100%;
}

/* ===== 教程页 Hero ===== */
.guide-hero {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 80px 24px 20px;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    background-color: #f3e8ff;
    color: var(--primary-hover);
    padding: 6px 16px;
    border-radius: 40px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 20px;
    gap: 6px;
}

.hero-badge span {
    color: var(--accent-color);
}

.guide-hero h1 {
    font-size: 42px;
    line-height: 1.2;
    margin-bottom: 20px;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.guide-hero h1 span {
    color: var(--primary-color);
}

.hero-desc {
    font-size: 17px;
    color: var(--text-muted);
    line-height: 1.7;
}

/* ===== 快速导航卡片（创意版块） ===== */
.quick-nav-section {
    max-width: var(--max-width);
    margin: 0 auto 60px;
    padding: 0 24px;
}

.quick-nav-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
}

.quick-nav-card {
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px 16px;
    text-align: center;
    text-decoration: none;
    color: var(--text-main);
    transition: all var(--transition-smooth);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.quick-nav-card:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-sm);
    transform: translateY(-3px);
}

.nav-icon {
    font-size: 28px;
}

.quick-nav-card span {
    font-weight: 600;
    font-size: 15px;
}

/* ===== 主内容容器 ===== */
.guide-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px 80px;
}

/* ===== 章节标题 ===== */
.article-section {
    margin-bottom: 60px;
}

.section-anchor-title {
    font-size: 26px;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 22px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--primary-color);
}

/* ===== 正文段落 ===== */
.article-p {
    font-size: 16px;
    color: #334155;
    line-height: 1.85;
    margin-bottom: 22px;
    text-align: justify;
}

/* ===== 代码块 ===== */
.code-block-mock {
    background-color: #0f172a;
    color: #e2e8f0;
    padding: 20px;
    border-radius: 8px;
    font-family: 'Fira Code', Consolas, Monaco, monospace;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 26px;
    overflow-x: auto;
    border: 1px solid #1e293b;
    white-space: pre-wrap;
}

/* ===== 版本提示双卡片（创意版块） ===== */
.version-tip-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin: 30px 0;
}

.tip-item {
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
    transition: all var(--transition-smooth);
}

.tip-item:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-sm);
}

.tip-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 12px;
    letter-spacing: 0.3px;
}

.badge-mod {
    background-color: #ede9fe;
    color: #7c3aed;
}

.badge-pro {
    background-color: #fce7f3;
    color: #be185d;
}

.tip-item p {
    font-size: 15px;
    color: #334155;
    line-height: 1.6;
}

/* ===== 步骤网格（创意版块） ===== */
.steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 24px;
    margin: 30px 0;
}

.step-item {
    text-align: center;
    padding: 20px;
    background: var(--bg-light);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    transition: all var(--transition-smooth);
}

.step-item:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-sm);
    transform: translateY(-2px);
}

.step-number {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: white;
    font-weight: 800;
    font-size: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
}

.step-item h4 {
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-main);
}

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

/* ===== 内联提示框（改造后） ===== */
.inline-alert {
    background: linear-gradient(135deg, #f0fdf4 0%, #fdf2f8 100%);
    border: 1px solid #bbf7d0;
    border-radius: var(--radius-md);
    padding: 20px;
    margin: 24px 0;
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.inline-alert-icon {
    font-size: 24px;
    flex-shrink: 0;
    margin-top: 2px;
}

.inline-alert-content {
    flex: 1;
}

.inline-alert-title {
    font-size: 15px;
    font-weight: 700;
    color: #166534;
    margin-bottom: 6px;
}

.inline-alert-text {
    font-size: 14px;
    color: #15803d;
    line-height: 1.6;
}

/* ===== 节点分组卡片（创意版块） ===== */
.group-demo {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.group-card {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px 20px;
    text-align: center;
    transition: all var(--transition-smooth);
}

.group-card:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-sm);
    transform: translateY(-2px);
}

.group-card h4 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-main);
}

.group-card code {
    background: #f3e8ff;
    color: var(--primary-hover);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
}

.group-desc {
    display: block;
    margin-top: 10px;
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.5;
}

/* ===== 调优表格（创意版块） ===== */
.tuning-table {
    margin: 24px 0;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.tuning-row {
    display: grid;
    grid-template-columns: 1fr 1fr 2fr;
    align-items: center;
    background: var(--bg-white);
    padding: 16px 20px;
    font-size: 15px;
    transition: background var(--transition-fast);
}

.tuning-row:not(:last-child) {
    border-bottom: 1px solid var(--border-color);
}

.tuning-row:hover {
    background: var(--bg-light);
}

.tuning-param {
    font-family: Consolas, Monaco, monospace;
    font-weight: 600;
    color: var(--primary-hover);
}

.tuning-value {
    font-weight: 700;
    color: #16a34a;
    text-align: center;
}

.tuning-desc {
    color: var(--text-muted);
    text-align: right;
    font-size: 14px;
}

/* ===== FAQ 网格（创意版块） ===== */
.faq-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-top: 30px;
}

.faq-item {
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
    transition: all var(--transition-smooth);
}

.faq-item:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-sm);
}

.faq-item h4 {
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--text-main);
}

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

/* ===== 页脚 ===== */
footer {
    background-color: #0f172a;
    color: #94a3b8;
    padding: 70px 0 30px;
    font-size: 14px;
    border-top: 1px solid #1e293b;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
}

.footer-info {
    flex: 1 1 300px;
}

.footer-info h4 {
    color: var(--bg-white);
    font-size: 17px;
    margin-bottom: 18px;
    font-weight: 700;
}

.footer-info p {
    margin-bottom: 12px;
    line-height: 1.6;
}

.footer-links {
    flex: 2 1 500px;
}

.footer-links-table {
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
}

.footer-col {
    flex: 1 1 150px;
}

.footer-col h5 {
    color: var(--bg-white);
    font-size: 14px;
    margin-bottom: 18px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.footer-col ul {
    list-style: none;
}

.footer-col li {
    margin-bottom: 12px;
}

.footer-col a {
    color: #94a3b8;
    text-decoration: none;
    transition: color var(--transition-fast);
}

.footer-col a:hover {
    color: var(--primary-color);
}

.footer-bottom {
    max-width: 1200px;
    margin: 50px auto 0;
    padding: 24px 24px 0;
    border-top: 1px solid #1e293b;
    text-align: center;
    font-size: 12px;
    color: #64748b;
}

/* ===== 响应式设计 ===== */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        height: auto;
        padding: 16px 24px;
        align-items: flex-start;
    }

    .nav-menu {
        flex-wrap: wrap;
        gap: 16px;
        margin-top: 12px;
    }

    .guide-hero {
        padding: 60px 20px 20px;
    }

    .guide-hero h1 {
        font-size: 32px;
    }

    .quick-nav-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .version-tip-grid {
        grid-template-columns: 1fr;
    }

    .tuning-row {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .tuning-desc {
        grid-column: span 2;
        text-align: left;
        margin-top: 4px;
    }
}

@media (max-width: 480px) {
    .guide-hero h1 {
        font-size: 28px;
    }

    .quick-nav-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .steps-grid {
        grid-template-columns: 1fr;
    }

    .faq-grid {
        grid-template-columns: 1fr;
    }

    .footer-container {
        flex-direction: column;
    }

    .footer-links-table {
        flex-direction: column;
        gap: 30px;
    }
}