/* ===== MindGuard 设计系统 ===== */
:root {
  --brand: #3E8E7E;
  --brand-dark: #2F7265;
  --brand-soft: #E8F3EF;
  --brand-tint: #D3E9E1;
  --bg: #F4F6F3;
  --card: #FFFFFF;
  --ink: #22312C;
  --ink-2: #3C4D47;
  --muted: #84938D;
  --line: #E9EEEB;
  --danger: #C05340;
  --danger-soft: #FBECE8;
  --gold: #C79A3C;
  --radius: 18px;
  --shadow: 0 8px 24px rgba(36, 62, 54, 0.06);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at 30% 20%, #E9F1EC 0%, #DCE7E1 45%, #D3DED7 100%);
  -webkit-font-smoothing: antialiased;
}

/* ===== 响应式外壳：默认宽屏 Web 布局（左侧导航 + 内容居中） ===== */
.stage {
  height: 100vh; height: 100dvh;
  display: flex; align-items: stretch; justify-content: center;
}
.phone {
  position: relative;
  width: 100%; height: 100%;
  background: var(--bg);
  overflow: hidden;
  display: flex; flex-direction: row;
}
/* Web 页面不需要模拟手机状态栏 */
.statusbar, .sb-right, .sb-signal, .sb-wifi, .sb-battery { display: none; }

.screen {
  flex: 1; min-width: 0; min-height: 0;
  overflow-y: auto; overflow-x: hidden;
  padding: 34px 28px 48px;
  scrollbar-width: thin;
}
.screen::-webkit-scrollbar { width: 6px; }
.screen::-webkit-scrollbar-thumb { background: var(--brand-tint); border-radius: 3px; }
.screen .page { max-width: 820px; margin: 0 auto; }

/* ===== 左侧导航（宽屏） ===== */
.tabbar {
  order: -1;
  flex: 0 0 208px; width: 208px;
  display: flex; flex-direction: column; align-items: stretch; gap: 6px;
  background: #FFFFFF;
  border-right: 1px solid var(--line);
  padding: 30px 14px;
}
.tabbar.hidden { display: none; }
.tab {
  flex: 0 0 auto;
  display: flex; flex-direction: row; align-items: center; gap: 12px;
  padding: 12px 16px; cursor: pointer; border: none; background: none;
  color: var(--ink-2); font-size: 14px; font-weight: 500; font-family: inherit;
  border-radius: 12px; text-align: left;
}
.tab:hover { background: var(--bg); }
.tab.active { color: var(--brand-dark); font-weight: 700; background: var(--brand-soft); }
.tab svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

