/* ==================== 
   全站共享样式 (Style System) 
   ==================== */

/* --- 基础变量与重置 --- */
:root {
    /* 颜色系统 */
    --color-deep-bg: #140E25;       /* 深色面 */
    --color-paper-bg: #F7F5F3;      /* 纸面 */
    --color-text-main: #191523;     /* 正文 */
    --color-brand: #5214EB;         /* 品牌色 */
    --color-accent: #C8ED6E;        /* 强调色 */
    --color-btn-text: #140E25;      /* 按钮文字色（深色） */
    
    /* 边框与阴影 */
    --card-border: 1px solid rgba(25, 21, 35, 0.16);
    --card-shadow: none;

    /* 圆角 */
    --radius-card: 8px;
    --radius-btn: 6px;

    /* 间距与节奏 */
    --section-y: clamp(2.5rem, 5vw, 4rem);
    --gap: clamp(0.75rem, 1.5vw, 1.25rem);
    --content-max: 960px;
    
    /* 字体 */
    --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", sans-serif;
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-family: var(--font-sans);
    color: var(--color-text-main);
    background-color: var(--color-paper-bg);
    line-height: 1.55;
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    overflow-x: hidden;
    min-width: 320px;
}

img, svg {
    display: block;
    max-width: 100%;
}

a {
    color: inherit;
    text-decoration: none;
}

ul, ol {
    list-style: none;
}

/* --- 容器与排版 --- */
.container {
    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-deep-bg);
    color: var(--color-paper-bg);
}

.section__header {
    margin-bottom: var(--gap);
}

.megabadge {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--color-brand);
    margin-bottom: 0.5rem;
    display: block;
}

.section--dark .megabadge {
    color: var(--color-accent);
}

h1 {
    font-size: clamp(2.2rem, 5vw, 3.8rem);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.02em;
    margin-bottom: var(--gap);
}

h2 {
    font-size: clamp(1.6rem, 3vw, 2.4rem);
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: 0.02em;
    margin-bottom: var(--gap);
}

h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

p {
    margin-bottom: 1rem;
    max-width: 38em;
}

.highlight {
    color: var(--color-brand);
}

.section--dark .highlight {
    color: var(--color-accent);
}

/* --- 按钮组件 --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    height: 48px;
    padding: 0 24px;
    border-radius: var(--radius-btn);
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: transform 0.2s ease, background-color 0.2s ease;
    text-decoration: none;
}

.btn--primary {
    background-color: var(--color-accent);
    color: var(--color-btn-text);
}

.btn--primary:hover {
    transform: translateY(-2px);
    filter: brightness(0.95);
}

.btn--secondary {
    background-color: transparent;
    border: 1px solid var(--color-text-main);
    color: var(--color-text-main);
}

.section--dark .btn--secondary {
    border-color: var(--color-paper-bg);
    color: var(--color-paper-bg);
}

.btn:focus-visible {
    outline: 2px solid var(--color-brand);
    outline-offset: 2px;
}

.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: var(--card-border);
    border-radius: var(--radius-card);
    padding: var(--gap);
    box-shadow: var(--card-shadow);
}

.section--dark .card {
    background-color: rgba(247, 245, 243, 0.05);
    border-color: rgba(247, 245, 243, 0.1);
    color: var(--color-paper-bg);
}

.grid {
    display: grid;
    gap: var(--gap);
}

.grid--2 {
    grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
}

.grid--3 {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

/* --- 表格 --- */
.table-container {
    overflow-x: auto;
    border: var(--card-border);
    border-radius: var(--radius-card);
}

table {
    width: 100%;
    border-collapse: collapse;
    white-space: normal;
}

th, td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid rgba(25, 21, 35, 0.1);
}

.section--dark th, .section--dark td {
    border-bottom-color: rgba(247, 245, 243, 0.1);
}

th {
    font-weight: 700;
    background-color: rgba(25, 21, 35, 0.03);
}

.section--dark th {
    background-color: rgba(247, 245, 243, 0.05);
}

/* --- FAQ --- */
.faq-item {
    border-bottom: 1px solid rgba(25, 21, 35, 0.1);
}

