/* =========================================
   SafeW 全站共享样式
   设计 Token & 基础排版
   ========================================= */

:root {
    /* 色板 */
    --bg-deep: #13102D;
    --bg-paper: #F7F5F3;
    --text-body: #171523;
    --brand: #2714EB;
    --accent: #89ED6E;
    
    /* 结构性约束 */
    --radius-card: 24px;
    --radius-btn: 999px;
    --card-border: 0;
    --card-shadow: 0 10px 28px -14px rgba(23, 21, 35, 0.3);
    --section-y: clamp(3.5rem, 7vw, 6rem);
    --gap: clamp(1rem, 2vw, 1.75rem);
    --content-max: 1120px;
    
    /* 字体 */
    --font-main: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* 基础重置与排版 */
*, *::before, *::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--font-main);
    background-color: var(--bg-paper);
    color: var(--text-body);
    line-height: 1.65;
    -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;
    padding: 0;
    margin: 0;
}

/* 容器 */
.container {
    width: 100%;
    max-width: var(--content-max);
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--gap);
    padding-right: var(--gap);
}

/* 页面头部 */
.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.1);
    transition: background-color 0.3s ease;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 800;
    font-size: 1.25rem;
    color: var(--text-body);
}

.brand-logo img {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.nav-list {
    display: flex;
    gap: 24px;
    align-items: center;
}

.nav-link {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-body);
    transition: color 0.2s;
}

.nav-link:hover, .nav-link[aria-current="page"] {
    color: var(--brand);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 24px;
    height: 48px;
    border-radius: var(--radius-btn);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    border: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s;
}

.btn:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
}

.btn-primary {
    background-color: var(--accent);
    color: var(--bg-deep);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(137, 237, 110, 0.4);
}

.btn-secondary {
    background-color: transparent;
    border: 1px solid var(--text-body);
    color: var(--text-body);
}

.btn-secondary:hover {
    background-color: rgba(23, 21, 35, 0.05);
}

/* 页面底部 */
.site-footer {
    background-color: var(--bg-deep);
    color: var(--bg-paper);
    padding: 64px 0 32px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 48px;
    margin-bottom: 48px;
}

.footer-col h4 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--accent);
}

.footer-col ul li {
    margin-bottom: 12px;
}

.footer-col a {
    font-size: 0.9rem;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.footer-col a:hover {
    opacity: 1;
    color: var(--accent);
}

.footer-bottom {
    border-top: 1px solid rgba(247, 245, 243, 0.1);
    padding-top: 24px;
    text-align: center;
    font-size: 0.85rem;
    opacity: 0.6;
}

/* 通用区块样式 */
.section {
    padding-top: var(--section-y);
    padding-bottom: var(--section-y);
    position: relative;
}

.section-dark {
    background-color: var(--bg-deep);
    color: var(--bg-paper);
}

.section-light {
    background-color: var(--bg-paper);
    color: var(--text-body);
}

/* 眉标与标题 */
.breadcrumb-label {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 12px;
}

.paper-surface .breadcrumb-label {
    color: var(--brand);
}

.deep-surface .breadcrumb-label {
    color: var(--accent);
}

h1, h2, h3 {
    line-height: 1.2;
    margin-bottom: 16px;
}

h1 {
    font-size: clamp(2.2rem, 5vw, 4rem);
    font-weight: 800;
    letter-spacing: -0.02em;
}

h2 {
    font-size: clamp(1.6rem, 3vw, 2.4rem);
    font-weight: 700;
    letter-spacing: 0.02em;
}

h3 {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.hl {
    /* 高亮关键词 */
}

.paper-surface .hl {
    color: var(--brand);
}

.deep-surface .hl {
    color: var(--accent);
}

.text-intro {
    font-size: 1.125rem;
    line-height: 1.7;
    max-width: 680px;
    margin-bottom: 32px;
}

/* 按钮组 */
.btn-group {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

/* 卡片 */
.card {
    background-color: var(--bg-paper);
    border-radius: var(--radius-card);
    box-shadow: var(--card-shadow);
    padding: 32px;
    border: var(--card-border);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.deep-surface .card {
    background-color: var(--bg-paper);
    color: var(--text-body);
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 14px 32px -14px rgba(23, 21, 35, 0.4);
}

/* 网格布局工具 */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--gap);
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--gap);
}

@media (max-width: 768px) {
    .grid-2, .grid-3 {
        grid-template-columns: 1fr;
    }
    .nav-list {
        display: none; /* 简化移动端，实际项目需汉堡菜单 */
    }
    .mobile-menu-btn {
        display: block;
    }
}

/* 功能列表组件 */
.feature-list-item {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
}

.feature-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    color: var(--brand);
}

