/* =========================================
   SafeW 全站共享样式
   ========================================= */

/* --- 设计变量与基础重置 --- */
:root {
  --color-dark: #19102D;
  --color-paper: #FCFCFD;
  --color-text: #191523;
  --color-brand: #5214EB;
  --color-accent: #D66EED;
  
  --radius-card: 0;
  --radius-btn: 0;
  --card-border: 2px solid var(--color-text);
  --card-shadow: 4px 4px 0 var(--color-text);
  
  --section-y: clamp(5rem, 10vw, 9rem);
  --gap: clamp(1.5rem, 3vw, 2.5rem);
  --content-max: 1280px;
  
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", sans-serif;
  --line-height-base: 1.75;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: var(--line-height-base);
  color: var(--color-text);
  background-color: var(--color-paper);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

img, svg {
  display: block;
  max-width: 100%;
}

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-divider {
  width: 100%;
  height: 1px;
  background-color: rgba(25, 21, 35, 0.15);
  border: none;
}

.bg-dark {
  background-color: var(--color-dark);
  color: var(--color-paper);
}

.bg-dark .hl {
  color: var(--color-accent);
}

.bg-dark .brand-link {
  color: var(--color-accent);
}

.paper-section {
  background-color: var(--color-paper);
  color: var(--color-text);
}

.paper-section .hl {
  color: var(--color-brand);
}

.paper-section .brand-link {
  color: var(--color-brand);
}

/* --- 排版 --- */
.section-title {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.25;
  margin-bottom: calc(var(--gap) * 0.75);
}

.section-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.hero-section .section-label {
  color: var(--color-accent);
}

.hero-section .section-title {
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 1.5rem;
}

.hero-intro {
  font-size: clamp(1rem, 1.5vw, 1.15rem);
  max-width: 60ch;
  line-height: 1.6;
  margin-bottom: 2rem;
  opacity: 0.9;
}

.content-block {
  padding-top: var(--section-y);
  padding-bottom: var(--section-y);
}

.text-body {
  font-size: 1rem;
  line-height: var(--line-height-base);
  max-width: 38em;
  margin-bottom: 1.5rem;
}

/* --- 按钮 --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  height: 52px;
  padding: 0 24px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
  border: none;
  text-align: center;
}

.btn-primary {
  background-color: var(--color-accent);
  color: var(--color-dark);
}

.btn-primary:hover {
  transform: translateY(-2px);
  background-color: #c95ce0;
}

.btn-secondary {
  background-color: transparent;
  color: var(--color-text);
  border: 2px solid var(--color-text);
}

.bg-dark .btn-secondary {
  color: var(--color-paper);
  border-color: var(--color-paper);
}

.btn-secondary:hover {
  transform: translateY(-2px);
  background-color: rgba(25, 21, 35, 0.05);
}

.btn:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 2px;
}

.icon-btn {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* --- 卡片与面板 --- */
.card {
  background-color: var(--color-paper);
  border: var(--card-border);
  box-shadow: var(--card-shadow);
  padding: 1.5rem;
  position: relative;
}

.bg-dark .card {
  background-color: var(--color-paper);
  color: var(--color-text);
}

.panel {
  background-color: var(--color-dark);
  border: 2px solid var(--color-accent);
  padding: 2rem;
  position: relative;
  overflow: hidden;
}

/* --- 表格 --- */
.spec-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1.5rem;
}

.spec-table th, .spec-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid rgba(25, 21, 35, 0.15);
}

.spec-table th {
  font-weight: 700;
  width: 40%;
}

/* --- 列表与步骤 --- */
.step-list {
  counter-reset: step;
}

.step-item {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  align-items: flex-start;
}

.step-num {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  background-color: var(--color-accent);
  color: var(--color-dark);
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  gap: var(--gap);
}

.feature-item h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.tip-list li {
  position: relative;
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}

.tip-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.4em;
  width: 8px;
  height: 8px;
  background-color: var(--color-brand);
}

/* --- FAQ --- */
.faq-list details {
  border: var(--card-border);
  margin-bottom: 1rem;
  background: var(--color-paper);
}