/* ===== 通用组件 ===== */
.page { animation: fade .22s ease both; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.hero { padding: 20px 4px 22px; }
.hero-eyebrow { display: block; font-size: 10px; letter-spacing: 1.6px; color: var(--brand); font-weight: 700; margin-bottom: 10px; }
.hero-title { display: block; font-size: 27px; line-height: 1.32; font-weight: 700; letter-spacing: -0.5px; }
.hero-sub { display: block; margin-top: 10px; font-size: 13.5px; line-height: 1.7; color: var(--muted); white-space: pre-line; }

.card {
  background: var(--card); border-radius: var(--radius);
  padding: 18px; margin-bottom: 14px; box-shadow: var(--shadow);
}
.section-title { display: block; font-size: 15.5px; font-weight: 700; margin-bottom: 4px; }
.subtitle { font-size: 11px; color: var(--muted); }
.body-text { display: block; font-size: 12.5px; line-height: 1.75; color: var(--ink-2); }
.disclaimer { font-size: 10.5px; line-height: 1.7; color: var(--muted); text-align: center; padding: 8px 14px 20px; }

/* ===== 首页 ===== */
.mood-list { display: flex; justify-content: space-between; gap: 6px; margin-top: 14px; }
.mood-item {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 10px 2px; border-radius: 14px; background: var(--bg);
  cursor: pointer; transition: .18s; border: 2px solid transparent;
}
.mood-item:active { transform: scale(.94); }
.mood-item.selected { background: var(--brand-soft); border-color: var(--brand); }
.mood-emoji { font-size: 24px; line-height: 1; }
.mood-label { font-size: 10px; color: var(--ink-2); }
.mood-feedback { margin-top: 12px; font-size: 12px; color: var(--brand-dark); background: var(--brand-soft); border-radius: 10px; padding: 9px 12px; }

.entry {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 0; border-bottom: 1px solid var(--line); cursor: pointer;
}
.entry:last-child { border-bottom: none; padding-bottom: 2px; }
.entry:active { opacity: .6; }
.entry-icon {
  width: 40px; height: 40px; border-radius: 12px; flex: 0 0 40px;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 700; color: #fff;
}
.entry-icon-chat { background: linear-gradient(135deg,#57A997,#3E8E7E); }
.entry-icon-growth { background: linear-gradient(135deg,#E0B65E,#C79A3C); }
.entry-icon-help { background: linear-gradient(135deg,#D47863,#C05340); }
.entry-body { flex: 1; display: flex; flex-direction: column; gap: 3px; }
.entry-title { font-size: 14px; font-weight: 600; }
.entry-desc { font-size: 11px; color: var(--muted); }
.entry-arrow { font-size: 20px; color: var(--muted); }
.entry-urgent .entry-title { color: var(--danger); }

.principle-row { display: flex; flex-direction: column; gap: 5px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.principle-row:last-child { border-bottom: none; padding-bottom: 2px; }
.tag {
  display: inline-block; align-self: flex-start; font-size: 10px; font-weight: 600;
  color: var(--brand-dark); background: var(--brand-soft); border-radius: 6px; padding: 2px 8px;
}

/* ===== 对话页 ===== */
.chat-page { display: flex; flex-direction: column; height: 100%; }
.status-bar {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--card); border-radius: 12px; padding: 10px 14px; margin-bottom: 10px;
  box-shadow: var(--shadow);
}
.status-stage { font-size: 12px; font-weight: 600; color: var(--brand-dark); }
.status-turn { font-size: 10px; color: var(--muted); }
.message-list { flex: 1; overflow-y: auto; padding: 4px 2px 8px; scrollbar-width: none; }
.message-list::-webkit-scrollbar { display: none; }
.welcome { text-align: center; padding: 46px 20px; }
.welcome-icon {
  display: flex; width: 64px; height: 64px; margin: 0 auto 16px;
  align-items: center; justify-content: center; font-size: 34px;
  background: var(--brand-soft); color: var(--brand); border-radius: 50%;
}
.welcome-title { display: block; font-size: 16px; font-weight: 600; margin-bottom: 8px; }
.welcome-desc { display: block; font-size: 12.5px; color: var(--muted); line-height: 1.7; white-space: pre-line; }

.message-row { display: flex; flex-direction: column; margin-bottom: 14px; }
.row-user { align-items: flex-end; }
.row-assistant { align-items: flex-start; }
.bubble {
  max-width: 84%; padding: 11px 14px; font-size: 13px; line-height: 1.7;
  white-space: pre-line; word-break: break-word;
}
.bubble-user { background: var(--brand); color: #fff; border-radius: 16px 16px 4px 16px; }
.bubble-assistant { background: var(--card); color: var(--ink); border-radius: 16px 16px 16px 4px; box-shadow: var(--shadow); }

.crisis-flag {
  max-width: 90%; margin-top: 7px; background: var(--danger-soft); border: 1px solid #F0C9C0;
  border-radius: 10px; padding: 9px 11px; font-size: 11px; color: var(--danger);
}
.crisis-flag-text { display: block; line-height: 1.6; margin-bottom: 6px; }
.handoff-btn {
  display: inline-block; font-size: 11px; font-weight: 600; color: #fff; background: var(--danger);
  border-radius: 8px; padding: 6px 12px; cursor: pointer;
}

.trace-toggle { font-size: 10.5px; color: var(--brand); margin-top: 7px; cursor: pointer; padding: 2px 0; }
.trace-panel {
  margin-top: 6px; width: 92%; background: #F0F4F1; border: 1px solid var(--line);
  border-radius: 10px; padding: 10px; animation: fade .18s ease both;
}
.trace-item { display: flex; justify-content: space-between; gap: 8px; padding: 4px 0; font-size: 10.5px; }
.trace-name { color: var(--brand-dark); font-family: ui-monospace, Menlo, Consolas, monospace; }
.trace-result { color: var(--ink-2); text-align: right; }
.trace-source { display: block; margin-top: 6px; padding-top: 6px; border-top: 1px dashed #D6E0DA; font-size: 10px; color: var(--muted); }

.knowledge-card {
  margin-top: 7px; width: 92%; background: var(--brand-soft); border-radius: 10px; padding: 10px 12px;
}
.knowledge-title { display: block; font-size: 11.5px; font-weight: 600; color: var(--brand-dark); margin-bottom: 4px; }
.knowledge-content { display: block; font-size: 11px; line-height: 1.65; color: var(--ink-2); }

.quick-bar { margin: 6px 0 8px; }
.quick-label { font-size: 10px; color: var(--muted); }
.quick-list { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 5px; }
.quick-chip {
  font-size: 11px; color: var(--brand-dark); background: var(--brand-soft);
  border-radius: 14px; padding: 5px 10px; cursor: pointer;
}
.quick-chip:active { background: var(--brand-tint); }

.input-bar { display: flex; gap: 8px; align-items: center; padding: 8px 0 2px; border-top: 1px solid var(--line); }
.input {
  flex: 1; min-width: 0; height: 38px; border: 1px solid var(--line); background: var(--card);
  border-radius: 19px; padding: 0 14px; font-size: 13px; font-family: inherit; color: var(--ink); outline: none;
}
.input:focus { border-color: var(--brand); }
.send-btn {
  height: 38px; padding: 0 16px; border-radius: 19px; background: var(--brand); color: #fff;
  font-size: 12px; font-weight: 600; display: flex; align-items: center; cursor: pointer; border: none;
}
.send-btn:active { background: var(--brand-dark); }

/* ===== 危机页 ===== */
.hero-card {
  background: linear-gradient(150deg,#F6DDD6,#FBEDE8); border-radius: var(--radius);
  padding: 22px 20px; margin: 8px 0 14px; text-align: center; box-shadow: var(--shadow);
}
.hero-icon {
  display: flex; width: 52px; height: 52px; margin: 0 auto 14px;
  align-items: center; justify-content: center; font-size: 30px; font-weight: 300;
  background: var(--danger); color: #fff; border-radius: 50%;
}
.hero-title { display: block; font-size: 20px; font-weight: 700; color: #8F3C2C; }
.hero-desc { display: block; margin-top: 10px; font-size: 12.5px; line-height: 1.75; color: #9B5A4D; white-space: pre-line; }
.urgent-card { border-left: 3px solid var(--danger); }
.urgent-label { display: inline-block; font-size: 10px; font-weight: 600; color: var(--danger); background: var(--danger-soft); border-radius: 6px; padding: 2px 8px; margin-bottom: 6px; }
.urgent-title { display: block; font-size: 14px; font-weight: 700; margin-bottom: 6px; }
.hotline {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 0; border-bottom: 1px solid var(--line); cursor: pointer;
}
.hotline:last-of-type { border-bottom: none; }
.hotline-body { display: flex; flex-direction: column; gap: 3px; }
.hotline-name { font-size: 13px; font-weight: 600; }
.hotline-desc { font-size: 10.5px; color: var(--muted); }
.hotline-phone { font-size: 13px; font-weight: 700; color: var(--brand); white-space: nowrap; }
.hint { display: block; font-size: 10px; color: var(--muted); margin-top: 8px; }
.step { display: flex; gap: 12px; padding: 10px 0; }
.step-num {
  width: 24px; height: 24px; flex: 0 0 24px; border-radius: 50%;
  background: var(--brand-soft); color: var(--brand-dark); font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.step-body { display: flex; flex-direction: column; gap: 3px; }
.step-title { font-size: 13px; font-weight: 600; }
.step-desc { font-size: 11px; color: var(--muted); line-height: 1.6; }
.handoff-card { background: linear-gradient(180deg,#F0F7F4,#fff); }
.handoff-btn {
  display: block; width: 100%; text-align: center; margin-top: 12px;
  background: var(--brand); color: #fff; font-size: 13px; font-weight: 600;
  border-radius: 12px; padding: 12px; cursor: pointer;
}
.handoff-btn.done { background: var(--brand-soft); color: var(--brand-dark); }

/* ===== 成长页 ===== */
.stats-row { display: flex; margin-top: 14px; }
.stat { flex: 1; display: flex; flex-direction: column; align-items: center; }
.stat + .stat { border-left: 1px solid var(--line); }
.stat-value { font-size: 22px; font-weight: 700; color: var(--brand-dark); }
.stat-label { font-size: 10px; color: var(--muted); margin-top: 2px; }
.empty-state { margin-top: 14px; font-size: 12px; color: var(--muted); text-align: center; padding: 16px; background: var(--bg); border-radius: 12px; }
.recent-list { margin-top: 14px; }
.recent-title { display: block; font-size: 11px; color: var(--muted); margin-bottom: 6px; }
.recent-item { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 12px; }
.recent-time { color: var(--muted); font-size: 11px; }
.quality-card { background: linear-gradient(160deg,#F2F8F5,#fff); }
.quality-head { display: flex; align-items: center; justify-content: space-between; }
.quality-badge { font-size: 10px; font-weight: 600; color: var(--brand-dark); background: var(--brand-soft); border-radius: 6px; padding: 2px 8px; }
.metric-row { display: flex; gap: 10px; margin-top: 14px; }
.metric { flex: 1; background: var(--bg); border-radius: 12px; padding: 12px 10px; }
.metric-value { display: block; font-size: 17px; font-weight: 700; color: var(--brand-dark); letter-spacing: -0.3px; }
.metric-green { color: #2E9E72; }
.metric-label { display: block; font-size: 10.5px; font-weight: 600; margin-top: 4px; }
.metric-note { display: block; font-size: 9.5px; color: var(--muted); margin-top: 3px; line-height: 1.4; }
.ability { display: flex; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.ability:last-child { border-bottom: none; padding-bottom: 2px; }
.ability-tag {
  flex: 0 0 auto; align-self: flex-start; font-size: 10px; font-weight: 600;
  color: var(--brand-dark); background: var(--brand-soft); border-radius: 6px; padding: 2px 7px;
}
.ability-body { display: flex; flex-direction: column; gap: 3px; }
.ability-title { font-size: 12.5px; font-weight: 600; }
.ability-desc { font-size: 10.5px; line-height: 1.65; color: var(--muted); }

/* ===== 我的页 ===== */
.profile-header { display: flex; align-items: center; gap: 14px; padding: 18px 4px 20px; }
.avatar {
  width: 56px; height: 56px; border-radius: 18px; flex: 0 0 56px;
  background: linear-gradient(135deg,#57A997,#3E8E7E); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 26px; font-weight: 700;
}
.profile-info { display: flex; flex-direction: column; gap: 4px; }
.profile-name { font-size: 17px; font-weight: 700; }
.profile-desc { font-size: 11.5px; color: var(--muted); }
.about-list { margin-top: 10px; }
.about-row { display: flex; gap: 12px; padding: 7px 0; font-size: 12px; }
.about-key { flex: 0 0 34px; color: var(--muted); }
.about-value { color: var(--ink-2); }
.compliance { display: flex; gap: 10px; padding: 9px 0; }
.compliance-dot { color: var(--brand); font-weight: 700; }
.compliance-body { display: flex; flex-direction: column; gap: 2px; }
.compliance-title { font-size: 12.5px; font-weight: 600; }
.compliance-desc { font-size: 10.5px; color: var(--muted); line-height: 1.6; }
.roadmap-title { margin-top: 14px; }
.setting-row { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; cursor: pointer; }
.setting-row:active { opacity: .6; }
.setting-text { font-size: 13px; }
.setting-arrow { color: var(--muted); font-size: 18px; }

/* ===== 全屏页返回（危机 / 设置无底部导航，需显式返回入口） ===== */
.sub-back {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 14px; font-weight: 600; color: var(--brand-dark);
  padding: 6px 12px; margin: 0 0 14px -8px;
  border-radius: 10px; cursor: pointer; transition: .15s;
}
.sub-back:hover { background: var(--brand-soft); }
.sub-back:active { transform: translateX(-2px); }

/* ===== Toast ===== */
.toast {
  position: absolute; left: 50%; bottom: 96px; transform: translate(-50%, 10px);
  background: rgba(34,49,44,.92); color: #fff; font-size: 12px;
  padding: 9px 16px; border-radius: 20px; opacity: 0; pointer-events: none;
  transition: .25s; z-index: 20; max-width: 80%; text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ===== 首页重构：情绪先行 · 低认知负荷 ===== */
.home-page { min-height: 100%; display: flex; flex-direction: column; animation: fade .22s ease both; }

.home-head { display: flex; align-items: center; justify-content: space-between; padding: 6px 2px 0; }
.home-brand { font-size: 14px; font-weight: 700; letter-spacing: .4px; color: var(--brand-dark); }

.mood-question { padding: 30px 4px 10px; }
.mq-eyebrow { display: block; font-size: 11px; color: var(--brand); font-weight: 600; letter-spacing: 1px; margin-bottom: 8px; }
.mq-title { display: block; font-size: 25px; line-height: 1.36; font-weight: 700; letter-spacing: -.4px; }
.mq-sub { display: block; margin-top: 8px; font-size: 12.5px; color: var(--muted); line-height: 1.6; }

.mood-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 24px; }
.mood-grid .mood-item {
  flex: none; gap: 9px; padding: 20px 8px 17px; border-radius: 18px;
  background: var(--card); box-shadow: var(--shadow); border: 2px solid transparent;
}
.mood-grid .mood-item.selected { transform: translateY(-2px); }
.mood-grid .mood-emoji { font-size: 34px; }
.mood-grid .mood-label { font-size: 12px; font-weight: 600; }
.mood-grid .mood-item.selected.mood-great { background: #E8F5EE; border-color: #6FB98F; }
.mood-grid .mood-item.selected.mood-ok { background: #EDF2F4; border-color: #9AAFB8; }
.mood-grid .mood-item.selected.mood-low { background: #F0EEF7; border-color: #A99BCC; }
.mood-grid .mood-item.selected.mood-hard { background: #FBEDE8; border-color: var(--danger); }

.mood-reply {
  margin-top: 18px; padding: 20px 18px 18px; border-radius: 20px;
  background: var(--card); box-shadow: var(--shadow); text-align: center;
  animation: fade .3s ease both;
}
.mood-reply.mood-reply-great { background: linear-gradient(160deg,#F0FAF3,#FFF); }
.mood-reply.mood-reply-ok { background: linear-gradient(160deg,#F2F6F7,#FFF); }
.mood-reply.mood-reply-low { background: linear-gradient(160deg,#F4F1FA,#FFF); }
.mood-reply.mood-reply-hard { background: linear-gradient(160deg,#FDF0EB,#FFF); }
.mr-emoji { font-size: 30px; margin-bottom: 10px; }
.mr-text { display: block; font-size: 13.5px; line-height: 1.75; color: var(--ink-2); }
.mr-cta {
  margin-top: 18px; padding: 14px; border-radius: 14px; cursor: pointer;
  background: var(--brand); color: #fff; font-size: 14px; font-weight: 600;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.mr-cta:active { opacity: .88; }
.mr-cta span { font-size: 19px; line-height: 1; }
.mr-later { margin-top: 12px; font-size: 11.5px; color: var(--muted); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

.home-help {
  margin-top: auto; margin-bottom: 6px; display: flex; align-items: center; gap: 9px;
  padding: 13px 14px; border-radius: 14px; background: rgba(251,236,232,.7);
  border: 1px solid #F0D9D2; cursor: pointer;
}
.home-help .hh-icon { color: var(--danger); font-size: 16px; font-weight: 700; }
.home-help span:nth-child(2) { flex: 1; font-size: 11.5px; color: #9B5A4D; line-height: 1.5; }
.home-help .hh-arrow { color: var(--danger); font-size: 18px; }

/* 情绪响应式：选中后整个页面色调轻微跟随（低认知负荷的视觉反馈） */
.mood-themed.mood-theme-great { --brand: #3E9E72; --brand-dark: #2F7D59; --brand-soft: #E8F5EE; }
.mood-themed.mood-theme-ok { --brand: #6B8F9C; --brand-dark: #4F7481; --brand-soft: #EDF2F4; }
.mood-themed.mood-theme-low { --brand: #8E7DBF; --brand-dark: #6E5DA0; --brand-soft: #F0EEF7; }
.mood-themed.mood-theme-hard { --brand: #C26A55; --brand-dark: #A4523F; --brand-soft: #FBEDE8; }

/* 对话承接态 */
.welcome-mood .welcome-icon { font-size: 34px; }
.welcome-mood .welcome-desc { color: var(--ink-2); }

/* ===== 宽屏增强：内容舒展、Grid 排布 ===== */
@media (min-width: 721px) {
  .screen { padding: 40px 44px 56px; }
  .home-page { justify-content: center; padding: 24px 0; }
  .mq-title { font-size: 32px; }
  .mq-sub { font-size: 14px; }
  .mood-grid { grid-template-columns: repeat(4, 1fr); gap: 14px; }
  .mood-grid .mood-item { padding: 26px 8px 22px; }
  .mood-grid .mood-emoji { font-size: 40px; }
  .mood-grid .mood-label { font-size: 13px; }
  .mood-reply { padding: 26px 24px; }
  .mr-text { font-size: 15px; }
  .home-head { padding-bottom: 8px; }
  .chat-page { height: 100%; }
  .bubble { max-width: 72%; font-size: 14px; padding: 13px 17px; }
  .card { padding: 22px 24px; }
  .welcome { padding: 72px 20px; }
  .welcome-title { font-size: 19px; }
  .welcome-desc { font-size: 13.5px; }
}

/* ===== 危机确认弹窗（此前缺失样式，补上） ===== */
.modal-mask {
  position: absolute; inset: 0; z-index: 50;
  display: flex; align-items: center; justify-content: center;
  background: rgba(24, 38, 33, .42); padding: 24px;
  animation: fade .18s ease both;
}
.modal-box {
  width: 100%; max-width: 360px; background: var(--card);
  border-radius: 20px; padding: 26px 22px 20px; text-align: center;
  box-shadow: 0 24px 60px rgba(20, 45, 36, .28);
}
.modal-icon {
  width: 50px; height: 50px; margin: 0 auto 14px; border-radius: 50%;
  background: var(--danger-soft); color: var(--danger);
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; font-weight: 700;
}
.modal-title { display: block; font-size: 16px; font-weight: 700; margin-bottom: 8px; }
.modal-desc { display: block; font-size: 12.5px; line-height: 1.7; color: var(--muted); }
.modal-actions { display: flex; gap: 10px; margin-top: 20px; }
.modal-btn { flex: 1; padding: 12px; border-radius: 12px; font-size: 13px; font-weight: 600; cursor: pointer; }
.modal-btn.ghost { background: var(--bg); color: var(--ink-2); }
.modal-btn.primary { background: var(--danger); color: #fff; }

/* ===== 窄屏：底部 TabBar（移动端原生体验） ===== */
@media (max-width: 720px) {
  body { background: var(--bg); }
  .stage { padding: 0; }
  .phone { flex-direction: column; }
  .screen { padding: 10px 18px 24px; }
  .screen .page { max-width: none; }
  .tabbar {
    order: 0;
    flex: 0 0 auto; width: 100%;
    flex-direction: row; align-items: stretch; gap: 0;
    padding: 8px 8px calc(10px + env(safe-area-inset-bottom));
    border-right: none; border-top: 1px solid var(--line);
    background: rgba(255, 255, 255, .96); backdrop-filter: blur(12px);
  }
  .tab {
    flex: 1; flex-direction: column; justify-content: center; gap: 3px;
    padding: 4px 0; font-size: 10px; border-radius: 0; text-align: center;
  }
  .tab.active { background: none; color: var(--brand); }
  .tab svg { width: 22px; height: 22px; }
  .toast { bottom: 96px; }
}
