/* =========================================
   SafeW 全站共享样式
   ========================================= */

/* 设计变量 */
:root {
  /* 色板 */
  --c-dark: #251943;
  --c-paper: #DBD4ED;
  --c-text: #191523;
  --c-brand: #5214EB;
  --c-accent: #ED6E89;
  
  /* 结构 Token */
  --radius-card: 0;
  --radius-btn: 0;
  --card-border: 0;
  --card-shadow: 0 10px 28px -14px rgba(25, 21, 35, 0.3);
  --section-y: clamp(2.5rem, 5vw, 4rem);
  --gap: clamp(0.75rem, 1.5vw, 1.25rem);
  --content-max: 1280px;
  
  /* 排版 */
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", sans-serif;
  --lh-body: 1.55;
  --lh-title: 1.1;
  --ls-title: -0.02em;
  --fw-title: 800;
}

/* 基础重置 */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  color: var(--c-text);
  background: var(--c-paper);
  line-height: var(--lh-body);
  font-size: 16px;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
button, input { font: inherit; color: inherit; }

/* 布局容器 */
.container {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--gap);
}
.grid { display: grid; gap: var(--gap); }
.flex { display: flex; gap: var(--gap); align-items: center; }

/* 响应式网格基础 */
@media (min-width: 768px) {
  .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* 排版系统 */
.section { padding-block: var(--section-y); position: relative; }
.section-divider { border-top: 1px solid rgba(25, 21, 35, 0.1); }
.section.dark { background: var(--c-dark); color: var(--c-paper); }
.section.dark .hl { color: var(--c-accent); }

.maker {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  margin-bottom: 0.5em;
  text-transform: uppercase;
}
.paper .maker { color: var(--c-brand); }
.dark .maker { color: var(--c-accent); }

h1, h2, h3 { font-weight: var(--fw-title); line-height: var(--lh-title); letter-spacing: var(--ls-title); text-wrap: balance; }
h1 { font-size: clamp(2.4rem, 6vw, 4.5rem); margin-bottom: 0.5em; }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); margin-bottom: 0.6em; }
h3 { font-size: clamp(1.2rem, 2vw, 1.5rem); margin-bottom: 0.4em; }
p { margin-bottom: 1em; max-width: 38em; }
.hl { font-weight: 800; }
.paper .hl { color: var(--c-brand); }
.dark .hl { color: var(--c-accent); }

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6em;
  height: 48px;
  padding: 0 1.5em;
  font-weight: 700;
  font-size: 1rem;
  border: none;
  cursor: pointer;
  transition: transform 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
  white-space: nowrap;
}
.btn-primary {
  background: var(--c-accent);
  color: var(--c-dark);
}
.btn-primary:hover { transform: translateY(-2px); background: #d95a73; }
.btn-secondary {
  background: transparent;
  color: var(--c-text);
  border: 1px solid var(--c-text);
}
.dark .btn-secondary { color: var(--c-paper); border-color: var(--c-paper); }
.btn-secondary:hover { background: rgba(25, 21, 35, 0.05); }
.dark .btn-secondary:hover { background: rgba(219, 212, 237, 0.08); }
.btn:focus-visible { outline: 3px solid var(--c-accent); outline-offset: 2px; }

/* 卡片与面板 */
.card {
  background: var(--c-paper);
  border: var(--card-border);
  box-shadow: var(--card-shadow);
  padding: var(--gap);
  transition: box-shadow 0.2s ease;
}
.card.dark-card { background: var(--c-dark); color: var(--c-paper); }
.card:hover { box-shadow: 0 14px 32px -12px rgba(25, 21, 35, 0.4); }

.panel {
  background: var(--c-dark);
  padding: clamp(1.5rem, 3vw, 2.5rem);
  position: relative;
  overflow: hidden;
}
.panel.light-panel { background: var(--c-paper); color: var(--c-text); }

/* 表格 */
.table-wrap { overflow-x: auto; margin: 1em 0; }
table { width: 100%; border-collapse: collapse; min-width: 400px; }
th, td { padding: 0.8em 1em; text-align: left; border-bottom: 1px solid rgba(25, 21, 35, 0.12); }
th { font-weight: 700; background: rgba(25, 21, 35, 0.03); }
tr:last-child td { border-bottom: none; }
td:first-child { font-weight: 600; }

/* FAQ */
details {
  border: 1px solid rgba(25, 21, 35, 0.15);
  margin-bottom: var(--gap);
  background: var(--c-paper);
}
.dark details { background: rgba(219, 212, 237, 0.05); border-color: rgba(219, 212, 237, 0.2); }
summary {
  padding: 1em;
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  position: relative;
  padding-right: 2.5em;
}
summary::-webkit-details-marker { display: none; }
summary::after {
  content: "+";
  position: absolute;
  right: 1em;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.2em;
  transition: transform 0.2s ease;
}
details[open] summary::after { transform: translateY(-50%) rotate(45deg); }
details > div { padding: 0 1em 1em; }

/* 页头页脚 */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(219, 212, 237, 0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(25, 21, 35, 0.08);
  padding: 0.8em 0;
}
.dark .site-header { background: rgba(37, 25, 67, 0.95); border-bottom-color: rgba(219, 212, 237, 0.1); }
.header-inner { display: flex; justify-content: space-between; align-items: center; }
.logo { display: flex; align-items: center; gap: 0.6em; font-weight: 800; font-size: 1.2rem; }
.logo img { width: 32px; height: 32px; object-fit: contain; }
nav { display: flex; gap: 1.5em; align-items: center; }
nav a { font-weight: 500; opacity: 0.85; transition: opacity 0.2s; }
nav a:hover, nav a[aria-current="page"] { opacity: 1; color: var(--c-brand); }
.dark nav a { color: var(--c-paper); }
.dark nav a:hover, nav a[aria-current="page"] { color: var(--c-accent); }

.site-footer {
  border-top: 1px solid rgba(25, 21, 35, 0.1);
  padding: 2em 0;
  margin-top: var(--section-y);
  font-size: 0.9rem;
  opacity: 0.8;
}
.footer-inner { display: flex; justify-content: space-between; flex-wrap: wrap; gap: var(--gap); }
.footer-links { display: flex; gap: 1.5em; }

/* SVG 基础与动效 */
.svg-icon { width: 24px; height: 24px; stroke: currentColor; stroke-width: 1.8; fill: none; }
.hero-svg, .feature-svg { width: 100%; height: auto; max-width: 100%; }
svg { shape-rendering: geometricPrecision; }

/* 描边绘制 */
.anim-draw {
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: draw-path 2s ease forwards;
}
@keyframes draw-path { to { stroke-dashoffset: 1; } }

/* 数据流流动 */
.anim-flow {
  stroke-dasharray: 0.15 0.85;
  stroke-dashoffset: 0;
  animation: flow-stream 3s linear infinite;
}
@keyframes flow-stream { to { stroke-dashoffset: -1; } }

/* 悬浮呼吸 */
.anim-float {
  animation: float-cycle 5s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: center;
}
@keyframes float-cycle { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }

/* 脉冲点 */
.anim-pulse {
  animation: pulse-dot 2.5s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: center;
}
@keyframes pulse-dot { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }

/* 减少动态效果 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    animation-delay: 0ms !important;
  }
  html { scroll-behavior: auto; }
}

/* 移动端适配 */
@media (max-width: 767px) {
  .header-inner { flex-direction: column; gap: 0.8em; }
  nav { gap: 1em; flex-wrap: wrap; justify-content: center; }
  .hero-layout { flex-direction: column; }
  .feature-layout { flex-direction: column; }
  .feature-layout.reverse { flex-direction: column; }
}
