/* =========================================
   SafeW 全局样式与设计系统
   ========================================= */
:root {
  /* 色板 */
  --color-dark: #2D1438;
  --color-paper: #F6F3F7;
  --color-body: #1F1523;
  --color-brand: #9E13DD;
  --color-accent: #6EEDA8;

  /* 结构变量 */
  --radius-card: 20px;
  --radius-btn: 12px;
  --card-border: 0;
  --card-shadow: 0 10px 28px -14px rgba(31, 21, 35, 0.3);
  --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, sans-serif;
  --text-base: 1rem;
  --line-height-body: 1.55;
}

*, *::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);
  background-color: var(--color-paper);
  color: var(--color-body);
  line-height: var(--line-height-body);
  font-size: var(--text-base);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  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);
}

.section--dark {
  background-color: var(--color-dark);
  color: var(--color-paper);
}

.section--paper {
  background-color: var(--color-paper);
  color: var(--color-body);
}

.grid {
  display: grid;
  gap: var(--gap);
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
}

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* =========================================
   排版组件
   ========================================= */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.75em;
}

.section--paper .eyebrow { color: var(--color-brand); }
.section--dark .eyebrow { color: var(--color-accent); }

h1 {
  font-size: clamp(2.6rem, 6.4vw, 5rem);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.02em;
  text-wrap: balance;
  margin-bottom: 1em;
}

h2 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: -0.01em;
  text-wrap: balance;
  margin-bottom: 1.5em;
}

h3 {
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 0.75em;
}

p {
  margin-bottom: 1em;
  max-width: 38em;
}

.hl {
  font-weight: 600;
}
.section--paper .hl { color: var(--color-brand); }
.section--dark .hl { color: var(--color-accent); }

/* 提示框 */
.callout {
  border-left: 3px solid var(--color-brand);
  padding: 1em 1.25em;
  background: rgba(158, 19, 221, 0.06);
  border-radius: 0 var(--radius-card) var(--radius-card) 0;
  margin: 1.5em 0;
  font-size: 0.95rem;
}
.section--dark .callout {
  border-color: var(--color-accent);
  background: rgba(110, 237, 168, 0.08);
}

/* =========================================
   按钮
   ========================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6em;
  height: 52px;
  padding-inline: 1.5em;
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius-btn);
  cursor: pointer;
  transition: transform 0.2s ease, filter 0.2s ease;
  border: none;
  white-space: nowrap;
}

.btn:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 2px;
}

.btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

.btn-primary {
  background-color: var(--color-accent);
  color: var(--color-dark);
}

.btn-secondary {
  background: transparent;
  border: 1px solid var(--color-body);
  color: var(--color-body);
}
.section--dark .btn-secondary {
  border-color: var(--color-paper);
  color: var(--color-paper);
}

/* =========================================
   卡片与网格
   ========================================= */
.card {
  background: var(--color-paper);
  border: var(--card-border);
  box-shadow: var(--card-shadow);
  border-radius: var(--radius-card);
  padding: 1.5em;
  transition: box-shadow 0.2s ease;
}
.section--dark .card {
  background: var(--color-dark);
  box-shadow: none;
  border: 1px solid rgba(246, 243, 247, 0.15);
}
.card:hover {
  box-shadow: 0 12px 32px -12px rgba(31, 21, 35, 0.35);
}

.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
  gap: var(--gap);
}

/* =========================================
   表格
   ========================================= */
.table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-card);
  border: 1px solid rgba(31, 21, 35, 0.1);
}
.table-wrapper table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}
.table-wrapper th, .table-wrapper td {
  padding: 0.8em 1em;
  text-align: left;
  border-bottom: 1px solid rgba(31, 21, 35, 0.08);
}
.table-wrapper th {
  font-weight: 600;
  background: rgba(31, 21, 35, 0.03);
}
.section--dark .table-wrapper {
  border-color: rgba(246, 243, 247, 0.15);
}
.section--dark .table-wrapper th, .section--dark .table-wrapper td {
  border-color: rgba(246, 243, 247, 0.1);
}

/* =========================================
   列表
   ========================================= */
.check-list li {
  position: relative;
  padding-left: 1.8em;
  margin-bottom: 0.75em;
}
.check-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.4em;
  width: 0.6em;
  height: 0.6em;
  border-radius: 2px;
  background: var(--color-brand);
}
.section--dark .check-list li::before {
  background: var(--color-accent);
}

/* =========================================
   FAQ
   ========================================= */
