/* =====================================================================
 * 渠动力·售后陪练助手 V2  样式
 * 移动端PWA优先 · 明暗双主题 · 含关卡地图/对话气泡/雷达图/弹层
 * ===================================================================== */
:root {
  --bg: #f4f6fb;
  --surface: #ffffff;
  --surface-2: #f0f3fa;
  --text: #1a2233;
  --text-2: #5b6678;
  --muted: #8a93a6;
  --primary: #1f3a8a;
  --primary-soft: #e8edfb;
  --primary-2: #3b5bdb;
  --accent: #f59e0b;
  --success: #16a34a;
  --danger: #ef4444;
  --warn-bg: #fff7ed;
  --warn-border: #fdba74;
  --line: #e6eaf2;
  --line-2: #dfe5f0;
  --shadow: 0 4px 16px rgba(31, 58, 138, .08);
  --shadow-md: 0 8px 28px rgba(31, 58, 138, .14);
  --shadow-sm: 0 2px 8px rgba(31, 58, 138, .06);
  --radius: 16px;
  --radius-sm: 12px;
  --radius-lg: 22px;
  --nav-h: 60px;
  --header-h: 58px;
  --safe-b: env(safe-area-inset-bottom, 0px);

  --up: #ef4444;        /* A股红涨 */
  --down: #16a34a;      /* A股绿跌 */
  --neutral: #6b7280;
}
[data-theme="dark"] {
  --bg: #0e1320;
  --surface: #171d2e;
  --surface-2: #1f2738;
  --text: #e9edf6;
  --text-2: #aab3c5;
  --muted: #6c7689;
  --primary: #6f8cff;
  --primary-soft: #1c2540;
  --primary-2: #8aa0ff;
  --accent: #fbbf24;
  --success: #34d399;
  --danger: #f87171;
  --warn-bg: #2a2113;
  --warn-border: #7c5a23;
  --line: #283042;
  --line-2: #2f384c;
  --shadow: 0 4px 18px rgba(0,0,0,.35);
  --shadow-md: 0 10px 32px rgba(0,0,0,.5);
  --shadow-sm: 0 2px 8px rgba(0,0,0,.25);
  --up: #f87171;
  --down: #4ade80;
  --neutral: #9ca3af;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg); color: var(--text);
  font-size: 15px; line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(var(--nav-h) + var(--safe-b));
}
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 15px; }
ol, ul { padding-left: 18px; margin: 6px 0; }

/* ============ 顶部栏 ============ */
.app-header {
  position: sticky; top: 0; z-index: 30;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding-top: env(safe-area-inset-top, 0px);
}
.header-inner {
  height: var(--header-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 14px;
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff; font-weight: 800; font-size: 18px;
  display: grid; place-items: center; flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.brand-text strong { font-size: 16px; }
.brand-text small { color: var(--muted); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.header-actions { display: flex; gap: 6px; }
.icon-btn {
  width: 36px; height: 36px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface-2);
  font-size: 17px; color: var(--text);
}
.icon-btn:active { transform: scale(.96); }

/* ============ 主区 ============ */
.app-main { max-width: 720px; margin: 0 auto; padding: 14px 14px 24px; }
.page { display: none; animation: fade .25s ease; }
.page.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(6px);} to { opacity:1; transform:none;} }

/* ============ Hero ============ */
.hero-card {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff; border-radius: var(--radius-lg); padding: 18px 18px 20px;
  box-shadow: var(--shadow-md);
}
.hero-date { font-size: 12px; opacity: .85; letter-spacing: .5px; }
.hero-title { margin: 6px 0 4px; font-size: 22px; font-weight: 800; }
.hero-desc { margin: 0; font-size: 13px; opacity: .9; }

/* ============ 区块标题 ============ */
.section-label {
  margin: 22px 4px 10px; font-size: 13px; font-weight: 700;
  color: var(--text-2); letter-spacing: .3px;
  display: flex; align-items: center; gap: 8px;
}
.meta-tip { font-weight: 500; color: var(--muted); margin-left: auto; font-size: 12px; }
.count-badge {
  background: var(--primary-soft); color: var(--primary-2);
  border-radius: 20px; font-size: 11px; padding: 2px 8px; font-weight: 700;
}

/* ============ 市场速览卡片 ============ */
.market-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; box-shadow: var(--shadow-sm); }
/* "⌛ 加载中…"动态提示 */
.market-loading {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 12px 0 14px; font-size: 13px; font-weight: 600; color: var(--text-2);
  animation: market-loading-pulse 1.1s ease-in-out infinite;
}
.market-loading[hidden] { display: none; }
@keyframes market-loading-pulse {
  0%, 100% { opacity: .4; }
  50% { opacity: 1; }
}
/* 固定布局：六个宽基指数 三行两列，任何设备一致。
   flex 为基础兜底（老 WebView 不支持 grid 时也两列），支持 grid 的浏览器用 @supports 覆盖。 */
