/* ========================================
   SafeW 全站共享样式
   ======================================== */

:root {
  /* 色板 */
  --color-dark: #1B1231;
  --color-paper: #DBD4ED;
  --color-text: #191523;
  --color-brand: #5214EB;
  --color-accent: #9977EE;
  --color-accent-subtle: rgba(153, 119, 238, 0.12);
  --color-dark-surface: #2A204A;
  --color-paper-surface: #CFC8E8;

  /* 圆角与边界 */
  --radius-card: 24px;
  --radius-btn: 999px;
  --card-border: 0;
  --card-shadow: none;

  /* 间距与布局 */
  --section-y: clamp(5rem, 10vw, 9rem);
  --gap: clamp(1.5rem, 3vw, 2.5rem);
  --content-max: 960px;
  --header-h: 72px;

  /* 排版 */
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --lh-body: 1.75;
  --lh-title: 1.15;
  --fw-title: 500;
  --fs-body: 16px;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--color-text);
  background-color: var(--color-paper);
  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: clamp(1.5rem, 4vw, 3rem);
}

.section {
  padding-block: var(--section-y);
}

.section__inner {
  display: grid;
  gap: var(--gap);
}

/* 取色上下文覆盖 */
.dark-surface {
  background-color: var(--color-dark);
  color: var(--color-paper);
}
.dark-surface .hl, .dark-surface .eyebrow {
  color: var(--color-accent);
}
.dark-surface a:not(.btn) {
  color: var(--color-accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.paper-surface {
  background-color: var(--color-paper);
  color: var(--color-text);
}
.paper-surface .hl, .paper-surface .eyebrow {
  color: var(--color-brand);
}

/* 卡片背景区分 */
.card--dark { background: var(--color-dark-surface); }
.card--paper { background: var(--color-paper-surface); }

/* ========================================
   排版组件
   ======================================== */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 12px;
}
.eyebrow::before {
  content: "";
  display: inline-block;
  width: 16px;
  height: 2px;
  background-color: currentColor;
  border-radius: 2px;
}

h1 {
  font-size: clamp(2.6rem, 6.4vw, 5rem);
  font-weight: var(--fw-title);
  line-height: var(--lh-title);
  letter-spacing: -0.02em;
  text-wrap: balance;
  margin-bottom: 24px;
}

h2 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: var(--fw-title);
  line-height: var(--lh-title);
  letter-spacing: -0.01em;
  margin-bottom: 24px;
}

h3 {
  font-size: 1.25rem;
  font-weight: var(--fw-title);
  line-height: var(--lh-title);
  margin-top: 24px;
  margin-bottom: 12px;
}

p {
  margin-bottom: 16px;
  max-width: 38em;
}

.hl {
  font-weight: 600;
}

/* ========================================
   按钮
   ======================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 48px;
  padding-inline: 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;
  text-decoration: none;
}
.btn:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 2px;
}
.btn:hover {
  transform: translateY(-1px);
}

.btn--primary {
  background-color: var(--color-accent);
  color: var(--color-dark);
}
.btn--primary:hover {
  background-color: #8A68E0;
}

.btn--outline {
  background: transparent;
  color: var(--color-text);
  border: 1px solid var(--color-text);
}
.dark-surface .btn--outline {
  color: var(--color-paper);
  border-color: var(--color-paper);
}
.btn--outline:hover {
  background: rgba(0,0,0,0.05);
}
.dark-surface .btn--outline:hover {
  background: rgba(255,255,255,0.08);
}

/* ========================================
   页头与页脚
   ======================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  background: rgba(219, 212, 237, 0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(0,0,0,0.06);
}
.dark-surface .site-header {
  background: rgba(27, 18, 49, 0.9);
  border-bottom-color: rgba(255,255,255,0.08);
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.1rem;
}
.brand img {
  width: 28px;
  height: 28px;
}

.nav {
  display: flex;
  align-items: center;
  gap: 24px;
}
.nav a {
  font-size: 0.95rem;
  font-weight: 500;
  padding: 6px 0;
  position: relative;
}
.nav a:hover, .nav a[aria-current="page"] {
  color: var(--color-brand);
}
.dark-surface .nav a:hover, .dark-surface .nav a[aria-current="page"] {
  color: var(--color-accent);
}
.nav a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 100%; height: 2px;
  background: currentColor;
  border-radius: 2px;
}

.site-footer {
  padding-block: 48px;
  border-top: 1px solid rgba(0,0,0,0.08);
  background: var(--color-paper);
}
.dark-surface .site-footer {
  background: var(--color-dark);
  border-top-color: rgba(255,255,255,0.06);
}
.footer__inner {
  display: flex;
  flex-direction: column;
  gap: 24px;
  align-items: center;
  text-align: center;
}
.footer__links {
  display: flex;
  gap: 24px;
  font-size: 0.9rem;
}
.footer__copy {
  font-size: 0.8rem;
  opacity: 0.7;
}

/* ========================================
   列表与表格
   ======================================== */
