/* 
  SafeW 全站共享样式
  设计系统：紫罗兰深底 + 玫红强调 · 奶油纸面
*/

:root {
  /* 颜色变量 */
  --color-dark: #271231;
  --color-paper: #F5F0E5;
  --color-body: #1F1523;
  --color-brand: #9B12D8;
  --color-accent: #ED6EC0;
  
  /* 取色映射：纸面模式 (默认) */
  --bg-page: var(--color-paper);
  --bg-section: var(--color-paper);
  --text-main: var(--color-body);
  --text-muted: var(--color-body); /* 辅助文字同样使用正文色或更浅的变体，这里保持高对比 */
  --color-highlight: var(--color-brand);
  --color-button-bg: var(--color-brand);
  --color-button-text: var(--color-paper);
  --color-border: rgba(31, 21, 35, 0.15);

  /* 取色映射：深色面模式 */
  .color-dark-face {
    --bg-page: var(--color-dark);
    --bg-section: var(--color-dark);
    --text-main: var(--color-paper);
    --text-muted: var(--color-paper);
    --color-highlight: var(--color-accent);
    --color-button-bg: var(--color-accent);
    --color-button-text: var(--color-dark);
    --color-border: rgba(245, 240, 229, 0.15);
  }

  /* 结构变量 */
  --radius-card: 0;
  --radius-btn: 0;
  --card-border: 0;
  --card-shadow: 0 10px 28px -14px rgba(31, 21, 35, 0.3);
  --section-y: clamp(3.5rem, 7vw, 6rem);
  --gap: clamp(1rem, 2vw, 1.75rem);
  --content-max: 960px;
  
  /* 字体 */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  color: var(--text-main);
  background-color: var(--bg-page);
  -webkit-font-smoothing: antialiased;
}

/* 布局容器 */
.container {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--gap);
}

.section {
  padding-top: var(--section-y);
  padding-bottom: var(--section-y);
  background-color: var(--bg-section);
  position: relative;
}

.section + .section {
  border-top: 1px solid var(--color-border);
}

/* 排版 */
h1, h2, h3, h4 {
  font-weight: 500;
  line-height: 1.15;
  margin-top: 0;
  margin-bottom: calc(var(--gap) * 0.8);
  letter-spacing: -0.02em;
}

h1 {
  font-size: clamp(2.6rem, 6.4vw, 5rem);
}

h2 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  margin-bottom: calc(var(--gap) * 1.2);
}

h3 {
  font-size: clamp(1.2rem, 2vw, 1.5rem);
  margin-bottom: var(--gap);
}

p {
  margin-bottom: var(--gap);
  max-width: 38em;
}

/* 眉标 */
.breadcrumb {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--color-highlight);
  margin-bottom: calc(var(--gap) * 0.4);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.breadcrumb::before {
  content: "";
  display: block;
  width: 16px;
  height: 2px;
  background-color: currentColor;
}

/* 关键词高亮 */
.hl {
  color: var(--color-highlight);
}

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 0.875rem 2rem; /* 约 44px 高度 */
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: transform 0.2s ease, opacity 0.2s ease;
  min-height: 48px;
}

.btn-primary {
  background-color: var(--color-button-bg);
  color: var(--color-button-text);
}

.btn-secondary {
  background-color: transparent;
  color: var(--text-main);
  border: 1px solid var(--text-main);
}

.btn:hover {
  transform: translateY(-2px);
  opacity: 0.9;
}

.btn:focus-visible {
  outline: 3px solid var(--color-highlight);
  outline-offset: 2px;
}

.btn svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

/* 卡片 */
.card {
  background-color: var(--bg-section);
  border: 1px solid var(--color-border);
  box-shadow: var(--card-shadow);
  padding: var(--gap);
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.card:hover {
  box-shadow: 0 14px 32px -12px rgba(31, 21, 35, 0.4);
  transform: translateY(-2px);
}

/* 网格布局 */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap);
}

@media (max-width: 768px) {
  .grid-2 {
    grid-template-columns: 1fr;
  }
}

