/* SafeW 全站共享样式 */

/* ===== 设计变量 ===== */
:root {
    /* 色板 */
    --color-deep: #21163C;
    --color-paper: #F4F3F7;
    --color-body: #191523;
    --color-brand: #5214EB;
    --color-accent: #ED926E;

    /* 圆角 */
    --radius-card: 20px;
    --radius-btn: 12px;

    /* 卡片边界 */
    --card-border: 1px solid rgba(25, 21, 35, 0.16);
    --card-shadow: none;

    /* 节奏与密度 */
    --section-y: clamp(3.5rem, 7vw, 6rem);
    --gap: clamp(1rem, 2vw, 1.75rem);

    /* 内容最大宽度 */
    --content-max: 1280px;

    /* 标题处理 */
    --title-weight: 800;
    --title-spacing: -0.02em;
    --title-line-height: 1.1;

    /* 正文行高 */
    --body-line-height: 1.65;

    /* 按钮高度 */
    --btn-height: 52px;

    /* 字体栈 */
    --font-sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
}

/* ===== 基础重置 ===== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: var(--body-line-height);
    color: var(--color-body);
    background-color: var(--color-paper);
    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);
}

/* ===== 页头 ===== */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: rgba(244, 243, 247, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(25, 21, 35, 0.08);
    transition: box-shadow 0.3s ease;
}

.site-header.scrolled {
    box-shadow: 0 2px 16px rgba(25, 21, 35, 0.08);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    font-size: 1.15rem;
    letter-spacing: -0.01em;
}

.brand img {
    height: 32px;
    width: auto;
}

.brand-name {
    color: var(--color-brand);
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 24px;
}

.site-nav a {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-body);
    padding: 6px 4px;
    position: relative;
    transition: color 0.2s ease;
}

.site-nav a:hover {
    color: var(--color-brand);
}

.site-nav a[aria-current="page"] {
    color: var(--color-brand);
}

.site-nav a[aria-current="page"]::after {
    content: "";
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background-color: var(--color-brand);
    border-radius: 1px;
}

.nav-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: var(--btn-height);
    padding: 0 24px;
    background-color: var(--color-accent);
    color: var(--color-deep);
    font-weight: 700;
    font-size: 0.9rem;
    border-radius: var(--radius-btn);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.nav-cta:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(237, 146, 110, 0.35);
}

.nav-cta:focus-visible {
    outline: 3px solid var(--color-accent);
    outline-offset: 2px;
}

.nav-cta svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* 移动端菜单按钮 */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.mobile-menu-btn svg {
    width: 24px;
    height: 24px;
    stroke: var(--color-body);
}

/* ===== 区块通用 ===== */
.section {
    padding-top: var(--section-y);
    padding-bottom: var(--section-y);
}

.section-dark {
    background-color: var(--color-deep);
    color: var(--color-paper);
}

.section-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 12px;
}

.label-on-paper {
    color: var(--color-brand);
}

.label-on-deep {
    color: var(--color-accent);
}

.section-title {
    font-size: clamp(1.6rem, 3vw, 2.4rem);
    font-weight: var(--title-weight);
    line-height: var(--title-line-height);
    letter-spacing: var(--title-spacing);
    margin-bottom: 16px;
}

.section-desc {
    font-size: 1.05rem;
    line-height: 1.7;
    max-width: 680px;
    opacity: 0.85;
}

.hl {
    color: var(--color-brand);
}

.section-dark .hl {
    color: var(--color-accent);
}

/* ===== 两栏布局 ===== */
.two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--section-y);
    align-items: center;
}

/* ===== 按钮 ===== */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    height: var(--btn-height);
    padding: 0 32px;
    background-color: var(--color-accent);
    color: var(--color-deep);
    font-weight: 700;
    font-size: 1rem;
    border-radius: var(--radius-btn);
    border: none;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
    white-space: nowrap;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(237, 146, 110, 0.4);
    background-color: #f0a17e;
}

.btn-primary:focus-visible {
    outline: 3px solid var(--color-accent);
    outline-offset: 2px;
}

.btn-primary svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: var(--btn-height);
    padding: 0 24px;
    background: transparent;
    color: var(--color-body);
    font-weight: 700;
    font-size: 1rem;
    border-radius: var(--radius-btn);
    border: 2px solid var(--color-body);
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease, color 0.2s ease;
    white-space: nowrap;
}

