/* =========================================
   SafeW 全站共享样式 (style.css)
   ========================================= */

/* --- 设计 Token & 变量 --- */
:root {
  /* 配色 */
  --color-dark: #21163C;       /* 深色面 */
  --color-paper: #E9E8EA;      /* 浅色纸面 */
  --color-text: #191523;       /* 正文色 */
  --color-brand: #5214EB;      /* 品牌色 */
  --color-accent: #ED926E;     /* 朱红强调色 */
  
  /* 派生透明度 */
  --color-text-alpha-16: rgba(25, 21, 35, 0.16);
  --color-paper-alpha-16: rgba(233, 232, 234, 0.16);

  /* 圆角 */
  --radius-card: 20px;
  --radius-btn: 12px;
  --radius-badge: 6px;

  /* 阴影 */
  --card-shadow: none;
  --card-border: 1px solid var(--color-text-alpha-16);

  /* 节奏与密度 */
  --section-y: clamp(2.5rem, 5vw, 4rem);
  --gap: clamp(0.75rem, 1.5vw, 1.25rem);
  --content-max: 960px;
  --header-height: 72px;

  /* 字体 */
  --font-sans: "Inter", system-ui, -apple-system, sans-serif;
  --line-height-body: 1.55;
}

/* --- 基础重置与排版 --- */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: var(--line-height-body);
  color: var(--color-text);
  background-color: var(--color-paper);
  overflow-x: hidden;
}

/* 容器 */
.container {
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--gap);
}

/* 标题系统 */
h1, h2, h3, h4 {
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.2;
  margin-bottom: var(--gap);
}

h1 {
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  text-wrap: balance;
}

h2 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  margin-top: 0;
}

h3 {
  font-size: 1.25rem;
  margin-top: 1.5em;
}

p {
  margin-bottom: 1em;
  max-width: 38em;
}

/* 眉标 (Kicker) */
.kicker {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 0.5em;
  color: var(--color-brand);
}

.dark-surface .kicker {
  color: var(--color-accent);
}

.highlight {
  color: var(--color-brand);
}

.dark-surface .highlight {
  color: var(--color-accent);
}

/* 链接 */
a {
  color: var(--color-brand);
  text-decoration: none;
  transition: color 0.2s ease;
}

.dark-surface a {
  color: var(--color-accent);
}

a:hover {
  text-decoration: underline;
}

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 48px;
  padding: 0 24px;
  border-radius: var(--radius-btn);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
  text-decoration: none;
  gap: 8px;
}

.btn:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 2px;
}

.btn-primary {
  background-color: var(--color-accent);
  color: var(--color-dark);
  border: none;
}

.btn-primary:hover {
  transform: translateY(-2px);
  filter: brightness(1.05);
}

.btn-secondary {
  background-color: transparent;
  color: var(--color-text);
  border: 1px solid var(--color-text);
}

.dark-surface .btn-secondary {
  color: var(--color-paper);
  border-color: var(--color-paper);
}

.btn-secondary:hover {
  background-color: rgba(25, 21, 35, 0.05);
  transform: translateY(-1px);
}

.dark-surface .btn-secondary:hover {
  background-color: rgba(233, 232, 234, 0.1);
}

/* 卡片 */
.card {
  background-color: #fff;
  border: var(--card-border);
  border-radius: var(--radius-card);
  padding: var(--gap);
  box-shadow: var(--card-shadow);
}

.dark-surface .card {
  background-color: var(--color-paper);
  border-color: var(--color-paper-alpha-16);
}

/* 表格 */
.table-container {
  overflow-x: auto;
  width: 100%;
  border-radius: var(--radius-card);
  border: var(--card-border);
}

table {
  width: 100%;
  border-collapse: collapse;
  white-space: nowrap;
}

th, td {
  padding: 16px;
  text-align: left;
  border-bottom: 1px solid var(--color-text-alpha-16);
}

th {
  background-color: rgba(25, 21, 35, 0.03);
  font-weight: 700;
}

.dark-surface th {
  background-color: rgba(233, 232, 234, 0.05);
}

tr:last-child td {
  border-bottom: none;
}

/* FAQ Details */
.faq-item {
  border-bottom: 1px solid var(--color-text-alpha-16);
  margin-bottom: 0;
}

.faq-item summary {
  padding: 16px 0;
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  position: relative;
  padding-right: 32px;
}

