/* =========================================
   SafeW 全站共享样式 (style.css)
   ========================================= */

/* --- 0. 设计 Token & 变量 --- */
:root {
    /* 颜色系统 */
    --color-dark-bg: #21163C;
    --color-paper: #E9E8EA;
    --color-text-main: #191523;
    --color-brand: #5214EB;
    --color-accent: #ED926E;

    /* 结构尺寸 */
    --radius-card: 20px;
    --radius-btn: 12px;
    --card-border: 1px solid rgba(25, 21, 35, 0.16);
    --card-shadow: none;
    --section-y: clamp(2.5rem, 5vw, 4rem);
    --gap: clamp(0.75rem, 1.5vw, 1.25rem);
    --content-max: 960px;

    /* 排版基础 */
    --font-sans: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
}

/* --- 1. 全局重置与基础 --- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    color: var(--color-text-main);
    background-color: var(--color-paper);
    line-height: 1.55;
    font-size: 16px;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

img, svg {
    display: block;
    max-width: 100%;
}

a {
    color: inherit;
    text-decoration: none;
}

ul, ol {
    list-style: none;
}

/* --- 2. 容器与通用组件 --- */
.container {
    width: 100%;
    max-width: var(--content-max);
    margin-inline: auto;
    padding-inline: var(--gap);
}

.section {
    padding-block: var(--section-y);
}

/* 面与取色逻辑 */
.surface-dark {
    background-color: var(--color-dark-bg);
    color: var(--color-paper);
}

.surface-dark .hl {
    color: var(--color-accent);
}

.surface-light {
    background-color: var(--color-paper);
    color: var(--color-text-main);
}

/* 眉标 (Section Label) */
.section-label {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    margin-bottom: 0.75rem;
    color: var(--color-brand);
}

.surface-dark .section-label {
    color: var(--color-accent);
}

/* 标题处理 */
h1 {
    font-size: clamp(2.2rem, 5vw, 3.8rem);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.02em;
    margin-bottom: 1rem;
}

h2 {
    font-size: clamp(1.6rem, 3vw, 2.4rem);
    font-weight: 700;
    line-height: 1.25;
    margin-bottom: 1.5rem;
}

h3 {
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 0.75rem;
}

p {
    margin-bottom: 1rem;
    max-width: 38em;
}

/* 高亮关键词 */
.hl {
    color: var(--color-brand);
}

.surface-dark .hl {
    color: var(--color-accent);
}

/* --- 3. 按钮 --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    height: 48px;
    padding-inline: 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: var(--radius-btn);
    cursor: pointer;
    transition: transform 0.2s ease, opacity 0.2s ease;
    border: none;
    white-space: nowrap;
}

.btn:hover {
    transform: translateY(-2px);
}

.btn:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

.btn-primary {
    background-color: var(--color-accent);
    color: var(--color-dark-bg);
}

.btn-secondary {
    background-color: transparent;
    border: 1px solid var(--color-text-main);
    color: var(--color-text-main);
}

.surface-dark .btn-secondary {
    border-color: var(--color-paper);
    color: var(--color-paper);
}

/* --- 4. 卡片与面板 --- */
.card {
    background-color: var(--color-paper);
    border: var(--card-border);
    border-radius: var(--radius-card);
    padding: 1.5rem;
    box-shadow: var(--card-shadow);
}

.surface-dark .card {
    background-color: rgba(233, 232, 234, 0.08);
    border-color: rgba(233, 232, 234, 0.12);
    color: var(--color-paper);
}

