/* ========================================
   SafeW 全站共享样式
   ======================================== */

/* --- 设计变量 --- */
:root {
  /* 色板 */
  --color-dark-bg: #271231;
  --color-paper: #F6F3F7;
  --color-body-text: #1F1523;
  --color-brand: #9E13DD;
  --color-accent: #ED6EC0;

  /* 圆角 */
  --radius-card: 0;
  --radius-btn: 0;

  /* 卡片边界 */
  --card-border: 1px solid rgba(31, 21, 35, 0.16);
  --card-shadow: none;

  /* 节奏与密度 */
  --section-y: clamp(3.5rem, 7vw, 6rem);
  --gap: clamp(1rem, 2vw, 1.75rem);

  /* 内容最大宽度 */
  --content-max: 1120px;

  /* 标题处理 */
  --heading-weight: 600;
  --heading-letter-spacing: 0;
  --heading-line-height: 1.25;

  /* 正文行高 */
  --body-line-height: 1.65;

  /* 按钮尺寸 */
  --btn-height: 52px;
}

/* --- 重置与基础 --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 16px;
  line-height: var(--body-line-height);
  color: var(--color-body-text);
  background-color: var(--color-paper);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img, svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

ul, ol {
  list-style: none;
}

/* --- 容器 --- */
.container {
  max-width: var(--content-max);
  margin: 0 auto;
  padding-left: var(--gap);
  padding-right: var(--gap);
}

/* --- 区块通用 --- */
.section {
  padding-top: var(--section-y);
  padding-bottom: var(--section-y);
}

.section--dark {
  background-color: var(--color-dark-bg);
  color: var(--color-paper);
}

.section--paper-light {
  background-color: #EDE8EF;
}

/* --- 眉标 --- */
.breadcrumb-label {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  margin-bottom: 0.75rem;
  color: var(--color-brand);
}

.section--dark .breadcrumb-label {
  color: var(--color-accent);
}

/* --- 标题 --- */
h1, h2, h3, h4 {
  font-weight: var(--heading-weight);
  letter-spacing: var(--heading-letter-spacing);
  line-height: var(--heading-line-height);
}

h1 {
  font-size: clamp(2rem, 4.6vw, 3.4rem);
}

h2 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
}

h3 {
  font-size: clamp(1.2rem, 2vw, 1.5rem);
}

/* 高亮关键词 */
.hl {
  color: var(--color-brand);
}

.section--dark .hl {
  color: var(--color-accent);
}

/* --- 正文 --- */
p {
  max-width: 38em;
}

/* --- 按钮 --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  height: var(--btn-height);
  padding: 0 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: transform 0.2s ease, opacity 0.2s ease;
  text-decoration: none;
}

.btn--primary {
  background-color: var(--color-accent);
  color: var(--color-dark-bg);
}

.btn--primary:hover {
  transform: translateY(-2px);
  opacity: 0.9;
}

.btn--secondary {
  background: transparent;
  border: 1px solid currentColor;
  color: var(--color-body-text);
}

.section--dark .btn--secondary {
  color: var(--color-paper);
}

.btn--secondary:hover {
  transform: translateY(-2px);
  opacity: 0.85;
}

.btn:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
}

/* --- 图标 --- */
.icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* --- 卡片 --- */
.card {
  background-color: var(--color-paper);
  border: var(--card-border);
  box-shadow: var(--card-shadow);
  padding: 1.5rem;
  transition: transform 0.2s ease;
}

.section--dark .card {
  background-color: #3A1D4A;
  border-color: rgba(246, 243, 247, 0.12);
  color: var(--color-paper);
}

.card:hover {
  transform: translateY(-2px);
}

/* --- 表格 --- */
.table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

th, td {
  text-align: left;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(31, 21, 35, 0.1);
}

th {
  font-weight: 700;
  color: var(--color-brand);
}

.section--dark th {
  color: var(--color-accent);
}

td:first-child {
  font-weight: 600;
  white-space: nowrap;
}

/* --- FAQ --- */
.faq-item {
  border-bottom: 1px solid rgba(31, 21, 35, 0.1);
}