.section--dark .faq-item {
    border-bottom-color: rgba(247, 245, 243, 0.1);
}

details summary {
    padding: 16px 0;
    cursor: pointer;
    font-weight: 700;
    list-style: none;
    position: relative;
    padding-left: 24px;
}

details summary::-webkit-details-marker {
    display: none;
}

details summary::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    border: 2px solid var(--color-brand);
    border-radius: 4px;
}

.section--dark details summary::before {
    border-color: var(--color-accent);
}

details[open] summary::after {
    content: '−';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2rem;
    line-height: 1;
}

details p {
    padding-bottom: 16px;
    font-size: 0.95rem;
    opacity: 0.9;
}

/* --- 页头页脚 --- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: rgba(247, 245, 243, 0.9);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(25, 21, 35, 0.1);
    padding: 16px 0;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-list {
    display: flex;
    gap: 24px;
}

.nav-link {
    font-weight: 600;
    font-size: 0.95rem;
    transition: color 0.2s;
}

.nav-link:hover {
    color: var(--color-brand);
}

.nav-link[aria-current="page"] {
    color: var(--color-brand);
    border-bottom: 2px solid var(--color-brand);
}

.site-footer {
    background-color: var(--color-deep-bg);
    color: var(--color-paper-bg);
    padding: 48px 0;
    margin-top: auto;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 32px;
}

.footer-col h4 {
    color: var(--color-accent);
    margin-bottom: 16px;
    font-size: 1rem;
}

.footer-col a {
    display: block;
    margin-bottom: 8px;
    opacity: 0.8;
    font-size: 0.9rem;
}

.footer-col a:hover {
    opacity: 1;
}

/* --- SVG 动效方向 --- */
.svg-icon {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Hero SVG 动效 */
.hero-svg-group {
    transform-origin: center;
}
.hero-bubble {
    animation: floatBubble 6s ease-in-out infinite;
}
.hero-bubble:nth-child(2) { animation-delay: 1s; }
.hero-bubble:nth-child(3) { animation-delay: 2s; }

@keyframes floatBubble {
    0%, 100% { transform: translateY(0); opacity: 0.8; }
    50% { transform: translateY(-8px); opacity: 1; }
}

.hero-input-dots circle {
    animation: breatheDots 3s ease-in-out infinite;
}
.hero-input-dots circle:nth-child(1) { animation-delay: 0s; }
.hero-input-dots circle:nth-child(2) { animation-delay: 0.5s; }
.hero-input-dots circle:nth-child(3) { animation-delay: 1s; }

@keyframes breatheDots {
    0%, 100% { opacity: 0.3; transform: scale(0.8); }
    50% { opacity: 1; transform: scale(1.1); }
}

.hero-track {
    animation: orbitBreath 10s ease-in-out infinite alternate;
    transform-origin: center;
}
.hero-track:nth-child(2) { animation-duration: 14s; animation-direction: alternate-reverse; }
.hero-track:nth-child(3) { animation-duration: 18s; }

@keyframes orbitBreath {
    0% { transform: scale(0.95); opacity: 0.4; }
    100% { transform: scale(1.05); opacity: 0.8; }
}

/* 功能面板动效 */
.panel-draw {
    pathLength: 1;
    stroke-dasharray: 1;
    stroke-dashoffset: 0;
    animation: drawLine 8s linear infinite;
}

@keyframes drawLine {
    0% { stroke-dashoffset: 1; }
    50% { stroke-dashoffset: 0; }
    100% { stroke-dashoffset: 1; }
}

.panel-fade {
    animation: fadePanel 12s ease-in-out infinite alternate;
}

@keyframes fadePanel {
    0% { opacity: 0.6; transform: translateX(-5px); }
    100% { opacity: 1; transform: translateX(5px); }
}

/* 减少动态效果媒体查询 */
@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;
    }
}

/* --- 响应式调整 --- */
@media (max-width: 768px) {
    .header-inner {
        flex-direction: column;
        gap: 16px;
    }
    .nav-list {
        gap: 16px;
    }
    .hero-layout {
        flex-direction: column;
    }
}
