:root {
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --text-main: #1f2937;
    --text-muted: #4b5563;
    --bg-light: #f9fafb;
    --white: #ffffff;
    --border-color: #e5e7eb;
    --radius-md: 8px;
    --radius-lg: 12px;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.02);
    --shadow-md: 0 10px 20px rgba(0,0,0,0.05);
    --transition-base: 0.2s ease;
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", sans-serif;
    color: var(--text-main);
    line-height: 1.7;
    background-color: var(--white);
    -webkit-font-smoothing: antialiased;
}

/* ===== 导航（与首页完全一致） ===== */
header {
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 100;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 2rem;
    gap: 1rem;
}

.logo-wrap {
    display: flex;
    align-items: center;
    text-decoration: none;
    gap: 0.5rem;
    flex-shrink: 0;
}

.logo-img {
    width: 32px;
    height: 32px;
    object-fit: contain;
    border-radius: 4px;
}

.logo-text {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-main);
    white-space: nowrap;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-links {
    display: flex;
    gap: 0.25rem;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-muted);
    padding: 0.4rem 0.85rem;
    font-weight: 500;
    font-size: 0.95rem;
    border-radius: var(--radius-md);
    transition: color var(--transition-base), background-color var(--transition-base);
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--primary-color);
    background-color: #f0f0ff;
}

.github-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background-color: #24292e;
    color: var(--white);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 500;
    transition: background-color var(--transition-base);
    white-space: nowrap;
    flex-shrink: 0;
}

.github-btn:hover {
    background-color: #1a1e22;
}

/* ===== 配置指南主容器 ===== */
.guide-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 4rem 2rem 6rem;
}

.article-header {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 2rem;
    margin-bottom: 3rem;
}

.article-header h1 {
    font-size: clamp(1.9rem, 3.5vw, 2.4rem);
    color: #111827;
    margin-bottom: 1rem;
    line-height: 1.3;
    font-weight: 800;
}

.meta-info {
    font-size: 0.9rem;
    color: var(--text-muted);
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 2rem;
}

/* ===== 正文内容 ===== */
.guide-content h2 {
    font-size: 1.6rem;
    color: #111827;
    margin: 2.8rem 0 1.2rem;
    padding-left: 0.75rem;
    border-left: 4px solid var(--primary-color);
    font-weight: 700;
}

.guide-content h3 {
    font-size: 1.25rem;
    color: #111827;
    margin: 1.8rem 0 1rem;
    font-weight: 600;
}

.guide-content p {
    font-size: 1.05rem;
    margin-bottom: 1.2rem;
    color: #374151;
    text-align: justify;
}

.guide-content ol,
.guide-content ul {
    margin-bottom: 1.5rem;
    padding-left: 1.8rem;
}

.guide-content li {
    font-size: 1.05rem;
    margin-bottom: 0.6rem;
    color: #374151;
}

.guide-content code {
    background-color: #f3f4f6;
    color: #e11d48;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-family: Consolas, Monaco, "Courier New", monospace;
    font-size: 0.92rem;
    font-weight: 500;
}

.guide-content pre {
    background-color: #1e293b;
    color: #e2e8f0;
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    overflow-x: auto;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    line-height: 1.6;
}

.guide-content pre code {
    background: none;
    color: inherit;
    padding: 0;
    font-size: inherit;
}

.guide-image-wrap {
    margin: 2rem 0;
    background-color: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    overflow: hidden;
    text-align: center;
}

.guide-image-wrap img {
    display: block;
    max-width: 100%;
    height: auto;
    min-height: 200px;
    margin: 0 auto;
    background-color: #e5e7eb;
    object-fit: cover;
}

.image-caption {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    padding: 0.75rem;
    background-color: #f3f4f6;
    border-top: 1px solid var(--border-color);
}

.alert-block {
    background-color: #eff6ff;
    border-left: 4px solid #3b82f6;
    padding: 1.5rem;
    border-radius: 0 8px 8px 0;
    margin: 2rem 0;
}

.alert-block p {
    margin-bottom: 0;
    font-size: 0.95rem;
    color: #1e3a8a;
}

/* ===== 创意版块：规则引擎工作流 ===== */
.rule-flow-box {
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2rem;
    margin: 2.5rem 0;
}

.rule-flow-box h3 {
    margin-top: 0;
    font-size: 1.3rem;
    color: #111827;
    margin-bottom: 1.5rem;
}

.flow-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1.8rem;
}

.flow-item {
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.8rem 1.2rem;
    text-align: center;
    flex: 1 1 140px;
    min-width: 140px;
    box-shadow: var(--shadow-sm);
}

.flow-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary-color);
    color: #fff;
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 0.4rem;
}

.flow-item p {
    font-size: 0.9rem;
    color: var(--text-main);
    margin: 0;
}

.flow-arrow {
    font-size: 1.5rem;
    color: var(--primary-color);
    font-weight: bold;
    flex-shrink: 0;
}

/* ===== 创意版块：策略组卡片 ===== */
.strategy-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin: 2.5rem 0;
}

.strategy-card {
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.8rem 1.5rem;
    text-align: center;
    transition: box-shadow var(--transition-base), transform var(--transition-base);
    box-shadow: var(--shadow-sm);
}

.strategy-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-3px);
}

.strategy-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.strategy-card h4 {
    font-size: 1.1rem;
    color: #111827;
    margin-bottom: 0.5rem;
}

.strategy-card p {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin: 0;
}

/* ===== 创意版块：配置检查清单 ===== */
.checklist {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: var(--radius-lg);
    padding: 1.8rem;
    margin: 2.5rem 0;
}

.checklist h3 {
    margin-top: 0;
    color: #166534;
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.checklist ul {
    list-style: none;
    padding-left: 0;
}

.checklist li {
    padding: 0.3rem 0;
    font-size: 1rem;
    color: #14532d;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.checklist li::before {
    content: "✓";
    font-weight: bold;
    color: #16a34a;
}

/* ===== 页脚（与首页完全一致） ===== */
footer {
    background-color: #111827;
    color: #9ca3af;
    padding: 4rem 2rem 2rem;
    font-size: 0.93rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2.5rem;
    border-bottom: 1px solid #374151;
    padding-bottom: 2rem;
}

.footer-section h4 {
    color: var(--white);
    margin-bottom: 1rem;
    font-size: 1rem;
}

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

.footer-section ul li {
    margin-bottom: 0.55rem;
}

.footer-section a {
    color: #9ca3af;
    text-decoration: none;
    transition: color var(--transition-base);
}

.footer-section a:hover {
    color: var(--white);
}

.footer-bottom {
    max-width: 1200px;
    margin: 2rem auto 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.85rem;
    color: #6b7280;
}

/* ===== 响应式 ===== */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        gap: 0.8rem;
        padding: 1rem;
    }

    .nav-right {
        flex-direction: column;
        gap: 0.8rem;
        width: 100%;
        align-items: center;
    }

    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
    }

    .nav-links a {
        margin: 0;
        padding: 0.35rem 0.65rem;
        font-size: 0.9rem;
    }

    .guide-container {
        padding: 3rem 1.2rem 4rem;
    }

    .article-header h1 {
        font-size: 1.7rem;
    }

    .flow-steps {
        flex-direction: column;
    }

    .flow-arrow {
        transform: rotate(90deg);
    }

    .strategy-cards {
        grid-template-columns: 1fr;
    }

    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .guide-content pre {
        padding: 1rem;
        font-size: 0.8rem;
    }

    .rule-flow-box {
        padding: 1.2rem;
    }
}