/* SafeW 全站共享样式 */
:root {
  --color-dark: #21163C;
  --color-paper: #F4F3F7;
  --color-text: #191523;
  --color-brand: #5214EB;
  --color-accent: #ED926E;
  --color-btn-text: #21163C;

  --radius-card: 20px;
  --radius-btn: 12px;
  --section-y: clamp(3.5rem, 7vw, 6rem);
  --gap: clamp(1rem, 2vw, 1.75rem);
  --content-max: 960px;
  --line-height: 1.65;

  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", sans-serif;
}

/* 表面层变量覆盖 */
.surface-dark {
  --bg-surface: var(--color-dark);
  --text-main: var(--color-paper);
  --text-muted: rgba(244, 247, 247, 0.75);
  --accent: var(--color-accent);
  --brand: var(--color-accent);
  --border: rgba(244, 247, 247, 0.15);
}

.surface-light {
  --bg-surface: var(--color-paper);
  --text-main: var(--color-text);
  --text-muted: rgba(25, 21, 35, 0.65);
  --accent: var(--color-accent);
  --brand: var(--color-brand);
  --border: rgba(25, 21, 35, 0.16);
}

.card-light {
  --text-main: var(--color-text);
  --text-muted: rgba(25, 21, 35, 0.65);
  --brand: var(--color-brand);
  --border: rgba(25, 21, 35, 0.16);
}

/* 基础重置与排版 */
*, *::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(--line-height);
  color: var(--text-main);
  background-color: var(--color-paper);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

/* 布局容器 */
.container {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--gap);
}

.section {
  padding-top: var(--section-y);
  padding-bottom: var(--section-y);
  background-color: var(--bg-surface);
}

.section-header {
  margin-bottom: var(--gap);
}

.breadcrumb {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--brand);
  margin-bottom: 0.75rem;
  text-transform: uppercase;
}

h1 {
  font-size: clamp(2rem, 4.6vw, 3.4rem);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: 0;
  margin-bottom: 1rem;
  text-wrap: balance;
}

h2 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 600;
  line-height: 1.25;
  margin-bottom: 1.25rem;
  text-wrap: balance;
}

h3 {
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.35;
  margin-bottom: 0.75rem;
}

p {
  margin-bottom: 1rem;
  max-width: 38em;
  color: var(--text-main);
}

.hl {
  color: var(--brand);
  font-weight: 600;
}

.surface-dark .hl {
  color: var(--accent);
}

/* 页头 */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: rgba(244, 247, 247, 0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}

.surface-dark .site-header {
  background-color: rgba(33, 22, 60, 0.9);
}

.site-header.scrolled {
  border-bottom-color: var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-area img {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.nav-links {
  display: flex;
  gap: 1.5rem;
}

.nav-links a {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-main);
  padding: 0.25rem 0;
  position: relative;
}

.nav-links a[aria-current="page"],
.nav-links a:hover {
  color: var(--brand);
}

.surface-dark .nav-links a {
  color: var(--text-main);
}

.surface-dark .nav-links a[aria-current="page"],
.surface-dark .nav-links a:hover {
  color: var(--accent);
}

/* 按钮 */
.btn-group {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 1.5rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  height: 52px;
  padding: 0 1.5rem;
  border-radius: var(--radius-btn);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, background-color 0.2s ease;
  border: none;
  white-space: nowrap;
}

.btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.btn-primary {
  background-color: var(--color-accent);
  color: var(--color-btn-text);
}

.btn-primary:hover {
  transform: translateY(-2px);
  filter: brightness(1.05);
}

.btn-secondary {
  background: transparent;
  border: 1.5px solid var(--text-main);
  color: var(--text-main);
}

.surface-dark .btn-secondary {
  border-color: var(--text-main);
  color: var(--text-main);
}

.btn-secondary:hover {
  transform: translateY(-2px);
  background-color: rgba(25, 21, 35, 0.05);
}

.surface-dark .btn-secondary:hover {
  background-color: rgba(244, 247, 247, 0.08);
}

.btn svg {
  width: 20px;
  height: 20px;
  stroke-width: 1.8;
}

/* 网格与图文交错 */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--gap);
}

