/* 
 * SafeW 全站共享样式
 * 设计系统：蓝紫深底 + 翠绿强调 · 纯白纸面
 */

:root {
  /* 色板 */
  --color-dark: #140E25;
  --color-paper: #FCFCFD;
  --color-text: #191523;
  --color-brand: #5214EB;
  --color-accent: #6EEDD2;
  
  /* 结构性 Token */
  --radius-card: 8px;
  --radius-btn: 6px;
  --card-border: 0;
  --card-shadow: none;
  --section-y: clamp(3.5rem, 7vw, 6rem);
  --gap: clamp(1rem, 2vw, 1.75rem);
  --content-max: 960px;
  
  /* 字体 */
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", 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.65;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

img, svg {
  display: block;
  max-width: 100%;
}

a {
  text-decoration: none;
  color: inherit;
}

ul, ol {
  list-style: none;
}

/* 通用容器 */
.container {
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--gap);
}

/* 页头 */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: rgba(252, 252, 253, 0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(25, 21, 35, 0.08);
  padding: 16px 0;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--color-text);
}

.brand img {
  height: 32px;
  width: auto;
}

.nav-list {
  display: flex;
  gap: 24px;
  align-items: center;
}

.nav-link {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--color-text);
  transition: color 0.2s;
}

.nav-link:hover, .nav-link[aria-current="page"] {
  color: var(--color-brand);
}

.btn-header {
  background-color: var(--color-brand);
  color: #fff;
  padding: 8px 16px;
  border-radius: var(--radius-btn);
  font-size: 0.9rem;
  font-weight: 600;
  transition: transform 0.2s, background-color 0.2s;
}

.btn-header:hover {
  transform: translateY(-1px);
  filter: brightness(1.1);
}

/* 页脚 */
.site-footer {
  background-color: var(--color-dark);
  color: var(--color-paper);
  padding: 64px 0 32px;
  margin-top: var(--section-y);
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 48px;
  margin-bottom: 48px;
}

.footer-col h4 {
  color: var(--color-accent);
  font-size: 1rem;
  margin-bottom: 16px;
}

.footer-col ul li {
  margin-bottom: 12px;
}

.footer-col a {
  color: rgba(252, 252, 253, 0.7);
  font-size: 0.9rem;
  transition: color 0.2s;
}

.footer-col a:hover {
  color: var(--color-accent);
}

.footer-bottom {
  border-top: 1px solid rgba(252, 252, 253, 0.1);
  padding-top: 32px;
  text-align: center;
  font-size: 0.85rem;
  color: rgba(252, 252, 253, 0.5);
}

/* 区块通用 */
.section {
  padding-top: var(--section-y);
  padding-bottom: var(--section-y);
}

.section-dark {
  background-color: var(--color-dark);
  color: var(--color-paper);
}

.section-header {
  margin-bottom: 48px;
}

.breadcrumb {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--color-brand);
  margin-bottom: 12px;
  display: block;
}

.section-dark .breadcrumb {
  color: var(--color-accent);
}

h1 {
  font-size: clamp(2.6rem, 6.4vw, 5rem);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 24px;
  text-wrap: balance;
}

h2 {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin-bottom: 16px;
  text-wrap: balance;
}

h3 {
  font-size: 1.4rem;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 12px;
}

p {
  margin-bottom: 1.5em;
  max-width: 70ch;
}

.hl {
  color: var(--color-brand);
}

.section-dark .hl {
  color: var(--color-accent);
}

/* 按钮 */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background-color: var(--color-brand);
  color: #fff;
  padding: 14px 28px;
  border-radius: var(--radius-btn);
  font-size: 1rem;
  font-weight: 600;
  transition: transform 0.2s, filter 0.2s;
  border: none;
  cursor: pointer;
}

.btn-primary:hover {
  transform: translateY(-2px);
  filter: brightness(1.1);
}

.btn-primary:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background-color: transparent;
  color: var(--color-text);
  border: 1px solid rgba(25, 21, 35, 0.2);
  padding: 14px 28px;
  border-radius: var(--radius-btn);
  font-size: 1rem;
  font-weight: 600;
  transition: border-color 0.2s, color 0.2s;
  cursor: pointer;
}

.btn-secondary:hover {
  border-color: var(--color-text);
  color: var(--color-text);
}

.section-dark .btn-secondary {
  color: var(--color-paper);
  border-color: rgba(252, 252, 253, 0.3);
}

.section-dark .btn-secondary:hover {
  border-color: var(--color-paper);
}

.btn-icon {
  width: 20px;
  height: 20px;
  stroke-width: 2;
}

/* Hero 特殊样式 */
.hero-section {
  background-color: var(--color-dark);
  color: var(--color-paper);
  padding-top: calc(var(--section-y) + 40px);
  padding-bottom: calc(var(--section-y) + 40px);
  overflow: hidden;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
}