.market-row {
  display: flex; flex-wrap: wrap; gap: 8px;
}
.market-row .idx {
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  padding: 8px 10px; border-radius: var(--radius-sm);
  background: var(--surface-2); border: 1px solid var(--line);
  min-width: 0; box-sizing: border-box;
  /* flex 兜底：窄屏（不支持 grid 的设备）也强制两列——min-width 调小保证 300px 级屏幕放得下两个 */
  flex: 1 1 40%; min-width: 120px;
}
@supports (display: grid) {
  .market-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .market-row .idx { flex: none; min-width: 0; }
}
.idx-left { flex: 1; min-width: 0; }
.idx-right { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; flex-shrink: 0; }
.idx-name { font-size: 12px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.idx-val { font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }
.idx-chg { font-size: 11px; padding: 2px 6px; border-radius: 999px; font-weight: 700; white-space: nowrap; }
.idx-chg.up { background: rgba(239, 68, 68, .12); color: var(--up); }
.idx-chg.down { background: rgba(22, 163, 74, .12); color: var(--down); }
.idx-chg.flat { background: rgba(107, 114, 128, .12); color: var(--neutral); }
.idx-src { font-size: 9px; color: var(--muted); background: var(--surface); border: 1px solid var(--line); border-radius: 4px; padding: 0 4px; line-height: 14px; white-space: nowrap; }

/* 固定布局：涨/跌/成交 一行三格，任何设备一致（flex 兜底 + grid 覆盖） */
.market-mini {
  margin-top: 10px; display: flex; gap: 6px;
}
.market-mini .mini-item { flex: 1 1 0; }
@supports (display: grid) {
  .market-mini { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .market-mini .mini-item { flex: none; }
}
.mini-item { padding: 6px 4px; text-align: center; border-radius: 10px; background: var(--surface-2); }
.mini-label { display: block; font-size: 10px; color: var(--muted); }
.mini-val { display: block; font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.up { color: var(--up); } .down { color: var(--down); }

.market-legend { margin-top: 10px; font-size: 11px; color: var(--muted); }
.market-legend .tag {
  display: inline-block; padding: 1px 6px; margin-right: 4px;
  background: var(--surface-2); border-radius: 6px; color: var(--text-2);
  font-size: 11px;
}
.tag-live { background: rgba(239, 68, 68, .1) !important; color: var(--up) !important; font-weight: 600; }
.tag-main { background: rgba(239, 68, 68, .1) !important; color: var(--up) !important; font-weight: 600; }
.tag-sub  { background: rgba(22, 163, 74, .1) !important; color: var(--down) !important; }
.tag-static { background: rgba(107, 114, 128, .1) !important; color: var(--neutral) !important; }
.legend-note { font-size: 10px; color: var(--muted); margin-left: 8px; }

/* ============ 刷新按钮 ============ */
.refresh-btn {
  width: 30px; height: 30px; border: 1px solid var(--line);
  border-radius: 50%; background: var(--surface-2); color: var(--text-1);
  font-size: 16px; cursor: pointer; display: inline-flex; align-items: center;
  justify-content: center; transition: all .2s; line-height: 1;
}
.refresh-btn:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.refresh-btn:disabled { opacity: .4; cursor: not-allowed; }
.refresh-btn:active:not(:disabled) { transform: scale(.9); }

/* ============ 宏观数据条 ============ */
/* 固定布局：美元兑人民币等宏观 一行一格占满横屏，任何设备一致（flex 兜底 + grid 覆盖） */
.macro-strip {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-top: 6px;
}
.macro-strip .mini-item { flex: 1 1 100%; }
@supports (display: grid) {
  .macro-strip { display: grid; grid-template-columns: 1fr; gap: 6px; }
  .macro-strip .mini-item { flex: none; }
}
.macro-strip .mini-item { padding: 4px 8px; text-align: left; display: flex; align-items: center; gap: 6px; }
.macro-strip .mini-label { font-size: 11px; min-width: 90px; }
.macro-strip .mini-val { font-size: 12px; }
.macro-strip .mini-src { font-size: 9px; color: var(--muted); }
.macro-strip .idx-chg { font-size: 10px; }

/* ============ 管理员 · 数据源状态 ============ */
.ac-sources { margin-top: 8px; }
.ac-source-row {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px 10px; background: var(--surface-2); border-radius: var(--radius-sm);
  margin-bottom: 4px;
}
.ac-source-name { font-size: 12px; font-weight: 600; }
.ac-source-sub { font-size: 10px; color: var(--muted); margin-top: 1px; }
.open-desk-btn {
  display: block; margin-top: 10px; padding: 9px;
  border-radius: var(--radius-sm); background: var(--primary);
  color: #fff; text-align: center; font-weight: 700; font-size: 13px;
  text-decoration: none;
}
.open-desk-btn:active { transform: scale(.98); }

/* ============ 通用卡片 / 生成器 ============ */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow-sm); margin-bottom: 12px; }
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; gap: 8px; }
.card-head h3 { margin: 0; font-size: 15px; }
.card-sub { margin: 0 0 10px; font-size: 12px; color: var(--text-2); }

.badge { padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.badge-p0 { background: rgba(239, 68, 68, .12); color: var(--danger); }
.badge-p1 { background: rgba(245, 158, 11, .14); color: var(--accent); }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.form-grid label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--text-2); }
.form-grid input, .form-grid select, .form-grid textarea {
  padding: 8px 10px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface);
  color: var(--text); outline: none; font-size: 14px;
}
.form-grid input:focus, .form-grid textarea:focus, .form-grid select:focus { border-color: var(--primary-2); }

.gen-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }

.btn { padding: 9px 14px; border-radius: 10px; border: 1px solid transparent; font-size: 14px; font-weight: 600; transition: transform .12s ease; }
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:active { background: var(--primary-2); }
.btn-ghost { background: var(--surface-2); color: var(--text); border-color: var(--line); }
.btn-soft { background: var(--primary-soft); color: var(--primary-2); }
.btn-danger-outline { background: transparent; color: var(--danger); border-color: var(--danger); padding: 10px; width: 100%; border-radius: var(--radius); }

.result-box { margin-top: 12px; border: 1px dashed var(--line); border-radius: var(--radius-sm); padding: 10px; background: var(--surface-2); }
.result-head { display: flex; align-items: center; justify-content: space-between; }
.result-head span { font-weight: 700; font-size: 13px; color: var(--text-2); }
.result-text { white-space: pre-wrap; font-size: 14px; line-height: 1.7; padding: 8px 0; color: var(--text); }
.copy-mini { padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font-size: 12px; }
.compliance-tip { margin-top: 6px; font-size: 12px; color: var(--warn-border); background: var(--warn-bg); border: 1px solid var(--warn-border); padding: 6px 8px; border-radius: 8px; }

/* ============ 情景速入口 ============ */
.scenario-grid { display: block; }
.scenario-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 10px; text-align: left; display: flex; flex-direction: column; gap: 4px;
  box-shadow: var(--shadow-sm); transition: transform .12s ease;
}
.scenario-card:active { transform: scale(.97); }
.scenario-card .ic { font-size: 22px; }
.scenario-card .ti { font-size: 14px; font-weight: 700; }
.scenario-card .su { font-size: 11px; color: var(--text-2); }

.quick-tools { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.quick-tool {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 8px; display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.quick-tool .ic { font-size: 22px; }
.quick-tool .na { font-size: 12px; font-weight: 600; }

.notice-card {
  display: flex; gap: 10px; align-items: flex-start;
  background: var(--warn-bg); border: 1px solid var(--warn-border);
  border-radius: var(--radius); padding: 12px; margin-top: 18px;
  color: var(--text);
}
.notice-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); margin-top: 6px; flex-shrink: 0; }
.notice-card strong { display: block; font-size: 13px; }
.notice-card p { margin: 2px 0 0; font-size: 12px; }

