/* =========================================
   SafeW 全站共享样式
   ========================================= */

/* --- 1. 设计变量 (Design Tokens) --- */
:root {
  /* 品牌色板 */
  --color-dark-surface: #17203F;
  --color-paper: #FCFCFD;
  --color-text-body: #151823;
  --color-brand: #1441EB;
  --color-accent: #6EEDBD;

  /* 派生透明度 (用于分割线、次级底色) */
  --color-border-light: rgba(21, 24, 35, 0.08);
  --color-border-dark: rgba(252, 252, 253, 0.12);

  /* 圆角 */
  --radius-card: 8px;
  --radius-btn: 6px;
  --radius-lg: 16px;

  /* 间距与节奏 */
  --section-y: clamp(3.5rem, 7vw, 6rem);
  --gap: clamp(1rem, 2vw, 1.75rem);
  --content-max: 1120px;
  --header-height: 72px;

  /* 字体 */
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", sans-serif;
  --line-height-base: 1.65;
}

/* --- 2. 基础排版与重置 --- */
*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-sans);
  background-color: var(--color-paper);
  color: var(--color-text-body);
  line-height: var(--line-height-base);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-top: 0;
  margin-bottom: 0.6em;
}

h1 { font-size: clamp(2.4rem, 6vw, 4.5rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); line-height: 1.25; }
h3 { font-size: clamp(1.3rem, 2vw, 1.6rem); }
p { margin-top: 0; margin-bottom: 1em; max-width: 38em; }

a { color: inherit; text-decoration: none; transition: color 0.2s ease; }
img, svg { display: block; max-width: 100%; height: auto; }
ul, ol { padding-left: 1.5em; margin: 0; }
li { margin-bottom: 0.5em; }

/* --- 3. 布局容器 --- */
.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);
}

/* --- 4. 页面头部 (Header) --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: rgba(252, 252, 253, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border-light);
  height: var(--header-height);
  display: flex;
  align-items: center;
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand-logo img {
  height: 32px;
  width: auto;
}

.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--color-text-body);
}

.nav-links a:hover, .nav-links a[aria-current="page"] {
  color: var(--color-brand);
}

/* 移动端菜单按钮 (默认隐藏) */
.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-text-body);
}

/* --- 5. 按钮组件 --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  height: 48px;
  padding: 0 1.5em;
  font-size: 1rem;
  font-weight: 700;
  border-radius: var(--radius-btn);
  cursor: pointer;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.btn-primary {
  background-color: var(--color-accent);
  color: var(--color-dark-surface);
}

.btn-primary:hover {
  transform: translateY(-2px);
  opacity: 0.9;
}

.btn-secondary {
  background: transparent;
  color: var(--color-text-body);
  border: 1px solid var(--color-text-body);
}

.btn-secondary:hover {
  background-color: rgba(21, 24, 35, 0.05);
}

.btn-icon {
  width: 20px;
  height: 20px;
  stroke-width: 2;
}

/* --- 6. 眉标 (Section Label) --- */
.section-label {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  margin-bottom: 0.75em;
  color: var(--color-brand);
}

.dark-surface .section-label {
  color: var(--color-accent);
}

/* --- 7. 深色面 (Dark Surface) --- */
.dark-surface {
  background-color: var(--color-dark-surface);
  color: var(--color-paper);
}

.dark-surface p, .dark-surface h2, .dark-surface h3 {
  color: var(--color-paper);
}

.dark-surface a:not(.btn) {
  color: var(--color-accent);
}

/* --- 8. 卡片与网格 --- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--gap);
}

.card {
  background: var(--color-paper);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-card);
  padding: 1.5rem;
  box-shadow: var(--card-shadow);
}

.news-card {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.news-card time {
  font-size: 0.85rem;
  color: var(--color-brand);
  font-weight: 600;
  margin-bottom: 0.5em;
}

/* --- 9. 表格 --- */
.spec-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
  font-size: 0.95rem;
}

.spec-table th, .spec-table td {
  text-align: left;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--color-border-light);
}

.spec-table th {
  font-weight: 700;
  color: var(--color-text-body);
  width: 40%;
}

.dark-surface .spec-table th, .dark-surface .spec-table td {
  color: var(--color-paper);
  border-bottom-color: var(--color-border-dark);
}

/* --- 10. FAQ --- */
.faq-item {
  border-bottom: 1px solid var(--color-border-light);
  margin-bottom: 0;
}

.faq-item summary {
  padding: 1rem 0;
  cursor: pointer;
  font-weight: 700;
  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;
  transition: transform 0.2s ease;
}

.faq-item[open] summary::after {
  transform: rotate(45deg);
}

.faq-item p {
  margin-top: 0.5em;
  margin-bottom: 1.5em;
  color: var(--color-text-body);
}

.dark-surface .faq-item p {
  color: var(--color-paper);
}

/* --- 11. 页脚 (Footer) --- */
.site-footer {
  background-color: var(--color-dark-surface);
  color: var(--color-paper);
  padding-top: 4rem;
  padding-bottom: 2rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 2rem;
  margin-bottom: 3rem;
}

.footer-col h4 {
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--color-accent);
}

.footer-col ul {
  list-style: none;
  padding: 0;
}

.footer-col li { margin-bottom: 0.6rem; }

.footer-col a {
  color: rgba(252, 252, 253, 0.7);
  font-size: 0.9rem;
}

.footer-col a:hover { color: var(--color-paper); }

.footer-bottom {
  border-top: 1px solid var(--color-border-dark);
  padding-top: 2rem;
  text-align: center;
  font-size: 0.85rem;
  color: rgba(252, 252, 253, 0.5);
}

/* =========================================
   SVG 动效系统
   ========================================= */

/* 通用绘制路径设置 */
.draw-path {
  pathLength: 1;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
}

/* 几何体旋转拼合 */
@keyframes spin-in {
  0% { transform: rotate(-90deg) scale(0.8); opacity: 0; }
  40% { opacity: 1; }
  100% { transform: rotate(0deg) scale(1); opacity: 1; }
}

@keyframes float-bubble {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

@keyframes pulse-dot {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}

@keyframes dash-flow {
  to { stroke-dashoffset: -24; }
}

/* 动效类 */
.geo-spin {
  animation: spin-in 2.5s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.float-anim {
  animation: float-bubble 4s ease-in-out infinite;
}

.pulse-anim {
  animation: pulse-dot 2s ease-in-out infinite;
}

.dash-flow-anim {
  animation: dash-flow 1.5s linear 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;
  }
}

/* =========================================
   响应式适配
   ========================================= */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .mobile-menu-btn { display: block; }
  
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  
  .hero-layout {
    flex-direction: column-reverse;
  }
}
