/* =========================================
   SafeW 全站共享样式 / Design Tokens & Base
   ========================================= */
:root {
  /* 色板 */
  --color-dark: #19102D;
  --color-paper: #F4F3F7;
  --color-text: #191523;
  --color-brand: #5214EB;
  --color-accent: #D66EED;

  /* 表面层变量覆盖规则 */
  --surface-bg: var(--color-paper);
  --surface-text: var(--color-text);
  --surface-highlight: var(--color-brand);

  /* 结构尺寸 */
  --radius-card: 0;
  --radius-btn: 0;
  --card-border: 2px solid var(--surface-text);
  --card-shadow: 4px 4px 0 var(--surface-text);
  --section-y: clamp(2.5rem, 5vw, 4rem);
  --gap: clamp(0.75rem, 1.5vw, 1.25rem);
  --content-max: 960px;
  --line-height: 1.55;

  /* 字体 */
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* 深色面覆盖 */
.surface-dark {
  --surface-bg: #180f2c;
  --surface-text: var(--color-paper);
  --surface-highlight: var(--color-accent);
}

/* 浅色卡片覆盖（置于深色背景内时使用） */
.card-light {
  --surface-bg: var(--color-paper);
  --surface-text: var(--color-text);
  --surface-highlight: var(--color-brand);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: var(--line-height);
  color: var(--surface-text);
  background-color: var(--surface-bg);
  overflow-x: hidden;
}

img, svg {
  display: block;
  max-width: 100%;
}

a {
  color: var(--surface-highlight);
  text-decoration: none;
  transition: opacity 0.2s ease;
}
a:hover { opacity: 0.85; }
a:focus-visible {
  outline: 2px solid var(--surface-highlight);
  outline-offset: 2px;
}

/* =========================================
   布局系统 / Layout
   ========================================= */
.site-wrapper {
  display: flex;
  min-height: 100vh;
}

/* 桌面端左侧吸顶品牌栏 */
.sidebar {
  width: 280px;
  background: var(--color-dark);
  color: var(--color-paper);
  padding: 2rem;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  display: none;
  flex-direction: column;
  justify-content: space-between;
  z-index: 100;
}
.sidebar .brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 2rem;
}
.sidebar .brand img {
  width: auto;
  height: 32px;
}
.sidebar nav ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.sidebar nav a {
  color: var(--color-paper);
  font-weight: 500;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(244,243,247,0.1);
}
.sidebar nav a[aria-current="page"] {
  color: var(--color-accent);
  border-bottom-color: var(--color-accent);
}

/* 移动端顶部导航 */
.mobile-header {
  background: var(--color-dark);
  color: var(--color-paper);
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 90;
}
.mobile-header .brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
}
.mobile-header .brand img {
  width: auto;
  height: 28px;
}
.mobile-header nav {
  display: flex;
  gap: 1rem;
}
.mobile-header nav a {
  color: var(--color-paper);
  font-size: 0.9rem;
}
.mobile-header nav a[aria-current="page"] {
  color: var(--color-accent);
}

.main-content {
  flex: 1;
  overflow-x: hidden;
}

.section {
  padding: var(--section-y) 1.5rem;
  max-width: var(--content-max);
  margin: 0 auto;
}

.container {
  max-width: var(--content-max);
  margin: 0 auto;
}

/* =========================================
   排版组件 / Typography & Components
   ========================================= */
.micro-label {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--surface-highlight);
  margin-bottom: 0.75rem;
}

h1 {
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: 0.02em;
  color: var(--surface-text);
  margin-bottom: 1rem;
}

h2 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: 0.02em;
  color: var(--surface-text);
  margin-bottom: 1.5rem;
}

h3 {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--surface-text);
  margin-bottom: 0.75rem;
}

p {
  margin-bottom: 1rem;
  max-width: 38em;
}

.hl {
  color: var(--surface-highlight);
  font-weight: 700;
}

/* 按钮 */
.btn-group {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 1.5rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  height: 48px;
  padding: 0 1.25rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius-btn);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  text-decoration: none;
}
.btn:focus-visible {
  outline: 2px solid var(--surface-highlight);
  outline-offset: 2px;
}
.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--color-accent);
  color: var(--color-dark);
  border: none;
}
.btn-primary:hover {
  filter: brightness(0.95);
}

