/* =========================================
   SafeW 全站共享样式 (style.css)
   设计系统：蓝紫深底 + 紫罗兰强调 | 直角硬阴影 | 紧凑排版
   ========================================= */

/* --- 0. 设计变量 (Design Tokens) --- */
:root {
    /* 色板 */
    --color-dark-surface: #19102D;
    --color-paper: #F4F3F7;
    --color-text-body: #191523;
    --color-brand: #5214EB;
    --color-accent: #D66EED;

    /* 结构性约束 */
    --radius-card: 0;
    --radius-btn: 0;
    --card-border: 2px solid var(--color-text-body);
    --card-shadow: 4px 4px 0 var(--color-text-body);
    --section-y: clamp(2.5rem, 5vw, 4rem);
    --gap: clamp(0.75rem, 1.5vw, 1.25rem);
    --content-max: 960px;
    
    /* 排版 */
    --font-main: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", sans-serif;
    --line-height-tight: 1.15;
    --line-height-body: 1.55;
}

/* --- 1. 基础重置与排版 --- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-family: var(--font-main);
    background-color: var(--color-paper);
    color: var(--color-text-body);
    line-height: var(--line-height-body);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    max-width: 100%;
    overflow-x: hidden;
}

img, svg {
    display: block;
    max-width: 100%;
    height: auto;
}

a {
    color: var(--color-brand);
    text-decoration: none;
    transition: opacity 0.2s ease;
}

a:hover {
    opacity: 0.8;
}

a:focus-visible {
    outline: 2px solid var(--color-brand);
    outline-offset: 2px;
}

/* --- 2. 布局容器 --- */
.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-dark-surface);
    color: var(--color-paper);
}

.section-dark a {
    color: var(--color-accent);
}

.section-dark a:hover {
    opacity: 0.9;
}

/* 深色面上的浅色卡片 */
.card-light-in-dark {
    background-color: var(--color-paper);
    color: var(--color-text-body);
    border: var(--card-border);
    box-shadow: var(--card-shadow);
    padding: var(--gap);
    margin-bottom: var(--gap);
}

/* --- 3. 标题与眉标 --- */
.breadcrumb {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
    display: inline-block;
}

.section-dark .breadcrumb {
    color: var(--color-accent);
}

h1, h2, h3 {
    font-weight: 500;
    line-height: var(--line-height-tight);
    letter-spacing: -0.02em;
    text-wrap: balance;
}

h1 {
    font-size: clamp(2.6rem, 6.4vw, 5rem);
    margin-bottom: 1rem;
}

h2 {
    font-size: clamp(1.6rem, 3vw, 2.4rem);
    margin-bottom: 0.8rem;
}

h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.hl {
    color: var(--color-brand);
}

.section-dark .hl {
    color: var(--color-accent);
}

/* --- 4. 按钮组件 --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    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, border-color 0.2s ease;
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    background-color: var(--color-accent);
    color: var(--color-dark-surface);
    border: 2px solid var(--color-accent);
}

.btn-primary:hover {
    transform: translateY(-2px);
    filter: brightness(1.1);
}

.btn-secondary {
    background-color: transparent;
    color: var(--color-text-body);
    border: 2px solid var(--color-text-body);
}

.section-dark .btn-secondary {
    color: var(--color-paper);
    border-color: var(--color-paper);
}

.btn-secondary:hover {
    background-color: rgba(0,0,0,0.05);
    transform: translateY(-2px);
}

.section-dark .btn-secondary:hover {
    background-color: rgba(255,255,255,0.1);
}

/* --- 5. 卡片与面板 --- */
.card {
    background-color: var(--color-paper);
    border: var(--card-border);
    box-shadow: var(--card-shadow);
    padding: var(--gap);
    margin-bottom: var(--gap);
}

.panel {
    background-color: var(--color-dark-surface);
    border: 2px solid var(--color-paper);
    box-shadow: 4px 4px 0 var(--color-paper);
    padding: var(--gap);
    border-radius: var(--radius-card);
    overflow: hidden;
    position: relative;
}

/* --- 6. 表格 --- */
.table-wrapper {
    overflow-x: auto;
    margin-bottom: var(--gap);
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 500px;
}

th, td {
    text-align: left;
    padding: 12px 16px;
    border-bottom: 1px solid var(--color-text-body);
}

.section-dark th, .section-dark td {
    border-bottom-color: var(--color-paper);
}

th {
    font-weight: 700;
    background-color: rgba(0,0,0,0.05);
}

.section-dark th {
    background-color: rgba(255,255,255,0.05);
}

/* --- 7. FAQ --- */
.faq-item {
    border-bottom: 1px solid var(--color-text-body);
    margin-bottom: 0;
}

.faq-item summary {
    padding: 16px 0;
    cursor: pointer;
    font-weight: 600;
    list-style: none;
    position: relative;
    padding-right: 24px;
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-item summary::after {
    content: "+";
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2rem;
    line-height: 1;
}

.faq-item[open] summary::after {
    content: "-";
}

.faq-item p {
    padding-bottom: 16px;
    line-height: var(--line-height-body);
}

/* --- 8. SVG 动效方向：几何体旋转拼合 --- */
.svg-container {
    width: 100%;
    height: auto;
    position: relative;
}

.geo-shape {
    fill: none;
    stroke-width: 2;
    pathLength: 1;
    stroke-dasharray: 1;
    stroke-dashoffset: 0;
}

.geo-fill {
    stroke: none;
}

/* 旋转类 */
.rotate-slow {
    animation: rotate-cw 20s linear infinite;
    transform-box: fill-box;
    transform-origin: center;
}

.rotate-fast {
    animation: rotate-ccw 15s linear infinite;
    transform-box: fill-box;
    transform-origin: center;
}

/* 拼合描边类 */
.draw-path {
    animation: draw-line 4s ease-in-out infinite alternate;
}

@keyframes rotate-cw {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes rotate-ccw {
    from { transform: rotate(0deg); }
    to { transform: rotate(-360deg); }
}

@keyframes draw-line {
    from { stroke-dashoffset: 1; }
    to { stroke-dashoffset: 0; }
}

/* --- 9. 响应式与无障碍 --- */
@media (max-width: 768px) {
    .hero-layout {
        flex-direction: column-reverse !important;
    }
    
    .horizontal-scroll {
        flex-direction: column !important;
    }
    
    .step-bar {
        flex-direction: column !important;
    }
    
    .step-item {
        flex-direction: row !important;
        margin-bottom: 1rem;
    }
    
    .step-number {
        margin-right: 1rem;
        margin-bottom: 0.5rem;
    }
}

@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;
    }
    
    .rotate-slow, .rotate-fast {
        animation: none;
    }
    
    .draw-path {
        animation: none;
        stroke-dashoffset: 0;
    }
}

/* --- 10. 辅助工具类 --- */
.flex-row {
    display: flex;
    flex-wrap: wrap;
    gap: var(--gap);
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--gap);
}

.text-center {
    text-align: center;
}

.mt-gap {
    margin-top: var(--gap);
}

.mb-gap {
    margin-bottom: var(--gap);
}

.icon-svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
    vertical-align: middle;
}
