/* =========================================
   SafeW 全站共享样式
   ========================================= */

/* 设计变量 */
:root {
  --color-bg-dark: #10112D;
  --color-bg-paper: #F5F0E5;
  --color-bg-paper-light: #FAF7F0;
  --color-text-main: #151523;
  --color-text-on-dark: #F5F0E5;
  --color-brand: #1416EB;
  --color-accent: #89ED6E;
  --color-text-on-accent: #10112D;
  --color-border: rgba(21, 21, 35, 0.12);

  --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);
  --content-max: 1280px;

  --font-stack: "PingFang SC", "Noto Sans SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  --transition-base: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 基础重置与排版 */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-stack);
  font-size: 16px;
  line-height: 1.75;
  color: var(--color-text-main);
  background-color: var(--color-bg-paper);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; transition: color var(--transition-base); }
ul, ol { list-style: none; }

/* 容器与区块 */
.container {
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--gap);
}
.section {
  position: relative;
  padding: var(--section-y) 0;
  overflow: hidden;
}
.section::after {
  content: "";
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--color-border), transparent);
  opacity: 0.6;
}
.section:last-child::after { display: none; }

/* 面型切换（通过自定义属性覆盖取色） */
.section-paper { background-color: var(--color-bg-paper); color: var(--color-text-main); }
.section-dark { background-color: var(--color-bg-dark); color: var(--color-text-on-dark); }
.section-dark .section-title, .section-dark h2, .section-dark h3, .section-dark p { color: var(--color-text-on-dark); }
.section-dark .hl { color: var(--color-accent); }
.section-dark .eyebrow { color: var(--color-accent); }
.section-dark .brand-link { color: var(--color-accent); }
.section-dark .icon-svg { stroke: var(--color-accent); }

/* 标题系统 */
.eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  margin-bottom: 0.75rem;
  color: var(--color-brand);
  text-transform: uppercase;
}
.section-title {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin-bottom: 1.5rem;
}
.hl { color: var(--color-brand); font-weight: 600; }
.section-dark .hl { color: var(--color-accent); }
.hero-h1 {
  font-size: clamp(2.6rem, 6.4vw, 5rem);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 1.25rem;
  text-wrap: balance;
}

/* 布局网格 */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); align-items: center; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: var(--gap); }
@media (max-width: 900px) {
  .grid-2 { grid-template-columns: 1fr; }
  .hero-content { order: 1; }
  .hero-visual { order: 2; }
}

/* 组件：按钮 */
.btn-group { display: flex; gap: 1rem; flex-wrap: wrap; margin-top: 1.5rem; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  height: 52px;
  padding: 0 28px;
  border-radius: var(--radius-btn);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform var(--transition-base), box-shadow var(--transition-base), background var(--transition-base);
  border: none;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); }
.btn:focus-visible { outline: 3px solid var(--color-accent); outline-offset: 3px; }
.btn-primary {
  background-color: var(--color-accent);
  color: var(--color-text-on-accent);
  box-shadow: 0 4px 12px rgba(137, 237, 110, 0.35);
}
.btn-primary:hover { background-color: #7de060; }
.btn-secondary {
  background: transparent;
  color: var(--color-text-main);
  border: 2px solid var(--color-text-main);
}
.section-dark .btn-secondary {
  color: var(--color-text-on-dark);
  border-color: var(--color-text-on-dark);
}
.btn-secondary:hover { background: rgba(21, 21, 35, 0.05); }
.section-dark .btn-secondary:hover { background: rgba(245, 240, 229, 0.08); }

/* 组件：卡片 */
.card {
  background: var(--color-bg-paper);
  border-radius: var(--radius-card);
  border: var(--card-border);
  box-shadow: var(--card-shadow);
  padding: 1.5rem;
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}
.card:hover { transform: translateY(-4px); box-shadow: 0 14px 32px -12px rgba(21, 21, 35, 0.35); }
.card-icon {
  width: 48px; height: 48px;
  background: rgba(20, 22, 235, 0.08);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 1rem;
}
.section-dark .card { background: #1A1C42; }
.section-dark .card-icon { background: rgba(137, 237, 110, 0.1); }

/* 组件：表格 */
.spec-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
  font-size: 0.95rem;
}
.spec-table th, .spec-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--color-border);
  text-align: left;
}
.spec-table th { font-weight: 600; color: var(--color-brand); }
.section-dark .spec-table th { color: var(--color-accent); }
.spec-table td { color: inherit; }
.spec-table tr:last-child td { border-bottom: none; }

