/* ============================================
   SafeW 全站共享样式
   ============================================ */

/* ---------- 设计变量 ---------- */
:root {
  /* 色板 */
  --color-dark: #271334;
  --color-paper: #E9E8EA;
  --color-text: #1D1523;
  --color-brand: #8A13DD;
  --color-accent: #9EED6E;

  /* 圆角 */
  --radius-card: 20px;
  --radius-btn: 12px;
  --radius-badge: 8px;

  /* 卡片边界 */
  --card-border: 0;
  --card-shadow: none;

  /* 节奏与密度 */
  --section-y: clamp(2.5rem, 5vw, 4rem);
  --gap: clamp(0.75rem, 1.5vw, 1.25rem);
  --line-height: 1.55;

  /* 内容最大宽度 */
  --content-max: 1120px;

  /* 标题处理 */
  --heading-weight: 600;
  --letter-spacing: 0;
  --line-height-heading: 1.25;

  /* 其他 token */
  --header-height: 64px;
  --transition-speed: 0.2s;
}

/* ---------- 基础重置 ---------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: var(--line-height);
  color: var(--color-text);
  background-color: var(--color-paper);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img, svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

ul, ol {
  list-style: none;
}

/* ---------- 取色变量（默认纸面） ---------- */
:root {
  --text-color: var(--color-text);
  --heading-color: var(--color-text);
  --link-color: var(--color-brand);
  --icon-color: var(--color-brand);
  --badge-color: var(--color-brand);
  --bg-color: var(--color-paper);
}

/* 深色面覆盖 */
.dark-surface {
  --text-color: var(--color-paper);
  --heading-color: var(--color-paper);
  --link-color: var(--color-accent);
  --icon-color: var(--color-accent);
  --badge-color: var(--color-accent);
  --bg-color: var(--color-dark);
}

/* 浅色卡片（在深色面上使用，恢复纸面取色） */
.light-card {
  --text-color: var(--color-text);
  --heading-color: var(--color-text);
  --link-color: var(--color-brand);
  --icon-color: var(--color-brand);
  --badge-color: var(--color-brand);
  --bg-color: var(--color-paper);
}

/* ---------- 容器 ---------- */
.container {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--gap);
  overflow-x: hidden;
}

/* ---------- 眉标 ---------- */
.section-label {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--badge-color);
  margin-bottom: var(--gap);
}

.section-label::before {
  content: "";
  display: inline-block;
  width: 16px;
  height: 2px;
  background-color: currentColor;
  vertical-align: middle;
  margin-right: 6px;
  border-radius: 1px;
}

/* ---------- 高亮关键词 ---------- */
.hl {
  color: var(--link-color);
  font-weight: 700;
}

/* ---------- 区块通用 ---------- */
.section {
  padding: var(--section-y) 0;
}

.section h2 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: var(--heading-weight);
  letter-spacing: var(--letter-spacing);
  line-height: var(--line-height-heading);
  color: var(--heading-color);
  margin-bottom: calc(var(--gap) * 1.5);
}

.section h3 {
  font-size: clamp(1.1rem, 2vw, 1.4rem);
  font-weight: var(--heading-weight);
  letter-spacing: var(--letter-spacing);
  line-height: var(--line-height-heading);
  color: var(--heading-color);
  margin-bottom: var(--gap);
}

.section p, .section li {
  color: var(--text-color);
  font-size: clamp(0.95rem, 1.2vw, 1.05rem);
  line-height: var(--line-height);
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 52px;
  padding: 0 24px;
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius-btn);
  border: none;
  cursor: pointer;
  transition: transform var(--transition-speed), background-color var(--transition-speed), box-shadow var(--transition-speed);
  white-space: nowrap;
}

.btn:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 2px;
}

.btn-primary {
  background-color: var(--color-accent);
  color: var(--color-dark);
}

.btn-primary:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

.btn-secondary {
  background-color: transparent;
  color: var(--text-color);
  border: 1.5px solid var(--text-color);
}