/* 头部导航 */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: var(--bg-page);
  border-bottom: 1px solid var(--color-border);
  backdrop-filter: blur(8px);
  background-color: rgba(245, 240, 229, 0.9);
}

.color-dark-face header {
  background-color: rgba(39, 18, 49, 0.9);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.logo-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text-main);
  font-weight: 700;
  font-size: 1.1rem;
}

.logo-link img {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

nav ul {
  display: flex;
  list-style: none;
  gap: 2rem;
  margin: 0;
  padding: 0;
}

nav a {
  text-decoration: none;
  color: var(--text-main);
  font-weight: 500;
  font-size: 0.95rem;
  transition: color 0.2s;
}

nav a:hover, nav a[aria-current="page"] {
  color: var(--color-highlight);
}

@media (max-width: 600px) {
  nav ul {
    display: none; /* 简化移动端处理，实际项目可做汉堡菜单 */
  }
  .btn {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
  }
}

/* 页脚 */
footer {
  background-color: var(--color-dark);
  color: var(--color-paper);
  padding: var(--section-y) 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: var(--gap);
}

.footer-links a {
  display: block;
  color: var(--color-paper);
  text-decoration: none;
  margin-bottom: 0.5rem;
  opacity: 0.8;
}

.footer-links a:hover {
  opacity: 1;
  color: var(--color-accent);
}

.footer-bottom {
  margin-top: var(--gap) * 2;
  padding-top: var(--gap);
  border-top: 1px solid rgba(245, 240, 229, 0.1);
  font-size: 0.85rem;
  opacity: 0.6;
  text-align: center;
}

@media (max-width: 768px) {
  .footer-grid {
    grid-template-columns: 1fr;
  }
}

/* 功能模块样式 */
/* 对照表 */
.comparison-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.comparison-table th, .comparison-table td {
  padding: 1rem;
  border-bottom: 1px solid var(--color-border);
  vertical-align: top;
}

.comparison-table th {
  font-weight: 700;
  width: 20%;
}

.comparison-table td:first-child {
  font-weight: 600;
  color: var(--text-muted);
  width: 30%;
}

/* 选项卡 (Tab) */
.tabs-wrapper {
  margin-top: var(--gap);
}

.tab-nav {
  display: flex;
  border-bottom: 1px solid var(--color-border);
  gap: 1rem;
  overflow-x: auto;
  padding-bottom: 1px;
}

.tab-btn {
  background: none;
  border: none;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  position: relative;
  white-space: nowrap;
}

.tab-btn[aria-selected="true"] {
  color: var(--text-main);
}

.tab-btn[aria-selected="true"]::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: var(--color-highlight);
}

.tab-panel {
  display: none;
  padding-top: var(--gap);
  animation: fadeIn 0.3s ease;
}

.tab-panel.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 步骤列表 */
.step-list {
  counter-reset: step-counter;
  list-style: none;
  padding: 0;
}

.step-list li {
  position: relative;
  padding-left: 3.5rem;
  margin-bottom: var(--gap);
}

.step-number {
  position: absolute;
  left: 0;
  top: 0;
  width: 2.5rem;
  height: 2.5rem;
  background-color: var(--color-highlight);
  color: var(--bg-page);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
}

/* 资讯卡片 */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--gap);
}

.news-date {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  display: block;
}

.news-title {
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  display: block;
  color: var(--text-main);
  text-decoration: none;
}

.news-excerpt {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 0;
}

/* FAQ */
details {
  margin-bottom: var(--gap);
  border-bottom: 1px solid var(--color-border);
  padding-bottom: var(--gap);
}

summary {
  font-weight: 600;
  font-size: 1.1rem;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
}

summary::-webkit-details-marker {
  display: none;
}

summary::after {
  content: "+";
  font-size: 1.5rem;
  font-weight: 300;
  color: var(--color-highlight);
}

details[open] summary::after {
  content: "-";
}

details p {
  margin-top: 0.5rem;
  margin-bottom: 0;
  color: var(--text-muted);
}

/* 表格 (平台信息) */
.info-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: var(--gap);
}

.info-table th, .info-table td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
}

.info-table th {
  font-weight: 700;
  width: 30%;
}

