/* 安脑移动外壳(/m) — Glacier Clinical Humanist 设计系统
   视觉基线:冰川柔光浅蓝渐变、立体磨砂白圆角卡片、悬浮胶囊导航、5 色临床功能语义。
   适老参数:正文 17px / 大字 21px;可点区域 ≥48px(大字 56px);
   正文对比度 ≥4.5:1,白字只放在 #1D4ED8–#2563EB 深蓝上;
   状态同时用文字 + 图标/底色编码,不只靠红绿。 */
:root {
  --brand: #2563eb;
  --brand-vivid: #2f6bff;
  --brand-strong: #1d4ed8;
  --brand-deep: #0f295c;
  --brand-soft: #eaf2ff;
  --brand-mid: #60a5fa;
  --ink: #0f223d;
  --ink-2: #364966;
  --muted: #52637c;
  --line: #dbe7fb;
  --line-strong: #c5d8f7;
  --card: #ffffff;
  --surface-soft: #f4f8ff;
  --ok: #0d6838;
  --ok-bg: #e5f7ed;
  --warn: #8a4b00;
  --warn-bg: #fff3df;
  --err: #a1121b;
  --err-bg: #fdecee;
  --r: 24px;
  --r-lg: 30px;
  --r-sm: 16px;
  --tap: 48px;
  --tabs-h: 82px;
  --safe: env(safe-area-inset-bottom, 0px);
  --shadow: 0 14px 34px rgba(28, 74, 166, .09), 0 2px 6px rgba(28, 74, 166, .04);
  --shadow-soft: 0 6px 18px rgba(28, 74, 166, .06), 0 1px 3px rgba(28, 74, 166, .03);
  --shadow-float: 0 18px 42px rgba(24, 68, 160, .18), 0 2px 8px rgba(24, 68, 160, .06);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
a, button, summary, input, select, textarea, [role="button"], .m-msg.unread {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
button, summary, .m-tabs a, .m-subnav a, .m-back-pill, .m-filter-chip, .m-cats a, .m-badge {
  -webkit-user-select: none;
  user-select: none;
}

/* ---- 顶部细光流导航加载条(仅耗时 >90ms 显示,零闪烁) ---- */
.m-nav-bar {
  position: fixed; left: 0; right: 0; top: 0; height: 3px; z-index: 95;
  pointer-events: none; opacity: 0; transform: scaleX(0); transform-origin: left center;
  background: linear-gradient(90deg, #2563eb 0%, #38bdf8 52%, #10b981 100%);
  box-shadow: 0 1px 8px rgba(37, 99, 235, .45);
}
.m-nav-bar.is-active {
  opacity: 1; transform: scaleX(.76);
  transition: opacity .12s ease-out, transform 1.8s cubic-bezier(.12, .78, .24, .98);
}
.m-nav-bar.is-done {
  opacity: 0; transform: scaleX(1);
  transition: transform .16s ease-out, opacity .22s ease-out .08s;
}
body.m {
  margin: 0;
  font-size: 17px;
  line-height: 1.56;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  background:
    radial-gradient(76% 44% at 50% -4%, #e3f0ff 0%, rgba(227, 240, 255, 0) 74%),
    radial-gradient(50% 32% at 6% 18%, rgba(114, 174, 255, .17), transparent 72%),
    radial-gradient(46% 30% at 96% 34%, rgba(56, 198, 172, .12), transparent 72%),
    linear-gradient(180deg, #f2f8ff 0%, #ebf4ff 48%, #f7faff 100%);
  background-attachment: fixed;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
body.m.elder { font-size: 21px; --tap: 56px; --tabs-h: 96px; }
h1, h2, h3 { text-wrap: balance; }
p, li, dd, small { text-wrap: pretty; }
a { color: var(--brand-strong); text-underline-offset: 3px; }
.hidden { display: none !important; }
.ic { width: 1.3em; height: 1.3em; flex: none; }
.m-nowrap { white-space: nowrap; }
.m-num { font-variant-numeric: tabular-nums; }
.m-sr {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.m-skip {
  position: absolute; left: 12px; top: -80px; z-index: 100;
  padding: 12px 18px; border-radius: 14px; background: #fff;
  color: var(--brand-strong); font-weight: 800; text-decoration: none;
  box-shadow: var(--shadow);
}
.m-skip:focus { top: 12px; }
:focus-visible { outline: 3px solid #f59e0b; outline-offset: 2px; }

/* ---- 5 色临床语义色盘 ---- */
.m-tone-visual { background: #eaf3ff !important; color: #2563eb !important; }
.m-tone-attention { background: #fff0ed !important; color: #d9462f !important; }
.m-tone-memory { background: #fdf0f7 !important; color: #be185d !important; }
.m-tone-reaction { background: #fff6e5 !important; color: #b45309 !important; }
.m-tone-coordination { background: #e6f8f3 !important; color: #0f766e !important; }

/* ---- 顶栏 ---- */
.m-top {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 10px;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  background: linear-gradient(180deg, rgba(242, 248, 255, .96) 0%, rgba(242, 248, 255, .82) 76%, rgba(242, 248, 255, 0) 100%);
  backdrop-filter: blur(14px);
}
.m-brand {
  display: inline-flex; align-items: center; gap: 8px; min-height: var(--tap);
  color: var(--brand-deep); font-size: 1.24em; font-weight: 900; letter-spacing: .03em;
  text-decoration: none;
}
.m-brand-logo {
  display: grid; place-items: center; width: 32px; height: 32px; flex: none;
  border-radius: 10px; background: linear-gradient(135deg, #2f6bff, #1d4ed8);
  color: #fff; font-size: .78em; font-weight: 900; letter-spacing: 0;
  box-shadow: 0 5px 12px rgba(37, 99, 235, .26), inset 0 1px 0 rgba(255, 255, 255, .35);
}
.m-role-pill {
  font-style: normal; padding: 2px 8px; border-radius: 999px;
  background: rgba(37, 99, 235, .10); color: var(--brand-strong);
  font-size: .58em; font-weight: 800; letter-spacing: .02em;
}
.m-top-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.m-icon-btn {
  min-width: var(--tap); min-height: var(--tap); padding: 0 11px;
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  border: 1px solid rgba(255, 255, 255, .96); border-radius: 16px;
  background: rgba(255, 255, 255, .90); color: var(--brand-strong);
  box-shadow: 0 6px 16px rgba(28, 74, 166, .08), inset 0 1px 0 #fff;
  backdrop-filter: blur(10px);
  font: inherit; font-weight: 800; cursor: pointer;
}
.m-icon-btn:active { transform: translateY(1px) scale(.98); }
.m-icon-btn .ic { width: 1.35em; height: 1.35em; }
.m-elder-btn .m-aa { font-size: 1.05em; line-height: 1; }
.m-top-label { font-size: .68em; font-weight: 800; color: var(--muted); }
.m-elder-btn[aria-pressed="true"] {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  border-color: transparent; color: #fff;
  box-shadow: 0 8px 18px rgba(37, 99, 235, .28);
}
.m-elder-btn[aria-pressed="true"] .m-top-label { color: rgba(255, 255, 255, .92); }
.m-top-sub { margin-left: auto; color: var(--muted); font-size: .88em; }

/* ---- 主区与版式标题 ---- */
.m-main { max-width: 560px; margin: 0 auto; padding: 4px 16px 32px; }
body.has-tabs .m-main { padding-bottom: calc(var(--tabs-h) + 84px + var(--safe)); }
body.m-chat.has-tabs .m-main { padding-bottom: calc(var(--tabs-h) + 156px + var(--safe)); }
.m-sec-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  margin: 24px 4px 10px;
}
.m-sec-head.first { margin-top: 2px; }
.m-sec-head .m-h2 { margin: 0; }
.m-sec-head small, .m-sec-head a { font-size: .82em; color: var(--muted); text-decoration: none; font-weight: 700; }
.m-sec-head a { color: var(--brand-strong); }
.m-h2 {
  margin: 24px 4px 10px; font-size: 1.08em; font-weight: 850;
  letter-spacing: -.01em; color: var(--ink);
}
.m-h2.first { margin-top: 4px; }
.m-hint { color: var(--muted); font-size: .86em; margin: 8px 2px; line-height: 1.5; }
.m-hint-center { text-align: center; }
.m-page-title { margin: 14px 4px 4px; font-size: 1.62em; font-weight: 900; line-height: 1.2; letter-spacing: -.025em; color: var(--brand-deep); }
.m-page-sub { margin: 0 4px 14px; color: var(--muted); font-size: .9em; }
.m-eyebrow {
  display: inline-flex; align-items: center; gap: 5px; padding: 4px 11px; border-radius: 999px;
  background: rgba(255, 255, 255, .82); color: var(--brand-strong);
  border: 1px solid rgba(255, 255, 255, .94);
  font-size: .75em; font-weight: 800; letter-spacing: .03em;
}
.m-big { font-size: 1.38em; font-variant-numeric: tabular-nums; color: var(--brand-strong); }
.m-disclaimer {
  color: var(--muted); font-size: .76em; text-align: center;
  margin: 30px 6px 0; padding-top: 14px; border-top: 1px solid rgba(197, 216, 247, .48);
}
.m-links { text-align: center; font-size: .9em; margin: 18px 0; }
.m-links a { display: inline-block; padding: 10px 6px; font-weight: 700; }

/* ---- 子页面返回头部 ---- */
.m-subhead {
  display: flex; align-items: center; gap: 10px; margin: 2px 0 14px;
}
.m-back-pill {
  display: inline-flex; align-items: center; gap: 3px; min-height: 44px; padding: 0 14px 0 10px;
  border-radius: 999px; background: rgba(255, 255, 255, .92); border: 1px solid var(--line);
  color: var(--brand-strong); font-size: .88em; font-weight: 800; text-decoration: none;
  box-shadow: var(--shadow-soft); flex: none;
}
.m-back-pill .ic { width: 1.15em; height: 1.15em; transform: rotate(180deg); }
.m-subhead-copy { min-width: 0; flex: 1; }
.m-subhead-copy h1, .m-subhead-copy h2 { margin: 0; font-size: 1.28em; font-weight: 900; line-height: 1.22; color: var(--brand-deep); }
.m-subhead-copy p { margin: 2px 0 0; font-size: .82em; color: var(--muted); }

/* ---- 卡片 / 内嵌格 / 提示框 / 折叠块 ---- */
.m-card {
  background: linear-gradient(180deg, #ffffff 0%, #fcfdff 100%);
  border: 1px solid rgba(212, 228, 252, .82);
  border-radius: var(--r); padding: 18px;
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, .96);
}
.m-card + .m-card { margin-top: 12px; }
.m-stat-tile {
  padding: 13px 12px; border-radius: 18px;
  background: var(--surface-soft); border: 1px solid #e1ecfc;
}
.m-stat-tile span { display: block; color: var(--muted); font-size: .78em; font-weight: 700; }
.m-stat-tile b { display: block; margin-top: 3px; color: var(--brand-strong); font-size: 1.44em; line-height: 1.18; font-variant-numeric: tabular-nums; }
.m-stat-tile b small { font-size: .54em; color: var(--muted); font-weight: 700; }
.m-callout {
  display: flex; align-items: flex-start; gap: 10px; padding: 13px 15px; margin: 12px 0;
  border-radius: 18px; background: #eef5ff; border: 1px solid #d4e4fc; color: var(--ink-2); font-size: .88em;
}
.m-callout.warn { background: var(--warn-bg); border-color: #f9d9a8; color: var(--warn); }
.m-callout.ok { background: var(--ok-bg); border-color: #bde8cf; color: var(--ok); }
.m-callout .ic { margin-top: 2px; flex: none; }
.m-callout p { margin: 0; }

.m-empty-card { text-align: center; padding: 28px 18px; color: var(--ink-2); }
.m-empty-card p { margin: 6px 0; }
.m-empty-card .m-btn { display: inline-flex; margin: 14px auto 0; }
.m-empty-ic {
  display: inline-grid; place-items: center; width: 52px; height: 52px; margin: 0 auto 8px;
  border-radius: 18px; background: var(--brand-soft); color: var(--brand-strong);
}
.m-empty-ic .ic { width: 1.6em; height: 1.6em; }
.m-empty {
  text-align: center; padding: 36px 20px; margin-top: 12px;
  background: linear-gradient(180deg, #fff, #f7fbff);
  border: 1px solid rgba(212, 228, 252, .82); border-radius: var(--r-lg);
  box-shadow: var(--shadow);
}
.m-empty h1 { font-size: 1.38em; margin: 6px 0 10px; color: var(--brand-deep); }
.m-empty p { margin: 6px 0; color: var(--ink-2); }
.m-empty .m-btn { margin-top: 14px; width: 100%; max-width: 280px; }

/* ---- 按钮与堆栈 ---- */
.m-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--tap); padding: 0 22px; border: 0; border-radius: 999px;
  background: linear-gradient(135deg, #2f6bff 0%, #2563eb 52%, #1d4ed8 100%);
  color: #fff; font: inherit; font-weight: 800; text-decoration: none;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(37, 99, 235, .24), inset 0 1px 0 rgba(255, 255, 255, .28);
}
.m-btn:disabled { background: #9aa6b8; box-shadow: none; cursor: not-allowed; }
.m-btn-ghost {
  background: #fff; color: var(--brand-strong); border: 1.5px solid #c6daf9;
  box-shadow: var(--shadow-soft);
}
.m-btn-warn {
  background: var(--warn-bg); color: var(--warn); border: 1.5px solid #f4c987;
  box-shadow: none;
}
.m-btn-danger-ghost {
  background: var(--err-bg); color: var(--err); border: 1.5px solid #f5b9c0;
  box-shadow: none;
}
.m-btn-block { display: flex; width: 100%; }
.m-btn-sm { min-height: var(--tap); padding: 0 16px; font-size: .9em; }
body.elder .m-btn-sm { min-height: 52px; }
.m-btn-sub {
  min-height: var(--tap); padding: 0 15px; font-size: .9em;
  background: var(--surface-soft); color: var(--brand-strong); border: 1.5px solid #cbe0fc;
  box-shadow: none;
}
.m-btn-sos { width: 100%; background: linear-gradient(135deg, #e11d48, #b91c1c); box-shadow: 0 10px 24px rgba(185, 28, 28, .28); }
.m-btn-stack { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.m-btn-stack form { margin: 0; }
.m-btn-stack .m-btn { width: 100%; }

/* 异步提交忙碌态:防重复连点 + 纯 CSS 旋转微环 */
.m-btn.is-busy, button.is-busy {
  pointer-events: none; opacity: .88; cursor: progress;
}
.m-btn.is-busy::before, .m-send.is-busy::before {
  content: ""; width: 1.05em; height: 1.05em; flex: none; border-radius: 50%;
  border: 2.2px solid currentColor; border-right-color: transparent;
  animation: m-spin .68s linear infinite;
}
.m-send.is-busy .ic { display: none; }
@keyframes m-spin { to { transform: rotate(360deg); } }

/* 绑定码 / 登录码一键复制胶囊 */
.m-copy-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 40px; margin-top: 8px; padding: 0 14px; border-radius: 999px;
  border: 1.5px solid #b9d3fb; background: #fff; color: var(--brand-strong);
  font: inherit; font-size: .86em; font-weight: 800; cursor: pointer;
  box-shadow: var(--shadow-soft);
}
.m-copy-btn.is-copied {
  background: var(--ok-bg); border-color: #9fe0bc; color: var(--ok);
}

/* 全量触控控件物理弹性按压反馈(按下 55ms 敏捷下沉) */
.m-btn:active,
.m-grid a:active,
.m-game-card:active,
.m-banner:active,
.m-back-pill:active,
.m-schedule-pill:active,
.m-assist-dock:active,
.m-task-cta:active,
.m-chips button:active,
.m-filter-chip:active,
.m-cats a:active,
.m-play-back:active,
.m-play-pause:not(:disabled):active,
.m-fold summary:active,
.m-copy-btn:active {
  transform: translateY(1px) scale(.972);
  transition-duration: .055s;
}
.m-send:active,
.m-composer-sos:active,
.m-dialog-close:active {
  transform: scale(.93);
  transition-duration: .055s;
}
.m-tabs a:active .m-tab-icon,
.m-subnav a:active {
  transform: scale(.92);
  transition-duration: .055s;
}
.m-menu a:active,
.m-menu button:active,
a.m-row:active,
.m-msg.unread:active {
  background-color: #ebf3ff;
}
.m-menu a:active .ic-go,
a.m-row:active .ic-go,
.m-schedule-pill:active .ic-go {
  transform: translateX(3px);
}
.m-tabs a.is-navigating { color: var(--brand-strong); }
.m-tabs a.is-navigating .m-tab-icon { background: var(--brand-soft); color: var(--brand-strong); }
a.m-row.is-navigating, .m-menu a.is-navigating { background-color: #eef5ff; }

.m-badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 4px 11px; border-radius: 999px;
  background: var(--brand-soft); color: var(--brand-strong);
  font-size: .78em; font-weight: 800; white-space: nowrap; font-variant-numeric: tabular-nums;
}
.m-badge.ok { background: var(--ok-bg); color: var(--ok); }
.m-badge.ok::before { content: "✓ "; }
.m-badge.warn { background: var(--warn-bg); color: var(--warn); }
.m-badge.err { background: var(--err-bg); color: var(--err); }
.m-badge.muted { background: #edf2f9; color: var(--muted); }

/* ---- 原生折叠块(商城意向等) ---- */
.m-fold { margin-top: 8px; }
.m-fold summary {
  list-style: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  width: 100%; cursor: pointer; user-select: none;
}
.m-fold summary::-webkit-details-marker { display: none; }
.m-fold[open] summary {
  margin-bottom: 10px; background: var(--brand-soft); border-color: #b8d2fb;
}
.m-fold-body {
  padding: 12px; border-radius: 16px; background: var(--surface-soft); border: 1px solid #dce9fb;
}

/* ---- 顶部评估横幅(对齐 UIUX 参考稿:左立体蓝图标 + 右圆形蓝引导钮) ---- */
.m-banner {
  display: flex; align-items: center; gap: 12px; min-height: 68px;
  margin: 2px 0 14px; padding: 12px 14px 12px 15px; border-radius: 24px;
  background: linear-gradient(135deg, rgba(255, 255, 255, .98) 0%, rgba(238, 246, 255, .94) 100%);
  border: 1px solid rgba(255, 255, 255, .96);
  box-shadow: var(--shadow-soft), inset 0 1px 0 #fff;
  color: var(--ink); text-decoration: none;
}
.m-banner-icon {
  display: grid; place-items: center; width: 46px; height: 46px; padding: 10px; flex: none;
  border-radius: 15px;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8); color: #fff;
  box-shadow: 0 8px 16px rgba(37, 99, 235, .24), inset 0 1px 0 rgba(255, 255, 255, .35);
}
.m-banner-copy { flex: 1; min-width: 0; }
.m-banner-copy b { display: block; font-size: 1.02em; color: var(--brand-deep); }
.m-banner-copy small { display: block; margin-top: 2px; color: var(--muted); font-size: .8em; }
.m-banner-go {
  display: grid; place-items: center; width: 36px; height: 36px; flex: none;
  border-radius: 50%; background: linear-gradient(135deg, #2f6bff, #1d4ed8);
  color: #fff; box-shadow: 0 6px 14px rgba(37, 99, 235, .28);
}
.m-banner-go .ic { width: 1.05em; height: 1.05em; }
.ic-go { color: #8fa3c0 !important; }

/* ---- 定时提醒胶囊条 ---- */
.m-schedule-pill {
  display: flex; align-items: center; gap: 10px; min-height: var(--tap);
  margin: 12px 0 2px; padding: 8px 14px 8px 10px; border-radius: 999px;
  background: rgba(255, 255, 255, .88); border: 1px solid rgba(214, 229, 252, .85);
  box-shadow: var(--shadow-soft); color: var(--ink-2); font-size: .86em; font-weight: 700;
  text-decoration: none;
}
.m-schedule-pill-ic {
  display: grid; place-items: center; width: 32px; height: 32px; flex: none;
  border-radius: 50%; background: var(--brand-soft); color: var(--brand-strong);
}
.m-schedule-pill-ic .ic { width: 1.05em; height: 1.05em; }
.m-schedule-pill-text { flex: 1; min-width: 0; }
.m-schedule-pill-text em { font-style: normal; color: var(--brand-strong); }

/* ---- 首页主卡 ---- */
.m-home-hero {
  position: relative; overflow: hidden; padding: 20px 18px 18px;
  border-radius: var(--r-lg);
  background:
    radial-gradient(circle at 86% 12%, rgba(255, 255, 255, .96), transparent 38%),
    linear-gradient(152deg, #f8fbff 0%, #dfeeff 56%, #cfe4ff 100%);
  border: 1px solid rgba(255, 255, 255, .98);
  box-shadow: 0 18px 42px rgba(37, 99, 235, .14), inset 0 1px 0 #fff;
}
.m-home-hero::after {
  content: ""; position: absolute; left: -34px; bottom: -70px;
  width: 190px; height: 190px; border-radius: 50%;
  background: rgba(47, 107, 255, .09); filter: blur(8px); pointer-events: none;
}
.m-home-hero h1 {
  position: relative; z-index: 2; max-width: 60%; margin: 10px 0 4px;
  color: var(--brand-deep); font-size: 1.92em; font-weight: 900; line-height: 1.1; letter-spacing: -.03em;
}
.m-home-hero-sub {
  position: relative; z-index: 2; max-width: 60%; margin: 0;
  color: var(--ink-2); font-size: .9em; line-height: 1.48;
}
.m-home-art {
  position: absolute; right: -10px; top: 14px; width: 45%; max-width: 184px;
  z-index: 1; pointer-events: none;
}
.m-home-stats {
  position: relative; z-index: 2; display: grid;
  grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 16px;
}
.m-home-stats div {
  padding: 10px 6px; text-align: center; border-radius: 18px;
  background: rgba(255, 255, 255, .90); border: 1px solid rgba(255, 255, 255, .98);
  box-shadow: 0 6px 16px rgba(37, 99, 235, .08);
}
.m-home-stats b {
  display: block; color: var(--brand-strong); font-size: 1.42em; line-height: 1.15;
  letter-spacing: -.02em; font-variant-numeric: tabular-nums;
}
.m-home-stats small { font-size: .52em; font-weight: 700; color: var(--muted); }
.m-home-stats span { display: block; margin-top: 3px; color: var(--muted); font-size: .75em; font-weight: 700; }
.m-home-hero .m-hero-foot {
  position: relative; z-index: 2; margin: 12px 0 0; padding-top: 10px;
  border-top: 1px solid rgba(37, 99, 235, .10); color: var(--ink-2); font-size: .83em;
}
.m-hero-note { display: block; margin-top: 2px; color: var(--muted); font-size: .86em; }

/* ---- 2×2 宫格入口 ---- */
.m-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; }
.m-grid a {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 4px;
  min-width: 0; min-height: 120px; padding: 16px; color: var(--ink); text-decoration: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, .98), rgba(250, 253, 255, .94));
  border: 1px solid rgba(255, 255, 255, .96);
  border-radius: 24px; box-shadow: var(--shadow-soft), inset 0 1px 0 #fff;
}
.m-grid a > span:not(.ic-tile) { font-weight: 850; font-size: 1.02em; line-height: 1.25; color: var(--brand-deep); overflow-wrap: anywhere; }
.m-grid a small { color: var(--muted); font-size: .78em; line-height: 1.4; overflow-wrap: anywhere; }
.ic-tile {
  display: grid; place-items: center; width: 44px; height: 44px; padding: 10px;
  margin-bottom: 6px; border-radius: 14px; background: var(--brand-soft); color: var(--brand-strong);
}
.m-grid a:nth-child(2) .ic-tile { background: #e6f8f3; color: #0f766e; }
.m-grid a:nth-child(3) .ic-tile { background: #f1edff; color: #5b3df5; }
.m-grid a:nth-child(4) .ic-tile { background: #fff4e5; color: #b45309; }

/* ---- 今日任务 ---- */
.m-plan-pill {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin: 0 2px 10px; padding: 8px 12px; border-radius: 14px;
  background: rgba(255, 255, 255, .74); border: 1px solid rgba(212, 228, 252, .75);
  color: var(--ink-2); font-size: .82em;
}
.m-plan-pill .ic { width: 1.1em; height: 1.1em; color: var(--brand-strong); }
.m-task-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.m-task {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px;
  background: var(--card); border: 1px solid rgba(212, 228, 252, .8);
  border-radius: 22px; box-shadow: var(--shadow-soft);
}
.m-task-ic {
  display: grid; place-items: center; width: 46px; height: 46px; padding: 10px; flex: none;
  border-radius: 15px; background: var(--brand-soft); color: var(--brand-strong);
}
.m-task-main { flex: 1; min-width: 0; }
.m-task-main b { display: block; font-size: 1em; color: var(--brand-deep); }
.m-task-main small { color: var(--muted); font-size: .8em; }
.m-meter { height: 8px; margin-top: 8px; border-radius: 999px; background: #e5efff; overflow: hidden; }
.m-meter span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--brand), #38bdf8); }
.m-task-cta {
  display: inline-flex; align-items: center; justify-content: center; min-height: 40px;
  padding: 0 13px; border-radius: 999px; text-decoration: none;
  background: linear-gradient(135deg, #2f6bff, #1d4ed8); color: #fff;
  font-size: .8em; font-weight: 800; white-space: nowrap;
  box-shadow: 0 6px 14px rgba(37, 99, 235, .22);
}

/* ---- 训练助手对话 ---- */
.m-chat-card {
  margin-top: 20px; padding: 18px 16px 16px; border-radius: 28px;
  background: linear-gradient(180deg, #ffffff 0%, #f5f9ff 100%);
  border: 1px solid rgba(208, 226, 252, .86); box-shadow: var(--shadow);
}
.m-chat-card .m-chat-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px solid #eaf1fc; }
.m-chat-avatar {
  display: grid; place-items: center; width: 46px; height: 46px; flex: none;
  border-radius: 16px; background: linear-gradient(135deg, #2f6bff, #1d4ed8);
  color: #fff; box-shadow: 0 8px 18px rgba(37, 99, 235, .26);
}
.m-chat-avatar .ic { width: 1.4em; height: 1.4em; }
.m-chat-title-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.m-online-tag {
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 999px;
  background: var(--ok-bg); color: var(--ok); font-size: .72em; font-weight: 800;
}
.m-online-tag::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%; background: #10b981;
}
.m-chat-card .m-chat-head h1 { margin: 0; font-size: 1.18em; color: var(--brand-deep); }
.m-chat-card .m-chat-head p { margin: 2px 0 0; color: var(--muted); font-size: .82em; }
.m-chat-head h1 { margin: 4px 0 0; font-size: 1.35em; color: var(--brand-deep); }
.m-chat-head p { margin: 4px 0 12px; color: var(--muted); }
.m-thread { display: flex; flex-direction: column; gap: 10px; }
.m-bubble {
  max-width: 90%; padding: 12px 15px; border-radius: 20px 20px 20px 6px;
  background: #fff; border: 1px solid #e1ebf9;
  box-shadow: 0 4px 12px rgba(28, 74, 166, .05);
}
.m-bubble p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.m-bubble.mine {
  align-self: flex-end; border-radius: 20px 20px 6px 20px;
  background: linear-gradient(135deg, #2f6bff, #1d4ed8); color: #fff; border-color: transparent;
  box-shadow: 0 8px 18px rgba(37, 99, 235, .20);
}
.m-bubble.mine a { color: #fff; }
.m-bubble.live p:empty::before {
  content: "正在整理回复";
  color: var(--muted); font-size: .92em; font-weight: 600;
  margin-right: 4px;
}
.m-bubble.live p::after { content: "▍"; color: var(--brand); }
@media (prefers-reduced-motion: no-preference) {
  .m-bubble.live p::after { animation: m-caret .9s step-end infinite; }
  .m-bubble.live p:empty::before { animation: m-pulse-soft 1.2s ease-in-out infinite; }
}
@keyframes m-caret { 50% { opacity: 0; } }
@keyframes m-pulse-soft { 0%, 100% { opacity: .52; } 50% { opacity: 1; } }
.m-thread .m-bubble:last-child { scroll-margin-bottom: 220px; }
.m-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 2px; }
.m-chips form { margin: 0; }
.m-chips button {
  min-height: 44px; padding: 0 14px; border: 1.5px solid #c9dcfb; border-radius: 999px;
  background: #fff; color: var(--brand-strong); font: inherit; font-size: .85em; font-weight: 700;
  cursor: pointer; box-shadow: 0 2px 6px rgba(28, 74, 166, .04);
}
body.elder .m-chips button { min-height: 52px; }

/* ---- 底部输入条 + 求助 ---- */
body.m-chat .m-composer {
  position: fixed; left: 12px; right: 12px; z-index: 32;
  bottom: calc(var(--tabs-h) + 18px + var(--safe));
  max-width: 536px; margin: 0 auto; display: flex; align-items: center; gap: 8px;
  padding: 6px 6px 6px 12px; border-radius: 999px;
  background: rgba(255, 255, 255, .98); border: 1px solid rgba(220, 233, 252, .96);
  box-shadow: var(--shadow-float); backdrop-filter: blur(14px);
}
body.m-chat .m-composer:focus-within { outline: 3px solid rgba(47, 107, 255, .24); }
.m-composer-ic { display: grid; place-items: center; color: var(--brand-strong); flex: none; padding-left: 4px; }
.m-composer textarea {
  flex: 1; min-height: var(--tap); max-height: 104px; padding: 10px 4px;
  border: 0; background: transparent; color: var(--ink); font: inherit; resize: none;
}
.m-composer textarea:focus { outline: none; }
.m-send {
  display: grid; place-items: center; width: var(--tap); height: var(--tap); flex: none;
  border: 0; border-radius: 50%; background: linear-gradient(135deg, #2f6bff, #1d4ed8);
  color: #fff; cursor: pointer; box-shadow: 0 8px 18px rgba(37, 99, 235, .28);
}
.m-send .ic { width: 1.3em; height: 1.3em; }
.m-composer-sos {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  width: 50px; height: 50px; flex: none; padding: 0; border: 0; border-radius: 50%;
  background: linear-gradient(135deg, #e11d48, #b91c1c); color: #fff;
  font: inherit; font-size: .58em; font-weight: 800; line-height: 1.05; cursor: pointer;
  box-shadow: 0 8px 16px rgba(185, 28, 28, .26);
}
.m-composer-sos .ic { width: 1.45em; height: 1.45em; }
body.elder .m-composer-sos { width: 60px; height: 60px; }

/* ---- 常驻助手条(非首页) ---- */
.m-assist-dock {
  position: fixed; left: 12px; right: 12px; z-index: 29;
  bottom: calc(var(--tabs-h) + 18px + var(--safe));
  max-width: 536px; margin: 0 auto; display: flex; align-items: center; gap: 10px;
  min-height: 54px; padding: 6px 8px 6px 10px; border-radius: 999px;
  background: rgba(255, 255, 255, .96); border: 1px solid rgba(216, 230, 252, .95);
  box-shadow: 0 12px 28px rgba(24, 68, 160, .15); color: var(--ink); text-decoration: none;
  backdrop-filter: blur(12px);
}
body.m-chat .m-assist-dock { display: none; }
.m-assist-dock-icon {
  display: grid; place-items: center; width: 38px; height: 38px; flex: none;
  border-radius: 50%; background: var(--brand-soft); color: var(--brand-strong);
}
.m-assist-dock-text { flex: 1; font-weight: 800; font-size: .92em; color: var(--brand-deep); line-height: 1.2; }
.m-assist-dock-text small { display: block; font-weight: 600; font-size: .78em; color: var(--muted); }
.m-assist-dock-plus {
  display: grid; place-items: center; width: 38px; height: 38px; flex: none;
  border-radius: 50%; background: linear-gradient(135deg, #2f6bff, #1d4ed8); color: #fff;
}
.m-assist-dock-plus .ic { width: 1.1em; height: 1.1em; }

/* ---- 底部悬浮胶囊导航 ---- */
.m-tabs {
  position: fixed; left: 12px; right: 12px; bottom: calc(10px + var(--safe)); z-index: 30;
  display: flex; gap: 4px; max-width: 536px; margin: 0 auto; padding: 7px 8px;
  background: rgba(255, 255, 255, .97); border: 1px solid rgba(224, 235, 252, .96);
  border-radius: 26px; box-shadow: var(--shadow-float), inset 0 1px 0 #fff;
  backdrop-filter: blur(16px);
}
.m-tabs a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; min-height: 56px; border-radius: 20px; color: var(--muted);
  text-decoration: none; font-size: .75em; font-weight: 700;
}
.m-tab-icon { display: grid; place-items: center; width: 40px; height: 28px; border-radius: 999px; }
.m-tabs .ic { width: 1.32em; height: 1.32em; }
.m-tabs a.on { color: var(--brand-strong); font-weight: 850; }
.m-tabs a.on .m-tab-icon {
  background: linear-gradient(135deg, #2f6bff, #1d4ed8); color: #fff;
  box-shadow: 0 6px 14px rgba(37, 99, 235, .32), inset 0 1px 0 rgba(255, 255, 255, .32);
}

/* ---- 二级导航(训练/游戏库/进度) ---- */
.m-subnav {
  display: flex; gap: 4px; margin: 14px 0; padding: 6px;
  background: rgba(255, 255, 255, .94); border: 1px solid rgba(255, 255, 255, .96);
  border-radius: 22px; box-shadow: var(--shadow-soft);
}
.m-subnav a {
  flex: 1; min-height: 52px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; border-radius: 16px; color: var(--muted); text-decoration: none;
  font-size: .82em; font-weight: 700;
}
.m-subnav .ic { width: 1.28em; height: 1.28em; }
.m-subnav a.on {
  background: var(--brand-soft); color: var(--brand-strong); font-weight: 850;
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, .14);
}

/* ---- 横向分类筛选胶囊栏 ---- */
.m-filter-bar {
  display: flex; gap: 8px; overflow-x: auto; margin: 4px -2px 14px; padding: 2px 2px 4px;
  scrollbar-width: none;
}
.m-filter-bar::-webkit-scrollbar { display: none; }
.m-filter-chip {
  flex: none; min-height: 44px; padding: 0 15px; border-radius: 999px;
  border: 1.5px solid #cfe0fb; background: rgba(255, 255, 255, .92);
  color: var(--ink-2); font: inherit; font-size: .84em; font-weight: 800;
  cursor: pointer; white-space: nowrap; box-shadow: var(--shadow-soft);
}
body.elder .m-filter-chip { min-height: 52px; }
.m-filter-chip.on {
  background: linear-gradient(135deg, #2f6bff, #1d4ed8); border-color: transparent;
  color: #fff; box-shadow: 0 8px 18px rgba(37, 99, 235, .26);
}

/* ---- 训练主卡 ---- */
.m-game-hero {
  position: relative; overflow: hidden; padding: 22px 20px 24px; border-radius: var(--r-lg);
  color: #fff;
  background:
    radial-gradient(circle at 84% 10%, rgba(255, 255, 255, .28), transparent 36%),
    linear-gradient(142deg, #17368f 0%, #2563eb 56%, #3b82f6 100%);
  box-shadow: 0 20px 44px rgba(23, 54, 143, .28), inset 0 1px 0 rgba(255, 255, 255, .24);
}
.m-game-hero .m-eyebrow { background: rgba(255, 255, 255, .18); border-color: rgba(255, 255, 255, .28); color: #fff; }
.m-game-hero h1 { position: relative; z-index: 2; max-width: 62%; margin: 12px 0 6px; font-size: 1.58em; font-weight: 900; line-height: 1.2; letter-spacing: -.02em; text-shadow: 0 1px 3px rgba(9, 30, 80, .24); }
.m-game-hero p { position: relative; z-index: 2; max-width: 60%; margin: 0; color: rgba(255, 255, 255, .94); font-size: .9em; text-shadow: 0 1px 3px rgba(9, 30, 80, .22); }
.m-game-hero img {
  position: absolute; right: -8px; top: 6px; width: 48%; max-width: 206px;
  z-index: 1; pointer-events: none;
}
.m-game-ring {
  position: absolute; right: 16px; bottom: 16px; z-index: 2;
  display: grid; place-content: center; width: 80px; height: 80px; border-radius: 50%;
  text-align: center; background: conic-gradient(#6ee7b7 calc(var(--p) * 1%), rgba(255, 255, 255, .22) 0);
  box-shadow: 0 8px 18px rgba(9, 30, 80, .24);
}
.m-game-ring::before { content: ""; position: absolute; inset: 7px; border-radius: 50%; background: #1c47b8; }
.m-game-ring b, .m-game-ring span { position: relative; z-index: 1; }
.m-game-ring b { font-size: 1.12em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.m-game-ring span { font-size: .62em; color: rgba(255, 255, 255, .9); }

/* ---- 游戏库卡片 ---- */
.m-game-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; min-width: 0; }
.m-game-card {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 5px;
  min-width: 0; min-height: 184px; padding: 15px; text-align: left; font: inherit; color: var(--ink);
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
  border: 1px solid rgba(210, 227, 252, .85);
  border-radius: 24px; box-shadow: var(--shadow-soft), inset 0 1px 0 #fff; cursor: pointer;
  text-decoration: none; overflow: hidden;
}
.m-game-card.in-plan {
  border-color: #9fc1fa;
  box-shadow: 0 10px 24px rgba(37, 99, 235, .10), inset 0 1px 0 #fff;
}
.m-game-card-top {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 6px; width: 100%; margin-bottom: 2px;
}
.m-game-ic {
  display: grid; place-items: center; width: 46px; height: 46px; padding: 10px; flex: none;
  border-radius: 15px; background: var(--brand-soft); color: var(--brand-strong);
}
.m-game-mode {
  padding: 2px 7px; border-radius: 999px; background: #f2f6fd; color: var(--muted);
  font-size: .68em; font-weight: 700; white-space: nowrap;
}
.m-game-card b { font-size: 1em; font-weight: 850; line-height: 1.26; color: var(--brand-deep); overflow-wrap: anywhere; }
.m-game-card small { color: var(--muted); font-size: .78em; line-height: 1.42; overflow-wrap: anywhere; }
.m-game-minutes {
  padding: 2px 8px; border-radius: 999px; background: #eef5ff; color: var(--brand-strong);
  font-size: .73em; font-weight: 700; font-variant-numeric: tabular-nums;
}
.m-game-card .m-badge {
  max-width: 100%; margin-top: auto; white-space: normal; line-height: 1.35;
  overflow-wrap: anywhere;
}
.m-game-start {
  display: inline-flex; align-items: center; gap: 4px; margin-top: 6px; padding-top: 6px;
  width: 100%; border-top: 1px solid #eef3fc;
  color: var(--brand-strong); font-size: .8em; font-weight: 850;
}
.m-game-start .ic { width: 1.05em; height: 1.05em; margin-left: auto; }
.m-game-visual .m-game-ic { background: #eaf3ff; color: #2563eb; }
.m-game-attention .m-game-ic { background: #fff0ed; color: #d9462f; }
.m-game-memory .m-game-ic { background: #fdf0f7; color: #be185d; }
.m-game-reaction .m-game-ic { background: #fff6e5; color: #b45309; }
.m-game-coordination .m-game-ic { background: #e6f8f3; color: #0f766e; }

/* ---- 弹窗 / 抽屉 ---- */
.m-dialog {
  width: min(92vw, 520px); max-height: 86vh; padding: 0; border: 0;
  border-radius: 28px; background: #fff; color: var(--ink);
  box-shadow: 0 30px 80px rgba(15, 41, 92, .30);
}
.m-dialog::backdrop { background: rgba(15, 41, 92, .40); backdrop-filter: blur(5px); }
.m-dialog-head { display: flex; align-items: center; gap: 12px; padding: 20px 20px 0; }
.m-dialog-head h2 { margin: 0; font-size: 1.25em; color: var(--brand-deep); }
.m-dialog-close {
  display: grid; place-items: center; width: var(--tap); height: var(--tap); flex: none;
  margin-left: auto; border: 0; border-radius: 50%; background: #f1f5fb; color: var(--muted); cursor: pointer;
}
.m-dialog p { margin: 12px 0; padding: 0 20px; color: var(--ink-2); }
.m-dialog-actions { padding: 8px 20px 20px; }
.m-dialog-actions .m-btn { width: 100%; }
.m-about-list { list-style: none; margin: 4px 0; padding: 0 20px; }
.m-about-list li { display: flex; flex-direction: column; gap: 2px; padding: 10px 0; border-bottom: 1px solid #edf2fc; }
.m-about-list li:last-child { border-bottom: 0; }
.m-about-list b { font-size: .95em; color: var(--brand-deep); }
.m-about-list span { color: var(--muted); font-size: .84em; }
.m-about .m-btn { margin: 4px 20px 20px; width: calc(100% - 40px); }
.m-drawer {
  inset: 0 auto 0 0; width: min(86vw, 360px); height: 100%; max-height: 100%;
  margin: 0; border-radius: 0 28px 28px 0; overflow-y: auto;
  background: linear-gradient(180deg, #f8fbff, #edf4ff);
}
.m-drawer-head { display: flex; align-items: center; gap: 12px; padding: 20px 18px 14px; border-bottom: 1px solid rgba(212, 228, 252, .7); }
.m-brand-mark {
  display: grid; place-items: center; width: 46px; height: 46px; flex: none;
  border-radius: 15px; background: linear-gradient(135deg, #2f6bff, #1d4ed8);
  color: #fff; font-size: 1.25em; font-weight: 900;
  box-shadow: 0 8px 18px rgba(37, 99, 235, .24);
}
.m-drawer-head b { display: block; font-size: 1.15em; color: var(--brand-deep); }
.m-drawer-head small { display: block; color: var(--muted); font-size: .78em; }
.m-drawer-nav { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px 24px; }
.m-drawer-nav a, .m-drawer-nav button {
  display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 0 12px;
  border: 0; border-radius: 14px; background: none; color: var(--ink);
  font: inherit; font-weight: 700; text-align: left; text-decoration: none; cursor: pointer;
}
.m-drawer-nav a .ic, .m-drawer-nav button .ic { color: var(--brand-strong); }
.m-drawer-nav span { flex: 1; }
.m-drawer-nav em { font-style: normal; padding: 2px 8px; border-radius: 999px; background: #e8f0fe; color: var(--brand-strong); font-size: .78em; font-weight: 800; }
.m-drawer-nav a:active, .m-drawer-nav button:active { background: #e5f0ff; }
.m-drawer-sep { height: 1px; margin: 10px 12px; background: var(--line); }

/* ---- 训练进度与圆形周历(对齐 UIUX 参考稿) ---- */
.m-progress-card {
  padding: 20px 18px; border-radius: 28px;
  background: linear-gradient(160deg, #ffffff 0%, #f3f8ff 100%);
  border: 1px solid rgba(255, 255, 255, .96); box-shadow: var(--shadow), inset 0 1px 0 #fff;
}
.m-progress-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.m-progress-head b { font-size: 1.06em; color: var(--brand-deep); }
.m-progress-head span {
  padding: 3px 10px; border-radius: 999px; background: var(--brand-soft);
  color: var(--brand-strong); font-weight: 850; font-size: .86em; font-variant-numeric: tabular-nums;
}
.m-progress-bar { height: 12px; margin: 14px 0 10px; border-radius: 999px; background: #e3eeff; overflow: hidden; }
.m-progress-bar span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #2563eb 0%, #3b82f6 55%, #10b981 100%); }
.m-progress-note { margin: 0; color: var(--ink-2); font-size: .9em; }
.m-week-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-top: 16px; }
.m-week-days span {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  aspect-ratio: 1; min-height: 44px; max-width: 54px; width: 100%; margin: 0 auto;
  border-radius: 50%; background: #eef4ff; color: var(--muted); font-size: .74em;
  font-variant-numeric: tabular-nums;
}
.m-week-days span.done {
  background: linear-gradient(135deg, #2f6bff, #1d4ed8); color: #fff;
  box-shadow: 0 6px 14px rgba(37, 99, 235, .26);
}
.m-week-days span.today { outline: 2.5px solid var(--brand); outline-offset: 2px; }
.m-week-days i { font-style: normal; font-weight: 700; line-height: 1; }
.m-week-days b { font-size: .98em; line-height: 1.05; }

.m-record-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.m-record {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px;
  background: #fff; border: 1px solid rgba(212, 228, 252, .78);
  border-radius: 22px; box-shadow: var(--shadow-soft);
}
.m-record-ic { display: grid; place-items: center; width: 44px; height: 44px; flex: none; border-radius: 14px; background: #eaf3ff; color: var(--brand-strong); }
.m-record-ic.done { background: var(--ok-bg); color: var(--ok); }
.m-record-main { flex: 1; min-width: 0; }
.m-record-main b { display: block; color: var(--brand-deep); }
.m-record-main small { color: var(--muted); font-size: .8em; }
.m-record-time { color: var(--muted); font-size: .8em; white-space: nowrap; }
.m-score { color: var(--brand-strong); font-weight: 900; font-size: 1.24em; white-space: nowrap; font-variant-numeric: tabular-nums; }
.m-score small { color: var(--muted); font-size: .58em; font-weight: 600; margin-left: 1px; }
.m-stars { display: block; font-style: normal; font-size: .62em; color: #b45309; text-align: right; letter-spacing: .06em; }

/* ---- 脑健康指数环形仪表卡 ---- */
.m-health-card {
  margin-top: 16px;
  background: linear-gradient(155deg, #ffffff 0%, #f2f8ff 100%);
}
.m-health-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.m-health-ring {
  --p: 0; position: relative; display: grid; place-content: center; flex: none;
  width: 84px; height: 84px; border-radius: 50%; text-align: center;
  background: conic-gradient(#2563eb calc(var(--p) * 1%), #dbe8fc 0);
  box-shadow: 0 8px 18px rgba(37, 99, 235, .14);
}
.m-health-ring::before {
  content: ""; position: absolute; inset: 8px; border-radius: 50%; background: #fff;
}
.m-health-ring b, .m-health-ring small { position: relative; z-index: 1; }
.m-health-num { color: var(--brand-strong); font-size: 1.72em; font-weight: 900; line-height: 1; font-variant-numeric: tabular-nums; }
.m-health-ring small { display: block; margin-top: 2px; font-size: .62em; color: var(--muted); font-weight: 700; }
.m-mini-bar { height: 5px; margin-top: 7px; border-radius: 999px; background: #e3edfc; overflow: hidden; }
.m-mini-bar span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #2563eb, #34d399); }

/* ---- KPI 宫格 ---- */
.m-kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.m-kpis-3 { grid-template-columns: repeat(3, 1fr); }
.m-kpis > div {
  padding: 13px; border-radius: 18px; background: #fff;
  border: 1px solid rgba(212, 228, 252, .8); box-shadow: var(--shadow-soft);
}
.m-card .m-kpis > div, .m-card .m-kpis .m-card {
  background: var(--surface-soft); border-color: #dfebfc; box-shadow: none;
}
.m-kpis .m-card { margin: 0; padding: 14px; border-radius: 20px; }
.m-kpis span { display: block; color: var(--muted); font-size: .78em; font-weight: 700; }
.m-kpis b {
  display: block; margin-top: 3px; color: var(--brand-strong); font-size: 1.48em;
  line-height: 1.18; font-variant-numeric: tabular-nums;
}
.m-kpis b.has-alert { color: #c2410c; }
.m-kpis b small { font-size: .52em; color: var(--muted); font-weight: 700; }
.m-kpis small { display: block; margin-top: 2px; color: var(--muted); font-size: .73em; line-height: 1.38; }

/* ---- 商城 ---- */
.m-mall-hero {
  position: relative; overflow: hidden; padding: 22px 20px; border-radius: 28px;
  background:
    radial-gradient(circle at 90% 10%, rgba(255, 255, 255, .94), transparent 38%),
    linear-gradient(150deg, #f7fbff 0%, #dcecff 100%);
  border: 1px solid #fff; box-shadow: 0 16px 36px rgba(37, 99, 235, .12);
}
.m-mall-hero h1 { margin: 10px 0 4px; color: var(--brand-deep); font-size: 1.85em; font-weight: 900; letter-spacing: -.02em; }
.m-mall-hero p { margin: 0; color: var(--ink-2); font-size: .9em; }
.m-search {
  display: flex; align-items: center; gap: 8px; margin: 12px 0; padding: 4px 6px 4px 14px;
  background: #fff; border: 1.5px solid var(--line); border-radius: 999px; box-shadow: var(--shadow-soft);
}
.m-search:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(37, 99, 235, .14); }
.m-search .ic-search { width: 1.22em; height: 1.22em; color: var(--muted); flex: none; }
.m-search input { flex: 1; width: 100%; min-width: 0; min-height: var(--tap); padding: 0; border: 0; background: transparent; color: var(--ink); font: inherit; }
.m-search input:focus { outline: none; }
.m-search .m-send { width: var(--tap); height: var(--tap); }
.m-cats { display: flex; gap: 8px; overflow-x: auto; margin: 4px 0 14px; padding-bottom: 4px; scrollbar-width: none; }
.m-cats::-webkit-scrollbar { display: none; }
.m-cats a {
  flex: none; display: inline-flex; align-items: center; min-height: 42px; padding: 0 15px;
  border-radius: 999px; background: rgba(255, 255, 255, .88); border: 1px solid var(--line);
  color: var(--ink-2); font-size: .86em; font-weight: 800; text-decoration: none;
}
body.elder .m-cats a { min-height: 50px; }
.m-cats a.on {
  background: linear-gradient(135deg, #2f6bff, #1d4ed8); border-color: transparent;
  color: #fff; box-shadow: 0 6px 14px rgba(37, 99, 235, .24);
}

.m-products { list-style: none; margin: 14px 0 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.m-products .m-card { margin: 0; }
.m-product { display: flex; flex-direction: column; gap: 6px; min-width: 0; padding: 15px; border-radius: 22px; }
.m-product b, .m-product small, .m-product .m-hint { overflow-wrap: anywhere; }
.m-product-media {
  display: grid; place-items: center; height: 104px; margin-bottom: 4px; border-radius: 18px;
  background: linear-gradient(145deg, #edf4ff, #dceaff); color: var(--brand-strong);
}
.m-product-media .ic {
  width: 52px; height: 52px; padding: 12px; border-radius: 16px;
  background: rgba(255, 255, 255, .86); box-shadow: 0 6px 14px rgba(37, 99, 235, .10);
}
.m-product-body { display: flex; flex: 1; min-width: 0; flex-direction: column; gap: 4px; }
.m-product-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.m-product b { font-size: 1.02em; line-height: 1.3; color: var(--brand-deep); }
.m-product small { color: var(--muted); font-size: .8em; line-height: 1.42; }
.m-product .m-hint { font-size: .76em; margin: 2px 0; }
.m-price {
  margin: auto 0 4px; color: #c23916; font-size: 1.16em; font-weight: 900;
  font-variant-numeric: tabular-nums;
}
.m-price small { color: var(--muted); font-size: .66em; font-weight: 700; }
.m-product form { width: 100%; min-width: 0; margin-top: 4px; }
.m-product textarea, .m-product input { width: 100%; min-width: 0; }
.m-product .m-btn { width: 100%; }
.m-products-list { grid-template-columns: 1fr; }
.m-product-row { flex-direction: row; align-items: flex-start; gap: 14px; }
.m-product-row .m-product-media { width: 88px; height: 88px; flex: none; margin: 0; }
.m-product-row .m-product-body { min-width: 0; }
.m-cart-card { padding: 18px; }
.m-cart-list { list-style: none; margin: 0; padding: 0; }
.m-cart-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid #edf2fc; }
.m-cart-row:last-child { border-bottom: 0; }
.m-cart-main { flex: 1; min-width: 0; }
.m-cart-main b { display: block; color: var(--brand-deep); }
.m-cart-main small { color: var(--muted); font-size: .8em; }
.m-cart-total {
  margin: 12px 0 14px; padding: 10px 12px; border-radius: 14px;
  background: var(--surface-soft); font-size: .94em;
}

/* ---- 我的与个人档案头卡 ---- */
.m-profile-hero {
  padding: 20px; border-radius: var(--r-lg);
  background:
    radial-gradient(circle at 90% 0%, rgba(255, 255, 255, .94), transparent 40%),
    linear-gradient(150deg, #f6faff 0%, #ddeeff 100%);
  border: 1px solid #fff; box-shadow: 0 18px 40px rgba(37, 99, 235, .13), inset 0 1px 0 #fff;
}
.m-profile-row { display: flex; align-items: center; gap: 14px; }
.m-avatar {
  display: grid; place-items: center; width: 66px; height: 66px; flex: none;
  border-radius: 22px; background: linear-gradient(135deg, #2f6bff, #1d4ed8);
  color: #fff; font-size: 1.55em; font-weight: 900;
  box-shadow: 0 10px 22px rgba(37, 99, 235, .28), inset 0 1px 0 rgba(255, 255, 255, .35);
}
.m-profile-copy { min-width: 0; flex: 1; }
.m-profile-copy h1 { margin: 4px 0 0; font-size: 1.5em; font-weight: 900; letter-spacing: -.02em; color: var(--brand-deep); }
.m-profile-copy p { margin: 2px 0 0; color: var(--ink-2); font-size: .88em; font-weight: 700; }
.m-profile-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 16px; }
.m-profile-stats div {
  padding: 10px 6px; text-align: center; border-radius: 16px;
  background: rgba(255, 255, 255, .90); border: 1px solid rgba(255, 255, 255, .96);
}
.m-profile-stats b { display: block; color: var(--brand-strong); font-size: 1.4em; line-height: 1.2; font-variant-numeric: tabular-nums; }
.m-profile-stats span { display: block; margin-top: 2px; color: var(--muted); font-size: .73em; font-weight: 700; }
.m-profile-note { margin: 12px 0 0; color: var(--muted); font-size: .8em; }
.m-menu-group { margin-top: 18px; }
.m-menu-group h2 { margin: 0 4px 8px; color: var(--ink-2); font-size: .92em; font-weight: 850; }
.m-menu {
  list-style: none; margin: 0; padding: 0; overflow: hidden;
  background: #fff; border: 1px solid rgba(212, 228, 252, .8);
  border-radius: 22px; box-shadow: var(--shadow-soft);
}
.m-menu + .m-menu { margin-top: 12px; }
.m-menu li + li { border-top: 1px solid #edf2fc; }
.m-menu a, .m-menu button {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 10px 16px;
  border: 0; background: none; color: var(--ink); font: inherit; font-weight: 700;
  text-align: left; text-decoration: none; cursor: pointer;
}
.m-menu .ic { width: 1.3em; height: 1.3em; color: var(--brand-strong); }
.m-menu span { flex: 1; min-width: 0; }
.m-menu span small { display: block; font-weight: 500; font-size: .8em; color: var(--muted); margin-top: 1px; }
.m-menu em { font-style: normal; padding: 2px 9px; border-radius: 999px; background: var(--surface-soft); color: var(--brand-strong); font-size: .8em; font-weight: 800; }

/* ---- 表单 ---- */
.m-form { display: flex; flex-direction: column; gap: 6px; }
.m-form.m-search { flex-direction: row; align-items: center; gap: 8px; }
.m-form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.m-form-inline { display: flex; align-items: center; gap: 8px; }
.m-form-inline input { flex: 1; }
.m-form label { margin-top: 6px; font-weight: 800; font-size: .92em; color: var(--brand-deep); }
.m-form input, .m-form select, .m-form textarea {
  width: 100%; min-width: 0; min-height: var(--tap); padding: 0 14px;
  border: 1.5px solid #c5d7f6; border-radius: 15px;
  background: #fff; color: var(--ink); font: inherit;
}
.m-form textarea { min-height: 108px; padding: 12px 14px; resize: vertical; }
.m-form select { padding-right: 28px; }
.m-form input:focus, .m-form select:focus, .m-form textarea:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(37, 99, 235, .18);
}
.m-form .m-btn { margin-top: 10px; }
.m-scale-q { padding: 10px 0; border-bottom: 1px solid #edf2fc; }
.m-scale-q:last-of-type { border-bottom: 0; }
.m-scale-q label { display: block; margin: 0 0 6px; }
.m-code-input { text-align: center; font-size: 1.4em !important; font-weight: 800; letter-spacing: .2em; text-transform: uppercase; font-variant-numeric: tabular-nums; }
.m-code-input::placeholder { color: #6b7280; font-size: .62em; font-weight: 500; letter-spacing: 0; }
.m-seg { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 16px 0 12px; padding: 5px; background: #fff; border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-soft); }
.m-seg button { min-height: var(--tap); border: 0; border-radius: 14px; background: none; color: var(--muted); font: inherit; font-weight: 800; cursor: pointer; }
.m-seg button.on { background: linear-gradient(135deg, #2f6bff, #1d4ed8); color: #fff; box-shadow: 0 6px 14px rgba(37, 99, 235, .24); }

/* ---- 登录 ---- */
.m-login-hero {
  position: relative; overflow: hidden; min-height: 206px; padding: 24px 20px 20px;
  border-radius: var(--r-lg);
  background:
    radial-gradient(circle at 86% 12%, rgba(255, 255, 255, .95), transparent 38%),
    linear-gradient(155deg, #f5faff 0%, #dcecff 100%);
  border: 1px solid #fff; box-shadow: 0 18px 40px rgba(37, 99, 235, .13);
}
.m-login-hero h1 { position: relative; z-index: 2; margin: 12px 0 6px; color: var(--brand-deep); font-size: 1.95em; font-weight: 900; letter-spacing: -.03em; }
.m-login-hero p { position: relative; z-index: 2; max-width: 60%; margin: 0; color: var(--ink-2); font-size: .94em; }
.m-login-hero img { position: absolute; right: -10px; bottom: -4px; width: 48%; max-width: 194px; pointer-events: none; }

/* ---- 角色英雄卡(家属/医生/机构页共用) ---- */
.m-hero {
  position: relative; overflow: hidden; padding: 22px 20px; border-radius: 28px; color: #fff;
  background:
    radial-gradient(circle at 90% 10%, rgba(255, 255, 255, .26), transparent 40%),
    linear-gradient(142deg, #17368f 0%, #2563eb 58%, #3b82f6 100%);
  box-shadow: 0 18px 40px rgba(23, 54, 143, .25), inset 0 1px 0 rgba(255, 255, 255, .22);
}
.m-hero::after {
  content: ""; position: absolute; right: -28px; bottom: -48px; width: 150px; height: 150px;
  border-radius: 50%; background: rgba(255, 255, 255, .08); pointer-events: none;
}
.m-hero h1, .m-hero p { position: relative; z-index: 1; text-shadow: 0 1px 3px rgba(9, 30, 80, .18); }
.m-hero h1 { margin: 4px 0 6px; font-size: 1.52em; font-weight: 900; letter-spacing: -.02em; }
.m-hero p { margin: 4px 0; }
.m-hero-hi {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  background: rgba(255, 255, 255, .18); font-size: .78em; font-weight: 800; letter-spacing: .02em;
}
.m-hero-slim { padding: 18px 20px; margin-bottom: 14px; }
.m-hero-slim p { opacity: .95; font-size: .9em; }
.m-hero .m-hint { color: rgba(255, 255, 255, .88); }
.m-hero-foot { font-size: .9em; color: rgba(255, 255, 255, .92); }

/* ---- 列表 / 头像行 / 处方 / 问答 ---- */
.m-list {
  list-style: none; margin: 0; padding: 0; overflow: hidden;
  background: #fff; border: 1px solid rgba(212, 228, 252, .8);
  border-radius: 22px; box-shadow: var(--shadow-soft);
}
.m-sublist {
  box-shadow: none; border-color: #e1ecfc; margin-bottom: 14px;
}
.m-brief-box {
  padding: 12px 14px; border-radius: 16px;
  background: var(--surface-soft); border: 1px solid #e1ecfc;
}
.m-list + .m-card, .m-list + .m-btn, .m-list + .m-btn-stack { margin-top: 14px; }
.m-list li + li { border-top: 1px solid #edf2fc; }
.m-row {
  display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 12px 16px;
  color: var(--ink); text-decoration: none;
}
.m-row + .m-row { border-top: 1px solid #edf2fc; }
.m-row-avatar {
  display: grid; place-items: center; width: 42px; height: 42px; flex: none;
  border-radius: 14px; background: var(--brand-soft); color: var(--brand-strong);
  font-weight: 900; font-size: 1em;
}
.m-row-avatar.ok { background: var(--ok-bg); color: var(--ok); }
.m-row-avatar.warn { background: var(--warn-bg); color: var(--warn); }
.m-row-main { flex: 1; min-width: 0; }
.m-row-main b { display: block; color: var(--brand-deep); font-weight: 800; }
.m-row-main small { display: block; margin-top: 2px; color: var(--muted); font-size: .82em; line-height: 1.42; }
.m-row-main p { margin: 4px 0; color: var(--ink-2); font-size: .92em; }
.m-msg.unread { background: #f2f7ff; cursor: pointer; }
.m-dot { display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 50%; background: var(--brand); vertical-align: middle; }
.m-plain { margin: 0 0 12px; padding-left: 1.2em; color: var(--ink-2); }
.m-plain li + li { margin-top: 4px; }
.m-code {
  margin: 12px 0 0; padding: 12px; border-radius: 16px;
  background: var(--surface-soft); border: 1px dashed #9fc1fa;
  text-align: center; font-size: .88em; color: var(--ink-2);
}
.m-code b {
  display: block; margin-bottom: 4px; color: var(--brand-strong);
  font-size: 1.9em; letter-spacing: .18em; font-variant-numeric: tabular-nums;
}
.m-profile { display: flex; align-items: center; gap: 14px; }
.m-profile small { display: block; color: var(--muted); }
.m-tip { display: flex; gap: 10px; margin-top: 14px; color: var(--ink-2); font-size: .88em; background: linear-gradient(180deg, #f8fbff, #f0f6ff); }
.m-tip .ic { margin-top: 2px; color: var(--brand-strong); }
.m-tip p { margin: 0; }
.m-flash {
  display: flex; align-items: center; gap: 10px; margin: 10px 0 12px; padding: 12px 15px;
  border-radius: 16px; font-size: .92em; font-weight: 700;
}
.m-flash.ok { background: var(--ok-bg); color: var(--ok); border: 1px solid #bce8cf; }
.m-flash.err { background: var(--err-bg); color: var(--err); border: 1px solid #f6c2c7; }
.m-toast { position: fixed; left: 16px; right: 16px; top: calc(70px + env(safe-area-inset-top)); z-index: 50; max-width: 528px; margin: 0 auto; box-shadow: var(--shadow-float); }
.m-article { margin: 12px 0 8px; white-space: pre-wrap; line-height: 1.72; color: var(--ink); }
.m-brief p { margin: 0 0 8px; line-height: 1.6; }

.m-plan-head { display: flex; align-items: center; gap: 12px; }
.m-plan-head b { color: var(--brand-deep); font-size: 1.04em; }
.m-plan-head small { display: block; color: var(--muted); font-size: .82em; }
.ic-dir { display: grid; place-items: center; width: 46px; height: 46px; padding: 10px; flex: none; border-radius: 15px; background: var(--brand-soft); color: var(--brand-strong); }
.m-dl { display: grid; gap: 8px; margin: 14px 0; padding: 12px 14px; border-radius: 16px; background: var(--surface-soft); }
.m-dl div { display: flex; justify-content: space-between; gap: 12px; font-size: .92em; }
.m-dl dt { color: var(--muted); }
.m-dl dd { margin: 0; font-weight: 800; color: var(--brand-deep); text-align: right; font-variant-numeric: tabular-nums; }
.m-plan-items { margin: 0; padding-left: 1.2em; color: var(--ink-2); }
.m-plan-items li + li { margin-top: 5px; }
.m-plan-note { margin: 12px 0 0; padding: 10px 12px; border-radius: 14px; background: var(--warn-bg); color: var(--warn); font-size: .88em; font-weight: 700; }

.m-qa { list-style: none; display: flex; flex-direction: column; gap: 10px; margin: 0 0 14px; padding: 0; }
.m-qa li {
  max-width: 90%; padding: 12px 15px; border-radius: 20px 20px 20px 6px;
  background: #fff; border: 1px solid #e1ebf9; box-shadow: var(--shadow-soft);
}
.m-qa li.mine {
  align-self: flex-end; border-radius: 20px 20px 6px 20px;
  background: linear-gradient(135deg, #2f6bff, #1d4ed8); color: #fff; border-color: transparent;
}
.m-qa small { color: var(--muted); font-size: .75em; font-weight: 700; }
.m-qa li.mine small { color: rgba(255, 255, 255, .86); }
.m-qa p { margin: 4px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }

/* ---- 适老增强 ---- */
body.elder .m-brand { font-size: 1.3em; }
body.elder .m-home-hero h1 { font-size: 2.15em; }
body.elder .m-home-hero-sub { font-size: .9em; }
body.elder .m-grid a { min-height: 138px; }
body.elder .m-grid a > span:not(.ic-tile) { font-size: 1.06em; }
body.elder .m-task { padding: 18px 16px; }
body.elder .m-tabs a { font-size: .82em; }
body.elder .m-tabs a .m-tab-icon { width: 44px; height: 32px; }
body.elder .m-menu a, body.elder .m-menu button { min-height: 64px; }
body.elder .m-drawer-nav a, body.elder .m-drawer-nav button { min-height: 60px; }
body.elder .m-bubble { max-width: 94%; }
body.elder .m-game-card { min-height: 198px; }

@media (prefers-reduced-motion: no-preference) {
  .m-btn, .m-icon-btn, .m-grid a, .m-game-card, .m-tabs a, .m-tabs .m-tab-icon,
  .m-subnav a, .m-menu a, .m-menu button, a.m-row, .m-msg, .m-banner,
  .m-back-pill, .m-schedule-pill, .m-assist-dock, .m-task-cta, .m-chips button,
  .m-filter-chip, .m-cats a, .m-send, .m-composer-sos, .m-play-back, .m-play-pause,
  .m-copy-btn, .ic-go {
    transition:
      transform .18s cubic-bezier(.22, 1, .36, 1),
      background-color .15s ease-out,
      box-shadow .16s ease-out,
      border-color .15s ease-out,
      opacity .15s ease-out;
  }
  .m-dialog:not(.m-drawer)[open] {
    animation: m-dialog-in .18s cubic-bezier(.22, 1, .36, 1) both;
  }
  .m-drawer[open] {
    animation: m-drawer-in .22s cubic-bezier(.22, 1, .36, 1) both;
  }
  .m-toast {
    animation: m-toast-in .22s cubic-bezier(.22, 1, .36, 1) both;
  }
  .m-toast.is-leaving {
    animation: m-toast-out .18s ease-in forwards;
  }
  .m-game-card.is-filtering-in {
    animation: m-card-rise .18s cubic-bezier(.22, 1, .36, 1) both;
  }
  .m-fold[open] .m-fold-body {
    animation: m-card-rise .16s ease-out both;
  }
}
@keyframes m-dialog-in {
  from { opacity: 0; transform: translateY(8px) scale(.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes m-drawer-in {
  from { opacity: .6; transform: translateX(-100%); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes m-toast-in {
  from { opacity: 0; transform: translateY(-12px) scale(.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes m-toast-out {
  to { opacity: 0; transform: translateY(-8px) scale(.98); }
}
@keyframes m-card-rise {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
@media (max-width: 380px) {
  .m-top-label { display: none; }
  .m-home-hero h1, .m-home-hero-sub { max-width: 64%; }
  .m-home-art { right: -16px; width: 48%; }
  .m-game-hero h1, .m-game-hero p { max-width: 66%; }
  .m-game-hero img { right: -14px; width: 50%; }
  .m-products { grid-template-columns: 1fr; }
  .m-products-list .m-product-row { flex-direction: row; }
}
@media (max-width: 340px) {
  .m-home-art { display: none; }
  .m-home-hero h1, .m-home-hero-sub { max-width: 100%; }
  .m-game-hero img { opacity: .45; }
  .m-game-hero h1, .m-game-hero p { max-width: 74%; }
}

/* ---- Web 游戏页(ADR-0019) ---- */
body.m-playing .m-assist-dock,
body.m-train .m-assist-dock { display: none; }
body.m-playing .m-main { padding-bottom: 24px; }
.m-play-cockpit {
  padding: 12px 14px 14px; margin: 2px 0 12px; border-radius: 24px;
  background: rgba(255, 255, 255, .92); border: 1px solid rgba(212, 228, 252, .86);
  box-shadow: var(--shadow-soft), inset 0 1px 0 #fff;
}
.m-play-head { display: flex; align-items: center; gap: 10px; margin: 0 0 10px; }
.m-play-back, .m-play-pause {
  min-height: var(--tap); padding: 0 14px; display: inline-flex; align-items: center;
  justify-content: center; gap: 4px; border: 1.5px solid #c9dcfb; border-radius: 15px;
  background: #fff; color: var(--brand-strong); font: inherit; font-weight: 800;
  text-decoration: none; box-shadow: var(--shadow-soft); cursor: pointer;
}
.m-play-pause:disabled { opacity: .52; cursor: not-allowed; box-shadow: none; }
.m-play-back { flex: none; }
.m-play-back .ic { transform: rotate(180deg); }
.m-play-pause { margin-left: auto; flex: none; }
.m-play-head h1 { margin: 2px 0 0; font-size: 1.2em; font-weight: 900; line-height: 1.2; color: var(--brand-deep); }
.m-play-hud {
  margin: 0; padding: 7px 12px; border-radius: 12px; background: var(--surface-soft);
  font-weight: 800; font-size: .92em; color: var(--ink); font-variant-numeric: tabular-nums;
}
.m-play-progress { height: 10px; margin: 10px 0 0; border-radius: 999px; background: #e2edfc; overflow: hidden; }
.m-play-progress span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #2563eb, #38bdf8, #10b981); transition: width .2s ease-out; }
.m-play-stage {
  position: relative; min-height: min(62vh, 560px); padding: 14px; overflow: hidden;
  border: 1.5px solid rgba(255, 255, 255, .98); border-radius: 28px;
  background:
    radial-gradient(circle at 88% 8%, rgba(255, 255, 255, .96), transparent 36%),
    linear-gradient(155deg, #f7fbff 0%, #e7f2ff 58%, #daebff 100%);
  box-shadow: 0 18px 40px rgba(37, 99, 235, .14), inset 0 1px 0 #fff;
  touch-action: manipulation;
}
.m-play-stage.is-finished { pointer-events: none; }
.m-play-target {
  position: absolute; display: grid; place-items: center; padding: 0; border: 3px solid rgba(255, 255, 255, .45);
  border-radius: 20px; color: #fff; font: inherit; font-size: 2em; font-weight: 900;
  box-shadow: 0 10px 22px rgba(15, 41, 92, .22); cursor: pointer;
  touch-action: manipulation;
  animation: m-target-in .17s cubic-bezier(.22, 1, .36, 1) both;
  transition: transform .14s cubic-bezier(.22, 1, .36, 1), box-shadow .14s ease-out;
}
.m-play-target:active { transform: scale(.94); transition-duration: .05s; }
.m-play-target[data-holding="1"] {
  transform: scale(1.045);
  box-shadow: 0 14px 30px rgba(15, 41, 92, .30), 0 0 0 4px rgba(255, 255, 255, .62);
}
.m-hold-ring {
  --hold-p: 0;
  position: absolute; inset: -9px; border-radius: inherit; pointer-events: none;
  padding: 5px;
  background: conic-gradient(#34d399 calc(var(--hold-p) * 1%), rgba(255, 255, 255, .28) 0);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  filter: drop-shadow(0 2px 8px rgba(16, 185, 129, .38));
}
.m-hold-ring.is-ready {
  background: conic-gradient(#10b981 100%, transparent 0);
  filter: drop-shadow(0 0 12px rgba(16, 185, 129, .78));
}
@keyframes m-target-in {
  from { opacity: 0; transform: scale(.82); }
  to { opacity: 1; transform: scale(1); }
}
.m-play-ripple {
  position: absolute; z-index: 18; width: 28px; height: 28px; border-radius: 50%;
  pointer-events: none; transform: translate(-50%, -50%) scale(.4);
  border: 3px solid rgba(16, 185, 129, .75); background: rgba(16, 185, 129, .14);
  animation: m-play-ripple .46s cubic-bezier(.16, .84, .32, 1) forwards;
}
.m-play-ripple.warn {
  border-color: rgba(217, 119, 6, .75); background: rgba(245, 158, 11, .14);
}
@keyframes m-play-ripple {
  to { opacity: 0; transform: translate(-50%, -50%) scale(3.1); }
}
.m-play-feedback {
  position: absolute; z-index: 20; pointer-events: none; transform: translate(-50%, -50%);
  padding: 5px 12px; border-radius: 999px; background: #fff; color: var(--ok);
  font-size: .9em; font-weight: 900; box-shadow: var(--shadow-soft);
  animation: m-play-float .9s ease-out both;
}
.m-play-feedback.warn { color: var(--warn); }
@keyframes m-play-float { from { opacity: 0; transform: translate(-50%, -40%); } 30% { opacity: 1; } to { opacity: 0; transform: translate(-50%, -130%); } }
.m-play-board { display: grid; gap: 10px; width: 100%; margin: 0 auto; }
.m-play-card {
  aspect-ratio: 1; min-width: 0; padding: 0; border: 2px solid rgba(255, 255, 255, .6); border-radius: 18px;
  background: linear-gradient(145deg, #2f6bff, #1d4ed8); color: #fff; font: inherit; font-weight: 900;
  font-size: clamp(1.2rem, 5vw, 2rem);
  box-shadow: 0 8px 16px rgba(29, 78, 216, .22), inset 0 1px 0 rgba(255, 255, 255, .35); cursor: pointer;
  transition: transform .16s cubic-bezier(.22, 1, .36, 1), background-color .15s ease-out, box-shadow .16s ease-out;
}
.m-play-card:not(:disabled):active { transform: scale(.93); transition-duration: .05s; }
.m-play-card:disabled { cursor: default; opacity: 1; }
.m-play-card.is-face {
  color: #fff;
  animation: m-card-flip .2s cubic-bezier(.22, 1, .36, 1);
}
.m-play-card.is-matched {
  box-shadow: inset 0 0 0 4px rgba(255, 255, 255, .72), 0 8px 20px rgba(16, 185, 129, .24);
  animation: m-card-match .26s cubic-bezier(.22, 1, .36, 1);
}
@keyframes m-card-flip {
  0% { transform: scaleX(.72) scaleY(.95); }
  100% { transform: scaleX(1) scaleY(1); }
}
@keyframes m-card-match {
  0% { transform: scale(1); }
  50% { transform: scale(1.07); }
  100% { transform: scale(1); }
}
.m-play-prompt { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 2px 0 14px; font-size: 1.28em; font-weight: 900; }
.m-play-swatch { width: 46px; height: 46px; border-radius: 14px; border: 2px solid rgba(15, 41, 92, .25); flex: none; transition: background-color .16s ease-out; }
.m-play-options { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; }
.m-play-option {
  width: min(30vw, 128px); aspect-ratio: 1; border: 3px solid rgba(255, 255, 255, .65);
  border-radius: 20px; box-shadow: 0 10px 20px rgba(15, 41, 92, .16); cursor: pointer;
  transition: transform .15s cubic-bezier(.22, 1, .36, 1), box-shadow .15s ease-out;
}
.m-play-option:active { transform: scale(.94); transition-duration: .05s; }
.m-play-pill-banner {
  padding: 16px 14px; margin: 0 0 12px; border-radius: 20px; color: #fff;
  text-align: center; box-shadow: 0 10px 24px rgba(15, 41, 92, .18);
  border: 2px solid rgba(255, 255, 255, .42);
}
.m-play-pill-banner b { display: block; font-size: 1.28em; font-weight: 900; }
.m-play-pill-banner small { display: block; margin-top: 4px; font-size: .86em; opacity: .92; }
.m-play-grid {
  display: grid; grid-template-columns: repeat(var(--cols, 1), minmax(0, 1fr));
  gap: 12px; width: 100%;
}
.m-play-choice {
  min-height: 82px; padding: 14px 18px; border: 2.5px solid rgba(255, 255, 255, .52);
  border-radius: 20px; color: #fff; font: inherit; font-size: 1.24em; font-weight: 900;
  box-shadow: 0 10px 22px rgba(15, 41, 92, .18); cursor: pointer;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  transition: transform .14s cubic-bezier(.22, 1, .36, 1), box-shadow .14s ease-out;
}
.m-play-choice:active { transform: scale(.96); transition-duration: .05s; }
.m-play-choice small { font-size: .72em; font-weight: 700; opacity: .92; }
.m-play-beat-ring {
  position: absolute; inset: -26px; border-radius: 50%; pointer-events: none;
  border: 3px dashed rgba(37, 99, 235, .62);
  animation: m-beat-shrink var(--beat-ms, 650ms) linear forwards;
}
@keyframes m-beat-shrink {
  from { transform: scale(1.22); opacity: .35; }
  85% { opacity: .95; border-color: #10b981; }
  to { transform: scale(.74); opacity: .95; border-color: #10b981; }
}
.m-play-star-svg {
  position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none;
}
.m-play-numpad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; padding: 4px; }
.m-play-num {
  aspect-ratio: 1; border: 2px solid #c9dcfb; border-radius: 20px; background: #fff;
  color: var(--brand-strong); font: inherit; font-size: 2em; font-weight: 900;
  box-shadow: var(--shadow-soft); cursor: pointer; font-variant-numeric: tabular-nums;
  transition: transform .15s cubic-bezier(.22, 1, .36, 1), background-color .14s ease-out, border-color .14s ease-out;
}
.m-play-num:not(:disabled):active { transform: scale(.93); background: #eef5ff; transition-duration: .05s; }
.m-play-num.done {
  background: var(--ok-bg); color: var(--ok); border-color: #b9e7cd;
  animation: m-card-match .22s cubic-bezier(.22, 1, .36, 1);
}
.is-wrong {
  animation: m-gentle-shake .24s ease-out;
}
@keyframes m-gentle-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}
.m-play-spinner {
  width: 56px; height: 56px; margin: 12px auto 14px; border-radius: 50%;
  border: 4px solid #dbe8fc; border-top-color: var(--brand);
  animation: m-spin .78s linear infinite;
}
.m-play-canvas { display: block; width: 100%; height: auto; border-radius: 20px; touch-action: none; }
.m-play-hint { margin: 8px 2px 0; text-align: center; color: var(--muted); font-size: .86em; }
.m-play-overlay, .m-play-pause-overlay {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center;
  padding: 18px; background: rgba(12, 32, 74, .48); backdrop-filter: blur(6px);
}
.m-play-overlay.hidden, .m-play-pause-overlay.hidden { display: none; }
.m-play-panel {
  width: min(92vw, 436px); max-height: 88vh; overflow: auto; padding: 24px 22px;
  border-radius: 30px; background: linear-gradient(180deg, #fff, #f8fbff);
  border: 1px solid #fff; box-shadow: 0 30px 80px rgba(15, 41, 92, .32);
  text-align: center;
}
.m-play-panel h2 { margin: 0 0 8px; font-size: 1.38em; font-weight: 900; color: var(--brand-deep); }
.m-play-intro { text-align: left; }
.m-play-intro > .m-eyebrow { margin-bottom: 8px; background: var(--brand-soft); }
.m-play-intro h2 { text-align: left; }
.m-play-meta { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 6px; }
.m-play-meta-center { justify-content: center; margin: 10px 0 8px; }
.m-play-facts {
  margin: 12px 0 14px; padding: 12px 14px; list-style: none;
  border-radius: 18px; background: var(--surface-soft); border: 1px solid #dfebfc;
  color: var(--ink-2); font-size: .88em;
}
.m-play-facts li {
  position: relative; padding: 6px 0 6px 18px;
  border-bottom: 1px solid #e5eefc;
}
.m-play-facts li:last-child { border-bottom: 0; }
.m-play-facts li::before {
  content: ""; position: absolute; left: 2px; top: 14px;
  width: 7px; height: 7px; border-radius: 50%; background: var(--brand);
}
.m-play-intro .m-play-note { text-align: left; }
.m-play-score {
  --score: 0; position: relative; display: grid; place-content: center;
  width: 152px; height: 152px; margin: 12px auto; border-radius: 50%;
  background: conic-gradient(#2563eb calc(var(--score) * 1%), #dbe7fb 0);
}
.m-play-score::before { content: ""; position: absolute; inset: 12px; border-radius: 50%; background: #fff; }
.m-play-score b, .m-play-score small { position: relative; z-index: 1; }
.m-play-score b { font-size: 2.25em; line-height: 1; color: var(--brand-strong); font-variant-numeric: tabular-nums; }
.m-play-score small { display: block; color: var(--muted); font-size: .7em; }
.m-play-stars { margin: 4px 0; color: #b45309; font-size: 1.35em; letter-spacing: .18em; }
.m-play-note { color: var(--muted); font-size: .86em; margin: 6px 0; }
.m-play-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.m-play-actions .m-btn { width: 100%; }
body.elder .m-play-stage { min-height: min(58vh, 520px); }
body.m-low-end .m-top,
body.m-low-end .m-icon-btn,
body.m-low-end .m-composer,
body.m-low-end .m-assist-dock,
body.m-low-end .m-tabs,
body.m-low-end .m-dialog::backdrop {
  backdrop-filter: none;
}
body.m-low-end .m-card,
body.m-low-end .m-home-hero,
body.m-low-end .m-game-hero,
body.m-low-end .m-play-stage,
body.m-low-end .m-play-panel,
body.m-low-end .m-banner {
  box-shadow: none;
}
body.m-low-end .m-play-feedback,
body.m-low-end .m-play-ripple,
body.m-low-end .m-play-target { animation-duration: .01s; }
