/* =========================================
   SafeW 全站共享样式
   ========================================= */

:root {
  /* 色板 */
  --color-dark: #10112D;
  --color-paper: #F5F0E5;
  --color-body: #151523;
  --color-brand: #1416EB;
  --color-accent: #89ED6E;
  --color-accent-hover: #76D15C;

  /* 圆角 */
  --radius-card: 24px;
  --radius-btn: 999px;

  /* 卡片边界 */
  --card-border: 0;
  --card-shadow: 0 10px 28px -14px rgba(21, 21, 35, 0.3);

  /* 节奏与密度 */
  --section-y: clamp(5rem, 10vw, 9rem);
  --gap: clamp(1.5rem, 3vw, 2.5rem);
  --line-height-body: 1.75;

  /* 内容最大宽度 */
  --content-max: 1280px;

  /* 标题处理 */
  --font-weight-title: 800;
  --letter-spacing-title: -0.02em;
  --line-height-title: 1.1;
  --size-h1: clamp(2.4rem, 6vw, 4.5rem);
  --size-h2: clamp(1.6rem, 3vw, 2.4rem);
  --size-h3: clamp(1.2rem, 2vw, 1.5rem);

  /* 字体 */
  --font-main: "PingFang SC", "Noto Sans SC", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* 基础重置与排版 */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--font-main);
  background-color: var(--color-paper);
  color: var(--color-body);
  line-height: var(--line-height-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }

/* 布局容器 */
.app-shell {
  display: grid;
  grid-template-columns: 1fr;
  min-height: 100vh;
}
@media (min-width: 1024px) {
  .app-shell { grid-template-columns: 260px 1fr; }
}

/* 左侧品牌栏 / 顶部导航 */
.brand-nav {
  background: var(--color-paper);
  border-right: 1px solid rgba(21, 21, 35, 0.08);
  padding: 2rem 1.5rem;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}
@media (max-width: 1023px) {
  .brand-nav {
    position: relative;
    height: auto;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    max-width: 100%;
    overflow: hidden;
    border-bottom: 1px solid rgba(21, 21, 35, 0.08);
    border-right: none;
  }
  .brand-logo img {
    width: 28px;
    height: 28px;
  }
  .nav-links {
    gap: 0.5rem;
  }
  .nav-link {
    padding: 0.4rem 0.6rem;
    font-size: 0.9rem;
  }
}
.brand-logo { display: flex; align-items: center; gap: 0.75rem; font-weight: 800; font-size: 1.25rem; letter-spacing: -0.01em; }
.brand-logo img { width: 32px; height: 32px; object-fit: contain; }
.nav-links { display: flex; flex-direction: column; gap: 0.5rem; }
@media (max-width: 1023px) {
  .nav-links { flex-direction: row; gap: 1rem; }
}
.nav-link {
  padding: 0.6rem 0.8rem;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 500;
  transition: background 0.2s, color 0.2s;
}
.nav-link:hover, .nav-link[aria-current="page"] {
  background: rgba(21, 21, 35, 0.06);
  color: var(--color-brand);
}
.nav-link[aria-current="page"] { font-weight: 700; }

/* 主内容区 */
.main-content {
  padding: 0;
  background: var(--color-paper);
  min-width: 0;
  overflow-x: hidden;
}
.section-wrapper {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: var(--section-y) var(--gap);
}

/* 颜色覆盖类 */
.dark-surface {
  background: var(--color-dark);
  color: var(--color-paper);
}
.dark-surface h1, .dark-surface h2, .dark-surface h3, .dark-surface p, .dark-surface span, .dark-surface li, .dark-surface td, .dark-surface th {
  color: var(--color-paper);
}
.dark-surface .hl { color: var(--color-accent); }
.dark-surface .badge { color: var(--color-accent); }
.dark-surface a:not(.btn) { color: var(--color-accent); }

