/* =========================================
   SafeW 全站共享样式 (style.css)
   ========================================= */

/* --- 设计 Token / 变量 --- */
:root {
  /* 色板 */
  --color-dark-surface: #1B1231;
  --color-paper-surface: #DBD4ED;
  --color-text-body: #191523;
  --color-brand: #5214EB;
  --color-accent: #9977EE;

  /* 派生色 (用于分割线、次要底色，不用于正文文字) */
  --color-border-light: rgba(25, 21, 35, 0.1);
  --color-dark-card-bg: #251C3D;
  
  /* 圆角 */
  --radius-card: 24px;
  --radius-btn: 999px;
  
  /* 卡片边界 */
  --card-border: 0;
  --card-shadow: none;
  
  /* 节奏与密度 */
  --section-y: clamp(5rem, 10vw, 9rem);
  --gap: clamp(1.5rem, 3vw, 2.5rem);
  --content-max: 1120px;
  
  /* 字体 */
  --font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
}

/* --- 基础重置 --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-family);
  font-size: 16px;
  line-height: 1.75;
  color: var(--color-text-body);
  background-color: var(--color-paper-surface);
  overflow-x: hidden;
}

img, svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

ul, ol {
  list-style: none;
}

/* --- 排版工具 --- */
.container {
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--gap);
}

.section {
  padding-top: var(--section-y);
  padding-bottom: var(--section-y);
  position: relative;
}

.section--dark {
  background-color: var(--color-dark-surface);
  color: var(--color-paper-surface);
}

.section--paper {
  background-color: var(--color-paper-surface);
  color: var(--color-text-body);
}

/* 眉标 */
.breadcrumb-label {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
  color: var(--color-brand);
}

.section--dark .breadcrumb-label {
  color: var(--color-accent);
}

/* 标题 */
h1, h2, h3, h4 {
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: 0.02em;
}

h1 {
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  letter-spacing: -0.02em;
  margin-bottom: 1.5rem;
}

h2 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  margin-bottom: 1.25rem;
}

h3 {
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
}

/* 关键词高亮 */
.hl {
  color: var(--color-brand);
}

.section--dark .hl {
  color: var(--color-accent);
}

/* 正文限制宽度 */
.text-content {
  max-width: 38em;
}

/* --- 按钮 --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  height: 52px;
  padding: 0 24px;
  border-radius: var(--radius-btn);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.2s ease, background-color 0.2s ease, opacity 0.2s ease;
  border: none;
  text-align: center;
}

.btn--primary {
  background-color: var(--color-accent);
  color: var(--color-dark-surface);
}

.btn--primary:hover {
  transform: translateY(-2px);
  filter: brightness(1.1);
}

.btn--secondary {
  background-color: transparent;
  border: 2px solid var(--color-text-body);
  color: var(--color-text-body);
}

.section--dark .btn--secondary {
  border-color: var(--color-paper-surface);
  color: var(--color-paper-surface);
}

.btn--secondary:hover {
  transform: translateY(-2px);
  opacity: 0.9;
}

.btn:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 2px;
}

/* --- 卡片与面板 --- */
.card {
  background-color: var(--color-dark-card-bg);
  border-radius: var(--radius-card);
  border: var(--card-border);
  box-shadow: var(--card-shadow);
  padding: var(--gap);
  transition: transform 0.3s ease;
}

.card--light {
  background-color: #ffffff;
}

.card--hover:hover {
  transform: translateY(-4px);
}

.panel {
  background-color: var(--color-dark-surface);
  border-radius: var(--radius-card);
  padding: 2rem;
  overflow: hidden;
  position: relative;
}

.panel--accent {
  background-color: var(--color-brand);
}

/* --- 表格 --- */
.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-card);
  border: 1px solid var(--color-border-light);
  max-width: 100%;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 100%;
}

th, td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid var(--color-border-light);
}

th {
  font-weight: 700;
  background-color: rgba(25, 21, 35, 0.05);
}

td:first-child {
  font-weight: 600;
}

/* --- FAQ --- */
.faq-item {
  border-bottom: 1px solid var(--color-border-light);
  margin-bottom: 0.5rem;
}

.faq-item summary {
  padding: 1.25rem 0;
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  position: relative;
  padding-right: 2rem;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.5rem;
  font-weight: 400;
  color: var(--color-brand);
}

