/* =========================================
   SafeW Global Styles & Design System
   ========================================= */

/* --- 设计变量与 Token --- */
:root {
    /* 色板 */
    --color-dark: #21163C;
    --color-paper: #E9E8EA;
    --color-text: #191523;
    --color-brand: #5214EB;
    --color-accent: #ED926E;

    /* 结构性约束 */
    --radius-card: 20px;
    --radius-btn: 12px;
    --card-border: 0;
    --card-shadow: 0 10px 28px -14px rgba(25, 21, 35, 0.3);
    --section-y: clamp(3.5rem, 7vw, 6rem);
    --gap: clamp(1rem, 2vw, 1.75rem);
    --content-max: 960px;

    /* 字体 */
    --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* --- 基础排版与重置 --- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-family: var(--font-sans);
    background-color: var(--color-paper);
    color: var(--color-text);
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

body {
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

ul, ol {
    list-style: none;
}

img, svg {
    display: block;
    max-width: 100%;
}

/* --- 容器与网格 --- */
.container {
    max-width: var(--content-max);
    margin: 0 auto;
    padding: 0 var(--gap);
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
    gap: var(--gap);
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
    gap: var(--gap);
}

/* --- 头部与导航 --- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: rgba(233, 232, 234, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(25, 21, 35, 0.08);
    transition: background-color 0.3s ease;
}

.header-inner {
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 800;
    font-size: 1.25rem;
    letter-spacing: -0.02em;
}

.brand-logo img {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.nav-links {
    display: flex;
    gap: clamp(1rem, 2vw, 2rem);
    align-items: center;
}

.nav-link {
    font-size: 0.95rem;
    font-weight: 500;
    transition: color 0.2s ease;
}

.nav-link:hover, .nav-link[aria-current="page"] {
    color: var(--color-brand);
}

/* --- 按钮组件 --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    height: 48px;
    padding: 0 24px;
    border-radius: var(--radius-btn);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
    white-space: nowrap;
}

.btn:focus-visible {
    outline: 3px solid var(--color-brand);
    outline-offset: 2px;
}

.btn-primary {
    background-color: var(--color-accent);
    color: var(--color-dark);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(237, 146, 110, 0.4);
}

.btn-secondary {
    background-color: transparent;
    color: var(--color-text);
    border: 1px solid var(--color-text);
}

.btn-secondary:hover {
    background-color: rgba(25, 21, 35, 0.05);
    transform: translateY(-1px);
}

/* --- 区块通用样式 --- */
.section {
    padding-top: var(--section-y);
    padding-bottom: var(--section-y);
    border-bottom: 1px solid rgba(25, 21, 35, 0.1);
}

.section:last-of-type {
    border-bottom: none;
}

.section-label {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--color-brand);
    margin-bottom: 12px;
}

.section-title {
    font-size: clamp(1.6rem, 3vw, 2.4rem);
    font-weight: 700;
    letter-spacing: 0.02em;
    line-height: 1.25;
    margin-bottom: 24px;
    color: var(--color-text);
}

.section-desc {
    font-size: 1.125rem;
    color: var(--color-text);
    max-width: 38em;
    line-height: 1.7;
    margin-bottom: 32px;
}

/* --- 页面特定背景覆盖 --- */
.dark-surface {
    background-color: var(--color-dark);
    color: var(--color-paper);
    border-bottom: none;
}

.dark-surface .section-label {
    color: var(--color-accent);
}

.dark-surface .section-title {
    color: var(--color-paper);
}

.light-paper {
    background-color: var(--color-paper);
    color: var(--color-text);
}

/* --- 卡片组件 --- */
.card {
    background-color: #fff;
    border: var(--card-border);
    box-shadow: var(--card-shadow);
    border-radius: var(--radius-card);
    padding: 24px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 14px 32px -12px rgba(25, 21, 35, 0.35);
}

.card-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--color-text);
}

.card-text {
    font-size: 0.95rem;
    color: var(--color-text);
    line-height: 1.6;
}

/* --- 表格组件 --- */
.spec-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 1rem;
    margin-top: 16px;
}

