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

:root {
    --bg-primary: #0f0f1a;
    --bg-secondary: #1a1a2e;
    --bg-card: rgba(26, 26, 46, 0.85);
    --bg-glass: rgba(26, 26, 46, 0.6);
    --text-primary: #f0f0f5;
    --text-secondary: #b0b0c0;
    --accent: #ffd700;
    --accent-hover: #ffed4a;
    --accent-gradient: linear-gradient(135deg, #ffd700, #ffaa00);
    --border: rgba(255, 215, 0, 0.2);
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    --radius: 16px;
    --radius-sm: 8px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --max-width: 1200px;
    --font: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
}

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

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

/* ===== 滚动条美化 ===== */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--accent-hover);
}

/* ===== 渐变背景动画 ===== */
body::before {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(ellipse at 20% 50%, rgba(255, 215, 0, 0.05) 0%, transparent 50%),
                radial-gradient(ellipse at 80% 50%, rgba(26, 26, 46, 0.8) 0%, transparent 50%);
    animation: gradientShift 20s ease-in-out infinite alternate;
    z-index: -1;
    pointer-events: none;
}

@keyframes gradientShift {
    0% { transform: translate(0, 0) rotate(0deg); }
    100% { transform: translate(-5%, 5%) rotate(3deg); }
}

/* ===== 通用容器 ===== */
main {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px;
}

/* ===== 滚动进入动画 ===== */
section {
    opacity: 0;
    transform: translateY(40px);
    animation: fadeInUp 0.8s ease forwards;
}

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

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

/* ===== Header / Nav ===== */
header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    transition: var(--transition);
}

header:hover {
    background: rgba(26, 26, 46, 0.8);
}

nav {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

nav > a {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--accent);
    font-weight: 700;
    font-size: 1.25rem;
    letter-spacing: 1px;
    transition: var(--transition);
}

nav > a:hover {
    color: var(--accent-hover);
    transform: scale(1.02);
}

nav ul {
    list-style: none;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

nav ul li a {
    text-decoration: none;
    color: var(--text-secondary);
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
    position: relative;
}

nav ul li a::after {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 60%;
    height: 2px;
    background: var(--accent-gradient);
    transition: transform 0.3s ease;
    border-radius: 2px;
}

nav ul li a:hover {
    color: var(--accent);
    background: rgba(255, 215, 0, 0.08);
}

nav ul li a:hover::after {
    transform: translateX(-50%) scaleX(1);
}

/* ===== Hero Section ===== */
#hero {
    text-align: center;
    padding: 100px 20px 80px;
    background: linear-gradient(135deg, rgba(26, 26, 46, 0.9), rgba(15, 15, 26, 0.95)), 
                radial-gradient(circle at 30% 30%, rgba(255, 215, 0, 0.15), transparent 60%);
    border-radius: var(--radius);
    margin-top: 20px;
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
}

#hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(from 0deg, transparent, rgba(255, 215, 0, 0.03), transparent 60%);
    animation: rotateGlow 15s linear infinite;
    pointer-events: none;
}

@keyframes rotateGlow {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

#hero h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 800;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 20px;
    line-height: 1.2;
    position: relative;
    z-index: 1;
}

#hero p {
    font-size: clamp(1rem, 2vw, 1.2rem);
    color: var(--text-secondary);
    max-width: 700px;
    margin: 0 auto 40px;
    position: relative;
    z-index: 1;
}

#hero a[role="button"] {
    display: inline-block;
    padding: 14px 40px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: var(--transition);
    margin: 0 8px 12px;
    position: relative;
    z-index: 1;
}

#hero a[role="button"]:first-of-type {
    background: var(--accent-gradient);
    color: #1a1a2e;
    box-shadow: 0 4px 20px rgba(255, 215, 0, 0.3);
}

#hero a[role="button"]:first-of-type:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 30px rgba(255, 215, 0, 0.5);
}

#hero a[role="button"]:last-of-type {
    background: transparent;
    color: var(--accent);
    border: 2px solid var(--accent);
}

#hero a[role="button"]:last-of-type:hover {
    background: rgba(255, 215, 0, 0.1);
    transform: translateY(-3px);
}

/* ===== 通用 Section 样式 ===== */
section {
    padding: 60px 0;
    margin: 20px 0;
}

section h2 {
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 24px;
    position: relative;
    display: inline-block;
}

section h2::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background: var(--accent-gradient);
    margin-top: 8px;
    border-radius: 3px;
}

section p {
    color: var(--text-secondary);
    margin-bottom: 16px;
    max-width: 800px;
}

/* ===== 圆角卡片 ===== */
article, blockquote, details, .card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin: 16px 0;
    transition: var(--transition);
    box-shadow: var(--shadow);
}

article:hover, blockquote:hover, details:hover, .card:hover {
    transform: translateY(-4px);
    border-color: rgba(255, 215, 0, 0.4);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}

article h3 {
    color: var(--accent);
    font-size: 1.2rem;
    margin-bottom: 12px;
}

/* ===== 列表美化 ===== */
ul, ol {
    padding-left: 20px;
    color: var(--text-secondary);
}

li {
    margin-bottom: 10px;
    line-height: 1.6;
}

li strong {
    color: var(--text-primary);
}