/* ============ 训练页 ============ */
.flow-banner {
  display: flex; align-items: center; justify-content: space-between;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff; border-radius: var(--radius); padding: 12px 16px;
  box-shadow: var(--shadow);
  margin-bottom: 8px;
}
.flow-banner span { font-size: 13px; opacity: .9; }
.flow-steps { font-size: 13px; }
.flow-steps b { background: rgba(255,255,255,.18); padding: 2px 7px; border-radius: 6px; margin: 0 1px; }
.flow-steps i { margin: 0 2px; opacity: .6; font-style: normal; }

.page-hint { margin: 0 0 12px; font-size: 12px; color: var(--text-2); }

.user-summary {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 10px; box-shadow: var(--shadow-sm);
}
.us-item { display: flex; flex-direction: column; align-items: center; }
.us-label { font-size: 10px; color: var(--muted); }
.us-val { font-size: 18px; font-weight: 800; color: var(--primary-2); font-variant-numeric: tabular-nums; }

/* 关卡地图 */
.level-map { display: flex; flex-direction: column; gap: 12px; }
.level-area {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px; box-shadow: var(--shadow-sm);
}
.area-title {
  display: flex; align-items: center; gap: 8px; margin-bottom: 10px;
  font-size: 13px; font-weight: 700; color: var(--text-2);
}
.area-title .pill {
  background: var(--primary-soft); color: var(--primary-2);
  padding: 2px 10px; border-radius: 999px; font-size: 11px;
}
.levels { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.level-card {
  position: relative;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 10px;
  text-align: left; transition: transform .12s ease;
}
.level-card.locked { opacity: .55; filter: grayscale(.7); }
.level-card.done { border-color: var(--success); }
.level-card.current { border-color: var(--primary-2); box-shadow: 0 0 0 2px var(--primary-soft); }
.level-card:active { transform: scale(.97); }
.level-card .lt-name { font-weight: 700; font-size: 13px; }
.level-card .lt-meta { font-size: 11px; color: var(--text-2); margin-top: 4px; display: flex; gap: 6px; }
.level-card .stars { margin-top: 6px; font-size: 12px; color: var(--accent); letter-spacing: 1px; }

.mode-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mode-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px; text-align: left; transition: transform .12s ease;
}
.mode-card:active { transform: scale(.97); }
.mode-card .mode-ico { font-size: 26px; }
.mode-card .mode-name { font-size: 14px; font-weight: 700; margin-top: 6px; }
.mode-card .mode-sub { font-size: 11px; color: var(--text-2); margin-top: 2px; }

.compound-list { display: flex; flex-direction: column; gap: 8px; }
.compound-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
.combo-title { font-weight: 700; font-size: 13px; color: var(--text); }
.combo-order { display: block; padding: 4px 8px; border-radius: 6px; background: var(--primary-soft); color: var(--primary-2); font-size: 12px; margin-top: 6px; line-height: 1.5; }
.combo-strat { font-size: 12px; color: var(--text-2); margin-top: 4px; }

/* ============ 锦囊页 ============ */
/* 四模块 tab */
.method-tabs { display: flex; gap: 6px; margin: 4px 4px 12px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.method-tab {
  flex-shrink: 0; padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); color: var(--text-2); font-size: 13px; font-weight: 600;
  cursor: pointer; transition: all .15s ease; white-space: nowrap;
}
.method-tab.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.method-panel { display: none; }
.method-panel.active { display: block; }
/* 大师语录 */
.quote-card {
  background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--primary-2);
  border-radius: var(--radius); padding: 12px; margin-bottom: 10px; box-shadow: var(--shadow-sm);
}
.quote-text { font-size: 14px; font-weight: 600; color: var(--text); line-height: 1.6; }
.quote-who { font-size: 12px; color: var(--muted); margin-top: 6px; }
.quote-use { font-size: 12px; color: var(--text-2); margin-top: 6px; background: var(--surface-2); padding: 6px 8px; border-radius: 8px; }

/* ============ 智能话术生成器 ============ */
.mood-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.mood-chip {
  display: flex; align-items: center; gap: 6px; padding: 8px 10px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2);
  cursor: pointer; transition: all .2s;
}
.mood-chip.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.mc-ico { font-size: 16px; }
.mc-name { font-size: 12px; font-weight: 700; }
.mc-range { font-size: 10px; color: var(--muted); }
.mood-chip.active .mc-range { color: rgba(255,255,255,.8); }

/* ============ 基金行情估值 ============ */
.fund-valuation { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; margin-bottom: 4px; box-shadow: var(--shadow-sm); }
.fund-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.fund-head span { font-size: 14px; font-weight: 700; }
.fund-tip { font-size: 10px; color: var(--muted); font-weight: 500; margin-left: 4px; }
.fund-list { display: flex; flex-direction: column; gap: 6px; }
.fund-row {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px 10px; background: var(--surface-2); border-radius: var(--radius-sm);
}
.fund-name { font-size: 12px; font-weight: 600; }
.fund-code { font-size: 10px; color: var(--muted); margin-top: 1px; }
.fund-right { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.fund-price { font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.fund-chg { font-size: 11px; padding: 1px 6px; border-radius: 999px; font-weight: 700; }
.fund-chg.up { background: rgba(239,68,68,.12); color: var(--up); }
.fund-chg.down { background: rgba(22,163,74,.12); color: var(--down); }
.fund-chg.flat { background: rgba(107,114,128,.12); color: var(--neutral); }
.fund-note { font-size: 10px; color: var(--muted); margin-top: 10px; text-align: center; }
/* 指数估值徽章：低估(绿) / 合适(灰) / 高估(红) —— 表示估值贵贱，非涨跌 */
.eva-badge { display: inline-block; padding: 1px 6px; border-radius: 999px; font-size: 10px; font-weight: 700; margin-left: 4px; vertical-align: 1px; }
.eva-badge.eva-low  { background: rgba(22,163,74,.15);  color: var(--down); }
.eva-badge.eva-mid  { background: rgba(107,114,128,.15); color: var(--neutral); }
.eva-badge.eva-high { background: rgba(239,68,68,.15);  color: var(--up); }

.method-search { margin-bottom: 10px; }
.method-search input {
  width: 100%; padding: 10px 12px;
  border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text); outline: none;
}
.method-search input:focus { border-color: var(--primary-2); }

.method-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px; box-shadow: var(--shadow-sm); margin-bottom: 10px;
  border-left: 4px solid var(--primary);
}
.method-card .mhead { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.method-card .m-id {
  background: var(--primary); color: #fff; padding: 2px 8px; border-radius: 6px;
  font-size: 11px; font-weight: 800;
}
.method-card .m-title { font-weight: 700; font-size: 14px; }
.method-card ol li { margin: 4px 0; font-size: 13px; color: var(--text); }
.method-card mark { background: rgba(245, 158, 11, .35); color: var(--text); border-radius: 3px; padding: 0 2px; }

.quick-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow-sm); }
.quick-card h4 { margin: 8px 0 4px; font-size: 13px; color: var(--primary-2); }
.quick-card ol li { margin: 3px 0; font-size: 13px; }

