/* === SafeW 全站共享样式 === */

/* --- 设计变量 --- */
:root {
  /* 色板 */
  --color-dark: #271334;
  --color-paper: #E9E8EA;
  --color-text: #1D1523;
  --color-brand: #8A13DD;
  --color-accent: #9EED6E;

  /* 圆角 */
  --radius-card: 20px;
  --radius-btn: 12px;

  /* 卡片边界 */
  --card-border: 0;
  --card-shadow: none;

  /* 节奏与密度 */
  --section-y: clamp(2.5rem, 5vw, 4rem);
  --gap: clamp(0.75rem, 1.5vw, 1.25rem);

  /* 内容最大宽度 */
  --content-max: 960px;

  /* 字体 */
  --font-sans: "PingFang SC", "Noto Sans SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;

  /* 间距系统 */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;
}

/* --- 深色面取色覆盖 --- */
.dark-surface {
  --bg: var(--color-dark);
  --text: var(--color-paper);
  --brand: var(--color-accent);
  --accent: var(--color-accent);
  --subtle: rgba(233, 232, 234, 0.6);
}

/* --- 浅色卡片（置于深色区块内）取色回纸面 --- */
.paper-card {
  --bg: var(--color-paper);
  --text: var(--color-text);
  --brand: var(--color-brand);
  --accent: var(--color-accent);
  --subtle: rgba(29, 21, 35, 0.08);
}

/* --- 重置与基础 --- */
*, *::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);
  font-size: 16px;
  line-height: 1.55;
  color: var(--color-text);
  background-color: var(--color-paper);
  overflow-x: hidden;
}

img, svg {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

ul, ol {
  list-style: none;
}

/* --- 容器 --- */
.container {
  max-width: var(--content-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--gap);
  padding-right: var(--gap);
}

/* --- 页头 --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(233, 232, 234, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(29, 21, 35, 0.08);
  transition: box-shadow 0.3s ease;
}

.site-header.scrolled {
  box-shadow: 0 2px 12px rgba(29, 21, 35, 0.06);
}

.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: var(--space-sm);
}

.brand img {
  height: 32px;
  width: auto;
}

.brand-name {
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
  color: var(--color-text);
}

.nav {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}

.nav a {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-text);
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-btn);
  transition: color 0.2s, background 0.2s;
}

.nav a:hover,
.nav a[aria-current="page"] {
  color: var(--color-brand);
  background: rgba(138, 19, 221, 0.06);
}

.nav .btn-nav {
  background: var(--color-accent);
  color: var(--color-dark);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-btn);
  font-weight: 700;
  font-size: 0.85rem;
  transition: transform 0.2s ease, background 0.2s;
}

.nav .btn-nav:hover {
  transform: translateY(-1px);
  background: #8dd95e;
}

/* --- 按钮 --- */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  background: var(--color-accent);
  color: var(--color-dark);
  font-weight: 700;
  font-size: 1rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-btn);
  border: none;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s, box-shadow 0.2s;
  min-height: 48px;
}

.btn-primary:hover {
  transform: translateY(-2px);
  background: #8dd95e;
  box-shadow: 0 4px 16px rgba(158, 237, 110, 0.3);
}

.btn-primary:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--color-dark), 0 0 0 5px var(--color-accent);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  background: transparent;
  color: var(--color-text);
  font-weight: 600;
  font-size: 1rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-btn);
  border: 2px solid var(--color-text);
  cursor: pointer;
  transition: transform 0.2s ease, color 0.2s, border-color 0.2s;
  min-height: 48px;
}

.btn-secondary:hover {
  transform: translateY(-2px);
  color: var(--color-brand);
  border-color: var(--color-brand);
}

.btn-secondary:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--color-brand);
}

/* 深色面上的按钮变体 */
.dark-surface .btn-secondary {
  color: var(--color-paper);
  border-color: var(--color-paper);
}

.dark-surface .btn-secondary:hover {
  color: var(--color-accent);
  border-color: var(--color-accent);
}

