/* SafeW 全站共享样式 */
:root {
  --color-dark: #140E25;
  --color-paper: #FCFCFD;
  --color-text: #191523;
  --color-brand: #5214EB;
  --color-accent: #6EEDD2;
  --color-card-bg: #F3F4F6;
  --color-divider: #E5E7EB;
  --color-overlay: rgba(20, 14, 37, 0.6);

  --radius-card: 8px;
  --radius-btn: 6px;
  --section-y: clamp(3.5rem, 7vw, 6rem);
  --gap: clamp(1rem, 2vw, 1.75rem);
  --content-max: 960px;
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --line-height-body: 1.65;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  background: var(--color-paper);
  color: var(--color-text);
  line-height: var(--line-height-body);
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

/* 上下文覆盖变量 */
.bg-dark { background: var(--color-dark); color: var(--color-paper); }
.bg-dark .hl { color: var(--color-accent); }
.bg-dark .overline { color: var(--color-accent); }
.bg-dark .btn-primary { background: var(--color-accent); color: var(--color-dark); }
.bg-dark .btn-secondary { border-color: var(--color-paper); color: var(--color-paper); }
.bg-dark .btn-secondary:hover { background: var(--color-overlay); }
.bg-dark input, .bg-dark textarea, .bg-dark select { background: var(--color-overlay); color: var(--color-paper); border-color: var(--color-divider); }

.container {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--gap);
}

/* 排版 */
.overline {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-brand);
  margin-bottom: 0.75rem;
}
h1 {
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: 0.02em;
  margin-bottom: 1rem;
  text-wrap: balance;
}
h2 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 700;
  line-height: 1.25;
  margin: var(--section-y) 0 1.5rem;
  text-wrap: balance;
}
h3 {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.4;
  margin: 1.5rem 0 0.75rem;
}
p { margin-bottom: 1rem; max-width: 38em; }
.hl { color: var(--color-brand); font-weight: 700; }
a { color: var(--color-brand); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--color-accent); }
a:focus-visible { outline: 2px solid var(--color-brand); outline-offset: 2px; border-radius: 2px; }

/* 布局与分割 */
.section-wrapper {
  padding-top: var(--section-y);
  padding-bottom: var(--section-y);
  border-bottom: 1px solid var(--color-divider);
}
.section-wrapper:last-child { border-bottom: none; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: var(--gap); align-items: start; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: var(--gap); }

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  height: 48px;
  font-weight: 600;
  font-size: 1rem;
  border-radius: var(--radius-btn);
  cursor: pointer;
  transition: transform 0.2s, background 0.2s, color 0.2s, border-color 0.2s;
  border: 2px solid transparent;
  text-decoration: none;
}
.btn:hover { transform: translateY(-2px); }
.btn:focus-visible { outline: 3px solid var(--color-brand); outline-offset: 2px; }
.btn-primary { background: var(--color-brand); color: var(--color-paper); }
.btn-secondary { background: transparent; border-color: var(--color-text); color: var(--color-text); }
.btn svg { width: 20px; height: 20px; stroke: currentColor; stroke-width: 2; fill: none; }

/* 卡片 */
.card {
  background: var(--color-card-bg);
  border-radius: var(--radius-card);
  padding: var(--gap);
  transition: transform 0.2s;
}
.card:hover { transform: translateY(-2px); }

/* 表格 */
.table-wrap { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}
th, td { padding: 0.75rem 1rem; text-align: left; border-bottom: 1px solid var(--color-divider); }
th { font-weight: 600; color: var(--color-text); }
td:first-child { font-weight: 600; }

