/* =========================================
   SafeW 全站共享样式 (Style System)
   ========================================= */

/* --- 基础重置与变量 --- */
:root {
  /* 色板定义 */
  --color-dark: #17203F;      /* 深色面：首屏、收尾区 */
  --color-paper: #FCFCFD;     /* 纸面：内容区底色 */
  --color-text: #151823;      /* 正文色：标题与正文 */
  --color-brand: #1441EB;     /* 品牌色：强调词、链接、图标（纸面上） */
  --color-accent: #6EEDBD;    /* 强调色：按钮、眉标、图标（深色面上） */
  
  /* 结构性 Token */
  --radius-card: 8px;
  --radius-btn: 6px;
  --card-border: 0;
  --card-shadow: 0 10px 28px -14px;
  --section-y: clamp(5rem, 10vw, 9rem);
  --gap: clamp(1.5rem, 3vw, 2.5rem);
  --content-max: 960px;
  --font-main: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans SC", sans-serif;
  --line-height-base: 1.75;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-family: var(--font-main);
  color: var(--color-text);
  background-color: var(--color-paper);
  line-height: var(--line-height-base);
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* --- 排版系统 --- */
h1, h2, h3, h4 {
  line-height: 1.25;
  letter-spacing: 0;
  font-weight: 600;
  color: var(--color-text);
}

h1 {
  font-size: clamp(2rem, 4.6vw, 3.4rem);
  margin-bottom: 1rem;
  text-wrap: balance;
  max-width: 100%;
  overflow-wrap: break-word;
  line-height: 1.15;
}

h2 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  margin-bottom: var(--gap);
  text-wrap: balance;
}

h3 {
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
  color: var(--color-text);
}

p {
  margin-bottom: 1.5em;
  max-width: 38em;
}

a {
  color: var(--color-brand);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover { text-decoration: underline; }

strong { font-weight: 700; }

/* 眉标 (Subheading/Label) */
.section-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
  color: var(--color-brand);
}

.dark-section .section-label {
  color: var(--color-accent);
}

/* 高亮关键词 */
.hl {
  color: var(--color-brand);
}

.dark-section .hl {
  color: var(--color-accent);
}

/* --- 布局容器 --- */
.container {
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--gap);
}

.section {
  padding-top: var(--section-y);
  padding-bottom: var(--section-y);
  position: relative;
}

/* --- 头部与导航 --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: rgba(252, 252, 253, 0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(21, 24, 35, 0.1);
  height: 64px;
  display: flex;
  align-items: center;
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--gap);
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--color-text);
  text-decoration: none;
}

.brand-logo img {
  height: 28px;
  width: auto;
}

nav ul {
  display: flex;
  list-style: none;
  gap: 24px;
}

nav a {
  color: var(--color-text);
  font-weight: 500;
  font-size: 0.95rem;
  padding: 4px 0;
  border-bottom: 2px solid transparent;
}

nav a:hover, nav a[aria-current="page"] {
  color: var(--color-brand);
  border-bottom-color: var(--color-brand);
  text-decoration: none;
}

/* --- 按钮组件 --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 48px;
  padding: 0 24px;
  border-radius: var(--radius-btn);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
  text-decoration: none;
}

.btn:focus-visible {
  outline: 3px solid var(--color-brand);
  outline-offset: 2px;
}

.btn-primary {
  background-color: var(--color-accent);
  color: var(--color-dark);
  border: none;
}

.btn-primary:hover {
  background-color: #5be3b0;
  transform: translateY(-1px);
  text-decoration: none;
}

.btn-secondary {
  background-color: transparent;
  color: var(--color-text);
  border: 1px solid var(--color-text);
}

.dark-section .btn-secondary {
  color: var(--color-paper);
  border-color: var(--color-paper);
}

.btn-secondary:hover {
  background-color: rgba(21, 24, 35, 0.05);
  transform: translateY(-1px);
  text-decoration: none;
}

.dark-section .btn-secondary:hover {
  background-color: rgba(252, 252, 253, 0.1);
}

/* --- 卡片与面板 --- */
.card {
  background-color: var(--color-paper);
  border-radius: var(--radius-card);
  box-shadow: var(--card-shadow) rgba(21, 24, 35, 0.3);
  padding: 24px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 32px -12px rgba(21, 24, 35, 0.4);
}

