/* ============================================================
   海豚回声 · 布局与组件
   layout.css
   ============================================================ */

/* ══════════ 顶部导航 ══════════ */
.site-header {
  position: sticky; top: 0; z-index: 60;
  background: rgba(251, 252, 252, .94);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--c-line);
}
.header-inner {
  max-width: var(--maxw); margin: 0 auto;
  padding: 12px var(--sp-3);
  display: flex; align-items: center; gap: var(--sp-2);
}

.brand {
  display: inline-flex; align-items: center; gap: 9px;
  font-weight: 600; font-size: 1.06rem; color: var(--c-ink);
  text-decoration: none; flex-shrink: 0;
}
.brand:hover { text-decoration: none; color: var(--c-ink); }
.brand-mark { display: block; width: 26px; height: 26px; flex-shrink: 0; }

/* 桌面导航 */
.site-nav { display: none; gap: 4px; margin-left: var(--sp-3); }
.site-nav a {
  padding: 7px 12px; border-radius: var(--radius-sm);
  color: var(--c-text); font-size: .95rem; text-decoration: none;
}
.site-nav a:hover { background: var(--c-primary-wash); color: var(--c-primary); text-decoration: none; }
.site-nav a[aria-current="page"] { color: var(--c-primary); font-weight: 500; }

.header-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.lang-switch {
  padding: 6px 10px; border: 1px solid var(--c-line);
  border-radius: var(--radius-sm); font-size: .82rem;
  color: var(--c-muted); text-decoration: none; letter-spacing: .3px;
}
.lang-switch:hover { border-color: var(--c-primary-soft); color: var(--c-primary); text-decoration: none; }

