/* =========================================
   SafeW 全站共享样式 (style.css)
   ========================================= */

/* --- 基础重置与变量 --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  /* 色板 */
  --color-dark-bg: #141838;
  --color-paper: #FCFCFD;
  --color-text: #151723;
  --color-brand: #142CEB;
  --color-accent: #6EAFED;
  
  /* 组件边界 */
  --radius-card: 8px;
  --radius-btn: 6px;
  --card-border: 2px solid var(--color-text);
  --card-shadow: 4px 4px 0 var(--color-text);
  
  /* 节奏与密度 */
  --section-y: clamp(2.5rem, 5vw, 4rem);
  --gap: clamp(0.75rem, 1.5vw, 1.25rem);
  --content-max: 960px;
  
  /* 字体 */
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", sans-serif;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background-color: var(--color-paper);
  color: var(--color-text);
  line-height: 1.55;
  font-size: 16px;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

ul, ol {
  list-style: none;
}

/* --- 布局容器 --- */
.container {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--gap);
}

/* --- 侧边品牌栏 (桌面端) --- */
.brand-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 240px;
  height: 100vh;
  background-color: var(--color-dark-bg);
  color: var(--color-paper);
  display: flex;
  flex-direction: column;
  padding: 2rem 1.5rem;
  z-index: 100;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 2rem;
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}

.brand-logo img {
  width: 32px;
  height: 32px;
}

.brand-nav {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
}

.brand-nav a {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-btn);
  transition: background-color 0.2s ease;
  font-weight: 500;
  font-size: 0.95rem;
}

.brand-nav a:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.brand-nav a[aria-current="page"] {
  background-color: var(--color-accent);
  color: var(--color-dark-bg);
  font-weight: 700;
}

.brand-footer {
  font-size: 0.8rem;
  opacity: 0.6;
  margin-top: auto;
}

/* --- 主内容区 --- */
.main-content {
  margin-left: 240px;
  min-height: 100vh;
  background-color: var(--color-paper);
}

/* --- 移动端顶部导航 --- */
.mobile-header {
  display: none;
  position: sticky;
  top: 0;
  z-index: 90;
  background-color: var(--color-dark-bg);
  color: var(--color-paper);
  padding: 1rem var(--gap);
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.mobile-header .brand-logo {
  font-size: 1.1rem;
  margin: 0;
}

.mobile-menu-btn {
  background: none;
  border: none;
  color: var(--color-paper);
  cursor: pointer;
  padding: 0.5rem;
}

/* --- 区块通用 --- */
.section {
  padding: var(--section-y) 0;
  border-bottom: 1px solid rgba(var(--color-text), 0.08);
}

.section:last-child {
  border-bottom: none;
}

.section-label {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
  color: var(--color-brand);
}

.dark-section .section-label {
  color: var(--color-accent);
}

.section-title {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 1.5rem;
  color: var(--color-text);
}

.dark-section .section-title {
  color: var(--color-paper);
}

.section-title .hl {
  color: var(--color-brand);
}

.dark-section .section-title .hl {
  color: var(--color-accent);
}

.section-desc {
  font-size: 1.1rem;
  line-height: 1.7;
  margin-bottom: 2rem;
  max-width: 65ch;
  color: var(--color-text);
}

.dark-section .section-desc {
  color: var(--color-paper);
}

/* --- 按钮 --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  height: 52px;
  padding: 0 1.5rem;
  border-radius: var(--radius-btn);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
  text-decoration: none;
}

.btn-primary {
  background-color: var(--color-accent);
  color: var(--color-dark-bg);
  border: none;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(110, 175, 237, 0.3);
}

.btn-secondary {
  background-color: transparent;
  color: var(--color-text);
  border: 2px solid var(--color-text);
}

.dark-section .btn-secondary {
  color: var(--color-paper);
  border-color: var(--color-paper);
}

.btn-secondary:hover {
  background-color: rgba(0,0,0,0.05);
}

.dark-section .btn-secondary:hover {
  background-color: rgba(255,255,255,0.1);
}

.btn:focus-visible {
  outline: 3px solid var(--color-brand);
  outline-offset: 2px;
}

.btn svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* --- 卡片 --- */
.card {
  background-color: var(--color-paper);
  border: var(--card-border);
  box-shadow: var(--card-shadow);
  border-radius: var(--radius-card);
  padding: 1.5rem;
  transition: transform 0.2s ease;
}

.card:hover {
  transform: translate(-2px, -2px);
}

/* --- 表格 --- */
.data-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.95rem;
}

.data-table th,
.data-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid rgba(0,0,0,0.1);
}

