/* =========================================
   SafeW 全站共享样式 (style.css)
   ========================================= */

/* 设计 Token 与色板变量 */
:root {
  /* 基础色板 */
  --color-dark: #2D1438;
  --color-paper: #F6F3F7;
  --color-text: #1F1523;
  --color-brand: #9E13DD;
  --color-accent: #6EEDA8;

  /* 结构 Token */
  --radius-card: 20px;
  --radius-btn: 12px;
  --card-border: 0;
  --card-shadow: 0 10px 28px -14px rgba(31, 21, 35, 0.3);
  --section-y: clamp(2.5rem, 5vw, 4rem);
  --gap: clamp(0.75rem, 1.5vw, 1.25rem);
  --content-max: 1120px;

  /* 排版衍生 */
  --font-sans: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  --line-height-base: 1.55;
  --line-height-tight: 1.1;
  --tracking-tight: -0.02em;
}

/* 基础重置与全局设定 */
*, *::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);
  background-color: var(--color-paper);
  color: var(--color-text);
  line-height: var(--line-height-base);
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; transition: color 0.2s ease; }
ul, ol { list-style: none; }

/* 布局容器 */
.container {
  width: 100%;
  max-width: var(--content-max);
  margin-inline: auto;
  padding-inline: var(--gap);
}

/* 区块节奏 */
.section {
  padding-block: var(--section-y);
  position: relative;
}
.section--dark {
  background-color: var(--color-dark);
  color: var(--color-paper);
}
.section--dark .hl { color: var(--color-accent); }
.section--paper .hl { color: var(--color-brand); }

/* 眉标 (Eyebrow) */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: calc(var(--gap) * 0.5);
}
.paper-theme .eyebrow { color: var(--color-brand); }
.dark-theme .eyebrow { color: var(--color-accent); }
.eyebrow::before {
  content: "";
  display: block;
  width: 1.5ch;
  height: 2px;
  background-color: currentColor;
}

/* 标题系统 */
h1, h2, h3 {
  font-weight: 800;
  letter-spacing: var(--tracking-tight);
  line-height: var(--line-height-tight);
  margin-bottom: calc(var(--gap) * 0.75);
}
h1 { font-size: clamp(2.4rem, 6vw, 4.5rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); }
h3 { font-size: clamp(1.25rem, 2vw, 1.5rem); }
p { margin-bottom: var(--gap); max-width: 38em; }
.hl { font-weight: 800; }

/* 按钮组件 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6em;
  height: 48px;
  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, box-shadow 0.2s ease;
  border: none;
}
.btn:focus-visible { outline: 3px solid var(--color-accent); outline-offset: 2px; }
.btn:hover { transform: translateY(-1px); }

.btn--primary {
  background-color: var(--color-accent);
  color: var(--color-dark);
}
.btn--primary:hover { background-color: #5bd995; }

.btn--secondary {
  background: transparent;
  border: 1px solid var(--color-text);
  color: var(--color-text);
}
.dark-theme .btn--secondary {
  border-color: var(--color-paper);
  color: var(--color-paper);
}
.btn--secondary:hover { opacity: 0.85; }

/* 卡片与面板 */
.card {
  background-color: var(--color-paper);
  border: var(--card-border);
  border-radius: var(--radius-card);
  box-shadow: var(--card-shadow);
  padding: calc(var(--gap) * 1.5);
  transition: box-shadow 0.2s ease;
}
.card:hover { box-shadow: 0 12px 32px -12px rgba(31, 21, 35, 0.4); }

.panel-dark {
  background-color: var(--color-dark);
  border-radius: var(--radius-card);
  padding: calc(var(--gap) * 2);
}
.panel-dark .card {
  background-color: var(--color-paper);
  color: var(--color-text);
}

/* 列表与标记 */
.list-check li {
  position: relative;
  padding-left: 1.8em;
  margin-bottom: 0.6em;
}
.list-check li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.45em;
  width: 0.6em;
  height: 0.6em;
  border: 2px solid var(--color-brand);
  border-radius: 2px;
  transform: rotate(45deg);
}
.dark-theme .list-check li::before { border-color: var(--color-accent); }

/* 表格 */
.table-wrap { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}
th, td {
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(31, 21, 35, 0.1);
}
.dark-theme th, .dark-theme td { border-bottom-color: rgba(246, 243, 247, 0.15); }
td:first-child { font-weight: 600; width: 40%; }

/* 步骤徽标 */
.step-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background-color: var(--color-accent);
  color: var(--color-dark);
  font-weight: 800;
  font-size: 0.85rem;
  border-radius: 6px;
  margin-right: 0.5em;
}

