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

:root {
    --bg-primary: #0f0f1a;
    --bg-secondary: #1a1a2e;
    --bg-card: rgba(26, 26, 46, 0.75);
    --bg-glass: rgba(255, 255, 255, 0.06);
    --text-primary: #f0f0f5;
    --text-secondary: #a0a0b8;
    --text-muted: #6c6c88;
    --accent: #6c63ff;
    --accent-hover: #5a52e0;
    --accent-glow: rgba(108, 99, 255, 0.35);
    --border: rgba(255, 255, 255, 0.08);
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    --radius: 16px;
    --radius-sm: 10px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

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

body {
    font-family: var(--font-sans);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* ===== 滚动条 ===== */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 3px;
}

/* ===== 渐变动画背景 (Banner) ===== */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 20% 30%, rgba(108, 99, 255, 0.15) 0%, transparent 50%),
                radial-gradient(circle at 80% 70%, rgba(255, 107, 107, 0.08) 0%, transparent 50%),
                radial-gradient(circle at 50% 50%, rgba(0, 200, 200, 0.04) 0%, transparent 60%);
    pointer-events: none;
    z-index: -1;
    animation: bgShift 20s ease-in-out infinite alternate;
}

@keyframes bgShift {
    0% { transform: scale(1) translate(0, 0); }
    100% { transform: scale(1.1) translate(-2%, -1%); }
}

/* ===== 头部导航 ===== */
header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(15, 15, 26, 0.7);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 1.5rem;
}

nav[aria-label="主导航"] {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem 1rem;
    max-width: 1200px;
    margin: 0 auto;
}

nav[aria-label="主导航"] a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.4rem 0.8rem;
    border-radius: 999px;
    transition: var(--transition);
    position: relative;
}

nav[aria-label="主导航"] a:hover,
nav[aria-label="主导航"] a[aria-current="page"] {
    color: var(--text-primary);
    background: var(--bg-glass);
    text-shadow: 0 0 12px var(--accent-glow);
}

nav[aria-label="主导航"] a[aria-current="page"] {
    color: var(--accent);
}

/* ===== 主内容 ===== */
main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem 4rem;
}

/* ===== 通用 Section 卡片 ===== */
section {
    background: var(--bg-card);
    backdrop-filter: blur(12px) saturate(140%);
    -webkit-backdrop-filter: blur(12px) saturate(140%);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem 2rem 2.5rem;
    margin-bottom: 2.5rem;
    box-shadow: var(--shadow);
    transition: transform var(--transition), box-shadow var(--transition);
    opacity: 0;
    transform: translateY(30px);
    animation: fadeUp 0.7s ease forwards;
}

section:nth-child(1) { animation-delay: 0.1s; }
section:nth-child(2) { animation-delay: 0.2s; }
section:nth-child(3) { animation-delay: 0.3s; }
section:nth-child(4) { animation-delay: 0.4s; }
section:nth-child(5) { animation-delay: 0.5s; }
section:nth-child(6) { animation-delay: 0.6s; }
section:nth-child(7) { animation-delay: 0.7s; }
section:nth-child(8) { animation-delay: 0.8s; }
section:nth-child(9) { animation-delay: 0.9s; }
section:nth-child(10) { animation-delay: 1.0s; }
section:nth-child(11) { animation-delay: 1.1s; }
section:nth-child(12) { animation-delay: 1.2s; }
section:nth-child(13) { animation-delay: 1.3s; }
section:nth-child(14) { animation-delay: 1.4s; }
section:nth-child(15) { animation-delay: 1.5s; }

@keyframes fadeUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

section:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.5), 0 0 0 1px var(--accent-glow);
}

/* ===== 标题 ===== */
h1 {
    font-size: 2.8rem;
    font-weight: 800;
    background: linear-gradient(135deg, #f0f0f5 0%, #a78bfa 50%, #6c63ff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

h2 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1.25rem;
    position: relative;
    display: inline-block;
}

h2::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, var(--accent), transparent);
    border-radius: 2px;
    margin-top: 0.5rem;
}

h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

/* ===== 段落 ===== */
p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    max-width: 70ch;
}