.light-card {
  background: var(--color-paper);
  color: var(--color-body);
  border-radius: var(--radius-card);
  padding: 2rem;
  box-shadow: var(--card-shadow);
  border: var(--card-border);
}
.light-card h1, .light-card h2, .light-card h3, .light-card p, .light-card span, .light-card li, .light-card td, .light-card th {
  color: var(--color-body);
}
.light-card .hl { color: var(--color-brand); }
.light-card .badge { color: var(--color-brand); }
.light-card a:not(.btn) { color: var(--color-brand); }

/* 排版组件 */
.badge {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}
.section-title {
  font-size: var(--size-h2);
  font-weight: var(--font-weight-title);
  letter-spacing: var(--letter-spacing-title);
  line-height: var(--line-height-title);
  margin-bottom: 1.5rem;
}
.section-title .hl { color: var(--color-brand); }
.dark-surface .section-title .hl { color: var(--color-accent); }

.content-grid {
  display: grid;
  gap: var(--gap);
}
@media (min-width: 768px) { .content-grid.cols-2 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .content-grid.cols-3 { grid-template-columns: repeat(3, 1fr); } }

.card {
  background: var(--color-paper);
  border-radius: var(--radius-card);
  padding: 1.5rem;
  box-shadow: var(--card-shadow);
  border: var(--card-border);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card:hover { transform: translateY(-2px); box-shadow: 0 14px 32px -14px rgba(21, 21, 35, 0.35); }
.card h3 { font-size: var(--size-h3); font-weight: var(--font-weight-title); margin-bottom: 0.75rem; line-height: 1.25; }
.card p { font-size: 0.95rem; line-height: 1.7; margin-bottom: 0.75rem; }
.card ul { padding-left: 1.25rem; list-style-type: disc; }
.card ul li { margin-bottom: 0.4rem; font-size: 0.95rem; }

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  height: 52px;
  padding: 0 2rem;
  border-radius: var(--radius-btn);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  border: none;
  transition: transform 0.15s ease, filter 0.2s ease;
}
.btn:focus-visible { outline: 3px solid var(--color-accent); outline-offset: 3px; }
.btn-primary {
  background: var(--color-accent);
  color: var(--color-dark);
}
.btn-primary:hover { background: var(--color-accent-hover); transform: translateY(-1px); }
.btn-secondary {
  background: transparent;
  border: 1.5px solid var(--color-body);
  color: var(--color-body);
}
.dark-surface .btn-secondary { border-color: var(--color-paper); color: var(--color-paper); }
.btn-secondary:hover { filter: brightness(0.9); }
.btn-icon { width: 20px; height: 20px; }

/* 表格 */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}
.data-table th, .data-table td {
  padding: 0.8rem 1rem;
  border-bottom: 1px solid rgba(21, 21, 35, 0.1);
  text-align: left;
}
.data-table th { font-weight: 700; width: 40%; }
.dark-surface .data-table th, .dark-surface .data-table td { border-bottom-color: rgba(245, 240, 229, 0.15); }

/* FAQ */
.faq-item { margin-bottom: 1rem; border-radius: 12px; overflow: hidden; }
.faq-item summary {
  padding: 1rem 1.25rem;
  font-weight: 600;
  cursor: pointer;
  background: rgba(21, 21, 35, 0.04);
  border-radius: 12px;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; font-size: 1.25rem; font-weight: 300; transition: transform 0.2s; }
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item summary:hover { background: rgba(21, 21, 35, 0.06); }
.faq-item .faq-answer { padding: 1rem 1.25rem; font-size: 0.95rem; line-height: 1.7; }
.dark-surface .faq-item summary { background: rgba(245, 240, 229, 0.08); color: var(--color-paper); }
.dark-surface .faq-item summary:hover { background: rgba(245, 240, 229, 0.12); }

