/* =========================================
   SafeW 全站共享样式
   ========================================= */

/* --- 设计变量 --- */
:root {
  --color-dark: #231334;
  --color-paper: #E9E8EA;
  --color-body: #1C1523;
  --color-brand: #7D14EB;
  --color-accent: #EDD26E;
  
  --radius-card: 20px;
  --radius-btn: 12px;
  --card-border: 2px solid var(--color-body);
  --card-shadow: 4px 4px 0 var(--color-body);
  
  --section-y: clamp(5rem, 10vw, 9rem);
  --gap: clamp(1.5rem, 3vw, 2.5rem);
  --content-max: 1120px;
  
  --font-main: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --line-height-base: 1.75;
}

/* --- 基础重置与排版 --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-family: var(--font-main); font-size: 16px; color: var(--color-body); background-color: var(--color-paper); line-height: var(--line-height-base); -webkit-font-smoothing: antialiased; }
body { display: flex; flex-direction: column; min-height: 100vh; overflow-x: hidden; }
img, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; transition: opacity 0.2s ease; }
a:focus-visible { outline: 3px solid var(--color-accent); outline-offset: 2px; border-radius: 2px; }
ul, ol { list-style: none; }

/* --- 布局容器 --- */
.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); }
.bg-dark { background-color: var(--color-dark); color: var(--color-paper); }
.bg-dark .hl { color: var(--color-accent); }
.bg-dark a:not(.btn) { color: var(--color-accent); }
.bg-paper-alt { background-color: #dcdbe0; color: var(--color-body); }
.bg-paper-alt .hl { color: var(--color-brand); }

.grid-2 { display: grid; gap: var(--gap); grid-template-columns: 1fr 1fr; align-items: start; }
@media (max-width: 768px) { .grid-2 { grid-template-columns: 1fr; } }

/* --- 页头与页脚 --- */
.site-header { position: sticky; top: 0; z-index: 100; background: rgba(233, 232, 234, 0.85); backdrop-filter: blur(8px); border-bottom: 1px solid rgba(28, 21, 35, 0.08); }
.site-header .container { display: flex; justify-content: space-between; align-items: center; height: 64px; }
.logo { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 1.1rem; }
.logo img { width: 32px; height: 32px; object-fit: contain; }
.nav-links { display: flex; gap: 24px; font-weight: 500; }
.nav-links a:hover { color: var(--color-brand); }
.nav-links [aria-current="page"] { color: var(--color-brand); font-weight: 700; }
.site-footer { background: var(--color-dark); color: var(--color-paper); padding: 48px 0; margin-top: auto; }
.footer-inner { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 32px; }
.footer-col h4 { font-size: 0.9rem; font-weight: 700; margin-bottom: 12px; color: var(--color-accent); }
.footer-col ul li { margin-bottom: 8px; }
.footer-col a:hover { color: var(--color-accent); }
.copyright { text-align: center; margin-top: 32px; font-size: 0.85rem; opacity: 0.7; border-top: 1px solid rgba(233, 232, 234, 0.15); padding-top: 24px; }

/* --- 按钮 --- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 24px; height: 48px; border-radius: var(--radius-btn); font-weight: 600; font-size: 1rem; cursor: pointer; transition: transform 0.15s ease, background 0.2s ease, box-shadow 0.2s ease; }
.btn-primary { background: var(--color-accent); color: var(--color-dark); border: none; }
.btn-primary:hover { transform: translateY(-1px); background: #e5c85e; }
.btn-secondary { background: transparent; color: var(--color-body); border: 2px solid var(--color-body); }
.bg-dark .btn-secondary { color: var(--color-paper); border-color: var(--color-paper); }
.bg-dark .btn-secondary:hover { background: rgba(233, 232, 234, 0.1); }
.btn-group { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 24px; }
.icon-btn { width: 20px; height: 20px; flex-shrink: 0; }

/* --- 卡片与面板 --- */
.card { background: #fff; border: var(--card-border); border-radius: var(--radius-card); box-shadow: var(--card-shadow); padding: 24px; position: relative; }
.panel { background: var(--color-dark); border-radius: 24px; padding: 32px; box-shadow: 0 12px 32px rgba(0,0,0,0.25); }
.panel-light { background: var(--color-paper); border: var(--card-border); border-radius: var(--radius-card); box-shadow: var(--card-shadow); }

/* --- 标题系统 --- --- */
.milestone { display: inline-block; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.05em; margin-bottom: 12px; text-transform: uppercase; }
.text-brand .milestone { color: var(--color-brand); }
.text-accent .milestone { color: var(--color-accent); }
h1 { font-size: clamp(2rem, 4.6vw, 3.4rem); font-weight: 600; line-height: 1.25; letter-spacing: 0; margin-bottom: 16px; text-wrap: balance; }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); font-weight: 600; line-height: 1.25; margin-bottom: 24px; text-wrap: balance; }
h3 { font-size: 1.25rem; font-weight: 600; line-height: 1.3; margin-bottom: 12px; }
p { margin-bottom: 16px; max-width: 38em; }
.hl { font-weight: 700; }
.text-brand .hl { color: var(--color-brand); }
.text-accent .hl { color: var(--color-accent); }

