/* SafeW 全站共享样式 */
:root {
  --c-dark: #140E25;
  --c-paper: #FCFCFD;
  --c-text: #191523;
  --c-brand: #5214EB;
  --c-accent: #6EEDD2;
  --r-card: 8px;
  --r-btn: 6px;
  --card-border: 0;
  --card-shadow: none;
  --sec-y: clamp(3.5rem, 7vw, 6rem);
  --gap: clamp(1rem, 2vw, 1.75rem);
  --max-w: 1120px;
  --lh-body: 1.65;
  --font-main: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", sans-serif;
}

/* 主题变量覆盖 */
.theme-dark {
  --c-bg: var(--c-dark);
  --c-fg: var(--c-paper);
  --c-hl: var(--c-accent);
  --c-link: var(--c-accent);
  --c-icon: var(--c-accent);
  --c-border: rgba(252, 252, 253, 0.12);
}
.theme-paper {
  --c-bg: var(--c-paper);
  --c-fg: var(--c-text);
  --c-hl: var(--c-brand);
  --c-link: var(--c-brand);
  --c-icon: var(--c-brand);
  --c-border: rgba(25, 21, 35, 0.08);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-main);
  font-size: 16px;
  line-height: var(--lh-body);
  color: var(--c-fg);
  background-color: var(--c-bg);
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--c-link); text-decoration: none; transition: opacity 0.2s; }
a:hover { opacity: 0.85; }
ul, ol { list-style: none; }

/* 布局容器 */
.container {
  width: 100%;
  max-width: var(--max-w);
  margin-inline: auto;
  padding-inline: var(--gap);
  overflow-x: hidden;
}
.section {
  padding-block: var(--sec-y);
  border-bottom: 1px solid var(--c-border);
  overflow-x: hidden;
}
.section:last-child { border-bottom: none; }

/* 排版 */
.supertitle {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--c-hl);
  margin-bottom: 0.75rem;
}
h1 {
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: 0.02em;
  text-wrap: balance;
  margin-bottom: 1.25rem;
}
h2 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 1.5rem;
}
h3 {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 0.75rem;
  margin-top: 1.5rem;
}
p { margin-bottom: 1rem; max-width: 38em; }
strong { font-weight: 700; }
.hl { color: var(--c-hl); }

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  height: 48px;
  padding-inline: 1.25rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--r-btn);
  cursor: pointer;
  transition: transform 0.2s ease, background-color 0.2s ease;
  text-decoration: none;
}
.btn-primary {
  background-color: var(--c-accent);
  color: var(--c-dark);
}
.btn-primary:hover { transform: translateY(-1px); background-color: #5BDAC0; }
.btn-secondary {
  background: transparent;
  border: 1px solid var(--c-fg);
  color: var(--c-fg);
}
.btn-secondary:hover { background-color: rgba(128,128,128,0.08); }
.btn:focus-visible { outline: 2px solid var(--c-hl); outline-offset: 2px; }

/* 卡片与面板 */
.card {
  background: var(--c-bg);
  border: var(--card-border);
  box-shadow: var(--card-shadow);
  border-radius: var(--r-card);
  padding: var(--gap);
  position: relative;
}
.panel {
  background: var(--c-bg);
  border-radius: 12px;
  padding: var(--gap);
  position: relative;
  overflow: hidden;
}
.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); }

/* 表格 */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; min-width: 400px; }
th, td { padding: 0.75rem 1rem; text-align: left; border-bottom: 1px solid var(--c-border); }
th { font-weight: 700; }
td:first-child { font-weight: 600; }

/* FAQ */
.faq-item { border-bottom: 1px solid var(--c-border); }
.faq-item summary {
  padding: 1rem 0;
  cursor: pointer;
  font-weight: 600;
  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-weight: 400; font-size: 1.2rem; transition: transform 0.2s; }
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item p { padding-bottom: 1rem; }

/* 页头页脚 */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--c-bg);
  border-bottom: 1px solid var(--c-border);
  backdrop-filter: blur(8px);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}
.brand { display: flex; align-items: center; gap: 0.5rem; font-weight: 700; font-size: 1.1rem; }
.brand img { height: 28px; width: auto; }
nav { display: flex; gap: 1.5rem; }
nav a { font-size: 0.95rem; font-weight: 500; }
nav a[aria-current="page"] { color: var(--c-hl); }
.site-footer {
  padding-block: var(--sec-y);
  border-top: 1px solid var(--c-border);
  font-size: 0.9rem;
}
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: var(--gap); }
.footer-grid a { display: block; margin-bottom: 0.5rem; }

/* SVG 动效基础 */
.hero-svg { width: 100%; height: auto; }
.hero-svg path, .hero-svg circle, .hero-svg rect, .hero-svg g { transform-box: fill-box; transform-origin: center; }
.draw-line { pathLength: 1; stroke-dasharray: 1; stroke-dashoffset: 0; }
.bubble-group { animation: floatBubble 6s ease-in-out infinite; }
.input-dot { animation: breathe 2s ease-in-out infinite; }
.notify-card { animation: slideIn 4s ease-in-out infinite; }
.star-point { animation: twinkle 3s ease-in-out infinite; }
@keyframes floatBubble {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
@keyframes breathe {
  0%, 100% { opacity: 0.4; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1.1); }
}
@keyframes slideIn {
  0%, 10% { transform: translateX(0); opacity: 0; }
  15%, 85% { transform: translateX(0); opacity: 1; }
  90%, 100% { transform: translateX(0); opacity: 0; }
}
@keyframes twinkle {
  0%, 100% { opacity: 0.2; }
  50% { opacity: 0.8; }
}
@keyframes drawLine {
  0% { stroke-dashoffset: 1; }
  100% { stroke-dashoffset: 0; }
}
.animate-draw { animation: drawLine 3s linear infinite; }

@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;
  }
}

@media (max-width: 768px) {
  .header-inner { flex-direction: column; height: auto; padding: 1rem 0; gap: 0.75rem; }
  nav { gap: 1rem; }
  h1 { font-size: clamp(1.8rem, 6vw, 2.8rem); }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}
