/* =========================================
   SafeW 全站共享样式
   ========================================= */
:root {
  /* 色板 */
  --color-dark: #231334;
  --color-paper: #E9E8EA;
  --color-text: #1C1523;
  --color-brand: #7D14EB;
  --color-accent: #EDD26E;
  --color-white: #FFFFFF;

  /* 卡片背景微调（同色系深浅档） */
  --bg-card-light: #DFDEE0;
  --bg-card-dark: #2A1A3D;

  /* 结构 Token */
  --radius-card: 20px;
  --radius-btn: 12px;
  --card-border: 0;
  --card-shadow: none;
  --section-y: clamp(3.5rem, 7vw, 6rem);
  --gap: clamp(1rem, 2vw, 1.75rem);
  --content-max: 1120px;

  /* 字体 */
  --font-main: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-main);
  background-color: var(--color-paper);
  color: var(--color-text);
  line-height: 1.65;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* 布局容器 */
.container { max-width: var(--content-max); margin: 0 auto; padding: 0 var(--gap); }
section { padding-top: var(--section-y); padding-bottom: var(--section-y); }

/* 标题与眉标 */
h1, h2, h3 { font-weight: 500; line-height: 1.15; letter-spacing: -0.02em; }
h1 { font-size: clamp(2.6rem, 6.4vw, 5rem); }
h2 { font-size: clamp(1.8rem, 3.5vw, 2.8rem); margin-bottom: var(--gap); }
h3 { font-size: clamp(1.3rem, 2vw, 1.6rem); margin-bottom: 0.6em; }
p { margin-bottom: 1em; max-width: 38em; }
.eyebrow { display: inline-block; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.05em; margin-bottom: 0.5em; }
.light-paper .eyebrow { color: var(--color-brand); }
.dark-surface .eyebrow { color: var(--color-accent); }
.hl { font-weight: 600; }
.light-paper .hl { color: var(--color-brand); }
.dark-surface .hl { color: var(--color-accent); }

/* 导航与页头 */
header { position: sticky; top: 0; z-index: 100; background: rgba(233, 232, 234, 0.92); backdrop-filter: blur(10px); border-bottom: 1px solid rgba(28, 21, 35, 0.08); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.logo img { height: 32px; width: auto; vertical-align: middle; }
.logo span { margin-left: 0.5em; font-weight: 700; font-size: 1.1rem; color: var(--color-text); }
nav { display: flex; gap: var(--gap); align-items: center; }
nav a { text-decoration: none; color: var(--color-text); font-weight: 500; font-size: 0.95rem; transition: color 0.2s; }
nav a:hover, nav a[aria-current="page"] { color: var(--color-brand); }

/* 按钮 */
.btn { display: inline-flex; align-items: center; gap: 0.5em; padding: 0.8em 1.6em; border-radius: var(--radius-btn); font-weight: 600; text-decoration: none; transition: transform 0.2s ease, opacity 0.2s ease; cursor: pointer; border: none; font-size: 1rem; }
.btn-primary { background: var(--color-accent); color: var(--color-dark); }
.btn-primary:hover { transform: translateY(-2px); opacity: 0.9; }
.btn-secondary { background: transparent; border: 1px solid var(--color-text); color: var(--color-text); }
.btn-secondary:hover { background: rgba(28, 21, 35, 0.05); transform: translateY(-2px); }
.dark-surface .btn-secondary { border-color: var(--color-white); color: var(--color-white); }
.dark-surface .btn-secondary:hover { background: rgba(255, 255, 255, 0.1); }
.btn svg { width: 20px; height: 20px; stroke: currentColor; fill: none; }
@media (min-width: 768px) { .btn { min-height: 48px; } }

/* 卡片与网格 */
.card { background: var(--bg-card-light); border-radius: var(--radius-card); padding: var(--gap); border: var(--card-border); box-shadow: var(--card-shadow); }
.dark-surface { background: var(--color-dark); color: var(--color-white); }
.dark-surface .card { background: var(--bg-card-dark); color: var(--color-white); }
.grid-2 { display: grid; gap: var(--gap); grid-template-columns: 1fr; }
.grid-3 { display: grid; gap: var(--gap); grid-template-columns: 1fr; }
@media (min-width: 768px) { .grid-2 { grid-template-columns: repeat(2, 1fr); } .grid-3 { grid-template-columns: repeat(3, 1fr); } }

/* 图文交错行 */
.alt-row { display: flex; flex-direction: column; gap: var(--gap); }
@media (min-width: 768px) {
  .alt-row { flex-direction: row; align-items: center; }
  .alt-row.reverse { flex-direction: row-reverse; }
  .alt-row .text-col { flex: 1; }
  .alt-row .visual-col { flex: 1; display: flex; justify-content: center; }
}

/* 表格 */
table { width: 100%; border-collapse: collapse; margin: var(--gap) 0; font-size: 0.95rem; table-layout: fixed; }
th, td { padding: 0.8em 1em; text-align: left; border-bottom: 1px solid rgba(28, 21, 35, 0.1); word-break: break-word; }
th { font-weight: 600; }
tr:last-child td { border-bottom: none; }
.dark-surface th, .dark-surface td { border-bottom-color: rgba(255, 255, 255, 0.1); }

/* 折叠面板 FAQ */
details { margin-bottom: 1em; border: 1px solid rgba(28, 21, 35, 0.1); border-radius: var(--radius-card); overflow: hidden; }
summary { padding: 1em; cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; align-items: center; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; font-size: 1.2em; font-weight: 400; }
details[open] summary::after { content: "-"; }
details > div { padding: 0 1em 1em; }
.dark-surface details { border-color: rgba(255, 255, 255, 0.15); }

/* 视觉面板与 SVG 动效 */
.svg-panel { width: 100%; height: auto; max-width: 600px; margin: 0 auto; }
.draw-line { pathLength: 1; stroke-dasharray: 1; stroke-dashoffset: 0; animation: drawAnim 4s ease-in-out infinite alternate; }
.float-bubble { animation: floatBubble 5s ease-in-out infinite alternate; }
.pulse-dot { animation: pulseDot 3s ease-in-out infinite; }
.slide-in { animation: slideIn 6s ease-in-out infinite alternate; }
@keyframes drawAnim { 0% { stroke-dashoffset: 1; } 100% { stroke-dashoffset: 0; } }
@keyframes floatBubble { 0% { transform: translateY(0); } 100% { transform: translateY(-8px); } }
@keyframes pulseDot { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }
@keyframes slideIn { 0% { transform: translateX(20px); opacity: 0.6; } 100% { transform: translateX(0); opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .draw-line, .float-bubble, .pulse-dot, .slide-in { animation: none !important; }
}

/* 焦点与无障碍 */
:focus-visible { outline: 2px solid var(--color-brand); outline-offset: 2px; }
.dark-surface :focus-visible { outline-color: var(--color-accent); }
a:focus-visible { outline-offset: 4px; }

/* 步骤徽标 */
.step-badge { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; background: var(--color-accent); color: var(--color-dark); font-weight: 700; border-radius: 6px; margin-right: 0.5em; flex-shrink: 0; }
.dark-surface .step-badge { background: var(--color-accent); color: var(--color-dark); }

/* 响应式调整 */
@media (max-width: 767px) {
  .header-inner { flex-wrap: wrap; height: auto; padding: 0.8em 0; }
  nav { flex-wrap: wrap; gap: 0.5em; }
  .alt-row { flex-direction: column !important; }
}
