/* =========================================
   SafeW 全站共享样式 (Style Tokens)
   ========================================= */

:root {
    /* --- 色板 (Palette) --- */
    --color-deep-bg: #240F29;
    --color-paper: #F6F3F7;
    --color-text: #201523;
    --color-brand: #A711CF;
    --color-accent: #ED6E73;
    
    /* --- 几何与间距 (Geometry & Spacing) --- */
    --radius-card: 0;
    --radius-btn: 0;
    --content-max: 1280px;
    --section-y: clamp(3.5rem, 7vw, 6rem);
    --gap: clamp(1rem, 2vw, 1.75rem);
    
    /* --- 装饰 (Decoration) --- */
    --card-border: 2px solid var(--color-text);
    --card-shadow: 4px 4px 0 var(--color-text);
    --btn-shadow: 3px 3px 0 rgba(0,0,0,0.2);
    
    /* --- 排版 (Typography) --- */
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --lh-tight: 1.1;
    --lh-body: 1.65;
}

/* --- 基础重置 (Reset) --- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: var(--font-sans);
    color: var(--color-text);
    background-color: var(--color-paper);
    line-height: var(--lh-body);
    -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; transition: color 0.2s ease; }
ul, ol { padding-left: 0; list-style: none; }

/* --- 布局容器 (Layout) --- */
.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 {
    border: none;
    border-top: 1px solid rgba(32, 21, 35, 0.1);
    margin: 0;
}

/* --- 页头 (Header) --- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: var(--color-paper);
    border-bottom: 1px solid rgba(32, 21, 35, 0.1);
    padding: 16px 0;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 800;
    font-size: 1.25rem;
    letter-spacing: -0.02em;
}

.brand img {
    height: 32px;
    width: auto;
}

.nav-links {
    display: flex;
    gap: 24px;
    align-items: center;
}

.nav-link {
    font-weight: 600;
    font-size: 0.95rem;
    padding: 8px 0;
    position: relative;
}

.nav-link:hover { color: var(--color-brand); }
.nav-link[aria-current="page"] { color: var(--color-brand); }

/* --- 按钮 (Buttons) --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-family: inherit;
    font-weight: 700;
    font-size: 1rem;
    padding: 0 24px;
    height: 48px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
    border: none;
    white-space: nowrap;
}

.btn-primary {
    background-color: var(--color-accent);
    color: var(--color-deep-bg);
    box-shadow: var(--btn-shadow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 5px 5px 0 rgba(0,0,0,0.25);
}

.btn-secondary {
    background-color: transparent;
    color: var(--color-text);
    border: 2px solid var(--color-text);
    box-shadow: 2px 2px 0 var(--color-text);
}

.btn-secondary:hover {
    background-color: rgba(0,0,0,0.05);
    transform: translateY(-2px);
}

.btn:focus-visible, .nav-link:focus-visible {
    outline: 3px solid var(--color-accent);
    outline-offset: 2px;
}

/* --- 排版组件 (Typography Components) --- */
.hero-h1 {
    font-size: clamp(2.4rem, 6vw, 4.5rem);
    font-weight: 800;
    line-height: var(--lh-tight);
    letter-spacing: -0.02em;
    margin: 0 0 24px 0;
    word-break: keep-all;
}

.section-title {
    font-size: clamp(1.6rem, 3vw, 2.4rem);
    font-weight: 800;
    line-height: var(--lh-tight);
    letter-spacing: -0.02em;
    margin: 0 0 48px 0;
    word-break: keep-all;
}

.highlight { color: var(--color-brand); }
.deep-highlight { color: var(--color-accent); }

.masthead {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 16px;
    display: block;
}

.paper-theme .masthead { color: var(--color-brand); }
.deep-theme .masthead { color: var(--color-accent); }

/* --- 卡片与面板 (Cards & Panels) --- */
.card {
    background: #fff;
    border: var(--card-border);
    box-shadow: var(--card-shadow);
    padding: 24px;
    border-radius: var(--radius-card);
    height: 100%;
}

.panel {
    background-color: var(--color-deep-bg);
    border-radius: var(--radius-card);
    padding: 32px;
    color: var(--color-paper);
    position: relative;
    overflow: hidden;
}

/* --- 首页特定模块样式 (Home Modules) --- */

/* Hero */
.hero-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    align-items: center;
}

.hero-actions {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 32px;
}

.hero-fact {
    margin-top: 24px;
    font-size: 0.85rem;
    opacity: 0.8;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Steps */
.steps-container {
    display: flex;
    gap: 24px;
    counter-reset: step;
}

.step-item {
    flex: 1;
    position: relative;
}

.step-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background-color: var(--color-accent);
    color: var(--color-deep-bg);
    font-weight: 800;
    font-size: 0.9rem;
    margin-bottom: 16px;
}

.step-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 8px;
    display: block;
}

/* Feature Rows */
.feature-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 64px;
    align-items: center;
    margin-bottom: 96px;
}

.feature-row:last-child { margin-bottom: 0; }
.feature-row.reverse .feature-text { order: 2; }
.feature-row.reverse .feature-panel { order: 1; }

