/* =========================================
   SafeW 全站共享样式 (style.css)
   品牌色板与基础排版
   ========================================= */

:root {
  /* --- 配色系统 --- */
  --bg-dark: #2D1438;       /* 深色面：首屏、收尾区 */
  --bg-paper: #F6F3F7;      /* 浅色纸面：内容区 */
  --bg-card: #FFFFFF;       /* 卡片底色（继承自纸面的变体） */
  
  --text-main: #1F1523;     /* 正文色：标题、正文 */
  --text-muted: #4A3B52;    /* 辅助文字色（用于列表说明等，非派生灰色） */
  
  --brand: #9E13DD;         /* 品牌色：纸面上的强调、图标、链接 */
  --accent: #6EEDA8;        /* 强调色：按钮、深色面上的强调、徽标 */
  
  /* --- 尺寸与间距 --- */
  --radius-card: 20px;
  --radius-btn: 12px;
  --card-shadow: 0 10px 28px -14px rgba(31, 21, 35, 0.15);
  --card-border: 0;
  
  --content-max: 960px;
  --section-y: clamp(2.5rem, 5vw, 4rem);
  --gap: clamp(0.75rem, 1.5vw, 1.25rem);
  
  /* --- 字体 --- */
  --font-sans: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

/* --- Reset & Base --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-paper);
  color: var(--text-main);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a {
  color: var(--brand);
  text-decoration: none;
  transition: opacity 0.2s ease;
}

a:hover {
  opacity: 0.8;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

svg {
  flex-shrink: 0;
}

/* --- 布局容器 --- */
.container {
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--gap);
}

.section {
  padding: var(--section-y) 0;
}

/* --- 排版 --- */
h1, h2, h3, h4 {
  color: var(--text-main);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(2rem, 4.6vw, 3.4rem);
  margin-bottom: var(--gap);
}

h2 {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  margin-bottom: var(--section-y);
  position: relative;
  padding-left: var(--gap);
  border-left: 4px solid var(--brand);
}

.dark-section h2 {
  border-left-color: var(--accent);
}

h3 {
  font-size: clamp(1.25rem, 2vw, 1.5rem);
  margin-bottom: var(--gap);
}

p {
  margin-bottom: 1em;
  max-width: 38em;
}

.text-accent {
  color: var(--accent);
}

.text-brand {
  color: var(--brand);
}

/* --- 眉标 (Subtitle Label) --- */
.label {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 0.5em;
  color: var(--brand);
}

.dark-section .label {
  color: var(--accent);
}

/* --- 按钮组件 --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 48px;
  padding: 0 24px;
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius-btn);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s;
  text-decoration: none;
  white-space: nowrap;
}

.btn:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.btn-primary {
  background-color: var(--accent);
  color: var(--bg-dark);
  border: none;
}

.btn-primary:hover {
  background-color: #5CE096;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(110, 237, 168, 0.3);
}

.btn-secondary {
  background-color: transparent;
  color: var(--text-main);
  border: 1px solid var(--text-main);
}

.dark-section .btn-secondary {
  color: var(--bg-paper);
  border-color: var(--bg-paper);
}

.btn-secondary:hover {
  background-color: rgba(0,0,0,0.05);
  transform: translateY(-2px);
}

.dark-section .btn-secondary:hover {
  background-color: rgba(255,255,255,0.1);
}

/* --- 卡片 --- */
.card {
  background-color: var(--bg-card);
  border-radius: var(--radius-card);
  box-shadow: var(--card-shadow);
  padding: var(--gap);
  border: var(--card-border);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 32px -12px rgba(31, 21, 35, 0.2);
}

/* --- 表格 --- */
.table-responsive {
  overflow-x: auto;
  width: 100%;
  border-radius: var(--radius-card);
  border: 1px solid rgba(31, 21, 35, 0.1);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

th, td {
  padding: 16px 20px;
  text-align: left;
  border-bottom: 1px solid rgba(31, 21, 35, 0.08);
}

th {
  background-color: rgba(31, 21, 35, 0.03);
  font-weight: 700;
  color: var(--text-main);
}

tr:last-child td {
  border-bottom: none;
}

/* --- 导航栏 --- */
.navbar {
  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: 12px 0;
}

.dark-section .navbar {
  background-color: rgba(45, 20, 56, 0.9);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo img {
  height: 32px;
  width: auto;
}

.nav-links {
  display: flex;
  gap: 24px;
  align-items: center;
}

.nav-link {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-main);
}

.nav-link[aria-current="page"] {
  color: var(--brand);
  font-weight: 700;
}

.dark-section .nav-link {
  color: var(--bg-paper);
}

.dark-section .nav-link[aria-current="page"] {
  color: var(--accent);
}

@media (max-width: 768px) {
  .nav-links {
    display: none; /* 简化移动端，仅保留主按钮或Logo */
  }
  .navbar .btn {
    display: none;
  }
}

/* --- 页脚 --- */
.footer {
  background-color: var(--bg-dark);
  color: var(--bg-paper);
  padding: 64px 0 32px;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 32px;
  margin-bottom: 48px;
}

.footer-col h4 {
  color: var(--accent);
  margin-bottom: 16px;
  font-size: 1rem;
}

.footer-col ul {
  list-style: none;
}

.footer-col li {
  margin-bottom: 8px;
}

.footer-col a {
  color: var(--bg-paper);
  opacity: 0.8;
  font-size: 0.9rem;
}

.footer-col a:hover {
  opacity: 1;
  text-decoration: underline;
}

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 24px;
  text-align: center;
  font-size: 0.85rem;
  opacity: 0.6;
}