/* 步骤列表 */
.step-list { counter-reset: step; }
.step-item {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  align-items: flex-start;
}
.step-num {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  background: var(--color-accent);
  color: var(--color-dark);
  font-weight: 800;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
}
.step-content h4 { font-size: 1rem; font-weight: 700; margin-bottom: 0.3rem; }
.step-content p { font-size: 0.95rem; opacity: 0.9; }

/* 场景对照 */
.scenario-row {
  display: grid;
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}
@media (min-width: 768px) { .scenario-row { grid-template-columns: 1fr 1fr; } }
.scenario-panel {
  padding: 1.5rem;
  border-radius: 16px;
  background: rgba(21, 21, 35, 0.03);
  border: 1px solid rgba(21, 21, 35, 0.06);
}
.dark-surface .scenario-panel { background: rgba(245, 240, 229, 0.06); border-color: rgba(245, 240, 229, 0.1); }
.scenario-label { font-size: 0.85rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.75rem; opacity: 0.7; }
.scenario-text h4 { font-size: 1.1rem; font-weight: 700; margin-bottom: 0.5rem; }
.scenario-text p, .scenario-text li { font-size: 0.95rem; line-height: 1.7; margin-bottom: 0.5rem; }
.scenario-text ul { padding-left: 1.2rem; list-style-type: disc; }

/* 资讯卡片 */
.news-card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1.5rem;
  background: var(--color-paper);
  border-radius: var(--radius-card);
  box-shadow: var(--card-shadow);
  border: var(--card-border);
  transition: transform 0.2s ease;
}
.news-card:hover { transform: translateY(-2px); }
.news-date { font-size: 0.8rem; font-weight: 600; opacity: 0.7; }
.news-card h3 { font-size: 1.1rem; font-weight: 700; line-height: 1.4; }
.news-card p { font-size: 0.95rem; line-height: 1.65; opacity: 0.9; }

/* 页脚 */
.site-footer {
  background: var(--color-dark);
  color: var(--color-paper);
  padding: 3rem 1.5rem;
  text-align: center;
  font-size: 0.9rem;
  opacity: 0.9;
}
.footer-links { display: flex; justify-content: center; gap: 2rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.footer-links a { opacity: 0.8; transition: opacity 0.2s; }
.footer-links a:hover { opacity: 1; color: var(--color-accent); }

/* =========================================
   SVG 动效系统
   ========================================= */
.svg-visual {
  width: 100%;
  height: auto;
  max-width: 600px;
  margin: 0 auto;
}
.svg-visual path, .svg-visual circle, .svg-visual rect {
  transition: stroke-dashoffset 0.3s ease;
}
.geo-shape {
  transform-box: fill-box;
  transform-origin: center;
  animation: rotateAlign 12s linear infinite;
}
.bubble {
  animation: floatBubble 6s ease-in-out infinite;
}
.bubble.delay-1 { animation-delay: 1s; }
.bubble.delay-2 { animation-delay: 2.5s; }
.notif-card {
  animation: slideInNotif 8s ease-in-out infinite;
}
.input-dots circle {
  animation: breatheDot 3s ease-in-out infinite;
}
.draw-path {
  pathLength: 1;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: drawLine 6s ease-in-out infinite;
}

@keyframes rotateAlign {
  0%, 100% { transform: rotate(0deg) scale(1); }
  50% { transform: rotate(180deg) scale(1.05); }
}
@keyframes floatBubble {
  0%, 100% { transform: translateY(0); opacity: 1; }
  50% { transform: translateY(-6px); opacity: 0.85; }
}
@keyframes slideInNotif {
  0%, 10% { transform: translateX(20px); opacity: 0; }
  15%, 85% { transform: translateX(0); opacity: 1; }
  90%, 100% { transform: translateX(20px); opacity: 0; }
}
@keyframes breatheDot {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}
@keyframes drawLine {
  0% { stroke-dashoffset: 1; }
  20%, 80% { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: 1; }
}

/* 减少动态效果 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    animation: none !important;
  }
}