.feature-text h3 {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 16px;
    line-height: var(--lh-tight);
}

.feature-list li {
    position: relative;
    padding-left: 20px;
    margin-bottom: 12px;
}

.feature-list li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 8px;
    width: 6px;
    height: 6px;
    background-color: var(--color-brand);
}

.panel-svg-wrapper {
    width: 100%;
    aspect-ratio: 4 / 3;
    background-color: rgba(0,0,0,0.05);
    border: var(--card-border);
    box-shadow: var(--card-shadow);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

/* Tips */
.tips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

.tip-card {
    background-color: #fff;
    border: var(--card-border);
    box-shadow: var(--card-shadow);
    padding: 24px;
}

.tip-number {
    font-size: 2rem;
    font-weight: 800;
    color: var(--color-brand);
    line-height: 1;
    margin-bottom: 16px;
    display: block;
}

/* Use Cases */
.case-block {
    margin-bottom: 48px;
    padding-bottom: 48px;
    border-bottom: 1px solid rgba(0,0,0,0.1);
}

.case-block:last-child { border-bottom: none; }

.case-stages {
    display: flex;
    gap: 24px;
    margin-top: 24px;
}

.stage-card {
    flex: 1;
    background-color: #fff;
    border: var(--card-border);
    padding: 16px;
    box-shadow: var(--card-shadow);
}

.stage-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--color-brand);
    margin-bottom: 8px;
    display: block;
}

/* Table */
.platform-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 24px;
    font-size: 0.95rem;
}

.platform-table th, .platform-table td {
    text-align: left;
    padding: 16px;
    border-bottom: 1px solid rgba(0,0,0,0.1);
}

.platform-table th {
    font-weight: 700;
    background-color: rgba(0,0,0,0.03);
}

.platform-table a {
    color: var(--color-brand);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.platform-table a:hover { color: var(--color-accent); }

/* News */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}

.news-card {
    background-color: #fff;
    border: var(--card-border);
    box-shadow: var(--card-shadow);
    padding: 24px;
    display: flex;
    flex-direction: column;
}

.news-date {
    font-size: 0.8rem;
    color: var(--color-brand);
    font-weight: 700;
    margin-bottom: 12px;
}

.news-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 12px;
    line-height: 1.3;
}

.news-excerpt {
    font-size: 0.9rem;
    opacity: 0.8;
    flex-grow: 1;
}

/* FAQ */
.faq-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.faq-item summary {
    font-weight: 700;
    font-size: 1.05rem;
    padding: 16px 24px;
    background-color: #fff;
    border: var(--card-border);
    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-weight: 400;
    font-size: 1.5rem;
    color: var(--color-brand);
}

.faq-item[open] summary::after { content: "-"; }

.faq-item summary:hover { background-color: rgba(0,0,0,0.02); }

.faq-answer {
    padding: 16px 24px;
    background-color: #fff;
    border: var(--card-border);
    border-top: none;
    font-size: 0.95rem;
}

/* Footer */
.site-footer {
    background-color: var(--color-deep-bg);
    color: var(--color-paper);
    padding: 64px 0 32px 0;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 48px;
    margin-bottom: 48px;
}

.footer-brand p {
    opacity: 0.7;
    margin-top: 16px;
    max-width: 300px;
    font-size: 0.9rem;
}

.footer-col h4 {
    color: var(--color-accent);
    margin-bottom: 16px;
    font-weight: 700;
}

.footer-col ul li { margin-bottom: 12px; }
.footer-col a { opacity: 0.8; font-size: 0.9rem; }
.footer-col a:hover { opacity: 1; color: var(--color-accent); }

.copyright {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 32px;
    text-align: center;
    font-size: 0.8rem;
    opacity: 0.6;
}

/* --- SVG 动效 (SVG Animations) --- */
@keyframes draw-line {
    from { stroke-dashoffset: 1; }
    to { stroke-dashoffset: 0; }
}

@keyframes float-up {
    0%, 100% { transform: translateY(0); opacity: 0; }
    10% { opacity: 1; }
    50% { transform: translateY(-8px); opacity: 1; }
    90% { opacity: 1; }
}

@keyframes breathe {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

@keyframes slide-in-right {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.svg-draw {
    path, rect, circle, line, polyline {
        stroke-dasharray: 1;
        stroke-dashoffset: 0;
        animation: draw-line 1.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    }
}

.svg-bubble {
    animation: float-up 4s infinite ease-in-out;
}

.svg-breathe {
    animation: breathe 3s infinite ease-in-out;
}

.svg-slide {
    animation: slide-in-right 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

svg {
    overflow: visible;
}

/* --- 响应式 (Responsive) --- */
@media (max-width: 900px) {
    .hero-grid, .feature-row, .footer-grid {
        grid-template-columns: 1fr;
    }
    
    .feature-row.reverse .feature-text { order: 1; }
    .feature-row.reverse .feature-panel { order: 2; }
    
    .steps-container { flex-direction: column; }
    
    .case-stages { flex-direction: column; }
    
    .header-inner { flex-direction: row; }
    .nav-links { display: none; } /* Simplified for mobile, usually needs JS toggle, keeping simple here */
}

@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;
    }
}