/* --- 表格 --- */
.spec-table { width: 100%; border-collapse: collapse; margin: 16px 0; }
.spec-table th, .spec-table td { padding: 12px 16px; text-align: left; border-bottom: 1px solid rgba(28, 21, 35, 0.1); }
.spec-table th { font-weight: 700; width: 40%; }
.bg-dark .spec-table th, .bg-dark .spec-table td { border-bottom-color: rgba(233, 232, 234, 0.15); }

/* --- FAQ --- */
.faq-item { border: var(--card-border); border-radius: var(--radius-card); margin-bottom: 12px; background: #fff; }
.faq-item summary { padding: 16px 20px; cursor: pointer; font-weight: 600; 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 p { padding: 0 20px 16px; margin: 0; font-size: 0.95rem; color: var(--color-body); }
.bg-dark .faq-item { background: #2a1b3d; border-color: #3d2b54; }
.bg-dark .faq-item summary { color: var(--color-paper); }
.bg-dark .faq-item p { color: #d0ced2; }

/* --- 步骤条 --- */
.steps-row { display: flex; gap: 24px; flex-wrap: wrap; }
.step-card { flex: 1; min-width: 200px; background: #fff; border: var(--card-border); border-radius: var(--radius-card); padding: 24px; position: relative; }
.step-num { position: absolute; top: -12px; left: 20px; background: var(--color-accent); color: var(--color-dark); font-weight: 700; padding: 4px 10px; border-radius: 8px; font-size: 0.9rem; }
.bg-dark .step-card { background: #2a1b3d; border-color: #3d2b54; }

/* --- 新闻卡片 --- */
.news-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; }
.news-card { background: #fff; border: var(--card-border); border-radius: var(--radius-card); padding: 24px; display: flex; flex-direction: column; }
.news-card time { font-size: 0.85rem; color: #666; margin-bottom: 8px; }
.bg-dark .news-card { background: #2a1b3d; border-color: #3d2b54; }
.bg-dark .news-card time { color: #a8a4b0; }

/* =========================================
   SVG 动效系统
   ========================================= */
.svg-viz { width: 100%; height: auto; max-width: 100%; overflow: visible; }
.svg-viz circle, .svg-viz rect, .svg-viz path { transition: all 0.3s ease; }

/* 轨道呼吸 */
@keyframes orbit-breathe {
  0%, 100% { transform: scale(0.95); opacity: 0.6; }
  50% { transform: scale(1.05); opacity: 1; }
}
.orbit-ring { animation: orbit-breathe 6s ease-in-out infinite alternate; transform-box: fill-box; transform-origin: center; }
.orbit-ring:nth-child(2) { animation-delay: -2s; }
.orbit-ring:nth-child(3) { animation-delay: -4s; }

/* 描边绘制 */
@keyframes draw-line {
  from { stroke-dashoffset: 1; }
  to { stroke-dashoffset: 0; }
}
.draw-path { pathLength: 1; stroke-dasharray: 1; stroke-dashoffset: 0; animation: draw-line 3s ease infinite alternate; }

/* 悬浮气泡 */
@keyframes float-bubble {
  0%, 100% { transform: translateY(0); opacity: 0.8; }
  50% { transform: translateY(-8px); opacity: 1; }
}
.bubble { animation: float-bubble 4s ease-in-out infinite alternate; transform-box: fill-box; transform-origin: center; }
.bubble-delay-1 { animation-delay: -1s; }
.bubble-delay-2 { animation-delay: -2s; }

/* 输入点呼吸 */
@keyframes pulse-dot {
  0%, 100% { opacity: 0.4; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1); }
}
.typing-dot { animation: pulse-dot 1.5s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

/* 通知滑入 */
@keyframes slide-in-right {
  from { transform: translateX(20px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
.notify-card { animation: slide-in-right 5s ease infinite alternate; transform-box: fill-box; transform-origin: left center; }

/* 连接线流动 */
@keyframes flow-line {
  from { stroke-dashoffset: 1; }
  to { stroke-dashoffset: 0; }
}
.flow-line { pathLength: 1; stroke-dasharray: 1; stroke-dashoffset: 0; animation: flow-line 2.5s linear infinite; }

/* 减少动态效果 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
