/* =========================================
   SafeW 全站共享样式
   ========================================= */

/* 基础变量与 Token */
:root {
  --color-dark: #13102D;
  --color-paper: #D6D4ED;
  --color-text: #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: 1120px;
  
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", sans-serif;
  --transition-base: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 表面主题覆盖 */
.dark-surface {
  --bg: var(--color-dark);
  --fg: var(--color-paper);
  --hl: var(--color-accent);
  --link: var(--color-accent);
  --icon: var(--color-accent);
  --btn-text: var(--color-dark);
  --border-subtle: rgba(214, 212, 237, 0.15);
}
.light-paper {
  --bg: var(--color-paper);
  --fg: var(--color-text);
  --hl: var(--color-brand);
  --link: var(--color-brand);
  --icon: var(--color-brand);
  --btn-text: #FFFFFF;
  --border-subtle: rgba(23, 21, 35, 0.08);
}

/* 重置与基础排版 */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--fg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; height: auto; }
a { color: var(--link); text-decoration: none; transition: color var(--transition-base); }
a:hover { opacity: 0.85; }
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);
  background: var(--bg);
}

/* 标题与眉标 */
.eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--hl);
  margin-bottom: 0.75rem;
}
h1 {
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: 0.02em;
  margin-bottom: 1rem;
  text-wrap: balance;
}
h2 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: 0.02em;
  margin-bottom: 1.25rem;
  text-wrap: balance;
}
h3 {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 0.75rem;
}
p { margin-bottom: 1rem; color: var(--fg); }
.text-hl { color: var(--hl); font-weight: 600; }

/* 按钮组件 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  height: 48px;
  padding: 0 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius-btn);
  cursor: pointer;
  transition: transform var(--transition-base), box-shadow var(--transition-base), background var(--transition-base);
  border: none;
  text-decoration: none;
}
.btn-primary {
  background: var(--color-accent);
  color: var(--btn-text);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(137, 237, 110, 0.3); }
.btn-secondary {
  background: transparent;
  color: var(--fg);
  border: 1px solid currentColor;
}
.btn-secondary:hover { background: rgba(23, 21, 35, 0.05); }
.dark-surface .btn-secondary { color: var(--paper); border-color: var(--paper); }
.btn:focus-visible { outline: 2px solid var(--hl); outline-offset: 3px; }
.btn svg { width: 20px; height: 20px; stroke-width: 1.8; }

/* 卡片与面板 */
.card {
  background: var(--bg);
  border: var(--card-border);
  border-radius: var(--radius-card);
  box-shadow: var(--card-shadow);
  padding: var(--gap);
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}
.card:hover { transform: translateY(-2px); box-shadow: 0 14px 32px -12px rgba(23, 21, 35, 0.35); }
.panel {
  background: var(--bg);
  border-radius: var(--radius-card);
  padding: var(--gap);
  position: relative;
  overflow: hidden;
}
/* 内部浅色卡片覆盖 */
.panel .inner-light {
  background: var(--color-paper);
  color: var(--color-text);
  border-radius: calc(var(--radius-card) - 4px);
  padding: var(--gap);
}

/* 表格 */
.table-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}
th, td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border-subtle);
}
th { font-weight: 700; color: var(--fg); }
td { color: var(--fg); }
tr:last-child td { border-bottom: none; }

/* FAQ 细节组件 */
details {
  background: var(--bg);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  margin-bottom: var(--gap);
  padding: 1rem 1.25rem;
  transition: border-color var(--transition-base);
}
details[open] { border-color: var(--hl); }
summary {
  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.25rem;
  font-weight: 400;
  transition: transform var(--transition-base);
}
details[open] summary::after { transform: rotate(45deg); }
.details-content { margin-top: 0.75rem; color: var(--fg); line-height: 1.6; }

/* 徽章与标签 */
.badge-step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: var(--color-accent);
  color: var(--color-dark);
  font-weight: 700;
  font-size: 0.85rem;
  border-radius: 8px;
  flex-shrink: 0;
}
.tag {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  background: rgba(23, 21, 35, 0.06);
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--fg);
  margin-bottom: 0.5rem;
}
.dark-surface .tag { background: rgba(214, 212, 237, 0.12); color: var(--paper); }

/* 页头与页脚 */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(214, 212, 237, 0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0.75rem 0;
}
.dark-surface .site-header { background: rgba(19, 16, 45, 0.9); }
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 48px;
}
.logo { display: flex; align-items: center; gap: 0.5rem; font-weight: 700; font-size: 1.1rem; color: var(--fg); }
.logo img { width: 24px; height: 24px; object-fit: contain; }
nav ul { display: flex; gap: 1.5rem; }
nav a { color: var(--fg); font-weight: 500; font-size: 0.95rem; }
nav a:hover, nav a[aria-current="page"] { color: var(--hl); }
.site-footer {
  padding: 3rem 0 2rem;
  border-top: 1px solid var(--border-subtle);
  margin-top: var(--section-y);
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 2rem;
}
.footer-col h4 { font-size: 0.9rem; font-weight: 700; margin-bottom: 0.75rem; color: var(--fg); }
.footer-col a { display: block; color: var(--fg); font-size: 0.9rem; margin-bottom: 0.5rem; }
.footer-bottom { text-align: center; margin-top: 2rem; font-size: 0.85rem; color: var(--fg); opacity: 0.7; }

/* SVG 动效工具类 */
.svg-container { width: 100%; height: auto; }
.anim-float { animation: float 4s ease-in-out infinite; }
.anim-float-delay { animation: float 4s ease-in-out infinite 1s; }
.anim-float-deep { animation: float 5s ease-in-out infinite 0.5s; }
.anim-breathe { animation: breathe 2.5s ease-in-out infinite; }
.anim-slide-in { animation: slideIn 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards; }
.anim-draw {
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: drawLine 3s ease-in-out infinite alternate;
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
@keyframes breathe {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}
@keyframes slideIn {
  from { transform: translateX(-16px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
@keyframes drawLine {
  from { stroke-dashoffset: 1; }
  to { stroke-dashoffset: 0; }
}

/* 减少动态效果 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* 响应式适配 */
@media (max-width: 768px) {
  .hero-layout { flex-direction: column; gap: 2rem; }
  .feature-row { flex-direction: column; gap: 2rem; }
  .feature-row.reverse { flex-direction: column; }
  .steps-strip { flex-direction: column; align-items: flex-start; }
  .step-connector { display: none; }
  h1 { font-size: clamp(1.8rem, 6vw, 2.8rem); }
  nav ul { gap: 1rem; }
}
@media (min-width: 769px) {
  .hero-layout { display: flex; align-items: center; gap: 3rem; }
  .feature-row { display: flex; align-items: center; gap: 3rem; }
  .steps-strip { display: flex; align-items: flex-start; gap: 1.5rem; }
  .step-connector { width: 1px; height: 40px; background: var(--border-subtle); margin-top: 2rem; }
}