/* ===== 区块引用 ===== */
blockquote {
    border-left: 4px solid var(--accent);
    font-style: italic;
    padding: 20px 24px;
    margin: 16px 0;
    background: rgba(255, 215, 0, 0.05);
}

blockquote p {
    margin-bottom: 0;
}

/* ===== FAQ (details) ===== */
details {
    cursor: pointer;
    padding: 16px 24px;
    margin: 8px 0;
    background: var(--bg-glass);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

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

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

details summary::after {
    content: '+';
    font-size: 1.4rem;
    color: var(--accent);
    transition: transform 0.3s ease;
    margin-left: 12px;
}

details[open] summary::after {
    content: '−';
    transform: rotate(180deg);
}

details[open] {
    border-color: var(--accent);
}

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

/* ===== 知识中心链接 ===== */
#knowledge ul li a {
    color: var(--accent);
    text-decoration: none;
    transition: var(--transition);
    border-bottom: 1px solid transparent;
}

#knowledge ul li a:hover {
    color: var(--accent-hover);
    border-bottom-color: var(--accent);
}

/* ===== Contact / Address ===== */
address {
    font-style: normal;
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin-top: 16px;
}

address p {
    margin-bottom: 8px;
}

/* ===== Footer ===== */
footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    padding: 40px 20px 24px;
    margin-top: 60px;
    text-align: center;
}

footer nav ul {
    list-style: none;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px 24px;
    padding: 0;
    margin-bottom: 24px;
}

footer nav ul li a {
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 0.9rem;
    transition: var(--transition);
}

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

footer p {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 8px;
}

footer small {
    color: #666;
    font-size: 0.75rem;
}

/* ===== Legal Aside ===== */
#legal {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 40px 20px;
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-top: 40px;
    margin-bottom: 40px;
}

#legal h2 {
    color: var(--accent);
    margin-bottom: 20px;
}

#legal p {
    color: var(--text-secondary);
    margin-bottom: 12px;
}

#legal strong {
    color: var(--text-primary);
}

/* ===== 响应式设计 ===== */
@media (max-width: 1024px) {
    nav ul li a {
        padding: 6px 12px;
        font-size: 0.85rem;
    }
    
    #hero {
        padding: 80px 20px 60px;
    }
}

@media (max-width: 768px) {
    nav {
        height: auto;
        flex-direction: column;
        padding: 12px 16px;
        gap: 12px;
    }
    
    nav ul {
        justify-content: center;
        gap: 4px;
    }
    
    nav ul li a {
        padding: 6px 10px;
        font-size: 0.8rem;
    }
    
    #hero {
        padding: 60px 16px 40px;
        margin-top: 12px;
    }
    
    #hero a[role="button"] {
        display: block;
        width: 100%;
        max-width: 280px;
        margin: 0 auto 12px;
        padding: 12px 24px;
    }
    
    section {
        padding: 40px 0;
    }
    
    article, blockquote, details, address, #legal {
        padding: 16px;
    }
    
    footer nav ul {
        gap: 8px 16px;
    }
    
    footer nav ul li a {
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    main {
        padding: 0 12px;
    }
    
    #hero h1 {
        font-size: 1.6rem;
    }
    
    #hero p {
        font-size: 0.95rem;
    }
    
    section h2 {
        font-size: 1.3rem;
    }
    
    nav ul {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    nav ul li a {
        padding: 4px 8px;
        font-size: 0.75rem;
    }
}

/* ===== 暗色模式增强 (默认已是暗色) ===== */
@media (prefers-color-scheme: light) {
    :root {
        --bg-primary: #f5f5fa;
        --bg-secondary: #e8e8f0;
        --bg-card: rgba(255, 255, 255, 0.85);
        --bg-glass: rgba(255, 255, 255, 0.6);
        --text-primary: #1a1a2e;
        --text-secondary: #4a4a5a;
        --accent: #b8860b;
        --accent-hover: #daa520;
        --accent-gradient: linear-gradient(135deg, #b8860b, #daa520);
        --border: rgba(184, 134, 11, 0.2);
        --shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    }
    
    body::before {
        background: radial-gradient(ellipse at 20% 50%, rgba(184, 134, 11, 0.05) 0%, transparent 50%),
                    radial-gradient(ellipse at 80% 50%, rgba(232, 232, 240, 0.8) 0%, transparent 50%);
    }
    
    #hero {
        background: linear-gradient(135deg, rgba(232, 232, 240, 0.9), rgba(245, 245, 250, 0.95)), 
                    radial-gradient(circle at 30% 30%, rgba(184, 134, 11, 0.1), transparent 60%);
    }
    
    #hero a[role="button"]:first-of-type {
        color: #fff;
    }
    
    header {
        border-bottom-color: rgba(184, 134, 11, 0.2);
    }
    
    footer {
        background: var(--bg-secondary);
    }
}

/* ===== 打印样式 ===== */
@media print {
    header, footer, #hero a[role="button"] {
        display: none;
    }
    
    body {
        background: #fff;
        color: #000;
    }
    
    section {
        opacity: 1;
        transform: none;
        animation: none;
        page-break-inside: avoid;
    }
    
    article, blockquote, details, address, #legal {
        border: 1px solid #ccc;
        background: #fff;
        box-shadow: none;
    }
}