.dl-grid {
  display: grid;
  gap: 24px;
}
.dl-item dt {
  font-weight: 600;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.dl-item dd {
  margin-left: 28px;
  opacity: 0.9;
}

.table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-block: 24px;
  border-radius: var(--radius-card);
  background: var(--color-paper-surface);
}
.dark-surface .table-wrapper {
  background: var(--color-dark-surface);
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}
.data-table th, .data-table td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid rgba(0,0,0,0.06);
}
.dark-surface .data-table th, .dark-surface .data-table td {
  border-bottom-color: rgba(255,255,255,0.06);
}
.data-table th {
  font-weight: 600;
  background: rgba(0,0,0,0.03);
}
.dark-surface .data-table th {
  background: rgba(255,255,255,0.04);
}
.data-table tr:last-child td {
  border-bottom: none;
}
.data-table a {
  color: var(--color-brand);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.dark-surface .data-table a {
  color: var(--color-accent);
}

/* ========================================
   新闻卡片
   ======================================== */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--gap);
}
.news-card {
  background: var(--color-paper-surface);
  border-radius: var(--radius-card);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.dark-surface .news-card {
  background: var(--color-dark-surface);
}
.news-card h4 {
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1.4;
}
.news-card time {
  font-size: 0.8rem;
  opacity: 0.7;
}
.news-card p {
  font-size: 0.95rem;
  line-height: 1.6;
  margin: 0;
}

/* ========================================
   FAQ
   ======================================== */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
details {
  background: var(--color-paper-surface);
  border-radius: var(--radius-card);
  padding: 20px 24px;
}
.dark-surface details {
  background: var(--color-dark-surface);
}
summary {
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 12px;
}
summary::-webkit-details-marker { display: none; }
summary::before {
  content: "";
  width: 8px; height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform 0.2s ease;
  flex-shrink: 0;
}
details[open] summary::before {
  transform: rotate(-135deg);
}
details p {
  margin-top: 12px;
  margin-bottom: 0;
  font-size: 0.95rem;
  line-height: 1.7;
}

/* ========================================
   SVG 动效系统
   ======================================== */
.svg-panel {
  width: 100%;
  height: auto;
  max-width: 100%;
}
svg {
  overflow: visible;
}

/* 绘制路径 */
.anim-draw {
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: draw-line 3s ease-in-out infinite alternate;
}
@keyframes draw-line {
  0% { stroke-dashoffset: 1; }
  100% { stroke-dashoffset: 0; }
}

/* 呼吸点 */
.anim-breathe {
  animation: breathe 2.5s ease-in-out infinite alternate;
}
@keyframes breathe {
  0% { opacity: 0.4; transform: scale(0.95); }
  100% { opacity: 1; transform: scale(1.05); }
}

/* 层叠漂浮 */
.anim-float {
  animation: float-layer 6s ease-in-out infinite alternate;
}
.anim-float-delay {
  animation: float-layer 6s ease-in-out infinite alternate;
  animation-delay: -2s;
}
@keyframes float-layer {
  0% { transform: translateY(0); }
  100% { transform: translateY(-12px); }
}

/* 限制动画偏好 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    animation: none !important;
  }
}

/* ========================================
   响应式适配
   ======================================== */
@media (max-width: 768px) {
  .nav { display: none; }
  .hero-layout {
    grid-template-columns: 1fr !important;
    text-align: center;
  }
  .hero-layout .svg-panel {
    max-width: 320px;
    margin: 24px auto 0;
  }
  .user-types-grid {
    grid-template-columns: 1fr !important;
  }
  h1 br { display: none; }
}
