/* === Design Tokens & Reset === */
:root {
    /* Colors - Palette */
    --color-deep-bg: #121531;
    --color-paper-bg: #E8E9EA;
    --color-body-text: #151723;
    --color-brand: #142CEB;
    --color-accent: #ED7D6E;

    /* Derived UI Colors */
    --color-surface-dark: var(--color-deep-bg);
    --color-surface-light: var(--color-paper-bg);
    
    /* Text on Dark / Paper */
    --color-text-on-dark: var(--color-paper-bg);
    --color-text-on-paper: var(--color-body-text);
    
    /* Accent on Dark / Brand */
    --color-accent-on-dark: var(--color-accent);
    --color-brand-on-paper: var(--color-brand);

    /* Spacing & Layout */
    --section-y: clamp(3.5rem, 7vw, 6rem);
    --gap: clamp(1rem, 2vw, 1.75rem);
    --content-max: 1120px;
    --header-height: 72px;
    
    /* Radius & Borders */
    --radius-card: 24px;
    --radius-btn: 999px;
    --card-border: 0;
    --card-shadow: none;
    
    /* Typography */
    --font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    --body-line-height: 1.65;
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    line-height: var(--body-line-height);
    color: var(--color-text-on-paper);
    background-color: var(--color-surface-light);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

ul, ol {
    list-style: none;
}

img, svg {
    display: block;
    max-width: 100%;
}

/* === Layout Containers === */
.container {
    width: 100%;
    max-width: var(--content-max);
    margin: 0 auto;
    padding: 0 var(--gap);
}

.section {
    padding-top: var(--section-y);
    padding-bottom: var(--section-y);
}

.section--dark {
    background-color: var(--color-surface-dark);
    color: var(--color-text-on-dark);
}

.section--paper {
    background-color: var(--color-surface-light);
    color: var(--color-text-on-paper);
}

/* === Typography === */
.text-hl {
    color: var(--color-brand-on-paper);
}

.section--dark .text-hl {
    color: var(--color-accent-on-dark);
}

.label-badge {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: 0.75rem;
}

.section--paper .label-badge {
    color: var(--color-brand-on-paper);
}

.section--dark .label-badge {
    color: var(--color-accent-on-dark);
}

h1 {
    font-size: clamp(2rem, 4.6vw, 3.4rem);
    font-weight: 600;
    line-height: 1.25;
    letter-spacing: 0;
    margin-bottom: 1.5rem;
}

h2 {
    font-size: clamp(1.6rem, 3vw, 2.4rem);
    font-weight: 600;
    line-height: 1.25;
    margin-bottom: 1.5rem;
}

h3 {
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 0.75rem;
}

p {
    margin-bottom: 1rem;
    max-width: 38em;
}

/* === Components: Buttons === */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    height: 52px;
    padding: 0 24px;
    border-radius: var(--radius-btn);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, opacity 0.2s ease;
    border: none;
    text-decoration: none;
}

.btn:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

.btn:hover {
    transform: translateY(-2px);
}

.btn--primary {
    background-color: var(--color-accent);
    color: var(--color-deep-bg);
}

.btn--secondary {
    background: transparent;
    border: 1px solid currentColor;
}

.section--paper .btn--secondary {
    color: var(--color-body-text);
    border-color: var(--color-body-text);
}

.section--dark .btn--secondary {
    color: var(--color-paper-bg);
    border-color: var(--color-paper-bg);
}

.btn svg {
    width: 20px;
    height: 20px;
    stroke-width: 2;
}

/* === Components: Cards === */
.card {
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-card);
    padding: 24px;
    border: var(--card-border);
    box-shadow: var(--card-shadow);
    transition: transform 0.2s ease;
}

.section--paper .card {
    background-color: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(8px);
}

.section--dark .card {
    background-color: rgba(255, 255, 255, 0.08);
}

.card:hover {
    transform: translateY(-4px);
}

/* === Components: Table === */
.table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius-card);
    background-color: rgba(255, 255, 255, 0.05);
    padding: 16px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 400px;
}

.data-table th, 
.data-table td {
    text-align: left;
    padding: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.data-table tr:last-child th,
.data-table tr:last-child td {
    border-bottom: none;
}

.data-table th {
    font-weight: 600;
    width: 40%;
}

.section--paper .data-table th,
.section--paper .data-table td {
    border-bottom-color: rgba(0, 0, 0, 0.1);
}

/* === Components: FAQ === */
.faq-item {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 16px 0;
}

.section--paper .faq-item {
    border-bottom-color: rgba(0, 0, 0, 0.1);
}

.faq-item summary {
    cursor: pointer;
    font-weight: 600;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-item summary::after {
    content: "+";
    font-size: 1.5rem;
    font-weight: 300;
    transition: transform 0.2s;
}

.faq-item[open] summary::after {
    transform: rotate(45deg);
}

.faq-item p {
    margin-top: 12px;
    margin-bottom: 0;
    opacity: 0.9;
}

/* === Header & Footer === */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    background-color: rgba(22, 24, 40, 0.85);
    backdrop-filter: blur(12px);
    z-index: 100;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--color-paper-bg);
}

.brand-logo img {
    height: 32px;
    width: auto;
}

.nav-list {
    display: flex;
    gap: 24px;
}

.nav-link {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.95rem;
    transition: color 0.2s;
}

.nav-link:hover, 
.nav-link[aria-current="page"] {
    color: var(--color-paper-bg);
}

.site-footer {
    background-color: var(--color-deep-bg);
    color: rgba(255, 255, 255, 0.6);
    padding: 48px 0;
    font-size: 0.9rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 32px;
}

.footer-col h4 {
    color: var(--color-paper-bg);
    margin-bottom: 16px;
    font-size: 1rem;
}

.footer-col a {
    display: block;
    margin-bottom: 8px;
    transition: color 0.2s;
}

.footer-col a:hover {
    color: var(--color-accent);
}

/* === Grid Layouts === */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
    gap: var(--gap);
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--gap);
}

@media (max-width: 768px) {
    .grid-3 {
        grid-template-columns: 1fr;
    }
    .nav-list {
        display: none; /* Simple mobile hide for brevity, focus on desktop layout */
    }
}

/* === SVG Animations === */
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes drawLine {
    0% { stroke-dashoffset: 1; }
    100% { stroke-dashoffset: 0; }
}

@keyframes breathe {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
}

@keyframes rotateIn {
    0% { transform: rotate(0deg) scale(0.8); opacity: 0; }
    100% { transform: rotate(360deg) scale(1); opacity: 1; }
}

.anim-float {
    animation: float 6s ease-in-out infinite;
}

.anim-draw {
    stroke-dasharray: 1;
    stroke-dashoffset: 0;
    animation: drawLine 3s ease-in-out infinite alternate;
}

.anim-breathe {
    animation: breathe 4s ease-in-out infinite;
}

.anim-rotate {
    animation: rotateIn 12s linear infinite;
    transform-box: fill-box;
    transform-origin: center;
}

/* Reduced Motion */
@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;
    }
}
