/* =========================================
   SafeW 全站共享样式
   ========================================= */

/* 1. 设计变量与基础 Reset */
:root {
  /* 配色 */
  --bg-dark: #231334;
  --bg-paper: #F5F3F7;
  --bg-paper-light: #EDEAF0;
  --text-main: #1C1523;
  --brand: #7D14EB;
  --accent: #EDD26E;
  --surface-dark-text: #F5F3F7;
  
  /* 圆角 */
  --radius-card: 20px;
  --radius-btn: 12px;
  
  /* 卡片边界与阴影 */
  --card-border: 2px solid var(--text-main);
  --card-shadow: 4px 4px 0 var(--text-main);
  
  /* 节奏与密度 */
  --section-y: clamp(2.5rem, 5vw, 4rem);
  --gap: clamp(0.75rem, 1.5vw, 1.25rem);
  
  /* 内容最大宽度 */
  --content-max: 960px;
  
  /* 字体 */
  --font-main: "PingFang SC", "Noto Sans SC", system-ui, -apple-system, sans-serif;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-family: var(--font-main);
  color: var(--text-main);
  background-color: var(--bg-paper);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

body {
  min-width: 320px;
  overflow-x: hidden;
}

img, svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

ul, ol {
  list-style: none;
}

/* 2. 布局容器 */
.container {
  width: 100%;
  max-width: var(--content-max);
  margin-inline: auto;
  padding-inline: var(--gap);
}

section {
  padding-block: var(--section-y);
}

/* 3. 排版系统 */
.section-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}
.section-label::before {
  content: "";
  display: block;
  width: 1.2em;
  height: 2px;
  background-color: currentColor;
}

h1 {
  font-size: clamp(2.6rem, 6.4vw, 5rem);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

h2 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 500;
  line-height: 1.25;
  text-wrap: balance;
  margin-bottom: var(--gap);
}

h3 {
  font-size: clamp(1.2rem, 2vw, 1.5rem);
  font-weight: 500;
  line-height: 1.3;
  margin-bottom: 0.6rem;
}

p {
  margin-bottom: 1rem;
  font-size: 1rem;
}

.hl {
  font-weight: 600;
}

/* 4. 按钮组件 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6em;
  height: 52px;
  padding-inline: 1.5em;
  border-radius: var(--radius-btn);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, filter 0.2s ease;
  white-space: nowrap;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.btn-primary {
  background-color: var(--accent);
  color: var(--bg-dark);
}

.btn-secondary {
  background: transparent;
  border: 2px solid var(--text-main);
  color: var(--text-main);
}
/* 深色面上的次按钮 */
.dark-surface .btn-secondary {
  border-color: var(--surface-dark-text);
  color: var(--surface-dark-text);
}

/* 5. 卡片与面板 */
.card {
  background-color: var(--bg-paper);
  border: var(--card-border);
  box-shadow: var(--card-shadow);
  border-radius: var(--radius-card);
  padding: var(--gap);
  position: relative;
}

.dark-surface .card {
  background-color: var(--bg-paper);
  border-color: var(--text-main);
  color: var(--text-main);
}

.visual-panel {
  background-color: var(--bg-dark);
  border-radius: var(--radius-card);
  padding: clamp(1.5rem, 3vw, 2.5rem);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 320px;
  position: relative;
  overflow: hidden;
}

/* 6. 表格 */
.spec-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}
.spec-table th, .spec-table td {
  text-align: left;
  padding: 0.8rem 0;
  border-bottom: 1px solid rgba(28, 21, 35, 0.15);
}
.spec-table th {
  font-weight: 600;
  width: 40%;
}
.dark-surface .spec-table th,
.dark-surface .spec-table td {
  border-bottom-color: rgba(245, 243, 247, 0.15);
}

/* 7. FAQ */
.faq-item {
  border: var(--card-border);
  border-radius: var(--radius-card);
  margin-bottom: var(--gap);
  background-color: var(--bg-paper);
  overflow: hidden;
}
.dark-surface .faq-item {
  background-color: var(--bg-paper);
  border-color: var(--text-main);
}
.faq-item summary {
  padding: 1.2rem var(--gap);
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  font-size: 1.2rem;
  font-weight: 400;
}
.faq-item[open] summary::after { content: "-"; }
.faq-item .faq-answer {
  padding: 0 var(--gap) 1.2rem;
  font-size: 0.95rem;
  line-height: 1.6;
}

/* 8. 页头页脚 */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: rgba(245, 243, 247, 0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(28, 21, 35, 0.08);
  padding-block: 0.8rem;
}
.dark-surface ~ .site-header,
.site-header.dark-mode {
  background-color: rgba(35, 19, 52, 0.9);
  border-bottom-color: rgba(245, 243, 247, 0.1);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 48px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  font-size: 1.1rem;
}
.brand img {
  height: 28px;
  width: auto;
}
.nav {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}
.nav a {
  font-size: 0.95rem;
  font-weight: 500;
  opacity: 0.85;
  transition: opacity 0.2s;
}
.nav a:hover, .nav a[aria-current="page"] {
  opacity: 1;
}
.nav a[aria-current="page"] {
  border-bottom: 2px solid currentColor;
}

.site-footer {
  background-color: var(--bg-dark);
  color: var(--surface-dark-text);
  padding-block: 2.5rem;
  font-size: 0.9rem;
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 2rem;
}
.footer-col h4 {
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 0.8rem;
  opacity: 0.7;
}
.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: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(245, 243, 247, 0.1);
  font-size: 0.8rem;
  opacity: 0.6;
}

/* 9. SVG 动效 Keyframes */
@keyframes node-glow {
  0%, 100% { opacity: 0.2; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.1); }
}
@keyframes link-flow {
  0% { stroke-dashoffset: 1; }
  100% { stroke-dashoffset: 0; }
}
@keyframes float-y {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

/* 动效类应用 */
.svg-node { animation: node-glow 3s ease-in-out infinite; }
.svg-link { stroke-dasharray: 1; animation: link-flow 2s linear infinite; }
.svg-float { animation: float-y 4s ease-in-out infinite; }

/* 延迟错开 */
.d1 { animation-delay: 0.2s; }
.d2 { animation-delay: 0.6s; }
.d3 { animation-delay: 1.0s; }
.d4 { animation-delay: 1.4s; }

/* 10. 响应式与无障碍 */
@media (max-width: 768px) {
  .nav { display: none; } /* 移动端简化导航，实际项目可加汉堡菜单，此处保持简洁 */
  .two-col { grid-template-columns: 1fr !important; }
  h1 { font-size: clamp(2.2rem, 8vw, 3.5rem); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* 工具类 */
.flex-center { display: flex; align-items: center; justify-content: center; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: var(--gap); }
.text-accent { color: var(--accent); }
.text-brand { color: var(--brand); }
.bg-dark { background-color: var(--bg-dark); color: var(--surface-dark-text); }
.bg-paper-light { background-color: var(--bg-paper-light); }
.mt-sm { margin-top: var(--gap); }
.mb-md { margin-bottom: calc(var(--gap) * 1.5); }
