/* =========================================
   SafeW 全站共享样式
   ========================================= */

/* 1. 设计变量与基础重置 */
:root {
  /* 色板 */
  --color-dark: #140E25;
  --color-paper: #F7F5F3;
  --color-text: #191523;
  --color-brand: #5214EB;
  --color-accent: #C8ED6E;

  /* 上下文覆盖色 */
  --text-primary: var(--color-text);
  --text-highlight: var(--color-brand);
  --bg-base: var(--color-paper);

  /* 结构 Token */
  --radius-card: 8px;
  --radius-btn: 6px;
  --card-border: 1px solid rgba(25, 21, 35, 0.16);
  --card-shadow: none;
  --section-y: clamp(2.5rem, 5vw, 4rem);
  --gap: clamp(0.75rem, 1.5vw, 1.25rem);
  --content-max: 1120px;
  --header-h: 64px;

  /* 排版 */
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", sans-serif;
  --line-height-body: 1.55;
  --line-height-title: 1.15;
}

/* 深色面上下文 */
.dark-bg {
  background-color: var(--color-dark);
  color: var(--color-paper);
  --text-primary: var(--color-paper);
  --text-highlight: var(--color-accent);
}
.dark-bg .card {
  background-color: var(--color-paper);
  color: var(--color-text);
}

/* 纸面上下文（默认） */
.paper-bg {
  background-color: var(--color-paper);
  color: var(--color-text);
  --text-primary: var(--color-text);
  --text-highlight: var(--color-brand);
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  background-color: var(--bg-base);
  color: var(--text-primary);
  line-height: var(--line-height-body);
  overflow-x: hidden;
}

img, svg {
  display: block;
  max-width: 100%;
}

a {
  color: var(--text-highlight);
  text-decoration: none;
  transition: opacity 0.2s ease;
}
a:hover { opacity: 0.85; }
a:focus-visible {
  outline: 2px solid var(--text-highlight);
  outline-offset: 2px;
  border-radius: 2px;
}

/* 2. 排版系统 */
.container {
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--gap);
}

.section {
  padding-block: var(--section-y);
}

h1, h2, h3, h4 {
  font-weight: 500;
  line-height: var(--line-height-title);
  letter-spacing: -0.01em;
  margin-top: 0;
  margin-bottom: var(--gap);
}

h1 {
  font-size: clamp(2.6rem, 6.4vw, 5rem);
  margin-bottom: calc(var(--gap) * 1.5);
}

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.75);
}

p {
  margin: 0 0 var(--gap) 0;
  max-width: 38em;
}

.subtitle {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-highlight);
  margin-bottom: calc(var(--gap) * 0.5);
  display: block;
}

.hl {
  color: var(--text-highlight);
}

/* 3. 布局网格 */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap);
  align-items: center;
}

@media (max-width: 768px) {
  .grid-2 { grid-template-columns: 1fr; }
  .grid-2 .visual-panel { order: -1; }
}

/* 4. 组件：按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 52px;
  padding: 0 24px;
  border-radius: var(--radius-btn);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
  border: 1px solid transparent;
  text-decoration: none;
}
.btn:hover { transform: translateY(-2px); }
.btn:focus-visible { outline: 3px solid var(--text-highlight); outline-offset: 2px; }

.btn-primary {
  background-color: var(--color-accent);
  color: #140E25;
}
.btn-primary:hover { background-color: #b8dd5e; }

.btn-secondary {
  background-color: transparent;
  color: var(--text-primary);
  border-color: var(--text-primary);
}
.btn-secondary:hover { background-color: rgba(128,128,128,0.08); }

/* 5. 组件：卡片与面板 */
.card {
  background-color: var(--color-paper);
  border: var(--card-border);
  border-radius: var(--radius-card);
  box-shadow: var(--card-shadow);
  padding: var(--gap);
}

.visual-panel {
  background-color: var(--color-dark);
  border-radius: var(--radius-card);
  padding: var(--gap);
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}
.dark-bg .visual-panel {
  background-color: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
}

/* 6. 表格 */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  margin-bottom: var(--gap);
}
.data-table th, .data-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: var(--card-border);
}
.data-table th {
  font-weight: 600;
  width: 40%;
}
.data-table tr:last-child td { border-bottom: none; }