.visual-panel {
    background-color: var(--color-dark-bg);
    border-radius: var(--radius-card);
    padding: 1.5rem;
    aspect-ratio: 4/3;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

/* --- 5. 导航与页脚 --- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: var(--color-paper);
    border-bottom: 1px solid rgba(25, 21, 35, 0.1);
    padding-block: 1rem;
    backdrop-filter: blur(8px);
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    font-size: 1.1rem;
}

.brand img {
    height: 32px;
    width: auto;
}

.main-nav ul {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.main-nav a {
    font-size: 0.95rem;
    font-weight: 500;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.main-nav a:hover,
.main-nav a[aria-current="page"] {
    opacity: 1;
    color: var(--color-brand);
}

.surface-dark .main-nav a {
    color: var(--color-paper);
    opacity: 0.8;
}

.surface-dark .main-nav a:hover,
.surface-dark .main-nav a[aria-current="page"] {
    color: var(--color-accent);
}

.site-footer {
    background-color: var(--color-dark-bg);
    color: var(--color-paper);
    padding-block: 3rem;
    border-top: 1px solid rgba(233, 232, 234, 0.1);
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
}

.footer-col h4 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--color-accent);
}

.footer-col ul li {
    margin-bottom: 0.5rem;
}

.footer-col a:hover {
    text-decoration: underline;
}

.copyright {
    text-align: center;
    margin-top: 3rem;
    font-size: 0.85rem;
    opacity: 0.6;
}

/* --- 6. 表格与列表 --- */
.spec-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5rem;
}

.spec-table th, .spec-table td {
    padding: 0.75rem;
    border-bottom: 1px solid rgba(25, 21, 35, 0.1);
    text-align: left;
}

.spec-table th {
    font-weight: 700;
    width: 40%;
}

.list-check li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 0.75rem;
}

.list-check li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.4em;
    width: 8px;
    height: 8px;
    background-color: var(--color-brand);
    border-radius: 2px;
    transform: rotate(45deg);
}

.surface-dark .list-check li::before {
    background-color: var(--color-accent);
}

/* --- 7. FAQ --- */
details {
    border: var(--card-border);
    border-radius: var(--radius-btn);
    margin-bottom: 0.75rem;
    background-color: rgba(255, 255, 255, 0.5);
}

.surface-dark details {
    background-color: rgba(233, 232, 234, 0.05);
}

summary {
    padding: 1rem 1.5rem;
    cursor: pointer;
    font-weight: 600;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

summary::-webkit-details-marker {
    display: none;
}

summary::after {
    content: "+";
    font-size: 1.2rem;
    font-weight: 400;
}

details[open] summary::after {
    content: "-";
}

.details-content {
    padding: 0 1.5rem 1.5rem;
    font-size: 0.95rem;
    line-height: 1.6;
}

/* --- 8. 响应式适配 --- */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .main-nav ul {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .visual-panel {
        aspect-ratio: 16/9;
        margin-top: 1.5rem;
    }
}

/* --- 9. SVG 动效 Keyframes & Classes --- */
/* 减少动态效果偏好 */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        animation-delay: 0ms !important;
    }
}

/* 轨道呼吸 */
@keyframes orbit-breathe {
    0%, 100% { transform: scale(0.95); opacity: 0.8; }
    50% { transform: scale(1.05); opacity: 1; }
}

/* 气泡浮升 */
@keyframes float-up {
    0%, 100% { transform: translateY(0); opacity: 0.8; }
    50% { transform: translateY(-8px); opacity: 1; }
}

/* 连线流动 */
@keyframes flow-line {
    to { stroke-dashoffset: -20; }
}

/* 元素应用 */
.anim-orbit {
    animation: orbit-breathe 6s ease-in-out infinite;
    transform-box: fill-box;
    transform-origin: center;
}

.anim-float-1 { animation: float-up 4s ease-in-out infinite; }
.anim-float-2 { animation: float-up 5s ease-in-out infinite 1s; }
.anim-float-3 { animation: float-up 4.5s ease-in-out infinite 2s; }

.anim-flow {
    stroke-dasharray: 10 10;
    animation: flow-line 2s linear infinite;
}

/* 输入框光标闪烁 */
@keyframes blink-cursor {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}
.cursor-blink {
    animation: blink-cursor 1.5s step-end infinite;
}