.data-list { display: flex; flex-direction: column; gap: 8px; }
.data-row { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; display: flex; justify-content: space-between; align-items: center; }
.data-name { font-size: 13px; font-weight: 700; }
.data-val { font-size: 16px; font-weight: 800; color: var(--primary-2); font-variant-numeric: tabular-nums; }
.data-meta { font-size: 11px; color: var(--muted); margin-top: 2px; }
.data-tag { font-size: 10px; padding: 2px 6px; border-radius: 6px; background: var(--surface-2); color: var(--text-2); margin-right: 4px; }
.data-version { font-size: 10px; padding: 1px 6px; border-radius: 6px; background: var(--warn-bg); color: var(--accent); }

.emotion-map { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.emo-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px; }
.emo-name { font-weight: 700; font-size: 12px; }
.emo-sig { font-size: 11px; color: var(--text-2); margin: 2px 0; }
.emo-mod { font-size: 11px; color: var(--primary-2); }

/* ============ 战绩页 ============ */
.stats-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
.ss-item { display: flex; flex-direction: column; align-items: center; }
.ss-val { font-size: 22px; font-weight: 800; color: var(--primary-2); }
.ss-label { font-size: 11px; color: var(--muted); }

.radar-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; box-shadow: var(--shadow-sm); }
.radar-svg { width: 100%; height: auto; max-height: 320px; }
.radar-legend { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 4px; font-size: 12px; color: var(--text-2); }
.radar-legend .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 4px; vertical-align: middle; }
.dot-empathy { background: #f97316; }
.dot-pro { background: #3b5bdb; }
.dot-action { background: #16a34a; }
.dot-compliance { background: #dc2626; }

.weakness-list { display: flex; flex-direction: column; gap: 6px; }
.weakness-item {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 8px 10px;
}
.weakness-rank { width: 22px; height: 22px; border-radius: 50%; background: var(--danger); color: #fff; display: grid; place-items: center; font-size: 12px; font-weight: 800; }
.weakness-rank.rank-2 { background: var(--accent); }
.weakness-rank.rank-3 { background: var(--neutral); }
.weakness-text { font-size: 13px; }

.filter-pills { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.filter-pill {
  padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); font-size: 12px; color: var(--text-2);
  transition: all .12s ease;
}
.filter-pill.active { background: var(--primary); color: #fff; border-color: var(--primary); }

.mistake-list { display: flex; flex-direction: column; gap: 6px; }
.mistake-item { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px; }
.mistake-meta { font-size: 11px; color: var(--muted); display: flex; gap: 6px; }
.mistake-q { font-size: 13px; font-weight: 600; margin: 4px 0; }
.mistake-ans { font-size: 12px; color: var(--danger); }
.mistake-actions { display: flex; gap: 6px; margin-top: 6px; }
.mistake-actions .mini-btn { padding: 4px 8px; border-radius: 6px; font-size: 12px; border: 1px solid var(--line); background: var(--surface-2); }

.recent-list { display: flex; flex-direction: column; gap: 6px; }
.recent-item { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px; display: flex; justify-content: space-between; align-items: center; }
.recent-name { font-size: 13px; font-weight: 700; }
.recent-stars { color: var(--accent); }
.recent-score { font-size: 11px; color: var(--text-2); }

.rank-list { display: flex; flex-direction: column; gap: 6px; }
.rank-item { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px 10px; display: flex; align-items: center; gap: 10px; }
.rank-item.me { background: var(--primary-soft); border-color: var(--primary-2); }
.rank-no { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 13px; }
.rank-no.r1 { background: #fef3c7; color: #b45309; }
.rank-no.r2 { background: #e5e7eb; color: #6b7280; }
.rank-no.r3 { background: #fde68a; color: #92400e; }
.rank-no.rn { background: var(--surface-2); color: var(--text-2); }
.rank-name { font-size: 13px; font-weight: 700; flex: 1; }
.rank-org { font-size: 11px; color: var(--muted); }
.rank-stars { color: var(--accent); font-weight: 700; font-size: 13px; }

/* ============ 我的页 ============ */
#redlineList .redline-item {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 10px 12px; margin-bottom: 6px;
  display: flex; gap: 10px; font-size: 13px;
}
.redline-no { width: 22px; height: 22px; border-radius: 50%; background: var(--danger); color: #fff; display: grid; place-items: center; font-size: 12px; font-weight: 800; flex-shrink: 0; }
#emotionIdent .emo-card { display: flex; flex-direction: column; }

.empty-tip { color: var(--muted); font-size: 13px; text-align: center; padding: 14px; background: var(--surface); border-radius: var(--radius-sm); border: 1px dashed var(--line); }
.about-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; font-size: 13px; margin-bottom: 12px; }
.about-card p { margin: 4px 0; }
.about-card .muted { color: var(--muted); font-size: 12px; }

/* ============ 弹层（关卡详情 + 训练 + 结算 + 工作台） ============ */
.modal {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(0,0,0,.55); backdrop-filter: blur(2px);
  display: flex; align-items: center; justify-content: center;
  animation: fade .15s ease;
  padding: 12px;
}
.modal[hidden] { display: none; }
.modal-card {
  background: var(--surface); border-radius: var(--radius); width: 100%; max-width: 540px;
  max-height: 86vh; display: flex; flex-direction: column;
  box-shadow: var(--shadow-md); overflow: hidden;
  animation: pop .2s ease;
}
@keyframes pop { from { opacity: 0; transform: translateY(20px) scale(.96);} to { opacity:1; transform:none; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.modal-head h3 { margin: 0; font-size: 16px; }
.modal-head-tall small { display: block; margin-top: 2px; font-size: 11px; }
.close-btn { background: transparent; border: 0; font-size: 24px; line-height: 1; color: var(--text-2); padding: 0 4px; }
.modal-body { padding: 14px 16px; overflow: auto; }
.modal-foot { padding: 12px 16px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; }

.modal-tall .modal-card { max-height: 92vh; height: 92vh; }
.modal-head-tall { align-items: flex-start; }
.modal-body-tall { flex: 1; padding: 14px; overflow: auto; }

.modal-full { padding: 0; }
.modal-full .modal-card { max-width: 100vw; max-height: 100vh; height: 100vh; border-radius: 0; }
.modal-full .modal-body { padding: 0; height: 100%; }

/* ============ 情景模拟对话 ============ */
.dialogue-meta {
  display: flex; align-items: center; gap: 8px; padding: 0 4px 10px;
  font-size: 12px; color: var(--text-2);
}
.dialogue-meta .badge { padding: 2px 8px; border-radius: 999px; font-size: 11px; }
.dialogue-meta .emotion-tag { background: rgba(239, 68, 68, .12); color: var(--danger); }
.dialogue-meta .dim-tag { background: var(--primary-soft); color: var(--primary-2); }

.chat-area { display: flex; flex-direction: column; gap: 10px; }
.bubble { max-width: 84%; padding: 10px 12px; border-radius: 14px; font-size: 14px; line-height: 1.5; }
.bubble.cust { align-self: flex-start; background: var(--surface-2); border: 1px solid var(--line); }
.bubble.cust .emo-line { font-size: 11px; color: var(--muted); margin-top: 4px; }
.bubble.me { align-self: flex-end; background: var(--primary); color: #fff; }
.bubble.me.correct { background: var(--success); }
.bubble.me.wrong { background: var(--danger); }
.bubble .fb { font-size: 12px; margin-top: 6px; padding-top: 6px; border-top: 1px solid rgba(255,255,255,.3); }
.bubble.cust .fb { color: var(--muted); border-top-color: var(--line); }
.bubble .ans { font-size: 11px; opacity: .8; }

.opts { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.opt-btn {
  text-align: left; padding: 11px 14px; border-radius: var(--radius-sm);
  background: var(--surface); border: 1px solid var(--line); font-size: 14px; color: var(--text);
  transition: all .12s ease;
}
.opt-btn:hover { border-color: var(--primary-2); }
.opt-btn:disabled { cursor: default; }
.opt-btn.correct { background: rgba(22, 163, 74, .12); border-color: var(--success); color: var(--success); }
.opt-btn.wrong { background: rgba(239, 68, 68, .12); border-color: var(--danger); color: var(--danger); }
.opt-btn .dim-tag { font-size: 10px; padding: 1px 6px; border-radius: 4px; background: var(--surface-2); color: var(--text-2); margin-left: 6px; }

.opt-summary {
  margin-top: 12px; padding: 12px; border-radius: var(--radius-sm);
  background: var(--surface-2); border: 1px solid var(--line); font-size: 13px;
}

/* 填空题 */
.fill-area { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px; font-size: 14px; line-height: 1.8; }
.fill-blank { display: inline-block; min-width: 100px; padding: 1px 6px; margin: 0 2px; border-bottom: 2px solid var(--primary-2); background: transparent; outline: none; text-align: center; }
.fill-blank.correct { border-bottom-color: var(--success); color: var(--success); background: rgba(22, 163, 74, .1); }
.fill-blank.wrong { border-bottom-color: var(--danger); color: var(--danger); background: rgba(239, 68, 68, .1); }
.fill-blank:disabled { cursor: default; }

.fill-keywords { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 6px; font-size: 11px; }
.fill-kw {
  padding: 2px 8px; border-radius: 6px;
  background: var(--primary-soft); color: var(--primary-2);
}

/* 找错题 */
.find-error-prompt {
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 12px; font-size: 14px; line-height: 1.7; margin-bottom: 12px;
}
.check-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.check-item { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); cursor: pointer; }
.check-item input { width: 16px; height: 16px; }
.check-item.sel { background: var(--primary-soft); border-color: var(--primary-2); }

/* 归因题 */
.cause-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.cause-btn { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 6px; text-align: center; font-size: 12px; }
.cause-btn.sel { background: var(--primary); color: #fff; border-color: var(--primary); }
.cause-btn .cb-ico { font-size: 22px; display: block; margin-bottom: 4px; }

/* ============ 结算页 ============ */
.score-giant { font-size: 50px; font-weight: 900; text-align: center; color: var(--primary-2); margin: 14px 0; line-height: 1; }
.score-stars { text-align: center; font-size: 26px; color: var(--accent); letter-spacing: 2px; }
.score-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.score-cell { background: var(--surface-2); border-radius: var(--radius-sm); padding: 10px; text-align: center; }
.score-cell .lbl { font-size: 11px; color: var(--muted); }
.score-cell .val { font-size: 20px; font-weight: 800; color: var(--text); }
.dim-list { margin-top: 10px; font-size: 13px; }
.dim-list .dim-line { display: flex; align-items: center; gap: 8px; margin: 4px 0; }
.dim-list .dim-bar { flex: 1; height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; position: relative; }
.dim-list .dim-fill { height: 100%; background: linear-gradient(90deg, var(--primary), var(--primary-2)); border-radius: 4px; }

/* ============ 底部导航 ============ */
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0;
  background: var(--surface); border-top: 1px solid var(--line);
  display: grid; grid-template-columns: repeat(5, 1fr);
  height: calc(var(--nav-h) + var(--safe-b));
  padding-bottom: var(--safe-b);
  z-index: 25;
}
.nav-item {
  background: transparent; border: 0; display: flex; flex-direction: column;
  align-items: center; gap: 2px; padding: 8px 0; color: var(--muted); font-size: 11px;
}
.nav-item .nav-ico { font-size: 20px; }
.nav-item.active { color: var(--primary-2); font-weight: 700; }

/* ============ Toast ============ */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--nav-h) + var(--safe-b) + 18px); transform: translateX(-50%);
  background: rgba(20, 28, 50, .92); color: #fff; padding: 8px 14px; border-radius: 999px;
  font-size: 13px; opacity: 0; transition: opacity .2s; z-index: 200; pointer-events: none;
}
.toast.show { opacity: 1; }

/* ============ 工具：滚动条 ============ */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 2px; }

/* ============ 简易网格工具 ============ */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* ============ 适合手机端全面屏适配 ============ */
@media (max-width: 380px) {
  /* 2026-08-13：删除 .market-row / .market-mini 窄屏覆盖——固定布局任何宽度不变
     （.market-mini 规则会连带误伤 .macro-strip，导致宏观条被改成 3 列不占满） */
  .form-grid { grid-template-columns: 1fr; }
}

/* ============ 登录/注册遮罩 ============ */
.auth-overlay {
  position: fixed; inset: 0; z-index: 120;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.auth-overlay[hidden] { display: none; }
.auth-card {
  width: 100%; max-width: 360px;
  background: var(--surface); color: var(--text);
  border-radius: var(--radius-lg); padding: 24px 20px;
  box-shadow: var(--shadow-md);
}
.auth-logo {
  width: 48px; height: 48px; border-radius: 14px; margin: 0 auto 10px;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff; font-weight: 800; font-size: 24px; display: grid; place-items: center;
}
.auth-title { text-align: center; font-size: 20px; margin: 0; }
.auth-sub { text-align: center; color: var(--muted); font-size: 12px; margin: 4px 0 16px; }
.auth-tabs { display: flex; background: var(--surface-2); border-radius: 10px; padding: 4px; margin-bottom: 14px; }
.auth-tab {
  flex: 1; padding: 8px; border: 0; border-radius: 8px; background: transparent;
  color: var(--text-2); font-size: 14px; font-weight: 600;
}
.auth-tab.active { background: var(--surface); color: var(--primary-2); box-shadow: var(--shadow-sm); }
.auth-form { display: flex; flex-direction: column; gap: 12px; }
.auth-form label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--text-2); }
.auth-form input {
  padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text); outline: none; font-size: 14px;
}
.auth-form input:focus { border-color: var(--primary-2); }
.auth-err { color: var(--danger); font-size: 12px; min-height: 16px; }
.auth-hint { font-size: 11px; color: var(--muted); text-align: center; margin-top: 10px; }

/* ============ 账户条 / 版权 ============ */
.account-bar { margin-bottom: 8px; }
.account-info {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 10px 12px; box-shadow: var(--shadow-sm);
}
.account-info .ai-name { font-size: 13px; }
.btn-sm { padding: 5px 10px; font-size: 12px; }

.copyright-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px; margin: 12px 0; box-shadow: var(--shadow-sm); text-align: center;
  font-size: 12px; color: var(--text-2); line-height: 1.9;
}
.copyright-card p { margin: 0; }
.copyright-card p:first-child { color: var(--primary-2); font-weight: 700; }

/* ============ 分享弹层 ============ */
.share-body { padding: 16px; }
.share-cover {
  background: linear-gradient(135deg, #1f3a8a, #3b5bdb);
  border-radius: var(--radius); padding: 28px 20px 22px; text-align: center; color: #fff;
  position: relative; overflow: hidden; box-shadow: 0 6px 20px rgba(31,58,138,.3);
}
.share-cover::before {
  content: ''; position: absolute; top: -40px; right: -30px;
  width: 140px; height: 140px; border-radius: 50%; background: rgba(255,255,255,.06);
}
.share-cover::after {
  content: ''; position: absolute; bottom: -50px; left: -20px;
  width: 100px; height: 100px; border-radius: 50%; background: rgba(255,255,255,.04);
}
.share-cover-mark {
  width: 56px; height: 56px; border-radius: 14px; margin: 0 auto 14px;
  background: linear-gradient(135deg, #f59e0b, #fbbf24);
  color: #1f3a8a; font-weight: 900; font-size: 30px; display: grid; place-items: center;
  position: relative; z-index: 1;
}
.share-cover-title { font-size: 24px; font-weight: 800; position: relative; z-index: 1; }
.share-cover-sub { font-size: 14px; color: #8aa0ff; margin-top: 4px; position: relative; z-index: 1; }
.share-cover-desc { font-size: 12px; color: rgba(255,255,255,.7); margin-top: 14px; line-height: 1.7; position: relative; z-index: 1; }
.share-cover-brand { font-size: 11px; color: rgba(255,255,255,.45); margin-top: 14px; position: relative; z-index: 1; }

.share-qr-wrap { text-align: center; margin: 16px 0; }
.share-qr-img {
  width: 180px; height: 180px; border-radius: 12px; border: 1px solid var(--line);
  background: #fff; padding: 8px;
}
.share-qr-tip { font-size: 13px; color: var(--text-2); margin-top: 10px; }

.share-url-row { display: flex; gap: 8px; align-items: center; margin-top: 4px; }
.share-url-input {
  flex: 1; min-width: 0; padding: 8px 10px; border: 1px solid var(--line);
  border-radius: 8px; background: var(--surface-2); color: var(--text-2);
  font-size: 12px; outline: none;
}
.share-url-input:focus { border-color: var(--primary-2); }

/* ============ 个人中心 / 管理员 ============ */
#accountCenter { margin-bottom: 4px; }
.ac-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px; margin-bottom: 12px; box-shadow: var(--shadow-sm);
}
.ac-head { display: flex; align-items: center; gap: 12px; }
.ac-avatar {
  width: 44px; height: 44px; border-radius: 12px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff; font-weight: 800; font-size: 20px; display: grid; place-items: center;
}
.ac-name { font-size: 16px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.ac-sub { font-size: 12px; color: var(--text-2); margin-top: 2px; }
.ac-badge {
  background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: #fff;
  font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 999px;
}
.ac-badge.sm { font-size: 10px; padding: 0 6px; }
.ac-former { margin-top: 10px; font-size: 12px; color: var(--text-2); background: var(--surface-2); padding: 6px 10px; border-radius: 8px; }
.ac-actions { display: flex; gap: 8px; margin-top: 12px; }
.ac-actions .btn { flex: 1; }

.ac-admin { margin-top: 6px; }
.ac-pending, .ac-users { display: flex; flex-direction: column; gap: 8px; }
.ac-user {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 10px 12px; display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.acu-name { font-size: 14px; font-weight: 700; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.acu-sub { font-size: 11px; color: var(--text-2); margin-top: 2px; }
.acu-status { font-size: 10px; padding: 0 6px; border-radius: 999px; font-weight: 700; }
.acu-status.s-pending { background: #fff7ed; color: #ea580c; }
.acu-status.s-approved { background: #ecfdf5; color: #16a34a; }
.acu-status.s-rejected { background: #fef2f2; color: #dc2626; }
.acu-actions { display: flex; gap: 6px; flex-shrink: 0; }

.mini-btn {
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
  border-radius: 8px; padding: 5px 10px; font-size: 12px; cursor: pointer;
}
.mini-btn.ok { border-color: var(--success, #16a34a); color: var(--success, #16a34a); }
.mini-btn.danger { border-color: var(--danger, #dc2626); color: var(--danger, #dc2626); }
.mini-btn:hover { filter: brightness(.97); }

/* ============ 情景速入口 · 三维度分类 ============ */
.scene-cat-tabs {
  display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap;
}
.scene-cat-tab {
  padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text-2); font-size: 13px; font-weight: 600;
  cursor: pointer; transition: all .15s ease;
}
.scene-cat-tab.active {
  background: var(--primary); color: #fff; border-color: var(--primary);
}
.scene-cat-tab:hover { filter: brightness(.97); }

.scene-group {
  background: var(--surface); border-radius: var(--radius);
  padding: 12px; margin-bottom: 12px; box-shadow: var(--shadow-sm);
}
.scene-group-head {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 4px;
  cursor: pointer; user-select: none;
}
.scene-group-head::after {
  content: '▸'; margin-left: auto; font-size: 12px; color: var(--text-2);
  transition: transform .2s ease;
}
.scene-group:not(.collapsed) .scene-group-head::after { transform: rotate(90deg); }
.scene-group.collapsed .scenario-grid-inner { display: none; }
.scene-group-name { font-size: 15px; font-weight: 800; }
.scene-group-level {
  font-size: 10px; padding: 1px 8px; border-radius: 999px;
  background: var(--surface-2); color: var(--text-2); font-weight: 600;
}
.scene-group-tag {
  font-size: 10px; padding: 1px 8px; border-radius: 999px;
  background: var(--primary-soft); color: var(--primary); font-weight: 600;
}
.scene-group-desc { font-size: 12px; color: var(--text-2); margin-bottom: 6px; }
.scene-group-strat { font-size: 12px; color: var(--muted); margin-bottom: 8px; font-style: italic; }
.scenario-grid-inner {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
}
@media (max-width: 380px) { .scenario-grid-inner { grid-template-columns: 1fr; } }

/* ============ 复合场景 · 分类分组 ============ */
.compound-group { margin-bottom: 16px; }
.compound-cat-title {
  font-size: 14px; font-weight: 800; color: var(--text);
  margin-bottom: 8px; display: flex; align-items: center; gap: 6px;
}
.compound-cat-count {
  font-size: 11px; font-weight: 600; color: var(--muted);
  background: var(--surface-2); padding: 1px 8px; border-radius: 999px;
}

/* ============ 行为金融学偏差卡片 ============ */
.bias-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px; margin-bottom: 10px; box-shadow: var(--shadow-sm);
}
.bias-head {
  display: flex; align-items: center; gap: 10px; margin-bottom: 8px; flex-wrap: wrap;
}
.bias-ico { font-size: 24px; }
.bias-name { font-size: 15px; font-weight: 800; }
.bias-en { font-size: 11px; color: var(--muted); font-weight: 400; }
.bias-scenes { margin-left: auto; display: flex; gap: 4px; flex-wrap: wrap; }
.bias-scene-tag {
  font-size: 10px; padding: 1px 6px; border-radius: 999px;
  background: var(--primary-soft); color: var(--primary); font-weight: 600;
}
.bias-desc {
  font-size: 13px; color: var(--text); margin-bottom: 8px; line-height: 1.6;
}
.bias-section {
  font-size: 12px; color: var(--text-2); margin-bottom: 4px; line-height: 1.6;
}
.bias-section b { color: var(--text); }

/* ============ 情绪卡片（详细版） ============ */
.emo-detail-card {
  background: var(--surface); border-radius: var(--radius);
  padding: 14px; margin-bottom: 12px; box-shadow: var(--shadow-sm);
}
.emo-detail-head {
  display: flex; align-items: center; gap: 8px; margin-bottom: 10px; flex-wrap: wrap;
}
.emo-detail-ico { font-size: 24px; }
.emo-detail-name { font-size: 16px; font-weight: 800; }
.emo-detail-scenes { margin-left: auto; display: flex; gap: 4px; flex-wrap: wrap; }
.emo-detail-row {
  font-size: 13px; color: var(--text-2); margin-bottom: 6px; line-height: 1.6;
}
.emo-detail-row b { color: var(--text); }
.emo-taboo {
  background: var(--warn-bg); border-radius: 8px; padding: 6px 10px;
  color: var(--danger); font-size: 12px;
}
.emo-detail-script {
  background: var(--surface-2); border-radius: 8px; padding: 10px;
  font-size: 13px; color: var(--text); margin-top: 6px; line-height: 1.7;
}
.emo-detail-script b { color: var(--primary); }

/* ============ 加群模块 ============ */
.ac-group-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; margin-top: 12px; text-align: center; box-shadow: var(--shadow-sm);
}
.ac-group-head {
  font-size: 16px; font-weight: 800; margin-bottom: 12px;
}
.ac-group-qr {
  width: 200px; height: 200px; margin: 0 auto 10px;
  border-radius: 12px; overflow: hidden; border: 2px solid var(--line);
}
.ac-group-qr img { width: 100%; height: 100%; object-fit: cover; }
.ac-group-info {
  font-size: 13px; color: var(--text-2); margin-top: 4px;
  white-space: pre-line; text-align: center;
}
.ac-group-empty p { color: var(--muted); font-size: 13px; margin: 4px 0; }
.ac-group-empty .muted { font-size: 12px; }

/* ============================================================
   情景速入口 · App 风格层级导航
   ============================================================ */
/* —— 首页宫格（固定两列 · 2+2+1，末格横跨整行填满，无留白） —— */
.scene-quick-grid {
  display: grid; gap: 10px;
  grid-template-columns: repeat(2, 1fr);
}
.scene-quick-item {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 8px 12px; display: flex; flex-direction: column; align-items: center; gap: 2px;
  box-shadow: var(--shadow-sm); cursor: pointer; text-align: center;
  transition: transform .15s ease, box-shadow .15s ease;
}
.scene-quick-item:active { transform: scale(.95); box-shadow: none; }
.scene-quick-item .ic {
  width: 42px; height: 42px; border-radius: 13px; font-size: 21px;
  display: flex; align-items: center; justify-content: center;
  background: #e8edfb; /* fallback：不支持 color-mix 时 */
  background: color-mix(in srgb, var(--sc) 12%, #fff); margin-bottom: 6px;
}
.scene-quick-item .na { font-size: 12px; font-weight: 700; color: var(--text); }
.scene-quick-item .cnt { font-size: 10px; color: var(--muted); }
/* 最后一个格子横跨整行（2+2+1 布局的末行），美观填满 */
.scene-quick-item:last-child { grid-column: 1 / -1; }
/* —— 全屏选择器（底部滑入） —— */
.scene-sheet {
  position: fixed; inset: 0; z-index: 1000;
}
.scene-sheet[hidden] { display: none; }
.scene-sheet-mask {
  position: absolute; inset: 0; background: rgba(15, 23, 42, .45);
  opacity: 0; transition: opacity .25s ease;
}
.scene-sheet.show .scene-sheet-mask { opacity: 1; }
.scene-sheet-panel {
  position: absolute; left: 0; right: 0; bottom: 0; top: 6%;
  background: var(--bg); border-radius: 24px 24px 0 0;
  box-shadow: 0 -12px 40px rgba(15, 23, 42, .18);
  display: flex; flex-direction: column;
  transform: translateY(100%); transition: transform .3s cubic-bezier(.32, .72, .35, 1);
}
.scene-sheet.show .scene-sheet-panel { transform: translateY(0); }
body.sheet-open { overflow: hidden; }
/* 头部 */
.scene-sheet-header {
  display: flex; align-items: center; gap: 8px;
  padding: 14px 12px 10px; flex-shrink: 0;
}
.scene-sheet-btn {
  width: 36px; height: 36px; flex-shrink: 0; border: none; border-radius: 50%;
  background: var(--surface); color: var(--text); font-size: 20px; line-height: 1;
  box-shadow: var(--shadow-sm); cursor: pointer;
  transition: transform .12s ease;
}
.scene-sheet-btn:active { transform: scale(.9); }
.scene-sheet-btn[hidden] { visibility: hidden; }
.scene-sheet-title { flex: 1; text-align: center; min-width: 0; }
.scene-sheet-title > div { font-size: 16px; font-weight: 800; color: var(--text); }
.scene-sheet-title > small { display: block; font-size: 11px; color: var(--muted); margin-top: 1px; }
/* 内容区 */
.scene-sheet-body {
  flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: 6px 16px calc(20px + var(--safe-b));
}
/* —— 一级：情绪版块卡片 —— */
.scene-section-list { display: flex; flex-direction: column; gap: 12px; }
.scene-section-card {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 14px; border: none; border-radius: 18px; cursor: pointer;
  background: var(--surface); /* fallback */
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--sc) 8%, #fff) 0%,
    color-mix(in srgb, var(--sc) 3%, #fff) 100%);
  box-shadow: var(--shadow-sm); /* fallback */
  box-shadow: 0 3px 14px color-mix(in srgb, var(--sc) 12%, transparent);
  text-align: left;
  transition: transform .15s ease, box-shadow .15s ease;
}
.scene-section-card:active {
  transform: scale(.975);
  box-shadow: var(--shadow-sm); /* fallback */
  box-shadow: 0 1px 6px color-mix(in srgb, var(--sc) 14%, transparent);
}
.scene-section-icon {
  width: 46px; height: 46px; flex-shrink: 0; border-radius: 14px;
  display: flex; align-items: center; justify-content: center; font-size: 24px;
  background: #eef1f8; /* fallback */
  background: color-mix(in srgb, var(--sc) 14%, #fff);
}
.scene-section-info { flex: 1; min-width: 0; }
.scene-section-name {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  font-size: 15px; font-weight: 800; color: var(--text);
}
.scene-section-tag {
  font-style: normal; font-size: 10px; font-weight: 700; color: var(--sc);
  background: var(--primary-soft); /* fallback */
  background: color-mix(in srgb, var(--sc) 12%, #fff);
  padding: 2px 8px; border-radius: 999px;
}
.scene-section-desc {
  display: block; font-size: 12px; color: var(--text-2); margin-top: 3px;
}
.scene-section-arrow { font-size: 20px; color: var(--muted); line-height: 1; }
/* —— 二级：场景列表 —— */
.scene-sheet-body.stage-2 { padding-top: 8px; }
.scene-item-list { display: flex; flex-direction: column; gap: 10px; }
.scene-item-card {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 13px 14px; border: 1px solid var(--line); border-radius: 16px;
  background: var(--surface); box-shadow: var(--shadow-sm); cursor: pointer;
  text-align: left; transition: transform .15s ease, box-shadow .15s ease;
}
.scene-item-card:active { transform: scale(.975); box-shadow: var(--shadow); }
.scene-item-icon {
  width: 40px; height: 40px; flex-shrink: 0; border-radius: 12px;
  display: flex; align-items: center; justify-content: center; font-size: 20px;
  background: #eef1f8; /* fallback */
  background: color-mix(in srgb, var(--sc) 10%, #fff);
}
.scene-item-info { flex: 1; min-width: 0; }
.scene-item-name { display: block; font-size: 14px; font-weight: 700; color: var(--text); }
.scene-item-sub {
  display: block; font-size: 12px; color: var(--text-2); margin-top: 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.scene-item-meta { font-size: 12px; color: var(--sc); letter-spacing: 1px; flex-shrink: 0; }
/* 深色模式适配 */
[data-theme="dark"] .scene-quick-item { background: #1d2536; border-color: #2a3448; }
[data-theme="dark"] .scene-quick-item .ic { background: #253048; background: color-mix(in srgb, var(--sc) 22%, #171f31); }
[data-theme="dark"] .scene-section-card {
  background: #1c2538; /* fallback */
  background: linear-gradient(135deg, color-mix(in srgb, var(--sc) 16%, #171f31) 0%, #171f31 100%);
}
[data-theme="dark"] .scene-section-icon,
[data-theme="dark"] .scene-item-icon { background: #253048; background: color-mix(in srgb, var(--sc) 22%, #171f31); }
[data-theme="dark"] .scene-item-card { background: #1d2536; border-color: #2a3448; }
[data-theme="dark"] .scene-sheet-panel { background: #121826; }

/* ============================================================
   首页全局 · App 风格微调（分区标题 / 高频工具 / 顶部主卡）
   ============================================================ */
.section-label {
  margin: 24px 2px 10px; font-size: 14px; font-weight: 800; color: var(--text);
}
.hero-card { padding: 20px 18px 22px; }
.hero-title { font-size: 23px; }
.quick-tools { gap: 10px; }
.quick-tool {
  padding: 14px 8px 12px; border-radius: var(--radius); box-shadow: var(--shadow-sm);
  transition: transform .15s ease, box-shadow .15s ease;
}
.quick-tool:active { transform: scale(.95); box-shadow: none; }
.quick-tool .ic {
  width: 42px; height: 42px; border-radius: 13px; font-size: 21px;
  display: flex; align-items: center; justify-content: center;
  background: var(--primary-soft); margin-bottom: 6px;
}
.quick-tool:nth-child(2) .ic { background: #fef3c7; }
.quick-tool:nth-child(3) .ic { background: #d1fae5; }
.quick-tool .na { font-size: 12px; font-weight: 700; }
[data-theme="dark"] .quick-tool:nth-child(2) .ic { background: #3a2e0b; }
[data-theme="dark"] .quick-tool:nth-child(3) .ic { background: #0b3a26; }
