/* ==============================
   SafeW 全站共享样式
   ============================== */
:root {
  /* 色板 */
  --color-dark: #21163C;
  --color-paper: #E9E8EA;
  --color-text: #191523;
  --color-brand: #5214EB;
  --color-accent: #ED926E;
  --color-white: #FFFFFF;
  --shadow-color: rgba(25, 21, 35, 0.3);

  /* 设计 Token */
  --radius-card: 20px;
  --radius-btn: 12px;
  --card-border: 0;
  --card-shadow: 0 10px 28px -14px var(--shadow-color);
  --section-y: clamp(3.5rem, 7vw, 6rem);
  --gap: clamp(1rem, 2vw, 1.75rem);
  --content-max: 1120px;
  --header-h: 64px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--color-paper);
  color: var(--color-text);
  line-height: 1.65;
  font-size: 16px;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }
svg { width: auto; 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); }

/* 页头 */
.site-header { position: sticky; top: 0; z-index: 100; background: var(--color-paper); border-bottom: 1px solid rgba(25, 21, 35, 0.08); transition: background 0.3s, border-color 0.3s; }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: var(--header-h); }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.1rem; color: var(--color-text); }
.logo img { height: 32px; width: auto; }
.nav { display: flex; gap: 24px; }
.nav a { font-weight: 500; position: relative; padding: 4px 0; transition: color 0.2s; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--color-brand); }
.nav a[aria-current="page"]::after { content: ''; position: absolute; bottom: -2px; left: 0; width: 100%; height: 2px; background: var(--color-brand); border-radius: 1px; }
@media (max-width: 768px) { .nav { display: none; } }

/* 页脚 */
.site-footer { background: var(--color-dark); color: var(--color-paper); padding: var(--section-y) 0; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--gap); }
.footer-col h4 { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.14em; margin-bottom: 16px; color: var(--color-accent); }
.footer-col a { display: block; margin-bottom: 10px; opacity: 0.85; transition: opacity 0.2s; }
.footer-col a:hover { opacity: 1; }

/* 按钮 */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 24px; height: 48px; border-radius: var(--radius-btn); font-weight: 600; font-size: 1rem; cursor: pointer; transition: transform 0.2s, box-shadow 0.2s, background 0.2s; border: 2px solid transparent; white-space: nowrap; }
.btn-primary { background: var(--color-accent); color: var(--color-dark); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(237, 146, 110, 0.4); }
.btn-secondary { background: transparent; border-color: var(--color-text); color: var(--color-text); }
.btn-secondary:hover { background: rgba(25, 21, 35, 0.05); }
.btn:focus-visible { outline: 3px solid var(--color-brand); outline-offset: 2px; }

/* 区块与排版 */
section { padding-block: var(--section-y); }
.section-header { margin-bottom: calc(var(--gap) * 2); }
.eyebrow { display: inline-block; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--color-brand); margin-bottom: 12px; }
h1 { font-size: clamp(2.2rem, 5vw, 3.8rem); font-weight: 700; line-height: 1.15; letter-spacing: 0.02em; margin-bottom: 24px; text-wrap: balance; }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); font-weight: 700; line-height: 1.25; margin-bottom: 16px; text-wrap: balance; }
h3 { font-size: 1.25rem; font-weight: 600; margin-bottom: 12px; }
p { margin-bottom: 16px; max-width: 38em; }
.hl { color: var(--color-brand); }

/* 深色面覆盖 */
.dark-section { background: var(--color-dark); color: var(--color-paper); }
.dark-section .eyebrow { color: var(--color-accent); }
.dark-section .hl { color: var(--color-accent); }
.dark-section .btn-secondary { border-color: var(--color-paper); color: var(--color-paper); }
.dark-section .btn-secondary:hover { background: rgba(233, 232, 234, 0.1); }
.dark-section .card { background: var(--color-paper); color: var(--color-text); }

/* 卡片 */
.card { background: var(--color-paper); border-radius: var(--radius-card); box-shadow: var(--card-shadow); padding: 24px; border: var(--card-border); transition: transform 0.2s, box-shadow 0.2s; }
.card:hover { transform: translateY(-4px); box-shadow: 0 14px 32px -12px var(--shadow-color); }
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: var(--gap); }

/* 表格 */
.table-wrapper { overflow-x: auto; border-radius: var(--radius-card); background: var(--color-paper); box-shadow: var(--card-shadow); }
table { width: 100%; border-collapse: collapse; min-width: 400px; }
th, td { padding: 16px 24px; text-align: left; border-bottom: 1px solid rgba(25, 21, 35, 0.1); }
th { font-weight: 600; background: rgba(25, 21, 35, 0.03); }
tr:last-child td { border-bottom: none; }

/* FAQ */
details { background: var(--color-paper); border-radius: var(--radius-card); margin-bottom: 12px; box-shadow: var(--card-shadow); overflow: hidden; }
summary { padding: 20px 24px; 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.2rem; transition: transform 0.2s; }
details[open] summary::after { transform: rotate(45deg); }
details > div { padding: 0 24px 20px; color: var(--color-text); }

/* SVG 基础与动效 */
.svg-panel { width: 100%; height: auto; }
svg { width: 100%; height: auto; }
svg path, svg line, svg polyline, svg rect, svg circle { transition: stroke 0.2s, fill 0.2s; }
svg g.anim-element { transform-box: fill-box; transform-origin: center; }

@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes dash { 0% { stroke-dashoffset: 1; } 100% { stroke-dashoffset: 0; } }
@keyframes breathe { 0%, 100% { opacity: 0.4; } 50% { opacity: 1; } }
@keyframes slideIn { 0% { transform: translateX(20px); opacity: 0; } 100% { transform: translateX(0); opacity: 1; } }

.anim-float { animation: float 6s ease-in-out infinite; }
.anim-float-delay { animation: float 6s ease-in-out infinite 2s; }
.anim-draw { stroke-dasharray: 1; stroke-dashoffset: 0; animation: dash 3s linear infinite; }
.anim-breathe { animation: breathe 4s ease-in-out infinite; }
.anim-slide { animation: slideIn 0.8s ease-out forwards; }

/* 减少动态效果 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* 辅助类 */
.text-center { text-align: center; }
.flex-center { display: flex; justify-content: center; align-items: center; }
.gap-16 { gap: 16px; }
.mt-16 { margin-top: 16px; }
.mb-24 { margin-bottom: 24px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: var(--gap); }
@media (min-width: 768px) { .grid-2 { grid-template-columns: 1fr 1fr; } }

/* 兜底：裁掉横向溢出 */
body > * {
  overflow-x: clip;
}
