/* =========================================
   SafeW 全站共享样式
   ========================================= */

/* --- 设计变量 --- */
:root {
  /* 配色 */
  --color-dark: #21163C;
  --color-paper: #F4F3F7;
  --color-text: #191523;
  --color-brand: #5214EB;
  --color-accent: #ED926E;
  --color-white: #FFFFFF;

  /* 圆角与阴影 */
  --radius-card: 20px;
  --radius-btn: 12px;
  --card-border: 0;
  --card-shadow: 0 10px 28px -14px rgba(25, 21, 35, 0.3);

  /* 节奏与密度 */
  --section-y: clamp(5rem, 10vw, 9rem);
  --gap: clamp(1.5rem, 3vw, 2.5rem);
  --content-max: 1280px;

  /* 排版 */
  --font-body: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  --font-title: var(--font-body);
  --size-h1: clamp(2rem, 4.6vw, 3.4rem);
  --size-h2: clamp(1.6rem, 3vw, 2.4rem);
  --size-body: 16px;
  --lh-body: 1.75;
}

/* --- 基础重置与排版 --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: var(--size-body);
  line-height: var(--lh-body);
  color: var(--color-text);
  background-color: var(--color-paper);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

ul, ol {
  list-style: none;
}

/* --- 容器与区块 --- */
.container {
  width: 100%;
  max-width: var(--content-max);
  margin-inline: auto;
  padding-inline: var(--gap);
}

.section {
  padding-block: var(--section-y);
}

.section-inner {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}

/* --- 眉标与标题 --- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-brand);
  margin-bottom: 0.5em;
}

.dark-surface .eyebrow {
  color: var(--color-accent);
}

.light-card .eyebrow {
  color: var(--color-brand);
}

h1, h2, h3 {
  font-family: var(--font-title);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: 0;
  color: var(--color-text);
}

h1 { font-size: var(--size-h1); }
h2 { font-size: var(--size-h2); margin-top: 0.5em; }
h3 { font-size: 1.15rem; margin-top: 0.8em; }

.hl {
  color: var(--color-brand);
  font-weight: 700;
}

.dark-surface h1, .dark-surface h2, .dark-surface h3,
.dark-surface p, .dark-surface li, .dark-surface td, .dark-surface th {
  color: var(--color-paper);
}

.dark-surface .hl { color: var(--color-accent); }

.light-card h1, .light-card h2, .light-card h3,
.light-card p, .light-card li, .light-card td, .light-card th {
  color: var(--color-text);
}

.light-card .hl { color: var(--color-brand); }

/* --- 按钮 --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 52px;
  padding-inline: 24px;
  border-radius: var(--radius-btn);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
  white-space: nowrap;
}

.btn:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 2px;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-primary {
  background-color: var(--color-accent);
  color: var(--color-dark);
  border: none;
}

.btn-primary:hover {
  background-color: #d97a54;
  box-shadow: 0 6px 16px rgba(237, 146, 110, 0.4);
}

.btn-secondary {
  background-color: transparent;
  color: var(--color-text);
  border: 1.5px solid var(--color-text);
}

.dark-surface .btn-secondary {
  color: var(--color-paper);
  border-color: var(--color-paper);
}

.btn-secondary:hover {
  background-color: rgba(25, 21, 35, 0.06);
}

.dark-surface .btn-secondary:hover {
  background-color: rgba(244, 243, 247, 0.08);
}

/* --- 页头 --- */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: rgba(244, 243, 247, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(25, 21, 35, 0.08);
  padding-block: 16px;
}

.dark-surface .header {
  background-color: rgba(33, 22, 60, 0.95);
  border-bottom-color: rgba(244, 243, 247, 0.1);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.logo img {
  height: 32px;
  width: auto;
}

.nav-links {
  display: flex;
  gap: 24px;
  font-size: 0.95rem;
  font-weight: 500;
}

.nav-links a {
  padding-block: 4px;
  border-bottom: 2px solid transparent;
  transition: border-color 0.2s;
}

.nav-links a:hover, .nav-links a[aria-current="page"] {
  border-bottom-color: var(--color-brand);
}

.dark-surface .nav-links a:hover,
.dark-surface .nav-links a[aria-current="page"] {
  border-bottom-color: var(--color-accent);
}

.mobile-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.mobile-toggle svg {
  width: 24px;
  height: 24px;
  stroke: currentColor;
}

/* --- 通用组件 --- */
.card {
  background: var(--color-white);
  border-radius: var(--radius-card);
  padding: var(--gap);
  box-shadow: var(--card-shadow);
  border: var(--card-border) solid var(--color-text);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 32px -12px rgba(25, 21, 35, 0.35);
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  gap: var(--gap);
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  gap: var(--gap);
}

dl.feature-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: 16px;
}

