/* === 设计变量 === */
:root {
  --color-dark: #13102D;
  --color-paper: #D6D4ED;
  --color-body: #171523;
  --color-brand: #2714EB;
  --color-accent: #89ED6E;
  --radius-card: 24px;
  --radius-btn: 999px;
  --card-border: 0;
  --card-shadow: 0 10px 28px -14px rgba(23,21,35,0.3);
  --section-y: clamp(2.5rem, 5vw, 4rem);
  --gap: clamp(0.75rem, 1.5vw, 1.25rem);
  --content-max: 1280px;
  --font-title-weight: 500;
  --line-height-title: 1.15;
  --line-height-body: 1.55;
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* === 基础重置与排版 === */
*, *::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);
  background: var(--color-paper);
  color: var(--color-body);
  line-height: var(--line-height-body);
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

/* === 布局容器 === */
.container {
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--gap);
}
.section {
  padding-block: var(--section-y);
  position: relative;
}
.section + .section { border-top: 1px solid rgba(23,21,35,0.1); }

/* === 主题覆盖 === */
.theme-paper { background: var(--color-paper); color: var(--color-body); }
.theme-dark { background: var(--color-dark); color: var(--color-paper); }
.theme-dark .hl { color: var(--color-accent); }
.theme-dark a:not(.btn):not(.btn-outline) { color: var(--color-accent); }
.theme-dark .badge { color: var(--color-accent); }
.theme-dark table th, .theme-dark table td { color: var(--color-paper); }
.theme-dark table th { color: var(--color-accent); }

/* === 标题与眉标 === */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--color-brand);
  margin-bottom: 12px;
}
.theme-dark .badge { color: var(--color-accent); }
h1 {
  font-size: clamp(2.6rem, 6.4vw, 5rem);
  font-weight: var(--font-title-weight);
  line-height: var(--line-height-title);
  letter-spacing: -0.02em;
  margin-bottom: 24px;
  text-wrap: balance;
}
h2 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: var(--font-title-weight);
  line-height: var(--line-height-title);
  letter-spacing: -0.01em;
  margin-bottom: 32px;
  text-wrap: balance;
}
h3 {
  font-size: 1.25rem;
  font-weight: var(--font-title-weight);
  line-height: 1.3;
  margin-bottom: 12px;
}
.hl { color: var(--color-brand); }
.theme-dark .hl { color: var(--color-accent); }

/* === 按钮 === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 52px;
  padding: 0 28px;
  border-radius: var(--radius-btn);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.btn:focus-visible { outline: 3px solid var(--color-accent); outline-offset: 3px; }
.btn-primary {
  background: var(--color-accent);
  color: var(--color-dark);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(137,237,110,0.25); }
.btn-secondary {
  background: transparent;
  border: 1px solid var(--color-body);
  color: var(--color-body);
}
.theme-dark .btn-secondary {
  border-color: var(--color-paper);
  color: var(--color-paper);
}
.btn-secondary:hover { background: rgba(23,21,35,0.06); }
.theme-dark .btn-secondary:hover { background: rgba(214,212,237,0.1); }
.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 48px;
  padding: 0 20px;
  border-radius: var(--radius-btn);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
  background: transparent;
  border: 1px solid var(--color-accent);
  color: var(--color-accent);
}
.btn-outline:hover {
  background: rgba(137, 237, 110, 0.1);
  transform: translateY(-2px);
}
.theme-dark-btn {
  border-color: var(--color-paper);
  color: var(--color-paper);
}
.theme-dark-btn:hover {
  background: rgba(214, 212, 237, 0.1);
}

/* === 卡片与面板 === */
.card {
  background: #fff;
  border-radius: var(--radius-card);
  border: var(--card-border);
  box-shadow: var(--card-shadow);
  padding: 24px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card:hover { transform: translateY(-2px); box-shadow: 0 14px 32px -12px rgba(23,21,35,0.35); }
.panel {
  background: var(--color-dark);
  border-radius: var(--radius-card);
  padding: 24px;
  position: relative;
  overflow: hidden;
}

/* === 表格 === */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table {
  width: 100%;
  border-collapse: collapse;
  min-width: 480px;
}
th, td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid rgba(23,21,35,0.1);
}
th { font-weight: 700; color: var(--color-brand); }
.theme-dark th { color: var(--color-accent); }
td { color: inherit; }
tr:last-child td { border-bottom: none; }

/* === FAQ / Details === */
.faq-list { display: grid; gap: 16px; }
details {
  background: rgba(255,255,255,0.6);
  border-radius: 16px;
  padding: 16px 20px;
  border: 1px solid rgba(23,21,35,0.08);
  transition: background 0.2s;
}
.theme-dark details { background: rgba(255,255,255,0.05); border-color: rgba(255,255,255,0.1); }
details[open] { background: rgba(255,255,255,0.9); }
.summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  font-weight: 600;
  list-style: none;
}
.summary::-webkit-details-marker { display: none; }
.summary::after {
  content: "+";
  font-size: 1.2rem;
  font-weight: 500;
  transition: transform 0.2s;
}
details[open] .summary::after { transform: rotate(45deg); }
.details-content { margin-top: 12px; line-height: 1.7; color: inherit; }