.btn-secondary {
  background: transparent;
  color: var(--surface-text);
  border: 1px solid var(--surface-text);
}
.btn-secondary:hover {
  background: rgba(0,0,0,0.05);
}

/* 卡片 */
.card {
  background: var(--surface-bg);
  border: var(--card-border);
  box-shadow: var(--card-shadow);
  padding: 1.5rem;
  border-radius: var(--radius-card);
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  gap: var(--gap);
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  gap: var(--gap);
}

/* 表格 */
.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;
  border-bottom: 1px solid var(--surface-text);
  text-align: left;
}
.data-table th {
  font-weight: 700;
  background: rgba(0,0,0,0.03);
}
.surface-dark .data-table th {
  background: rgba(255,255,255,0.05);
}

/* 列表与提示 */
ul.styled-list {
  list-style: none;
  padding-left: 0;
}
ul.styled-list li {
  position: relative;
  padding-left: 1.5rem;
  margin-bottom: 0.75rem;
}
ul.styled-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 6px;
  height: 6px;
  background: var(--surface-highlight);
}

.tip-box {
  border-left: 3px solid var(--surface-highlight);
  padding: 1rem 1.25rem;
  background: rgba(0,0,0,0.02);
  margin: 1.5rem 0;
}
.surface-dark .tip-box {
  background: rgba(255,255,255,0.05);
}

/* FAQ */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.faq-item details {
  border: var(--card-border);
  background: var(--surface-bg);
  padding: 1rem 1.25rem;
  cursor: pointer;
}
.faq-item summary {
  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.2rem;
  color: var(--surface-highlight);
}
.faq-item details[open] summary::after {
  content: "-";
}
.faq-item details p {
  margin-top: 0.75rem;
  color: var(--surface-text);
  opacity: 0.9;
}

/* 时间线 */
.timeline {
  position: relative;
  padding-left: 2rem;
  border-left: 2px solid var(--surface-text);
  margin: 1.5rem 0;
}
.timeline-step {
  position: relative;
  margin-bottom: 2rem;
  padding-left: 1rem;
}
.timeline-step::before {
  content: attr(data-step);
  position: absolute;
  left: -2.4rem;
  top: 0;
  width: 2rem;
  height: 2rem;
  background: var(--color-accent);
  color: var(--color-dark);
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
}

/* 新闻网格 */
.news-grid article {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.news-grid time {
  font-size: 0.8rem;
  color: var(--surface-highlight);
  font-weight: 600;
}

/* 场景走查 */
.scenario-card {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 1.5rem;
  align-items: start;
}
@media (max-width: 768px) {
  .scenario-card {
    grid-template-columns: 1fr;
  }
}

/* =========================================
   SVG 动效系统 / Animations
   ========================================= */
.svg-animated {
  width: 100%;
  height: auto;
  overflow: visible;
}

.anim-draw {
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: drawPath 3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.anim-float {
  animation: floatY 4s ease-in-out infinite alternate;
}

.anim-breathe {
  animation: breathe 5s ease-in-out infinite;
}

.anim-slide-in {
  animation: slideIn 1.5s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

@keyframes drawPath {
  0% { stroke-dashoffset: 1; }
  100% { stroke-dashoffset: 0; }
}

@keyframes floatY {
  0% { transform: translateY(0); }
  100% { transform: translateY(-6px); }
}

@keyframes breathe {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.75; }
}

@keyframes slideIn {
  0% { transform: translateX(20px); opacity: 0; }
  100% { transform: translateX(0); opacity: 1; }
}

/* 变换中心控制 */
.transform-center {
  transform-box: fill-box;
  transform-origin: center;
}

/* =========================================
   响应式与无障碍 / Responsive & Reduced Motion
   ========================================= */
@media (min-width: 1024px) {
  .sidebar { display: flex; }
  .mobile-header { display: none; }
  .section { padding-left: 2rem; padding-right: 2rem; }
}

@media (max-width: 1023px) {
  .site-wrapper { flex-direction: column; }
  .main-content { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .anim-draw, .anim-float, .anim-breathe, .anim-slide-in {
    animation: none !important;
  }
}
/* factory-contrast-width */
@media (min-width: 1440px) {
  [data-fc-1440="ink"] {
    color: #191523 !important;
    -webkit-text-fill-color: #191523 !important;
  }
}
@media (min-width: 1440px) {
  [data-fc-1440="ink"] {
    color: #191523 !important;
    -webkit-text-fill-color: #191523 !important;
  }
}
