/* =========================================
   SafeW 全站共享样式
   ========================================= */

/* --- 设计变量 --- */
:root {
  /* 色板 */
  --bg-dark: #21163C;
  --bg-paper: #E9E8EA;
  --text-body: #191523;
  --brand: #5214EB;
  --accent: #ED926E;

  /* 结构 Token */
  --radius-card: 20px;
  --radius-btn: 12px;
  --card-border: 1px solid rgba(25, 21, 35, 0.16);
  --card-shadow: none;
  --section-y: clamp(2.5rem, 5vw, 4rem);
  --gap: clamp(0.75rem, 1.5vw, 1.25rem);
  --content-max: 1120px;

  /* 排版 */
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
}

/* --- 基础重置 --- */
*, *::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: 1.55;
  color: var(--text-body);
  background-color: var(--bg-paper);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
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);
  position: relative;
}
.section--paper { background-color: var(--bg-paper); }
.section--dark {
  background-color: var(--bg-dark);
  color: #E9E8EA; /* 深色面默认纸面色正文 */
}
.section--dark .hl { color: var(--accent); }
.section--dark .meta-tag { color: var(--accent); }
.section--dark a:not(.btn) { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }

/* --- 排版层级 --- */
h1, h2, h3, h4 { font-weight: 500; line-height: 1.15; letter-spacing: -0.01em; }
h1 { font-size: clamp(2.6rem, 6.4vw, 5rem); margin-bottom: var(--gap); }
h2 { font-size: clamp(1.8rem, 3.5vw, 2.8rem); margin-bottom: calc(var(--gap) * 1.5); }
h3 { font-size: clamp(1.3rem, 2vw, 1.6rem); margin-bottom: var(--gap); }
p { margin-bottom: var(--gap); max-width: 38em; }
.text-center { text-align: center; }
.w-full { max-width: 100%; }
.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  gap: var(--gap);
}
.flex-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--gap); }
.flex-col { display: flex; flex-direction: column; gap: var(--gap); }

/* --- 眉标与高亮 --- */
.meta-tag {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
  color: var(--brand);
}
.hl { color: var(--brand); }
.section--dark .hl { color: var(--accent); }

/* --- 按钮组件 --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 52px;
  padding: 0 24px;
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius-btn);
  cursor: pointer;
  transition: transform 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
  border: none;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.btn--primary {
  background-color: var(--accent);
  color: var(--bg-dark);
}
.btn--primary:hover { background-color: #D97A56; }
.btn--secondary {
  background: transparent;
  color: var(--text-body);
  border: 1px solid var(--text-body);
}
.section--dark .btn--secondary {
  color: #E9E8EA;
  border-color: #E9E8EA;
}
.btn svg { width: 20px; height: 20px; flex-shrink: 0; }

/* --- 卡片与面板 --- */
.card {
  background: #FFFFFF;
  border: var(--card-border);
  border-radius: var(--radius-card);
  box-shadow: var(--card-shadow);
  padding: 24px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.05); }
.panel-dark {
  background-color: #2B1F4D;
  border-radius: var(--radius-card);
  padding: 24px;
  color: #E9E8EA;
}
.panel-brand {
  background-color: var(--brand);
  border-radius: var(--radius-card);
  padding: 24px;
  color: #FFFFFF;
}