/* 页头与导航 */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: rgba(246, 243, 247, 0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}
.site-header.scrolled { border-bottom-color: rgba(31, 21, 35, 0.1); }
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.1rem; }
.logo img { height: 28px; width: auto; }
.nav-list { display: flex; gap: 24px; }
.nav-link { font-weight: 500; font-size: 0.95rem; }
.nav-link[aria-current="page"] { color: var(--color-brand); font-weight: 700; }
.dark-theme .nav-link[aria-current="page"] { color: var(--color-accent); }

/* 页脚 */
.site-footer {
  background-color: var(--color-dark);
  color: var(--color-paper);
  padding: 48px 0;
  font-size: 0.9rem;
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 32px;
}
.footer-links { display: flex; gap: 24px; }
.footer-links a:hover { color: var(--color-accent); }

/* 交错图文布局 */
.alt-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--gap);
}
@media (min-width: 768px) {
  .alt-grid { grid-template-columns: 1fr 1fr; }
  .alt-grid > *:nth-child(even) { direction: rtl; }
  .alt-grid > *:nth-child(even) > * { direction: ltr; }
}

/* 时间轴 */
.timeline {
  position: relative;
  padding-left: 24px;
  border-left: 2px solid rgba(31, 21, 35, 0.15);
}
.dark-theme .timeline { border-left-color: rgba(246, 243, 247, 0.2); }
.timeline-item { position: relative; margin-bottom: 32px; }
.timeline-item::before {
  content: "";
  position: absolute;
  left: -29px;
  top: 6px;
  width: 10px;
  height: 10px;
  background-color: var(--color-brand);
  border-radius: 50%;
  border: 2px solid var(--color-paper);
}
.dark-theme .timeline-item::before { background-color: var(--color-accent); border-color: var(--color-dark); }
.time-tag {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--color-brand);
  margin-bottom: 4px;
  display: block;
}
.dark-theme .time-tag { color: var(--color-accent); }

/* 新闻网格 */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--gap);
}
.news-card h4 { margin-bottom: 8px; font-size: 1.1rem; }
.news-date { font-size: 0.8rem; color: rgba(31, 21, 35, 0.6); margin-top: 12px; display: block; }
.dark-theme .news-date { color: rgba(246, 243, 247, 0.6); }

/* FAQ */
.faq-list details {
  border-bottom: 1px solid rgba(31, 21, 35, 0.1);
  padding: 16px 0;
}
.dark-theme .faq-list details { border-bottom-color: rgba(246, 243, 247, 0.15); }
.faq-list summary {
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after {
  content: "+";
  font-weight: 400;
  font-size: 1.2rem;
  transition: transform 0.2s ease;
}
.faq-list details[open] summary::after { transform: rotate(45deg); }
.faq-list p { margin-top: 12px; font-size: 0.95rem; color: rgba(31, 21, 35, 0.8); }
.dark-theme .faq-list p { color: rgba(246, 243, 247, 0.8); }

/* SVG 基础与尺寸控制 */
.svg-panel { width: 100%; height: auto; max-width: 100%; }
.svg-icon { width: 24px; height: 24px; stroke-width: 1.8; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; }

/* SVG 动效关键帧 */
@keyframes draw-line {
  0% { stroke-dashoffset: 1; }
  100% { stroke-dashoffset: 0; }
}
@keyframes breathe {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.02); }
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
@keyframes dash-flow {
  0% { stroke-dashoffset: 1; }
  50% { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: 1; }
}

/* 动效类绑定 */
.anim-draw {
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: draw-line 2.5s cubic-bezier(0.4, 0, 0.2, 1) forwards, breathe 4s ease-in-out infinite 2.5s;
}
.anim-bubble { animation: float 5s ease-in-out infinite; }
.anim-input-dot { animation: breathe 2s ease-in-out infinite alternate; }
.anim-line-flow {
  stroke-dasharray: 1;
  animation: dash-flow 6s linear infinite;
}
.anim-slide-up {
  opacity: 0;
  transform: translateY(12px);
  animation: draw-line 1.2s cubic-bezier(0.2, 0, 0.2, 1) forwards, float 6s ease-in-out infinite 1.2s;
}

/* 减少动态效果适配 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    animation: none !important;
  }
}

/* 响应式微调 */
@media (max-width: 640px) {
  .header-inner { height: 56px; }
  .nav-list { gap: 16px; }
  .nav-link { font-size: 0.85rem; }
  .btn { width: 100%; height: 44px; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
}
