/* ===== SafeW 全站共享样式 ===== */

/* --- 设计变量 --- */
:root {
  /* 色板 */
  --color-dark: #231334;
  --color-paper: #F5F3F7;
  --color-text: #1C1523;
  --color-brand: #7D14EB;
  --color-accent: #EDD26E;
  --color-line: rgba(28, 21, 35, 0.12);

  /* 圆角 */
  --radius-card: 20px;
  --radius-btn: 12px;

  /* 卡片边界 */
  --card-border: 2px solid var(--color-text);
  --card-shadow: 4px 4px 0 var(--color-text);

  /* 节奏与密度 */
  --section-y: clamp(2.5rem, 5vw, 4rem);
  --gap: clamp(0.75rem, 1.5vw, 1.25rem);
  --line-height-body: 1.55;

  /* 内容最大宽度 */
  --content-max: 1280px;

  /* 标题处理 */
  --title-weight: 600;
  --title-tracking: 0;
  --title-line-height: 1.25;

  /* 字体 */
  --font-sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
}

/* --- 基础排版 --- */
*, *::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-sans);
  font-size: 16px;
  line-height: var(--line-height-body);
  color: var(--color-text);
  background: var(--color-paper);
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

/* --- 容器 --- */
.container {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--gap);
}

/* --- 页头 --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--color-paper);
  border-bottom: 1px solid var(--color-line);
  transition: box-shadow 0.3s ease;
}

.site-header.scrolled {
  box-shadow: 0 2px 12px rgba(28, 21, 35, 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);
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 0.02em;
}

.header-logo img {
  width: 32px;
  height: 32px;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 24px;
}

.header-nav a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-text);
  transition: color 0.2s;
}

.header-nav a:hover,
.header-nav a[aria-current="page"] {
  color: var(--color-brand);
}

.header-nav a[aria-current="page"] {
  font-weight: 700;
}

.header-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: var(--color-accent);
  color: var(--color-dark);
  font-weight: 700;
  font-size: 0.9rem;
  border-radius: var(--radius-btn);
  transition: transform 0.2s, box-shadow 0.2s;
}

.header-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(237, 210, 110, 0.4);
}

/* --- 按钮 --- */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 32px;
  background: var(--color-accent);
  color: var(--color-dark);
  font-weight: 700;
  font-size: 1rem;
  border-radius: var(--radius-btn);
  border: none;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, filter 0.2s;
  min-height: 48px;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(237, 210, 110, 0.5);
  filter: brightness(1.05);
}

.btn-primary:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 3px;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 28px;
  background: transparent;
  color: var(--color-text);
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: var(--radius-btn);
  border: 2px solid var(--color-text);
  cursor: pointer;
  transition: transform 0.2s, background 0.2s, color 0.2s;
  min-height: 48px;
}

.btn-secondary:hover {
  transform: translateY(-2px);
  background: var(--color-text);
  color: var(--color-paper);
}

.btn-secondary:focus-visible {
  outline: 3px solid var(--color-text);
  outline-offset: 3px;
}

/* --- 眉标 --- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-brand);
  margin-bottom: 12px;
}

.dark-surface .eyebrow {
  color: var(--color-accent);
}

/* --- 标题 --- */
.section-title {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: var(--title-weight);
  letter-spacing: var(--title-tracking);
  line-height: var(--title-line-height);
  color: var(--color-text);
  margin-bottom: 16px;
}

.dark-surface .section-title {
  color: var(--color-paper);
}

.section-title .hl {
  color: var(--color-brand);
}

.dark-surface .section-title .hl {
  color: var(--color-accent);
}

.h1-hero {
  font-size: clamp(2.2rem, 5vw, 4rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--color-paper);
}

.h1-hero .hl {
  color: var(--color-accent);
}

/* --- 正文 --- */
.body-text {
  font-size: 1rem;
  line-height: var(--line-height-body);
  color: var(--color-text);
}

.dark-surface .body-text {
  color: var(--color-paper);
}

.body-text p {
  margin-bottom: 16px;
}

.body-text p:last-child {
  margin-bottom: 0;
}

/* --- 深色面 --- */
.dark-surface {
  background: var(--color-dark);
}

.dark-surface .body-text {
  color: var(--color-paper);
}

