/* =========================================
   SafeW 全站共享样式 (Style System)
   ========================================= */

/* 1. 基础重置与变量定义 */
:root {
    /* 色板 */
    --color-dark-surface: #121531;
    --color-paper: #E8E9EA;
    --color-text-body: #151723;
    --color-brand: #142CEB;
    --color-accent: #ED7D6E;

    /* 结构性 Token */
    --radius-card: 24px;
    --radius-btn: 999px;
    --card-border: 2px solid var(--color-text-body);
    --card-shadow: 4px 4px 0 var(--color-text-body);
    --section-y: clamp(5rem, 10vw, 9rem);
    --gap: clamp(1.5rem, 3vw, 2.5rem);
    --content-max: 1280px;

    /* 排版 */
    --font-base: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --h1-size: clamp(2.4rem, 6vw, 4.5rem);
    --h2-size: clamp(1.8rem, 4vw, 3rem);
    --h3-size: clamp(1.4rem, 2.5vw, 1.8rem);
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-base);
    background-color: var(--color-paper);
    color: var(--color-text-body);
    line-height: 1.75;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s ease;
}

img, svg {
    display: block;
    max-width: 100%;
}

ul, ol {
    list-style: none;
}

/* 2. 通用容器与排版 */
.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;
}

/* 分割线风格 */
.divider-line {
    height: 1px;
    background-color: var(--color-text-body);
    opacity: 0.15;
    width: 100%;
}

/* 眉标 (Label) */
.label {
    display: inline-block;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: 1rem;
    color: var(--color-brand);
}

.dark-surface .label {
    color: var(--color-accent);
}

/* 标题系统 */
h1, h2, h3, h4 {
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.1;
    margin-bottom: 1.5rem;
}

h1 {
    font-size: var(--h1-size);
    line-height: 1.1;
}

h2 {
    font-size: var(--h2-size);
    line-height: 1.2;
}

h3 {
    font-size: var(--h3-size);
}

/* 关键词高亮 */
.hl {
    color: var(--color-brand);
}

.dark-surface .hl {
    color: var(--color-accent);
}

/* 3. 组件：按钮 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    height: 52px;
    padding: 0 2rem;
    border-radius: var(--radius-btn);
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
    white-space: nowrap;
}

.btn-primary {
    background-color: var(--color-accent);
    color: var(--color-dark-surface);
    border: none;
    box-shadow: 2px 2px 0 rgba(0,0,0,0.1);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 4px 4px 0 rgba(0,0,0,0.15);
}

.btn-secondary {
    background-color: transparent;
    color: var(--color-text-body);
    border: 2px solid var(--color-text-body);
}

.dark-surface .btn-secondary {
    color: var(--color-paper);
    border-color: var(--color-paper);
}

.btn-secondary:hover {
    background-color: rgba(0,0,0,0.05);
}

.dark-surface .btn-secondary:hover {
    background-color: rgba(255,255,255,0.1);
}

.btn:focus-visible {
    outline: 3px solid var(--color-accent);
    outline-offset: 4px;
}

/* 图标尺寸 */
.icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* 4. 组件：卡片与面板 */
.card {
    background-color: var(--color-paper);
    border: var(--card-border);
    box-shadow: var(--card-shadow);
    border-radius: var(--radius-card);
    padding: 2rem;
    transition: transform 0.2s ease;
}

.card:hover {
    transform: translateY(-4px);
}

.dark-surface .card {
    /* 深色面上的浅色卡片恢复纸面取色 */
    background-color: var(--color-paper);
    color: var(--color-text-body);
    border-color: var(--color-text-body);
}

.visual-panel {
    background-color: var(--color-dark-surface);
    border-radius: var(--radius-card);
    padding: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    position: relative;
    overflow: hidden;
}

/* 5. 页头 (Header) */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: var(--color-paper);
    border-bottom: 1px solid rgba(0,0,0,0.05);
    padding: 1rem 0;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 800;
    font-size: 1.25rem;
    color: var(--color-text-body);
}

.brand-logo img {
    height: 32px;
    width: auto;
}

.main-nav ul {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.main-nav a {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--color-text-body);
    position: relative;
}

.main-nav a:hover {
    color: var(--color-brand);
}

