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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", sans-serif;
    background: #f8f9fa;
    color: #222;
    line-height: 1.7;
    transition: background 0.3s, color 0.3s;
}

a {
    color: #2a2a72;
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    text-decoration: underline;
    color: #1e1e5a;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ===== 导航 ===== */
nav {
    background: #2a2a72;
    color: #fff;
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

nav .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    padding: 12px 20px;
}

nav .logo {
    font-size: 1.6rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: 1px;
    background: linear-gradient(135deg, #ffd700, #ffaa00);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

nav .nav-links {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
}

nav .nav-links a {
    color: #e0e0ff;
    font-size: 0.95rem;
    padding: 6px 0;
    border-bottom: 2px solid transparent;
    transition: border-color 0.2s, color 0.2s;
}

nav .nav-links a:hover {
    border-bottom-color: #ffd700;
    color: #ffd700;
    text-decoration: none;
}

.menu-toggle {
    display: none;
    background: none;
    border: 2px solid #fff;
    color: #fff;
    font-size: 1.2rem;
    padding: 4px 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
}

.menu-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
}

@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }

    nav .nav-links {
        display: none;
        width: 100%;
        flex-direction: column;
        gap: 8px;
        padding: 12px 0 0;
    }

    nav .nav-links.open {
        display: flex;
    }
}

/* ===== 返回顶部 ===== */
.back-top {
    position: fixed;
    bottom: 40px;
    right: 40px;
    background: #2a2a72;
    color: #fff;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s, transform 0.3s;
    z-index: 999;
    border: none;
}

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

.back-top:hover {
    background: #1e1e5a;
    transform: scale(1.1);
}

/* ===== Banner 轮播 ===== */
.banner {
    position: relative;
    overflow: hidden;
    height: 420px;
    background: #1a1a3e;
    color: #fff;
}

.banner::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(42, 42, 114, 0.8), rgba(26, 26, 62, 0.9));
    z-index: 1;
}

.banner-slide {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.8s ease;
    padding: 40px 20px;
    text-align: center;
    z-index: 2;
}

.banner-slide.active {
    opacity: 1;
}

.banner-slide h1 {
    font-size: 2.8rem;
    margin-bottom: 16px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    background: linear-gradient(135deg, #fff, #ffd700);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.banner-slide p {
    font-size: 1.2rem;
    max-width: 700px;
    margin: 0 auto;
    opacity: 0.9;
}

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

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

.banner-dots span.active {
    background: #ffd700;
    transform: scale(1.2);
}

.banner-dots span:hover {
    background: rgba(255, 215, 0, 0.7);
}

/* ===== 通用标题 ===== */
.section-title {
    font-size: 2rem;
    margin-bottom: 12px;
    color: #2a2a72;
    text-align: center;
    position: relative;
    display: inline-block;
    left: 50%;
    transform: translateX(-50%);
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, #2a2a72, #ffd700);
    margin: 8px auto 0;
    border-radius: 2px;
}

.section-sub {
    text-align: center;
    color: #555;
    margin-bottom: 40px;
    font-size: 1.05rem;
}

/* ===== 卡片网格 ===== */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    margin: 30px 0;
}

.card {
    background: #fff;
    border-radius: 12px;
    padding: 28px 20px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    transition: transform 0.25s, box-shadow 0.25s;
    border: 1px solid #eee;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.card h3 {
    color: #2a2a72;
    margin-bottom: 10px;
    font-size: 1.2rem;
}

.card p {
    color: #444;
    font-size: 0.95rem;
}

/* ===== FAQ ===== */
.faq-item {
    border-bottom: 1px solid #e0e0e0;
    padding: 16px 0;
    transition: background 0.2s;
}

.faq-item:hover {
    background: rgba(42, 42, 114, 0.02);
}

.faq-question {
    font-weight: 600;
    font-size: 1.05rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #2a2a72;
    padding: 4px 0;
    user-select: none;
}

.faq-question::after {
    content: "+";
    font-size: 1.4rem;
    transition: transform 0.3s;
}