.signal-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 13px; border-radius: var(--radius-sm);
  background: var(--c-signal-bg); color: var(--c-signal);
  border: 1px solid var(--c-signal-line);
  font-size: .89rem; font-weight: 500; text-decoration: none;
  white-space: nowrap;
}
.signal-btn:hover { background: #F6E6D8; color: var(--c-signal); text-decoration: none; }

/* 移动端：导航折叠为横向滚动条 */
@media (min-width: 768px) {
  .site-nav { display: flex; }
}
@media (max-width: 767px) {
  .site-nav {
    display: flex; gap: 2px;
    overflow-x: auto; scrollbar-width: none;
    order: 3; width: 100%; margin-left: 0; padding-top: 8px;
    border-top: 1px solid var(--c-line-soft);
  }
  .site-nav::-webkit-scrollbar { display: none; }
  .site-nav a { white-space: nowrap; padding: 6px 10px; font-size: .9rem; }
  .header-inner { flex-wrap: wrap; padding-bottom: 10px; }
}

/* ══════════ 页脚 ══════════ */
.site-footer {
  margin-top: var(--sp-6);
  padding: var(--sp-5) 0 var(--sp-4);
  border-top: 1px solid var(--c-line);
  background: #fff;
  font-size: var(--fs-sm);
  color: var(--c-muted);
}
.footer-grid {
  max-width: var(--maxw); margin: 0 auto; padding: 0 var(--sp-3);
  display: grid; gap: var(--sp-4);
}
@media (min-width: 768px) { .footer-grid { grid-template-columns: 1.6fr 1fr 1fr; } }

.footer-grid h4 { font-size: var(--fs-sm); color: var(--c-ink); margin-bottom: 10px; }
.footer-grid a { color: var(--c-muted); display: block; padding: 3px 0; font-size: var(--fs-sm); }
.footer-grid a:hover { color: var(--c-primary); }

.disclaimer {
  max-width: 420px; margin: 0;
  padding: 12px 14px;
  background: var(--c-line-soft);
  border-left: 3px solid var(--c-primary-soft);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: var(--fs-xs); line-height: 1.7; color: var(--c-text);
}
.disclaimer strong { color: var(--c-ink); }

.footer-bottom {
  max-width: var(--maxw); margin: var(--sp-4) auto 0; padding: var(--sp-3) var(--sp-3) 0;
  border-top: 1px solid var(--c-line-soft);
  display: flex; flex-wrap: wrap; gap: 10px 18px;
  justify-content: space-between; font-size: var(--fs-xs); color: var(--c-faint);
}

/* ══════════ 声呐母题 ══════════ */
.sonar {
  position: relative; width: 74px; height: 74px; flex-shrink: 0;
}
.sonar i {
  position: absolute; inset: 0; margin: auto;
  border: 1.5px solid var(--c-primary-soft);
  border-radius: 50%;
}
.sonar i:nth-child(1) { width: 74px; height: 74px; opacity: .28; animation: sonar 3.2s ease-out infinite; }
.sonar i:nth-child(2) { width: 52px; height: 52px; opacity: .45; animation: sonar 3.2s ease-out infinite .55s; }
.sonar i:nth-child(3) { width: 30px; height: 30px; opacity: .7;  animation: sonar 3.2s ease-out infinite 1.1s; }
.sonar i:nth-child(4) {
  width: 9px; height: 9px; background: var(--c-primary);
  border: none; opacity: 1;
}
@keyframes sonar {
  0%   { transform: scale(.55); opacity: 0; }
  35%  { opacity: .6; }
  100% { transform: scale(1); opacity: 0; }
}

/* ══════════ 通用区块 ══════════ */
main { display: block; }

.section { padding: var(--sp-6) 0; }
.section--tight { padding: var(--sp-5) 0; }
.section--wash { background: #fff; border-top: 1px solid var(--c-line); border-bottom: 1px solid var(--c-line); }

.section-head { max-width: 620px; margin-bottom: var(--sp-4); }
.section-head h2 { margin-top: 0; }
.section-head p { color: var(--c-muted); margin-bottom: 0; }

.eyebrow {
  display: inline-block; margin-bottom: 10px;
  font-size: var(--fs-xs); letter-spacing: 1.4px; text-transform: uppercase;
  color: var(--c-primary-soft); font-weight: 600;
}

/* ══════════ 安全提示条（危机页跳转用） ══════════ */
.safety-banner {
  display: none;
  padding: 13px 16px; margin-bottom: var(--sp-3);
  background: var(--c-signal-bg); border: 1px solid var(--c-signal-line);
  border-radius: var(--radius); color: #7A4A24; font-size: var(--fs-sm);
}
.safety-banner.is-on { display: block; }
.safety-banner a { color: var(--c-signal); font-weight: 600; }

/* ══════════ 面包屑 ══════════ */
.crumbs { font-size: var(--fs-sm); color: var(--c-muted); margin-bottom: var(--sp-3); }
.crumbs a { color: var(--c-muted); }
.crumbs span { margin: 0 7px; color: var(--c-faint); }

/* ══════════ 文章排版 ══════════ */
.prose { max-width: var(--maxw-read); }
.prose h2 { margin-top: var(--sp-5); }
.prose h3 { margin-top: var(--sp-4); }
.prose ul, .prose ol { padding-left: 1.35em; }
.prose li { margin-bottom: 8px; }
.prose blockquote {
  margin: var(--sp-3) 0; padding: 4px 0 4px 18px;
  border-left: 3px solid var(--c-primary-soft);
  color: var(--c-muted); font-style: normal;
}
.prose hr { border: none; border-top: 1px solid var(--c-line); margin: var(--sp-5) 0; }

/* 三档对照表 */
.triage { width: 100%; border-collapse: collapse; margin: var(--sp-3) 0; font-size: var(--fs-sm); }
.triage th, .triage td {
  border: 1px solid var(--c-line); padding: 11px 13px; text-align: left; vertical-align: top;
}
.triage th { background: var(--c-line-soft); font-weight: 600; color: var(--c-ink); }
.triage td strong { color: var(--c-ink); }

/* ══════════ 测评相关 ══════════ */
.quiz-shell { max-width: 660px; margin: 0 auto; }
.quiz-progress { margin-bottom: var(--sp-4); }
.quiz-progress-bar {
  height: 5px; background: var(--c-line-soft);
  border-radius: 999px; overflow: hidden;
}
.quiz-progress-fill {
  height: 100%; width: 0; background: var(--c-primary);
  border-radius: 999px; transition: width .32s ease;
}
.quiz-progress-text {
  display: flex; justify-content: space-between;
  font-size: var(--fs-xs); color: var(--c-muted); margin-top: 8px;
}

.quiz-q { font-size: 1.16rem; color: var(--c-ink); font-weight: 500; line-height: 1.6; margin-bottom: var(--sp-3); }
.quiz-hint { font-size: var(--fs-sm); color: var(--c-muted); margin-bottom: var(--sp-3); }

.opt-list { display: grid; gap: 10px; margin-bottom: var(--sp-4); }
.opt {
  display: flex; align-items: center; gap: 12px;
  padding: 15px 17px; width: 100%;
  background: var(--c-card); border: 1.5px solid var(--c-line);
  border-radius: var(--radius); cursor: pointer; text-align: left;
  font-size: 1rem; font-family: inherit; color: var(--c-text);
  transition: border-color .16s, background .16s;
}
.opt:hover { border-color: var(--c-primary-soft); background: var(--c-primary-wash); }
.opt.is-picked { border-color: var(--c-primary); background: var(--c-primary-wash); color: var(--c-ink); font-weight: 500; }
.opt-dot {
  width: 19px; height: 19px; flex-shrink: 0;
  border: 1.5px solid var(--c-faint); border-radius: 50%;
  position: relative; transition: border-color .16s;
}
.opt.is-picked .opt-dot { border-color: var(--c-primary); border-width: 5.5px; }

.quiz-nav { display: flex; gap: 10px; align-items: center; }
.quiz-nav .btn--ghost { margin-right: auto; }

/* ══════════ 结果页 ══════════ */
.level-card {
  border-radius: var(--radius-lg); padding: var(--sp-4);
  border: 1px solid var(--c-line); background: var(--c-card);
  margin-bottom: var(--sp-4);
}
.level-card--signal { background: var(--c-signal-bg); border-color: var(--c-signal-line); }
.level-badge {
  display: inline-block; padding: 4px 12px; border-radius: 999px;
  font-size: var(--fs-xs); font-weight: 600; letter-spacing: .5px;
  margin-bottom: 12px;
}
.level-card .level-title { font-size: 1.3rem; color: var(--c-ink); margin-bottom: 8px; font-weight: 600; }
.level-card p:last-child { margin-bottom: 0; }

.action-list { list-style: none; padding: 0; margin: var(--sp-3) 0 0; display: grid; gap: 10px; }
.action-list li {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px 16px; background: var(--c-card);
  border: 1px solid var(--c-line); border-radius: var(--radius);
  font-size: var(--fs-sm); margin: 0;
}
.action-list .ai { flex-shrink: 0; width: 20px; height: 20px; margin-top: 2px; color: var(--c-primary); }
.action-list strong { display: block; color: var(--c-ink); font-weight: 600; margin-bottom: 2px; }

.note-box {
  padding: 15px 17px; background: var(--c-line-soft);
  border-radius: var(--radius); font-size: var(--fs-sm);
  color: var(--c-text); margin: var(--sp-3) 0;
}
.note-box h4 { margin-bottom: 8px; font-size: var(--fs-sm); }
.note-box ul { margin-bottom: 0; }

.src-line {
  font-size: var(--fs-xs); color: var(--c-faint);
  border-top: 1px solid var(--c-line-soft); padding-top: 14px; margin-top: var(--sp-4);
}

/* ══════════ 列表页（科普/学堂） ══════════ */
.post-list { display: grid; gap: var(--sp-2); }
.post-item {
  display: block; padding: var(--sp-3);
  background: var(--c-card); border: 1px solid var(--c-line);
  border-radius: var(--radius); text-decoration: none;
  transition: border-color .18s, box-shadow .18s, transform .18s;
}
.post-item:hover {
  border-color: var(--c-primary-soft);
  box-shadow: var(--shadow); transform: translateY(-1px);
  text-decoration: none;
}
.post-item h3 { margin: 0 0 6px; font-size: 1.06rem; color: var(--c-ink); }
.post-item p { margin: 0; font-size: var(--fs-sm); color: var(--c-muted); }
.post-item .meta { margin-top: 10px; font-size: var(--fs-xs); color: var(--c-faint); }

/* ══════════ 危机页 ══════════ */
.crisis-page { max-width: 620px; margin: 0 auto; }
.crisis-h1 { font-size: 28px; margin-bottom: var(--sp-3); }

.crisis-step {
  display: flex; gap: 14px; padding: var(--sp-3) 0;
  border-bottom: 1px solid var(--c-line-soft);
}
.crisis-step:last-of-type { border-bottom: none; }
.crisis-num {
  flex-shrink: 0; width: 28px; height: 28px; border-radius: 50%;
  background: var(--c-primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: .85rem; font-weight: 600; margin-top: 2px;
}
.crisis-step h3 { margin: 0 0 6px; font-size: 1.04rem; }
.crisis-step p { margin: 0; font-size: var(--fs-sm); }

.hotline {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 15px 17px; margin-bottom: 10px;
  border: 1px solid var(--c-line); border-radius: var(--radius);
  background: var(--c-card); text-decoration: none;
}
.hotline:hover { border-color: var(--c-primary-soft); background: var(--c-primary-wash); text-decoration: none; }
.hotline .hl-name { font-weight: 600; color: var(--c-ink); display: block; font-size: .98rem; }
.hotline .hl-desc { font-size: var(--fs-xs); color: var(--c-muted); display: block; margin-top: 2px; }
.hotline .hl-num { font-size: 1.15rem; font-weight: 700; color: var(--c-primary); font-variant-numeric: tabular-nums; }

/* 安全确认复选 */
.confirm-item {
  display: flex; gap: 11px; align-items: flex-start;
  padding: 13px 15px; border: 1px solid var(--c-line);
  border-radius: var(--radius); background: var(--c-card);
  cursor: pointer; font-size: var(--fs-sm); margin-bottom: 10px;
}
.confirm-item:hover { border-color: var(--c-primary-soft); }
.confirm-item input { margin-top: 3px; width: 17px; height: 17px; accent-color: var(--c-primary); flex-shrink: 0; }
.confirm-item.is-checked { border-color: var(--c-primary-soft); background: var(--c-primary-wash); }

/* ══════════ 表单 ══════════ */
.field { margin-bottom: var(--sp-3); }
.field label { display: block; font-size: var(--fs-sm); font-weight: 500; color: var(--c-ink); margin-bottom: 7px; }
.field textarea, .field input[type="text"] {
  width: 100%; padding: 13px 15px;
  border: 1.5px solid var(--c-line); border-radius: var(--radius);
  font-family: inherit; font-size: 1rem; color: var(--c-text);
  background: var(--c-card); resize: vertical; line-height: 1.7;
}
.field textarea:focus, .field input[type="text"]:focus {
  border-color: var(--c-primary-soft); outline: none;
}
.field .help { font-size: var(--fs-xs); color: var(--c-faint); margin-top: 6px; }

/* ══════════ 空状态 / 占位 ══════════ */
.placeholder {
  padding: var(--sp-5) var(--sp-3); text-align: center;
  border: 1px dashed var(--c-line); border-radius: var(--radius-lg);
  background: var(--c-card); color: var(--c-muted);
}
.placeholder h3 { margin-bottom: 8px; color: var(--c-ink); }
.placeholder p { margin-bottom: 0; font-size: var(--fs-sm); }
