/* =========================================
   SafeW 全局样式 (style.css)
   ========================================= */

/* --- 1. 设计变量 (Design Tokens) --- */
:root {
    /* 配色系统 */
    --color-bg-dark: #121531;
    --color-bg-paper: #E8E9EA;
    --color-text-main: #151723;
    --color-brand: #142CEB;
    --color-accent: #ED7D6E;

    /* 语义化变量：纸面环境 */
    --c-surface: var(--color-bg-paper);
    --c-text: var(--color-text-main);
    --c-highlight: var(--color-brand);
    --c-cta: var(--color-brand);

    /* 语义化变量：深色环境 */
    .dark-surface {
        --c-surface: var(--color-bg-dark);
        --c-text: #FFFFFF;
        --c-highlight: var(--color-accent);
        --c-cta: var(--color-accent);
    }

    /* 几何与间距 */
    --radius-card: 24px;
    --radius-btn: 999px;
    --gap: clamp(1rem, 2vw, 1.75rem);
    --section-y: clamp(3.5rem, 7vw, 6rem);
    --content-max: 960px;
    
    /* 阴影与边框 */
    --card-border: 0;
    --card-shadow: none;

    /* 字体 */
    --font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
}

/* --- 2. 基础排版与重置 --- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    background-color: var(--c-surface);
    color: var(--c-text);
    line-height: 1.65;
    font-size: 16px;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

a {
    text-decoration: none;
    color: inherit;
    transition: opacity 0.2s ease;
}

ul {
    list-style: none;
}

img, svg {
    display: block;
    max-width: 100%;
}

/* --- 3. 布局容器 --- */
.container {
    max-width: var(--content-max);
    margin-inline: auto;
    padding-inline: var(--gap);
}

.section-padding {
    padding-block: var(--section-y);
}

.grid-layout {
    display: grid;
    gap: var(--gap);
}

/* --- 4. 组件：按钮 --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    height: 52px;
    padding-inline: 24px;
    border-radius: var(--radius-btn);
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
    border: none;
}

.btn-primary {
    background-color: var(--c-cta);
    color: #FFFFFF;
}

.dark-surface .btn-primary {
    color: var(--color-bg-dark);
}

.btn-secondary {
    background-color: transparent;
    color: var(--c-text);
    border: 2px solid var(--c-text);
}

.btn:hover {
    transform: translateY(-2px);
    opacity: 0.9;
}

.btn:focus-visible {
    outline: 3px solid var(--color-brand);
    outline-offset: 2px;
}

.btn-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* --- 5. 组件：卡片 --- */
.card {
    background-color: rgba(255, 255, 255, 0.5);
    border-radius: var(--radius-card);
    padding: 24px;
    border: var(--card-border);
    box-shadow: var(--card-shadow);
}

.dark-surface .card {
    background-color: rgba(255, 255, 255, 0.08);
}

/* --- 6. 组件：表格 --- */
.table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius-card);
    border: 1px solid rgba(0,0,0,0.1);
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 500px;
}

th, td {
    padding: 16px 24px;
    text-align: left;
    border-bottom: 1px solid rgba(0,0,0,0.08);
}

th {
    font-weight: 700;
    background-color: rgba(0,0,0,0.03);
}

tr:last-child th, tr:last-child td {
    border-bottom: none;
}

/* --- 7. 组件：FAQ --- */
details {
    border-bottom: 1px solid rgba(0,0,0,0.1);
    padding: 16px 0;
}

summary {
    font-weight: 700;
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.1rem;
}

summary::-webkit-details-marker {
    display: none;
}

summary::after {
    content: "+";
    font-size: 1.5rem;
    font-weight: 400;
    opacity: 0.5;
}

details[open] summary::after {
    content: "-";
}

details p {
    margin-top: 12px;
    color: var(--c-text);
    opacity: 0.9;
    line-height: 1.7;
}

/* --- 8. 组件：眉标 (Eyebrow) --- */
.eyebrow {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--c-highlight);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.eyebrow::before {
    content: "";
    display: block;
    width: 20px;
    height: 2px;
    background-color: currentColor;
}

/* --- 9. 标题排版 --- */
h1, h2, h3, h4 {
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.1;
    color: var(--c-text);
}

h1 {
    font-size: clamp(2.4rem, 6vw, 4.5rem);
}

h2 {
    font-size: clamp(1.8rem, 3.5vw, 2.6rem);
    margin-bottom: 24px;
    line-height: 1.2;
}