.faq-list summary {
  padding: 1rem;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.faq-list summary::-webkit-details-marker {
  display: none;
}

.faq-list summary::after {
  content: "+";
  font-size: 1.2rem;
  font-weight: 400;
}

.faq-list details[open] summary::after {
  content: "-";
}

.faq-list .faq-answer {
  padding: 0 1rem 1rem;
  line-height: 1.7;
}

/* --- 页头与页脚 --- */
.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: 1rem 0;
}

.nav-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 800;
  font-size: 1.25rem;
}

.brand-logo img {
  width: 32px;
  height: 32px;
}

.main-nav ul {
  display: flex;
  gap: 1.5rem;
}

.main-nav a {
  font-weight: 500;
  padding: 0.25rem 0;
  position: relative;
}

.main-nav a:hover,
.main-nav a[aria-current="page"] {
  color: var(--color-brand);
}

.main-nav a[aria-current="page"]::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: var(--color-brand);
}

.site-footer {
  background-color: var(--color-dark);
  color: var(--color-paper);
  padding: 3rem 0;
  margin-top: auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  gap: var(--gap);
}

.footer-col h4 {
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 1rem;
  letter-spacing: 0.05em;
}

.footer-col ul li {
  margin-bottom: 0.5rem;
}

.footer-col a {
  opacity: 0.8;
  transition: opacity 0.2s;
}

.footer-col a:hover {
  opacity: 1;
}

.copyright {
  text-align: center;
  margin-top: 3rem;
  font-size: 0.85rem;
  opacity: 0.6;
}

/* --- SVG 动效系统 --- */
.svg-visual {
  width: 100%;
  height: auto;
  max-width: 100%;
}

.svg-visual path,
.svg-visual rect,
.svg-visual circle,
.svg-visual line {
  transition: fill 0.3s ease, stroke 0.3s ease;
}

/* 绘制路径 */
.draw-path {
  pathLength: 1;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: drawLine 3s cubic-bezier(0.4, 0, 0.2, 1) infinite alternate;
}

@keyframes drawLine {
  0% { stroke-dashoffset: 1; }
  50%, 100% { stroke-dashoffset: 0; }
}

/* 呼吸点 */
.breath-dot {
  animation: breathe 3s ease-in-out infinite;
}

@keyframes breathe {
  0%, 100% { opacity: 0.4; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.1); }
}

/* 卡片漂浮 */
.float-card {
  animation: floatCard 6s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: center;
}

.float-card:nth-child(2) { animation-delay: -1.5s; animation-duration: 7s; }
.float-card:nth-child(3) { animation-delay: -3s; animation-duration: 5.5s; }

@keyframes floatCard {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

/* 消息气泡浮现 */
.msg-bubble {
  opacity: 0.85;
  animation: popIn 4s ease-in-out infinite alternate;
  transform-box: fill-box;
  transform-origin: center;
}

@keyframes popIn {
  0%, 100% { transform: scale(1) translateY(0); opacity: 0.85; }
  50% { transform: scale(1.03) translateY(-3px); opacity: 1; }
}

/* 通知滑入 */
.notif-slide {
  animation: slideIn 5s ease-in-out infinite alternate;
  transform-box: fill-box;
  transform-origin: center;
}

@keyframes slideIn {
  0%, 100% { transform: translateX(0); opacity: 0.9; }
  50% { transform: translateX(4px); opacity: 1; }
}

/* 连接线流动 */
.flow-line {
  pathLength: 1;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: flowDash 4s linear infinite;
}

@keyframes flowDash {
  0% { stroke-dashoffset: 1; }
  100% { stroke-dashoffset: 0; }
}

/* 减少动态效果 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    animation-name: none;
  }
  .draw-path, .flow-line {
    stroke-dashoffset: 0;
  }
}

/* --- 响应式适配 --- */
@media (max-width: 768px) {
  .nav-bar { flex-direction: column; gap: 1rem; }
  .main-nav ul { gap: 1rem; flex-wrap: wrap; justify-content: center; }
  .hero-layout { flex-direction: column; }
  .feature-grid { grid-template-columns: 1fr; }
}