/* 7. FAQ */
.faq-item {
  border-bottom: var(--card-border);
  padding: 16px 0;
}
.faq-item summary {
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 12px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  background-color: var(--text-highlight);
  transform: rotate(45deg);
  transition: transform 0.2s ease;
}
.faq-item[open] summary::before { transform: rotate(-45deg); }
.faq-item p { margin-top: 12px; margin-bottom: 0; color: var(--text-primary); opacity: 0.9; }

/* 8. 眉标与列表 */
.list-clean {
  list-style: none;
  padding: 0;
  margin: 0;
}
.list-clean li {
  position: relative;
  padding-left: 24px;
  margin-bottom: 12px;
}
.list-clean li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  width: 8px;
  height: 8px;
  background-color: var(--text-highlight);
  border-radius: 2px;
}

/* 9. 新闻卡片 */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--gap);
}
.news-card {
  display: flex;
  flex-direction: column;
  height: 100%;
}
.news-card time {
  font-size: 0.85rem;
  opacity: 0.7;
  margin-bottom: 8px;
  display: block;
}
.news-card h4 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 8px 0;
  line-height: 1.3;
}
.news-card p {
  font-size: 0.95rem;
  margin: 0;
  opacity: 0.85;
}

/* 10. SVG 动效关键帧 */
@keyframes node-glow {
  0%, 100% { opacity: 0.25; transform: scale(0.85); }
  50% { opacity: 1; transform: scale(1.15); }
}
@keyframes line-draw {
  0% { stroke-dashoffset: 1; }
  50% { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: 1; }
}
@keyframes bubble-rise {
  0%, 100% { transform: translateY(0); opacity: 0.6; }
  50% { transform: translateY(-6px); opacity: 1; }
}
@keyframes input-breathe {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

.svg-node {
  transform-box: fill-box;
  transform-origin: center;
  animation: node-glow 5s infinite ease-in-out;
}
.svg-node:nth-child(odd) { animation-delay: 0s; }
.svg-node:nth-child(even) { animation-delay: 1.5s; }
.svg-node:nth-child(3n) { animation-delay: 3s; }

.svg-line {
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: line-draw 6s infinite linear;
}
.svg-line:nth-child(2) { animation-delay: 1s; }
.svg-line:nth-child(3) { animation-delay: 2.5s; }

.svg-bubble {
  transform-box: fill-box;
  transform-origin: center;
  animation: bubble-rise 4s infinite ease-in-out;
}
.svg-input-dot {
  animation: input-breathe 2s infinite ease-in-out;
}
.svg-input-dot:nth-child(2) { animation-delay: 0.2s; }
.svg-input-dot:nth-child(3) { animation-delay: 0.4s; }

/* 11. 页头页脚 */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: rgba(24, 14, 37, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  height: var(--header-h);
  display: flex;
  align-items: center;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}
.brand-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--color-paper);
}
.brand-logo img { height: 28px; width: auto; }
.nav-links {
  display: flex;
  gap: 24px;
  align-items: center;
}
.nav-links a {
  color: rgba(247, 245, 243, 0.85);
  font-size: 0.95rem;
  font-weight: 500;
}
.nav-links a:hover { color: var(--color-accent); }
.nav-links a[aria-current="page"] { color: var(--color-accent); }

.site-footer {
  background-color: var(--color-dark);
  color: rgba(247, 245, 243, 0.7);
  padding: 48px 0;
  font-size: 0.9rem;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--gap);
}
.footer-col h5 {
  color: var(--color-paper);
  font-size: 0.95rem;
  margin: 0 0 16px 0;
  font-weight: 600;
}
.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col li { margin-bottom: 10px; }
.footer-col a { color: rgba(247, 245, 243, 0.7); }
.footer-col a:hover { color: var(--color-accent); }
.copyright {
  text-align: center;
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid rgba(255,255,255,0.08);
  font-size: 0.85rem;
  opacity: 0.6;
}

/* 12. 响应式与无障碍 */
@media (max-width: 640px) {
  .nav-links { display: none; }
  .mobile-menu-btn { display: block; }
  h1 { font-size: clamp(2rem, 8vw, 3rem); }
  .grid-2 { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .svg-node, .svg-line, .svg-bubble, .svg-input-dot {
    animation: none !important;
    opacity: 0.8;
    transform: none;
  }
}
