/* =========================================
   SafeW 全局样式与动效
   ========================================= */

:root {
  /* 色板 */
  --color-dark: #21163C;
  --color-paper: #E9E8EA;
  --color-text: #191523;
  --color-brand: #5214EB;
  --color-accent: #ED926E;
  
  /* 结构变量 */
  --radius-card: 20px;
  --radius-btn: 12px;
  --card-border: 0;
  --card-shadow: 0 10px 28px -14px rgba(25, 21, 35, 0.3);
  --section-y: clamp(3.5rem, 7vw, 6rem);
  --gap: clamp(1rem, 2vw, 1.75rem);
  --content-max: 1120px;
  
  /* 字体与排版 */
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", "PingFang SC", sans-serif;
  --line-height-base: 1.65;
  --line-height-tight: 1.15;
}

*, *::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: var(--line-height-base);
  color: var(--color-text);
  background-color: var(--color-paper);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, svg {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
  transition: opacity 0.2s ease;
}

a:focus-visible, button:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 4px;
  border-radius: 4px;
}

/* 布局容器 */
.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--paper {
  background-color: var(--color-paper);
  border-bottom: 1px solid rgba(25, 21, 35, 0.08);
}

.section--dark {
  background-color: var(--color-dark);
  color: var(--color-paper);
}

.section--dark .hl {
  color: var(--color-accent);
}

.section--dark h2, .section--dark h3, .section--dark p, .section--dark li {
  color: var(--color-paper);
}

.section--dark a {
  color: var(--color-accent);
}

.section__badge {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  margin-bottom: 0.8rem;
  text-transform: uppercase;
}

.section--paper .section__badge {
  color: var(--color-brand);
}

.section__title {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 500;
  line-height: var(--line-height-tight);
  letter-spacing: -0.02em;
  margin-bottom: calc(var(--gap) * 0.8);
}

.section--paper .section__title {
  color: var(--color-text);
}

.section__title .hl {
  color: var(--color-brand);
}

.section__lead {
  font-size: 1.125rem;
  max-width: 65ch;
  margin-bottom: calc(var(--gap) * 1.5);
  opacity: 0.9;
}

/* 标题高亮 */
.hl {
  color: var(--color-brand);
}

/* 按钮系统 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  height: 52px;
  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-decoration: none;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn--primary {
  background-color: var(--color-accent);
  color: var(--color-dark);
}

.btn--primary:hover {
  background-color: #e08560;
  box-shadow: 0 6px 16px rgba(237, 146, 110, 0.4);
}

.btn--outline {
  background: transparent;
  border: 2px solid var(--color-text);
  color: var(--color-text);
}

.section--dark .btn--outline {
  border-color: var(--color-paper);
  color: var(--color-paper);
}

.btn__icon {
  width: 20px;
  height: 20px;
  stroke-width: 2;
}

/* 网格与排版辅助 */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  gap: var(--gap);
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  gap: var(--gap);
}

.text-center { text-align: center; }
.max-w-prose { max-width: 38em; }
.mx-auto { margin-left: auto; margin-right: auto; }

p, ul, ol {
  margin-bottom: 1.2em;
}

ul, ol {
  padding-left: 1.5em;
}

li {
  margin-bottom: 0.5em;
}

/* 卡片系统 */
.card {
  background-color: var(--color-paper);
  border-radius: var(--radius-card);
  border: var(--card-border);
  box-shadow: var(--card-shadow);
  padding: calc(var(--gap) * 1.2);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 32px -12px rgba(25, 21, 35, 0.35);
}

/* 表格系统 */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-card);
  background-color: var(--color-paper);
  box-shadow: var(--card-shadow);
  margin-top: var(--gap);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 500px;
}

th, td {
  padding: 1rem 1.5rem;
  text-align: left;
  border-bottom: 1px solid rgba(25, 21, 35, 0.08);
}

th {
  font-weight: 600;
  background-color: rgba(25, 21, 35, 0.03);
}

td a {
  color: var(--color-brand);
  word-break: break-all;
}

/* FAQ 系统 */
.faq-list {
  list-style: none;
  padding: 0;
}

.faq-item {
  border-bottom: 1px solid rgba(25, 21, 35, 0.1);
  padding: 1.2rem 0;
}

.faq-item details summary {
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.faq-item details summary::-webkit-details-marker {
  display: none;
}

.faq-item details summary::after {
  content: "+";
  font-size: 1.4rem;
  font-weight: 400;
  transition: transform 0.2s ease;
}

.faq-item details[open] summary::after {
  transform: rotate(45deg);
}

.faq-item details p {
  margin-top: 0.8rem;
  opacity: 0.85;
  line-height: 1.7;
}

/* 页头页脚 */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: rgba(233, 232, 234, 0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(25, 21, 35, 0.06);
  padding: 0.8rem 0;
}

.site-footer {
  background-color: var(--color-dark);
  color: var(--color-paper);
  padding: 3rem 0 2rem;
  font-size: 0.9rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--gap);
  margin-bottom: 2rem;
}

.footer-col h4 {
  color: var(--color-accent);
  margin-bottom: 1rem;
  font-size: 1rem;
}

.footer-col ul {
  list-style: none;
  padding: 0;
}

.footer-col li {
  margin-bottom: 0.6rem;
}

.footer-col a:hover {
  opacity: 0.8;
  text-decoration: underline;
}

.footer-copy {
  border-top: 1px solid rgba(233, 232, 234, 0.1);
  padding-top: 1.5rem;
  text-align: center;
  opacity: 0.7;
}

/* 导航链接 */
.nav-link {
  font-weight: 500;
  padding: 0.4rem 0.8rem;
  border-radius: 8px;
  transition: background 0.2s;
}

.nav-link:hover {
  background-color: rgba(25, 21, 35, 0.05);
}

.nav-link[aria-current="page"] {
  color: var(--color-brand);
  font-weight: 700;
}

/* SVG 动效：卡片层叠漂浮 */
.hero-svg-container {
  position: relative;
  width: 100%;
  max-width: 600px;
  aspect-ratio: 4 / 3;
}

.hero-svg {
  width: 100%;
  height: 100%;
}

.card-layer {
  transform-box: fill-box;
  transform-origin: center;
}

.float-1 {
  animation: float-cycle-1 6s ease-in-out infinite alternate;
}

.float-2 {
  animation: float-cycle-2 7s ease-in-out infinite alternate;
  animation-delay: -2s;
}

.float-3 {
  animation: float-cycle-3 5.5s ease-in-out infinite alternate;
  animation-delay: -4s;
}

@keyframes float-cycle-1 {
  0% { transform: translateY(0px) rotate(0deg); }
  100% { transform: translateY(-12px) rotate(0.5deg); }
}

@keyframes float-cycle-2 {
  0% { transform: translateY(0px) rotate(0deg); }
  100% { transform: translateY(-8px) rotate(-0.8deg); }
}

@keyframes float-cycle-3 {
  0% { transform: translateY(0px) rotate(0deg); }
  100% { transform: translateY(-15px) rotate(0.3deg); }
}

/* 减少动态效果支持 */
@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;
  }
  .float-1, .float-2, .float-3 {
    animation: none !important;
    transform: none !important;
  }
}

/* 响应式微调 */
@media (max-width: 768px) {
  .hero-layout {
    flex-direction: column;
  }
  .hero-text {
    text-align: center;
    max-width: 100%;
  }
  .hero-svg-container {
    margin-top: 2rem;
    max-width: 100%;
  }
  .feature-row {
    flex-direction: column;
  }
  .feature-img {
    order: -1;
  }
}
