/* ===== 重置与基础 ===== */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
    transition: background 0.3s ease, color 0.3s ease;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.3s ease, opacity 0.3s ease;
}

a:hover {
    opacity: 0.8;
    color: var(--secondary);
}

img,
svg {
    max-width: 100%;
    height: auto;
    display: block;
}

ul {
    list-style: none;
}

/* ===== CSS 变量 (主题) ===== */
:root {
    --primary: #2c3e50;
    --secondary: #e74c3c;
    --accent: #3498db;
    --bg: #f8f9fa;
    --text: #222222;
    --light: #ffffff;
    --gray: #6c757d;
    --border: #dee2e6;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 8px 25px rgba(0, 0, 0, 0.12);
    --radius: 12px;
    --transition: 0.3s ease;
    --glass-bg: rgba(255, 255, 255, 0.6);
    --glass-border: rgba(255, 255, 255, 0.2);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

/* ===== 暗色模式 ===== */
body.dark {
    --primary: #0f3460;
    --secondary: #e74c3c;
    --accent: #5dade2;
    --bg: #1a1a2e;
    --text: #eaeaea;
    --light: #16213e;
    --gray: #a0a0b0;
    --border: #2a2a4a;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
    --shadow-hover: 0 8px 25px rgba(0, 0, 0, 0.5);
    --glass-bg: rgba(22, 33, 62, 0.6);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

body.dark .header {
    background: #0f3460;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}

body.dark .card,
body.dark .faq-item,
body.dark .article-item {
    background: #1a1a2e;
    border-color: #2a2a4a;
}

body.dark .banner {
    background: linear-gradient(135deg, #0f3460, #1a1a2e);
}

body.dark .footer {
    background: #0a0a1a;
}

body.dark .search-box input {
    background: #1a1a2e;
    color: #eaeaea;
    border-color: #2a2a4a;
}

body.dark .search-box input:focus {
    border-color: var(--accent);
}

/* ===== 容器 & 布局 ===== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ===== 导航栏 ===== */
.header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--light);
    box-shadow: var(--shadow);
    transition: background 0.3s ease, box-shadow 0.3s ease;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    background: var(--glass-bg);
    border-bottom: 1px solid var(--glass-border);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    transition: color 0.3s ease;
}

.logo svg {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
}

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

.nav a {
    color: var(--text);
    font-weight: 500;
    font-size: 0.95rem;
    position: relative;
    padding: 4px 0;
    transition: color 0.3s ease;
}

.nav a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--secondary);
    transition: width 0.3s ease;
    border-radius: 2px;
}

.nav a:hover::after {
    width: 100%;
}

.nav a:hover {
    color: var(--secondary);
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.8rem;
    cursor: pointer;
    color: var(--primary);
    transition: color 0.3s ease;
    padding: 4px;
}

.menu-toggle:hover {
    color: var(--secondary);
}

.mobile-menu {
    display: none;
    flex-direction: column;
    background: var(--light);
    padding: 20px;
    gap: 16px;
    border-top: 1px solid var(--border);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    background: var(--glass-bg);
}

.mobile-menu a {
    font-size: 1rem;
    padding: 8px 0;
    color: var(--text);
    font-weight: 500;
    transition: color 0.3s ease, padding-left 0.3s ease;
    border-radius: 6px;
}

.mobile-menu a:hover {
    color: var(--secondary);
    padding-left: 8px;
    background: rgba(231, 76, 60, 0.05);
}

@media (max-width: 768px) {
    .nav {
        display: none;
    }
    .menu-toggle {
        display: block;
    }
    .mobile-menu.open {
        display: flex;
    }
}

/* ===== 搜索框 ===== */
.search-box {
    display: flex;
    gap: 8px;
    align-items: center;
}

.search-box input {
    padding: 8px 14px;
    border: 1px solid var(--border);
    border-radius: 30px;
    font-size: 0.9rem;
    outline: none;
    width: 200px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
    background: var(--light);
    color: var(--text);
}

.search-box input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.15);
}

.search-box button {
    background: var(--primary);
    color: var(--light);
    border: none;
    padding: 8px 16px;
    border-radius: 30px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.3s ease, transform 0.2s ease;
    font-weight: 500;
}

.search-box button:hover {
    background: var(--secondary);
    transform: scale(1.02);
}

.search-box button:active {
    transform: scale(0.97);
}

@media (max-width: 768px) {
    .search-box input {
        width: 120px;
    }
}

/* ===== 暗色模式切换按钮 ===== */
.dark-mode-toggle {
    background: none;
    border: none;
    font-size: 1.4rem;
    cursor: pointer;
    color: var(--primary);
    padding: 4px;
    transition: color 0.3s ease, transform 0.3s ease;
    line-height: 1;
}

.dark-mode-toggle:hover {
    color: var(--secondary);
    transform: rotate(15deg);
}