.deep-surface .feature-icon {
    color: var(--accent);
}

/* 表格 */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 24px;
    font-size: 0.95rem;
}

.data-table th, .data-table td {
    padding: 16px;
    text-align: left;
    border-bottom: 1px solid rgba(23, 21, 35, 0.1);
}

.data-table th {
    font-weight: 700;
    color: var(--brand);
    width: 30%;
}

.deep-surface .data-table th {
    color: var(--accent);
}

.deep-surface .data-table td, .deep-surface .data-table th {
    border-bottom-color: rgba(247, 245, 243, 0.1);
}

/* FAQ 组件 */
.faq-details {
    margin-bottom: 16px;
    border-bottom: 1px solid rgba(23, 21, 35, 0.1);
}

.faq-summary {
    padding: 20px 0;
    font-weight: 600;
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.faq-summary::-webkit-details-marker {
    display: none;
}

.faq-summary::after {
    content: "+";
    font-size: 1.5rem;
    font-weight: 300;
    transition: transform 0.3s;
}

.faq-details[open] .faq-summary::after {
    transform: rotate(45deg);
}

.faq-answer {
    padding-bottom: 20px;
    color: var(--text-body);
    opacity: 0.9;
}

.deep-surface .faq-details {
    border-bottom-color: rgba(247, 245, 243, 0.15);
}

.deep-surface .faq-answer {
    color: var(--bg-paper);
}

/* 步骤条 */
.step-bar {
    display: flex;
    gap: 24px;
    overflow-x: auto;
    padding-bottom: 16px;
}

.step-item {
    flex: 1;
    min-width: 200px;
    counter-increment: step-counter;
}

.step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background-color: var(--accent);
    color: var(--bg-deep);
    font-weight: 700;
    border-radius: 8px;
    margin-bottom: 12px;
}

/* 资讯卡片 */
.news-card {
    background-color: var(--bg-paper);
    border-radius: var(--radius-card);
    overflow: hidden;
    box-shadow: var(--card-shadow);
    display: flex;
    flex-direction: column;
}

.news-card-content {
    padding: 24px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.news-date {
    font-size: 0.8rem;
    color: var(--brand);
    margin-bottom: 8px;
    font-weight: 600;
}

.deep-surface .news-date {
    color: var(--accent);
}

.news-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 12px;
    line-height: 1.4;
}

.news-excerpt {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-body);
    opacity: 0.85;
}

/* 场景卡片 */
.scenario-card {
    border-left: 4px solid var(--brand);
    background-color: rgba(39, 20, 235, 0.04);
    padding: 24px;
    border-radius: 0 var(--radius-card) var(--radius-card) 0;
    margin-bottom: 24px;
}

.deep-surface .scenario-card {
    border-left-color: var(--accent);
    background-color: rgba(137, 237, 110, 0.1);
}

.scenario-tag {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
    color: var(--brand);
}

.deep-surface .scenario-tag {
    color: var(--accent);
}

/* SVG 动效关键帧 */
@keyframes grid-pulse {
    0% { stroke-dashoffset: 1; opacity: 0.3; }
    50% { stroke-dashoffset: 0; opacity: 1; }
    100% { stroke-dashoffset: 1; opacity: 0.3; }
}

@keyframes float-bubble {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

@keyframes fade-in-up {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 动效类 */
.anim-node {
    stroke-dasharray: 1;
    stroke-dashoffset: 0;
    animation: grid-pulse 3s ease-in-out infinite;
}

.anim-node:nth-child(odd) { animation-delay: 0.5s; }
.anim-node:nth-child(3n) { animation-delay: 1s; }

.anim-float {
    animation: float-bubble 4s ease-in-out infinite;
}

.anim-fade {
    animation: fade-in-up 0.8s ease-out forwards;
}

/* 减少动态效果偏好 */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    .anim-node, .anim-float, .anim-fade {
        animation: none;
        opacity: 1;
        transform: none;
    }
}
