/* =========================================
   SafeW 全站共享样式 (Global Styles)
   设计系统：蓝紫深底 + 紫罗兰强调 · 纯白纸面
   ========================================= */

:root {
    /* --- 颜色系统 --- */
    --color-dark: #19102D;       /* 深色面背景 */
    --color-paper: #FCFCFD;      /* 浅色纸面背景 */
    --color-text: #191523;       /* 正文与标题色 */
    --color-brand: #5214EB;      /* 品牌色（链接、眉标） */
    --color-accent: #D66EED;     /* 强调色（按钮、高亮） */
    
    /* --- 排版与间距 --- */
    --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans SC", sans-serif;
    --content-max: 1120px;
    --section-y: clamp(5rem, 10vw, 9rem);
    --gap: clamp(1.5rem, 3vw, 2.5rem);
    
    /* --- 组件规范 (无圆角，硬阴影) --- */
    --radius-card: 0px;
    --radius-btn: 0px;
    --card-border: 2px solid var(--color-text);
    --card-shadow: 4px 4px 0 var(--color-text);
    
    /* --- 状态 --- */
    --focus-ring: 3px solid var(--color-brand);
}

/* --- 基础重置 --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: var(--font-sans);
    background-color: var(--color-paper);
    color: var(--color-text);
    line-height: 1.75;
    font-size: 16px;
    overflow-x: hidden;
}

a { color: inherit; text-decoration: none; transition: color 0.2s; }
img, svg { display: block; max-width: 100%; height: auto; }
ul, ol { list-style: none; }

/* --- 布局容器 --- */
.container {
    width: 100%;
    max-width: var(--content-max);
    margin: 0 auto;
    padding: 0 var(--gap);
}

.section {
    padding-top: var(--section-y);
    padding-bottom: var(--section-y);
}

/* --- 页面头部 --- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: rgba(252, 252, 253, 0.95);
    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;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 800;
    font-size: 1.25rem;
    letter-spacing: -0.02em;
}

.brand-logo img {
    height: 32px;
    width: auto;
}

.main-nav {
    display: flex;
    gap: 24px;
    align-items: center;
}

.nav-link {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--color-text);
}

.nav-link:hover { color: var(--color-brand); }
.nav-link[aria-current="page"] { color: var(--color-brand); text-decoration: underline; text-underline-offset: 4px; }

/* --- 按钮系统 --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 48px;
    padding: 0 24px;
    font-weight: 700;
    font-size: 1rem;
    border-radius: var(--radius-btn);
    cursor: pointer;
    transition: transform 0.2s, opacity 0.2s;
}

.btn-primary {
    background-color: var(--color-accent);
    color: var(--color-dark);
    border: none;
}

.btn-primary:hover { transform: translateY(-2px); opacity: 0.9; }

.btn-secondary {
    background: transparent;
    color: var(--color-text);
    border: 2px solid var(--color-text);
}

/* 深色面上的次级按钮变体 */
.surface .btn-secondary {
    color: var(--color-paper);
    border-color: var(--color-paper);
}

.btn:focus-visible { outline: var(--focus-ring); outline-offset: 2px; }

/* --- 标题系统 --- --- */
.section-eyebrow {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: 12px;
    display: block;
}

.paper-surface .section-eyebrow { color: var(--color-brand); }
.dark-surface .section-eyebrow { color: var(--color-accent); }

h1 {
    font-size: clamp(2rem, 4.6vw, 3.4rem);
    font-weight: 600;
    line-height: 1.25;
    letter-spacing: -0.02em;
    margin-bottom: 24px;
}

h2 {
    font-size: clamp(1.6rem, 3vw, 2.4rem);
    font-weight: 600;
    line-height: 1.25;
    margin-bottom: 32px;
}

h3 {
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 16px;
}

.highlight { color: var(--color-brand); }
.dark-surface .highlight { color: var(--color-accent); }

/* --- 通用组件 --- */
.card {
    background: var(--color-paper);
    border: var(--card-border);
    box-shadow: var(--card-shadow);
    padding: 32px;
    border-radius: var(--radius-card);
}

.table-wrapper {
    overflow-x: auto;
    border: 2px solid var(--color-text);
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    min-width: 600px;
}

th, td {
    padding: 16px;
    border-bottom: 1px solid rgba(25, 21, 35, 0.2);
}

th {
    background: rgba(25, 21, 35, 0.05);
    font-weight: 700;
}

/* --- FAQ 样式 --- */
.faq-item {
    border-bottom: 2px solid rgba(25, 21, 35, 0.1);
    margin-bottom: 16px;
}

.faq-item summary {
    font-weight: 700;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 16px 0;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.faq-item summary::-webkit-details-marker { display: none; }

.faq-item summary::after {
    content: "+";
    font-size: 1.5rem;
    font-weight: 300;
    transition: transform 0.2s;
}

.faq-item[open] summary::after { transform: rotate(45deg); }

.faq-item p {
    padding-bottom: 16px;
    color: rgba(25, 21, 35, 0.8);
}

/* --- 页脚 --- */
.site-footer {
    background-color: var(--color-dark);
    color: var(--color-paper);
    padding: 64px 0;
    margin-top: var(--section-y);
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 48px;
}

.footer-col h4 {
    color: var(--color-accent);
    margin-bottom: 24px;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.footer-col ul li { margin-bottom: 12px; }
.footer-col a { color: rgba(252, 252, 253, 0.7); }
.footer-col a:hover { color: var(--color-paper); }

/* --- SVG 动效方向：卡片层叠漂浮 --- */
@keyframes float-slow {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-12px); }
}

@keyframes float-medium {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

@keyframes draw-line {
    0% { stroke-dashoffset: 100; }
    50% { stroke-dashoffset: 0; }
    100% { stroke-dashoffset: -100; }
}

/* 动效类应用 */
.anim-float-slow { animation: float-slow 6s ease-in-out infinite; }
.anim-float-medium { animation: float-medium 4s ease-in-out infinite; }
.anim-pulse { animation: pulse-dot 2s ease-in-out infinite; }

/* 减少动画偏好设置 */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
