/* SafeW 全局共享样式 */
:root {
  /* 色板 */
  --bg-dark: #19102D;
  --bg-paper: #FCFCFD;
  --bg-paper-light: #F0F0F3;
  --text: #191523;
  --brand: #5214EB;
  --accent: #D66EED;

  /* 结构 Token */
  --radius-card: 0;
  --radius-btn: 0;
  --card-border: 2px solid var(--text);
  --card-shadow: 4px 4px 0 var(--text);
  --section-y: clamp(5rem, 10vw, 9rem);
  --gap: clamp(1.5rem, 3vw, 2.5rem);
  --content-max: 1120px;
  --header-h: 64px;

  /* 字体 */
  --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; font-size: 16px; }
body {
  font-family: var(--font-sans);
  color: var(--text);
  background-color: var(--bg-paper);
  line-height: 1.75;
  -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 { max-width: var(--content-max); margin: 0 auto; padding: 0 var(--gap); }
.section { padding-top: var(--section-y); padding-bottom: var(--section-y); position: relative; }
.section-dark { background-color: var(--bg-dark); color: var(--bg-paper); }
.section-light { background-color: var(--bg-paper-light); }

.eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brand);
  margin-bottom: 0.75rem;
}
.section-dark .eyebrow { color: var(--accent); }

h1 {
  font-size: clamp(2.2rem, 5vw, 4rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 1.5rem;
  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;
  margin-top: 2rem;
  text-wrap: balance;
}
h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  margin-top: 1.5rem;
}
p { margin-bottom: 1rem; max-width: 38em; }
.hl { color: var(--brand); font-weight: 600; }
.section-dark .hl { color: var(--accent); }

/* 布局网格 */
.grid-2 { display: grid; gap: var(--gap); grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); }
.grid-3 { display: grid; gap: var(--gap); grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); }
.flex-row { display: flex; gap: var(--gap); align-items: center; flex-wrap: wrap; }
.flex-col { display: flex; flex-direction: column; gap: var(--gap); }

/* 组件：按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  height: 52px;
  padding: 0 24px;
  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;
}
.btn:hover { transform: translateY(-2px); }
.btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.btn-primary { background-color: var(--accent); color: var(--bg-dark); border: 2px solid transparent; }
.btn-primary:hover { background-color: #C95DE0; }
.btn-secondary { background: transparent; border: 2px solid var(--text); color: var(--text); }
.section-dark .btn-secondary { border-color: var(--bg-paper); color: var(--bg-paper); }
.section-dark .btn-secondary:hover { background-color: rgba(255,255,255,0.1); }

/* 组件：卡片 */
.card {
  background: var(--bg-paper);
  border: var(--card-border);
  box-shadow: var(--card-shadow);
  padding: 24px;
  border-radius: var(--radius-card);
  height: 100%;
}
.section-dark .card { background: var(--bg-paper); color: var(--text); }
.card-icon { width: 24px; height: 24px; stroke: var(--brand); margin-bottom: 12px; }
.section-dark .card-icon { stroke: var(--accent); }

/* 组件：表格 */
.spec-table { width: 100%; border-collapse: collapse; margin: 1.5rem 0; table-layout: fixed; }
.spec-table th, .spec-table td { padding: 12px 16px; border-bottom: 1px solid rgba(0,0,0,0.1); text-align: left; overflow-wrap: break-word; word-wrap: break-word; }
.spec-table th { font-weight: 700; width: 40%; }
.section-dark .spec-table th, .section-dark .spec-table td { border-color: rgba(255,255,255,0.15); }

/* 组件：FAQ */
details { border: var(--card-border); background: var(--bg-paper); margin-bottom: 12px; border-radius: var(--radius-card); }
.summary { padding: 16px; font-weight: 600; cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; }
.summary::-webkit-details-marker { display: none; }
.summary::after { content: "+"; font-size: 1.2rem; font-weight: 400; }
details[open] .summary::after { content: "-"; }
.details-content { padding: 0 16px 16px; line-height: 1.7; }
.section-dark details { background: var(--bg-paper-light); color: var(--text); }

/* 组件：步骤徽标 */
.step-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--accent);
  color: var(--bg-dark);
  font-weight: 700;
  font-size: 0.9rem;
  border-radius: var(--radius-btn);
  flex-shrink: 0;
}

/* 组件：提示框 */
.callout {
  border-left: 4px solid var(--brand);
  padding: 16px 20px;
  margin: 1.5rem 0;
  background: rgba(82, 20, 235, 0.05);
}
.section-dark .callout { border-left-color: var(--accent); background: rgba(214, 110, 237, 0.1); }

/* 页头页脚 */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(252, 252, 253, 0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(0,0,0,0.08);
  height: var(--header-h);
}
.section-dark .site-header { background: rgba(25, 16, 45, 0.95); border-bottom-color: rgba(255,255,255,0.1); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 100%; }
.brand { display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 1.1rem; }
.brand img { width: 32px; height: 32px; object-fit: contain; }
.nav { display: flex; gap: 24px; align-items: center; }
.nav a { font-weight: 500; font-size: 0.95rem; transition: color 0.2s; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--brand); }
.section-dark .nav a { color: var(--bg-paper); }
.section-dark .nav a:hover, .section-dark .nav a[aria-current="page"] { color: var(--accent); }
.mobile-toggle { display: none; background: none; border: none; cursor: pointer; padding: 8px; }
.mobile-toggle svg { width: 24px; height: 24px; stroke: currentColor; }
.footer { padding: 48px 0; border-top: 1px solid rgba(0,0,0,0.1); font-size: 0.9rem; color: rgba(0,0,0,0.6); }
.section-dark .footer { border-top-color: rgba(255,255,255,0.1); color: rgba(255,255,255,0.6); }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 32px; }
.footer h4 { font-weight: 700; margin-bottom: 12px; color: var(--text); }
.section-dark .footer h4 { color: var(--bg-paper); }
.footer ul li { margin-bottom: 8px; }
.footer a:hover { text-decoration: underline; }

/* SVG 动效 */
.svg-panel { width: 100%; height: auto; max-width: 100%; overflow: hidden; }
.anim-orbit { animation: orbitBreathe 6s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.anim-draw { stroke-dasharray: 1; stroke-dashoffset: 0; animation: drawPath 4s ease forwards; }
.anim-fade-slide { animation: fadeSlideIn 5s ease forwards; }
@keyframes orbitBreathe {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.04); opacity: 0.85; }
}
@keyframes drawPath {
  0% { stroke-dashoffset: 1; }
  100% { stroke-dashoffset: 0; }
}
@keyframes fadeSlideIn {
  0% { opacity: 0; transform: translateY(8px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* 减少动态效果 */
@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;
  }
}

/* 响应式 */
@media (max-width: 768px) {
  .nav { display: none; }
  .nav.open { display: flex; flex-direction: column; position: absolute; top: var(--header-h); left: 0; right: 0; background: var(--bg-paper); padding: 16px; border-bottom: 1px solid rgba(0,0,0,0.1); }
  .section-dark .nav.open { background: var(--bg-dark); }
  .mobile-toggle { display: block; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .flex-row { flex-direction: column; align-items: flex-start; }
}
