/* =========================================
   SafeW 全站共享样式
   ========================================= */

/* --- 设计 Token / 变量 --- */
:root {
  /* 颜色系统 */
  --color-dark: #251943;      /* 深色面 */
  --color-paper: #DBD4ED;     /* 纸面 */
  --color-text: #191523;      /* 正文/标题色 */
  --color-brand: #5214EB;     /* 品牌色（强调词、图标、眉标） */
  --color-accent: #ED6E89;    /* 强调色（按钮、徽标、深色面上的强调） */
  
  /* 结构参数 */
  --radius-card: 0;           /* 直角 */
  --radius-btn: 0;            /* 直角 */
  --card-border: 1px solid rgba(25, 21, 35, 0.16); /* 细线描边 */
  --card-shadow: none;        /* 无阴影 */
  
  --section-y: clamp(5rem, 10vw, 9rem);
  --gap: clamp(1.5rem, 3vw, 2.5rem);
  --content-max: 1120px;
  
  /* 字体 */
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* --- 基础重置 --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background-color: var(--color-paper);
  color: var(--color-text);
  line-height: 1.75;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

img, svg {
  display: block;
  max-width: 100%;
}

a {
  color: var(--color-brand);
  text-decoration: underline;
  text-underline-offset: 2px;
}

a:hover {
  text-decoration-thickness: 2px;
}

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--dark {
  background-color: var(--color-dark);
  color: var(--color-paper);
}

.section--dark .hl {
  color: var(--color-accent);
}

.section--dark a:not(.btn) {
  color: var(--color-accent);
}

.section--paper {
  background-color: var(--color-paper);
  color: var(--color-text);
}

.section--paper .hl {
  color: var(--color-brand);
}

.section--paper a:not(.btn) {
  color: var(--color-brand);
}

/* 嵌套浅色卡片（在深色面上） */
.card-light {
  background-color: var(--color-paper);
  color: var(--color-text);
  border: var(--card-border);
  border-radius: var(--radius-card);
  padding: var(--gap);
}

.card-light .hl {
  color: var(--color-brand);
}

/* --- 排版 --- */
.heading-group {
  margin-bottom: var(--gap);
}

.breadcrumb {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
  color: var(--color-brand);
}

.section--dark .breadcrumb {
  color: var(--color-accent);
}

h1, h2, h3, h4 {
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: 0.02em;
}

h1 {
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  margin-bottom: 1rem;
  text-wrap: balance;
}

h2 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  margin-bottom: 1.5rem;
}

h3 {
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
}

p {
  margin-bottom: 1rem;
  max-width: 38em;
}

.hl {
  /* 高亮词样式由父级决定颜色 */
  font-weight: 800;
}

/* --- 组件：按钮 --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  height: 48px;
  padding-inline: 1.5rem;
  font-size: 1rem;
  font-weight: 700;
  text-decoration: none;
  border-radius: var(--radius-btn);
  transition: transform 0.2s ease, opacity 0.2s ease;
  cursor: pointer;
}

.btn:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

.btn--primary {
  background-color: var(--color-accent);
  color: var(--color-dark);
  border: none;
}

.btn--primary:hover {
  transform: translateY(-2px);
  opacity: 0.9;
}

.btn--secondary {
  background-color: transparent;
  color: var(--color-text);
  border: 1px solid var(--color-text);
}

.section--dark .btn--secondary {
  color: var(--color-paper);
  border-color: var(--color-paper);
}

.btn--secondary:hover {
  background-color: rgba(25, 21, 35, 0.05);
  transform: translateY(-2px);
}

/* --- 组件：卡片 --- */
.card {
  background-color: var(--color-paper);
  color: var(--color-text);
  border: var(--card-border);
  border-radius: var(--radius-card);
  padding: var(--gap);
  display: flex;
  flex-direction: column;
  height: 100%;
}