.dark-surface .section-title {
  color: var(--color-paper);
}

.dark-surface .section-title .hl {
  color: var(--color-accent);
}

.dark-surface .eyebrow {
  color: var(--color-accent);
}

.dark-surface a:not(.btn-primary):not(.header-cta) {
  color: var(--color-accent);
}

/* --- 浅色卡片（在深色面上使用） --- */
.paper-card {
  background: var(--color-paper);
  border: var(--card-border);
  box-shadow: var(--card-shadow);
  border-radius: var(--radius-card);
  padding: 24px;
}

.paper-card .section-title {
  color: var(--color-text);
}

.paper-card .section-title .hl {
  color: var(--color-brand);
}

.paper-card .eyebrow {
  color: var(--color-brand);
}

.paper-card .body-text {
  color: var(--color-text);
}

/* --- 区块 --- */
.section {
  padding-top: var(--section-y);
  padding-bottom: var(--section-y);
}

.section-divider {
  border: none;
  border-top: 1px solid var(--color-line);
  margin: 0;
}

/* --- 两栏布局 --- */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap);
  align-items: center;
}

/* --- 特性胶囊 --- */
.feature-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.feature-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 99px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-paper);
}

.feature-pill svg {
  width: 18px;
  height: 18px;
  stroke: var(--color-accent);
}

/* --- 场景卡片 --- */
.scene-card {
  background: var(--color-paper);
  border: var(--card-border);
  box-shadow: var(--card-shadow);
  border-radius: var(--radius-card);
  padding: 24px;
}

.scene-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--color-text);
}

.scene-steps {
  list-style: none;
  counter-reset: step;
  padding: 0;
}

.scene-steps li {
  counter-increment: step;
  padding: 8px 0 8px 36px;
  position: relative;
  font-size: 0.95rem;
  line-height: 1.6;
}

.scene-steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 8px;
  width: 24px;
  height: 24px;
  background: var(--color-accent);
  color: var(--color-dark);
  font-weight: 700;
  font-size: 0.8rem;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* --- 功能定义列表 --- */
.func-list {
  list-style: none;
  padding: 0;
}

.func-list li {
  padding: 16px 0;
  border-bottom: 1px solid var(--color-line);
}

.func-list li:last-child {
  border-bottom: none;
}

.func-list dt {
  font-weight: 700;
  font-size: 1.05rem;
  margin-bottom: 6px;
  color: var(--color-text);
  display: flex;
  align-items: center;
  gap: 10px;
}

.func-list dd {
  font-size: 0.95rem;
  line-height: 1.65;
  color: var(--color-text);
  padding-left: 34px;
}

.dark-surface .func-list dt {
  color: var(--color-paper);
}

.dark-surface .func-list dd {
  color: var(--color-paper);
}

.dark-surface .func-list li {
  border-bottom-color: rgba(245, 243, 247, 0.15);
}

/* --- 对比表 --- */
.compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.compare-table th,
.compare-table td {
  padding: 14px 18px;
  text-align: left;
  border-bottom: 1px solid var(--color-line);
}

.compare-table th {
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  color: var(--color-brand);
  background: rgba(125, 20, 235, 0.06);
}

.dark-surface .compare-table th {
  color: var(--color-accent);
  background: rgba(237, 210, 110, 0.1);
}

.compare-table td:first-child {
  font-weight: 600;
  color: var(--color-text);
  width: 30%;
}

.dark-surface .compare-table td:first-child {
  color: var(--color-paper);
}

/* --- 编号步骤 --- */
.step-list {
  list-style: none;
  padding: 0;
  counter-reset: step-num;
}

.step-list li {
  counter-increment: step-num;
  padding: 16px 0 16px 56px;
  position: relative;
  border-bottom: 1px solid var(--color-line);
}

.step-list li:last-child {
  border-bottom: none;
}

.step-list li::before {
  content: "0" counter(step-num);
  position: absolute;
  left: 0;
  top: 16px;
  width: 36px;
  height: 36px;
  background: var(--color-accent);
  color: var(--color-dark);
  font-weight: 800;
  font-size: 0.85rem;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.step-list h4 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--color-text);
}

.dark-surface .step-list h4 {
  color: var(--color-paper);
}

.step-list p {
  font-size: 0.95rem;
  line-height: 1.65;
  color: var(--color-text);
}

