/* =========================================
   SafeW 全站共享样式
   ========================================= */

/* --- 设计 Token & 变量 --- */
:root {
    /* 颜色系统 */
    --color-dark-bg: #1B1231;
    --color-paper: #F4F3F7;
    --color-text: #191523;
    --color-brand: #5214EB;
    --color-accent: #9977EE;
    
    /* 结构尺寸 */
    --radius-card: 24px;
    --radius-btn: 999px;
    --card-border: 2px solid var(--color-text);
    --card-shadow: 4px 4px 0 var(--color-text);
    --section-y: clamp(3.5rem, 7vw, 6rem);
    --gap: clamp(1rem, 2vw, 1.75rem);
    --content-max: 1280px;

    /* 字体比例 */
    --font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", sans-serif;
    --h1-size: clamp(2rem, 4.6vw, 3.4rem);
    --h2-size: clamp(1.6rem, 3vw, 2.4rem);
    --text-base: 1.125rem; /* 18px */
    --line-height: 1.65;
}

/* --- 基础重置 --- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    color: var(--color-text);
    background-color: var(--color-paper);
    line-height: var(--line-height);
    -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;
}

/* --- 通用布局 --- */
.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 {
    height: 1px;
    background-color: rgba(25, 21, 35, 0.15);
    margin: 0 auto;
    max-width: calc(var(--content-max) + var(--gap) * 2);
}

/* --- 标题系统 --- */
.section-label {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: 0.75rem;
    color: var(--color-brand);
}

.dark-section .section-label {
    color: var(--color-accent);
}

h1 {
    font-size: var(--h1-size);
    font-weight: 600;
    line-height: 1.25;
    letter-spacing: 0;
    margin-bottom: 1.5rem;
    color: var(--color-text);
}

.dark-section h1 {
    color: var(--color-paper);
}

h2 {
    font-size: var(--h2-size);
    font-weight: 600;
    line-height: 1.25;
    margin-bottom: 1.5rem;
}

h3 {
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 1rem;
}

p {
    margin-bottom: 1.25rem;
    max-width: 38em;
}

strong {
    font-weight: 600;
}

/* --- 按钮 --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    height: 52px;
    padding: 0 24px;
    border-radius: var(--radius-btn);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, opacity 0.2s ease;
    white-space: nowrap;
}

.btn:hover {
    transform: translateY(-2px);
}

.btn:focus-visible {
    outline: 2px solid var(--color-brand);
    outline-offset: 2px;
}

.btn-primary {
    background-color: var(--color-accent);
    color: var(--color-dark-bg);
    border: none;
}

.btn-primary:hover {
    opacity: 0.9;
}

.btn-secondary {
    background-color: transparent;
    color: var(--color-text);
    border: 2px solid var(--color-text);
}

.dark-section .btn-secondary {
    color: var(--color-paper);
    border-color: var(--color-paper);
}

/* --- 导航栏 --- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: rgba(244, 243, 247, 0.9);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(25, 21, 35, 0.08);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--color-text);
}

.logo img {
    height: 32px;
    width: auto;
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    font-size: 0.95rem;
    font-weight: 500;
    transition: color 0.2s;
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
    color: var(--color-brand);
}

@media (max-width: 768px) {
    .nav-links {
        display: none; /* 移动端简化，仅保留主按钮 */
    }
    .header-inner .btn-primary {
        display: none;
    }
}

/* --- 卡片样式 --- */
.card {
    background-color: #fff;
    border: var(--card-border);
    border-radius: var(--radius-card);
    box-shadow: var(--card-shadow);
    padding: 2rem;
    transition: transform 0.3s ease;
}

.card:hover {
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0 var(--color-text);
}

/* --- 表格样式 --- */
.table-wrapper {
    overflow-x: auto;
    border: var(--card-border);
    border-radius: var(--radius-card);
    box-shadow: var(--card-shadow);
    background: #fff;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

th, td {
    padding: 1rem 1.5rem;
    text-align: left;
    border-bottom: 1px solid rgba(25, 21, 35, 0.1);
}

th {
    background-color: rgba(25, 21, 35, 0.03);
    font-weight: 600;
}

td:first-child {
    font-weight: 600;
    color: var(--color-brand);
}

tr:last-child td {
    border-bottom: none;
}

/* --- FAQ 样式 --- */
.faq-list {
    display: grid;
    gap: 1rem;
}

.faq-item details {
    background-color: #fff;
    border: var(--card-border);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 2px 2px 0 var(--color-text);
}

.faq-item summary {
    font-weight: 600;
    cursor: pointer;
    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: 400;
    color: var(--color-brand);
}

.faq-item details[open] summary::after {
    content: '−';
}

.faq-item p {
    margin-top: 1rem;
    margin-bottom: 0;
    font-size: 0.95rem;
    color: rgba(25, 21, 35, 0.85);
}

/* --- 页脚 --- */
.site-footer {
    background-color: var(--color-dark-bg);
    color: var(--color-paper);
    padding: 4rem 0 2rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-col h4 {
    color: var(--color-accent);
    margin-bottom: 1.5rem;
    font-size: 1rem;
}

.footer-col ul li {
    margin-bottom: 0.75rem;
}

.footer-col a:hover {
    color: var(--color-accent);
    text-decoration: underline;
}

.footer-bottom {
    border-top: 1px solid rgba(244, 243, 247, 0.1);
    padding-top: 2rem;
    text-align: center;
    font-size: 0.85rem;
    color: rgba(244, 243, 247, 0.5);
}

/* --- SVG 动效 --- */
.svg-visual {
    width: 100%;
    height: auto;
}

/* 卡片漂浮效果 */
.float-slow {
    animation: floatSlow 6s ease-in-out infinite;
}
.float-medium {
    animation: floatMedium 5s ease-in-out infinite;
    animation-delay: 1s;
}
.float-fast {
    animation: floatFast 4s ease-in-out infinite;
    animation-delay: 0.5s;
}

@keyframes floatSlow {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}
@keyframes floatMedium {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}
@keyframes floatFast {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

/* 呼吸灯效果 (Input dots) */
.breathe {
    animation: breathe 2s ease-in-out infinite;
}
.breathe-delay-1 { animation-delay: 0.2s; }
.breathe-delay-2 { animation-delay: 0.4s; }

@keyframes breathe {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

/* 线条流动 */
.flow-line {
    stroke-dasharray: 10 5;
    animation: flowDash 1s linear infinite;
}

@keyframes flowDash {
    to { stroke-dashoffset: -15; }
}

/* 减少动态效果适配 */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    .float-slow, .float-medium, .float-fast, .breathe, .flow-line {
        animation: none !important;
    }
}

/* --- 响应式微调 --- */
@media (max-width: 768px) {
    h1 { font-size: 2.2rem; }
    h2 { font-size: 1.8rem; }
    .hero-layout {
        flex-direction: column-reverse;
    }
    .grid-3 {
        grid-template-columns: 1fr;
    }
    .alt-row {
        flex-direction: column;
    }
    .alt-row.reverse {
        flex-direction: column;
    }
}

/* 兜底：裁掉横向溢出 */
body > * {
  overflow-x: clip;
}