.faq-item[open] summary::after {
  content: "-";
}

.faq-item p {
  padding-bottom: 1.25rem;
  color: rgba(25, 21, 35, 0.8);
  line-height: 1.8;
}

/* --- 页头 --- */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: rgba(219, 212, 237, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--color-border-light);
  padding: 1rem 0;
}

.section--dark ~ .header,
.header--dark {
  background-color: rgba(27, 18, 49, 0.9);
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

.header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo img {
  height: 32px;
  width: auto;
}

.nav {
  display: flex;
  gap: 2rem;
  align-items: center;
}

.nav a {
  font-weight: 500;
  font-size: 0.95rem;
  opacity: 0.8;
  transition: opacity 0.2s;
}

.nav a:hover,
.nav a[aria-current="page"] {
  opacity: 1;
  color: var(--color-brand);
}

.section--dark .nav a {
  color: var(--color-paper-surface);
}

.section--dark .nav a:hover,
.section--dark .nav a[aria-current="page"] {
  color: var(--color-accent);
}

/* --- 页脚 --- */
.footer {
  padding: 4rem 0 2rem;
  border-top: 1px solid var(--color-border-light);
  background-color: var(--color-paper-surface);
  color: var(--color-text-body);
}

.section--dark .footer {
  background-color: var(--color-dark-surface);
  color: var(--color-paper-surface);
  border-top-color: rgba(255, 255, 255, 0.1);
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  margin-bottom: 3rem;
}

.footer-col h4 {
  font-size: 1rem;
  margin-bottom: 1rem;
  color: var(--color-brand);
}

.section--dark .footer-col h4 {
  color: var(--color-accent);
}

.footer-col ul li {
  margin-bottom: 0.5rem;
}

.footer-col a {
  font-size: 0.9rem;
  opacity: 0.8;
}

.footer-col a:hover {
  opacity: 1;
  text-decoration: underline;
}

.footer-bottom {
  text-align: center;
  font-size: 0.85rem;
  opacity: 0.6;
  padding-top: 2rem;
  border-top: 1px solid var(--color-border-light);
}

/* --- 响应式 --- */
@media (max-width: 768px) {
  .nav {
    display: none; /* 简化移动端，仅保留主要按钮或汉堡菜单逻辑可后续扩展，此处保持简洁 */
  }
  
  .header .container {
    justify-content: space-between;
  }
  
  .hero-layout {
    flex-direction: column-reverse;
  }
  
  .hero-visual {
    width: 100%;
    margin-bottom: 2rem;
  }
  
  .features-grid {
    grid-template-columns: 1fr;
  }
  
  .steps-list {
    flex-direction: column;
    gap: 1.5rem;
  }
}

/* --- SVG 动效 Keyframes & Classes --- */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

@keyframes breathe {
  0%, 100% { opacity: 0.6; transform: scale(0.98); }
  50% { opacity: 1; transform: scale(1.02); }
}

@keyframes slideInRight {
  0% { transform: translateX(30px); opacity: 0; }
  100% { transform: translateX(0); opacity: 1; }
}

@keyframes drawLine {
  0% { stroke-dashoffset: 1; }
  100% { stroke-dashoffset: 0; }
}

@keyframes pulseDot {
  0%, 100% { opacity: 0.4; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.2); }
}

.svg-float {
  animation: float 6s ease-in-out infinite;
}

.svg-breathe {
  animation: breathe 4s ease-in-out infinite;
}

.svg-slide-in {
  animation: slideInRight 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
  /* 初始状态已处理为完全显示，避免依赖动画 */
  opacity: 1; 
  transform: translateX(0);
}

/* 针对路径描边动画 */
.svg-draw {
  path {
    pathLength: 1;
    stroke-dasharray: 1;
    stroke-dashoffset: 0;
  }
}

.svg-draw-path {
  animation: drawLine 3s ease-in-out infinite alternate;
}

.svg-pulse-dot {
  animation: pulseDot 2s 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;
    scroll-behavior: auto !important;
  }
  
  .svg-float, .svg-breathe, .svg-slide-in, .svg-draw-path, .svg-pulse-dot {
    animation: none;
    opacity: 1;
    transform: none;
  }
}