.data-table th {
  font-weight: 700;
  background-color: rgba(0,0,0,0.03);
  width: 35%;
}

.data-table tr:last-child td {
  border-bottom: none;
}

/* --- FAQ --- */
.faq-item {
  border-bottom: 1px solid rgba(0,0,0,0.1);
  margin-bottom: 1rem;
}

.faq-item summary {
  padding: 1rem 0;
  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.5rem;
  font-weight: 300;
  transition: transform 0.2s ease;
}

.faq-item[open] summary::after {
  transform: rotate(45deg);
}

.faq-item p {
  padding-bottom: 1rem;
  line-height: 1.7;
  color: var(--color-text);
  opacity: 0.85;
}

/* --- 深度专题侧栏 --- */
.spotlight-layout {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 2rem;
}

.spotlight-nav {
  position: sticky;
  top: 2rem;
  border-left: 2px solid rgba(0,0,0,0.1);
  padding-left: 1rem;
}

.spotlight-nav a {
  display: block;
  padding: 0.5rem 0;
  color: var(--color-text);
  opacity: 0.6;
  transition: opacity 0.2s ease;
  font-size: 0.95rem;
}

.spotlight-nav a:hover,
.spotlight-nav a.active {
  opacity: 1;
  color: var(--color-brand);
}

.spotlight-content h3 {
  font-size: 1.4rem;
  font-weight: 700;
  margin: 2rem 0 1rem;
  line-height: 1.2;
}

.spotlight-content p {
  margin-bottom: 1rem;
  line-height: 1.7;
}

/* --- 场景走查 --- */
.scenario-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: center;
}

.scenario-content {
  order: 1;
}

.scenario-visual {
  order: 2;
  background-color: var(--color-dark-bg);
  border-radius: var(--radius-card);
  padding: 2rem;
  display: flex;
  justify-content: center;
  align-items: center;
}

.scenario-visual svg {
  width: 100%;
  max-width: 320px;
  height: auto;
}

/* --- 快速开始时间线 --- */
.timeline {
  position: relative;
  padding-left: 2rem;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background-color: rgba(0,0,0,0.1);
}

.timeline-step {
  position: relative;
  margin-bottom: 2.5rem;
  padding-left: 1.5rem;
}

.timeline-step:last-child {
  margin-bottom: 0;
}

.step-number {
  position: absolute;
  left: -2.35rem;
  top: 0;
  width: 2.5rem;
  height: 2.5rem;
  background-color: var(--color-accent);
  color: var(--color-dark-bg);
  border-radius: var(--radius-btn);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.1rem;
  border: 2px solid var(--color-dark-bg);
}

.step-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.step-desc {
  opacity: 0.85;
  line-height: 1.6;
}

/* --- 资讯卡片网格 --- */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--gap);
}

.news-card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.news-card time {
  font-size: 0.85rem;
  opacity: 0.6;
  font-weight: 500;
}

.news-card h4 {
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.3;
}

.news-card p {
  font-size: 0.95rem;
  line-height: 1.6;
  opacity: 0.85;
}

/* --- 响应式适配 --- */
@media (max-width: 768px) {
  .brand-sidebar {
    display: none;
  }
  
  .mobile-header {
    display: flex;
  }
  
  .main-content {
    margin-left: 0;
  }
  
  .spotlight-layout {
    grid-template-columns: 1fr;
  }
  
  .spotlight-nav {
    position: static;
    border-left: none;
    border-bottom: 2px solid rgba(0,0,0,0.1);
    padding-left: 0;
    padding-bottom: 1rem;
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    white-space: nowrap;
    margin-bottom: 1.5rem;
  }
  
  .scenario-row {
    grid-template-columns: 1fr;
  }
  
  .scenario-content {
    order: 2;
  }
  
  .scenario-visual {
    order: 1;
  }
}

/* --- SVG 动效 --- */
@keyframes drawStroke {
  from { stroke-dashoffset: 1; }
  to { stroke-dashoffset: 0; }
}

@keyframes breathe {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.02); opacity: 0.85; }
}

@keyframes floatUp {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

@keyframes slideInRight {
  from { transform: translateX(20px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.svg-draw {
  pathLength: 1;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: drawStroke 2s ease forwards, breathe 4s ease-in-out infinite 2s;
}

.svg-breathe {
  transform-box: fill-box;
  transform-origin: center;
  animation: breathe 5s ease-in-out infinite;
}

.svg-float {
  animation: floatUp 3s ease-in-out infinite;
}

.svg-slide {
  animation: slideInRight 1.5s ease forwards;
}

svg {
  width: 100%;
  height: auto;
}

/* --- 减少动态效果偏好 --- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
