/* SafeW 全站共享样式 */
:root {
  /* 色板 */
  --color-dark: #17203F;
  --color-paper: #FCFCFD;
  --color-text: #151823;
  --color-brand: #1441EB;
  --color-accent: #6EEDBD;
  
  /* 组件变量 */
  --radius-card: 8px;
  --radius-btn: 6px;
  --card-border: 0;
  --card-shadow: 0 10px 28px -14px rgba(21, 24, 35, 0.3);
  --section-y: clamp(5rem, 10vw, 9rem);
  --gap: clamp(1.5rem, 3vw, 2.5rem);
  --content-max: 960px;
  
  /* 排版 */
  --font-main: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --line-height-text: 1.75;
}

/* 基础重置与排版 */
*, *::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-main);
  font-size: 16px;
  line-height: var(--line-height-text);
  color: var(--color-text);
  background-color: var(--color-paper);
  max-width: 100%;
  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: 0 auto;
  padding: 0 var(--gap);
}

/* 页面区块通用结构 */
.section {
  padding-top: var(--section-y);
  padding-bottom: var(--section-y);
}

.section--dark {
  background-color: var(--color-dark);
  color: var(--color-paper);
}

.section__header {
  margin-bottom: var(--gap);
}

/* 眉标 */
.badge {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}

.section--light .badge {
  color: var(--color-brand);
}

.section--dark .badge {
  color: var(--color-accent);
}

/* 标题 */
h1, h2, h3, h4 {
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

h1 {
  font-size: clamp(2.4rem, 6vw, 4.5rem);
  line-height: 1.1;
}

h2 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  line-height: 1.25;
  margin-bottom: 0.5rem;
}

h3 {
  font-size: clamp(1.2rem, 2vw, 1.5rem);
  line-height: 1.2;
  margin-bottom: 0.75rem;
}

p {
  margin-bottom: 1rem;
  max-width: 38em;
}

/* 高亮关键词 */
.hl {
  font-weight: 800;
}

.section--light .hl {
  color: var(--color-brand);
}

.section--dark .hl {
  color: var(--color-accent);
}

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  height: 48px;
  padding: 0 1.5rem;
  border-radius: var(--radius-btn);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
  border: none;
  text-align: center;
  justify-content: center;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.btn--primary {
  background-color: var(--color-accent);
  color: var(--color-dark);
}

.btn--primary:hover {
  background-color: #5dd9aa;
}

.btn--secondary {
  background-color: transparent;
  border: 1px solid currentColor;
}

.section--light .btn--secondary {
  color: var(--color-text);
  border-color: var(--color-text);
}

.section--dark .btn--secondary {
  color: var(--color-paper);
  border-color: var(--color-paper);
}

.btn svg {
  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.1);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.section--dark ~ .site-header,
.site-header--dark {
  background-color: var(--color-dark);
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 800;
  font-size: 1.2rem;
  color: var(--color-text);
}

.section--dark .logo {
  color: var(--color-paper);
}

.logo img {
  width: 32px;
  height: 32px;
}

.nav {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.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);
}

.section--dark .nav a:hover {
  color: var(--color-accent);
}

.nav a[aria-current="page"] {
  color: var(--color-brand);
  font-weight: 700;
}

.section--dark .nav a[aria-current="page"] {
  color: var(--color-accent);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* 移动端菜单按钮 */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  color: var(--color-text);
}

.section--dark .menu-toggle {
  color: var(--color-paper);
}

.menu-toggle svg {
  width: 24px;
  height: 24px;
}

/* 页脚 */
.site-footer {
  background-color: var(--color-dark);
  color: var(--color-paper);
  padding: var(--section-y) 0;
}

.footer-inner {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--gap);
}

.footer-col h4 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--color-accent);
}

.footer-col ul li {
  margin-bottom: 0.5rem;
}

.footer-col ul li a {
  font-size: 0.9rem;
  opacity: 0.8;
  transition: opacity 0.2s ease;
}

.footer-col ul li a:hover {
  opacity: 1;
}

.footer-bottom {
  margin-top: var(--gap);
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
  font-size: 0.85rem;
  opacity: 0.6;
}

/* 卡片 */
.card {
  background-color: var(--color-paper);
  border-radius: var(--radius-card);
  box-shadow: var(--card-shadow);
  padding: 1.5rem;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.card:hover {
  box-shadow: 0 12px 32px -12px rgba(21, 24, 35, 0.4);
  transform: translateY(-2px);
}

.card--no-shadow {
  box-shadow: none;
}

/* 特性胶囊 */
.capsule {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  background-color: rgba(20, 65, 235, 0.08);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-brand);
}

.capsule svg {
  width: 16px;
  height: 16px;
}

/* 功能列表 */
.feature-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--gap);
}

.feature-item {
  padding: 1.5rem;
  border-radius: var(--radius-card);
  background-color: var(--color-paper);
  border: 1px solid rgba(21, 24, 35, 0.08);
}

.feature-item__icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background-color: rgba(20, 65, 235, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}

.feature-item__icon svg {
  width: 20px;
  height: 20px;
  color: var(--color-brand);
}

.feature-item h3 {
  margin-bottom: 0.5rem;
}

.feature-item p {
  font-size: 0.95rem;
  color: rgba(21, 24, 35, 0.8);
  margin-bottom: 0;
}

/* 流程条 */
.flow-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin: 2rem 0;
}

.flow-node {
  flex: 1;
  min-width: 150px;
  text-align: center;
  padding: 1rem;
  background-color: var(--color-paper);
  border-radius: var(--radius-card);
  border: 1px solid rgba(21, 24, 35, 0.08);
}

