/* ==========================================
   SafeW 全站共享样式
   ========================================== */

/* 设计变量 */
:root {
  --color-dark: #21163C;
  --color-paper: #E9E8EA;
  --color-body: #191523;
  --color-brand: #5214EB;
  --color-accent: #ED926E;
  
  --radius-card: 20px;
  --radius-btn: 12px;
  --card-border: 0;
  --card-shadow: 0 10px 28px -14px rgba(25, 21, 35, 0.3);
  
  --section-y: clamp(3.5rem, 7vw, 6rem);
  --gap: clamp(1rem, 2vw, 1.75rem);
  --content-max: 1280px;
  
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --line-height-base: 1.65;
}

/* 基础重置与排版 */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: var(--line-height-base);
  color: var(--color-body);
  background-color: var(--color-paper);
  -webkit-font-smoothing: antialiased;
  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-inline: auto;
  padding-inline: var(--gap);
}
.section {
  padding-block: var(--section-y);
  position: relative;
}

/* 面色控制类 */
.section--light {
  background-color: var(--color-paper);
  color: var(--color-body);
  --text-main: var(--color-body);
  --text-highlight: var(--color-brand);
  --link-color: var(--color-brand);
}
.section--dark {
  background-color: var(--color-dark);
  color: var(--color-paper);
  --text-main: var(--color-paper);
  --text-highlight: var(--color-accent);
  --link-color: var(--color-accent);
}
.section--inner-card {
  background-color: var(--color-paper);
  color: var(--color-body);
  --text-main: var(--color-body);
  --text-highlight: var(--color-brand);
  --link-color: var(--color-brand);
  border-radius: var(--radius-card);
  padding: var(--gap);
  box-shadow: var(--card-shadow);
}

/* 标题与眉标 */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 12px;
  color: var(--text-highlight);
}
.eyebrow::before {
  content: "";
  display: block;
  width: 16px;
  height: 2px;
  background-color: currentColor;
}
h1 {
  font-size: clamp(2.2rem, 5vw, 4rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 24px;
  color: var(--text-main);
}
h2 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 600;
  line-height: 1.25;
  margin-bottom: 32px;
  color: var(--text-main);
}
h3 {
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 12px;
  color: var(--text-main);
}
p { margin-bottom: 16px; max-width: 38em; }
.hl { color: var(--text-highlight); font-weight: 700; }

/* 按钮组件 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 52px;
  padding: 0 24px;
  border-radius: var(--radius-btn);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
  border: none;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); }
.btn:focus-visible { outline: 3px solid var(--text-highlight); outline-offset: 3px; }
.btn-primary {
  background-color: var(--color-accent);
  color: var(--color-dark);
}
.btn-primary:hover { background-color: #d9825f; }
.btn-secondary {
  background: transparent;
  border: 2px solid var(--text-main);
  color: var(--text-main);
}
.btn-secondary:hover { background-color: rgba(128,128,128,0.1); }
.btn svg { width: 20px; height: 20px; flex-shrink: 0; }

/* 导航页头 */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: rgba(233, 232, 234, 0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(25, 21, 35, 0.08);
}
.section--dark .site-header {
  background-color: rgba(33, 22, 60, 0.9);
  border-bottom-color: rgba(233, 232, 234, 0.1);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.logo-group {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 1.1rem;
}
.logo-group img { height: 32px; width: auto; }
.nav-links { display: flex; gap: 24px; align-items: center; }
.nav-links a {
  font-size: 0.95rem;
  font-weight: 500;
  padding: 8px 0;
  border-bottom: 2px solid transparent;
  transition: border-color 0.2s;
}
.nav-links a:hover, .nav-links a[aria-current="page"] {
  border-bottom-color: var(--text-highlight);
}
@media (max-width: 768px) {
  .nav-links { display: none; }
}

/* 页脚 */
.site-footer {
  padding-block: 48px;
  border-top: 1px solid rgba(128,128,128,0.2);
  text-align: center;
  font-size: 0.9rem;
  opacity: 0.85;
}
.footer-nav { display: flex; justify-content: center; gap: 24px; margin-bottom: 16px; }
.footer-nav a { color: var(--text-highlight); }

/* 网格与卡片 */
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: var(--gap); }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: var(--gap); }
.card {
  background: rgba(128,128,128,0.05);
  border: 1px solid rgba(128,128,128,0.15);
  border-radius: var(--radius-card);
  padding: var(--gap);
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}
.card:hover { box-shadow: var(--card-shadow); transform: translateY(-4px); }
.news-card {
  display: flex;
  flex-direction: column;
  background-color: var(--color-paper);
  color: var(--color-body);
  border-radius: var(--radius-card);
  padding: 24px;
  box-shadow: var(--card-shadow);
}
.news-card h3 { font-size: 1.1rem; margin-bottom: 8px; }
.news-card p { font-size: 0.95rem; opacity: 0.9; margin-bottom: 12px; }
.news-card time { font-size: 0.85rem; color: #666; }

/* 表格 */
.data-table {
  width: 100%;
  border-collapse: collapse;
  margin-block: 24px;
}
.data-table th, .data-table td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid rgba(128,128,128,0.2);
}
.data-table th { font-weight: 600; color: var(--text-main); }
.data-table td { color: var(--text-main); }
.data-table tr:last-child td { border-bottom: none; }

/* FAQ */
.faq-item {
  border-bottom: 1px solid rgba(128,128,128,0.2);
  margin-bottom: 12px;
}
.faq-item summary {
  padding: 16px 0;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  position: relative;
  padding-right: 32px;
  color: var(--text-main);
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.2rem;
  transition: transform 0.2s;
}
.faq-item[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.faq-item p { padding-bottom: 16px; color: var(--text-main); opacity: 0.9; }

/* 时间轴 */
.timeline {
  position: relative;
  padding-left: 32px;
  border-left: 2px solid rgba(128,128,128,0.3);
}
.timeline-item {
  position: relative;
  margin-bottom: 32px;
  padding-left: 24px;
}
.timeline-item::before {
  content: "";
  position: absolute;
  left: -37px;
  top: 6px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: var(--text-highlight);
  border: 3px solid var(--section-bg, var(--color-paper));
}
.timeline-time {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-highlight);
  margin-bottom: 6px;
  letter-spacing: 0.05em;
}

/* SVG 动效基础 */
.svg-panel {
  width: 100%;
  height: auto;
  overflow: hidden;
}
svg { display: block; }
svg circle, svg path, svg rect, svg line, svg polyline {
  transform-box: fill-box;
  transform-origin: center;
}
.anim-draw {
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: safe-draw 6s ease-in-out infinite alternate;
}
.anim-line {
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: safe-flow 8s linear infinite;
}
.anim-float {
  animation: safe-float 5s ease-in-out infinite;
}
.anim-pulse {
  animation: safe-pulse 4s ease-in-out infinite;
}
.anim-delay-1 { animation-delay: 0.8s; }
.anim-delay-2 { animation-delay: 1.6s; }
.anim-delay-3 { animation-delay: 2.4s; }

@keyframes safe-draw {
  from { stroke-dashoffset: 1; }
  to { stroke-dashoffset: 0; }
}
@keyframes safe-flow {
  from { stroke-dashoffset: 1; }
  to { stroke-dashoffset: 0; }
}
@keyframes safe-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
@keyframes safe-pulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

/* 减少动态效果 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    animation: none !important;
  }
  html { scroll-behavior: auto; }
}