/* FAQ / Details */
details {
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-card);
  margin-bottom: 0.75rem;
  padding: 1rem;
  transition: background 0.2s;
}
details[open] { background: var(--color-card-bg); }
summary {
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
summary::-webkit-details-marker { display: none; }
summary::before {
  content: "";
  display: inline-block;
  width: 8px; height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  transition: transform 0.2s;
}
details[open] summary::before { transform: rotate(45deg); }
.details-content { margin-top: 0.75rem; color: var(--color-text); }

/* 功能 Tab (CSS 实现，无 JS 降级为纵向排列) */
.tab-nav { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1.5rem; }
.tab-radio { display: none; }
.tab-label {
  padding: 0.5rem 1rem;
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-btn);
  cursor: pointer;
  font-weight: 500;
  transition: background 0.2s;
}
.tab-label:hover { background: var(--color-card-bg); }
.tab-panel { display: none; padding: 1.5rem; background: var(--color-card-bg); border-radius: var(--radius-card); }
.tab-radio:checked + .tab-label { background: var(--color-brand); color: var(--color-paper); border-color: var(--color-brand); }
.tab-radio:nth-of-type(1):checked ~ .tab-panel:nth-of-type(1),
.tab-radio:nth-of-type(2):checked ~ .tab-panel:nth-of-type(2),
.tab-radio:nth-of-type(3):checked ~ .tab-panel:nth-of-type(3),
.tab-radio:nth-of-type(4):checked ~ .tab-panel:nth-of-type(4),
.tab-radio:nth-of-type(5):checked ~ .tab-panel:nth-of-type(5) { display: block; }

/* 时间线 (快速开始) */
.timeline { position: relative; padding-left: 2rem; }
.timeline::before {
  content: ""; position: absolute; left: 0.75rem; top: 0; bottom: 0;
  width: 2px; background: var(--color-divider);
}
.step { position: relative; margin-bottom: 2rem; }
.step::before {
  content: attr(data-step);
  position: absolute; left: -2rem; top: 0;
  width: 1.5rem; height: 1.5rem;
  background: var(--color-accent); color: var(--color-dark);
  border-radius: 4px; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.85rem;
}

/* 新闻卡片 */
.news-card { display: flex; flex-direction: column; height: 100%; }
.news-card time { font-size: 0.8rem; color: var(--color-brand); margin-bottom: 0.5rem; }
.news-card h3 { font-size: 1.1rem; margin: 0.5rem 0; }
.news-card p { font-size: 0.95rem; color: var(--color-text); opacity: 0.9; }

/* 页头页脚 */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--color-paper);
  border-bottom: 1px solid var(--color-divider);
  padding: 0.75rem 0;
}
.header-inner { display: flex; align-items: center; justify-content: space-between; }
.logo-area { display: flex; align-items: center; gap: 0.75rem; }
.logo-area img { height: 32px; width: auto; }
.nav-links { display: flex; gap: 1.5rem; align-items: center; }
.nav-links a { font-weight: 500; }
.nav-links a[aria-current="page"] { color: var(--color-brand); font-weight: 700; }
.footer {
  background: var(--color-dark);
  color: var(--color-paper);
  padding: 3rem 0;
  margin-top: var(--section-y);
}
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--gap); }
.footer h4 { margin-bottom: 1rem; color: var(--color-accent); }
.footer ul { list-style: none; }
.footer li { margin-bottom: 0.5rem; }
.footer a { color: var(--color-paper); opacity: 0.85; }
.footer a:hover { opacity: 1; color: var(--color-accent); }

/* SVG 容器与动效 */
.svg-container { width: 100%; height: auto; }
svg { display: block; overflow: visible; }
.anim-draw {
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: draw-line 4s ease forwards;
}
.anim-breathe {
  animation: breathe 5s ease-in-out infinite;
}
.anim-float {
  animation: float 6s ease-in-out infinite;
}
.anim-pulse-dot {
  animation: pulse-dot 3s ease-in-out infinite;
}

@keyframes draw-line {
  from { stroke-dashoffset: 1; }
  to { stroke-dashoffset: 0; }
}
@keyframes breathe {
  0%, 100% { opacity: 0.8; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.02); }
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
@keyframes pulse-dot {
  0%, 100% { transform: scale(1); opacity: 0.6; }
  50% { transform: scale(1.3); opacity: 1; }
}

/* 减少动态效果 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .anim-draw { stroke-dashoffset: 0; }
}

/* 响应式调整 */
@media (max-width: 768px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .nav-links { gap: 1rem; }
  h1 { font-size: clamp(1.8rem, 6vw, 2.8rem); }
}
