/* =========================================
   1. 设计变量与基础设置
   ========================================= */
:root {
    /* 色板 */
    --color-dark-bg: #2D1438;
    --color-paper-bg: #F6F3F7;
    --color-text-main: #1F1523;
    --color-brand: #9E13DD;
    --color-accent: #6EEDA8;

    /* 组件变量 */
    --radius-card: 20px;
    --radius-btn: 12px;
    --card-shadow: 0 10px 28px -14px rgba(31, 21, 35, 0.3);
    
    /* 节奏与密度 */
    --section-y: clamp(2.5rem, 5vw, 4rem);
    --gap: clamp(0.75rem, 1.5vw, 1.25rem);
    --content-max: 1280px;
    
    /* 字体 */
    --font-title-weight: 800;
    --font-body-weight: 400;
}

*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    padding: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--color-text-main);
    background-color: var(--color-paper-bg);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

/* =========================================
   2. 排版系统
   ========================================= */
h1, h2, h3, h4, h5, h6 {
    font-weight: var(--font-title-weight);
    letter-spacing: -0.02em;
    line-height: 1.1;
    margin-top: 0;
    margin-bottom: 0.5em;
}

h1 {
    font-size: clamp(2.4rem, 6vw, 4.5rem);
}

h2 {
    font-size: clamp(1.6rem, 3vw, 2.4rem);
    margin-bottom: var(--gap);
}

h3 {
    font-size: clamp(1.2rem, 2vw, 1.5rem);
    margin-bottom: 0.75em;
}

p {
    margin-bottom: 1em;
    max-width: 38em;
}

a {
    color: var(--color-brand);
    text-decoration: none;
    transition: color 0.2s ease;
}

.dark-mode a {
    color: var(--color-accent);
}

a:hover {
    text-decoration: underline;
}

strong {
    font-weight: 700;
}

/* =========================================
   3. 布局容器
   ========================================= */
.container {
    width: 100%;
    max-width: var(--content-max);
    margin: 0 auto;
    padding: 0 var(--gap);
}

section {
    padding: var(--section-y) 0;
}

/* 区块背景控制 */
.section-dark {
    background-color: var(--color-dark-bg);
    color: var(--color-paper-bg);
}

.section-light {
    background-color: var(--color-paper-bg);
    color: var(--color-text-main);
}

/* 取色变量覆盖 */
.dark-mode {
    --text-primary: var(--color-paper-bg);
    --text-secondary: rgba(246, 243, 247, 0.7);
    --link-color: var(--color-accent);
    --highlight-color: var(--color-accent);
}

.light-mode {
    --text-primary: var(--color-text-main);
    --text-secondary: rgba(31, 21, 35, 0.7);
    --link-color: var(--color-brand);
    --highlight-color: var(--color-brand);
}

.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.link-color { color: var(--link-color); }
.highlight { color: var(--highlight-color); }

/* =========================================
   4. 通用组件
   ========================================= */
/* 眉标 */
.badge {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: 0.5em;
    padding: 0.25em 0.75em;
    border-radius: 50px;
}

/* 按钮 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5em;
    height: 48px;
    padding: 0 1.5em;
    font-size: 1rem;
    font-weight: 600;
    border-radius: var(--radius-btn);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
    text-decoration: none;
    border: none;
}

.btn-primary {
    background-color: var(--color-accent);
    color: var(--color-dark-bg);
}

.btn-primary:hover {
    background-color: #5be094;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(110, 237, 168, 0.4);
    text-decoration: none;
}

.btn-secondary {
    background-color: transparent;
    color: var(--color-text-main);
    border: 1px solid var(--color-text-main);
}

.dark-mode .btn-secondary {
    color: var(--color-paper-bg);
    border-color: var(--color-paper-bg);
}

.btn-secondary:hover {
    background-color: rgba(31, 21, 35, 0.05);
    transform: translateY(-2px);
    text-decoration: none;
}

.dark-mode .btn-secondary:hover {
    background-color: rgba(246, 243, 247, 0.1);
}

.btn svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* 卡片 */
.card {
    background-color: var(--color-paper-bg);
    border-radius: var(--radius-card);
    box-shadow: var(--card-shadow);
    padding: 1.5em;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.dark-mode .card {
    background-color: #3A1C48; /* 深色面上的浅色卡片 */
    box-shadow: none;
    border: 1px solid rgba(246, 243, 247, 0.1);
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 15px 32px -12px rgba(31, 21, 35, 0.4);
}

/* 表格 */
.table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius-card);
    border: 1px solid rgba(31, 21, 35, 0.1);
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.95rem;
}

th, td {
    padding: 1em;
    border-bottom: 1px solid rgba(31, 21, 35, 0.08);
}

th {
    background-color: rgba(31, 21, 35, 0.03);
    font-weight: 700;
}

.dark-mode th, .dark-mode td {
    border-bottom-color: rgba(246, 243, 247, 0.08);
}

.dark-mode th {
    background-color: rgba(246, 243, 247, 0.05);
}

/* FAQ Details */
details {
    background-color: var(--color-paper-bg);
    border-radius: var(--radius-card);
    margin-bottom: 0.75em;
    border: 1px solid rgba(31, 21, 35, 0.08);
    overflow: hidden;
}

