/* 
 * SafeW 全站共享样式表
 * Design Tokens & Reset
 */
:root {
    /* 色板 */
    --color-dark: #21163C;      /* 深色面 */
    --color-paper: #E9E8EA;     /* 浅色纸面 */
    --color-text: #191523;      /* 正文色 */
    --color-brand: #5214EB;     /* 品牌色 */
    --color-accent: #ED926E;    /* 朱红强调色 */
    
    /* 辅助色 */
    --color-border: rgba(25, 21, 35, 0.16);
    --color-white: #FFFFFF;
    
    /* 圆角 */
    --radius-card: 20px;
    --radius-btn: 12px;
    --radius-sm: 8px;
    
    /* 间距与布局 */
    --content-max: 1120px;
    --section-y: clamp(2.5rem, 5vw, 4rem);
    --gap: clamp(0.75rem, 1.5vw, 1.25rem);
    
    /* 字体 */
    --font-sans: -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;
}

body {
    font-family: var(--font-sans);
    color: var(--color-text);
    background-color: var(--color-paper);
    line-height: 1.55;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

img, svg {
    display: block;
    max-width: 100%;
}

a {
    color: inherit;
    text-decoration: none;
}

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);
    position: relative;
}

.section-dark {
    background-color: var(--color-dark);
    color: var(--color-paper);
}

.section-light {
    background-color: var(--color-paper);
    color: var(--color-text);
}

/* 排版层级 */
.h-badge {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
    color: var(--color-brand);
}

.section-dark .h-badge {
    color: var(--color-accent);
}

h1 {
    font-size: clamp(2.2rem, 5vw, 3.8rem);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.02em;
    margin-bottom: 1.5rem;
    text-wrap: balance;
}

h2 {
    font-size: clamp(1.6rem, 3vw, 2.4rem);
    font-weight: 700;
    line-height: 1.25;
    margin-bottom: 1rem;
    text-wrap: balance;
}

h3 {
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 0.75rem;
}

p {
    margin-bottom: 1rem;
    max-width: 38em;
}

.text-hl {
    color: var(--color-brand);
}

.section-dark .text-hl {
    color: var(--color-accent);
}

/* 按钮组件 */
.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, opacity 0.2s ease, background-color 0.2s ease;
    border: none;
}

.btn-primary {
    background-color: var(--color-accent);
    color: var(--color-dark);
}

.btn-primary:hover {
    transform: translateY(-2px);
    filter: brightness(1.05);
}

.btn-secondary {
    background-color: transparent;
    border: 1px solid var(--color-text);
    color: var(--color-text);
}

.section-dark .btn-secondary {
    border-color: var(--color-paper);
    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);
}

.btn:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

/* 卡片组件 */
.card {
    background-color: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-card);
    padding: 1.5rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.section-dark .card {
    background-color: rgba(255,255,255,0.05);
    border-color: rgba(255,255,255,0.1);
}

.card-grid {
    display: grid;
    gap: var(--gap);
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
}

/* 表格组件 */
.table-wrapper {
    overflow-x: auto;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-card);
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

th, td {
    padding: 1rem;
    border-bottom: 1px solid var(--color-border);
}

th {
    background-color: rgba(0,0,0,0.03);
    font-weight: 700;
}

td:last-child {
    text-align: right;
}

tr:last-child td {
    border-bottom: none;
}

/* 链接样式 */
.link-accent {
    color: var(--color-brand);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.section-dark .link-accent {
    color: var(--color-accent);
}

.link-accent:hover {
    opacity: 0.8;
}

/* 页头导航 */
header {
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: rgba(233, 232, 234, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--color-border);
    padding: 1rem 0;
}

.section-dark header {
    background-color: rgba(33, 22, 60, 0.9);
    border-bottom-color: rgba(255,255,255,0.1);
}

.nav-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 800;
    font-size: 1.25rem;
}

.brand-logo img {
    height: 32px;
    width: auto;
}

nav ul {
    display: flex;
    gap: 2rem;
    align-items: center;
}

nav a {
    font-weight: 500;
    font-size: 0.95rem;
    position: relative;
}

nav a[aria-current="page"] {
    color: var(--color-brand);
}

.section-dark nav a[aria-current="page"] {
    color: var(--color-accent);
}

@media (max-width: 768px) {
    nav ul {
        display: none; /* 简化处理，移动端隐藏菜单或改为汉堡包（此处为静态演示保持简洁） */
    }
    .mobile-menu-btn {
        display: block;
    }
}

/* SVG 动效关键帧 */
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-12px); }
}

@keyframes float-delayed {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

@keyframes draw-stroke {
    0% { stroke-dashoffset: 1; }
    100% { stroke-dashoffset: 0; }
}

@keyframes pulse-opacity {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
}

@keyframes slide-in-right {
    from { transform: translateX(20px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* SVG 动效类 */
.anim-float {
    animation: float 6s ease-in-out infinite;
    will-change: transform;
}

.anim-float-delayed {
    animation: float-delayed 7s ease-in-out infinite 1s;
    will-change: transform;
}

.anim-draw {
    pathLength: 1;
    stroke-dasharray: 1;
    stroke-dashoffset: 0;
    animation: draw-stroke 2s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.anim-breathe {
    animation: pulse-opacity 3s ease-in-out infinite;
}

.anim-pop-in {
    animation: slide-in-right 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

/* 减少动态效果适配 */
@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;
    }
}

/* 特定区块样式补充 */
.timeline-item {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 2rem;
    position: relative;
}

.timeline-marker {
    flex-shrink: 0;
    width: 60px;
    text-align: right;
    font-weight: 700;
    color: var(--color-brand);
    padding-top: 0.25rem;
}

.section-dark .timeline-marker {
    color: var(--color-accent);
}

.timeline-content {
    border-left: 2px solid var(--color-brand);
    padding-left: 1.5rem;
    position: relative;
}

.section-dark .timeline-content {
    border-color: var(--color-accent);
}

.timeline-content::before {
    content: '';
    position: absolute;
    left: -6px;
    top: 0;
    width: 10px;
    height: 10px;
    background-color: var(--color-brand);
    border-radius: 50%;
}

.section-dark .timeline-content::before {
    background-color: var(--color-accent);
}

details {
    border-bottom: 1px solid var(--color-border);
    padding: 1rem 0;
}

summary {
    font-weight: 600;
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

summary::-webkit-details-marker {
    display: none;
}

summary::after {
    content: '+';
    font-weight: 300;
    font-size: 1.2rem;
}

details[open] summary::after {
    content: '-';
}

details p {
    margin-top: 0.75rem;
    color: var(--color-text);
    opacity: 0.85;
}

.section-dark details p {
    color: var(--color-paper);
}

/* 步骤条 */
.steps-container {
    display: flex;
    gap: 1rem;
    counter-reset: step-counter;
}

.step-card {
    flex: 1;
    counter-increment: step-counter;
    position: relative;
}

.step-number {
    display: inline-block;
    width: 32px;
    height: 32px;
    background-color: var(--color-accent);
    color: var(--color-dark);
    font-weight: 800;
    border-radius: 8px;
    text-align: center;
    line-height: 32px;
    margin-bottom: 0.75rem;
}
