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

html {
    scroll-behavior: smooth;
}

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

body.dark {
    background: #121212;
    color: #e0e0e0;
}

a {
    color: #0056b3;
    text-decoration: none;
    transition: color 0.3s;
}

body.dark a {
    color: #64b5f6;
}

a:hover {
    color: #003d82;
}

body.dark a:hover {
    color: #90caf9;
}

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

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

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

.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }

/* ===== 按钮 ===== */
.btn {
    display: inline-block;
    padding: 12px 28px;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    text-align: center;
}

.btn-primary {
    background: #0056b3;
    color: #fff;
}

.btn-primary:hover {
    background: #003d82;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 86, 179, 0.3);
}

body.dark .btn-primary {
    background: #64b5f6;
    color: #121212;
}

body.dark .btn-primary:hover {
    background: #42a5f5;
    box-shadow: 0 6px 20px rgba(100, 181, 246, 0.3);
}

/* ===== 卡片 ===== */
.card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    padding: 24px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

body.dark .card {
    background: #1e1e1e;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

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

body.dark .card:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

/* ===== 区块 ===== */
.section {
    padding: 80px 0;
}

.section-title {
    font-size: 2rem;
    margin-bottom: 12px;
    text-align: center;
    font-weight: 700;
}

.section-subtitle {
    font-size: 1.1rem;
    color: #666;
    text-align: center;
    margin-bottom: 48px;
}

body.dark .section-subtitle {
    color: #aaa;
}

/* ===== 网格 ===== */
.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 24px;
}

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

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

/* ===== 头部导航 ===== */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: #fff;
    border-bottom: 1px solid #eaeaea;
    transition: background 0.3s, box-shadow 0.3s;
}

body.dark .site-header {
    background: #1e1e1e;
    border-bottom-color: #333;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo-icon {
    font-size: 2rem;
    line-height: 1;
}

.logo-text {
    font-weight: 700;
    font-size: 1.3rem;
    color: #1a1a2e;
}

body.dark .logo-text {
    color: #e0e0e0;
}

/* ===== 导航 ===== */
#nav-list {
    display: flex;
    list-style: none;
    gap: 24px;
    align-items: center;
}

#nav-list a {
    color: #333;
    font-weight: 500;
    position: relative;
    padding-bottom: 4px;
}

body.dark #nav-list a {
    color: #ccc;
}

#nav-list a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: #0056b3;
    transition: width 0.3s ease;
}

body.dark #nav-list a::after {
    background: #64b5f6;
}

#nav-list a:hover::after {
    width: 100%;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 4px;
    color: #333;
}

body.dark .mobile-menu-btn {
    color: #e0e0e0;
}

#dark-mode-toggle {
    background: none;
    border: none;
    font-size: 1.3rem;
    cursor: pointer;
    padding: 4px;
    transition: transform 0.3s;
}

#dark-mode-toggle:hover {
    transform: scale(1.2);
}

/* ===== Hero 区域 ===== */
.hero {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    color: #fff;
    padding: 120px 0 80px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 50%, rgba(100, 181, 246, 0.1) 0%, transparent 60%);
    animation: heroGlow 10s ease-in-out infinite;
}

@keyframes heroGlow {
    0%, 100% { transform: translate(0, 0); opacity: 0.5; }
    50% { transform: translate(10%, 10%); opacity: 1; }
}

.hero .container {
    position: relative;
    z-index: 1;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 16px;
    line-height: 1.2;
}

.hero h1 span {
    color: #64b5f6;
}

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

.hero .btn-outline {
    display: inline-block;
    padding: 12px 28px;
    border-radius: 8px;
    font-weight: 600;
    border: 2px solid #fff;
    color: #fff;
    transition: all 0.3s;
}

.hero .btn-outline:hover {
    background: #fff;
    color: #1a1a2e;
    transform: translateY(-2px);
}

/* ===== 关于区域 ===== */
#about {
    background: #fff;
}

body.dark #about {
    background: #121212;
}

.about-card {
    background: #f0f4ff;
    border-radius: 16px;
    padding: 32px;
}

body.dark .about-card {
    background: #1e2a3a;
}

.about-card h3 {
    margin-bottom: 16px;
}

.about-card ul {
    list-style: none;
    padding: 0;
}

.about-card li {
    padding: 8px 0;
    border-bottom: 1px solid #ddd;
}

body.dark .about-card li {
    border-bottom-color: #444;
}

.about-card li:last-child {
    border-bottom: none;
}

/* ===== 服务区域 ===== */
#services {
    background: #f8f9fa;
}

body.dark #services {
    background: #1a1a1a;
}

.service-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
    display: block;
}

/* ===== 资讯区域 ===== */
#insights {
    background: #fff;
}

body.dark #insights {
    background: #121212;
}

.article-card time {
    font-size: 0.9rem;
    color: #888;
}

.article-card p {
    color: #555;
}

body.dark .article-card p {
    color: #aaa;
}

.article-card a {
    display: inline-block;
    margin-top: 12px;
    color: #0056b3;
    font-weight: 600;
    transition: color 0.3s;
}

body.dark .article-card a {
    color: #64b5f6;
}