.dark-surface .step-list p {
  color: var(--color-paper);
}

/* --- 资讯卡片 --- */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--gap);
}

.news-card {
  background: var(--color-paper);
  border: var(--card-border);
  box-shadow: var(--card-shadow);
  border-radius: var(--radius-card);
  padding: 24px;
  display: flex;
  flex-direction: column;
}

.news-card time {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-brand);
  margin-bottom: 8px;
}

.dark-surface .news-card time {
  color: var(--color-accent);
}

.news-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 10px;
  line-height: 1.4;
  color: var(--color-text);
}

.dark-surface .news-card h3 {
  color: var(--color-paper);
}

.news-card p {
  font-size: 0.9rem;
  line-height: 1.65;
  color: var(--color-text);
  flex-grow: 1;
}

.dark-surface .news-card p {
  color: var(--color-paper);
}

/* --- 平台表格 --- */
.platform-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.platform-table th,
.platform-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--color-line);
}

.platform-table th {
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  color: var(--color-brand);
}

.dark-surface .platform-table th {
  color: var(--color-accent);
}

.platform-table td:first-child {
  font-weight: 600;
}

.platform-table a {
  color: var(--color-brand);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.dark-surface .platform-table a {
  color: var(--color-accent);
}

/* --- FAQ --- */
.faq-list {
  list-style: none;
  padding: 0;
}

.faq-list li {
  border-bottom: 1px solid var(--color-line);
}

.faq-list li:last-child {
  border-bottom: none;
}

.faq-list details {
  padding: 16px 0;
}

.faq-list summary {
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 0;
  color: var(--color-text);
  transition: color 0.2s;
}

.faq-list summary::-webkit-details-marker {
  display: none;
}

.faq-list summary::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--color-brand);
  border-bottom: 2px solid var(--color-brand);
  transform: rotate(-45deg);
  transition: transform 0.2s;
  flex-shrink: 0;
}

.faq-list details[open] summary::before {
  transform: rotate(45deg);
}

.faq-list summary:hover {
  color: var(--color-brand);
}

.faq-list details > div {
  padding: 8px 0 8px 20px;
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--color-text);
}

.dark-surface .faq-list summary {
  color: var(--color-paper);
}

.dark-surface .faq-list summary::before {
  border-color: var(--color-accent);
}

.dark-surface .faq-list summary:hover {
  color: var(--color-accent);
}

.dark-surface .faq-list details > div {
  color: var(--color-paper);
}

/* --- 提示框 --- */
.note-box {
  padding: 16px 20px;
  border-left: 4px solid var(--color-brand);
  background: rgba(125, 20, 235, 0.06);
  border-radius: 0 8px 8px 0;
  font-size: 0.9rem;
  line-height: 1.65;
  margin: 16px 0;
}

.dark-surface .note-box {
  border-left-color: var(--color-accent);
  background: rgba(237, 210, 110, 0.1);
}

.note-box strong {
  font-weight: 700;
}

/* --- 页脚 --- */
.site-footer {
  background: var(--color-dark);
  color: var(--color-paper);
  padding: 48px 0 32px;
}

.footer-inner {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--gap);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 32px;
}

.footer-brand p {
  font-size: 0.9rem;
  line-height: 1.6;
  color: rgba(245, 243, 247, 0.7);
  margin-top: 12px;
}

.footer-links h4 {
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--color-accent);
  margin-bottom: 12px;
}

.footer-links ul {
  list-style: none;
  padding: 0;
}

.footer-links li {
  margin-bottom: 8px;
}

.footer-links a {
  font-size: 0.9rem;
  color: rgba(245, 243, 247, 0.7);
  transition: color 0.2s;
}

.footer-links a:hover {
  color: var(--color-accent);
}

.footer-bottom {
  border-top: 1px solid rgba(245, 243, 247, 0.12);
  padding-top: 20px;
  text-align: center;
  font-size: 0.8rem;
  color: rgba(245, 243, 247, 0.5);
}

/* --- SVG 面板 --- */
.svg-panel {
  background: var(--color-dark);
  border-radius: var(--radius-card);
  overflow: hidden;
  position: relative;
  aspect-ratio: 4 / 3;
}

