/* 
 * SafeW Global Styles
 * Theme: Indigo Dark + Sky Accent · Pure Paper
 */

:root {
    /* 色板 */
    --color-dark-bg: #141838;
    --color-paper-bg: #FCFCFD;
    --color-text-main: #151723;
    --color-brand: #142CEB;
    --color-accent: #6EAFED;
    
    /* 结构性 Token */
    --radius-card: 8px;
    --radius-btn: 6px;
    --card-border: 0;
    --card-shadow: none;
    --section-y: clamp(5rem, 10vw, 9rem);
    --gap: clamp(1.5rem, 3vw, 2.5rem);
    --content-max: 1120px;
    
    /* 字体 */
    --font-sans: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
}

/* 基础重置与排版 */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-sans);
    background-color: var(--color-paper-bg);
    color: var(--color-text-main);
    line-height: 1.75;
    font-size: 16px;
    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);
}

/* 区块通用 */
.section {
    padding-top: var(--section-y);
    padding-bottom: var(--section-y);
    position: relative;
}

.section-divider {
    height: 1px;
    background-color: rgba(21, 23, 35, 0.08);
    width: 100%;
    max-width: var(--content-max);
    margin: 0 auto;
}

/* 标题系统 */
.heading-xl {
    font-size: clamp(2.4rem, 6vw, 4.5rem);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.02em;
    text-wrap: balance;
}

.heading-lg {
    font-size: clamp(1.6rem, 3vw, 2.4rem);
    font-weight: 800;
    line-height: 1.25;
    letter-spacing: -0.01em;
    text-wrap: balance;
}

.heading-md {
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 0.75rem;
}

/* 眉标 */
.badge-label {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
    text-transform: uppercase;
}

/* 按钮系统 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    height: 52px;
    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:hover {
    transform: translateY(-2px);
}

.btn:focus-visible {
    outline: 3px solid var(--color-accent);
    outline-offset: 2px;
}

.btn-primary {
    background-color: var(--color-accent);
    color: var(--color-dark-bg);
}

.btn-primary:hover {
    background-color: #5a9bda;
}

.btn-secondary {
    background-color: transparent;
    border: 1px solid var(--color-text-main);
    color: var(--color-text-main);
}

.bg-dark .btn-secondary {
    border-color: var(--color-paper-bg);
    color: var(--color-paper-bg);
}

/* 卡片系统 (无描边无阴影，靠底色区分) */
.card {
    background-color: rgba(21, 23, 35, 0.03);
    border-radius: var(--radius-card);
    padding: var(--gap);
    transition: background-color 0.2s ease;
}

.bg-dark .card {
    background-color: rgba(252, 252, 253, 0.06);
}

/* 页面特定背景覆盖 */
.bg-dark {
    background-color: var(--color-dark-bg);
    color: var(--color-paper-bg);
    overflow-x: hidden;
    width: 100%;
}

.bg-dark .badge-label {
    color: var(--color-accent);
}

.bg-dark .heading-md, 
.bg-dark p, 
.bg-dark li {
    color: var(--color-paper-bg);
}

.bg-dark a:not(.btn) {
    color: var(--color-accent);
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

.bg-dark a:not(.btn):hover {
    text-decoration: underline;
}

/* 高亮关键词 */
.hl {
    color: var(--color-brand);
}

.bg-dark .hl {
    color: var(--color-accent);
}

/* 表格系统 */
.table-specs {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.table-specs th, 
.table-specs td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid rgba(21, 23, 35, 0.08);
}

.table-specs th {
    font-weight: 600;
    color: var(--color-text-main);
}

.bg-dark .table-specs th,
.bg-dark .table-specs td {
    border-bottom-color: rgba(252, 252, 253, 0.1);
}

/* FAQ 系统 */
.faq-item {
    border-bottom: 1px solid rgba(21, 23, 35, 0.08);
}

.faq-item summary {
    padding: 24px 0;
    cursor: pointer;
    font-weight: 600;
    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-size: 1.5rem;
    font-weight: 300;
    opacity: 0.5;
    transition: transform 0.2s ease;
}

.faq-item[open] summary::after {
    transform: rotate(45deg);
}

.faq-item p {
    padding-bottom: 24px;
    color: rgba(21, 23, 35, 0.8);
}

/* 资讯卡片 */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--gap);
}

.news-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.news-date {
    font-size: 0.85rem;
    color: rgba(21, 23, 35, 0.5);
    font-weight: 500;
}

/* 导航与页头 */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background-color: rgba(252, 252, 253, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(21, 23, 35, 0.05);
    transition: background-color 0.2s ease;
}

.header-inner {
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-links {
    display: flex;
    gap: 32px;
    align-items: center;
}

.nav-link {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--color-text-main);
    transition: color 0.2s ease;
}

.nav-link:hover, 
.nav-link[aria-current="page"] {
    color: var(--color-brand);
}

/* 页脚 */
.site-footer {
    padding: 64px 0;
    border-top: 1px solid rgba(21, 23, 35, 0.08);
    background-color: var(--color-paper-bg);
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--gap);
}

.footer-col h4 {
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--color-text-main);
}

.footer-col a {
    display: block;
    margin-bottom: 12px;
    font-size: 0.9rem;
    color: rgba(21, 23, 35, 0.7);
    transition: color 0.2s ease;
}

.footer-col a:hover {
    color: var(--color-brand);
}

/* 响应式调整 */
@media (max-width: 768px) {
    .nav-links {
        display: none; /* 移动端简化，实际项目可加汉堡菜单 */
    }
    .header-inner {
        justify-content: space-between;
    }
}

/* SVG 动效关键帧 */
@keyframes rotate-slow {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes rotate-reverse {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(-360deg); }
}

@keyframes float-gentle {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

@keyframes dash-flow {
    0% { stroke-dashoffset: 1; }
    50% { stroke-dashoffset: 0.4; }
    100% { stroke-dashoffset: 1; }
}

@keyframes fade-in-out {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
}

/* 动效类 */
.anim-rotate-slow {
    animation: rotate-slow 20s linear infinite;
    transform-box: fill-box;
    transform-origin: center;
}

.anim-rotate-reverse {
    animation: rotate-reverse 16s linear infinite;
    transform-box: fill-box;
    transform-origin: center;
}

.anim-float {
    animation: float-gentle 6s ease-in-out infinite;
}

.anim-dash {
    stroke-dasharray: 1;
    stroke-dashoffset: 0;
    animation: dash-flow 4s ease-in-out infinite;
}

.anim-pulse {
    animation: fade-in-out 5s ease-in-out infinite;
}

/* 减少动态效果偏好 */
@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-rotate-slow, 
    .anim-rotate-reverse, 
    .anim-float, 
    .anim-dash, 
    .anim-pulse {
        animation: none !important;
    }
}

/* 兜底：裁掉横向溢出 */
body > * {
  overflow-x: clip;
}