.hero-content p.lead {
  font-size: 1.15rem;
  line-height: 1.6;
  color: rgba(252, 252, 253, 0.85);
  margin-bottom: 32px;
  max-width: 540px;
}

.hero-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.hero-fact {
  margin-top: 24px;
  font-size: 0.85rem;
  color: rgba(252, 252, 253, 0.5);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* 深度专题 (杂志排版) */
.deep-dive-layout {
  display: grid;
  grid-template-columns: 1fr 240px;
  gap: 48px;
}

.toc-nav {
  position: sticky;
  top: 100px;
  font-size: 0.9rem;
  border-left: 1px solid rgba(25, 21, 35, 0.1);
  padding-left: 16px;
}

.toc-nav ul {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.toc-nav a {
  color: var(--color-text);
  opacity: 0.6;
  transition: opacity 0.2s;
}

.toc-nav a:hover {
  opacity: 1;
  color: var(--color-brand);
}

/* 功能列表 */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 32px;
}

.feature-item {
  background-color: rgba(25, 21, 35, 0.03);
  padding: 24px;
  border-radius: var(--radius-card);
  border: var(--card-border);
}

.feature-title {
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 8px;
  color: var(--color-text);
}

.feature-desc {
  font-size: 0.95rem;
  color: rgba(25, 21, 35, 0.8);
  line-height: 1.6;
}

/* 场景卡片 */
.scenario-card {
  background-color: var(--color-paper);
  border: 1px solid rgba(25, 21, 35, 0.08);
  border-radius: var(--radius-card);
  padding: 32px;
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.scenario-tag {
  display: inline-block;
  background-color: rgba(82, 20, 235, 0.1);
  color: var(--color-brand);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 700;
  width: fit-content;
}

.scenario-step {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.step-num {
  font-weight: 800;
  color: var(--color-accent);
  background-color: var(--color-brand);
  width: 24px;
  height: 24px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  flex-shrink: 0;
}

/* 资讯卡片 */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.news-card {
  background-color: rgba(25, 21, 35, 0.05);
  padding: 24px;
  border-radius: var(--radius-card);
  display: flex;
  flex-direction: column;
  height: 100%;
}

.news-date {
  font-size: 0.8rem;
  color: rgba(25, 21, 35, 0.5);
  margin-bottom: 12px;
}

.news-card h4 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 12px;
  line-height: 1.4;
}

.news-card p {
  font-size: 0.95rem;
  color: rgba(25, 21, 35, 0.8);
  margin-bottom: 0;
}

/* 表格 */
.platform-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  margin-bottom: 32px;
  table-layout: fixed;
  box-sizing: border-box;
}

.platform-table th, .platform-table td {
  text-align: left;
  padding: 16px;
  border-bottom: 1px solid rgba(25, 21, 35, 0.1);
}

.platform-table th {
  font-weight: 700;
  color: var(--color-text);
  background-color: rgba(25, 21, 35, 0.03);
}

.platform-table tr:last-child td {
  border-bottom: none;
}

/* FAQ */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.faq-item {
  border: 1px solid rgba(25, 21, 35, 0.08);
  border-radius: var(--radius-card);
  overflow: hidden;
}

.faq-summary {
  padding: 20px 24px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #fff;
}

.faq-summary::-webkit-details-marker {
  display: none;
}

.faq-summary::after {
  content: "+";
  font-size: 1.2rem;
  color: var(--color-brand);
  transition: transform 0.2s;
}

.faq-item[open] .faq-summary::after {
  transform: rotate(45deg);
}

.faq-answer {
  padding: 0 24px 24px;
  font-size: 0.95rem;
  color: rgba(25, 21, 35, 0.8);
  line-height: 1.7;
}

/* SVG 动效 */
.svg-anim-container {
  width: 100%;
  height: auto;
  overflow: visible;
}

.draw-path {
  pathLength: 1;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: drawFlow 4s ease-in-out infinite alternate;
}

.float-element {
  animation: floatUp 6s ease-in-out infinite alternate;
}

.pulse-dot {
  animation: pulseDot 3s ease-in-out infinite;
}

@keyframes drawFlow {
  0% { stroke-dashoffset: 1; }
  100% { stroke-dashoffset: 0; }
}

@keyframes floatUp {
  0% { transform: translateY(0); }
  100% { transform: translateY(-10px); }
}

@keyframes pulseDot {
  0%, 100% { opacity: 0.4; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.2); }
}

/* 减少动态效果 */
@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-path, .float-element, .pulse-dot {
    animation: none;
  }
}

/* 响应式 */
@media (max-width: 768px) {
  .hero-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }
  
  .hero-content p.lead {
    margin-left: auto;
    margin-right: auto;
  }
  
  .hero-actions {
    justify-content: center;
  }
  
  .deep-dive-layout {
    grid-template-columns: 1fr;
  }
  
  .toc-nav {
    display: none;
  }
  
  .nav-list {
    display: none;
  }
}
