/* =========================================
   SafeW 全站共享样式
   设计系统：靛蓝深底 + 嫩绿强调 · 深米纸面
   ========================================= */

/* --- 设计变量 (Design Tokens) --- */
:root {
  /* 颜色色板 */
  --color-dark-bg: #13102D;      /* 深色面底色 */
  --color-paper-bg: #D6D4ED;     /* 浅色纸面底色 */
  --color-text-body: #171523;    /* 正文色 */
  --color-brand: #2714EB;        /* 品牌色 (纸面上用于强调) */
  --color-accent: #89ED6E;       /* 强调色 (深色面上用于强调/按钮) */
  
  /* 派生透明度 (仅用于边框/分割线) */
  --border-alpha: 0.16;

  /* 尺寸与间距 */
  --radius-card: 24px;
  --radius-btn: 999px;
  --content-max: 1280px;
  --section-y: clamp(5rem, 10vw, 9rem);
  --gap: clamp(1.5rem, 3vw, 2.5rem);
  
  /* 字体 */
  --font-main: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, 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-main);
  font-size: 16px;
  line-height: 1.75;
  color: var(--color-text-body);
  background-color: var(--color-paper-bg);
  overflow-x: hidden;
}

/* 文本排版 */
h1, h2, h3, h4, h5, h6 {
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: 0.5em;
}

h1 {
  font-size: clamp(2.4rem, 6vw, 4.5rem);
}

h2 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  margin-bottom: 0.8em;
}

h3 {
  font-size: clamp(1.2rem, 2vw, 1.5rem);
  margin-bottom: 0.6em;
}

p {
  margin-bottom: 1em;
  max-width: 38em;
}

a {
  color: inherit;
  text-decoration: none;
}

ul, ol {
  list-style: none;
}

img, svg {
  display: block;
  max-width: 100%;
}

/* --- 布局容器 --- */
.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);
}

/* --- 页面头部 (Header) --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: var(--color-dark-bg);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 1.1rem;
  color: #fff;
}

.logo img {
  height: 32px;
  width: auto;
}

.nav-desktop {
  display: flex;
  gap: 24px;
}

.nav-link {
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.95rem;
  font-weight: 500;
  transition: color 0.2s ease;
}

.nav-link:hover,
.nav-link[aria-current="page"] {
  color: #fff;
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  color: #fff;
}

@media (max-width: 768px) {
  .nav-desktop { display: none; }
  .mobile-menu-btn { display: block; }
}

/* --- 按钮组件 --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 48px;
  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;
  white-space: nowrap;
}

.btn:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

.btn:active {
  transform: scale(0.98);
}

/* 主按钮：强调色底，深色文字 */
.btn-primary {
  background-color: var(--color-accent);
  color: var(--color-dark-bg);
}

.btn-primary:hover {
  filter: brightness(1.05);
}

/* 次按钮：描边风格 */
.btn-outline {
  background-color: transparent;
  border: 1px solid currentColor;
}

/* 纸面上的次按钮：正文色边框 */
.paper-surface .btn-outline {
  color: var(--color-text-body);
  border-color: var(--color-text-body);
}

/* 深色面上的次按钮：纸面色边框 */
.dark-surface .btn-outline {
  color: var(--color-paper-bg);
  border-color: var(--color-paper-bg);
}

/* --- 眉标 (Eyebrow) --- */
.eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.paper-surface .eyebrow {
  color: var(--color-brand);
}

.dark-surface .eyebrow {
  color: var(--color-accent);
}

/* --- 高亮关键词 --- */
.hl {
  /* 默认继承上下文颜色，通过父级容器控制 */
}

.paper-surface .hl {
  color: var(--color-brand);
}

.dark-surface .hl {
  color: var(--color-accent);
}

/* --- 卡片与面板 --- */
.card {
  background-color: #fff; /* 纸面内的浅色卡片 */
  border: var(--card-border) var(--color-text-body);
  border-radius: var(--radius-card);
  box-shadow: var(--card-shadow);
  padding: 24px;
  transition: transform 0.2s ease;
}

.paper-surface .card {
  background-color: #fff;
  border-color: rgba(23, 21, 35, 0.16);
}

.dark-surface .card {
  /* 深色面上的浅色卡片，恢复纸面取色逻辑 */
  background-color: #fff;
  border-color: rgba(23, 21, 35, 0.16);
}

.panel {
  border-radius: var(--radius-card);
  overflow: hidden;
  position: relative;
}

.dark-panel {
  background-color: var(--color-dark-bg);
}

.paper-panel {
  background-color: var(--color-paper-bg);
}

