/* =========================================
   SafeW 全站共享样式
   ========================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", sans-serif;
  font-size: 17px; line-height: 1.75; color: var(--text-primary); background: var(--bg-paper);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
img, svg { max-width: 100%; height: auto; display: block; }
a { color: var(--col-brand); text-decoration: none; transition: opacity 0.2s ease; }
a:hover { opacity: 0.85; }
ul, ol { list-style: none; }

/* 设计变量 */
:root {
  --bg-dark: #2D1438; --bg-paper: #F6F3F7; --col-text: #1F1523; --col-brand: #9E13DD; --col-accent: #6EEDA8;
  --text-primary: var(--col-text); --text-heading: var(--col-text);
  --radius-card: 20px; --radius-btn: 12px;
  --card-border: 1px solid rgba(31, 21, 35, 0.16); --card-shadow: none;
  --section-y: clamp(5rem, 10vw, 9rem); --gap: clamp(1.5rem, 3vw, 2.5rem);
  --content-max: 960px;
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", sans-serif;
}

/* 面层级取色覆盖 */
.dark-section { background: var(--bg-dark); color: var(--bg-paper); --text-primary: var(--bg-paper); --text-heading: var(--bg-paper); }
.dark-section .hl { color: var(--col-accent); }
.dark-section .badge { color: var(--col-accent); border-color: var(--col-accent); }
.light-card { background: var(--bg-paper); color: var(--col-text); border: var(--card-border); box-shadow: var(--card-shadow); border-radius: var(--radius-card); --text-primary: var(--col-text); --text-heading: var(--col-text); }
.light-card .hl { color: var(--col-brand); }
.light-card .badge { color: var(--col-brand); border-color: var(--col-brand); }

/* 布局与排版 */
.container { max-width: var(--content-max); margin-inline: auto; padding-inline: var(--gap); }
section { padding-block: var(--section-y); }
h1 { font-size: clamp(2.4rem, 6vw, 4.5rem); font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; margin-bottom: 1.5rem; text-wrap: balance; }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); font-weight: 800; letter-spacing: -0.02em; line-height: 1.25; margin-bottom: 1.5rem; text-wrap: balance; }
h3 { font-size: 1.25rem; font-weight: 700; margin-bottom: 0.75rem; line-height: 1.3; }
.lead { font-size: 1.15rem; line-height: 1.7; max-width: 38em; margin-bottom: 2rem; }
.badge { display: inline-block; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.05em; padding: 0.3em 0.8em; border-radius: 6px; border: 1px solid; margin-bottom: 1rem; }
p { margin-bottom: 1.2em; }
p:last-child { margin-bottom: 0; }

/* 按钮 */
.btn {
  display: inline-flex; align-items: center; gap: 0.6em; min-height: 48px; padding: 0.6em 1.5em;
  font-size: 1rem; font-weight: 600; border-radius: var(--radius-btn); cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
  border: 2px solid transparent; text-align: center; justify-content: center;
}
.btn:focus-visible { outline: 3px solid var(--col-accent); outline-offset: 2px; }
.btn-primary { background: var(--col-accent); color: var(--bg-dark); }
.btn-primary:hover { background: #5bd893; }
.btn-secondary { background: transparent; border-color: var(--col-text); color: var(--col-text); }
.dark-section .btn-secondary { border-color: var(--bg-paper); color: var(--bg-paper); }
.dark-section .btn-secondary:hover { background: rgba(246, 243, 247, 0.1); }
.btn:hover { transform: translateY(-2px); }
.btn svg { width: 20px; height: 20px; stroke-width: 2; flex-shrink: 0; }

/* 卡片与网格 */
.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); }
.cap { display: flex; align-items: center; gap: 0.6em; padding: 0.8em 1em; background: rgba(31,21,35,0.04); border-radius: 12px; font-weight: 600; font-size: 0.95rem; }
.dark-section .cap { background: rgba(246,243,247,0.08); }
.cap svg { width: 22px; height: 22px; stroke-width: 1.8; }

/* 表格 */
table { width: 100%; border-collapse: collapse; margin-top: 1rem; table-layout: fixed; }
th, td { padding: 0.8em 1em; text-align: left; border-bottom: 1px solid rgba(31,21,35,0.1); min-width: 0; overflow-wrap: break-word; }
th { font-weight: 700; }
.dark-table th, .dark-table td { border-color: rgba(246,243,247,0.1); }

