/* =========================================
   SafeW 全站共享样式
   ========================================= */

/* === 设计变量 === */
:root {
  --color-dark: #271231;
  --color-paper: #F5F0E5;
  --color-text: #1F1523;
  --color-brand: #9B12D8;
  --color-accent: #ED6EC0;
  
  --radius-card: 0;
  --radius-btn: 0;
  --card-border: 0;
  --card-shadow: 0 10px 28px -14px rgba(31, 21, 35, 0.3);
  
  --section-y: clamp(3.5rem, 7vw, 6rem);
  --gap: clamp(1rem, 2vw, 1.75rem);
  --content-max: 960px;
  
  --line-height-body: 1.65;
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", sans-serif;
}

/* === 基础重置与排版 === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  background-color: var(--color-paper);
  color: var(--color-text);
  line-height: var(--line-height-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

/* === 容器与分节 === */
.container { max-width: var(--content-max); margin: 0 auto; padding: 0 var(--gap); }
.section { padding: var(--section-y) 0; position: relative; }
.section-light { background-color: var(--color-paper); color: var(--color-text); }
.section-dark { background-color: var(--color-dark); color: var(--color-paper); }
.section-dark .hl { color: var(--color-accent); }
.section-dark .eyebrow { color: var(--color-accent); }
.section-dark a:not(.btn) { color: var(--color-accent); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.section-dark a:not(.btn):hover { opacity: 0.85; }

/* === 排版组件 === */
.eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 0.5em;
  color: var(--color-brand);
}
h1 {
  font-size: clamp(2.2rem, 5vw, 4rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 1.2em;
  text-wrap: balance;
}
h2 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 1em;
  text-wrap: balance;
}
h3 {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin-bottom: 0.75em;
  line-height: 1.3;
}
p { margin-bottom: 1em; max-width: 38em; }
.hl { color: var(--color-brand); }
.section-dark .hl { color: var(--color-accent); }

/* === 布局网格 === */
.grid-auto {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  gap: var(--gap);
}
.flex-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--gap);
  align-items: center;
}
.hero-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap);
  align-items: center;
}
@media (max-width: 768px) {
  .hero-layout { grid-template-columns: 1fr; }
}

/* === 按钮 === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6em;
  height: 52px;
  padding: 0 1.5em;
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius-btn);
  cursor: pointer;
  transition: transform 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
  white-space: nowrap;
}
.btn-primary {
  background-color: var(--color-accent);
  color: var(--color-dark);
  border: 2px solid var(--color-accent);
}
.btn-primary:hover { transform: translateY(-2px); background-color: #d95fae; border-color: #d95fae; }
.btn-secondary {
  background-color: transparent;
  color: var(--color-text);
  border: 2px solid var(--color-text);
}
.btn-secondary:hover { transform: translateY(-2px); background-color: rgba(31, 21, 35, 0.05); }
.section-dark .btn-secondary { color: var(--color-paper); border-color: var(--color-paper); }
.section-dark .btn-secondary:hover { background-color: rgba(245, 240, 229, 0.1); }
.btn:focus-visible { outline: 3px solid var(--color-accent); outline-offset: 2px; }
.btn-icon { width: 20px; height: 20px; flex-shrink: 0; }

/* === 卡片 === */
.card {
  background-color: var(--color-paper);
  color: var(--color-text);
  border-radius: var(--radius-card);
  box-shadow: var(--card-shadow);
  border: var(--card-border);
  padding: 1.5em;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: 0 14px 32px -12px rgba(31, 21, 35, 0.35); }
.card-dark-inner {
  background-color: var(--color-paper);
  color: var(--color-text);
}
.card-header {
  display: flex;
  align-items: center;
  gap: 0.6em;
  margin-bottom: 0.75em;
  font-weight: 700;
  font-size: 1.1rem;
}
.card-meta { font-size: 0.85rem; opacity: 0.8; margin-top: 0.75em; display: block; }