.dark-surface .btn-secondary {
  color: var(--color-paper);
  border-color: var(--color-paper);
}

.btn-secondary:hover {
  transform: translateY(-1px);
  background-color: rgba(0,0,0,0.05);
}

.dark-surface .btn-secondary:hover {
  background-color: rgba(255,255,255,0.08);
}

.btn-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* ---------- 卡片 ---------- */
.card {
  background-color: var(--bg-color);
  border: var(--card-border);
  box-shadow: var(--card-shadow);
  border-radius: var(--radius-card);
  padding: var(--gap);
}

/* ---------- 网格 ---------- */
.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;
  font-size: 0.95rem;
}

.data-table th,
.data-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid rgba(0,0,0,0.08);
}

.dark-surface .data-table th,
.dark-surface .data-table td {
  border-bottom-color: rgba(255,255,255,0.1);
}

.data-table th {
  font-weight: 600;
  color: var(--heading-color);
}

.data-table td {
  color: var(--text-color);
}

/* ---------- FAQ ---------- */
.faq-item {
  border-bottom: 1px solid rgba(0,0,0,0.08);
  padding: var(--gap) 0;
}

.dark-surface .faq-item {
  border-bottom-color: rgba(255,255,255,0.1);
}

.faq-item summary {
  font-weight: 600;
  color: var(--heading-color);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1rem;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::before {
  content: "";
  width: 6px;
  height: 6px;
  border-right: 2px solid var(--icon-color);
  border-bottom: 2px solid var(--icon-color);
  transform: rotate(-45deg);
  flex-shrink: 0;
  transition: transform var(--transition-speed);
}

.faq-item[open] summary::before {
  transform: rotate(45deg);
}

.faq-item summary:hover {
  color: var(--link-color);
}

.faq-item .faq-answer {
  margin-top: 8px;
  color: var(--text-color);
  line-height: var(--line-height);
  padding-left: 14px;
}

/* ---------- 页头 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: var(--color-paper);
  border-bottom: 1px solid rgba(0,0,0,0.06);
  transition: background-color var(--transition-speed), box-shadow var(--transition-speed);
}

.dark-surface .site-header {
  background-color: var(--color-dark);
  border-bottom-color: rgba(255,255,255,0.06);
}

.site-header.scrolled {
  box-shadow: 0 1px 8px rgba(0,0,0,0.06);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--heading-color);
}

.brand img {
  height: 32px;
  width: auto;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: calc(var(--gap) * 1.5);
}

.nav-links a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-color);
  padding: 4px 0;
  position: relative;
  transition: color var(--transition-speed);
}

.nav-links a:hover {
  color: var(--link-color);
}

.nav-links a[aria-current="page"] {
  color: var(--link-color);
}

.nav-links a[aria-current="page"]::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background-color: var(--link-color);
  border-radius: 1px;
}

.header-btn {
  height: 40px;
  padding: 0 16px;
  font-size: 0.9rem;
}

/* ---------- 页脚 ---------- */
.site-footer {
  padding: 48px 0 32px;
  background-color: var(--color-dark);
  color: var(--color-paper);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--gap);
}

.footer-col h4 {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--color-accent);
  margin-bottom: 12px;
  letter-spacing: 0.05em;
}

.footer-col a {
  display: block;
  font-size: 0.9rem;
  color: rgba(233,234,234,0.7);
  padding: 4px 0;
  transition: color var(--transition-speed);
}

.footer-col a:hover {
  color: var(--color-accent);
}

.footer-bottom {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid rgba(255,255,255,0.08);
  font-size: 0.8rem;
  color: rgba(233,234,234,0.5);
  text-align: center;
}

/* ---------- SVG 动效 ---------- */
.svg-visual {
  width: 100%;
  height: auto;
}