/* --- 眉标 --- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-brand);
  margin-bottom: var(--space-md);
}

.dark-surface .eyebrow {
  color: var(--color-accent);
}

.eyebrow::before {
  content: "";
  display: inline-block;
  width: 3px;
  height: 14px;
  background: currentColor;
  border-radius: 2px;
}

/* --- 标题 --- */
h1 {
  font-size: clamp(2.4rem, 6vw, 4.5rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  text-wrap: balance;
  color: var(--color-text);
}

h2 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  text-wrap: balance;
  color: var(--color-text);
}

h3 {
  font-size: clamp(1.1rem, 2vw, 1.35rem);
  font-weight: 700;
  line-height: 1.25;
  color: var(--color-text);
  margin-bottom: var(--space-md);
}

.dark-surface h1,
.dark-surface h2,
.dark-surface h3 {
  color: var(--color-paper);
}

/* 高亮关键词 */
.hl {
  color: var(--color-brand);
}

.dark-surface .hl {
  color: var(--color-accent);
}

/* --- 正文 --- */
.body-text {
  font-size: clamp(0.95rem, 1.2vw, 1.05rem);
  line-height: 1.55;
  color: var(--color-text);
  max-width: 38em;
}

.dark-surface .body-text {
  color: var(--color-paper);
}

.body-text-subtle {
  font-size: 0.85rem;
  color: var(--subtle, rgba(29, 21, 35, 0.5));
  margin-top: var(--space-sm);
}

.dark-surface .body-text-subtle {
  color: rgba(233, 232, 234, 0.5);
}

/* --- 段落 --- */
p {
  margin-bottom: var(--space-md);
}

/* --- 列表 --- */
.content-list {
  padding-left: 0;
}

.content-list li {
  position: relative;
  padding-left: 1.5em;
  margin-bottom: var(--space-sm);
  line-height: 1.6;
}

.content-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 6px;
  height: 6px;
  border-radius: 2px;
  background: var(--color-brand);
  transform: rotate(45deg);
}

.dark-surface .content-list li::before {
  background: var(--color-accent);
}

/* --- 编号步骤 --- */
.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: var(--color-accent);
  color: var(--color-dark);
  font-weight: 800;
  font-size: 0.8rem;
  border-radius: 8px;
  flex-shrink: 0;
}

.step-item {
  display: flex;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.step-item p {
  margin-bottom: 0;
}

/* --- 区块 --- */
.section {
  padding-top: var(--section-y);
  padding-bottom: var(--section-y);
  overflow-x: hidden;
  width: 100%;
}

.section-dark {
  background: var(--color-dark);
}

.section-paper {
  background: var(--color-paper);
}

.section-alt {
  background: #dddce0;
}

/* --- 图文交错行 --- */
.text-image-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2xl);
  align-items: center;
}

.text-image-row.reverse {
  direction: rtl;
}

.text-image-row.reverse > * {
  direction: ltr;
}

.visual-panel {
  background: var(--color-dark);
  border-radius: var(--radius-card);
  padding: var(--space-xl);
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.visual-panel svg {
  width: 100%;
  height: 100%;
  max-width: 100%;
}

/* --- 表格 --- */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.data-table th,
.data-table td {
  padding: var(--space-md) var(--space-lg);
  text-align: left;
  border-bottom: 1px solid var(--subtle, rgba(29, 21, 35, 0.1));
}

.data-table th {
  font-weight: 700;
  color: var(--color-text);
}

.dark-surface .data-table th {
  color: var(--color-paper);
}

.data-table td:first-child {
  font-weight: 600;
  white-space: nowrap;
}

.data-table tr:last-child th,
.data-table tr:last-child td {
  border-bottom: none;
}

/* --- FAQ --- */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.faq-item {
  border-radius: var(--radius-card);
  overflow: hidden;
  background: var(--subtle, rgba(29, 21, 35, 0.04));
  border: var(--card-border, 0);
}

.dark-surface .faq-item {
  background: rgba(233, 232, 234, 0.06);
}

.faq-item summary {
  padding: var(--space-lg);
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  transition: color 0.2s;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "";
  display: inline-block;
  width: 12px;
  height: 12px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform 0.3s ease;
  flex-shrink: 0;
}

.faq-item[open] summary::after {
  transform: rotate(-135deg);
}

.faq-item summary:hover {
  color: var(--color-brand);
}

.dark-surface .faq-item summary:hover {
  color: var(--color-accent);
}

.faq-item summary:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 2px var(--color-brand);
}

