/* =========================================
   SafeW 全站共享样式 (style.css)
   ========================================= */

/* --- 设计 Token & 变量 --- */
:root {
    /* 颜色系统 */
    --color-dark-bg: #13102D;
    --color-paper: #F7F5F3;
    --color-text-main: #171523;
    --color-brand: #2714EB;
    --color-accent: #89ED6E;
    
    /* 派生颜色 (用于边框、次要文字) */
    --color-border: 1px solid rgba(23, 21, 35, 0.16);
    --color-text-secondary: rgba(23, 21, 35, 0.65);
    --color-dark-text: #F7F5F3;
    --color-dark-accent: #89ED6E;

    /* 尺寸与间距 */
    --radius-card: 24px;
    --radius-btn: 999px;
    --section-y: clamp(2.5rem, 5vw, 4rem);
    --gap: clamp(0.75rem, 1.5vw, 1.25rem);
    --content-max: 960px;
    
    /* 字体 */
    --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-weight-bold: 800;
    --font-weight-normal: 400;
}

/* --- 基础重置 --- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    color: var(--color-text-main);
    background-color: var(--color-paper);
    line-height: 1.55;
    -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);
}

/* --- 文本排版 --- */
h1, h2, h3, h4 {
    font-weight: var(--font-weight-bold);
    letter-spacing: -0.02em;
    line-height: 1.1;
    color: var(--color-text-main);
}

h1 {
    font-size: clamp(2.4rem, 6vw, 4.5rem);
    margin-bottom: 1rem;
}

h2 {
    font-size: clamp(1.6rem, 3vw, 2.4rem);
    margin-bottom: var(--gap);
}

h3 {
    font-size: clamp(1.25rem, 2vw, 1.5rem);
    margin-bottom: 0.75rem;
}

p {
    margin-bottom: 1rem;
    max-width: 38em;
}

.hl {
    color: var(--color-brand);
}

.dark-mode .hl {
    color: var(--color-accent);
}

/* 眉标 */
.badge {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
    color: var(--color-brand);
}

.dark-mode .badge {
    color: var(--color-accent);
}

/* --- 按钮 --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 48px;
    padding: 0 24px;
    border-radius: var(--radius-btn);
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: transform 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
    border: none;
    gap: 8px;
}

.btn-primary {
    background-color: var(--color-accent);
    color: var(--color-dark-bg);
}

.btn-primary:hover {
    transform: translateY(-2px);
    filter: brightness(1.05);
}

.btn-primary:focus-visible {
    outline: 3px solid var(--color-brand);
    outline-offset: 2px;
}

.btn-outline {
    background-color: transparent;
    border: 2px solid var(--color-text-main);
    color: var(--color-text-main);
}

.dark-mode .btn-outline {
    border-color: var(--color-dark-text);
    color: var(--color-dark-text);
}

.btn-outline:hover {
    background-color: rgba(23, 21, 35, 0.05);
}

.dark-mode .btn-outline:hover {
    background-color: rgba(247, 245, 243, 0.1);
}

.btn-icon {
    width: 20px;
    height: 20px;
    stroke-width: 2;
}

/* --- 卡片 --- */
.card {
    background: var(--color-paper);
    border: var(--card-border);
    border-radius: var(--radius-card);
    padding: 24px;
    box-shadow: var(--card-shadow);
    transition: transform 0.2s ease;
}

.card:hover {
    transform: translateY(-4px);
}

/* --- 表格 --- */
.table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius-card);
    border: var(--card-border);
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

th, td {
    padding: 16px 24px;
    border-bottom: var(--card-border);
}

th {
    background-color: rgba(23, 21, 35, 0.03);
    font-weight: 700;
    color: var(--color-text-main);
}

td {
    color: var(--color-text-main);
}

tr:last-child td {
    border-bottom: none;
}

/* --- FAQ (Details/Summary) --- */
.faq-item {
    border-bottom: var(--card-border);
    margin-bottom: 1rem;
}