.flow-node strong {
  display: block;
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.flow-node span {
  font-size: 0.8rem;
  opacity: 0.7;
}

.flow-arrow {
  width: 24px;
  height: 24px;
  color: var(--color-brand);
  flex-shrink: 0;
}

/* 编号徽标 */
.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background-color: var(--color-accent);
  color: var(--color-dark);
  font-weight: 800;
  font-size: 0.9rem;
  margin-right: 0.75rem;
  flex-shrink: 0;
}

.steps-list {
  counter-reset: step;
}

.steps-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  padding-left: 0;
}

.steps-list li::before {
  counter-increment: step;
  content: counter(step);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background-color: var(--color-accent);
  color: var(--color-dark);
  font-weight: 800;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.steps-list li p {
  margin: 0;
  flex: 1;
}

/* 表格 */
.table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-card);
  border: 1px solid rgba(21, 24, 35, 0.08);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

th, td {
  padding: 1rem 1.25rem;
  text-align: left;
  border-bottom: 1px solid rgba(21, 24, 35, 0.08);
}

th {
  font-weight: 700;
  background-color: rgba(20, 65, 235, 0.04);
  white-space: nowrap;
}

td:first-child {
  font-weight: 600;
  white-space: nowrap;
}

tr:last-child th,
tr:last-child td {
  border-bottom: none;
}

/* FAQ */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

details {
  border: 1px solid rgba(21, 24, 35, 0.08);
  border-radius: var(--radius-card);
  padding: 1.25rem;
  transition: border-color 0.2s ease;
}

details:hover {
  border-color: rgba(20, 65, 235, 0.2);
}

summary {
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

summary::-webkit-details-marker {
  display: none;
}

summary::after {
  content: "";
  width: 16px;
  height: 16px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23151823' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

details[open] summary::after {
  transform: rotate(180deg);
}

details > :last-child {
  margin-top: 1rem;
  font-size: 0.95rem;
  line-height: 1.7;
  color: rgba(21, 24, 35, 0.8);
}

/* 提示框 */
.callout {
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius-card);
  border-left: 4px solid var(--color-brand);
  background-color: rgba(20, 65, 235, 0.04);
  margin: 1.5rem 0;
}

.callout--accent {
  border-left-color: var(--color-accent);
  background-color: rgba(110, 237, 189, 0.08);
}

.callout p {
  margin: 0;
  font-size: 0.95rem;
}

/* 新闻卡片 */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--gap);
}

.news-card {
  padding: 1.5rem;
  border-radius: var(--radius-card);
  background-color: var(--color-paper);
  border: 1px solid rgba(21, 24, 35, 0.08);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.news-card:hover {
  box-shadow: var(--card-shadow);
  transform: translateY(-2px);
}

.news-card time {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-brand);
  display: block;
  margin-bottom: 0.5rem;
}

.news-card h3 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.news-card p {
  font-size: 0.9rem;
  color: rgba(21, 24, 35, 0.7);
  margin-bottom: 0;
}

/* SVG 容器 */
.svg-container {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

.svg-container svg {
  width: 100%;
  height: auto;
}

/* SVG 动效 */
@keyframes float-gentle {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

@keyframes float-delayed {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px);
  }
}

@keyframes breathe {
  0%, 100% {
    opacity: 0.4;
  }
  50% {
    opacity: 1;
  }
}

@keyframes draw-line {
  0% {
    stroke-dashoffset: 1;
  }
  100% {
    stroke-dashoffset: 0;
  }
}

@keyframes slide-in-right {
  0% {
    transform: translateX(30px);
    opacity: 0;
  }
  100% {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes pulse-dot {
  0%, 100% {
    transform: scale(1);
    opacity: 0.6;
  }
  50% {
    transform: scale(1.3);
    opacity: 1;
  }
}

.anim-float {
  animation: float-gentle 6s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: center;
}

.anim-float-delayed {
  animation: float-delayed 7s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: center;
}

.anim-breathe {
  animation: breathe 3s ease-in-out infinite;
}

.anim-draw {
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: draw-line 4s ease-in-out infinite alternate;
}

.anim-slide-in {
  animation: slide-in-right 2s ease-out forwards;
}

.anim-pulse {
  animation: pulse-dot 2s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: center;
}

/* 减少动态效果 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  .anim-float,
  .anim-float-delayed,
  .anim-breathe,
  .anim-draw,
  .anim-slide-in,
  .anim-pulse {
    animation: none !important;
  }
}

/* 响应式 */
@media (max-width: 768px) {
  .nav {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background-color: var(--color-paper);
    flex-direction: column;
    padding: 1.5rem;
    gap: 1rem;
    border-bottom: 1px solid rgba(21, 24, 35, 0.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  }
  
  .section--dark ~ .nav,
  .nav--dark {
    background-color: var(--color-dark);
  }
  
  .nav.active {
    display: flex;
  }
  
  .menu-toggle {
    display: block;
  }
  
  .header-actions .btn {
    display: none;
  }
  
  .flow-bar {
    flex-direction: column;
  }
  
  .flow-arrow {
    transform: rotate(90deg);
  }
  
  .feature-list {
    grid-template-columns: 1fr;
  }
  
  .news-grid {
    grid-template-columns: 1fr;
  }
  
  .footer-inner {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .feature-list {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* 焦点可见样式 */
*:focus-visible {
  outline: 2px solid var(--color-brand);
  outline-offset: 2px;
}

.section--dark *:focus-visible {
  outline-color: var(--color-accent);
}

/* 工具类 */
.text-center {
  text-align: center;
}

.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }

.gap-sm { gap: 0.5rem; }
.gap-md { gap: 1rem; }

.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }

.opacity-70 { opacity: 0.7; }
.opacity-80 { opacity: 0.8; }
