/* =========================================
   SafeW 全站共享样式
   设计系统：蓝紫深底 + 胭脂强调 · 深米纸面
   ========================================= */

:root {
    /* 色板 */
    --bg-deep: #251943;
    --bg-paper: #DBD4ED;
    --text-body: #191523;
    --brand: #5214EB;
    --accent: #ED6E89;

    /* 结构 Token */
    --content-max: 1280px;
    --section-y: clamp(5rem, 10vw, 9rem);
    --gap: clamp(1.5rem, 3vw, 2.5rem);

    /* 组件细节 */
    --radius-card: 0;
    --radius-btn: 0;
    --card-border: 1px solid rgba(25, 21, 35, 0.16);
    --card-shadow: none;
    --font-main: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", sans-serif;
}

/* 基础重置与排版 */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-main);
    font-size: 17px;
    line-height: 1.75;
    color: var(--text-body);
    background-color: var(--bg-paper);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

img, svg {
    display: block;
    max-width: 100%;
    height: auto;
}

a {
    color: inherit;
    text-decoration: none;
}

ul, ol {
    list-style: none;
}

/* 颜色变体类（用于继承控制） */
.deep-surface {
    background-color: var(--bg-deep);
    color: var(--bg-paper);
}

.paper-surface {
    background-color: var(--bg-paper);
    color: var(--text-body);
}

/* 容器 */
.container {
    max-width: var(--content-max);
    margin: 0 auto;
    padding: 0 var(--gap);
}

.section-spacer {
    padding-top: var(--section-y);
    padding-bottom: var(--section-y);
    border-bottom: 1px solid rgba(25, 21, 35, 0.1);
}

.deep-surface .section-spacer {
    border-bottom-color: rgba(219, 212, 237, 0.15);
}

/* 标题系统 */
h1, h2, h3, h4 {
    font-weight: 500;
    line-height: 1.15;
    letter-spacing: -0.01em;
}

h1 {
    font-size: clamp(2.6rem, 6.4vw, 5rem);
    margin-bottom: 1.5rem;
}

h2 {
    font-size: clamp(1.8rem, 3.5vw, 2.8rem);
    margin-bottom: 1rem;
}

h3 {
    font-size: clamp(1.3rem, 2vw, 1.6rem);
    margin-bottom: 1rem;
}

.subtitle {
    font-size: clamp(1rem, 1.5vw, 1.2rem);
    line-height: 1.6;
    opacity: 0.9;
    max-width: 70ch;
    margin-bottom: 2rem;
}

.brand-highlight {
    color: var(--brand);
}

.deep-surface .brand-highlight {
    color: var(--accent);
}

/* 眉标 */
.section-label {
    display: inline-block;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: 1rem;
    color: var(--brand);
}

.deep-surface .section-label {
    color: var(--accent);
}

/* 按钮 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.85rem 1.75rem;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    border: 2px solid transparent;
    transition: transform 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
    text-decoration: none;
}

.btn:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 2px;
}

.btn-primary {
    background-color: var(--accent);
    color: var(--bg-deep);
    border-color: var(--accent);
}

.btn-primary:hover {
    background-color: #d95a74;
    border-color: #d95a74;
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: transparent;
    color: var(--text-body);
    border-color: var(--text-body);
}

.btn-secondary:hover {
    background-color: rgba(25, 21, 35, 0.05);
    transform: translateY(-2px);
}

.deep-surface .btn-secondary {
    color: var(--bg-paper);
    border-color: var(--bg-paper);
}

.deep-surface .btn-secondary:hover {
    background-color: rgba(219, 212, 237, 0.1);
}

/* 卡片与面板 */
.card {
    background-color: currentColor;
    background-color: inherit;
    border: var(--card-border);
    box-shadow: var(--card-shadow);
    border-radius: var(--radius-card);
    padding: 2rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.deep-surface .card {
    /* 深色面上的浅色卡片，恢复纸面取色 */
    background-color: var(--bg-paper);
    color: var(--text-body);
    border-color: rgba(25, 21, 35, 0.16);
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.06);
}

/* 表格 */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.data-table th, .data-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid rgba(25, 21, 35, 0.1);
    vertical-align: top;
}

.deep-surface .data-table th, 
.deep-surface .data-table td {
    border-bottom-color: rgba(219, 212, 237, 0.15);
}

.data-table th {
    font-weight: 700;
    color: var(--brand);
}

.deep-surface .data-table th {
    color: var(--accent);
}

.data-table tr:last-child th,
.data-table tr:last-child td {
    border-bottom: none;
}

/* 列表与步骤 */
.step-list {
    counter-reset: step-counter;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.step-item {
    display: flex;
    gap: 1.25rem;
    align-items: flex-start;
}

.step-number {
    flex-shrink: 0;
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--accent);
    color: var(--bg-deep);
    font-weight: 800;
    font-size: 1.1rem;
    border-radius: var(--radius-card);
}

/* FAQ Details */
details {
    border-bottom: 1px solid rgba(25, 21, 35, 0.1);
    padding: 1.25rem 0;
}

.deep-surface details {
    border-bottom-color: rgba(219, 212, 237, 0.15);
}

summary {
    font-weight: 600;
    font-size: 1.1rem;
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-right: 1rem;
}

summary::-webkit-details-marker {
    display: none;
}

summary::after {
    content: "+";
    font-weight: 300;
    font-size: 1.5rem;
    line-height: 1;
    transition: transform 0.2s ease;
}

details[open] summary::after {
    transform: rotate(45deg);
}

details p {
    margin-top: 0.75rem;
    opacity: 0.9;
}

/* 导航栏 */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: var(--bg-deep);
    border-bottom: 1px solid rgba(219, 212, 237, 0.15);
    padding: 1rem 0;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    font-size: 0.95rem;
    font-weight: 500;
    opacity: 0.8;
    color: #DBD4ED;
    transition: opacity 0.2s ease;
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
    opacity: 1;
    color: var(--accent);
}

/* 页脚 */
.site-footer {
    padding: 4rem 0;
    text-align: center;
    font-size: 0.9rem;
    opacity: 0.8;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 1.5rem;
}

/* SVG 动效关键帧 */
@keyframes draw-line {
    from { stroke-dashoffset: 1; }
    to { stroke-dashoffset: 0; }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

@keyframes fade-in-up {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes rotate-geom {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes pulse-opacity {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
}

/* 动效工具类 */
.anim-draw {
    pathLength: 1;
    stroke-dasharray: 1;
    stroke-dashoffset: 0;
    animation: draw-line 2s ease forwards;
}

.anim-float {
    animation: float 6s ease-in-out infinite;
}

.anim-float-delayed {
    animation: float 6s ease-in-out infinite;
    animation-delay: 3s;
}

.anim-fade-in {
    opacity: 0;
    animation: fade-in-up 0.8s ease forwards;
    animation-delay: 0.3s;
}

.anim-rotate {
    transform-box: fill-box;
    transform-origin: center;
    animation: rotate-geom 20s linear infinite;
}

.anim-pulse {
    animation: pulse-opacity 3s ease-in-out infinite;
}

/* 响应式网格 */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
    gap: var(--gap);
}

.text-col {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.visual-col {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 减少动态效果偏好设置 */
@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;
    }
    .anim-draw, .anim-float, .anim-fade-in, .anim-rotate, .anim-pulse {
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
        stroke-dashoffset: 0 !important;
    }
}

/* 兜底：裁掉横向溢出 */
body > * {
  overflow-x: clip;
}