.dark-surface .faq-item summary:focus-visible {
  box-shadow: inset 0 0 0 2px var(--color-accent);
}

.faq-item .faq-answer {
  padding: 0 var(--space-lg) var(--space-lg);
  line-height: 1.6;
  color: var(--color-text);
}

.dark-surface .faq-item .faq-answer {
  color: var(--color-paper);
}

/* --- 新闻卡片 --- */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--gap);
}

.news-card {
  border-radius: var(--radius-card);
  background: var(--subtle, rgba(29, 21, 35, 0.04));
  padding: var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  transition: transform 0.2s ease;
}

.news-card:hover {
  transform: translateY(-2px);
}

.news-card time {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--subtle, rgba(29, 21, 35, 0.5));
}

.news-card h3 {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: var(--space-xs);
}

.news-card p {
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--subtle, rgba(29, 21, 35, 0.7));
  margin-bottom: 0;
}

.dark-surface .news-card {
  background: rgba(233, 232, 234, 0.06);
}

.dark-surface .news-card time {
  color: rgba(233, 232, 234, 0.5);
}

.dark-surface .news-card p {
  color: rgba(233, 232, 234, 0.65);
}

/* --- 特性胶囊 --- */
.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-top: var(--space-lg);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-sm) var(--space-md);
  border-radius: 100px;
  background: rgba(138, 19, 221, 0.08);
  color: var(--color-brand);
  font-size: 0.85rem;
  font-weight: 600;
}

.dark-surface .chip {
  background: rgba(158, 237, 110, 0.12);
  color: var(--color-accent);
}

.chip svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* --- 提示框 --- */
.callout {
  border-radius: var(--radius-card);
  padding: var(--space-lg);
  border-left: 4px solid var(--color-brand);
  background: rgba(138, 19, 221, 0.04);
  margin: var(--space-lg) 0;
}

.dark-surface .callout {
  border-left-color: var(--color-accent);
  background: rgba(158, 237, 110, 0.06);
}

.callout p {
  margin-bottom: 0;
  font-size: 0.95rem;
}

/* --- 页脚 --- */
.site-footer {
  background: var(--color-dark);
  color: var(--color-paper);
  padding: var(--space-2xl) 0;
}

.footer-inner {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--gap);
  display: flex;
  flex-direction: column;
  gap: var(--space-xl);
}

.footer-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: var(--space-xl);
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.footer-brand img {
  height: 28px;
  width: auto;
}

.footer-brand span {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--color-paper);
}

.footer-links {
  display: flex;
  gap: var(--space-xl);
  flex-wrap: wrap;
}

