/* ===== SafeW 全站共享样式 ===== */

/* --- 设计变量 --- */
:root {
  /* 色板 */
  --color-dark: #17203F;
  --color-paper: #FCFCFD;
  --color-body: #151823;
  --color-brand: #1441EB;
  --color-accent: #6EEDBD;

  /* 圆角 */
  --radius-card: 8px;
  --radius-btn: 6px;

  /* 卡片边界与阴影 */
  --card-border: 1px solid rgba(21, 24, 35, 0.16);
  --card-shadow: none;

  /* 节奏与密度 */
  --section-y: clamp(3.5rem, 7vw, 6rem);
  --gap: clamp(1rem, 2vw, 1.75rem);
  --line-height-body: 1.65;

  /* 内容最大宽度 */
  --content-max: 960px;

  /* 标题处理 */
  --heading-weight: 800;
  --tracking-tight: -0.02em;
  --leading-tight: 1.1;

  /* 字体栈 */
  --font-sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, -apple-system, sans-serif;
}

/* --- 深色面取色覆盖 --- */
.dark-face {
  --text-primary: var(--color-paper);
  --text-secondary: rgba(252, 252, 253, 0.72);
  --accent-text: var(--color-accent);
  --link-color: var(--color-accent);
}

/* --- 浅色纸面取色（默认） --- */
.paper-face {
  --text-primary: var(--color-body);
  --text-secondary: var(--color-body);
  --accent-text: var(--color-accent);
  --link-color: var(--color-brand);
}

/* --- 浅色卡片在深色面上的取色恢复 --- */
.card-light-on-dark {
  --text-primary: var(--color-body);
  --text-secondary: var(--color-body);
  --link-color: var(--color-brand);
  --accent-text: var(--color-brand);
}

/* --- 基础重置 --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}

body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: var(--line-height-body);
  color: var(--text-primary);
  background-color: var(--color-paper);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, svg {
  display: block;
  max-width: 100%;
}

a {
  color: var(--link-color);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  opacity: 0.85;
}

ul, ol {
  list-style: none;
}

/* --- 容器 --- */
.container {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--gap);
}

.section {
  padding-top: var(--section-y);
  padding-bottom: var(--section-y);
}

/* --- 眉标 --- */
.eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.5em;
  color: var(--link-color);
}

.dark-face .eyebrow {
  color: var(--accent-text);
}

/* --- 标题 --- */
h1, h2, h3, h4 {
  font-weight: var(--heading-weight);
  letter-spacing: var(--tracking-tight);
  line-height: var(--leading-tight);
  color: var(--text-primary);
}

h1 {
  font-size: clamp(2.4rem, 6vw, 4.5rem);
}

h2 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  line-height: 1.25;
}

h3 {
  font-size: clamp(1.2rem, 2vw, 1.5rem);
  line-height: 1.3;
}

p {
  max-width: 38em;
  margin-bottom: 1em;
}

/* --- 高亮关键词 --- */
.hl {
  color: var(--link-color);
}

.dark-face .hl {
  color: var(--accent-text);
}

/* --- 按钮 --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  height: 52px;
  padding: 0 24px;
  font-size: 1rem;
  font-weight: 700;
  border-radius: var(--radius-btn);
  cursor: pointer;
  border: none;
  transition: transform 0.2s ease, opacity 0.2s ease, background-color 0.2s ease;
  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);
  opacity: 0.92;
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--text-primary);
  color: var(--text-primary);
}

.dark-face .btn-outline {
  border-color: var(--color-paper);
  color: var(--color-paper);
}

.btn-outline:hover {
  transform: translateY(-1px);
  opacity: 0.85;
}

.btn-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* --- 页头 --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: var(--color-paper);
  border-bottom: 1px solid rgba(21, 24, 35, 0.08);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.dark-face .site-header {
  background-color: var(--color-dark);
  border-bottom-color: rgba(252, 252, 253, 0.08);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--gap);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand img {
  height: 32px;
  width: auto;
}

.brand-name {
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.nav {
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav a {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: color 0.2s ease;
}

.nav a:hover {
  color: var(--text-primary);
}

.nav a[aria-current="page"] {
  color: var(--link-color);
}

.dark-face .nav a {
  color: var(--text-secondary);
}

.dark-face .nav a:hover {
  color: var(--text-primary);
}

.dark-face .nav a[aria-current="page"] {
  color: var(--accent-text);
}

/* --- 页脚 --- */
.site-footer {
  background-color: var(--color-dark);
  color: var(--color-paper);
  padding: 48px var(--gap);
}

.footer-inner {
  max-width: var(--content-max);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 32px;
}

.footer-col h4 {
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
  color: var(--color-accent);
}

.footer-col a {
  display: block;
  font-size: 0.85rem;
  color: rgba(252, 252, 253, 0.7);
  margin-bottom: 8px;
}

.footer-col a:hover {
  color: var(--color-paper);
}