.section--dark .card {
  background-color: var(--color-dark);
  color: var(--color-paper);
  border-color: rgba(219, 212, 237, 0.16);
}

.card--grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--gap);
}

/* --- 组件：表格 --- */
.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: var(--card-border);
  border-radius: var(--radius-card);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

th, td {
  text-align: left;
  padding: 1rem;
  border-bottom: var(--card-border);
}

th {
  font-weight: 700;
  background-color: rgba(25, 21, 35, 0.05);
}

.section--dark th {
  background-color: rgba(219, 212, 237, 0.05);
}

tr:last-child td {
  border-bottom: none;
}

/* --- 组件：FAQ --- */
.faq-item {
  border-bottom: var(--card-border);
}

.faq-item summary {
  padding: 1.25rem 0;
  cursor: pointer;
  font-weight: 700;
  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.5rem;
  font-weight: 400;
  transition: transform 0.2s;
}

.faq-item[open] summary::after {
  transform: rotate(45deg);
}

.faq-item p {
  padding-bottom: 1.25rem;
  color: inherit;
  opacity: 0.85;
}

/* --- 组件：步骤条 --- */
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gap);
  counter-reset: step;
}

.step {
  position: relative;
  padding-top: 3rem;
}

.step-number {
  position: absolute;
  top: 0;
  left: 0;
  width: 2.5rem;
  height: 2.5rem;
  background-color: var(--color-accent);
  color: var(--color-dark);
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-card);
}

/* --- 页头与页脚 --- */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: var(--color-paper);
  border-bottom: var(--card-border);
  padding-block: 1rem;
}

.section--dark ~ .header {
  background-color: var(--color-dark);
  border-color: rgba(219, 212, 237, 0.16);
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: inherit;
  font-weight: 800;
  font-size: 1.25rem;
}

.nav-list {
  display: flex;
  gap: 1.5rem;
}

.nav-link {
  text-decoration: none;
  color: inherit;
  font-weight: 500;
  padding: 0.5rem 0;
  border-bottom: 2px solid transparent;
}

.nav-link:hover, .nav-link[aria-current="page"] {
  border-bottom-color: var(--color-brand);
}

.section--dark .nav-link:hover, 
.section--dark .nav-link[aria-current="page"] {
  border-bottom-color: var(--color-accent);
}

.footer {
  background-color: var(--color-dark);
  color: var(--color-paper);
  padding-block: var(--section-y);
  border-top: 1px solid rgba(219, 212, 237, 0.1);
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--gap);
}

.footer-col h4 {
  color: var(--color-accent);
  margin-bottom: 1rem;
}

.footer-col a {
  display: block;
  color: var(--color-paper);
  text-decoration: none;
  margin-bottom: 0.5rem;
  opacity: 0.8;
}

.footer-col a:hover {
  opacity: 1;
  text-decoration: underline;
}

/* --- SVG 动效 --- */
.svg-grid-node {
  fill: rgba(219, 212, 237, 0.1);
  animation: gridPulse 4s infinite alternate ease-in-out;
}

.svg-grid-node:nth-child(odd) {
  animation-delay: 2s;
}

@keyframes gridPulse {
  0%, 100% { fill: rgba(219, 212, 237, 0.05); }
  50% { fill: rgba(237, 110, 137, 0.6); }
}

/* 呼吸光晕 */
.svg-breathe {
  animation: breathe 6s infinite ease-in-out;
}

@keyframes breathe {
  0%, 100% { opacity: 0.3; transform: scale(0.95); }
  50% { opacity: 1; transform: scale(1.05); }
}

/* 浮动 */
.svg-float {
  animation: float 8s infinite ease-in-out;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

/* --- 响应式 --- */
@media (max-width: 768px) {
  .steps {
    grid-template-columns: 1fr;
  }
  
  .hero-layout {
    flex-direction: column-reverse;
  }
  
  .nav-list {
    display: none; /* 移动端简化处理，实际项目可加汉堡菜单 */
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