/* === 表格 === */
.table-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}
th, td {
  padding: 0.85em 1em;
  text-align: left;
  border-bottom: 1px solid rgba(31, 21, 35, 0.1);
}
th { font-weight: 700; background-color: rgba(31, 21, 35, 0.03); }
td { vertical-align: top; }
.section-dark table { color: var(--color-paper); }
.section-dark th, .section-dark td { border-bottom-color: rgba(245, 240, 229, 0.15); }
.section-dark th { background-color: rgba(245, 240, 229, 0.05); }
.link-cell a { color: var(--color-brand); text-decoration: underline; text-decoration-thickness: 1px; }
.section-dark .link-cell a { color: var(--color-accent); }

/* === FAQ === */
.faq-list { display: flex; flex-direction: column; gap: 0.75em; }
details {
  border: 1px solid rgba(31, 21, 35, 0.1);
  background: transparent;
}
summary {
  padding: 1em 1em 1em 2.2em;
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  position: relative;
  transition: background-color 0.2s ease;
}
summary::-webkit-details-marker { display: none; }
summary::before {
  content: '';
  position: absolute;
  left: 0.8em;
  top: 50%;
  transform: translateY(-50%);
  width: 8px;
  height: 8px;
  border: 2px solid var(--color-brand);
  border-radius: 0;
}
details[open] summary { background-color: rgba(31, 21, 35, 0.03); }
details p { padding: 0 1em 1em 2.2em; margin: 0; line-height: 1.7; }
.section-dark details { border-color: rgba(245, 240, 229, 0.2); }
.section-dark summary { color: var(--color-paper); }
.section-dark summary::before { border-color: var(--color-accent); }
.section-dark details[open] summary { background-color: rgba(245, 240, 229, 0.05); }
.section-dark details p { color: var(--color-paper); opacity: 0.9; }

/* === 步骤列表 === */
.step-list { counter-reset: step; }
.step-item {
  counter-increment: step;
  position: relative;
  padding-left: 3.5em;
  margin-bottom: 1.5em;
}
.step-item::before {
  content: '0' counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 2.2em;
  height: 2.2em;
  background-color: var(--color-accent);
  color: var(--color-dark);
  font-weight: 800;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0;
}
.section-dark .step-item::before { background-color: var(--color-accent); }

/* === 页头与页脚 === */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: var(--color-paper);
  border-bottom: 1px solid rgba(31, 21, 35, 0.08);
  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.6em; font-weight: 800; font-size: 1.1rem; }
.brand img { height: 28px; width: auto; }
.nav-links { display: flex; gap: 1.5em; align-items: center; }
.nav-links a { font-weight: 500; font-size: 0.95rem; position: relative; }
.nav-links a:hover { opacity: 0.8; }
.nav-links a[aria-current="page"] { font-weight: 700; color: var(--color-brand); }
.section-dark .nav-links a[aria-current="page"] { color: var(--color-accent); }
.site-footer {
  background-color: var(--color-dark);
  color: var(--color-paper);
  padding: 3em 0;
  font-size: 0.9rem;
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 2em;
}
.footer-col h4 { font-weight: 700; margin-bottom: 0.8em; color: var(--color-accent); }
.footer-col a { display: block; margin-bottom: 0.5em; opacity: 0.8; }
.footer-col a:hover { opacity: 1; text-decoration: underline; }
.footer-copy { margin-top: 2em; padding-top: 1.5em; border-top: 1px solid rgba(245, 240, 229, 0.1); text-align: center; opacity: 0.6; }

/* === SVG 动效关键帧 === */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
@keyframes float-delay {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
@keyframes breathe {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}
@keyframes slideIn {
  0% { transform: translateX(16px); opacity: 0; }
  100% { transform: translateX(0); opacity: 1; }
}
@keyframes drawPath {
  to { stroke-dashoffset: 0; }
}

.anim-float { animation: float 6s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.anim-float-delay { animation: float-delay 7s ease-in-out infinite; animation-delay: 2s; transform-box: fill-box; transform-origin: center; }
.anim-breathe { animation: breathe 4s ease-in-out infinite; }
.anim-slide { animation: slideIn 5s ease-out forwards; }
.anim-draw {
  pathLength: 1;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: drawPath 4s ease-in-out infinite alternate;
}

/* === 减少动态效果支持 === */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
    animation: none !important;
  }
}