.btn-secondary:hover {
    transform: translateY(-1px);
    border-color: var(--color-brand);
    color: var(--color-brand);
}

.btn-secondary:focus-visible {
    outline: 3px solid var(--color-brand);
    outline-offset: 2px;
}

.btn-group {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 24px;
}

/* ===== 胶囊标签 ===== */
.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background-color: rgba(82, 20, 235, 0.08);
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-brand);
}

.section-dark .chip {
    background-color: rgba(237, 146, 110, 0.12);
    color: var(--color-accent);
}

.chip svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.8;
}

/* ===== 面板（视觉展示区） ===== */
.visual-panel {
    background-color: var(--color-deep);
    border-radius: var(--radius-card);
    padding: 32px;
    aspect-ratio: 4 / 3;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.visual-panel svg {
    width: 100%;
    height: auto;
}

.panel-light {
    background-color: var(--color-paper);
    border: var(--card-border);
}

/* ===== 功能定义列表 ===== */
.feature-list {
    display: grid;
    gap: 24px;
}

.feature-item {
    padding: 24px;
    background-color: rgba(244, 243, 247, 0.6);
    border-radius: var(--radius-card);
    border: var(--card-border);
    transition: background-color 0.2s ease;
}

.feature-item:hover {
    background-color: rgba(244, 243, 247, 0.9);
}

.section-dark .feature-item {
    background-color: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.1);
}

.feature-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.feature-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background-color: var(--color-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.section-dark .feature-icon {
    background-color: var(--color-accent);
}

.feature-icon svg {
    width: 20px;
    height: 20px;
    stroke: var(--color-deep);
    fill: none;
    stroke-width: 2;
}

.feature-name {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--color-body);
}

.section-dark .feature-name {
    color: var(--color-paper);
}

.feature-desc {
    font-size: 0.92rem;
    line-height: 1.7;
    color: var(--color-body);
    opacity: 0.8;
}

.section-dark .feature-desc {
    color: var(--color-paper);
    opacity: 0.75;
}

/* ===== 时间轴 ===== */
.timeline {
    position: relative;
    padding-left: 32px;
}

.timeline::before {
    content: "";
    position: absolute;
    left: 11px;
    top: 8px;
    bottom: 8px;
    width: 2px;
    background: linear-gradient(to bottom, var(--color-brand), var(--color-accent));
    border-radius: 1px;
}

.timeline-item {
    position: relative;
    padding-bottom: 32px;
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-marker {
    position: absolute;
    left: -32px;
    top: 4px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background-color: var(--color-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 800;
    color: var(--color-deep);
}

.timeline-time {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--color-brand);
    margin-bottom: 4px;
    letter-spacing: 0.02em;
}

.section-dark .timeline-time {
    color: var(--color-accent);
}

.timeline-title {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.section-dark .timeline-title {
    color: var(--color-paper);
}

.timeline-desc {
    font-size: 0.92rem;
    line-height: 1.7;
    opacity: 0.85;
}

/* ===== 步骤条 ===== */
.steps-row {
    display: flex;
    gap: 24px;
}

.step-card {
    flex: 1;
    padding: 28px 24px;
    background-color: rgba(244, 243, 247, 0.6);
    border-radius: var(--radius-card);
    border: var(--card-border);
    position: relative;
}

.section-dark .step-card {
    background-color: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.08);
}

.step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background-color: var(--color-accent);
    color: var(--color-deep);
    font-weight: 800;
    font-size: 0.9rem;
    margin-bottom: 16px;
}

.step-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.section-dark .step-title {
    color: var(--color-paper);
}

.step-desc {
    font-size: 0.9rem;
    line-height: 1.7;
    opacity: 0.8;
}

/* ===== 新闻卡片 ===== */
.news-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-top: 32px;
}

.news-card {
    padding: 28px 24px;
    background-color: rgba(244, 243, 247, 0.6);
    border-radius: var(--radius-card);
    border: var(--card-border);
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.news-card:hover {
    background-color: rgba(244, 243, 247, 0.95);
    transform: translateY(-2px);
}

.section-dark .news-card {
    background-color: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.1);
}

.section-dark .news-card:hover {
    background-color: rgba(255, 255, 255, 0.12);
}

.news-date {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--color-brand);
    margin-bottom: 10px;
}