/* --- 表格 --- */
.table-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}
.data-table th, .data-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid rgba(25, 21, 35, 0.1);
}
.data-table th { font-weight: 600; color: var(--text-body); }
.section--dark .data-table th { color: #E9E8EA; border-bottom-color: rgba(233, 232, 234, 0.15); }
.section--dark .data-table td { color: #E9E8EA; border-bottom-color: rgba(233, 232, 234, 0.15); }

/* --- 定义列表 (功能项) --- */
.dl-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--gap);
}
.dl-item {
  padding: 20px;
  border: var(--card-border);
  border-radius: var(--radius-card);
  background: #FFFFFF;
}
.section--dark .dl-item { background: #2B1F4D; border-color: rgba(233, 232, 234, 0.1); }
.dl-item dt {
  font-weight: 700;
  font-size: 1.05rem;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.dl-item dd { font-size: 0.95rem; color: inherit; opacity: 0.85; line-height: 1.6; }

/* --- 步骤编号徽标 --- */
.step-list { counter-reset: step; }
.step-item {
  display: flex;
  gap: 16px;
  margin-bottom: var(--gap);
  align-items: flex-start;
}
.step-num {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  background: var(--accent);
  color: var(--bg-dark);
  font-weight: 800;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
}

/* --- FAQ (Details/Summary) --- */
.faq-list { display: flex; flex-direction: column; gap: 12px; }
details {
  border: var(--card-border);
  border-radius: var(--radius-card);
  background: #FFFFFF;
  overflow: hidden;
}
.section--dark details { background: #2B1F4D; border-color: rgba(233, 232, 234, 0.1); }
summary {
  padding: 16px 20px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
summary::-webkit-details-marker { display: none; }
summary::after {
  content: "+";
  font-size: 1.2rem;
  font-weight: 400;
  transition: transform 0.2s ease;
}
details[open] summary::after { transform: rotate(45deg); }
details[open] summary { border-bottom: 1px solid rgba(0,0,0,0.05); }
.section--dark details[open] summary { border-bottom-color: rgba(233, 232, 234, 0.1); }
.faq-answer { padding: 16px 20px; font-size: 0.95rem; line-height: 1.65; color: inherit; opacity: 0.9; }

/* --- 时间轴 --- */
.timeline {
  position: relative;
  padding-left: 24px;
  border-left: 2px solid rgba(82, 20, 235, 0.2);
}
.section--dark .timeline { border-left-color: rgba(237, 146, 110, 0.3); }
.timeline-item { position: relative; margin-bottom: var(--gap); padding-left: 16px; }
.timeline-item::before {
  content: "";
  position: absolute;
  left: -29px;
  top: 6px;
  width: 10px;
  height: 10px;
  background: var(--brand);
  border-radius: 50%;
  border: 2px solid var(--bg-paper);
}
.section--dark .timeline-item::before { background: var(--accent); border-color: var(--bg-dark); }
.timeline-time { font-size: 0.85rem; font-weight: 700; color: var(--brand); margin-bottom: 4px; }
.section--dark .timeline-time { color: var(--accent); }

/* --- 新闻卡片 --- */
.news-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: var(--gap); }
.news-card { display: flex; flex-direction: column; }
.news-date { font-size: 0.8rem; color: var(--brand); font-weight: 600; margin-bottom: 8px; }
.section--dark .news-date { color: var(--accent); }
.news-title { font-weight: 700; font-size: 1.1rem; margin-bottom: 8px; line-height: 1.4; }
.news-excerpt { font-size: 0.95rem; opacity: 0.85; line-height: 1.6; }

/* --- 页头页脚 --- */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(233, 232, 234, 0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(0,0,0,0.05);
}
.section--dark ~ .header { background: rgba(33, 22, 60, 0.95); border-bottom-color: rgba(233, 232, 234, 0.1); }
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.logo-group { display: flex; align-items: center; gap: 10px; }
.logo-img { width: 32px; height: 32px; object-fit: contain; }
.brand-name { font-weight: 800; font-size: 1.1rem; letter-spacing: -0.02em; }
.nav-links { display: flex; gap: 24px; align-items: center; }
.nav-links a { font-weight: 500; font-size: 0.95rem; opacity: 0.8; transition: opacity 0.2s; }
.nav-links a:hover, .nav-links a[aria-current="page"] { opacity: 1; color: var(--brand); }
.section--dark .nav-links a { color: #E9E8EA; }
.section--dark .nav-links a:hover, .section--dark .nav-links a[aria-current="page"] { color: var(--accent); }
.footer {
  background: var(--bg-dark);
  color: #E9E8EA;
  padding: 48px 0 24px;
  font-size: 0.9rem;
}
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 32px; margin-bottom: 32px; }
.footer-col h4 { font-weight: 700; margin-bottom: 16px; color: #FFFFFF; }
.footer-col a { display: block; margin-bottom: 10px; opacity: 0.75; transition: opacity 0.2s; }
.footer-col a:hover { opacity: 1; color: var(--accent); }
.footer-bottom { border-top: 1px solid rgba(233, 232, 234, 0.1); padding-top: 24px; text-align: center; opacity: 0.6; font-size: 0.85rem; }

/* --- SVG 动效关键帧 --- */
@keyframes drawPath {
  0% { stroke-dashoffset: 1; }
  100% { stroke-dashoffset: 0; }
}
@keyframes floatSoft {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
@keyframes breatheDot {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}
@keyframes slideInRight {
  0% { transform: translateX(20px); opacity: 0; }
  100% { transform: translateX(0); opacity: 1; }
}
@keyframes pulseGlow {
  0%, 100% { filter: drop-shadow(0 0 2px rgba(237, 146, 110, 0.2)); }
  50% { filter: drop-shadow(0 0 6px rgba(237, 146, 110, 0.5)); }
}

.draw-line {
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: drawPath 4s ease-in-out infinite alternate;
}
.float-layer {
  animation: floatSoft 6s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: center;
}
.breath-dot {
  animation: breatheDot 2.5s ease-in-out infinite;
}
.slide-up {
  animation: slideInRight 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.pulse-accent {
  animation: pulseGlow 4s ease-in-out infinite;
}

/* --- 响应式与无障碍 --- */
@media (max-width: 768px) {
  .nav-links { display: none; }
  h1 { font-size: clamp(2rem, 8vw, 3.2rem); }
  .hero-layout { flex-direction: column; }
  .hero-visual { order: -1; margin-top: 24px; }
  .grid-2 { grid-template-columns: 1fr; }
  .news-grid { grid-template-columns: 1fr; }
}
@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-line, .float-layer, .breath-dot, .slide-up, .pulse-accent {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}

/* 兜底：裁掉横向溢出 */
body > * {
  overflow-x: clip;
}