.dark-panel {
  background-color: var(--color-dark);
  border-radius: 16px;
  padding: 32px;
  color: var(--color-paper);
  position: relative;
  overflow: hidden;
}

/* --- 表格 --- */
.data-table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-size: 0.95rem;
}

.data-table th, .data-table td {
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(21, 24, 35, 0.1);
}

.data-table th {
  font-weight: 600;
  color: var(--color-text);
  width: 40%;
}

.dark-section .data-table th,
.dark-section .data-table td {
  border-bottom-color: rgba(252, 252, 253, 0.1);
  color: var(--color-paper);
}

/* --- FAQ (Details/Summary) --- */
details.faq-item {
  border-bottom: 1px solid rgba(21, 24, 35, 0.1);
  margin-bottom: 16px;
  padding-bottom: 16px;
}

details.faq-item summary {
  list-style: none;
  cursor: pointer;
  font-weight: 600;
  padding: 8px 0;
  position: relative;
  padding-right: 32px;
}

details.faq-item summary::-webkit-details-marker { display: none; }

details.faq-item summary::after {
  content: "+";
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.2rem;
  color: var(--color-brand);
}

details.faq-item[open] summary::after { content: "-"; }

details.faq-item p {
  margin-top: 12px;
  margin-bottom: 0;
  font-size: 0.95rem;
  color: var(--color-text);
}

/* --- SVG 动效方向 (星点明灭与连线) --- */
.star-dot {
  fill: var(--color-brand);
  opacity: 0.6;
  animation: twinkle 4s infinite alternate ease-in-out;
}

.star-dot.accent {
  fill: var(--color-accent);
}

.connection-line {
  stroke: var(--color-brand);
  stroke-width: 1.5;
  fill: none;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: drawLine 6s infinite linear;
}

.connection-line.accent {
  stroke: var(--color-accent);
}

@keyframes twinkle {
  0% { opacity: 0.3; transform: scale(0.8); }
  100% { opacity: 0.8; transform: scale(1.2); }
}

@keyframes drawLine {
  0% { stroke-dashoffset: 1; opacity: 0; }
  10% { opacity: 1; }
  80% { opacity: 1; }
  100% { stroke-dashoffset: 0; opacity: 0; }
}

/* 确保动画元素初始状态正常 */
svg path, svg circle, svg rect {
  transform-box: fill-box;
  transform-origin: center;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* --- 页脚 --- */
.site-footer {
  background-color: var(--color-dark);
  color: var(--color-paper);
  padding: 64px 0 32px;
  margin-top: auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 32px;
  margin-bottom: 48px;
}

.footer-col h4 {
  color: var(--color-accent);
  margin-bottom: 16px;
  font-size: 1rem;
}

.footer-col ul {
  list-style: none;
}

.footer-col li {
  margin-bottom: 12px;
}

.footer-col a {
  color: rgba(252, 252, 253, 0.8);
  font-size: 0.9rem;
}

.footer-col a:hover {
  color: var(--color-accent);
  text-decoration: none;
}

.copyright {
  text-align: center;
  border-top: 1px solid rgba(252, 252, 253, 0.1);
  padding-top: 32px;
  font-size: 0.85rem;
  color: rgba(252, 252, 253, 0.5);
}

/* --- 响应式微调 --- */
@media (max-width: 768px) {
  h1 { font-size: 2rem; }
  .header-inner nav { display: none; } /* 移动端简化：隐藏导航，保留主按钮 */
  .hero-layout { flex-direction: column-reverse; }
  .feature-grid { grid-template-columns: 1fr; }
}