/* 组件：FAQ */
.faq-list { display: flex; flex-direction: column; gap: 1rem; }
.faq-item {
  background: var(--color-bg-paper);
  border-radius: 16px;
  border: 1px solid var(--color-border);
  overflow: hidden;
}
.section-dark .faq-item { background: #1A1C42; border-color: rgba(245, 240, 229, 0.1); }
.faq-item summary {
  padding: 1.25rem;
  cursor: pointer;
  font-weight: 600;
  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;
  transition: transform var(--transition-base);
}
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-content { padding: 0 1.25rem 1.25rem; line-height: 1.8; }

/* 组件：步骤徽标 */
.step-list { counter-reset: step; }
.step-item {
  counter-increment: step;
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  align-items: flex-start;
}
.step-badge {
  flex-shrink: 0;
  width: 32px; height: 32px;
  background: var(--color-accent);
  color: var(--color-text-on-accent);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
}

/* 页头与页脚 */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(245, 240, 229, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
  transition: background var(--transition-base);
}
.section-dark ~ .site-header { background: rgba(16, 17, 45, 0.9); border-color: rgba(245, 240, 229, 0.1); }
.header-inner {
  height: 72px;
  display: flex; align-items: center; justify-content: space-between;
}
.brand { display: flex; align-items: center; gap: 0.75rem; font-weight: 700; font-size: 1.1rem; }
.brand img { width: 32px; height: 32px; object-fit: contain; }
.nav-links { display: flex; gap: 2rem; align-items: center; }
.nav-links a { font-weight: 500; font-size: 0.95rem; }
.nav-links a:hover { color: var(--color-brand); }
.nav-links a[aria-current="page"] { color: var(--color-brand); font-weight: 600; }
.section-dark .nav-links a { color: var(--color-text-on-dark); }
.section-dark .nav-links a:hover, .section-dark .nav-links a[aria-current="page"] { color: var(--color-accent); }

.site-footer {
  padding: 4rem 0 2rem;
  background: var(--color-bg-dark);
  color: var(--color-text-on-dark);
  font-size: 0.9rem;
}
.footer-grid {
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 2rem; margin-bottom: 3rem;
}
.footer-col h4 { margin-bottom: 1rem; color: var(--color-accent); }
.footer-col ul li { margin-bottom: 0.6rem; }
.footer-col ul li a { color: rgba(245, 240, 229, 0.7); }
.footer-col ul li a:hover { color: var(--color-accent); }
.footer-bottom {
  border-top: 1px solid rgba(245, 240, 229, 0.1);
  padding-top: 1.5rem;
  display: flex; justify-content: space-between; align-items: center;
}
@media (max-width: 768px) {
  .nav-links { display: none; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-bottom { flex-direction: column; gap: 1rem; text-align: center; }
}

/* SVG 动效核心规则 */
.svg-visual { width: 100%; height: auto; max-width: 100%; }
svg { overflow: visible; }
.draw-line {
  pathLength: 1;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: drawStroke 4s ease-in-out infinite;
}
.breathe-dot {
  animation: breathe 3s ease-in-out infinite;
}
.float-card {
  animation: floatY 6s ease-in-out infinite;
}
.float-delay-1 { animation-delay: -1.5s; }
.float-delay-2 { animation-delay: -3s; }
.float-delay-3 { animation-delay: -4.5s; }

@keyframes drawStroke {
  0% { stroke-dashoffset: 1; }
  15%, 85% { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: 1; }
}
@keyframes breathe {
  0%, 100% { opacity: 0.4; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1); }
}
@keyframes floatY {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

/* 减少动态效果 */
@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-line, .breathe-dot, .float-card { animation: none !important; }
}