/* 列表与定义 */
dl { display: grid; grid-template-columns: 1fr; gap: 1.5rem; }
dt { font-weight: 700; font-size: 1.1rem; margin-bottom: 0.4em; display: flex; align-items: center; gap: 0.6em; }
dd { opacity: 0.9; }
.check-list li { position: relative; padding-left: 1.8em; margin-bottom: 0.8em; }
.check-list li::before { content: ""; position: absolute; left: 0; top: 0.4em; width: 8px; height: 8px; background: var(--col-brand); border-radius: 2px; }
.dark-section .check-list li::before { background: var(--col-accent); }

/* 时间轴 */
.timeline { position: relative; padding-left: 2rem; border-left: 2px solid rgba(31,21,35,0.15); }
.timeline-item { position: relative; padding-bottom: 2rem; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before { content: ""; position: absolute; left: -2.45rem; top: 0.3em; width: 10px; height: 10px; border-radius: 50%; background: var(--col-brand); border: 2px solid var(--bg-paper); }
.dark-section .timeline-item::before { background: var(--col-accent); border-color: var(--bg-dark); }
.time-tag { font-size: 0.85rem; font-weight: 700; color: var(--col-brand); margin-bottom: 0.3em; display: block; }
.dark-section .time-tag { color: var(--col-accent); }

/* 步骤条 */
.steps-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--gap); counter-reset: step; }
.step-card { background: rgba(31,21,35,0.05); border-radius: var(--radius-card); padding: 1.5rem; position: relative; }
.dark-section .step-card { background: rgba(246,243,247,0.08); }
.step-card::before { counter-increment: step; content: "0" counter(step); position: absolute; top: -12px; left: 1.5rem; background: var(--col-accent); color: var(--bg-dark); font-weight: 800; font-size: 0.9rem; padding: 0.3em 0.8em; border-radius: 6px; }

/* 新闻卡片 */
.news-card { padding: var(--gap); background: var(--bg-paper); border: var(--card-border); border-radius: var(--radius-card); }
.news-card time { font-size: 0.8rem; font-weight: 600; color: var(--col-brand); margin-bottom: 0.5em; display: block; }
.dark-section .news-card time { color: var(--col-accent); }
.news-card p { font-size: 0.95rem; opacity: 0.85; }

/* FAQ */
details { margin-bottom: 1rem; border: var(--card-border); border-radius: var(--radius-card); overflow: hidden; }
summary { padding: 1.2em 1.5em; cursor: pointer; font-weight: 600; list-style: none; position: relative; padding-left: 2.5em; }
summary::-webkit-details-marker { display: none; }
summary::before { content: ""; position: absolute; left: 1.5em; top: 50%; transform: translateY(-50%); width: 12px; height: 12px; border: 2px solid currentColor; border-radius: 4px; }
details[open] summary::before { background: currentColor; }
details p { padding: 0 1.5em 1.2em; line-height: 1.7; }

/* 页头页脚 */
header { position: sticky; top: 0; z-index: 100; background: var(--bg-paper); border-bottom: 1px solid rgba(31,21,35,0.08); backdrop-filter: blur(8px); }
.nav-container { display: flex; justify-content: space-between; align-items: center; padding-block: 1rem; }
.nav-links { display: flex; gap: 1.5rem; align-items: center; }
.nav-links a { color: var(--col-text); font-weight: 500; }
.nav-links a[aria-current="page"] { color: var(--col-brand); font-weight: 700; }
footer { background: var(--bg-dark); color: var(--bg-paper); padding-block: 3rem; margin-top: auto; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 2rem; }
.footer-grid a { color: var(--bg-paper); opacity: 0.8; }
.footer-grid a:hover { opacity: 1; }
.footer-copy { margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid rgba(246,243,247,0.1); font-size: 0.85rem; opacity: 0.7; }

/* SVG 动效 */
.hero-svg { width: 100%; height: auto; }
.anim-draw { stroke-dasharray: 1; stroke-dashoffset: 0; animation: draw-line 6s ease-in-out infinite alternate; }
.anim-float { animation: float 5s ease-in-out infinite; }
.anim-pulse { animation: pulse-dot 4s ease-in-out infinite; }
.anim-rotate { transform-box: fill-box; transform-origin: center; animation: rotate-snap 12s linear infinite; }
@keyframes draw-line { 0% { stroke-dashoffset: 1; } 100% { stroke-dashoffset: 0; } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes pulse-dot { 0%, 100% { opacity: 0.3; } 50% { opacity: 1; } }
@keyframes rotate-snap { 0%, 100% { transform: rotate(0deg); } 50% { transform: rotate(180deg); } }

/* 减少动态效果 */
@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) {
  .nav-links { gap: 1rem; }
  .btn span.hide-mobile { display: none; }
  dl { grid-template-columns: 1fr; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}
