/* =========================================
   1. 设计变量 (Design Tokens)
   ========================================= */
:root {
    /* 颜色系统：严格遵循蓝紫深底 + 蓝紫强调 · 深米纸面 */
    --bg-dark: #1B1231;      /* 首屏 Hero、重点区块底色 */
    --bg-light: #DBD4ED;     /* 大部分内容区底色 */
    --text-body: #191523;    /* 纸面上的标题与正文 */
    --brand-color: #5214EB;  /* 纸面上的品牌色 */
    --accent-color: #9977EE; /* 强调色（按钮、深色面文字） */
    
    /* 结构变量 */
    --content-max: 960px;
    --section-y: clamp(5rem, 10vw, 9rem);
    --gap: clamp(1.5rem, 3vw, 2.5rem);
    --radius-card: 24px;
    --radius-btn: 999px;
    
    /* 组件细节 */
    --card-border: 0;
    --card-shadow: none;
    --header-height: 72px;
}

/* =========================================
   2. 全局重置与排版 (Global Reset & Typography)
   ========================================= */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
    line-height: 1.75;
    color: var(--text-body);
    background-color: var(--bg-light);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

img, svg {
    display: block;
    max-width: 100%;
}

/* =========================================
   3. 布局容器 (Layout)
   ========================================= */
.container {
    width: 100%;
    max-width: var(--content-max);
    margin: 0 auto;
    padding: 0 24px;
}

.section {
    padding-top: var(--section-y);
    padding-bottom: var(--section-y);
    position: relative;
}

.section-dark {
    background-color: var(--bg-dark);
    color: var(--bg-light);
}

/* 页面背景切换逻辑 */
.section-hero { background-color: var(--bg-dark); color: var(--bg-light); }
.section-paper { background-color: var(--bg-light); color: var(--text-body); }
.section-footer { background-color: var(--bg-dark); color: var(--bg-light); }

/* =========================================
   4. 排版细节 (Typography Details)
   ========================================= */
.section-label {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    margin-bottom: 1rem;
    color: var(--brand-color);
}

.section-dark .section-label {
    color: var(--accent-color);
}

h1 {
    font-size: clamp(2.2rem, 5vw, 3.8rem);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.02em;
    margin-bottom: 1.5rem;
    text-wrap: balance;
}

h2 {
    font-size: clamp(1.6rem, 3vw, 2.4rem);
    font-weight: 700;
    line-height: 1.25;
    margin-bottom: 1.5rem;
    letter-spacing: 0.02em;
    text-wrap: balance;
}

h3 {
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 1rem;
}

p {
    margin-bottom: 1.25rem;
    max-width: 38em;
}

.hl {
    color: var(--brand-color);
}

.section-dark .hl {
    color: var(--accent-color);
}

/* =========================================
   5. 页头与页脚 (Header & Footer)
   ========================================= */
.site-header {
    height: var(--header-height);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background-color: rgba(27, 18, 49, 0.9);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

.logo img {
    height: 32px;
    width: auto;
}

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.nav-links a {
    color: var(--bg-light);
    font-size: 0.95rem;
    font-weight: 500;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
    opacity: 1;
    color: var(--accent-color);
}

@media (max-width: 768px) {
    .nav-links { display: none; }
}

/* =========================================
   6. 按钮 (Buttons)
   ========================================= */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 48px;
    padding: 0 24px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: var(--radius-btn);
    cursor: pointer;
    transition: transform 0.2s ease, background-color 0.2s ease;
    text-align: center;
}

.btn-primary {
    background-color: var(--accent-color);
    color: var(--bg-dark);
}

.btn-primary:hover {
    transform: translateY(-2px);
    filter: brightness(1.1);
}

.btn-secondary {
    background-color: transparent;
    border: 1px solid var(--text-body);
    color: var(--text-body);
}

.section-dark .btn-secondary {
    border-color: var(--bg-light);
    color: var(--bg-light);
}

.btn-icon {
    margin-right: 8px;
    width: 20px;
    height: 20px;
}

/* =========================================
   7. 卡片与面板 (Cards & Panels)
   ========================================= */
.card {
    background-color: rgba(255, 255, 255, 0.4);
    border-radius: var(--radius-card);
    padding: 2rem;
    transition: transform 0.2s ease;
}

.section-dark .card {
    background-color: rgba(255, 255, 255, 0.05);
}

.card:hover {
    transform: translateY(-4px);
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
    gap: var(--gap);
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
    gap: var(--gap);
}

/* =========================================
   8. 表格 (Tables)
   ========================================= */
.table-wrapper {
    overflow-x: auto;
    margin-top: 1.5rem;
    border-radius: var(--radius-card);
    background-color: rgba(255, 255, 255, 0.4);
}

.section-dark .table-wrapper {
    background-color: rgba(255, 255, 255, 0.05);
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 500px;
}

th, td {
    padding: 1rem 1.5rem;
    text-align: left;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.section-dark th, 
.section-dark td {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

th {
    font-weight: 700;
    color: var(--brand-color);
}

.section-dark th {
    color: var(--accent-color);
}

tr:last-child th, tr:last-child td {
    border-bottom: none;
}

/* =========================================
   9. FAQ (Details & Summary)
   ========================================= */
.faq-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 2rem;
}

details {
    background-color: rgba(255, 255, 255, 0.4);
    border-radius: 16px;
    padding: 1.25rem;
    transition: background-color 0.2s;
}

.section-dark details {
    background-color: rgba(255, 255, 255, 0.05);
}

details[open] {
    background-color: rgba(255, 255, 255, 0.6);
}

.summary {
    font-weight: 700;
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.summary::-webkit-details-marker { display: none; }

.summary::after {
    content: "+";
    font-size: 1.25rem;
    color: var(--brand-color);
    transition: transform 0.2s;
}

details[open] .summary::after {
    transform: rotate(45deg);
    color: var(--brand-color);
}

.details-content {
    margin-top: 1rem;
    color: var(--text-body);
    opacity: 0.9;
}

/* =========================================
   10. SVG 动效 (SVG Animations)
   ========================================= */
svg {
    width: 100%;
    height: auto;
    overflow: visible;
}

/* 几何体旋转拼合 - Hero */
@keyframes rotate-slow {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.geo-shape-1 {
    transform-box: fill-box;
    transform-origin: center;
    animation: rotate-slow 20s linear infinite;
}

.geo-shape-2 {
    transform-box: fill-box;
    transform-origin: center;
    animation: rotate-slow 15s linear infinite reverse;
}

.float-layer {
    animation: float 6s ease-in-out infinite;
}

/* 呼吸效果 - 输入指示器 */
@keyframes breathe {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

.breathe-dot {
    animation: breathe 2s ease-in-out infinite;
}
.breathe-dot:nth-child(2) { animation-delay: 0.2s; }
.breathe-dot:nth-child(3) { animation-delay: 0.4s; }

/* 连接线流动 - 快速开始 */
@keyframes dash-flow {
    to { stroke-dashoffset: -20; }
}

.flow-line {
    stroke-dasharray: 6 6;
    animation: dash-flow 1s linear infinite;
}

/* 减少动态效果 */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
