/* =========================================
   SafeW 全局样式 (Global Styles)
   设计系统：紫罗兰深底 + 翠绿强调
   ========================================= */

:root {
  /* --- 色板 (Color Palette) --- */
  --bg-dark: #2D1438;       /* 深色面：首屏、收尾区 */
  --bg-paper: #F6F3F7;      /* 纸面：内容背景 */
  --text-body: #1F1523;     /* 正文色：标题与正文 */
  --brand: #9E13DD;         /* 品牌色：纸面上的强调/链接 */
  --accent: #6EEDA8;        /* 强调色：按钮、深色面上的强调 */

  /* --- 排版与间距 (Spacing & Typography) --- */
  --content-max: 1280px;
  --section-y: clamp(5rem, 10vw, 9rem);
  --gap: clamp(1.5rem, 3vw, 2.5rem);
  --radius-card: 20px;
  --radius-btn: 12px;
  --card-border: 1px solid rgba(31, 21, 35, 0.16);
  --card-shadow: none;

  /* --- 字体 (Fonts) --- */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", sans-serif;
}

/* --- 基础重置 (Reset) --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-family: var(--font-sans);
  color: var(--text-body);
  background-color: var(--bg-paper);
  -webkit-font-smoothing: antialiased;
}

body {
  line-height: 1.75;
  font-size: 16px;
  overflow-x: hidden;
}

img, svg {
  display: block;
  max-width: 100%;
}

a {
  color: var(--brand);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  text-decoration: underline;
}

a:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: 2px;
}

/* --- 布局容器 (Layout) --- */
.container {
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 clamp(1rem, 3vw, 2rem);
}

section {
  padding-top: var(--section-y);
  padding-bottom: var(--section-y);
}

/* 页面级深色背景块 */
.bg-dark {
  background-color: var(--bg-dark);
  color: var(--bg-paper);
}

/* 深色背景下的文字覆盖变量 */
.bg-dark h2, .bg-dark h3, .bg-dark p {
  color: var(--bg-paper);
}
.bg-dark a:not(.btn) {
  color: var(--accent);
}

/* --- 排版组件 (Typography Components) --- */
.section-label {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
  color: var(--brand);
}

.bg-dark .section-label {
  color: var(--accent);
}

h1 {
  font-size: clamp(2.6rem, 6.4vw, 5rem);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 1.5rem;
  color: var(--bg-paper); /* Hero默认深色背景 */
}

h2 {
  font-size: clamp(1.8rem, 3.5vw, 2.8rem);
  font-weight: 500;
  line-height: 1.2;
  margin-bottom: 1.5rem;
  color: var(--text-body);
}

h3 {
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 1rem;
  color: var(--text-body);
}

p {
  margin-bottom: 1.5rem;
  max-width: 38em;
}

/* 高亮关键词 */
.hl {
  color: var(--brand);
}
.bg-dark .hl {
  color: var(--accent);
}

/* --- 按钮 (Buttons) --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 48px;
  padding: 0 24px;
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius-btn);
  cursor: pointer;
  transition: transform 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
  text-decoration: none !important;
}

.btn-primary {
  background-color: var(--accent);
  color: var(--bg-dark);
  border: none;
}

.btn-primary:hover {
  transform: translateY(-2px);
  filter: brightness(1.05);
}

.btn-secondary {
  background-color: transparent;
  color: var(--text-body);
  border: 1px solid var(--text-body);
}

.bg-dark .btn-secondary {
  color: var(--bg-paper);
  border-color: var(--bg-paper);
}

.btn-secondary:hover {
  background-color: rgba(0,0,0,0.05);
}
.bg-dark .btn-secondary:hover {
  background-color: rgba(255,255,255,0.1);
}

.btn-icon {
  width: 20px;
  height: 20px;
  margin-right: 8px;
  stroke-width: 2;
}

/* --- 卡片 (Cards) --- */
.card {
  background-color: #fff;
  border: var(--card-border);
  border-radius: var(--radius-card);
  padding: 2rem;
  box-shadow: var(--card-shadow);
  transition: transform 0.2s ease;
}