.svg-panel svg {
  width: 100%;
  height: auto;
  display: block;
}

/* --- 焦点样式 --- */
*:focus-visible {
  outline: 3px solid var(--color-brand);
  outline-offset: 2px;
}

.btn-primary:focus-visible,
.btn-secondary:focus-visible {
  outline-color: var(--color-accent);
}

/* --- 响应式 --- */
@media (max-width: 768px) {
  .two-col {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .header-nav {
    gap: 16px;
  }

  .header-nav a.nav-link {
    display: none;
  }

  .news-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .header-inner {
    height: 56px;
  }

  .header-logo span {
    display: none;
  }

  .feature-pills {
    flex-direction: column;
  }
}

/* --- SVG 动效 Keyframes --- */

/* 数据点沿路径流动 */
@keyframes flow-dot {
  0% {
    stroke-dashoffset: 1;
  }
  50% {
    stroke-dashoffset: 0;
  }
  100% {
    stroke-dashoffset: 1;
  }
}

.flow-dot {
  pathLength: 1;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: flow-dot 4s ease-in-out infinite;
}

/* 气泡依次浮现后漂浮 */
@keyframes bubble-float {
  0%, 100% {
    transform: translateY(0);
    opacity: 1;
  }
  50% {
    transform: translateY(-6px);
    opacity: 0.85;
  }
}

.bubble-float-1 {
  animation: bubble-float 5s ease-in-out infinite;
}

.bubble-float-2 {
  animation: bubble-float 5s ease-in-out 0.8s infinite;
}

.bubble-float-3 {
  animation: bubble-float 5s ease-in-out 1.6s infinite;
}

/* 通知卡片滑入 */
@keyframes notify-slide {
  0%, 100% {
    transform: translateX(0);
    opacity: 1;
  }
  15% {
    transform: translateX(-8px);
    opacity: 0.7;
  }
  30% {
    transform: translateX(0);
    opacity: 1;
  }
}

.notify-slide {
  animation: notify-slide 6s ease-in-out infinite;
}

/* 输入三点呼吸 */
@keyframes dot-breathe {
  0%, 100% {
    opacity: 0.3;
  }
  50% {
    opacity: 1;
  }
}

.dot-breathe-1 {
  animation: dot-breathe 2s ease-in-out infinite;
}

.dot-breathe-2 {
  animation: dot-breathe 2s ease-in-out 0.3s infinite;
}

.dot-breathe-3 {
  animation: dot-breathe 2s ease-in-out 0.6s infinite;
}

/* 连接线流动 */
@keyframes dash-flow {
  0% {
    stroke-dashoffset: 1;
  }
  100% {
    stroke-dashoffset: 0;
  }
}

.dash-flow {
  pathLength: 1;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: dash-flow 3s linear infinite;
}

/* 设置面板元素脉冲 */
@keyframes pulse-glow {
  0%, 100% {
    opacity: 0.6;
  }
  50% {
    opacity: 1;
  }
}

.pulse-glow {
  animation: pulse-glow 4s ease-in-out infinite;
}

/* 消息列表项依次出现 */
@keyframes msg-appear {
  0%, 100% {
    transform: translateX(0);
    opacity: 1;
  }
  10% {
    transform: translateX(-4px);
    opacity: 0.6;
  }
  20% {
    transform: translateX(0);
    opacity: 1;
  }
}

.msg-appear-1 {
  animation: msg-appear 7s ease-in-out infinite;
}

.msg-appear-2 {
  animation: msg-appear 7s ease-in-out 1.2s infinite;
}

.msg-appear-3 {
  animation: msg-appear 7s ease-in-out 2.4s infinite;
}

/* 扫码配对旋转 */
@keyframes scan-rotate {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.scan-rotate {
  transform-box: fill-box;
  transform-origin: center;
  animation: scan-rotate 8s linear infinite;
}

/* --- 减少动态效果 --- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .flow-dot,
  .bubble-float-1,
  .bubble-float-2,
  .bubble-float-3,
  .notify-slide,
  .dot-breathe-1,
  .dot-breathe-2,
  .dot-breathe-3,
  .dash-flow,
  .pulse-glow,
  .msg-appear-1,
  .msg-appear-2,
  .msg-appear-3,
  .scan-rotate {
    animation: none !important;
  }
}