.faq-item:last-child {
  border-bottom: none;
}

.faq-item summary {
  padding: 1rem 0;
  cursor: pointer;
  font-weight: 600;
  font-size: 1.05rem;
  list-style: none;
  position: relative;
  padding-right: 2rem;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.2rem;
  font-weight: 400;
  transition: transform 0.2s ease;
}

.faq-item[open] summary::after {
  content: "−";
}

.faq-item summary:hover {
  color: var(--color-brand);
}

.faq-item .faq-answer {
  padding-bottom: 1rem;
  line-height: var(--body-line-height);
}

/* --- 页头 --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: var(--color-paper);
  border-bottom: 1px solid rgba(31, 21, 35, 0.08);
  transition: box-shadow 0.3s ease;
}

.site-header.scrolled {
  box-shadow: 0 2px 8px rgba(31, 21, 35, 0.08);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 1.1rem;
}

.logo img {
  height: 32px;
  width: auto;
}

.nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav a {
  font-size: 0.95rem;
  font-weight: 500;
  padding: 0.25rem 0;
  position: relative;
  transition: color 0.2s ease;
}

.nav a:hover {
  color: var(--color-brand);
}

.nav a[aria-current="page"] {
  color: var(--color-brand);
  font-weight: 700;
}

.nav .btn--primary {
  height: 40px;
  font-size: 0.9rem;
  padding: 0 1.25rem;
}

/* --- 页脚 --- */
.site-footer {
  background-color: var(--color-dark-bg);
  color: var(--color-paper);
  padding: 3rem 0 2rem;
}

.footer-inner {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--gap);
}

.footer-col h4 {
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--color-accent);
}

.footer-col a {
  display: block;
  font-size: 0.9rem;
  padding: 0.3rem 0;
  opacity: 0.8;
  transition: opacity 0.2s ease;
}

.footer-col a:hover {
  opacity: 1;
}

.footer-bottom {
  text-align: center;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(246, 243, 247, 0.1);
  font-size: 0.85rem;
  opacity: 0.6;
  max-width: var(--content-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--gap);
  padding-right: var(--gap);
}

/* --- SVG 动效关键帧 --- */

/* 同心轨道呼吸 */
@keyframes orbit-breathe {
  0%, 100% {
    transform: scale(1);
    opacity: 0.6;
  }
  50% {
    transform: scale(1.08);
    opacity: 1;
  }
}

@keyframes orbit-breathe-slow {
  0%, 100% {
    transform: scale(1);
    opacity: 0.4;
  }
  50% {
    transform: scale(1.12);
    opacity: 0.8;
  }
}

@keyframes orbit-breathe-fast {
  0%, 100% {
    transform: scale(1);
    opacity: 0.5;
  }
  50% {
    transform: scale(1.05);
    opacity: 0.9;
  }
}

/* 气泡依次浮现 */
@keyframes bubble-float-in {
  0%, 100% {
    transform: translateY(0);
    opacity: 0.85;
  }
  50% {
    transform: translateY(-6px);
    opacity: 1;
  }
}

/* 输入中三个点呼吸 */
@keyframes dots-breathe {
  0%, 100% {
    opacity: 0.3;
  }
  50% {
    opacity: 1;
  }
}

/* 通知卡片滑入 */
@keyframes notif-slide-in {
  0%, 100% {
    transform: translateX(0);
    opacity: 0.9;
  }
  50% {
    transform: translateX(4px);
    opacity: 1;
  }
}

/* 连接线流动 */
@keyframes dash-flow {
  0% {
    stroke-dashoffset: 1;
  }
  100% {
    stroke-dashoffset: 0;
  }
}

/* --- 动效类 --- */
.orbit-1 {
  animation: orbit-breathe 6s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: center;
}

.orbit-2 {
  animation: orbit-breathe-slow 8s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: center;
}

.orbit-3 {
  animation: orbit-breathe-fast 5s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: center;
}

.bubble-delay-1 {
  animation: bubble-float-in 4s ease-in-out infinite;
  animation-delay: 0s;
}