.article-card a:hover {
    color: #003d82;
}

body.dark .article-card a:hover {
    color: #90caf9;
}

/* ===== How-to 区域 ===== */
#howto {
    background: #f8f9fa;
}

body.dark #howto {
    background: #1a1a1a;
}

.step-card {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    background: #fff;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
    transition: transform 0.3s, box-shadow 0.3s;
}

body.dark .step-card {
    background: #1e1e1e;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.step-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

body.dark .step-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.step-number {
    background: #0056b3;
    color: #fff;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
}

body.dark .step-number {
    background: #64b5f6;
    color: #121212;
}

/* ===== FAQ 区域 ===== */
#faq {
    background: #fff;
}

body.dark #faq {
    background: #121212;
}

.faq-item {
    margin-bottom: 12px;
    cursor: pointer;
    overflow: hidden;
}

.faq-question {
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    font-size: 1.1rem;
    font-weight: 600;
    padding: 12px 0;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: inherit;
    transition: color 0.3s;
}

.faq-question:hover {
    color: #0056b3;
}

body.dark .faq-question:hover {
    color: #64b5f6;
}

.faq-icon {
    transition: transform 0.3s;
    font-size: 0.9rem;
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
    padding: 0 12px;
}

.faq-answer.active {
    max-height: 300px;
    padding: 12px;
}

.faq-answer p {
    color: #555;
}

body.dark .faq-answer p {
    color: #aaa;
}

/* ===== 联系区域 ===== */
#contact {
    background: #f8f9fa;
}

body.dark #contact {
    background: #1a1a1a;
}

.contact-card {
    padding: 40px;
}

.contact-form label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    background: #fff;
    color: #222;
    transition: border-color 0.3s, box-shadow 0.3s;
}

body.dark .contact-form input,
body.dark .contact-form textarea {
    background: #2a2a2a;
    color: #e0e0e0;
    border-color: #444;
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: #0056b3;
    box-shadow: 0 0 0 3px rgba(0, 86, 179, 0.1);
}

body.dark .contact-form input:focus,
body.dark .contact-form textarea:focus {
    border-color: #64b5f6;
    box-shadow: 0 0 0 3px rgba(100, 181, 246, 0.1);
}

.contact-form textarea {
    resize: vertical;
}

.contact-form button {
    width: 100%;
}

/* ===== 页脚 ===== */
footer {
    background: #1a1a2e;
    color: #ccc;
    padding: 48px 0 24px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 32px;
    margin-bottom: 32px;
}

footer h3 {
    color: #fff;
    margin-bottom: 12px;
}

footer p {
    font-size: 0.95rem;
}

footer ul {
    list-style: none;
    padding: 0;
}

footer ul li {
    margin-bottom: 4px;
}

footer a {
    color: #aaa;
    transition: color 0.3s;
}

footer a:hover {
    color: #fff;
}

.footer-divider {
    border-top: 1px solid #333;
    padding-top: 24px;
    text-align: center;
    font-size: 0.9rem;
}

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

.footer-update {
    color: #888;
    margin-top: 8px;
}

/* ===== 返回顶部按钮 ===== */
#back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #0056b3;
    color: #fff;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    display: none;
    z-index: 999;
    transition: opacity 0.3s, transform 0.3s, background 0.3s;
}

body.dark #back-to-top {
    background: #64b5f6;
    color: #121212;
}

#back-to-top:hover {
    transform: scale(1.1);
    background: #003d82;
}

body.dark #back-to-top:hover {
    background: #42a5f5;
}

/* ===== 毛玻璃效果 ===== */
.glass {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

body.dark .glass {
    background: rgba(30, 30, 30, 0.6);
    border-color: rgba(255, 255, 255, 0.1);
}

/* ===== 响应式 ===== */
@media (max-width: 768px) {
    .section {
        padding: 48px 0;
    }

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

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

    .hero {
        padding: 80px 0 60px;
    }

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

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

    .mobile-menu-btn {
        display: block;
    }

    #nav-list {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 60px;
        left: 0;
        width: 100%;
        background: #fff;
        padding: 16px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        gap: 12px;
    }

    body.dark #nav-list {
        background: #1e1e1e;
    }

    #nav-list.open {
        display: flex;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }

    #back-to-top {
        bottom: 20px;
        right: 20px;
        width: 44px;
        height: 44px;
        font-size: 1.2rem;
    }
}

/* ===== 暗色模式额外调整 ===== */
body.dark .site-header.scrolled {
    background: rgba(30, 30, 30, 0.95);
    backdrop-filter: blur(10px);
}

body.dark .hero .btn-outline:hover {
    background: #64b5f6;
    color: #121212;
    border-color: #64b5f6;
}

/* ===== 滚动条美化 ===== */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

body.dark ::-webkit-scrollbar-track {
    background: #2a2a2a;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

body.dark ::-webkit-scrollbar-thumb {
    background: #555;
}

body.dark ::-webkit-scrollbar-thumb:hover {
    background: #777;
}

/* ===== 选中文本颜色 ===== */
::selection {
    background: #0056b3;
    color: #fff;
}

body.dark ::selection {
    background: #64b5f6;
    color: #121212;
}