.spec-table th, .spec-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid rgba(25, 21, 35, 0.1);
}

.spec-table th {
    font-weight: 700;
    color: var(--color-text);
    width: 40%;
}

.spec-table td {
    color: var(--color-text);
}

/* --- FAQ 组件 --- */
.faq-list details {
    margin-bottom: 12px;
    border: 1px solid rgba(25, 21, 35, 0.1);
    border-radius: var(--radius-btn);
    overflow: hidden;
    background-color: #fff;
}

.faq-list summary {
    padding: 16px 24px;
    font-weight: 600;
    cursor: pointer;
    list-style: none;
    position: relative;
    padding-right: 40px;
}

.faq-list summary::-webkit-details-marker {
    display: none;
}

.faq-list summary::after {
    content: "+";
    position: absolute;
    right: 24px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2rem;
    font-weight: 400;
    color: var(--color-brand);
    transition: transform 0.2s ease;
}

.faq-list details[open] summary::after {
    transform: translateY(-50%) rotate(45deg);
}

.faq-list .faq-answer {
    padding: 0 24px 20px 24px;
    font-size: 1rem;
    color: var(--color-text);
    line-height: 1.7;
    border-top: 1px solid rgba(25, 21, 35, 0.05);
}

/* --- 页脚 --- */
.site-footer {
    background-color: var(--color-dark);
    color: var(--color-paper);
    padding: 64px 0 32px;
    border-top: 1px solid rgba(233, 232, 234, 0.1);
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 32px;
    margin-bottom: 48px;
}

.footer-heading {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--color-paper);
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a {
    font-size: 0.95rem;
    color: rgba(233, 232, 234, 0.7);
    transition: color 0.2s ease;
}

.footer-links a:hover {
    color: var(--color-accent);
}

.footer-bottom {
    padding-top: 32px;
    border-top: 1px solid rgba(233, 232, 234, 0.1);
    font-size: 0.9rem;
    color: rgba(233, 232, 234, 0.5);
    text-align: center;
}

/* --- SVG 动效 Keyframes --- */
@keyframes orbit-breathe {
    0%, 100% { transform: scale(0.96); opacity: 0.7; }
    50% { transform: scale(1.04); opacity: 1; }
}

@keyframes bubble-float {
    0%, 100% { transform: translateY(0); opacity: 0.8; }
    50% { transform: translateY(-6px); opacity: 1; }
}

@keyframes input-breathe {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
}

@keyframes slide-in-left {
    from { transform: translateX(-20px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* --- 动效 Class 应用 --- */
.anim-orbit {
    animation: orbit-breathe 6s ease-in-out infinite;
    transform-origin: center;
    transform-box: fill-box;
}

.anim-bubble {
    animation: bubble-float 4s ease-in-out infinite;
    transform-origin: center;
    transform-box: fill-box;
}

.anim-input-dot {
    animation: input-breathe 1.5s ease-in-out infinite;
}

.anim-slide-in {
    animation: slide-in-left 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

/* --- 减少动态效果偏好 --- */
@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;
    }
}

/* --- 辅助工具类 --- */
.text-accent { color: var(--color-accent); }
.text-brand { color: var(--color-brand); }
.hl { font-weight: 800; }
.step-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background-color: var(--color-accent);
    color: var(--color-dark);
    font-weight: 700;
    border-radius: 8px;
    margin-right: 12px;
    flex-shrink: 0;
}
.timeline-item {
    position: relative;
    padding-left: 24px;
    border-left: 2px solid rgba(25, 21, 35, 0.1);
    margin-bottom: 32px;
}
.timeline-item::before {
    content: '';
    position: absolute;
    left: -6px;
    top: 6px;
    width: 10px;
    height: 10px;
    background-color: var(--color-brand);
    border-radius: 50%;
}
.dark-surface .timeline-item {
    border-left-color: rgba(233, 232, 234, 0.15);
}
.dark-surface .timeline-item::before {
    background-color: var(--color-accent);
}

/* 兜底：裁掉横向溢出 */
body > * {
  overflow-x: clip;
}