.bubble-delay-2 {
  animation: bubble-float-in 4s ease-in-out infinite;
  animation-delay: 0.8s;
}

.bubble-delay-3 {
  animation: bubble-float-in 4s ease-in-out infinite;
  animation-delay: 1.6s;
}

.dots-breathe-1 {
  animation: dots-breathe 1.5s ease-in-out infinite;
  animation-delay: 0s;
}

.dots-breathe-2 {
  animation: dots-breathe 1.5s ease-in-out infinite;
  animation-delay: 0.3s;
}

.dots-breathe-3 {
  animation: dots-breathe 1.5s ease-in-out infinite;
  animation-delay: 0.6s;
}

.notif-slide {
  animation: notif-slide-in 5s ease-in-out infinite;
  animation-delay: 1s;
}

.dash-flow {
  pathLength: 1;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: dash-flow 3s linear infinite;
}

/* --- 响应式 --- */
@media (max-width: 768px) {
  .nav {
    display: none;
  }

  .mobile-menu-btn {
    display: flex;
  }

  h1 {
    font-size: clamp(1.8rem, 6vw, 2.8rem);
  }
}

/* --- 减少动态效果 --- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  html {
    scroll-behavior: auto;
  }

  .orbit-1,
  .orbit-2,
  .orbit-3,
  .bubble-delay-1,
  .bubble-delay-2,
  .bubble-delay-3,
  .dots-breathe-1,
  .dots-breathe-2,
  .dots-breathe-3,
  .notif-slide,
  .dash-flow {
    animation: none !important;
  }
}

/* --- 工具类 --- */
.text-center {
  text-align: center;
}

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--gap);
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gap);
}

@media (max-width: 768px) {
  .grid-2, .grid-3 {
    grid-template-columns: 1fr;
  }
}

.min-w-0 { min-width: 0; }

.w-full { width: 100%; }

.max-w-prose { max-width: 38em; }

/* --- 图文交错布局 --- */
.split-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap);
  align-items: center;
}

.split-row.reverse {
  direction: rtl;
}

.split-row.reverse > * {
  direction: ltr;
}

@media (max-width: 768px) {
  .split-row,
  .split-row.reverse {
    grid-template-columns: 1fr;
  }
}

/* --- 视觉面板 --- */
.visual-panel {
  background-color: var(--color-dark-bg);
  border-radius: var(--radius-card);
  padding: 2rem;
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.section--dark .visual-panel {
  background-color: #3A1D4A;
}

/* --- 步骤编号徽标 --- */
.step-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background-color: var(--color-accent);
  color: var(--color-dark-bg);
  font-weight: 700;
  font-size: 0.9rem;
  flex-shrink: 0;
}

/* --- 特性胶囊 --- */
.feature-capsule {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.8rem;
  border: var(--card-border);
  font-size: 0.85rem;
  font-weight: 500;
}

/* --- 提示框 --- */
.callout {
  border-left: 3px solid var(--color-brand);
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  background-color: rgba(158, 19, 221, 0.04);
  font-size: 0.95rem;
}

.section--dark .callout {
  border-left-color: var(--color-accent);
  background-color: rgba(237, 110, 192, 0.06);
}

/* --- News 卡片 --- */
.news-card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.news-card time {
  font-size: 0.8rem;
  opacity: 0.7;
  font-weight: 500;
}

.news-card h4 {
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.4;
}

.news-card p {
  font-size: 0.9rem;
  line-height: 1.6;
  opacity: 0.85;
}

/* --- 移动端菜单 --- */
.mobile-menu-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  background-color: rgba(39, 18, 49, 0.95);
  backdrop-filter: blur(4px);
}

.mobile-menu-overlay.active {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2rem;
}

.mobile-menu-overlay a {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--color-paper);
}

.mobile-close-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  color: var(--color-paper);
  font-size: 1.5rem;
  cursor: pointer;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* --- 对比表特殊样式 --- */
.comparison-table th:first-child,
.comparison-table td:first-child {
  min-width: 140px;
}

.check-icon {
  color: var(--color-brand);
}

.cross-icon {
  color: rgba(31, 21, 35, 0.3);
}