.main-nav [aria-current="page"] {
    color: var(--color-brand);
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

@media (max-width: 768px) {
    .main-nav {
        display: none; /* 简化处理，移动端隐藏菜单，实际需JS控制 */
    }
    .mobile-menu-btn {
        display: block;
    }
}

/* 6. 页脚 (Footer) */
.site-footer {
    background-color: var(--color-dark-surface);
    color: var(--color-paper);
    padding: 4rem 0;
    margin-top: auto;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 3rem;
}

.footer-col h4 {
    color: var(--color-accent);
    font-size: 1rem;
    margin-bottom: 1.25rem;
}

.footer-col ul li {
    margin-bottom: 0.75rem;
}

.footer-col a {
    color: var(--color-paper);
    opacity: 0.8;
}

.footer-col a:hover {
    opacity: 1;
    text-decoration: underline;
}

.footer-bottom {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    text-align: center;
    font-size: 0.85rem;
    opacity: 0.6;
}

@media (max-width: 768px) {
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

/* 7. SVG 动效 (Keyframes & Classes) */
@keyframes orbit-breathe {
    0%, 100% {
        transform: scale(0.95);
        opacity: 0.6;
    }
    50% {
        transform: scale(1.05);
        opacity: 1;
    }
}

@keyframes float-up {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-8px);
    }
}

.svg-orbit {
    animation: orbit-breathe 6s ease-in-out infinite;
    transform-origin: center;
    transform-box: fill-box;
}

.svg-float {
    animation: float-up 4s ease-in-out infinite;
    transform-origin: center;
    transform-box: fill-box;
}

/* 延迟错开动画 */
.delay-1 { animation-delay: 0.5s; }
.delay-2 { animation-delay: 1.2s; }
.delay-3 { animation-delay: 2s; }

/* 减少动态效果适配 */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* 8. 特殊区块样式 */
/* FAQ Details */
details {
    border: var(--card-border);
    border-radius: var(--radius-card);
    margin-bottom: 1rem;
    background-color: var(--color-paper);
    overflow: hidden;
}

summary {
    padding: 1.5rem;
    font-weight: 700;
    cursor: pointer;
    list-style: none;
    position: relative;
    padding-right: 3rem;
}

summary::-webkit-details-marker {
    display: none;
}

summary::after {
    content: '+';
    position: absolute;
    right: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.5rem;
    color: var(--color-brand);
    font-weight: 400;
}

details[open] summary::after {
    content: '-';
}

details p {
    padding: 0 1.5rem 1.5rem 1.5rem;
    color: var(--color-text-body);
    opacity: 0.9;
}

/* News Cards */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--gap);
}

.news-card {
    background-color: var(--color-paper);
    border: var(--card-border);
    border-radius: var(--radius-card);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.news-date {
    font-size: 0.85rem;
    color: var(--color-brand);
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.news-card h3 {
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
    line-height: 1.3;
}

.news-card p {
    font-size: 0.95rem;
    line-height: 1.6;
    opacity: 0.85;
}

/* Table Styles */
.spec-table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
    font-size: 1rem;
}

.spec-table th, .spec-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid rgba(0,0,0,0.1);
}

.spec-table th {
    font-weight: 700;
    width: 30%;
    color: var(--color-brand);
}

.dark-surface .spec-table th {
    color: var(--color-accent);
}

@media (max-width: 600px) {
    .spec-table th, .spec-table td {
        display: block;
        width: 100%;
    }
    .spec-table th {
        padding-bottom: 0.25rem;
    }
    .spec-table td {
        padding-top: 0.25rem;
        padding-bottom: 1.5rem;
        opacity: 0.8;
    }
}

/* Grid Layouts for Content */
.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--gap);
}

.grid-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--gap);
    align-items: center;
}

@media (max-width: 900px) {
    .grid-split {
        grid-template-columns: 1fr;
    }
    .grid-split.reverse {
        display: flex;
        flex-direction: column;
    }
}

/* Timeline Steps */
.timeline-step {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.step-number {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    background-color: var(--color-accent);
    color: var(--color-dark-surface);
    font-weight: 800;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
}

.step-content h3 {
    margin-bottom: 0.5rem;
    font-size: 1.25rem;
}

/* Accessibility Focus */
*:focus-visible {
    outline: 3px solid var(--color-accent);
    outline-offset: 2px;
}