.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.5rem;
  line-height: 1;
  color: var(--color-brand);
}

.faq-item[open] summary::after {
  content: "-";
  color: var(--color-accent);
}

.faq-item p {
  margin-top: 0;
  margin-bottom: 16px;
  color: var(--color-text);
  opacity: 0.9;
}

/* 页头 */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background-color: rgba(233, 232, 234, 0.85);
  backdrop-filter: blur(12px);
  z-index: 100;
  border-bottom: 1px solid var(--color-text-alpha-16);
}

.dark-surface .header {
  background-color: rgba(33, 22, 60, 0.85);
  border-bottom-color: var(--color-paper-alpha-16);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--color-text);
  text-decoration: none;
}

.dark-surface .logo {
  color: var(--color-paper);
}

.logo img {
  height: 32px;
  width: auto;
}

.nav-links {
  display: flex;
  gap: 24px;
  align-items: center;
}

.nav-links a {
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--color-text);
}

.dark-surface .nav-links a {
  color: var(--color-paper);
}

.nav-links a:hover {
  color: var(--color-brand);
}

.dark-surface .nav-links a:hover {
  color: var(--color-accent);
}

.nav-links a[aria-current="page"] {
  color: var(--color-brand);
  font-weight: 700;
}

.dark-surface .nav-links a[aria-current="page"] {
  color: var(--color-accent);
}

/* 页脚 */
.footer {
  background-color: var(--color-dark);
  color: var(--color-paper);
  padding: 64px 0 32px;
  margin-top: var(--section-y);
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 48px;
  margin-bottom: 48px;
}

.footer-col h4 {
  color: var(--color-accent);
  font-size: 1rem;
  margin-bottom: 16px;
}

.footer-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-col li {
  margin-bottom: 12px;
}

.footer-col a {
  color: var(--color-paper);
  opacity: 0.8;
  font-size: 0.9rem;
}

.footer-col a:hover {
  opacity: 1;
  color: var(--color-accent);
}

.footer-bottom {
  border-top: 1px solid var(--color-paper-alpha-16);
  padding-top: 32px;
  text-align: center;
  font-size: 0.85rem;
  opacity: 0.6;
}

/* --- SVG 动效 Keyframes --- */

/* 绘制路径动画 */
@keyframes draw-path {
  from { stroke-dashoffset: 1; }
  to { stroke-dashoffset: 0; }
}

.anim-draw {
  pathLength: 1;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: draw-path 2s ease-out forwards;
}

/* 呼吸动画 (输入点) */
@keyframes breathe {
  0%, 100% { opacity: 0.3; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1); }
}

.anim-breathe {
  animation: breathe 2s infinite ease-in-out;
}

/* 浮动动画 */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.anim-float {
  animation: float 4s ease-in-out infinite;
}

/* 滑入动画 */
@keyframes slide-in-up {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.anim-slide-in {
  animation: slide-in-up 0.8s ease-out forwards;
}

/* 数据流动画 */
@keyframes flow-line {
  from { stroke-dashoffset: 100; }
  to { stroke-dashoffset: 0; }
}

.anim-flow {
  pathLength: 100;
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  animation: flow-line 3s linear infinite;
}

/* 节点闪烁 */
@keyframes pulse-node {
  0%, 100% { r: 3; opacity: 0.5; }
  50% { r: 5; opacity: 1; }
}

.anim-pulse {
  animation: pulse-node 2s infinite ease-in-out;
}

/* 延迟类 */
.delay-1 { animation-delay: 0.2s; }
.delay-2 { animation-delay: 0.4s; }
.delay-3 { animation-delay: 0.6s; }
.delay-4 { animation-delay: 0.8s; }

/* --- 响应式媒体查询 --- */
@media (max-width: 768px) {
  .nav-links {
    display: none; /* 简化版：移动端暂隐菜单，实际项目可加汉堡按钮 */
  }
  
  .header .btn-primary {
    display: block;
  }
  
  h1 {
    font-size: 2rem;
  }
  
  .hero-layout {
    flex-direction: column-reverse !important;
  }
  
  .hero-visual {
    width: 100% !important;
    margin-bottom: 24px;
  }
}

/* 减少动态效果 */
@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-draw, .anim-flow {
    stroke-dashoffset: 0 !important;
  }
}