@media (max-width: 768px) {
  .grid-2 { grid-template-columns: 1fr; }
  .nav-links { display: none; }
}

.content-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--gap);
}

.content-row.reverse { flex-direction: row-reverse; }
@media (max-width: 768px) {
  .content-row, .content-row.reverse { flex-direction: column; }
}

.text-col { flex: 1 1 0; min-width: 0; }
.visual-col { flex: 1 1 0; min-width: 0; }

.panel {
  background-color: var(--bg-surface);
  border-radius: var(--radius-card);
  padding: var(--gap);
  border: 1px solid var(--border);
  overflow: hidden;
}

.panel svg {
  width: 100%;
  height: auto;
}

/* 时间轴 */
.timeline {
  position: relative;
  padding-left: 2rem;
  border-left: 2px solid var(--border);
}

.timeline-item {
  position: relative;
  margin-bottom: 2.5rem;
  padding-left: 1rem;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -2.4rem;
  top: 0.3rem;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: var(--accent);
  border: 2px solid var(--bg-surface);
}

.time-mark {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--brand);
  margin-bottom: 0.5rem;
  letter-spacing: 0.03em;
}

/* 功能分段 */
.feature-block {
  margin-bottom: 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}

.feature-block:last-child { border-bottom: none; margin-bottom: 0; }

.step-list {
  counter-reset: step;
  list-style: none;
  padding: 0;
}

.step-list li {
  position: relative;
  padding-left: 2rem;
  margin-bottom: 0.75rem;
  color: var(--text-main);
}

.step-list li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 6px;
  background-color: var(--accent);
  color: var(--color-btn-text);
  font-weight: 700;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.note-box {
  margin-top: 1rem;
  padding: 1rem;
  border-left: 3px solid var(--accent);
  background-color: rgba(237, 146, 110, 0.08);
  border-radius: 0 var(--radius-btn) var(--radius-btn) 0;
  font-size: 0.95rem;
  color: var(--text-main);
}

/* 新闻卡片 */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--gap);
}

.news-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.news-card h3 {
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
}

.news-card p {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.news-date {
  font-size: 0.8rem;
  color: var(--brand);
  font-weight: 600;
}

/* 表格 */
.data-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
  font-size: 0.95rem;
}

.data-table th,
.data-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

.data-table th {
  font-weight: 600;
  color: var(--brand);
}

.surface-dark .data-table th {
  color: var(--accent);
}

/* FAQ */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  overflow: hidden;
  background-color: var(--bg-surface);
}

.faq-item summary {
  padding: 1.25rem 1.5rem;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-main);
}

.faq-item summary::-webkit-details-marker { display: none; }

.faq-item summary::after {
  content: "+";
  font-size: 1.25rem;
  color: var(--brand);
  transition: transform 0.2s ease;
}

.faq-item[open] summary::after {
  transform: rotate(45deg);
}

.faq-item p {
  padding: 0 1.5rem 1.25rem;
  color: var(--text-muted);
}

/* SVG 图标通用 */
.icon {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* SVG 动效 */
.anim-orbit {
  transform-box: fill-box;
  transform-origin: center;
  animation: orbit-breathe 6s ease-in-out infinite;
}

.anim-orbit-delay {
  animation-delay: 1.5s;
}

.anim-float {
  transform-box: fill-box;
  transform-origin: center;
  animation: float-up 5s ease-in-out infinite;
}

.anim-draw {
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: draw-stroke 4s ease-in-out infinite;
}

@keyframes orbit-breathe {
  0%, 100% { transform: scale(1); opacity: 0.25; }
  50% { transform: scale(1.06); opacity: 0.45; }
}

@keyframes float-up {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

@keyframes draw-stroke {
  0%, 100% { stroke-dashoffset: 1; }
  50% { stroke-dashoffset: 0; }
}

/* 减少动态效果 */
@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-orbit, .anim-float, .anim-draw {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}