.info-table a {
  color: var(--color-highlight);
  text-decoration: none;
  border-bottom: 1px dashed var(--color-highlight);
}

/* SVG 动画基础 */
.svg-anim-group {
  transform-origin: center;
  transform-box: fill-box;
}

@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-anim-group {
    animation: none !important;
  }
}

/* 动效类定义 */
@keyframes drawLine {
  from { stroke-dashoffset: 1; }
  to { stroke-dashoffset: 0; }
}

@keyframes pulseOpacity {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}

@keyframes floatY {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

@keyframes nodeLightUp {
  0%, 100% { fill: rgba(155, 18, 216, 0.1); }
  50% { fill: var(--color-accent); }
}

.draw-path {
  pathLength: 1;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: drawLine 2s ease forwards;
}

.breathing {
  animation: pulseOpacity 3s ease-in-out infinite;
}

.floating {
  animation: floatY 4s ease-in-out infinite;
}

.node-light {
  animation: nodeLightUp 4s ease-in-out infinite;
}

.delay-1 { animation-delay: 0.5s; }
.delay-2 { animation-delay: 1.0s; }
.delay-3 { animation-delay: 1.5s; }
.delay-4 { animation-delay: 2.0s; }
.delay-5 { animation-delay: 2.5s; }
.delay-6 { animation-delay: 3.0s; }
.delay-7 { animation-delay: 3.5s; }
.delay-8 { animation-delay: 4.0s; }
.delay-9 { animation-delay: 4.5s; }
.delay-10 { animation-delay: 5.0s; }
.delay-11 { animation-delay: 5.5s; }
.delay-12 { animation-delay: 6.0s; }
.delay-13 { animation-delay: 6.5s; }
.delay-14 { animation-delay: 7.0s; }
.delay-15 { animation-delay: 7.5s; }
.delay-16 { animation-delay: 8.0s; }
.delay-17 { animation-delay: 8.5s; }
.delay-18 { animation-delay: 9.0s; }
.delay-19 { animation-delay: 9.5s; }
.delay-20 { animation-delay: 10.0s; }
.delay-21 { animation-delay: 10.5s; }
.delay-22 { animation-delay: 11.0s; }
.delay-23 { animation-delay: 11.5s; }
.delay-24 { animation-delay: 12.0s; }
.delay-25 { animation-delay: 12.5s; }
.delay-26 { animation-delay: 13.0s; }
.delay-27 { animation-delay: 13.5s; }
.delay-28 { animation-delay: 14.0s; }
.delay-29 { animation-delay: 14.5s; }
.delay-30 { animation-delay: 15.0s; }
.delay-31 { animation-delay: 15.5s; }
.delay-32 { animation-delay: 16.0s; }
.delay-33 { animation-delay: 16.5s; }
.delay-34 { animation-delay: 17.0s; }
.delay-35 { animation-delay: 17.5s; }
.delay-36 { animation-delay: 18.0s; }
.delay-37 { animation-delay: 18.5s; }
.delay-38 { animation-delay: 19.0s; }
.delay-39 { animation-delay: 19.5s; }
.delay-40 { animation-delay: 20.0s; }
.delay-41 { animation-delay: 20.5s; }
.delay-42 { animation-delay: 21.0s; }
.delay-43 { animation-delay: 21.5s; }
.delay-44 { animation-delay: 22.0s; }
.delay-45 { animation-delay: 22.5s; }
.delay-46 { animation-delay: 23.0s; }
.delay-47 { animation-delay: 23.5s; }
.delay-48 { animation-delay: 24.0s; }
.delay-49 { animation-delay: 24.5s; }
.delay-50 { animation-delay: 25.0s; }
.delay-51 { animation-delay: 25.5s; }
.delay-52 { animation-delay: 26.0s; }
.delay-53 { animation-delay: 26.5s; }
.delay-54 { animation-delay: 27.0s; }
.delay-55 { animation-delay: 27.5s; }
.delay-56 { animation-delay: 28.0s; }
.delay-57 { animation-delay: 28.5s; }
.delay-58 { animation-delay: 29.0s; }
.delay-59 { animation-delay: 29.5s; }
.delay-60 { animation-delay: 30.0s; }