/* ===== 面包屑 ===== */
.breadcrumb {
    padding: 16px 0;
    font-size: 0.9rem;
    color: var(--gray);
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.breadcrumb a {
    color: var(--accent);
    transition: color 0.3s ease;
}

.breadcrumb a:hover {
    color: var(--secondary);
}

.breadcrumb span {
    color: var(--gray);
}

/* ===== Banner 轮播 ===== */
.banner {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius);
    margin: 20px 0;
    background: linear-gradient(135deg, #2c3e50, #34495e, #1a252f);
    color: var(--light);
    min-height: 360px;
    display: flex;
    align-items: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
    transition: box-shadow 0.3s ease;
}

.banner:hover {
    box-shadow: 0 6px 30px rgba(0, 0, 0, 0.18);
}

.banner-slide {
    display: none;
    padding: 40px;
    width: 100%;
    animation: fadeInUp 0.6s ease forwards;
}

.banner-slide.active {
    display: block;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.banner h1 {
    font-size: 2.4rem;
    margin-bottom: 16px;
    line-height: 1.3;
    font-weight: 800;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.banner p {
    font-size: 1.1rem;
    max-width: 600px;
    opacity: 0.9;
    line-height: 1.7;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

.banner .btn {
    display: inline-block;
    margin-top: 20px;
    padding: 12px 28px;
    background: var(--secondary);
    color: var(--light);
    border-radius: 30px;
    font-weight: 600;
    transition: background 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.3);
}

.banner .btn:hover {
    background: #c0392b;
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(231, 76, 60, 0.4);
}

.banner .btn:active {
    transform: translateY(0);
}

.banner-dots {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
}

.banner-dots span {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    transition: background 0.3s ease, transform 0.3s ease;
}

.banner-dots span.active {
    background: var(--light);
    transform: scale(1.3);
}

.banner-dots span:hover {
    background: rgba(255, 255, 255, 0.8);
    transform: scale(1.2);
}

@media (max-width: 768px) {
    .banner {
        min-height: 280px;
    }
    .banner h1 {
        font-size: 1.6rem;
    }
    .banner p {
        font-size: 0.95rem;
    }
    .banner-slide {
        padding: 24px;
    }
}

/* ===== 通用区块 ===== */
.section {
    padding: 50px 0;
}

.section-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 30px;
    text-align: center;
    position: relative;
    transition: color 0.3s ease;
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: var(--secondary);
    margin: 12px auto 0;
    border-radius: 2px;
    transition: width 0.3s ease;
}

.section-title:hover::after {
    width: 80px;
}

/* ===== 网格布局 ===== */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

@media (max-width: 768px) {
    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

/* ===== 卡片 ===== */
.card {
    background: var(--light);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
    border: 1px solid transparent;
}

.card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-hover);
    border-color: rgba(52, 152, 219, 0.15);
}

.card h3 {
    font-size: 1.2rem;
    margin-bottom: 12px;
    color: var(--primary);
    transition: color 0.3s ease;
}

.card:hover h3 {
    color: var(--secondary);
}

.card p {
    color: var(--gray);
    font-size: 0.95rem;
    line-height: 1.7;
}

.card svg {
    margin-bottom: 16px;
    width: 48px;
    height: 48px;
    transition: transform 0.3s ease;
}

.card:hover svg {
    transform: scale(1.1);
}

/* ===== 毛玻璃卡片 (用于特殊强调) ===== */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--glass-shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.glass-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

/* ===== 文章列表 ===== */
.article-item {
    display: flex;
    gap: 20px;
    padding: 20px 0;
    border-bottom: 1px solid var(--border);
    transition: background 0.3s ease, padding-left 0.3s ease;
    border-radius: 8px;
}

.article-item:last-child {
    border-bottom: none;
}

.article-item:hover {
    background: rgba(52, 152, 219, 0.03);
    padding-left: 8px;
}

.article-info {
    flex: 1;
}

.article-info h3 {
    font-size: 1.1rem;
    margin-bottom: 6px;
    color: var(--primary);
    transition: color 0.3s ease;
}

.article-item:hover .article-info h3 {
    color: var(--secondary);
}

.article-info .meta {
    font-size: 0.85rem;
    color: var(--gray);
    margin-bottom: 8px;
    display: flex;
    gap: 12px;
    align-items: center;
}

.article-info p {
    color: #444;
    line-height: 1.6;
}

body.dark .article-info p {
    color: #b0b0c0;
}

.article-info .read-more {
    display: inline-block;
    margin-top: 8px;
    color: var(--secondary);
    font-weight: 600;
    transition: gap 0.3s ease, color 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.article-info .read-more:hover {
    gap: 8px;
    color: #c0392b;
}

.article-thumb svg {
    width: 120px;
    height: 80px;
    border-radius: 8px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.article-item:hover .article-thumb svg {
    transform: scale(1.03);
}

@media (max-width: 768px) {
    .article-item {
        flex-direction: column;
        gap: 12px;
    }
    .article-thumb svg {
        width: 100%;
        height: auto;
        max-height: 160px;
    }
}

/* ===== FAQ ===== */
.faq-item {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 12px;
    overflow: hidden;
    background: var(--light);
    transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

.faq-item:hover {
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    border-color: var(--accent);
}

.faq-question {
    padding: 16px 20px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.3s ease, color 0.3s ease;
    user-select: none;
    color: var(--text);
}

.faq-question:hover {
    background: #f1f3f5;
    color: var(--primary);
}

body.dark .faq-question:hover {
    background: rgba(255, 255, 255, 0.05);
}

.faq-question .icon {
    font-size: 1.2rem;
    transition: transform 0.3s ease, color 0.3s ease;
    color: var(--gray);
    flex-shrink: 0;
    margin-left: 12px;
}

.faq-item:hover .faq-question .icon {
    color: var(--secondary);
}

.faq-answer {
    padding: 0 20px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, padding 0.3s ease;
    color: var(--gray);
    line-height: 1.7;
}

.faq-answer.open {
    max-height: 600px;
    padding: 0 20px 20px;
}

/* ===== HowTo 教程 ===== */
.howto-step {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
    align-items: flex-start;
    transition: transform 0.3s ease;
}

.howto-step:hover {
    transform: translateX(4px);
}

.howto-step .step-num {
    background: var(--primary);
    color: var(--light);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
    transition: background 0.3s ease, transform 0.3s ease;
}

.howto-step:hover .step-num {
    background: var(--secondary);
    transform: scale(1.1);
}

.howto-step .step-content {
    flex: 1;
}

.howto-step .step-content h4 {
    font-size: 1.05rem;
    margin-bottom: 4px;
    color: var(--primary);
    transition: color 0.3s ease;
}

.howto-step:hover .step-content h4 {
    color: var(--secondary);
}

/* ===== 统计数据 ===== */
.stat-item {
    text-align: center;
    padding: 20px;
    background: var(--light);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.stat-number {
    font-size: 2.8rem;
    font-weight: 800;
    color: var(--secondary);
    line-height: 1.2;
    transition: color 0.3s ease;
}

.stat-item:hover .stat-number {
    color: var(--primary);
}

.stat-label {
    font-size: 1rem;
    color: var(--gray);
    margin-top: 4px;
}

/* ===== 页脚 ===== */
.footer {
    background: var(--primary);
    color: rgba(255, 255, 255, 0.85);
    padding: 40px 0 20px;
    margin-top: 50px;
    transition: background 0.3s ease;
}

.footer a {
    color: rgba(255, 255, 255, 0.8);
    transition: color 0.3s ease, padding-left 0.3s ease;
}

.footer a:hover {
    color: var(--light);
    padding-left: 4px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
    margin-bottom: 30px;
}

.footer h4 {
    font-size: 1.1rem;
    margin-bottom: 16px;
    color: var(--light);
    position: relative;
    display: inline-block;
}

.footer h4::after {
    content: '';
    display: block;
    width: 30px;
    height: 2px;
    background: var(--secondary);
    margin-top: 6px;
    border-radius: 2px;
}

.footer ul {
    list-style: none;
}

.footer ul li {
    margin-bottom: 8px;
    font-size: 0.9rem;
    transition: padding-left 0.3s ease;
}

.footer ul li:hover {
    padding-left: 4px;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding-top: 20px;
    text-align: center;
    font-size: 0.85rem;
    line-height: 1.8;
}

.footer-bottom p {
    margin: 4px 0;
}

@media (max-width: 768px) {
    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 24px;
    }
}

@media (max-width: 480px) {
    .footer-grid {
        grid-template-columns: 1fr;
    }
}

/* ===== 返回顶部 ===== */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: var(--primary);
    color: var(--light);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: opacity 0.3s ease, visibility 0.3s ease, background 0.3s ease, transform 0.3s ease;
    opacity: 0;
    visibility: hidden;
    z-index: 999;
    border: none;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    background: rgba(44, 62, 80, 0.9);
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: var(--secondary);
    transform: scale(1.1) translateY(-2px);
    box-shadow: 0 6px 16px rgba(231, 76, 60, 0.4);
}

.back-to-top:active {
    transform: scale(0.95);
}

/* ===== 滚动动画 ===== */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ===== 响应式微调 ===== */
@media (max-width: 480px) {
    .container {
        padding: 0 12px;
    }

    .section {
        padding: 30px 0;
    }

    .section-title {
        font-size: 1.5rem;
    }

    .banner h1 {
        font-size: 1.4rem;
    }

    .stat-number {
        font-size: 2rem;
    }

    .card {
        padding: 18px;
    }
}

/* ===== 打印样式 ===== */
@media print {
    .header,
    .footer,
    .back-to-top,
    .banner-dots,
    .menu-toggle,
    .dark-mode-toggle,
    .search-box {
        display: none !important;
    }

    body {
        background: white;
        color: black;
    }

    .card,
    .faq-item,
    .article-item {
        box-shadow: none;
        border: 1px solid #ddd;
        break-inside: avoid;
    }
}