/* =========================================
   SafeW 全站共享样式 (style.css)
   设计系统：蓝紫深底 + 胭脂强调 · 深米纸面
   ========================================= */

/* --- 基础变量与 Reset --- */
:root {
  /* 色板 */
  --color-dark: #251943;
  --color-paper: #DBD4ED;
  --color-text: #191523;
  --color-brand: #5214EB;
  --color-accent: #ED6E89;
  
  /* 结构性 Token */
  --radius-card: 0;
  --radius-btn: 0;
  --card-border: 1px solid rgba(25, 21, 35, 0.16);
  --card-shadow: none;
  --section-y: clamp(5rem, 10vw, 9rem);
  --gap: clamp(1.5rem, 3vw, 2.5rem);
  --content-max: 960px;
  
  /* 字体 */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", 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: 1.75;
  color: var(--color-text);
  background-color: var(--color-paper);
}

img, svg {
  display: block;
  max-width: 100%;
}

a {
  text-decoration: none;
  color: inherit;
  transition: opacity 0.2s ease;
}

ul, ol {
  list-style: none;
}

/* --- 布局容器 --- */
.container {
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--gap);
}

.section {
  padding: var(--section-y) 0;
}

/* --- 排版系统 --- */
.label {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 0.5em;
}

.light-paper .label { color: var(--color-brand); }
.dark-surface .label { color: var(--color-accent); }

h1, h2, h3, h4 {
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

h1 {
  font-size: clamp(2.6rem, 6.4vw, 5rem);
  margin-bottom: 1em;
  text-wrap: balance;
}

h2 {
  font-size: clamp(1.8rem, 4vw, 3rem);
  margin-bottom: 0.8em;
  text-wrap: balance;
}

h3 {
  font-size: clamp(1.2rem, 2.5vw, 1.5rem);
  margin-bottom: 0.6em;
  text-wrap: balance;
}

p {
  margin-bottom: 1em;
  max-width: 38em;
}

.hl {
  font-weight: 700;
}
.light-paper .hl { color: var(--color-brand); }
.dark-surface .hl { color: var(--color-accent); }

/* --- 按钮组件 --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  height: 52px;
  padding: 0 24px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  border: 2px solid transparent;
  border-radius: var(--radius-btn);
  transition: transform 0.2s ease, opacity 0.2s ease;
  white-space: nowrap;
}

.btn:hover {
  transform: translateY(-2px);
  opacity: 0.9;
}

.btn:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 2px;
}

.btn-primary {
  background-color: var(--color-accent);
  color: var(--color-dark);
}

.btn-secondary {
  background-color: transparent;
}
.light-paper .btn-secondary {
  color: var(--color-text);
  border-color: var(--color-text);
}
.dark-surface .btn-secondary {
  color: var(--color-paper);
  border-color: var(--color-paper);
}

/* --- 卡片与面板 --- */
.card {
  background-color: var(--color-paper);
  border: var(--card-border);
  box-shadow: var(--card-shadow);
  border-radius: var(--radius-card);
  padding: var(--gap);
  position: relative;
}

.panel {
  background-color: var(--color-dark);
  border-radius: var(--radius-card);
  padding: var(--gap);
  overflow: hidden;
  position: relative;
}

/* --- 表格组件 --- */
.table-wrapper {
  overflow-x: auto;
  border: var(--card-border);
  border-radius: var(--radius-card);
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

th, td {
  padding: 16px 24px;
  border-bottom: 1px solid rgba(25, 21, 35, 0.1);
}

th {
  font-weight: 600;
  background-color: rgba(25, 21, 35, 0.05);
}

tr:last-child td {
  border-bottom: none;
}

/* --- FAQ 组件 --- */
.faq-item {
  border-bottom: 1px solid rgba(25, 21, 35, 0.1);
}

details summary {
  padding: 24px 0;
  cursor: pointer;
  font-weight: 600;
  font-size: 1.1rem;
  list-style: none;
  position: relative;
  padding-right: 40px;
}

details summary::-webkit-details-marker {
  display: none;
}

details summary::after {
  content: "+";
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.5rem;
  font-weight: 300;
  transition: transform 0.3s ease;
}

details[open] summary::after {
  transform: translateY(-50%) rotate(45deg);
}

details p {
  padding-bottom: 24px;
  color: rgba(25, 21, 35, 0.8);
}

/* --- 页头与页脚 --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: var(--color-paper);
  border-bottom: 1px solid rgba(25, 21, 35, 0.1);
  padding: 16px 0;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-links {
  display: flex;
  gap: 32px;
}

.nav-link {
  font-weight: 500;
  font-size: 0.95rem;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.nav-link:hover, .nav-link[aria-current="page"] {
  opacity: 1;
}

.site-footer {
  background-color: var(--color-dark);
  color: var(--color-paper);
  padding: 64px 0 32px;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 48px;
  margin-bottom: 48px;
}

.footer-col h4 {
  color: var(--color-accent);
  margin-bottom: 24px;
  font-size: 1rem;
}

.footer-col a {
  display: block;
  margin-bottom: 12px;
  opacity: 0.8;
  transition: opacity 0.2s;
}

.footer-col a:hover {
  opacity: 1;
}

.footer-bottom {
  border-top: 1px solid rgba(219, 212, 237, 0.1);
  padding-top: 32px;
  text-align: center;
  font-size: 0.85rem;
  opacity: 0.6;
}

/* --- SVG 动效 (几何体旋转拼合) --- */
.svg-anim-group {
  transform-box: fill-box;
  transform-origin: center;
}

@keyframes rotate-slow {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(180deg); }
}

@keyframes rotate-reverse {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(-180deg); }
}

@keyframes pulse-opacity {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

@keyframes dash-draw {
  0%, 100% { stroke-dashoffset: 1; }
  50% { stroke-dashoffset: 0; }
}

.anim-rotate-slow { animation: rotate-slow 12s linear infinite; }
.anim-rotate-reverse { animation: rotate-reverse 15s linear infinite; }
.anim-pulse { animation: pulse-opacity 4s ease-in-out infinite; }
.anim-draw { animation: dash-draw 3s ease-in-out infinite; }

svg {
  width: 100%;
  height: auto;
}

/* --- 响应式适配 --- */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .grid-2 { grid-template-columns: 1fr !important; }
  .hero-content { text-align: center; }
  .hero-content p { margin-left: auto; margin-right: auto; }
  .hero-actions { justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