.dark-mode details {
    background-color: #3A1C48;
    border-color: rgba(246, 243, 247, 0.1);
}

summary {
    padding: 1.25em 1.5em;
    cursor: pointer;
    font-weight: 600;
    list-style: none;
    position: relative;
    padding-left: 2.5em;
}

summary::-webkit-details-marker {
    display: none;
}

summary::before {
    content: "+";
    position: absolute;
    left: 1.5em;
    top: 50%;
    transform: translateY(-50%);
    color: var(--link-color);
    font-weight: 800;
    transition: transform 0.2s ease;
}

details[open] summary::before {
    content: "-";
}

details > div {
    padding: 0 1.5em 1.5em 1.5em;
    color: var(--text-secondary);
}

/* 焦点样式 */
:focus-visible {
    outline: 2px solid var(--link-color);
    outline-offset: 2px;
}

/* =========================================
   5. 页头与页脚
   ========================================= */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: rgba(246, 243, 247, 0.9);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(31, 21, 35, 0.05);
    padding: 0.75em 0;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5em;
    font-weight: 800;
    font-size: 1.25rem;
    color: var(--color-text-main);
    text-decoration: none;
}

.logo img {
    height: 32px;
    width: auto;
}

.nav-links {
    display: flex;
    gap: 1.5em;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-links a {
    color: var(--color-text-main);
    font-weight: 500;
    font-size: 0.95rem;
}

.nav-links a:hover, .nav-links a[aria-current="page"] {
    color: var(--color-brand);
    text-decoration: none;
}

.site-footer {
    background-color: var(--color-dark-bg);
    color: var(--color-paper-bg);
    padding: 3em 0;
    text-align: center;
}

.footer-inner p {
    margin-bottom: 0.5em;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 1.5em;
    margin-top: 1em;
    list-style: none;
    padding: 0;
}

.footer-links a {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.footer-links a:hover {
    color: var(--color-accent);
}

/* =========================================
   6. SVG 动效 (CSS Keyframes)
   ========================================= */
/* 描边绘制动画 */
.draw-path {
    pathLength: 1;
    stroke-dasharray: 1;
    stroke-dashoffset: 0;
    animation: drawDash 4s cubic-bezier(0.4, 0, 0.2, 1) infinite alternate;
}

@keyframes drawDash {
    0% { stroke-dashoffset: 1; }
    100% { stroke-dashoffset: 0; }
}

/* 星点明灭动画 */
.twinkle-star {
    animation: twinkleAnim 3s ease-in-out infinite alternate;
}

@keyframes twinkleAnim {
    0% { opacity: 0.2; }
    100% { opacity: 1; }
}

/* 消息气泡浮动 */
.float-bubble {
    animation: floatBubble 4s ease-in-out infinite alternate;
}

@keyframes floatBubble {
    0% { transform: translateY(0); }
    100% { transform: translateY(-6px); }
}

/* 通知卡片滑入后悬浮 */
.slide-in-card {
    animation: slideInCard 5s ease-in-out infinite alternate;
}

@keyframes slideInCard {
    0% { transform: translateX(-4px); opacity: 0.8; }
    100% { transform: translateX(0); opacity: 1; }
}

/* 减少动态效果媒体查询 */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    .draw-path { stroke-dashoffset: 0; }
    .twinkle-star { opacity: 1; }
    .float-bubble { transform: translateY(0); }
    .slide-in-card { transform: translateX(0); }
}

/* =========================================
   7. 首页特定布局微调
   ========================================= */
.hero-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--gap);
    align-items: center;
}

.timeline {
    position: relative;
    padding-left: 2em;
    border-left: 2px solid var(--color-brand);
}

.timeline-item {
    position: relative;
    margin-bottom: 2em;
}

.timeline-item::before {
    content: "";
    position: absolute;
    left: -2.55em;
    top: 0.5em;
    width: 12px;
    height: 12px;
    background-color: var(--color-accent);
    border-radius: 50%;
    border: 2px solid var(--color-paper-bg);
}

.dark-mode .timeline-item::before {
    border-color: var(--color-dark-bg);
}

.feature-tabs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--gap);
}

.feature-panel {
    background-color: var(--color-paper-bg);
    border-radius: var(--radius-card);
    padding: 1.5em;
    border: 1px solid rgba(31, 21, 35, 0.05);
}

.dark-mode .feature-panel {
    background-color: #3A1C48;
    border-color: rgba(246, 243, 247, 0.1);
}

.step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background-color: var(--color-accent);
    color: var(--color-dark-bg);
    font-weight: 800;
    border-radius: 8px;
    margin-right: 0.75em;
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--gap);
}

@media (max-width: 768px) {
    .hero-grid {
        grid-template-columns: 1fr;
    }
    .nav-links {
        display: none; /* 简化移动端处理，实际项目中应加汉堡菜单 */
    }
    .mobile-nav-toggle {
        display: block;
    }
    .timeline {
        padding-left: 1.5em;
    }
    .timeline-item::before {
        left: -2.05em;
    }
}