.card:hover {
  transform: translateY(-4px);
}

.bg-dark .card {
  background-color: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
}

/* --- 表格 (Tables) --- */
.table-wrapper {
  overflow-x: auto;
  border: var(--card-border);
  border-radius: var(--radius-card);
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

th, td {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid rgba(31, 21, 35, 0.1);
}

th {
  background-color: rgba(31, 21, 35, 0.03);
  font-weight: 600;
  white-space: nowrap;
}

tr:last-child td {
  border-bottom: none;
}

/* --- 问答列表 (FAQ) --- */
details {
  border-bottom: 1px solid rgba(31, 21, 35, 0.1);
  padding: 1.5rem 0;
}

summary {
  list-style: none;
  font-weight: 600;
  font-size: 1.1rem;
  cursor: pointer;
  position: relative;
  padding-right: 2rem;
}

summary::-webkit-details-marker {
  display: none;
}

summary::after {
  content: "+";
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.2rem;
  color: var(--brand);
}

details[open] summary::after {
  content: "-";
}

details p {
  margin-top: 1rem;
  margin-bottom: 0;
  font-size: 0.95rem;
  color: rgba(31, 21, 35, 0.8);
}

/* --- 页头页脚 (Header & Footer) --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: rgba(246, 243, 247, 0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(31, 21, 35, 0.05);
  padding: 1rem 0;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo-link {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--text-body);
  text-decoration: none;
}

.logo-link:hover {
  text-decoration: none;
}

.logo-img {
  height: 32px;
  width: auto;
}

.nav-links {
  display: flex;
  gap: 2rem;
  align-items: center;
}

.nav-link {
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--text-body);
}

.nav-link[aria-current="page"] {
  color: var(--brand);
  font-weight: 700;
}

.footer {
  background-color: var(--bg-dark);
  color: var(--bg-paper);
  padding: 4rem 0;
  font-size: 0.9rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 3rem;
}

.footer-col h4 {
  color: var(--accent);
  margin-bottom: 1.5rem;
  font-size: 1rem;
}

.footer-links {
  list-style: none;
}

.footer-links li {
  margin-bottom: 0.8rem;
}

.footer-links a {
  color: rgba(246, 243, 247, 0.7);
}

.footer-links a:hover {
  color: var(--accent);
}

.copyright {
  margin-top: 4rem;
  text-align: center;
  color: rgba(246, 243, 247, 0.4);
  font-size: 0.8rem;
}

/* --- SVG 动效方向 (Animation Classes) --- */
.draw {
  pathLength: 1;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: drawLine 3s cubic-bezier(0.4, 0, 0.2, 1) infinite alternate;
}

@keyframes drawLine {
  0% { stroke-dashoffset: 1; }
  100% { stroke-dashoffset: 0; }
}

.float {
  animation: floatAnim 4s ease-in-out infinite alternate;
}

@keyframes floatAnim {
  0% { transform: translateY(0); }
  100% { transform: translateY(-10px); }
}

.blink-dot {
  animation: blink 2s infinite;
}

@keyframes blink {
  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;
    scroll-behavior: auto !important;
  }
  .draw, .float, .blink-dot {
    animation: none;
  }
}

/* --- 响应式调整 (Responsive) --- */
@media (max-width: 768px) {
  .nav-links {
    display: none; /* 移动端简化，实际项目应加汉堡菜单 */
  }
  
  .header-inner {
    justify-content: center;
  }

  h1 {
    font-size: 2.5rem;
  }
  
  .hero-layout {
    flex-direction: column-reverse;
  }
  
  .feature-row {
    flex-direction: column !important;
  }
  
  .feature-text, .feature-visual {
    width: 100% !important;
  }
}