.faq-item summary {
    padding: 16px 0;
    font-weight: 700;
    cursor: pointer;
    list-style: none;
    position: relative;
    padding-right: 40px;
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-item summary::after {
    content: '+';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.5rem;
    font-weight: 400;
    color: var(--color-brand);
}

.faq-item[open] summary::after {
    content: '−';
}

.faq-item p {
    margin-top: 0.5rem;
    color: var(--color-text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
}

/* --- 核心功能 Tab (纯 CSS 实现) --- */
.tabs-nav {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(23, 21, 35, 0.1);
    margin-bottom: 24px;
}

.tabs-nav input[type="radio"] {
    display: none;
}

.tabs-nav label {
    padding: 12px 24px;
    font-weight: 700;
    cursor: pointer;
    border-radius: var(--radius-btn);
    white-space: nowrap;
    color: var(--color-text-secondary);
    transition: all 0.2s ease;
}

.tabs-nav label:hover {
    background-color: rgba(23, 21, 35, 0.05);
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

#tab1:checked ~ .tabs-container .tab-content:nth-of-type(1),
#tab2:checked ~ .tabs-container .tab-content:nth-of-type(2),
#tab3:checked ~ .tabs-container .tab-content:nth-of-type(3),
#tab4:checked ~ .tabs-container .tab-content:nth-of-type(4) {
    display: block;
}

#tab1:checked ~ .tabs-nav label[for="tab1"],
#tab2:checked ~ .tabs-nav label[for="tab2"],
#tab3:checked ~ .tabs-nav label[for="tab3"],
#tab4:checked ~ .tabs-nav label[for="tab4"] {
    background-color: var(--color-brand);
    color: #fff;
}

/* --- 快速开始 (Timeline) --- */
.timeline-step {
    display: flex;
    gap: 24px;
    margin-bottom: 32px;
    position: relative;
}

.timeline-step:not(:last-child)::before {
    content: '';
    position: absolute;
    left: 24px; /* Icon center */
    top: 56px;
    bottom: -32px;
    width: 2px;
    background-color: rgba(23, 21, 35, 0.1);
}

.step-number {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    background-color: var(--color-accent);
    color: var(--color-dark-bg);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.25rem;
}

/* --- 新闻卡片 --- */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}

.news-card {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.news-date {
    font-size: 0.85rem;
    color: var(--color-text-secondary);
    margin-bottom: 8px;
}

/* --- 页头与页脚 --- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: rgba(247, 245, 243, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(23, 21, 35, 0.05);
    padding: 16px 0;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 800;
    font-size: 1.25rem;
}

.logo img {
    height: 32px;
    width: auto;
}

.nav-links {
    display: flex;
    gap: 24px;
    align-items: center;
}

.nav-link {
    font-weight: 600;
    color: var(--color-text-secondary);
    transition: color 0.2s;
}

.nav-link:hover, .nav-link[aria-current="page"] {
    color: var(--color-brand);
}

.site-footer {
    background-color: var(--color-dark-bg);
    color: var(--color-dark-text);
    padding: 64px 0 32px;
    margin-top: auto;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 48px;
    margin-bottom: 48px;
}

.footer-col h4 {
    color: var(--color-accent);
    margin-bottom: 24px;
    font-size: 1rem;
}

.footer-col a {
    display: block;
    color: rgba(247, 245, 243, 0.7);
    margin-bottom: 12px;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.footer-col a:hover {
    color: var(--color-accent);
}

.footer-bottom {
    border-top: 1px solid rgba(247, 245, 243, 0.1);
    padding-top: 32px;
    text-align: center;
    font-size: 0.85rem;
    color: rgba(247, 245, 243, 0.4);
}

/* --- SVG 动效 Keyframes --- */
@keyframes orbit-breathe {
    0%, 100% { transform: scale(1); opacity: 0.3; }
    50% { transform: scale(1.05); opacity: 0.6; }
}

@keyframes bubble-float {
    0% { transform: translateY(10px); opacity: 0; }
    20% { opacity: 1; }
    80% { opacity: 1; }
    100% { transform: translateY(-10px); opacity: 0; }
}

@keyframes dot-breathe {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

@keyframes slide-in {
    from { transform: translateX(20px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* --- 动效类应用 --- */
.svg-orbit {
    animation: orbit-breathe 6s ease-in-out infinite;
    transform-origin: center;
}

.svg-orbit-delayed {
    animation: orbit-breathe 8s ease-in-out infinite;
    animation-delay: 2s;
    transform-origin: center;
}

.svg-bubble {
    animation: bubble-float 4s ease-in-out infinite;
}

.svg-dot {
    animation: dot-breathe 2s ease-in-out infinite;
}

/* --- 响应式调整 --- */
@media (max-width: 768px) {
    .nav-links {
        display: none; /* 简化版：移动端隐藏导航，实际项目应加汉堡菜单 */
    }
    
    .header-inner .btn {
        display: none;
    }
    
    /* 移动端显示一个简单的登录/下载入口，这里仅做演示 */
    .mobile-menu-trigger {
        display: block;
    }
    
    .timeline-step {
        flex-direction: column;
        gap: 12px;
    }
    
    .timeline-step:not(:last-child)::before {
        left: 24px;
        top: 48px;
        bottom: -12px;
    }
}

@media (min-width: 769px) {
    .mobile-menu-trigger {
        display: none;
    }
}

/* --- 减少动态效果 --- */
@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;
    }
    
    .svg-orbit, .svg-orbit-delayed, .svg-bubble, .svg-dot {
        animation: none;
    }
}

/* --- 辅助类 --- */
.text-center { text-align: center; }
.mt-1 { margin-top: var(--gap); }
.mb-1 { margin-bottom: var(--gap); }
.grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 32px;
}
.flex-row {
    display: flex;
    gap: 24px;
    align-items: center;
}
.flex-col {
    display: flex;
    flex-direction: column;
}
