/* =========================================
   SafeW 全站共享样式
   ========================================= */

/* 设计 Token & 色板变量（仅在此定义） */
:root {
  --color-dark: #240F29;
  --color-paper: #F6F3F7;
  --color-body: #201523;
  --color-brand: #A711CF;
  --color-accent: #ED6E73;

  --radius-card: 0;
  --radius-btn: 0;
  --card-border: 2px solid var(--color-body);
  --card-shadow: 4px 4px 0 var(--color-body);
  --section-y: clamp(3.5rem, 7vw, 6rem);
  --gap: clamp(1rem, 2vw, 1.75rem);
  --content-max: 1280px;
  --line-height: 1.65;
}

/* 上下文覆盖：深色面 / 浅色卡片 */
.dark-surface {
  --bg: var(--color-dark);
  --text: var(--color-paper);
  --accent: var(--color-accent);
  --border: 2px solid var(--color-paper);
  --shadow: 4px 4px 0 var(--color-paper);
}
.light-card {
  --bg: var(--color-paper);
  --text: var(--color-body);
  --accent: var(--color-brand);
  --border: 2px solid var(--color-body);
  --shadow: 4px 4px 0 var(--color-body);
}

/* 基础重置与排版 */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", sans-serif;
  line-height: var(--line-height);
  color: var(--color-body);
  background: var(--color-paper);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; height: auto; }
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-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}
.dark-surface .section-badge { color: var(--accent); }
.light-section .section-badge { color: var(--color-brand); }

h1, h2, h3 {
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.2;
  margin-bottom: 0.75rem;
}
h1 { font-size: clamp(2.2rem, 5vw, 3.8rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); }
h3 { font-size: 1.25rem; }
p { margin-bottom: 1rem; max-width: 38em; }
.highlight { color: var(--accent); }
.dark-surface .highlight { color: var(--accent); }
.light-section .highlight { color: var(--color-brand); }

/* 页头与导航 */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(246, 243, 247, 0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(32, 21, 35, 0.1);
  transition: box-shadow 0.2s ease;
}
.site-header.scrolled { box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand img { height: 32px; width: auto; }
.nav-links { display: flex; gap: 24px; align-items: center; }
.nav-links a { font-weight: 500; font-size: 0.95rem; }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--color-brand); }

/* 按钮系统 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 52px;
  padding: 0 24px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: transform 0.15s ease, filter 0.15s ease;
}
.btn-primary {
  background: var(--color-accent);
  color: var(--color-dark);
}
.btn-secondary {
  background: transparent;
  border: 2px solid var(--color-body);
  color: var(--color-body);
}
.dark-surface .btn-secondary {
  border-color: var(--color-paper);
  color: var(--color-paper);
}
.btn:hover { transform: translateY(-2px); filter: brightness(0.95); }
.btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.btn svg { width: 20px; height: 20px; flex-shrink: 0; }

/* 卡片与面板 */
.panel {
  background: var(--bg);
  border: var(--border);
  box-shadow: var(--shadow);
  padding: 24px;
}
.feature-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap);
  align-items: center;
}
.feature-text { padding: 16px 0; }
.feature-panel { min-height: 280px; }
.feature-panel svg { width: 100%; height: 100%; }

/* 表格 */
.platform-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}
.platform-table th, .platform-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 2px solid var(--color-body);
}
.platform-table th { font-weight: 700; background: rgba(0,0,0,0.03); }
.platform-table a { color: var(--color-brand); text-decoration: underline; text-decoration-thickness: 1px; }
.dark-surface .platform-table a { color: var(--accent); }

/* FAQ */
.faq-list { display: grid; gap: 16px; }
.faq-item {
  border: var(--card-border);
  background: var(--bg);
  box-shadow: var(--card-shadow);
}
.faq-item summary {
  padding: 16px;
  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;
  font-weight: 400;
}
.faq-item[open] summary::after { content: "−"; }
.faq-item p { padding: 0 16px 16px; margin: 0; }

/* 新闻卡片 */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--gap);
}
.news-card {
  background: var(--bg);
  border: var(--border);
  box-shadow: var(--card-shadow);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.news-card time { font-size: 0.85rem; opacity: 0.8; }

/* 时间线（快速开始） */
.timeline { position: relative; padding-left: 32px; border-left: 2px solid var(--color-brand); }
.timeline-step { position: relative; margin-bottom: 32px; }
.timeline-step:last-child { margin-bottom: 0; }
.timeline-step::before {
  content: attr(data-num);
  position: absolute;
  left: -48px;
  top: 0;
  width: 32px;
  height: 32px;
  background: var(--color-accent);
  color: var(--color-dark);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
}
.dark-surface .timeline-step::before { background: var(--accent); color: var(--color-dark); }

/* 技巧编号 */
.tip-list { counter-reset: tip; }
.tip-item {
  counter-increment: tip;
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
  align-items: flex-start;
}
.tip-item::before {
  content: counter(tip, decimal-leading-zero);
  font-weight: 700;
  color: var(--color-accent);
  min-width: 36px;
}
.dark-surface .tip-item::before { color: var(--accent); }

/* SVG 动效关键帧 */
@keyframes floatSoft {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
@keyframes breathe {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}
@keyframes slideUp {
  0% { transform: translateY(12px); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}
@keyframes drawPath {
  0% { stroke-dashoffset: 1; }
  100% { stroke-dashoffset: 0; }
}
@keyframes twinkle {
  0%, 100% { opacity: 0.2; }
  50% { opacity: 1; }
}

.anim-float { animation: floatSoft 4s ease-in-out infinite; }
.anim-breathe { animation: breathe 3s ease-in-out infinite; }
.anim-slide { animation: slideUp 5s ease-out infinite alternate; }
.anim-draw { animation: drawPath 6s ease-in-out infinite alternate; }
.anim-twinkle { animation: twinkle 5s ease-in-out infinite; }

svg path, svg circle, svg rect, svg line {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
svg path.draw-line {
  pathLength: 1;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
}
svg .ui-fill { fill: currentColor; }
svg .ui-stroke { stroke: currentColor; }

/* 响应式与无障碍 */
@media (max-width: 900px) {
  .feature-row { grid-template-columns: 1fr; }
  .nav-links { gap: 16px; }
}
@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;
  }
}
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
::selection { background: var(--color-brand); color: var(--color-paper); }