.faq-item.open .faq-question::after {
    content: "−";
    transform: rotate(180deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, padding 0.4s ease;
    color: #444;
    padding: 0 0 0 8px;
    line-height: 1.7;
}

.faq-item.open .faq-answer {
    max-height: 400px;
    padding: 12px 0 8px 8px;
}

/* ===== HowTo ===== */
.howto-step {
    background: #fff;
    border-left: 5px solid #2a2a72;
    padding: 16px 20px;
    margin-bottom: 16px;
    border-radius: 0 8px 8px 0;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s, box-shadow 0.2s;
}

.howto-step:hover {
    transform: translateX(4px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.howto-step strong {
    color: #2a2a72;
}

/* ===== 文章 ===== */
.article-item {
    background: #fff;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 16px;
    border: 1px solid #eee;
    transition: background 0.2s, transform 0.2s;
}

.article-item:hover {
    background: #f5f5ff;
    transform: translateY(-2px);
}

.article-item h4 {
    color: #2a2a72;
    margin-bottom: 6px;
}

.article-item .meta {
    font-size: 0.85rem;
    color: #888;
    margin-bottom: 6px;
}

.article-item p {
    color: #444;
    font-size: 0.93rem;
}

.article-item .read-more {
    color: #2a2a72;
    font-weight: 600;
    display: inline-block;
    margin-top: 6px;
    transition: color 0.2s, transform 0.2s;
}

.article-item .read-more:hover {
    color: #ffd700;
    transform: translateX(4px);
    text-decoration: none;
}

/* ===== 页脚 ===== */
footer {
    background: #1a1a3e;
    color: #ccc;
    padding: 40px 0 20px;
    margin-top: 60px;
}

footer .container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 30px;
}

footer h4 {
    color: #ffd700;
    margin-bottom: 12px;
    font-size: 1.1rem;
    position: relative;
    display: inline-block;
}

footer h4::after {
    content: '';
    display: block;
    width: 30px;
    height: 2px;
    background: #ffd700;
    margin-top: 4px;
}

footer a {
    color: #bbb;
    display: block;
    margin-bottom: 6px;
    font-size: 0.9rem;
    transition: color 0.2s, padding-left 0.2s;
}

footer a:hover {
    color: #ffd700;
    padding-left: 4px;
    text-decoration: none;
}

footer .copyright {
    grid-column: 1 / -1;
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #333;
    margin-top: 20px;
    font-size: 0.85rem;
}

/* ===== 信息网格 ===== */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
    background: #fff;
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.2s;
}

.info-grid:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.info-grid div {
    font-size: 0.95rem;
}

.info-grid strong {
    color: #2a2a72;
}

/* ===== 暗黑模式 ===== */
.dark-mode {
    background: #222;
    color: #eee;
}

.dark-mode .card {
    background: #2c2c2c;
    border-color: #444;
    color: #ddd;
}

.dark-mode .card h3 {
    color: #aaccff;
}

.dark-mode .section-title {
    color: #aaccff;
}

.dark-mode .section-sub {
    color: #aaa;
}

.dark-mode .faq-question {
    color: #aaccff;
}

.dark-mode .faq-answer {
    color: #ccc;
}

.dark-mode .article-item {
    background: #2c2c2c;
    border-color: #444;
}

.dark-mode .article-item h4 {
    color: #aaccff;
}

.dark-mode .article-item p {
    color: #bbb;
}

.dark-mode .article-item:hover {
    background: #333;
}

.dark-mode .info-grid {
    background: #2c2c2c;
    color: #ddd;
}

.dark-mode .howto-step {
    background: #2c2c2c;
    border-left-color: #aaccff;
}

.dark-mode footer {
    background: #111;
}

.dark-mode .banner {
    background: #0d0d2b;
}

.dark-mode .faq-item:hover {
    background: rgba(170, 204, 255, 0.05);
}

.dark-mode .info-grid strong {
    color: #aaccff;
}

/* ===== 辅助类 ===== */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* ===== 搜索框 ===== */
.search-box {
    display: flex;
    gap: 4px;
    margin: 20px 0;
}

.search-box input {
    flex: 1;
    padding: 10px 14px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.search-box input:focus {
    border-color: #2a2a72;
    box-shadow: 0 0 0 3px rgba(42, 42, 114, 0.1);
}

.search-box button {
    background: #2a2a72;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s, transform 0.2s;
}

.search-box button:hover {
    background: #1e1e5a;
    transform: scale(1.02);
}

.dark-mode .search-box input {
    background: #333;
    color: #eee;
    border-color: #555;
}

.dark-mode .search-box input:focus {
    border-color: #aaccff;
    box-shadow: 0 0 0 3px rgba(170, 204, 255, 0.2);
}

/* ===== 滚动动画 ===== */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ===== 数字高亮 ===== */
.num-highlight {
    font-size: 2.2rem;
    font-weight: 700;
    color: #ffd700;
    display: inline-block;
}

/* ===== SVG 图标 ===== */
svg.icon {
    width: 48px;
    height: 48px;
    fill: #2a2a72;
    margin-bottom: 10px;
    transition: fill 0.3s, transform 0.3s;
}

.card:hover svg.icon {
    fill: #ffd700;
    transform: scale(1.1);
}

.dark-mode svg.icon {
    fill: #aaccff;
}

.dark-mode .card:hover svg.icon {
    fill: #ffd700;
}

/* ===== 弹性居中 ===== */
.flex-center {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    justify-content: center;
    align-items: center;
}

/* ===== 徽章 ===== */
.badge {
    background: #2a2a72;
    color: #fff;
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    display: inline-block;
    margin: 4px;
    transition: background 0.2s, transform 0.2s;
}

.badge:hover {
    background: #1e1e5a;
    transform: scale(1.05);
}

/* ===== 分割线 ===== */
hr {
    margin: 40px 0;
    border: 0;
    border-top: 1px solid #ddd;
}

.dark-mode hr {
    border-color: #444;
}

/* ===== 响应式微调 ===== */
@media (max-width: 768px) {
    .banner {
        height: 300px;
    }

    .banner-slide h1 {
        font-size: 1.8rem;
    }

    .banner-slide p {
        font-size: 1rem;
    }

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

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

    footer .container {
        grid-template-columns: 1fr 1fr;
    }

    .back-top {
        bottom: 20px;
        right: 20px;
        width: 40px;
        height: 40px;
        font-size: 1.4rem;
    }
}

@media (max-width: 480px) {
    .banner {
        height: 250px;
    }

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

    .banner-slide p {
        font-size: 0.9rem;
    }

    footer .container {
        grid-template-columns: 1fr;
    }
}