/* === 标签页 (CSS Only) === */
.tabs-nav { display: flex; gap: 8px; margin-bottom: 24px; flex-wrap: wrap; }
.tab-radio { display: none; }
.tab-label {
  padding: 10px 18px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95rem;
  background: rgba(23,21,35,0.04);
  border: 1px solid rgba(23,21,35,0.08);
  transition: all 0.2s;
}
.theme-dark .tab-label { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.1); }
.tab-panel { display: none; animation: fadeIn 0.3s ease; }
.tab-radio:checked + .tab-label { background: var(--color-brand); color: #fff; border-color: var(--color-brand); }
.theme-dark .tab-radio:checked + .tab-label { background: var(--color-accent); color: var(--color-dark); border-color: var(--color-accent); }
.tab-radio:nth-of-type(1):checked ~ .tab-panel:nth-of-type(1),
.tab-radio:nth-of-type(2):checked ~ .tab-panel:nth-of-type(2),
.tab-radio:nth-of-type(3):checked ~ .tab-panel:nth-of-type(3),
.tab-radio:nth-of-type(4):checked ~ .tab-panel:nth-of-type(4) { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

/* === 时间线 === */
.timeline { position: relative; padding-left: 32px; }
.timeline::before {
  content: "";
  position: absolute; left: 11px; top: 8px; bottom: 8px;
  width: 2px; background: rgba(23,21,35,0.15);
}
.theme-dark .timeline::before { background: rgba(255,255,255,0.15); }
.step { position: relative; margin-bottom: 32px; }
.step:last-child { margin-bottom: 0; }
.step-num {
  position: absolute; left: -32px; top: 0;
  width: 24px; height: 24px;
  background: var(--color-accent);
  color: var(--color-dark);
  border-radius: 8px;
  display: grid; place-items: center;
  font-weight: 700; font-size: 0.85rem;
}
.step-title { font-weight: 600; margin-bottom: 6px; }

/* === SVG 动效基础 === */
.svg-container { width: 100%; height: auto; max-width: 100%; display: block; }
svg { width: 100%; height: auto; overflow: visible; }
svg path, svg line, svg circle, svg rect {
  pathLength: 1;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
}

/* 绘制连线 */
@keyframes drawLine {
  0% { stroke-dashoffset: 1; }
  40%, 60% { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: 0; }
}
.anim-draw { animation: drawLine 6s ease-in-out infinite; }

/* 星点明灭 */
@keyframes twinkle {
  0%, 100% { opacity: 0.4; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1.1); }
}
.anim-twinkle { animation: twinkle 4s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.anim-twinkle-delay { animation: twinkle 4s ease-in-out infinite 1.5s; transform-box: fill-box; transform-origin: center; }

/* 消息气泡漂浮 */
@keyframes floatBubble {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
.anim-float { animation: floatBubble 5s ease-in-out infinite; }
.anim-float-delay { animation: floatBubble 5s ease-in-out infinite 1.2s; }

/* 输入点呼吸 */
@keyframes breatheDot {
  0%, 100% { opacity: 0.3; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1); }
}
.anim-breathe { animation: breatheDot 2.4s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.anim-breathe-2 { animation: breatheDot 2.4s ease-in-out infinite 0.4s; transform-box: fill-box; transform-origin: center; }
.anim-breathe-3 { animation: breatheDot 2.4s ease-in-out infinite 0.8s; transform-box: fill-box; transform-origin: center; }

/* 通知卡片滑入 */
@keyframes slideIn {
  0% { transform: translateX(20px); opacity: 0.5; }
  20%, 80% { transform: translateX(0); opacity: 1; }
  100% { transform: translateX(20px); opacity: 0.5; }
}
.anim-slide { animation: slideIn 8s ease-in-out infinite; }

/* 减少动态效果 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    animation: none !important;
  }
}

/* === 响应式 === */
@media (max-width: 768px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .hero-layout { flex-direction: column; }
  .hero-text { order: 1; }
  .hero-visual { order: 2; width: 100%; }
  .scenario-row { flex-direction: column; }
}
@media (min-width: 769px) {
  .grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); }
  .grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap); }
  .hero-layout { display: flex; align-items: center; gap: var(--gap); }
  .hero-text { flex: 1; min-width: 0; }
  .hero-visual { flex: 1; min-width: 0; max-width: 55%; }
  .scenario-row { display: flex; gap: var(--gap); }
  .scenario-card { flex: 1; }
}

/* 兜底：裁掉横向溢出 */
div.card,
.container {
  overflow-x: clip;
}