.footer-links ul {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.footer-links a {
  font-size: 0.85rem;
  color: rgba(233, 232, 234, 0.6);
  transition: color 0.2s;
}

.footer-links a:hover {
  color: var(--color-accent);
}

.footer-bottom {
  border-top: 1px solid rgba(233, 232, 234, 0.1);
  padding-top: var(--space-lg);
  font-size: 0.8rem;
  color: rgba(233, 232, 234, 0.4);
  text-align: center;
}

/* --- SVG 动效 --- */
@keyframes float-lift {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

@keyframes float-lift-slow {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

@keyframes float-lift-delayed {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

@keyframes bubble-in {
  0%, 10% { opacity: 0; transform: translateY(12px); }
  15%, 85% { opacity: 1; transform: translateY(0); }
  90%, 100% { opacity: 0; transform: translateY(-8px); }
}

@keyframes bubble-in-delayed {
  0%, 20% { opacity: 0; transform: translateY(12px); }
  25%, 75% { opacity: 1; transform: translateY(0); }
  80%, 100% { opacity: 0; transform: translateY(-8px); }
}

@keyframes bubble-in-slow {
  0%, 30% { opacity: 0; transform: translateY(12px); }
  35%, 65% { opacity: 1; transform: translateY(0); }
  70%, 100% { opacity: 0; transform: translateY(-8px); }
}

@keyframes dash-flow {
  0% { stroke-dashoffset: 1; }
  50% { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: 1; }
}

@keyframes pulse-dot {
  0%, 100% { opacity: 0.3; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.3); }
}

@keyframes slide-in-left {
  0%, 10% { opacity: 0; transform: translateX(-20px); }
  15%, 85% { opacity: 1; transform: translateX(0); }
  90%, 100% { opacity: 0; transform: translateX(-10px); }
}

@keyframes slide-in-right {
  0%, 10% { opacity: 0; transform: translateX(20px); }
  15%, 85% { opacity: 1; transform: translateX(0); }
  90%, 100% { opacity: 0; transform: translateX(10px); }
}

@keyframes typing-dots {
  0%, 60%, 100% { opacity: 0.3; }
  30% { opacity: 1; }
}

@keyframes notif-slide {
  0%, 8% { opacity: 0; transform: translateY(-16px); }
  12%, 88% { opacity: 1; transform: translateY(0); }
  92%, 100% { opacity: 0; transform: translateY(-8px); }
}

/* 动效类 */
.anim-float {
  animation: float-lift 6s ease-in-out infinite;
}

.anim-float-slow {
  animation: float-lift-slow 8s ease-in-out infinite;
}

.anim-float-delayed {
  animation: float-lift-delayed 7s ease-in-out infinite;
  animation-delay: -2s;
}

.anim-bubble-1 {
  animation: bubble-in 8s ease-in-out infinite;
}

.anim-bubble-2 {
  animation: bubble-in-delayed 8s ease-in-out infinite;
  animation-delay: -2.5s;
}

.anim-bubble-3 {
  animation: bubble-in-slow 8s ease-in-out infinite;
  animation-delay: -5s;
}

.anim-dash {
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: dash-flow 4s ease-in-out infinite;
}

.anim-pulse {
  animation: pulse-dot 2s ease-in-out infinite;
}

.anim-slide-left {
  animation: slide-in-left 10s ease-in-out infinite;
}

.anim-slide-right {
  animation: slide-in-right 10s ease-in-out infinite;
}

.anim-typing-dot {
  animation: typing-dots 1.5s ease-in-out infinite;
}

.anim-typing-dot-2 {
  animation: typing-dots 1.5s ease-in-out infinite;
  animation-delay: 0.3s;
}

.anim-typing-dot-3 {
  animation: typing-dots 1.5s ease-in-out infinite;
  animation-delay: 0.6s;
}

.anim-notif {
  animation: notif-slide 12s ease-in-out infinite;
}

/* 旋转/缩放中心 */
.anim-rotate-center {
  transform-box: fill-box;
  transform-origin: center;
}

/* --- 响应式 --- */
@media (max-width: 768px) {
  .header-inner {
    height: 56px;
  }

  .nav {
    gap: var(--space-md);
  }

  .nav a:not(.btn-nav) {
    display: none;
  }

  .text-image-row {
    grid-template-columns: 1fr;
    gap: var(--space-xl);
  }

  .text-image-row.reverse {
    direction: ltr;
  }

  .visual-panel {
    aspect-ratio: 16 / 10;
  }

  .footer-top {
    flex-direction: column;
  }

  .footer-links {
    flex-direction: column;
    gap: var(--space-lg);
  }

  .news-grid {
    grid-template-columns: 1fr;
  }

  .hero-layout {
    grid-template-columns: 1fr !important;
  }

  .hero-visual {
    order: -1;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  .anim-float,
  .anim-float-slow,
  .anim-float-delayed,
  .anim-bubble-1,
  .anim-bubble-2,
  .anim-bubble-3,
  .anim-dash,
  .anim-pulse,
  .anim-slide-left,
  .anim-slide-right,
  .anim-typing-dot,
  .anim-typing-dot-2,
  .anim-typing-dot-3,
  .anim-notif {
    animation: none !important;
  }
}

/* 兜底：裁掉横向溢出 */
body > * {
  overflow-x: clip;
}