h3 {
    font-size: 1.4rem;
    margin-bottom: 16px;
    line-height: 1.3;
}

.highlight {
    color: var(--c-highlight);
}

/* --- 10. 页头 (Header) --- */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background-color: rgba(232, 233, 234, 0.85); /* 纸面透明底色 */
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(0,0,0,0.05);
    padding-block: 16px;
}

.dark-surface ~ .site-header {
    background-color: rgba(18, 21, 49, 0.9);
    border-bottom-color: rgba(255,255,255,0.1);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    font-size: 1.2rem;
    color: var(--c-text);
}

.logo img {
    height: 32px;
    width: auto;
}

.nav-links {
    display: flex;
    gap: 32px;
}

.nav-link {
    font-weight: 600;
    font-size: 0.95rem;
    opacity: 0.8;
}

.nav-link:hover, .nav-link[aria-current="page"] {
    opacity: 1;
    color: var(--c-highlight);
}

/* --- 11. 页脚 (Footer) --- */
.site-footer {
    background-color: var(--color-bg-dark);
    color: #FFFFFF;
    padding-block: 64px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr;
    gap: 48px;
}

.footer-col h4 {
    color: #FFFFFF;
    margin-bottom: 24px;
    font-size: 1rem;
}

.footer-links li {
    margin-bottom: 12px;
}

.footer-links a {
    opacity: 0.7;
    font-size: 0.9rem;
}

.footer-links a:hover {
    opacity: 1;
    color: var(--color-accent);
}

.copyright {
    margin-top: 48px;
    padding-top: 24px;
    border-top: 1px solid rgba(255,255,255,0.1);
    text-align: center;
    font-size: 0.85rem;
    opacity: 0.5;
}

/* --- 12. SVG 动效关键帧 (Keyframes) --- */

/* 漂浮效果 (Float) */
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* 呼吸效果 (Breathe) */
@keyframes breathe {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

/* 滑入效果 (Slide In) */
@keyframes slideIn {
    0% { transform: translateX(20px); opacity: 0; }
    100% { transform: translateX(0); opacity: 1; }
}

/* 描边绘制 (Draw Stroke) */
@keyframes drawStroke {
    0% { stroke-dashoffset: 1; }
    50% { stroke-dashoffset: 0; }
    100% { stroke-dashoffset: 1; }
}

/* 流动点 (Flow Dot) */
@keyframes flowDot {
    0% { offset-distance: 0%; opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { offset-distance: 100%; opacity: 0; }
}

/* --- 13. SVG 动效类 (Animation Classes) --- */
.anim-float {
    animation: float 6s ease-in-out infinite;
}

.anim-breathe {
    animation: breathe 3s ease-in-out infinite;
}

.anim-slide-in {
    animation: slideIn 1.5s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.anim-draw {
    pathLength: 1;
    stroke-dasharray: 1;
    stroke-dashoffset: 0;
    animation: drawStroke 4s linear infinite;
}

.anim-flow-dot {
    fill: var(--color-accent);
    offset-path: path("M 0 50 Q 50 0 100 50 T 200 50"); /* 示例曲线路径 */
    animation: flowDot 4s linear infinite;
}

/* 延迟类 */
.delay-1 { animation-delay: 0.2s; }
.delay-2 { animation-delay: 0.4s; }
.delay-3 { animation-delay: 0.6s; }

/* --- 14. 响应式适配 (Responsive) --- */
@media (max-width: 768px) {
    .header-inner {
        flex-direction: column;
        gap: 16px;
    }
    .nav-links {
        gap: 20px;
    }
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 32px;
    }
    .hero-layout {
        grid-template-columns: 1fr !important;
    }
    .hero-visual {
        order: -1;
        margin-bottom: 32px;
    }
    .grid-3-col {
        grid-template-columns: 1fr !important;
    }
}

@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;
    }
    .svg-visual {
        height: auto;
        width: 100%;
    }
}

/* 移动端 SVG 缩放修正 */
.svg-visual {
    height: auto;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
}

/* 步骤条样式 */
.steps-container {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    margin-top: 32px;
}
.step-item {
    flex: 1;
    position: relative;
    padding-left: 40px;
}
.step-number {
    position: absolute;
    left: 0;
    top: 0;
    width: 28px;
    height: 28px;
    background-color: var(--color-accent);
    color: var(--color-bg-dark);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.9rem;
}
.step-title {
    font-weight: 700;
    margin-bottom: 8px;
    display: block;
}
@media (max-width: 768px) {
    .steps-container {
        flex-direction: column;
    }
}
