:root {
    --primary-color: #0f766e;
    --primary-hover: #0d6b63;
    --primary-light: #ccfbf1;
    --primary-soft: #f0fdfa;
    --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);
    --shadow-glow: 0 4px 14px rgba(15, 118, 110, 0.4);
    --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: var(--primary-soft);
}

.github-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background-color: #1e293b;
    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: #0f172a;
}

/* ===== Hero ===== */
.hero {
    max-width: 1200px;
    margin: 0 auto;
    padding: 5rem 2rem 4rem;
    text-align: center;
}

.hero-badge {
    display: inline-block;
    background: var(--primary-soft);
    color: var(--primary-color);
    padding: 0.3rem 1.2rem;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 1.8rem;
    border: 1px solid var(--primary-light);
}

.hero h1 {
    font-size: clamp(2rem, 4vw, 2.8rem);
    margin-bottom: 1rem;
    color: #0c4a6e;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.hero-sub {
    font-size: 1.15rem;
    color: var(--text-muted);
    max-width: 780px;
    margin: 0 auto 2.5rem;
}

.hero-sub strong {
    color: var(--primary-color);
    font-weight: 600;
}

.hero-stats-row {
    display: flex;
    justify-content: center;
    gap: 3rem;
    flex-wrap: wrap;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.stat-item {
    text-align: center;
}

.stat-num {
    display: block;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1.2;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* ===== 通用 Section ===== */
section {
    padding: 5rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.bg-alt {
    background-color: var(--bg-light);
    max-width: 100%;
}

.bg-alt .section-inner {
    max-width: 1200px;
    margin: 0 auto;
}

/* ===== FAQ 容器 ===== */
.faq-container {
    max-width: 900px;
    margin: 0 auto;
}

/* 分类筛选栏 - 纯 CSS 实现（默认全显示） */
.faq-filter {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 2.5rem;
}

.faq-filter input[type="radio"] {
    display: none;
}

.faq-filter label {
    display: inline-block;
    padding: 0.5rem 1.2rem;
    border-radius: 50px;
    border: 1px solid var(--border-color);
    background: var(--white);
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-base);
}

.faq-filter input[type="radio"]:checked + label {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
    box-shadow: var(--shadow-glow);
}

/* 问题网格 */
.faq-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

/* 核心修复：默认全部可见，分类选中时才隐藏非目标卡片 */
.faq-card {
    display: block;
}

/* 启动异常筛选 */
#cat-startup:checked ~ .faq-grid .faq-card:not(.cat-startup) {
    display: none;
}

/* 订阅更新筛选 */
#cat-sub:checked ~ .faq-grid .faq-card:not(.cat-sub) {
    display: none;
}

/* 规则分流筛选 */
#cat-rule:checked ~ .faq-grid .faq-card:not(.cat-rule) {
    display: none;
}

/* DNS 泄露筛选 */
#cat-dns:checked ~ .faq-grid .faq-card:not(.cat-dns) {
    display: none;
}

/* 问题卡片样式 */
.faq-item {
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: box-shadow var(--transition-base);
}

.faq-item[open] {
    box-shadow: var(--shadow-md);
}

.faq-item summary {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 1.2rem 1.5rem;
    cursor: pointer;
    list-style: none;
    font-weight: 600;
    color: #0c4a6e;
    transition: background var(--transition-base);
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-item summary:hover {
    background: var(--primary-soft);
}

.faq-icon {
    font-size: 1.3rem;
    flex-shrink: 0;
}

.faq-question {
    flex: 1;
    font-size: 1.02rem;
}

.faq-arrow {
    flex-shrink: 0;
    color: var(--primary-color);
    transition: transform var(--transition-base);
}

.faq-item[open] .faq-arrow {
    transform: rotate(180deg);
}

.faq-answer {
    padding: 0 1.5rem 1.5rem;
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.8;
}

.faq-answer p {
    margin-bottom: 0.8rem;
}

.faq-answer code {
    background: #f1f5f9;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-size: 0.85rem;
    color: #b91c1c;
}

.faq-answer a {
    color: var(--primary-color);
    font-weight: 500;
}

/* 联系横幅 */
.help-banner {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
    background: var(--primary-soft);
    border: 1px solid var(--primary-light);
    border-radius: var(--radius-lg);
    padding: 2rem;
    max-width: 800px;
    margin: 0 auto;
}

.help-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.help-text h4 {
    font-size: 1.1rem;
    color: #0c4a6e;
    margin-bottom: 0.5rem;
}

.help-text p {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.7;
}

/* ===== Footer ===== */
footer {
    background-color: #0f172a;
    color: #94a3b8;
    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 #334155;
    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: #94a3b8;
    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: #64748b;
}

/* ===== 响应式 ===== */
@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;
    }

    .hero h1 {
        font-size: 1.8rem;
    }

    .hero-sub {
        font-size: 1rem;
    }

    .hero-stats-row {
        gap: 1.5rem;
    }

    .stat-num {
        font-size: 1.4rem;
    }

    .faq-filter {
        gap: 0.4rem;
    }

    .faq-filter label {
        padding: 0.4rem 0.9rem;
        font-size: 0.85rem;
    }

    .help-banner {
        flex-direction: column;
        text-align: center;
    }

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

    section {
        padding: 3rem 1.2rem;
    }
}

@media (max-width: 480px) {
    .hero {
        padding: 3rem 1rem 2rem;
    }

    .faq-item summary {
        padding: 1rem;
    }

    .faq-answer {
        padding: 0 1rem 1rem;
    }
}