/* =========================================
   SafeW 全站共享样式 (style.css)
   ========================================= */

/* --- 1. 设计 Token & 变量定义 --- */
:root {
    /* 色彩系统 */
    --color-dark-surface: #240F29;
    --color-paper: #F6F3F7;
    --color-text-body: #201523;
    --color-brand: #A711CF;
    --color-accent: #ED6E73;

    /* 结构变量 */
    --radius-card: 0;
    --radius-btn: 0;
    --card-border: 0;
    --card-shadow: none;
    
    --section-y: clamp(2.5rem, 5vw, 4rem);
    --gap: clamp(0.75rem, 1.5vw, 1.25rem);
    --content-max: 1120px;

    /* 字体 */
    --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", sans-serif;
}

/* --- 2. 基础重置与排版 --- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-family: var(--font-sans);
    color: var(--color-text-body);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

body {
    background-color: var(--color-paper);
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

img, svg {
    display: block;
    max-width: 100%;
}

/* --- 3. 布局容器 --- */
.container {
    width: 100%;
    max-width: var(--content-max);
    margin: 0 auto;
    padding: 0 var(--gap);
}

/* --- 4. 页头与导航 --- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: rgba(246, 243, 247, 0.95);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(32, 21, 35, 0.08);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 800;
    font-size: 1.25rem;
    letter-spacing: -0.02em;
}

.brand-logo img {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.main-nav {
    display: flex;
    gap: 24px;
}

.main-nav a {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--color-text-body);
    transition: color 0.2s ease;
}

.main-nav a:hover,
.main-nav a[aria-current="page"] {
    color: var(--color-brand);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* --- 5. 按钮组件 --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    height: 48px;
    padding: 0 24px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: var(--radius-btn);
    cursor: pointer;
    transition: transform 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
    white-space: nowrap;
}

.btn:focus-visible {
    outline: 2px solid var(--color-brand);
    outline-offset: 2px;
}

.btn-primary {
    background-color: var(--color-accent);
    color: var(--color-dark-surface);
    border: 2px solid var(--color-accent);
}

.btn-primary:hover {
    transform: translateY(-2px);
    filter: brightness(0.95);
}

.btn-secondary {
    background-color: transparent;
    color: var(--color-text-body);
    border: 2px solid var(--color-text-body);
}

.btn-secondary:hover {
    transform: translateY(-2px);
    background-color: rgba(32, 21, 35, 0.05);
}

.btn-icon {
    width: 20px;
    height: 20px;
    stroke-width: 2;
}

/* --- 6. 通用区块样式 --- */
.section-block {
    padding-top: var(--section-y);
    padding-bottom: var(--section-y);
}

.section-header {
    margin-bottom: calc(var(--section-y) * 0.6);
}

.badge {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--color-brand);
    margin-bottom: 12px;
}

.dark-surface .badge {
    color: var(--color-accent);
}

.section-title {
    font-size: clamp(1.6rem, 3vw, 2.4rem);
    font-weight: 700;
    letter-spacing: 0.02em;
    line-height: 1.25;
    margin-bottom: 16px;
}

.hl {
    color: var(--color-brand);
}

.dark-surface .hl {
    color: var(--color-accent);
}

.text-intro {
    font-size: 1.125rem;
    line-height: 1.7;
    max-width: 65ch;
    margin-bottom: 32px;
}

/* --- 7. 卡片与面板 --- */
.card {
    background-color: rgba(32, 21, 35, 0.03);
    border: var(--card-border);
    box-shadow: var(--card-shadow);
    padding: 24px;
    border-radius: var(--radius-card);
}

.dark-surface .card {
    background-color: rgba(246, 243, 247, 0.08);
}

.panel {
    background-color: var(--color-dark-surface);
    border-radius: var(--radius-card);
    padding: 32px;
    position: relative;
    overflow: hidden;
}

/* --- 8. 表格样式 --- */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
    margin-top: 24px;
}

.data-table th,
.data-table td {
    padding: 16px;
    text-align: left;
    border-bottom: 1px solid rgba(32, 21, 35, 0.1);
}

.dark-surface .data-table th,
.dark-surface .data-table td {
    border-bottom: 1px solid rgba(246, 243, 247, 0.1);
}

.data-table th {
    font-weight: 700;
    color: var(--color-text-body);
}

.dark-surface .data-table th {
    color: var(--color-paper);
}

/* --- 9. FAQ 样式 --- */
.faq-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.faq-item {
    border: 1px solid rgba(32, 21, 35, 0.1);
    border-radius: var(--radius-card);
    overflow: hidden;
}

.dark-surface .faq-item {
    border-color: rgba(246, 243, 247, 0.1);
}

.faq-item summary {
    padding: 20px 24px;
    font-weight: 600;
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.2s;
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-item summary::after {
    content: "+";
    font-size: 1.25rem;
    font-weight: 400;
    color: var(--color-brand);
}

.faq-item[open] summary::after {
    content: "−";
}

.faq-item summary:hover {
    background-color: rgba(32, 21, 35, 0.03);
}

.dark-surface .faq-item summary:hover {
    background-color: rgba(246, 243, 247, 0.05);
}

.faq-answer {
    padding: 0 24px 24px;
    line-height: 1.7;
    color: var(--color-text-body);
}

.dark-surface .faq-answer {
    color: var(--color-paper);
}

/* --- 10. SVG 动效 Keyframes --- */
@keyframes draw-path {
    from { stroke-dashoffset: 1; }
    to { stroke-dashoffset: 0; }
}

@keyframes float-bubble {
    0%, 100% { transform: translateY(0); opacity: 0.8; }
    50% { transform: translateY(-6px); opacity: 1; }
}

@keyframes breathe-dots {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

@keyframes orbit-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes slide-in-right {
    from { transform: translateX(20px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* 动效类 */
.anim-draw {
    pathLength: 1;
    stroke-dasharray: 1;
    stroke-dashoffset: 0;
    animation: draw-path 2s ease-out forwards;
}

.anim-float {
    animation: float-bubble 4s ease-in-out infinite;
}

.anim-breathe {
    animation: breathe-dots 2s ease-in-out infinite;
}

.anim-orbit {
    transform-origin: center;
    animation: orbit-spin 20s linear infinite;
}

.anim-slide {
    animation: slide-in-right 0.8s ease-out forwards;
}

/* --- 11. 减少动态效果媒体查询 --- */
@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-breathe, .anim-orbit, .anim-slide {
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
    }
}

/* --- 12. 响应式调整 --- */
@media (max-width: 768px) {
    .header-inner {
        flex-wrap: wrap;
        height: auto;
        padding: 16px 0;
    }
    
    .main-nav {
        order: 3;
        width: 100%;
        justify-content: center;
        margin-top: 16px;
        padding-bottom: 16px;
        border-top: 1px solid rgba(32, 21, 35, 0.1);
    }

    .hero-grid {
        grid-template-columns: 1fr !important;
        gap: 48px;
    }

    .feature-grid {
        grid-template-columns: 1fr !important;
    }

    .scenario-row {
        grid-template-columns: 1fr !important;
        gap: 32px;
    }
    
    .news-grid {
        grid-template-columns: 1fr !important;
    }
}