/* --- 表格样式 --- */
.table-wrapper {
  overflow-x: auto;
  border: var(--card-border) var(--color-text-body);
  border-radius: var(--radius-card);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.data-table th,
.data-table td {
  padding: 16px 24px;
  text-align: left;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.data-table th {
  font-weight: 700;
  background-color: rgba(0, 0, 0, 0.03);
}

.data-table tr:last-child td {
  border-bottom: none;
}

/* --- FAQ 样式 (Details/Summary) --- */
.faq-item {
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.faq-item summary {
  padding: 20px 0;
  font-weight: 600;
  font-size: 1.1rem;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: color 0.2s;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  font-size: 1.2rem;
  font-weight: 400;
  transition: transform 0.2s;
}

.faq-item[open] summary::after {
  transform: rotate(45deg);
}

.faq-item[open] summary {
  color: var(--color-brand);
}

.faq-item p {
  padding-bottom: 20px;
  font-size: 0.95rem;
  color: rgba(23, 21, 35, 0.8);
}

.dark-surface .faq-item summary {
  color: var(--color-paper-bg);
}

.dark-surface .faq-item[open] summary {
  color: var(--color-accent);
}

.dark-surface .faq-item p {
  color: rgba(214, 212, 237, 0.8);
}

/* --- 核心功能 Tab (纯 CSS 实现) --- */
.feature-tabs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.feature-tab input[type="radio"] {
  display: none;
}

.feature-tab label {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 24px;
  background-color: #fff;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: var(--radius-card);
  cursor: pointer;
  transition: all 0.2s ease;
  height: 100%;
}

.feature-tab label:hover {
  transform: translateY(-2px);
  border-color: var(--color-brand);
}

.feature-tab input:checked + label {
  border-color: var(--color-brand);
  background-color: rgba(39, 20, 235, 0.05);
  box-shadow: 0 4px 12px rgba(39, 20, 235, 0.1);
}

.tab-icon {
  width: 48px;
  height: 48px;
  stroke: var(--color-brand);
  stroke-width: 1.5;
  fill: none;
}

.tab-title {
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 0;
}

.tab-content {
  font-size: 0.95rem;
  line-height: 1.6;
  color: rgba(23, 21, 35, 0.85);
}

/* --- 场景走查 --- */
.scenario-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 32px;
}

.scenario-card {
  background-color: #fff;
  border-radius: var(--radius-card);
  padding: 32px;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.step-list {
  counter-reset: step;
  list-style: none;
}

.step-list li {
  position: relative;
  padding-left: 32px;
  margin-bottom: 16px;
}

.step-list li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 0;
  top: 2px;
  width: 20px;
  height: 20px;
  background-color: var(--color-accent);
  color: var(--color-dark-bg);
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dark-surface .step-list li::before {
  background-color: var(--color-brand);
  color: #fff;
}

/* --- 资讯卡片 --- */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}

.news-card {
  background-color: var(--color-dark-bg);
  color: var(--color-paper-bg);
  border-radius: var(--radius-card);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.news-date {
  font-size: 0.8rem;
  color: var(--color-accent);
  font-weight: 600;
}

.news-card h4 {
  font-size: 1.1rem;
  margin: 0;
  line-height: 1.3;
}

.news-card p {
  font-size: 0.9rem;
  color: rgba(214, 212, 237, 0.8);
  margin: 0;
}

/* --- 页脚 (Footer) --- */
.site-footer {
  background-color: var(--color-dark-bg);
  color: var(--color-paper-bg);
  padding: 64px 0 32px;
  margin-top: var(--section-y);
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 40px;
  margin-bottom: 48px;
}

.footer-col h5 {
  color: var(--color-accent);
  font-size: 0.9rem;
  margin-bottom: 16px;
}

.footer-col ul {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-col a {
  color: rgba(214, 212, 237, 0.7);
  font-size: 0.9rem;
  transition: color 0.2s;
}

.footer-col a:hover {
  color: #fff;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 0.85rem;
  color: rgba(214, 212, 237, 0.5);
}

/* --- SVG 动效 Keyframes --- */
@keyframes float-1 {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

@keyframes float-2 {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

@keyframes float-3 {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

@keyframes dash {
  to { stroke-dashoffset: 0; }
}

@keyframes pulse-opacity {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

.svg-float-1 { animation: float-1 6s ease-in-out infinite; }
.svg-float-2 { animation: float-2 7s ease-in-out infinite; }
.svg-float-3 { animation: float-3 5s ease-in-out infinite; }

svg path.draw-line {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: dash 2s ease-in-out infinite alternate;
}

svg circle.breath {
  animation: pulse-opacity 3s 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;
  }
}

/* --- 响应式微调 --- */
@media (max-width: 768px) {
  .hero-layout {
    flex-direction: column-reverse;
  }
  .hero-text {
    text-align: center;
  }
  .hero-text p {
    margin-left: auto;
    margin-right: auto;
  }
  .btn-group {
    justify-content: center;
  }
  .scenario-grid {
    grid-template-columns: 1fr;
  }
}