.footer-bottom {
  max-width: var(--content-max);
  margin: 32px auto 0;
  padding-top: 24px;
  border-top: 1px solid rgba(252, 252, 253, 0.1);
  font-size: 0.8rem;
  color: rgba(252, 252, 253, 0.5);
  text-align: center;
}

/* --- 卡片 --- */
.card {
  background: var(--color-paper);
  border: var(--card-border);
  border-radius: var(--radius-card);
  box-shadow: var(--card-shadow);
  padding: 24px;
}

.card-grid {
  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 {
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(21, 24, 35, 0.1);
}

.data-table th {
  font-weight: 700;
  color: var(--text-primary);
  width: 40%;
}

.data-table td {
  color: var(--text-secondary);
}

/* --- FAQ details --- */
details {
  border: var(--card-border);
  border-radius: var(--radius-card);
  margin-bottom: 12px;
  overflow: hidden;
}

details summary {
  padding: 16px 20px;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: background-color 0.2s ease;
}

details summary::-webkit-details-marker {
  display: none;
}

details summary::marker {
  display: none;
  content: "";
}

details summary:hover {
  background-color: rgba(21, 24, 35, 0.03);
}

details[open] summary {
  background-color: rgba(21, 24, 35, 0.03);
}

.detail-arrow {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  transition: transform 0.3s ease;
}

details[open] .detail-arrow {
  transform: rotate(180deg);
}

details .detail-body {
  padding: 0 20px 20px;
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* --- Tab 切换（纯 CSS） --- */
.tab-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

.tab-nav input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.tab-nav label {
  display: inline-block;
  padding: 8px 18px;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--radius-btn);
  border: 1px solid rgba(21, 24, 35, 0.12);
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--text-secondary);
}

.tab-nav label:hover {
  border-color: var(--link-color);
  color: var(--link-color);
}

.tab-panel {
  display: none;
}

.tab-nav input[type="radio"]:checked + label {
  background-color: var(--link-color);
  color: var(--color-paper);
  border-color: var(--link-color);
}

.tab-nav input[id="tab1"]:checked ~ .tab-panel[data-tab="1"],
.tab-nav input[id="tab2"]:checked ~ .tab-panel[data-tab="2"],
.tab-nav input[id="tab3"]:checked ~ .tab-panel[data-tab="3"],
.tab-nav input[id="tab4"]:checked ~ .tab-panel[data-tab="4"],
.tab-nav input[id="tab5"]:checked ~ .tab-panel[data-tab="5"] {
  display: block;
}

/* --- 流程条 --- */
.flow-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0;
  padding: 24px 0;
}

.flow-node {
  flex: 1;
  min-width: 140px;
  text-align: center;
  padding: 16px;
}

.flow-node-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.flow-node-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.flow-arrow {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  color: var(--link-color);
  opacity: 0.5;
}

/* --- 时间线 --- */
.timeline {
  position: relative;
  padding-left: 48px;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 18px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: rgba(21, 24, 35, 0.1);
}

.timeline-item {
  position: relative;
  margin-bottom: 32px;
}

.timeline-item:last-child {
  margin-bottom: 0;
}

.timeline-number {
  position: absolute;
  left: -48px;
  top: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--color-accent);
  color: var(--color-dark);
  font-weight: 800;
  font-size: 0.85rem;
  border-radius: 6px;
}

.timeline-item h4 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 4px;
  line-height: 1.4;
}

.timeline-item p {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-bottom: 0;
}

/* --- 提示框 --- */
.callout {
  border-left: 3px solid var(--link-color);
  background: rgba(20, 65, 235, 0.04);
  border-radius: 0 var(--radius-card) var(--radius-card) 0;
  padding: 16px 20px;
  margin: 24px 0;
  font-size: 0.95rem;
  color: var(--text-secondary);
}

.dark-face .callout {
  background: rgba(110, 237, 189, 0.06);
  border-left-color: var(--color-accent);
}

/* --- 特性胶囊 --- */
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: 20px;
  border: 1px solid rgba(21, 24, 35, 0.12);
  color: var(--text-secondary);
}

.chip svg {
  width: 16px;
  height: 16px;
  color: var(--link-color);
}

.dark-face .chip {
  border-color: rgba(252, 252, 253, 0.15);
  color: var(--text-secondary);
}

.dark-face .chip svg {
  color: var(--accent-text);
}

/* =========================================
   SVG 动效 — @keyframes 与类名
   ========================================= */

/* 同心轨道呼吸：多层椭圆以不同速率缩放与明暗交替 */
@keyframes orbit-breathe-1 {
  0%, 100% {
    transform: scale(1);
    opacity: 0.6;
  }
  50% {
    transform: scale(1.08);
    opacity: 1;
  }
}

@keyframes orbit-breathe-2 {
  0%, 100% {
    transform: scale(1);
    opacity: 0.4;
  }
  50% {
    transform: scale(1.05);
    opacity: 0.8;
  }
}