/* 同心轨道呼吸 */
@keyframes orbit-breathe-1 {
  0%, 100% { transform: scale(1); opacity: 0.5; }
  50% { transform: scale(1.06); opacity: 0.85; }
}
@keyframes orbit-breathe-2 {
  0%, 100% { transform: scale(1); opacity: 0.6; }
  50% { transform: scale(1.04); opacity: 1; }
}
@keyframes orbit-breathe-3 {
  0%, 100% { transform: scale(1); opacity: 0.4; }
  50% { transform: scale(1.08); opacity: 0.75; }
}

.orbit-1 { animation: orbit-breathe-1 6s ease-in-out infinite; transform-origin: center; transform-box: fill-box; }
.orbit-2 { animation: orbit-breathe-2 8s ease-in-out infinite; transform-origin: center; transform-box: fill-box; }
.orbit-3 { animation: orbit-breathe-3 5s ease-in-out infinite; transform-origin: center; transform-box: fill-box; }

/* 气泡依次浮现后轻微漂浮 */
@keyframes bubble-appear {
  0%, 100% { transform: translateY(0); opacity: 0.7; }
  10%, 90% { transform: translateY(-3px); opacity: 1; }
}
@keyframes bubble-delay-1 {
  0%, 100% { opacity: 0; }
  8%, 92% { opacity: 0.9; }
}
@keyframes bubble-delay-2 {
  0%, 100% { opacity: 0; }
  16%, 84% { opacity: 0.9; }
}
@keyframes bubble-delay-3 {
  0%, 100% { opacity: 0; }
  24%, 76% { opacity: 0.9; }
}

.bubble-1 { animation: bubble-appear 4s ease-in-out infinite; transform-origin: center; transform-box: fill-box; }
.bubble-2 { animation: bubble-delay-2 5s ease-in-out infinite; }
.bubble-3 { animation: bubble-delay-3 6s ease-in-out infinite; }

/* 输入中三点呼吸 */
@keyframes dot-breathe {
  0%, 100% { opacity: 0.2; }
  50% { opacity: 1; }
}
.dot-1 { animation: dot-breathe 1.4s ease-in-out infinite; }
.dot-2 { animation: dot-breathe 1.4s ease-in-out 0.2s infinite; }
.dot-3 { animation: dot-breathe 1.4s ease-in-out 0.4s infinite; }

/* 通知卡片滑入 */
@keyframes notif-slide {
  0%, 100% { transform: translateX(20px); opacity: 0; }
  15%, 85% { transform: translateX(0); opacity: 1; }
}
.notif-card { animation: notif-slide 5s ease-in-out infinite; }

/* 连接线流动 */
@keyframes line-flow {
  from { stroke-dashoffset: 1; }
  to { stroke-dashoffset: 0; }
}
.flow-line {
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: line-flow 2s linear infinite;
}

/* 面板元素淡入循环 */
@keyframes panel-fade {
  0%, 100% { opacity: 0.85; }
  50% { opacity: 1; }
}
.panel-fade { animation: panel-fade 4s ease-in-out infinite; }

/* ---------- 响应式：减少动态效果 ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .orbit-1, .orbit-2, .orbit-3,
  .bubble-1, .bubble-2, .bubble-3,
  .dot-1, .dot-2, .dot-3,
  .notif-card, .flow-line, .panel-fade {
    animation: none !important;
  }
}

/* ---------- 平板 ---------- */
@media (max-width: 768px) {
  .nav-links {
    display: none;
  }
  .grid-2, .grid-3 {
    grid-template-columns: 1fr;
  }
  .hero-layout {
    flex-direction: column;
  }
  .scenario-row {
    flex-direction: column;
  }
  .feature-group-grid {
    grid-template-columns: 1fr;
  }
}

/* ---------- 手机 ---------- */
@media (max-width: 480px) {
  :root {
    --section-y: clamp(2rem, 8vw, 3rem);
    --gap: clamp(0.5rem, 3vw, 1rem);
  }
  .header-inner {
    height: 56px;
  }
  .brand img {
    height: 28px;
  }
  .btn {
    height: 48px;
    padding: 0 18px;
    font-size: 0.9rem;
  }
}