/* ===== 链接 ===== */
a {
    color: var(--accent);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

/* ===== 按钮 ===== */
a[aria-label] {
    display: inline-block;
    background: linear-gradient(135deg, var(--accent), #8b5cf6);
    color: #fff;
    padding: 0.75rem 2rem;
    border-radius: 999px;
    font-weight: 600;
    font-size: 1rem;
    box-shadow: 0 4px 20px var(--accent-glow);
    transition: var(--transition);
    text-decoration: none;
    border: none;
    cursor: pointer;
}

a[aria-label]:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 30px var(--accent-glow);
    text-decoration: none;
    color: #fff;
}

/* ===== 列表 ===== */
ul, ol {
    padding-left: 1.5rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

li {
    margin-bottom: 0.5rem;
}

/* ===== 文章卡片 ===== */
article {
    background: var(--bg-glass);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 1.25rem 1.5rem;
    margin-bottom: 1rem;
    transition: var(--transition);
}

article:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--accent);
    transform: scale(1.01);
}

/* ===== 引用块 ===== */
blockquote {
    border-left: 4px solid var(--accent);
    padding-left: 1.25rem;
    margin: 1rem 0;
    font-style: italic;
    color: var(--text-secondary);
    background: var(--bg-glass);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    padding: 1rem 1.5rem;
}

/* ===== details / summary (FAQ) ===== */
details {
    background: var(--bg-glass);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1.25rem;
    margin-bottom: 0.75rem;
    transition: var(--transition);
    cursor: pointer;
}

details[open] {
    border-color: var(--accent);
    background: rgba(108, 99, 255, 0.06);
}

summary {
    font-weight: 600;
    color: var(--text-primary);
    padding: 0.25rem 0;
    outline: none;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

summary::-webkit-details-marker {
    display: none;
}

summary::after {
    content: '+';
    font-size: 1.2rem;
    color: var(--accent);
    transition: var(--transition);
}

details[open] summary::after {
    content: '−';
}

details p {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
}

/* ===== 页脚 ===== */
footer {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    border-top: 1px solid var(--border);
    text-align: center;
    color: var(--text-muted);
    font-size: 0.875rem;
}

footer nav {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin: 1rem 0;
}

footer nav a {
    color: var(--text-muted);
    font-size: 0.875rem;
}

footer nav a:hover {
    color: var(--accent);
}

/* ===== aside 法律信息 ===== */
#legal {
    max-width: 1200px;
    margin: 0 auto 2rem;
    padding: 2rem 1.5rem;
    background: var(--bg-card);
    backdrop-filter: blur(12px) saturate(140%);
    -webkit-backdrop-filter: blur(12px) saturate(140%);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

#legal h2 {
    font-size: 1.5rem;
}

#legal p {
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
}

/* ===== 响应式 ===== */
@media (max-width: 768px) {
    header {
        padding: 0.5rem 1rem;
    }

    nav[aria-label="主导航"] {
        gap: 0.3rem 0.6rem;
    }

    nav[aria-label="主导航"] a {
        font-size: 0.75rem;
        padding: 0.3rem 0.6rem;
    }

    main {
        padding: 1rem 1rem 3rem;
    }

    section {
        padding: 1.5rem 1.25rem;
        margin-bottom: 1.5rem;
    }

    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    h3 {
        font-size: 1.1rem;
    }

    a[aria-label] {
        padding: 0.6rem 1.5rem;
        font-size: 0.9rem;
    }

    footer nav {
        flex-direction: column;
        gap: 0.5rem;
    }

    #legal {
        padding: 1.5rem 1rem;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 1.6rem;
    }

    section {
        padding: 1rem 1rem;
        border-radius: var(--radius-sm);
    }

    article {
        padding: 1rem;
    }

    details {
        padding: 0.5rem 1rem;
    }
}

/* ===== 暗色模式原生支持 (已默认暗色) ===== */
/* 如果用户系统为浅色，可以增加额外样式，但此处保持暗色为主 */

/* ===== 打印样式 ===== */
@media print {
    header, footer, #legal {
        display: none;
    }
    section {
        box-shadow: none;
        border: 1px solid #ccc;
        background: #fff;
        color: #000;
        animation: none;
        opacity: 1;
        transform: none;
    }
    body {
        background: #fff;
        color: #000;
    }
    h1, h2, h3, p, a {
        color: #000;
    }
}