/* SafeW 全局样式与动效 */
:root {
  --color-dark: #231334;
  --color-paper: #E9E8EA;
  --color-text: #1C1523;
  --color-brand: #7D14EB;
  --color-accent: #EDD26E;
  --radius-card: 20px;
  --radius-btn: 12px;
  --card-border: 0;
  --card-shadow: none;
  --section-y: clamp(3.5rem, 7vw, 6rem);
  --gap: clamp(1rem, 2vw, 1.75rem);
  --content-max: 1280px;
  --font-main: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-main);
  background-color: var(--color-paper);
  color: var(--color-text);
  line-height: 1.65;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--color-brand); text-decoration: none; transition: opacity .2s; }
a:hover { opacity: .85; }
a:focus-visible { outline: 2px solid var(--color-brand); outline-offset: 2px; border-radius: 2px; }

/* 布局容器 */
.container { max-width: var(--content-max); margin: 0 auto; padding: 0 var(--gap); overflow-x: hidden; }
section { padding: var(--section-y) 0; overflow-x: hidden; }
.dark-section { background-color: var(--color-dark); color: var(--color-paper); }
.dark-section a { color: var(--color-accent); }
.dark-section .hl { color: var(--color-accent); }
.dark-section .marker { color: var(--color-accent); }
.dark-section summary::before { color: var(--color-accent); }

/* 排版 */
h1, h2, h3 { font-weight: 700; letter-spacing: 0.02em; line-height: 1.25; }
h1 { font-size: clamp(2.2rem, 5vw, 3.8rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); margin-bottom: var(--gap); }
h3 { font-size: clamp(1.2rem, 2vw, 1.5rem); margin-bottom: calc(var(--gap) * 0.6); }
p { max-width: 38em; margin-bottom: 1rem; }
.marker {
  display: inline-block; font-size: 0.8rem; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--color-brand);
  margin-bottom: 0.5rem;
}
.hl { color: var(--color-brand); }
.dark-section .hl { color: var(--color-accent); }

/* 按钮 */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0 1.5rem; height: 52px; font-size: 1rem; font-weight: 600;
  border-radius: var(--radius-btn); cursor: pointer;
  transition: transform .2s, box-shadow .2s, background-color .2s;
  text-align: center; justify-content: center; border: none;
}
.btn-primary { background-color: var(--color-accent); color: #231334; }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(237, 210, 110, 0.35); }
.btn-secondary { background: transparent; border: 1px solid var(--color-text); color: var(--color-text); }
.dark-section .btn-secondary { border-color: var(--color-paper); color: var(--color-paper); }
.btn-secondary:hover { background: rgba(28, 21, 35, 0.06); }
.dark-section .btn-secondary:hover { background: rgba(233, 232, 234, 0.1); }

/* 卡片与面板 */
.card {
  background: rgba(255, 255, 255, 0.45);
  border-radius: var(--radius-card);
  padding: var(--gap);
  border: var(--card-border);
  box-shadow: var(--card-shadow);
}
.panel {
  background: var(--color-dark);
  border-radius: var(--radius-card);
  padding: var(--gap);
  position: relative; overflow: hidden;
}
.panel-light {
  background: var(--color-paper);
  border-radius: var(--radius-card);
  padding: var(--gap);
}

/* 网格与排列 */
.grid-2 { 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; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.list-clean { list-style: none; }
.list-clean li { position: relative; padding-left: 1.25rem; margin-bottom: 0.6rem; }
.list-clean li::before {
  content: ""; position: absolute; left: 0; top: 0.45rem;
  width: 6px; height: 6px; border-radius: 50%; background: var(--color-brand);
}
.dark-section .list-clean li::before { background: var(--color-accent); }

/* 表格 */
table { width: 100%; border-collapse: collapse; margin: var(--gap) 0; font-size: 0.95rem; }
th, td { padding: 0.8rem 1rem; text-align: left; border-bottom: 1px solid rgba(28, 21, 35, 0.12); }
th { font-weight: 600; }
.dark-section th, .dark-section td { border-bottom-color: rgba(233, 232, 234, 0.15); }

/* FAQ */
details { margin-bottom: 1rem; border-bottom: 1px solid rgba(28, 21, 35, 0.1); padding-bottom: 1rem; }
summary { cursor: pointer; font-weight: 600; list-style: none; position: relative; padding-left: 1.5rem; }
summary::before { content: "+"; position: absolute; left: 0; color: var(--color-brand); }
details[open] summary::before { content: "-"; }
.dark-section details { border-bottom-color: rgba(233, 232, 234, 0.15); }

/* 页头与页脚 */
header { position: sticky; top: 0; z-index: 100; background: var(--color-paper); border-bottom: 1px solid rgba(28, 21, 35, 0.1); padding: 0.75rem 0; }
.dark-section header { background: var(--color-dark); border-bottom-color: rgba(233, 232, 234, 0.1); }
.nav-inner { display: flex; justify-content: space-between; align-items: center; }
.logo { display: flex; align-items: center; gap: 0.5rem; font-weight: 700; font-size: 1.1rem; color: inherit; text-decoration: none; }
.nav-links { display: flex; gap: 1.5rem; list-style: none; }
.nav-links a { color: inherit; font-weight: 500; }
.nav-links a:hover { color: var(--color-brand); }
.dark-section .nav-links a:hover { color: var(--color-accent); }
.nav-links [aria-current="page"] { color: var(--color-brand); font-weight: 700; }
.dark-section .nav-links [aria-current="page"] { color: var(--color-accent); }
footer { padding: var(--section-y) 0; border-top: 1px solid rgba(28, 21, 35, 0.1); margin-top: var(--section-y); }
.footer-inner { display: flex; flex-direction: column; gap: var(--gap); align-items: center; text-align: center; }
.footer-links { display: flex; gap: 1.5rem; flex-wrap: wrap; justify-content: center; }

/* SVG 响应式与动效 */
.svg-responsive { width: 100%; height: auto; }
.draw { pathLength: 1; stroke-dasharray: 1; stroke-dashoffset: 0; animation: drawLine 5s ease-in-out infinite; }
.bubble { animation: floatBubble 7s ease-in-out infinite; }
.dot-flow { animation: moveDot 10s linear infinite; }
.delay-1 { animation-delay: -2.5s; }
.delay-2 { animation-delay: -5s; }

@keyframes drawLine {
  0%, 100% { stroke-dashoffset: 1; }
  50% { stroke-dashoffset: 0; }
}
@keyframes floatBubble {
  0%, 100% { transform: translateY(0); opacity: 0.8; }
  50% { transform: translateY(-10px); opacity: 1; }
}
@keyframes moveDot {
  0% { transform: translate(0, 0) scale(0.8); opacity: 0; }
  15% { transform: translate(30px, -15px) scale(1); opacity: 1; }
  45% { transform: translate(90px, -30px) scale(1); opacity: 1; }
  75% { transform: translate(160px, -10px) scale(1); opacity: 1; }
  100% { transform: translate(220px, 5px) scale(0.8); opacity: 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) {
  .grid-2 { grid-template-columns: 1fr; }
  .nav-links { display: none; }
  h1 { font-size: clamp(1.8rem, 6vw, 2.8rem); }
}
