/* =========================================
   SafeW 全站共享样式 (style.css)
   ========================================= */

/* --- 设计变量与基础重置 --- */
:root {
  /* 色板 */
  --color-dark: #121531;
  --color-paper: #E8E9EA;
  --color-paper-light: #F0F1F3;
  --color-text: #151723;
  --color-brand: #142CEB;
  --color-accent: #ED7D6E;

  /* 圆角与边界 */
  --radius-card: 24px;
  --radius-btn: 999px;
  --card-border: 0;
  --card-shadow: none;

  /* 间距与节奏 */
  --section-y: clamp(3.5rem, 7vw, 6rem);
  --gap: clamp(1rem, 2vw, 1.75rem);
  --content-max: 960px;
  --line-height-body: 1.65;
  --line-height-title: 1.15;

  /* 默认背景与文字变量（供组件继承） */
  --bg: var(--color-paper);
  --text: var(--color-text);
  --brand: var(--color-brand);
  --accent: var(--color-accent);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Noto Sans SC", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 1rem;
  line-height: var(--line-height-body);
  color: var(--text);
  background-color: var(--bg);
  overflow-x: hidden;
}

img, svg {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: var(--brand);
  text-decoration: none;
  transition: opacity 0.2s ease;
}
a:hover { opacity: 0.85; }
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

/* --- 布局容器 --- */
.container {
  max-width: var(--content-max);
  margin-inline: auto;
  padding-inline: var(--gap);
}

section {
  padding-block: var(--section-y);
}

/* --- 背景主题覆盖 --- */
.bg-dark {
  background-color: var(--color-dark);
  color: var(--color-paper);
  --text: var(--color-paper);
  --brand: var(--color-accent);
  --accent: var(--color-accent);
}
.bg-dark .hl { color: var(--color-accent); }
.bg-dark .subtitle { color: var(--color-accent); }
.bg-dark .card { background-color: var(--color-paper-light); color: var(--color-text); }
.bg-dark .card .hl { color: var(--color-brand); }
.bg-dark a:not(.btn) { color: var(--color-accent); }

.bg-paper-light {
  background-color: var(--color-paper-light);
  color: var(--color-text);
  --bg: var(--color-paper-light);
}

/* --- 排版系统 --- */
.subtitle {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
  color: var(--brand);
}

h1 {
  font-size: clamp(2.6rem, 6.4vw, 5rem);
  font-weight: 500;
  line-height: var(--line-height-title);
  letter-spacing: -0.02em;
  margin-bottom: 1.5rem;
  text-wrap: balance;
}

h2 {
  font-size: clamp(1.8rem, 3.5vw, 2.8rem);
  font-weight: 500;
  line-height: var(--line-height-title);
  margin-bottom: 1.5rem;
  text-wrap: balance;
}

h3 {
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.35;
  margin-bottom: 0.75rem;
  margin-top: 1.5rem;
}

p {
  max-width: 38em;
  margin-bottom: 1rem;
}

.hl {
  color: var(--brand);
  font-weight: 600;
}

/* --- 按钮组件 --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  height: 52px;
  padding: 0 2rem;
  border-radius: var(--radius-btn);
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.btn-primary {
  background-color: var(--color-accent);
  color: var(--color-dark);
  border: none;
}
.btn-secondary {
  background-color: transparent;
  color: var(--text);
  border: 1px solid var(--text);
}
.bg-dark .btn-secondary {
  color: var(--color-paper);
  border-color: var(--color-paper);
}

/* --- 卡片组件 --- */
.card {
  background-color: var(--bg);
  border: var(--card-border) solid transparent;
  box-shadow: var(--card-shadow);
  border-radius: var(--radius-card);
  padding: var(--gap);
  transition: transform 0.2s ease;
}
.card:hover { transform: translateY(-4px); }

.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); }

/* --- 表格组件 --- */
.spec-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
  font-size: 0.95rem;
}
.spec-table th, .spec-table td {
  padding: 0.75rem 0;
  text-align: left;
  border-bottom: 1px solid color-mix(in srgb, var(--text) 15%, transparent);
}
.spec-table th { font-weight: 600; width: 40%; }
.spec-table td { color: var(--text); }
.bg-dark .spec-table td { color: var(--color-paper); }

/* --- FAQ 组件 --- */
.faq-item {
  border-bottom: 1px solid color-mix(in srgb, var(--text) 15%, transparent);
  padding-block: 1rem;
}
.faq-item summary {
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  font-size: 1.2rem;
  transition: transform 0.2s ease;
}
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item p { margin-top: 0.75rem; font-size: 0.95rem; opacity: 0.9; }

/* --- 步骤编号 --- */
.step-list { counter-reset: step; list-style: none; padding: 0; }
.step-list li {
  position: relative;
  padding-left: 3.5rem;
  margin-bottom: 1.5rem;
}
.step-list li::before {
  counter-increment: step;
  content: "0" counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 2.5rem;
  height: 2.5rem;
  background-color: var(--color-accent);
  color: var(--color-dark);
  font-weight: 700;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
}

/* --- 响应式微调 --- */
@media (max-width: 768px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  h1 { font-size: clamp(2.2rem, 8vw, 3.5rem); }
  h2 { font-size: clamp(1.6rem, 5vw, 2.2rem); }
}

/* =========================================
   SVG 动效系统 (CSS Keyframes & Classes)
   ========================================= */
.svg-responsive {
  width: 100%;
  height: auto;
}

/* 星点明灭 */
@keyframes twinkle {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}
.anim-star { animation: twinkle 5s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }

/* 线条绘制与流动 */
@keyframes drawFlow {
  0% { stroke-dashoffset: 1; }
  40% { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: 0; }
}
.anim-draw {
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: drawFlow 8s linear infinite;
}

/* 界面元素微浮 */
@keyframes floatSoft {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}
.anim-float { animation: floatSoft 6s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }

/* 气泡依次浮现后漂浮 */
@keyframes bubblePop {
  0%, 100% { opacity: 0.85; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(-3px); }
}
.anim-bubble { animation: bubblePop 4.5s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.delay-1 { animation-delay: 0.8s; }
.delay-2 { animation-delay: 1.6s; }
.delay-3 { animation-delay: 2.4s; }

/* 输入中三个点呼吸 */
@keyframes breathe {
  0%, 100% { opacity: 0.4; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1.1); }
}
.anim-breathe { animation: breathe 2s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }

/* 通知卡片滑入 */
@keyframes slideIn {
  0% { opacity: 0; transform: translateX(12px); }
  100% { opacity: 1; transform: translateX(0); }
}
.anim-slide { animation: slideIn 1.2s cubic-bezier(0.2, 0.8, 0.2, 1) forwards; }

/* 减少动态效果偏好 */
@media (prefers-reduced-motion: reduce) {
  .anim-star, .anim-draw, .anim-float, .anim-bubble, .anim-breathe, .anim-slide {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}