.faq-item {
  border-bottom: 1px solid rgba(31, 21, 35, 0.1);
}
.section--dark .faq-item {
  border-color: rgba(246, 243, 247, 0.15);
}
.faq-item summary {
  padding: 1.2em 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-weight: 400;
  opacity: 0.6;
}
.faq-item[open] summary::after { content: "-"; }
.faq-item p {
  padding-bottom: 1.2em;
  color: inherit;
  opacity: 0.9;
}

/* =========================================
   导航与页头
   ========================================= */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(246, 243, 247, 0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(31, 21, 35, 0.06);
}
.section--dark .header {
  background: rgba(45, 20, 56, 0.9);
  border-color: rgba(246, 243, 247, 0.1);
}
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.logo-group {
  display: flex;
  align-items: center;
  gap: 0.6em;
}
.logo-group img {
  height: 28px;
  width: auto;
}
.nav-links {
  display: flex;
  gap: 1.5em;
}
.nav-links a {
  font-size: 0.95rem;
  font-weight: 500;
  opacity: 0.85;
  transition: opacity 0.2s;
}
.nav-links a:hover, .nav-links [aria-current="page"] {
  opacity: 1;
  color: var(--color-brand);
}
.section--dark .nav-links a { color: var(--color-paper); }
.section--dark .nav-links a:hover, .section--dark .nav-links [aria-current="page"] { color: var(--color-accent); }

.mobile-toggle {
  display: none;
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
}

/* =========================================
   页脚
   ========================================= */
.footer {
  padding-block: 3em;
  border-top: 1px solid rgba(31, 21, 35, 0.08);
  font-size: 0.9rem;
  opacity: 0.8;
}
.section--dark .footer {
  border-color: rgba(246, 243, 247, 0.1);
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--gap);
  margin-bottom: 2em;
}
.footer-col h4 {
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 0.8em;
  opacity: 0.7;
}
.footer-col a {
  display: block;
  margin-bottom: 0.5em;
  opacity: 0.85;
}
.footer-col a:hover { opacity: 1; }
.footer-bottom {
  text-align: center;
  opacity: 0.6;
}

/* =========================================
   SVG 动效与类名
   ========================================= */
.svg-container {
  width: 100%;
  height: auto;
}
.svg-container svg {
  width: 100%;
  height: auto;
}

/* 同心轨道呼吸 */
.orbit-ring {
  animation: orbitBreathe 6s ease-in-out infinite alternate;
  transform-box: fill-box;
  transform-origin: center;
}
.orbit-ring:nth-child(2) { animation-duration: 7.5s; animation-delay: -1s; }
.orbit-ring:nth-child(3) { animation-duration: 9s; animation-delay: -2.5s; }

@keyframes orbitBreathe {
  from { opacity: 0.3; transform: scale(0.96); }
  to { opacity: 0.8; transform: scale(1.04); }
}

/* 描边绘制 */
.draw-line {
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: drawPath 3s ease forwards;
}
@keyframes drawPath {
  from { stroke-dashoffset: 1; }
  to { stroke-dashoffset: 0; }
}

/* 气泡浮入 */
.bubble-float {
  animation: bubbleIn 4s ease-in-out infinite alternate;
}
@keyframes bubbleIn {
  0%, 100% { transform: translateY(0); opacity: 0.85; }
  50% { transform: translateY(-6px); opacity: 1; }
}

/* 输入点呼吸 */
.input-dot {
  animation: dotPulse 2s ease-in-out infinite;
}
.input-dot:nth-child(2) { animation-delay: 0.3s; }
.input-dot:nth-child(3) { animation-delay: 0.6s; }
@keyframes dotPulse {
  0%, 100% { opacity: 0.4; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1.1); }
}

/* 通知滑入 */
.notify-slide {
  animation: slideIn 5s ease-in-out infinite alternate;
}
@keyframes slideIn {
  0%, 100% { transform: translateX(0); opacity: 0.9; }
  50% { transform: translateX(4px); opacity: 1; }
}

/* 减少动态效果 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .orbit-ring, .draw-line, .bubble-float, .input-dot, .notify-slide {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}

/* =========================================
   响应式适配
   ========================================= */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .mobile-toggle { display: block; }
  .hero-layout { flex-direction: column-reverse !important; }
  .feature-row { flex-direction: column !important; }
  h1 { font-size: clamp(2.2rem, 8vw, 3.2rem); }
  .section { padding-block: var(--section-y); }
}