/* --- 时间轴组件 --- */
.timeline {
  position: relative;
  padding-left: 24px;
  border-left: 2px solid var(--brand);
}

.timeline-item {
  position: relative;
  margin-bottom: 40px;
  padding-left: 24px;
}

.timeline-item:last-child {
  margin-bottom: 0;
}

.timeline-dot {
  position: absolute;
  left: -31px;
  top: 4px;
  width: 16px;
  height: 16px;
  background-color: var(--accent);
  border-radius: 50%;
  border: 3px solid var(--bg-paper);
  box-shadow: 0 0 0 1px var(--brand);
}

.dark-section .timeline-dot {
  border-color: var(--bg-dark);
}

.timeline-time {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--brand);
  margin-bottom: 4px;
  display: block;
}

.dark-section .timeline-time {
  color: var(--accent);
}

/* --- FAQ (Details/Summary) --- */
.faq-list details {
  border-bottom: 1px solid rgba(31, 21, 35, 0.1);
  padding: 16px 0;
}

.faq-list summary {
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-main);
}

.faq-list summary::-webkit-details-marker {
  display: none;
}

.faq-list summary::after {
  content: "+";
  font-size: 1.2rem;
  font-weight: 300;
  color: var(--brand);
  transition: transform 0.2s;
}

.faq-list details[open] summary::after {
  transform: rotate(45deg);
}

.faq-list p {
  margin-top: 12px;
  font-size: 0.95rem;
  color: var(--text-muted);
}

/* --- SVG 动效类 --- */
.svg-icon {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

/* 几何旋转拼合动画 */
.anim-rotate {
  animation: rotateShape 12s linear infinite;
  transform-box: fill-box;
  transform-origin: center;
}

.anim-rotate-reverse {
  animation: rotateShapeReverse 15s linear infinite;
  transform-box: fill-box;
  transform-origin: center;
}

@keyframes rotateShape {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes rotateShapeReverse {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(-360deg); }
}

/* 描边绘制动画 */
.anim-draw {
  pathLength: 1;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: drawPath 6s ease-in-out infinite alternate;
}

@keyframes drawPath {
  0%, 100% { stroke-dashoffset: 1; }
  50% { stroke-dashoffset: 0; }
}

/* 浮动呼吸动画 */
.anim-float {
  animation: floatY 4s ease-in-out infinite alternate;
}

@keyframes floatY {
  0% { transform: translateY(0); }
  100% { transform: translateY(-8px); }
}

/* 减少动态效果适配 */
@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;
  }
}

/* --- 图文交错布局 --- */
.split-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
  margin-bottom: 64px;
}

.split-row.reverse {
  direction: rtl; /* 简单实现左右互换 */
}

.split-row.reverse > * {
  direction: ltr; /* 重置内部文本方向 */
}

.visual-panel {
  background-color: var(--bg-dark);
  border-radius: var(--radius-card);
  padding: 32px;
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.dark-section .visual-panel {
  background-color: #1A0B21; /* 比背景更深的颜色作为面板 */
}

.visual-panel svg {
  width: 100%;
  height: auto;
  max-width: 300px;
}

@media (max-width: 768px) {
  .split-row, .split-row.reverse {
    grid-template-columns: 1fr;
    gap: 32px;
    direction: ltr;
  }
  
  .visual-panel {
    order: -1; /* 图片在上方 */
  }
}

/* --- 新闻网格 --- */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--gap);
}

.news-date {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 8px;
  display: block;
}

/* --- 快速开始编号 --- */
.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background-color: var(--accent);
  color: var(--bg-dark);
  font-weight: 700;
  border-radius: 8px;
  margin-right: 12px;
  font-size: 0.9rem;
}

.step-item {
  display: flex;
  margin-bottom: 24px;
}