dl.feature-list dt {
  font-weight: 700;
  color: var(--color-brand);
  margin-bottom: 4px;
}

.dark-surface dl.feature-list dt {
  color: var(--color-accent);
}

dl.feature-list dd {
  color: var(--color-text);
  margin-left: 0;
  padding-left: 12px;
  border-left: 3px solid var(--color-brand);
}

.dark-surface dl.feature-list dd {
  border-left-color: var(--color-accent);
}

/* 时间轴 */
.timeline {
  position: relative;
  padding-left: 24px;
  border-left: 2px solid var(--color-brand);
}

.dark-surface .timeline {
  border-left-color: var(--color-accent);
}

.timeline-item {
  position: relative;
  margin-bottom: 32px;
  padding-left: 16px;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -31px;
  top: 6px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--color-brand);
  border: 2px solid var(--color-paper);
}

.dark-surface .timeline-item::before {
  background: var(--color-accent);
  border-color: var(--color-dark);
}

.timeline-time {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--color-brand);
  margin-bottom: 4px;
}

.dark-surface .timeline-time {
  color: var(--color-accent);
}

/* 步骤徽标 */
.step-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--color-accent);
  color: var(--color-dark);
  font-weight: 800;
  font-size: 0.9rem;
  margin-right: 8px;
  vertical-align: middle;
}

.steps-list {
  counter-reset: step;
}

.steps-list li {
  position: relative;
  padding-left: 44px;
  margin-bottom: 20px;
}

.steps-list li::before {
  counter-increment: step;
  content: "0" counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--color-accent);
  color: var(--color-dark);
  font-weight: 800;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 检查清单 */
.checklist {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 16px;
}

.checklist-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.check-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  stroke: var(--color-brand);
}

.dark-surface .check-icon {
  stroke: var(--color-accent);
}

/* 表格 */
.table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-card);
  background: var(--color-white);
  box-shadow: var(--card-shadow);
}

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  text-align: left;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(25, 21, 35, 0.08);
}

th {
  font-weight: 700;
  background: rgba(25, 21, 35, 0.03);
}

.dark-surface .table-wrapper {
  background: rgba(244, 243, 247, 0.05);
}

.dark-surface th, .dark-surface td {
  border-bottom-color: rgba(244, 243, 247, 0.1);
}

/* FAQ */
details.faq-item {
  border: 1px solid rgba(25, 21, 35, 0.1);
  border-radius: var(--radius-card);
  margin-bottom: 12px;
  background: var(--color-white);
  overflow: hidden;
}

.dark-surface details.faq-item {
  background: rgba(244, 243, 247, 0.05);
  border-color: rgba(244, 243, 247, 0.1);
}

summary {
  padding: 18px 20px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

summary::-webkit-details-marker { display: none; }

summary::after {
  content: "+";
  font-size: 1.2rem;
  font-weight: 400;
  transition: transform 0.2s;
}

details[open] summary::after {
  transform: rotate(45deg);
}

details.faq-item > div {
  padding: 0 20px 18px;
  color: var(--color-text);
}

.dark-surface details.faq-item > div {
  color: var(--color-paper);
}

/* --- SVG 容器 --- */
.svg-visual {
  width: 100%;
  height: auto;
  max-width: 640px;
  margin: 0 auto;
}

/* --- 动画定义 --- */
@keyframes float-main {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-14px); }
}

@keyframes float-sub {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

@keyframes breathe {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}

@keyframes slide-in {
  from { transform: translateX(24px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes dash-flow {
  to { stroke-dashoffset: 0; }
}

.anim-float { animation: float-main 6s ease-in-out infinite; }
.anim-float-sub { animation: float-sub 7.5s ease-in-out infinite 0.5s; }
.anim-breathe { animation: breathe 3s ease-in-out infinite; }
.anim-slide-in { animation: slide-in 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards; }
.anim-draw {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: dash-flow 1.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* SVG 子元素旋转/缩放基准 */
svg .rotatable, svg .scalable {
  transform-box: fill-box;
  transform-origin: center;
}

/* --- 响应式 --- */
@media (max-width: 768px) {
  .mobile-toggle { display: block; }
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--color-paper);
    padding: 16px;
    border-bottom: 1px solid rgba(25, 21, 35, 0.1);
    gap: 12px;
  }
  .dark-surface .nav-links { background: var(--color-dark); }
  .nav-links.is-open { display: flex; }
  .grid-2, .grid-3, dl.feature-list, .checklist {
    grid-template-columns: 1fr;
  }
  .hero-layout {
    flex-direction: column-reverse !important;
  }
  .svg-visual {
    max-width: 100%;
    margin-top: var(--gap);
  }
}

/* --- 减少动态效果 --- */
@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;
  }
  html { scroll-behavior: auto; }
}