.section-dark .news-date {
    color: var(--color-accent);
}

.news-title {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 10px;
    line-height: 1.4;
}

.section-dark .news-title {
    color: var(--color-paper);
}

.news-excerpt {
    font-size: 0.9rem;
    line-height: 1.7;
    opacity: 0.8;
}

/* ===== 表格 ===== */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 24px;
    font-size: 0.95rem;
}

.data-table th,
.data-table td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid rgba(25, 21, 35, 0.1);
}

.section-dark .data-table th,
.section-dark .data-table td {
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

.data-table th {
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 0.03em;
    color: var(--color-body);
    opacity: 0.7;
    text-transform: uppercase;
}

.section-dark .data-table th {
    color: var(--color-paper);
}

.data-table td:first-child {
    font-weight: 700;
    color: var(--color-body);
}

.section-dark .data-table td:first-child {
    color: var(--color-paper);
}

.data-table td:last-child {
    color: var(--color-body);
    opacity: 0.8;
}

.section-dark .data-table td:last-child {
    color: var(--color-paper);
    opacity: 0.75;
}

.table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* ===== FAQ ===== */
.faq-list {
    display: grid;
    gap: 12px;
    margin-top: 32px;
}

.faq-item {
    border-radius: var(--radius-card);
    border: var(--card-border);
    overflow: hidden;
    background-color: rgba(244, 243, 247, 0.5);
    transition: background-color 0.2s ease;
}

.section-dark .faq-item {
    background-color: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.08);
}

.faq-item[open] {
    background-color: rgba(244, 243, 247, 0.8);
}

.section-dark .faq-item[open] {
    background-color: rgba(255, 255, 255, 0.08);
}

.faq-item summary {
    padding: 20px 24px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    user-select: none;
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-item summary::after {
    content: "";
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    transition: transform 0.2s ease;
}

.faq-item[open] summary::after {
    transform: rotate(180deg);
}

.faq-answer {
    padding: 0 24px 20px;
    font-size: 0.92rem;
    line-height: 1.75;
    color: var(--color-body);
    opacity: 0.85;
}

.section-dark .faq-answer {
    color: var(--color-paper);
    opacity: 0.8;
}

/* ===== 提示框 ===== */
.callout {
    padding: 20px 24px;
    border-radius: var(--radius-card);
    border-left: 4px solid var(--color-accent);
    background-color: rgba(237, 146, 110, 0.08);
    font-size: 0.92rem;
    line-height: 1.7;
    margin-top: 20px;
}

.section-dark .callout {
    background-color: rgba(237, 146, 110, 0.1);
}

/* ===== 页脚 ===== */
.site-footer {
    background-color: var(--color-deep);
    color: var(--color-paper);
    padding: 48px 0 32px;
}

.footer-inner {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 48px;
    margin-bottom: 40px;
}

.footer-brand p {
    font-size: 0.9rem;
    line-height: 1.7;
    opacity: 0.7;
    margin-top: 12px;
    max-width: 320px;
}

.footer-links h4 {
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--color-accent);
    margin-bottom: 16px;
}

.footer-links ul {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.footer-links a {
    font-size: 0.9rem;
    opacity: 0.7;
    transition: opacity 0.2s ease, color 0.2s ease;
}

.footer-links a:hover {
    opacity: 1;
    color: var(--color-accent);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.82rem;
    opacity: 0.5;
}

/* ===== SVG 动效 Keyframes ===== */

/* 描边自绘动画 */
@keyframes drawStroke {
    from {
        stroke-dashoffset: 1;
    }
    to {
        stroke-dashoffset: 0;
    }
}

/* 呼吸动画 */
@keyframes breathe {
    0%, 100% {
        opacity: 0.6;
    }
    50% {
        opacity: 1;
    }
}

/* 漂浮动画 */
@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-6px);
    }
}

/* 滑入动画 */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* 消息气泡浮现 */
@keyframes bubblePop {
    0%, 100% {
        opacity: 0.3;
        transform: scale(0.95);
    }
    50% {
        opacity: 1;
        transform: scale(1);
    }
}

/* 流动线条 */
@keyframes flowLine {
    from {
        stroke-dashoffset: 1;
    }
    to {
        stroke-dashoffset: 0;
    }
}