@keyframes orbit-breathe-3 {
  0%, 100% {
    transform: scale(1);
    opacity: 0.3;
  }
  50% {
    transform: scale(1.03);
    opacity: 0.6;
  }
}

/* 气泡依次浮现后轻微漂浮 */
@keyframes bubble-rise {
  0%, 100% {
    transform: translateY(0);
    opacity: 1;
  }
  50% {
    transform: translateY(-6px);
    opacity: 0.85;
  }
}

@keyframes bubble-delay-1 {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-5px);
  }
}

@keyframes bubble-delay-2 {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

@keyframes bubble-delay-3 {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-4px);
  }
}

/* 输入中三个点呼吸 */
@keyframes dot-breathe {
  0%, 100% {
    opacity: 0.3;
  }
  50% {
    opacity: 1;
  }
}

/* 通知卡片滑入 */
@keyframes slide-in-right {
  0%, 100% {
    transform: translateX(0);
    opacity: 1;
  }
  10% {
    transform: translateX(8px);
    opacity: 0.7;
  }
  20% {
    transform: translateX(0);
    opacity: 1;
  }
}

/* 连接线流动 */
@keyframes dash-flow {
  0% {
    stroke-dashoffset: 1;
  }
  100% {
    stroke-dashoffset: 0;
  }
}

/* 设置面板开关闪烁 */
@keyframes toggle-glow {
  0%, 100% {
    opacity: 0.5;
  }
  50% {
    opacity: 1;
  }
}

/* 扫码框脉冲 */
@keyframes scan-pulse {
  0%, 100% {
    transform: scale(1);
    opacity: 0.7;
  }
  50% {
    transform: scale(1.04);
    opacity: 1;
  }
}

/* 文件列表项逐行显现 */
@keyframes row-fade-in {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.6;
  }
}

/* 对话气泡出现 */
@keyframes msg-pop {
  0%, 100% {
    transform: scale(1);
  }
  30% {
    transform: scale(1.05);
  }
  60% {
    transform: scale(0.98);
  }
}

/* 状态点呼吸 */
@keyframes status-dot {
  0%, 100% {
    r: 4;
    opacity: 0.6;
  }
  50% {
    r: 5;
    opacity: 1;
  }
}

/* --- 动效类绑定 --- */
.orbit-ring-1 {
  animation: orbit-breathe-1 6s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: center;
}

.orbit-ring-2 {
  animation: orbit-breathe-2 8s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: center;
}

.orbit-ring-3 {
  animation: orbit-breathe-3 10s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: center;
}

.bubble-anim {
  animation: bubble-rise 4s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: center;
}

.bubble-delay-1 {
  animation: bubble-delay-1 3.5s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: center;
}

.bubble-delay-2 {
  animation: bubble-delay-2 4s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: center;
}

.bubble-delay-3 {
  animation: bubble-delay-3 4.5s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: center;
}

.dot-breathe-1 {
  animation: dot-breathe 1.5s ease-in-out infinite;
}

.dot-breathe-2 {
  animation: dot-breathe 1.5s ease-in-out infinite 0.3s;
}

.dot-breathe-3 {
  animation: dot-breathe 1.5s ease-in-out infinite 0.6s;
}

.slide-in-anim {
  animation: slide-in-right 5s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: center;
}

.dash-flow-line {
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: dash-flow 3s linear infinite;
}

.toggle-glow-anim {
  animation: toggle-glow 2s ease-in-out infinite;
}

.scan-pulse-anim {
  animation: scan-pulse 4s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: center;
}

.row-fade-anim {
  animation: row-fade-in 5s ease-in-out infinite;
}

.msg-pop-anim {
  animation: msg-pop 4s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: center;
}

.status-dot-anim {
  animation: status-dot 2.5s ease-in-out infinite;
}

/* --- 减少动态效果 --- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    animation-delay: 0ms !important;
  }
  .orbit-ring-1,
  .orbit-ring-2,
  .orbit-ring-3,
  .bubble-anim,
  .bubble-delay-1,
  .bubble-delay-2,
  .bubble-delay-3,
  .dot-breathe-1,
  .dot-breathe-2,
  .dot-breathe-3,
  .slide-in-anim,
  .dash-flow-line,
  .toggle-glow-anim,
  .scan-pulse-anim,
  .row-fade-anim,
  .msg-pop-anim,
  .status-dot-anim {
    animation: none !important;
  }
}

/* --- 响应式 --- */
@media (max-width: 768px) {
  .header-inner {
    flex-direction: column;
    height: auto;
    padding: 12px var(--gap);
    gap: 12px;
  }

  .nav {
    gap: 16px;
  }

  .flow-bar {
    flex-direction: column;
  }

  .flow-arrow {
    transform: rotate(90deg);
    width: 24px;
    height: 24px;
  }

  .footer-inner {
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  .nav {
    gap: 12px;
    font-size: 0.85rem;
  }

  .btn {
    height: 48px;
    padding: 0 18px;
    font-size: 0.9rem;
  }
}