/* 通知卡片滑入 */
@keyframes notifSlide {
    from {
        opacity: 0;
        transform: translateX(-16px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* 输入点呼吸 */
@keyframes dotBreathe {
    0%, 100% {
        opacity: 0.3;
    }
    50% {
        opacity: 1;
    }
}

/* 窗口淡入 */
@keyframes windowFade {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 旋转动画 */
@keyframes gentleRotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* ===== 动效类 ===== */
.draw-stroke {
    pathLength: 1;
    stroke-dasharray: 1;
    stroke-dashoffset: 0;
    animation: drawStroke 3s ease-in-out infinite alternate;
}

.breathe {
    animation: breathe 4s ease-in-out infinite;
}

.float {
    animation: float 5s ease-in-out infinite;
}

.slide-in {
    animation: slideIn 2.5s ease-out forwards;
}

.bubble-pop {
    animation: bubblePop 4s ease-in-out infinite;
}

.flow-line {
    pathLength: 1;
    stroke-dasharray: 1;
    stroke-dashoffset: 0;
    animation: flowLine 3s ease-in-out infinite alternate;
}

.notif-slide {
    animation: notifSlide 2s ease-out forwards;
}

.dot-breathe-1 {
    animation: dotBreathe 2s ease-in-out infinite 0s;
}

.dot-breathe-2 {
    animation: dotBreathe 2s ease-in-out infinite 0.3s;
}

.dot-breathe-3 {
    animation: dotBreathe 2s ease-in-out infinite 0.6s;
}

.window-fade {
    animation: windowFade 2.5s ease-out forwards;
}

.gentle-rotate {
    animation: gentleRotate 20s linear infinite;
    transform-box: fill-box;
    transform-origin: center;
}

/* ===== 焦点样式 ===== */
*:focus-visible {
    outline: 3px solid var(--color-brand);
    outline-offset: 2px;
}

.btn-primary:focus-visible,
.btn-secondary:focus-visible {
    outline-color: var(--color-accent);
}

/* ===== 减少动态效果 ===== */
@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;
    }

    .draw-stroke,
    .breathe,
    .float,
    .slide-in,
    .bubble-pop,
    .flow-line,
    .notif-slide,
    .dot-breathe-1,
    .dot-breathe-2,
    .dot-breathe-3,
    .window-fade,
    .gentle-rotate {
        animation: none !important;
    }
}

/* ===== 响应式 ===== */

/* 平板 */
@media (max-width: 1024px) {
    .two-col {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .news-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .footer-inner {
        grid-template-columns: 1fr 1fr;
        gap: 32px;
    }

    .steps-row {
        flex-wrap: wrap;
    }

    .step-card {
        min-width: calc(50% - 12px);
    }
}

/* 手机 */
@media (max-width: 640px) {
    .site-nav .nav-link-text {
        display: none;
    }

    .mobile-menu-btn {
        display: block;
    }

    .site-nav {
        display: none;
        position: absolute;
        top: 64px;
        left: 0;
        right: 0;
        background-color: var(--color-paper);
        flex-direction: column;
        padding: 16px var(--gap);
        border-bottom: 1px solid rgba(25, 21, 35, 0.08);
        gap: 8px;
    }

    .site-nav.open {
        display: flex;
    }

    .site-nav a {
        padding: 12px 8px;
        width: 100%;
    }

    .nav-cta {
        width: 100%;
        justify-content: center;
    }

    .news-grid {
        grid-template-columns: 1fr;
    }

    .footer-inner {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }

    .steps-row {
        flex-direction: column;
    }

    .step-card {
        min-width: 100%;
    }

    .btn-group {
        flex-direction: column;
    }

    .btn-primary,
    .btn-secondary {
        width: 100%;
        justify-content: center;
    }

    .visual-panel {
        aspect-ratio: 16 / 10;
    }
}

/* ===== 长文排版辅助 ===== */
.text-column {
    max-width: 38em;
}

.hero-subtext {
    font-size: 0.85rem;
    opacity: 0.6;
    margin-top: 20px;
}

.hero-subtext a {
    color: var(--color-brand);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

.section-dark .hero-subtext a {
    color: var(--color-accent);
}

/* ===== 特性胶囊行 ===== */
.chips-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 24px;
}

/* ===== 对齐工具 ===== */
.text-center {
    text-align: center;
}

.mx-auto {
    margin-left: auto;
    margin-right: auto;
}
