:root {
  --bg: #FAF7F6;
  --card: #ffffff;
  --line: #EFE2E0;
  --text: #1E191A;
  --muted: #6B5F61;
  --accent: #A82638;
  --accent-soft: #FBEDEF;
  --up: #D8342C;
  --down: #0E8A5F;
  --warn: #9A6410;
  --warn-bg: #FDF6E8;
  --radius: 13px;
  --shadow: 0 1px 2px rgba(96, 30, 40, .05), 0 8px 24px -14px rgba(96, 30, 40, .16);
  --shadow-card: inset 0 1px 0 #fff, 0 1px 2px rgba(96, 30, 40, .05), 0 8px 24px -14px rgba(96, 30, 40, .16);
  --shadow-btn: inset 0 1px 0 rgba(255, 255, 255, .22), 0 6px 16px -6px rgba(150, 26, 46, .42);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --topbar-h: 52px;
  --tabbar-h: 56px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html {
  -webkit-text-size-adjust: 100%;   /* 微信里横屏/旋转后字号不放大 */
  text-size-adjust: 100%;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 15px;
  line-height: 1.55;
  overflow-x: hidden;               /* 防止某个长数字把整页顶出横向滚动 */
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }

button, input, select, textarea {
  font: inherit;
  color: inherit;
  touch-action: manipulation;       /* 去掉 iOS 300ms 点击延迟 */
}

/* ------------------------------------------------------------------ 布局 */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(255, 253, 253, .88);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 10px 16px;
  min-height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand {
  font-weight: 700;
  font-size: 16px;
  letter-spacing: .2px;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}
.brand .dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: linear-gradient(160deg, #B93044, #8E1F2E);
  box-shadow: 0 0 0 3.5px rgba(185, 48, 68, .12), 0 2px 6px rgba(140, 30, 50, .3);
}
/* flex:1 的 basis 是 0，导航会被压成「剩余空间」，1280 宽下最后一项
   「我的记录」只剩半个字；改用 auto 让它先按内容占位，剩余空间交给后面的
   .spacer。窄屏时仍然允许压缩 + 横向滚动，不会挤掉右侧账号区。 */
.nav {
  display: flex;
  gap: 4px;
  flex: 0 1 auto;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.nav::-webkit-scrollbar { display: none; }
.nav a, .nav button {
  padding: 6px 12px;
  border-radius: 999px;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
}
.nav a.active, .nav button.active {
  background: var(--accent-soft);
  color: #8E1F2E;
  font-weight: 650;
  box-shadow: inset 0 0 0 1px rgba(185, 48, 68, .12);
}
.who {
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 4px;
}
.who b { color: var(--text); font-weight: 600; }

main {
  max-width: 1080px;
  margin: 0 auto;
  padding: 18px 16px 64px;
}

/* 底部标签栏：只在手机显示，微信里单手够得着 */
.tabbar { display: none; }

/* ------------------------------------------------------------------ 卡片 */
.card {
  background: linear-gradient(180deg, #fff 0%, #FFFCFC 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 18px;
  margin-bottom: 14px;
}
.card h2, .card h3 {
  margin: 0 0 14px;
  font-size: 15px;
  font-weight: 650;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.card h2 .sub, .card h3 .sub {
  font-weight: 400;
  color: var(--muted);
  font-size: 12.5px;
}

/* 步骤序号：让人一眼看清「先填什么、后做什么」 */
.step-no {
  width: 20px;
  height: 20px;
  flex: none;
  border-radius: 6px;
  background: linear-gradient(180deg, #FBEDEF, #F8E3E6);
  color: #8E1F2E;
  box-shadow: inset 0 0 0 1px rgba(185, 48, 68, .13);
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* 可折叠卡片（资金与成本）：默认收起，标题行给一句话摘要 */
.card.fold { padding: 0; }
.fold-head {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 15px 16px;
  background: none;
  border: 0;
  text-align: left;
  cursor: pointer;
  font-size: 15px;
  color: var(--text);
}
.fold-head b { font-weight: 650; }
.fold-sum {
  margin-left: auto;
  min-width: 0;
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fold-head .chev {
  width: 16px; height: 16px; flex: none;
  fill: none; stroke: var(--muted); stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
  transition: transform .18s ease;
}
.card.fold.open .chev { transform: rotate(90deg); }
/* 展开后摘要让位给真实字段，避免标题行挤成两截 */
.card.fold.open .fold-sum { display: none; }
.fold-body { display: none; padding: 0 16px 16px; }
.card.fold.open .fold-body { display: block; }

/* 折叠卡右侧的「展开明细」：做成蓝色胶囊，一眼能看出这里可以点 */
.fold-sub { font-size: 12.5px; color: var(--muted); font-weight: 400; }
.fold-cta {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 4px 8px 4px 11px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: #A82638;
  box-shadow: inset 0 0 0 1px rgba(185, 48, 68, .1);
  font-size: 12.5px;
  font-weight: 600;
  flex: none;
}
.fold-cta .chev {
  width: 14px; height: 14px;
  stroke: currentColor;
  transition: transform .18s ease;
}

/* 通达信公式代码块：等宽字体 + 自动折行（手机上不横滑也能看全，复制拿到的仍是完整文本） */
pre.code {
  margin: 0;
  padding: 11px 12px;
  background: #FFFCFC;
  border: 1px solid var(--line);
  border-radius: 9px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12.5px;
  line-height: 1.72;
  color: #2A2325;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
  tab-size: 2;
}
.tdx-notes { line-height: 1.8; margin-top: 10px; }

/* 分享链接：手机上输入框独占一行，别被两个按钮挤成半截 */
.share-input { flex: 1 1 240px; min-width: 0; }
@media (max-width: 760px) {
  .input.share-input { flex: 1 1 100%; font-size: 13px; }
}

/* 参数名旁的「?」：点开看解释 */
.param-help {
  width: 16px; height: 16px;
  margin-left: 4px;
  padding: 0;
  border: 1px solid #E7C3C8;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: -3px;
  cursor: pointer;
}
.param-help:active { transform: scale(.92); }
.param-help.inline { pointer-events: none; vertical-align: 0; }

/* 有效邀请码一览：手机上也能直接看到、手动复制 */
.codes-block {
  border: 1px dashed #E8D6D3;
  border-radius: 9px;
  background: #FFFCFC;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.95;
  letter-spacing: .4px;
  margin-bottom: 12px;
  max-height: 176px;
  overflow-y: auto;
  word-break: break-all;
}

/* 主操作区：桌面跟在内容后面，手机吸在标签栏上方，单手就够得着 */
.actionbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 2px 0 20px;
}
.actionbar .btn.primary { min-width: 150px; }
.actionbar-space { display: none; }
.grid { display: grid; gap: 14px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* ------------------------------------------------------------------ 表单 */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label {
  font-size: 12.5px;
  color: var(--muted);
  font-weight: 500;
}
.input, select.input, textarea.input {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  -webkit-appearance: none;
  appearance: none;
  min-width: 0;
}
select.input {
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath fill='%236b7280' d='M0 0h10L5 6z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 9px center;
  padding-right: 26px;
}
.input:focus {
  border-color: #B93044;
  box-shadow: 0 0 0 3.5px rgba(185, 48, 68, .11);
}
textarea.input { min-height: 96px; resize: vertical; line-height: 1.6; }
.hint { font-size: 12px; color: var(--muted); }
.hint.bad { color: #B4232A; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* 日期用「年 / 月 / 日」三段下拉，代替手机上难拨的原生日期控件 */
.code-field { max-width: 320px; }

/* 股票输入联想：代码 / 简称 / 拼音都能搜，候选浮在输入框下方 */
.code-wrap { position: relative; flex: 1; min-width: 0; }
.code-wrap .input { width: 100%; }
.code-sug {
  display: none;
  position: absolute;
  left: 0; right: 0; top: calc(100% + 4px);
  z-index: 20;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 6px 24px rgba(96, 30, 40, .12);
  overflow: hidden auto;
  max-height: 264px;
}
.code-sug.open { display: block; }
.code-sug button {
  display: flex; align-items: baseline; gap: 8px;
  width: 100%; padding: 10px 12px;
  background: none; border: 0; text-align: left;
  font-size: 14px; cursor: pointer;
}
.code-sug button + button { border-top: 1px solid var(--line); }
.code-sug button:active { background: var(--accent-soft); }
.code-sug .sug-code { font-weight: 650; font-variant-numeric: tabular-nums; }
.code-sug .sug-name {
  flex: 1; min-width: 0; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
}
.code-sug .sug-mkt { font-size: 12px; color: var(--muted); flex: none; }
.code-sug .sug-empty { padding: 10px 12px; font-size: 13px; color: var(--muted); }
.code-sug button.on { background: var(--bg); }
.code-sug button.on .sug-name { color: var(--muted); }
.code-sug button.on .sug-mkt { color: var(--accent); }

/* 自选股：搜索框 + 标签列表，点 × 移除 */
.watch-search { position: relative; }
.watch-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.watch-list:empty { margin-top: 0; }
.watch-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 5px 5px 12px;
  border: 1px solid #F1DADC;
  border-radius: 999px;
  background: var(--accent-soft);
  max-width: 100%;
}
.watch-name {
  font-size: 14px; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.watch-code {
  font-size: 12px; color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.watch-del {
  flex: none;
  width: 22px; height: 22px; padding: 0;
  border: 0; border-radius: 50%;
  background: #fff; color: var(--muted);
  font-size: 15px; line-height: 1; cursor: pointer;
}
.watch-del:hover, .watch-del:focus-visible { color: var(--accent); }
.watch-empty { font-size: 13px; color: var(--muted); line-height: 1.7; padding: 12px 0 0; }
.watch-paste { margin-top: 10px; }
.watch-paste textarea { width: 100%; }

.date-range {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 14px;
}
.date-pick {
  display: grid;
  grid-template-columns: 1.25fr 1fr 1fr;
  gap: 6px;
}
.date-pick .input { padding-right: 22px; background-position: right 7px center; }
.chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.chips-label { font-size: 12px; color: var(--muted); }
.chip {
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--text);
  font-size: 13px;
  line-height: 1.25;
  cursor: pointer;
  transition: border-color .15s, background .15s, color .15s;
  -webkit-tap-highlight-color: transparent;
}
.chip:hover, .chip:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
  outline: none;
}
.chip:active { transform: scale(.97); }

.btn {
  display: inline-flex;
  white-space: nowrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: #fff;
  cursor: pointer;
  font-weight: 550;
  transition: background .15s, border-color .15s, transform .04s;
}
.btn:hover { background: #FFFDFD; }
.btn:active { transform: translateY(1px); }
.btn.primary {
  background: linear-gradient(180deg, #B93044 0%, #8E1F2E 100%);
  border-color: #8E1F2E;
  color: #fff;
  font-weight: 620;
  letter-spacing: .3px;
  box-shadow: var(--shadow-btn);
}
.btn.primary:hover { background: linear-gradient(180deg, #C4394B 0%, #A82638 100%); }
.btn.ghost { border-color: transparent; color: var(--muted); }
.btn.danger { color: var(--up); border-color: #f3d5d5; }
.btn.small { padding: 5px 10px; font-size: 13px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.block { width: 100%; }

.seg {
  display: inline-flex;
  background: #F4EDEB;
  border-radius: 10px;
  padding: 3px;
  gap: 3px;
  max-width: 100%;
}
.seg button {
  border: 0;
  background: transparent;
  padding: 6px 14px;
  border-radius: 8px;
  cursor: pointer;
  color: var(--muted);
  font-weight: 550;
  white-space: nowrap;
}
.seg button.active {
  background: #fff; color: #8E1F2E;
  box-shadow: 0 1px 2px rgba(96, 30, 40, .07), inset 0 0 0 1px rgba(185, 48, 68, .1);
}

.switch { display: flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; min-height: 38px; }
.switch input { width: 20px; height: 20px; accent-color: var(--accent); flex: none; }

/* ------------------------------------------------------------------ 策略选择 */
.presets { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.preset {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 13px;
  cursor: pointer;
  transition: border-color .15s, background .15s;
  background: #fff;
}
.preset:hover { border-color: #E0C4C1; }
.preset.active {
  border-color: #B93044;
  background: linear-gradient(180deg, #FDF7F7, #FBEDEF);
  box-shadow: 0 0 0 3px rgba(185, 48, 68, .07), inset 0 1px 0 #fff;
}
.preset b { display: block; font-size: 14px; margin-bottom: 2px; }
.preset:last-child:nth-child(odd) { grid-column: 1 / -1; }
.preset span { font-size: 12px; color: var(--muted); line-height: 1.45; }

/* 展开全部：默认收起时只剩 4 张卡，这个按钮必须一眼能看见 ——
   否则新用户会以为平台只有 4 套策略。用虚线红框 + 计数徽标，比灰按钮显眼得多。 */
.preset-more {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; margin-top: 10px; padding: 11px 14px;
  border: 1px dashed #D9A3AB; border-radius: 10px;
  background: linear-gradient(180deg, #FFF9F9, #FDF1F2);
  color: var(--accent); font-size: 13.5px; font-weight: 650;
  cursor: pointer; transition: border-color .15s, background .15s;
}
.preset-more:hover { border-color: var(--accent); background: #FBEDEF; }
.preset-more .pm-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 24px; height: 22px; padding: 0 7px; border-radius: 999px;
  background: var(--accent); color: #fff; font-size: 12px; font-weight: 700;
  line-height: 1;
}
.preset-more .pm-chev {
  width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2.2;
  transition: transform .18s;
}
.preset-more.on .pm-chev { transform: rotate(180deg); }

/* 我的策略 / 群友优质策略 */
.strat-tabs { display: flex; gap: 8px; margin-top: 12px; }
.stab {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 12px; border-radius: 9px; border: 1px solid var(--line);
  background: #fff; color: var(--muted); font-size: 13px; cursor: pointer;
  transition: border-color .15s, color .15s, background .15s;
}
.stab:hover { border-color: #E0C4C1; color: var(--text); }
.stab i {
  font-style: normal; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 999px; background: #F4EEEE; color: #7B6C6E;
  font-size: 11px; line-height: 18px; text-align: center;
}
.stab i:empty { display: none; }
.stab.on {
  border-color: var(--accent); color: var(--accent);
  background: var(--accent-soft); font-weight: 650;
}
.stab.on i { background: var(--accent); color: #fff; }
.strat-list {
  margin-top: 10px; border: 1px solid var(--line); border-radius: 10px;
  overflow: hidden; background: #fff;
}
.strat-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-top: 1px solid #F4EAE9;
}
.strat-item:first-child { border-top: 0; }
.strat-item .si-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.strat-item .si-main b { font-size: 13.5px; }
.strat-item .si-main .tag { align-self: flex-start; }
.strat-item .si-sub {
  font-size: 12px; color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.strat-empty {
  margin-top: 10px; padding: 14px; border-radius: 10px;
  background: #FAF6F5; color: var(--muted); font-size: 12.5px; line-height: 1.7;
}

/* ------------------------------------------------------------------ 积木条件行 */
.cond-row {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-bottom: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
}
.cond-row .input { padding: 6px 8px; }
.cr-a { display: flex; gap: 6px; flex: 2 1 150px; min-width: 0; }
.cr-a .c-left { flex: 1 1 auto; }
.cr-a .c-left-n { width: 62px; flex: none; }
/* 「前 N 日」引用：窄一点，保证一行还放得下指标 + 周期 */
.cr-a .c-lag { width: 78px; flex: none; color: #6B5F61; }
.cr-b { flex: 1 1 92px; min-width: 0; }
.cr-c { display: flex; gap: 6px; flex: 2 1 170px; min-width: 0; }
.cr-c .c-rtype { width: 66px; flex: none; }
.cr-c .c-val { width: 78px; flex: none; }
/* 右边是「指标 MA(n) 20」这种五段行时，指标下拉最容易被挤到只剩「MA(」，
   给个下限让它至少能显示完整的「MA(n)」 */
.cr-c .c-rind { flex: 1 1 0; min-width: 76px; }
.cr-c .c-rn { width: 56px; flex: none; }
.cr-c .c-rlag { width: 76px; flex: none; color: #6B5F61; }
.c-del { flex: none; }

/* 「全部满足 AND」这种小下拉：宽度自适应，右边留出箭头的位置 */
select.logic-select {
  width: auto;
  flex: none;
  padding: 6px 28px 6px 10px;
  font-size: 13px;
}

/* ------------------------------------------------------------------ 指标卡 */
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.metric {
  background:
    radial-gradient(120% 130% at 0% 0%, rgba(185, 48, 68, .05), transparent 58%),
    #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 13px;
  box-shadow: inset 0 1px 0 #fff;
}
.metric .k { font-size: 12px; color: var(--muted); }
.metric .v { font-size: 20px; font-weight: 680; letter-spacing: -.3px; margin-top: 2px; }
.metric .v.up { color: var(--up); }
.metric .v.down { color: var(--down); }
.metric .x { font-size: 11.5px; color: var(--muted); }

/* ------------------------------------------------------------------ 表格 */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
}
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td {
  padding: 8px 10px;
  text-align: right;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
th {
  color: var(--muted);
  font-weight: 600;
  font-size: 12px;
  background: #F7F0EE;
  position: sticky;
  top: 0;
}
th:first-child, td:first-child { text-align: left; }
tbody tr:hover { background: #FDF5F5; }
td.num { font-variant-numeric: tabular-nums; }
td.wrap, th.wrap { white-space: normal; min-width: 120px; }

/* 手机上「左右滑动」提示 */
.scroll-hint {
  display: none;
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 6px;
  text-align: right;
}

/* 手机卡片式列表（替代宽表格） */
.list-cards { display: none; }
.lcard {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 12px;
  margin-bottom: 8px;
  background: #fff;
}
.lcard .lc-top {
  display: flex;
  align-items: baseline;
  gap: 8px;
  justify-content: space-between;
}
.lcard .lc-title { font-weight: 650; font-size: 14px; min-width: 0; }
.lcard .lc-arrow { color: var(--muted); font-size: 12px; }
.lcard .lc-mid { display: flex; gap: 10px; align-items: baseline; margin-top: 5px; }
.lcard .lc-big { font-size: 18px; font-weight: 680; letter-spacing: -.3px; }
.lcard .lc-kv {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 14px;
  margin-top: 5px;
  font-size: 12.5px;
  color: var(--muted);
}
.lcard .lc-kv b { color: var(--text); font-weight: 550; font-variant-numeric: tabular-nums; }
.lcard .lc-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 9px;
  padding-top: 9px;
  border-top: 1px dashed var(--line);
  font-size: 12.5px;
  color: var(--muted);
}
.lcard .lc-acts { display: flex; gap: 6px; flex: none; }

/* ------------------------------------------------------------------ 图表 */
.chart-box { position: relative; width: 100%; }
.chart-box canvas { display: block; width: 100%; touch-action: pan-y; }
.legend { display: flex; gap: 16px; font-size: 12.5px; color: var(--muted); margin-bottom: 6px; flex-wrap: wrap; }
.legend i {
  display: inline-block; width: 10px; height: 3px; border-radius: 2px;
  vertical-align: middle; margin-right: 5px;
}

/* ------------------------------------------------------------------ 提示 */
.alert {
  padding: 10px 12px;
  border-radius: 9px;
  font-size: 13px;
  background: var(--warn-bg);
  color: var(--warn);
  border: 1px solid #f5e3c3;
  margin-bottom: 12px;
  word-break: break-word;
}
.alert.error { background: #FDF1F0; color: #B4232A; border-color: #F0D2CE; }
.alert.ok { background: #EFF9F4; color: #0D7A50; border-color: #CDEBDD; }
.alert ul { margin: 6px 0 0; padding-left: 18px; }
/* 登录页常驻维护提示：只是停用账号那一侧看得到，样式跟着 alert 走。
   下边距留 14：下面的 .install-hint 是 -6 的上边距，不然会叠在一起。 */
.auth-maint { margin: 12px 0 14px; font-size: 12.5px; line-height: 1.7; }

.tag {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 11.5px;
  background: #F4EDEB;
  color: var(--muted);
  white-space: nowrap;
}
.tag.green { background: #EDF8F2; color: #0D7A50; }
.tag.red { background: #FBEDEF; color: #B4232A; }
.tag.blue { background: var(--accent-soft); color: var(--accent); }

.center { text-align: center; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.spacer { flex: 1; }
.hidden { display: none !important; }

/* ------------------------------------------------------------------ 登录 */
.auth-wrap {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;          /* 卡片 + 备案号竖排，否则页脚会跑到卡片右边把卡片压窄 */
  align-items: center;
  justify-content: center;
  padding: 24px 16px calc(24px + var(--safe-b));
  background:
    radial-gradient(900px 460px at 50% -12%, rgba(185, 48, 68, .12) 0%, transparent 62%),
    radial-gradient(520px 300px at 90% 100%, rgba(194, 154, 98, .09) 0%, transparent 60%),
    var(--bg);
}
.auth-card {
  width: 100%;
  max-width: 400px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 26px 24px;
  box-shadow: 0 10px 40px rgba(96, 30, 40, .08);
}
.auth-card h1 { font-size: 19px; margin: 0 0 4px; }
.auth-card .sub { color: var(--muted); font-size: 13px; margin-bottom: 18px; }
.auth-tabs { display: flex; gap: 6px; margin-bottom: 16px; }
.auth-tabs button {
  flex: 1; border: 0; background: #F4EDEB; color: var(--muted);
  padding: 8px 4px; border-radius: 8px; cursor: pointer; font-weight: 550; font-size: 13px;
}
.auth-tabs button.active { background: var(--accent-soft); color: var(--accent); }

/* 加到手机桌面：微信拦未备案域名，桌面图标是主入口，这条提示放在登录页最显眼处 */
.install-hint {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin: -6px 0 16px;
  padding: 8px 11px;
  background: var(--accent-soft);
  border-radius: 9px;
  font-size: 12.5px;
  color: #7C1A2A;
  line-height: 1.5;
}
.link-btn {
  flex: none; padding: 0; border: 0; background: none;
  color: var(--accent); font-size: 12.5px; font-weight: 650;
  text-decoration: underline; cursor: pointer;
}
.steps { margin: 12px 0 0; padding-left: 20px; font-size: 13.5px; line-height: 1.95; }
.steps li { margin: 3px 0; }
.steps b { font-weight: 650; }

/* 备案号：大陆服务器上线后必须挂在首页底部，没配 BT_ICP_NO 时不渲染 */
.icp-foot {
  margin-top: 14px;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.7;
}
.icp-foot a { color: var(--muted); text-decoration: none; }
.icp-foot a:active { color: var(--accent); }
.icp-foot .dot { margin: 0 6px; opacity: .55; }

/* ------------------------------------------------------------------ 回显清单 */
.echo {
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  margin-top: 10px;
}
.echo .line {
  display: flex;
  gap: 10px;
  padding: 8px 12px;
  font-size: 13.5px;
  border-bottom: 1px solid var(--line);
  align-items: baseline;
}
.echo .line:last-child { border-bottom: 0; }
.echo .line .k { color: var(--muted); width: 42px; flex: none; font-size: 12.5px; }
.echo .line .v { flex: 1; word-break: break-word; }
.echo .line.bad { background: #FDF6F5; color: #B4232A; }

/* 自然语言解析：缺什么、为什么没看懂，逐条列出来 */
.nl-issues { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.nl-issue {
  padding: 9px 12px 10px;
  border-left: 3px solid var(--muted);
  border-radius: 8px;
  background: #f7f8fa;
  font-size: 13px;
  line-height: 1.5;
}
.nl-issue b { display: block; color: #2A2325; font-weight: 600; }
.nl-issue span { display: block; margin-top: 3px; color: var(--muted); font-size: 12.5px; line-height: 1.55; }
.nl-issue.error { border-left-color: #C62A2A; background: #FDF3F1; }
.nl-issue.warn { border-left-color: #B57500; background: #FDF7EC; }
.nl-issue.info { border-left-color: var(--accent); background: var(--accent-soft); }
.nl-sug { margin-top: 14px; }
.nl-sug .chips { margin-top: 8px; }
.nl-sug .chip { white-space: normal; text-align: left; line-height: 1.45; }

/* ------------------------------------------------------------------ 页面块 */
.page-head {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.page-head h1 { font-size: 20px; margin: 0; letter-spacing: -.3px; }
.page-head .meta { color: var(--muted); font-size: 13px; }

.loading { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; }
.spinner {
  width: 15px; height: 15px; border-radius: 50%;
  border: 2px solid #EADCD9; border-top-color: var(--accent);
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.kv { display: grid; grid-template-columns: 84px 1fr; gap: 6px 12px; font-size: 13px; }
.kv .k { color: var(--muted); }
.kv .v { word-break: break-all; }

/* ------------------------------------------------------------------ 弹窗（替代 prompt/confirm，微信 iOS 下原生弹窗不可靠） */
.modal-mask {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(96, 30, 40, .45);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: fade .16s ease-out;
}
.modal {
  width: 100%;
  max-width: 420px;
  background: #fff;
  border-radius: 16px 16px 0 0;
  padding: 20px 20px calc(18px + var(--safe-b));
  box-shadow: 0 -8px 40px rgba(96, 30, 40, .18);
  animation: rise .2s ease-out;
}
.modal h3 { margin: 0 0 6px; font-size: 16px; }
.modal .sub { color: var(--muted); font-size: 13px; margin-bottom: 14px; line-height: 1.6; }
.modal .acts { display: flex; gap: 10px; margin-top: 16px; }
.modal .acts .btn { flex: 1; min-height: 42px; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { transform: translateY(16px); opacity: .6; } }

/* 策略选择器：底部弹层里放一个可滚动的列表，三个页面共用 */
.pick-sheet { display: flex; flex-direction: column; max-height: 82vh; }
.ps-head { display: flex; align-items: center; justify-content: space-between; }
.ps-head h3 { margin: 0; }
.ps-x {
  border: 0; background: none; color: var(--muted); font-size: 22px; line-height: 1;
  padding: 2px 6px; cursor: pointer;
}
.ps-tabs { margin: 10px 0 8px; flex-wrap: wrap; gap: 6px; }
/* 三个页签在 390px 上要并排放下，「群友优质策略」不能折成两行 */
.ps-tabs .stab {
  flex: 1 1 0; justify-content: center; padding: 7px 6px;
  font-size: 12px; white-space: nowrap;
}
.ps-tabs .stab i { margin-left: 4px; }
.ps-list { overflow-y: auto; flex: 1 1 auto; min-height: 120px; padding: 2px; margin: 0 -2px; }
.ps-item {
  display: block; width: 100%; text-align: left; cursor: pointer;
  border: 1px solid var(--line); background: #fff; border-radius: 10px;
  padding: 10px 12px; margin-bottom: 8px; font: inherit; color: var(--text);
}
.ps-item b { display: block; font-size: 13.5px; font-weight: 650; }
.ps-item span { display: block; color: var(--muted); font-size: 12px; margin-top: 3px; line-height: 1.55; }
.ps-item.on { border-color: var(--accent); background: #FDF6F6; }
.ps-item.on b::after { content: ' 已选'; color: var(--accent); font-size: 11px; font-weight: 600; }
.ps-foot {
  display: flex; align-items: center; gap: 10px;
  padding-top: 10px; margin-top: 4px; border-top: 1px solid var(--line);
}
.ps-foot .btn { margin-left: auto; min-width: 104px; min-height: 40px; }
.ps-empty { color: var(--muted); font-size: 12.5px; padding: 22px 6px; text-align: center; line-height: 1.85; }

/* ================================================================== 手机 */
@media (max-width: 760px) {
  :root { --topbar-h: 48px; }

  main { padding: 12px 12px calc(var(--tabbar-h) + var(--safe-b) + 20px); }
  .card { padding: 14px; border-radius: 11px; margin-bottom: 11px; }
  .card h2 { font-size: 14.5px; margin-bottom: 12px; }

  /* 日期三段下拉：手机上竖排，每行放得下三个，免得挤成火星文 */
  .code-field { max-width: none; }
  .date-range { grid-template-columns: 1fr; gap: 12px; margin-top: 12px; }
  .date-pick { gap: 5px; }
  .date-pick .input { padding: 10px 17px 10px 8px; background-position: right 3px center; }
  .chip { padding: 7px 12px; font-size: 13px; }

  /* 顶栏只留品牌与账号，导航挪到底部 */
  .topbar-inner { padding: 8px 12px; gap: 8px; }
  .nav.desktop-only { display: none; }
  .who .name { max-width: 84px; overflow: hidden; text-overflow: ellipsis; }
  .brand { font-size: 15px; }

  .tabbar {
    display: flex;
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 40;
    background: rgba(255, 253, 253, .93);
    backdrop-filter: saturate(180%) blur(14px);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    border-top: 1px solid var(--line);
    padding-bottom: var(--safe-b);
  }
  /* 底部固定标签栏 + 页脚备案号：留白要够，否则备案号被压在标签栏下面 */
  main { padding-bottom: calc(var(--tabbar-h) + var(--safe-b) + 28px); }
  .tabbar a {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    height: var(--tabbar-h);
    color: var(--muted);
    font-size: 11px;
    -webkit-tap-highlight-color: transparent;
  }
  .tabbar a svg { width: 21px; height: 21px; stroke: currentColor; fill: none; stroke-width: 1.7; }
  .tabbar a.active { color: var(--accent); }
  .tabbar a:active { background: #FBF4F3; }

  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .metric { padding: 10px 11px; }
  .metric .v { font-size: 19px; }
  .presets { grid-template-columns: 1fr; }
  .preset { padding: 11px 12px; }
  .grid.two, .grid.three, .grid.four { grid-template-columns: 1fr; }
  /* 策略参数（周期数这类短数字）两列排，省掉一半滚动 */
  #params { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .page-head h1 { font-size: 18px; }
  .page-head .meta { font-size: 12.5px; }

  /* 输入框字号必须 ≥16px，否则 iOS 微信点进去会自动放大整页 */
  .input, select.input, textarea.input { font-size: 16px; padding: 10px 11px; }
  select.input { padding-right: 28px; }   /* 给自绘的三角箭头留位，别压住文字 */
  .btn { min-height: 40px; padding: 9px 15px; }
  .btn.small { min-height: 32px; padding: 6px 10px; font-size: 12.5px; }
  .seg { width: 100%; overflow-x: auto; flex-wrap: nowrap; }
  .seg button { flex: 1 0 auto; padding: 8px 12px; font-size: 13px; }

  /* 积木条件行：拆成三行，否则七个控件挤成一团 */
  .cond-row { display: grid; grid-template-columns: 1fr; gap: 6px; padding: 9px 42px 9px 9px; position: relative; }
  .cr-a { flex: none; }
  .cr-b, .cr-c { flex: none; }
  .cr-c .c-rtype { width: 80px; }
  .c-del {
    position: absolute; top: 5px; right: 5px;
    width: 32px; height: 32px; min-height: 32px; padding: 0;
    font-size: 17px; line-height: 1; color: var(--muted);
  }

  table { font-size: 12.5px; }
  th, td { padding: 7px 9px; }
  .scroll-hint { display: block; }
  /* 手机已换成卡片列表，横向滑动提示就没意义了 */
  .list-cards + .scroll-hint { display: none; }

  /* 宽表格换成卡片列表 */
  .desk-only { display: none !important; }
  .hide-sm { display: none !important; }
  .list-cards { display: block; }

  .chart-tip { font-size: 11.5px !important; }
  .auth-wrap { padding: 18px 14px calc(18px + var(--safe-b)); }
  .auth-card { padding: 22px 18px; border-radius: 14px; }
  .auth-card h1 { font-size: 18px; }
  .kv { grid-template-columns: 76px 1fr; }
  .modal { padding: 18px 16px calc(16px + var(--safe-b)); }

  /* 主操作吸底：放在标签栏正上方，滚到哪儿都能一键开始 */
  .actionbar {
    position: fixed;
    left: 0; right: 0;
    bottom: calc(var(--tabbar-h) + var(--safe-b));
    z-index: 35;
    margin: 0;
    padding: 8px 12px;
    background: rgba(255, 253, 253, .93);
    backdrop-filter: saturate(180%) blur(14px);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    border-top: 1px solid var(--line);
    box-shadow: 0 -2px 12px rgba(96, 30, 40, .05);
  }
  .actionbar .btn { min-height: 42px; }
  .actionbar .btn.primary { flex: 1 1 auto; min-width: 0; font-size: 15px; }
  .actionbar .btn:not(.primary) { flex: 0 0 auto; }
  .actionbar-space { display: block; height: 64px; }

  .card.fold { padding: 0; }
  .fold-head { padding: 14px; font-size: 14.5px; }
  .fold-body { padding: 0 14px 14px; }
  .fold-sum { max-width: 58%; }
  .step-no { width: 18px; height: 18px; border-radius: 5px; font-size: 11.5px; }
  .fold-cta { padding: 5px 9px 5px 12px; font-size: 12px; }
  .param-help { width: 18px; height: 18px; font-size: 12px; vertical-align: -4px; }
  pre.code { font-size: 12px; padding: 10px; }
}

/* 超小屏（iPhone SE 之类）再收一档 */
@media (max-width: 360px) {
  .metric .v { font-size: 17px; }
  .tabbar a { font-size: 10px; }
  .auth-tabs button { font-size: 12px; }
}

/* ------------------------------------------------------------------ 今日信号 */
.scan-summary { display: flex; flex-wrap: wrap; gap: 7px; margin: -2px 0 4px; }
.scan-pill {
  font-size: 12px; padding: 4px 10px; border-radius: 999px;
  background: #F6EFED; color: var(--muted); font-weight: 600;
}
.scan-pill.buy { background: var(--accent-soft); color: #A82638; }
.scan-pill.sell { background: #EFF9F4; color: var(--down); }
.scan-pill.err { background: #FDF1F0; color: #B4232A; }
.scan-group { margin-top: 16px; }
.scan-group h3 {
  margin: 0 0 2px; font-size: 13px; font-weight: 650; color: var(--text);
  display: flex; align-items: baseline; gap: 7px;
}
.scan-group h3 .sub { font-weight: 400; font-size: 12px; color: var(--muted); }
.scan-row {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 4px; border-bottom: 1px solid var(--line);
  cursor: pointer; border-radius: 8px;
}
.scan-row:last-child { border-bottom: 0; }
.scan-row:hover { background: #FDF7F7; }
.scan-row:active { background: var(--accent-soft); }
.scan-main { min-width: 0; }
.scan-title { display: flex; align-items: baseline; gap: 7px; }
.scan-title b { font-size: 14.5px; font-weight: 650; letter-spacing: -.2px; }
.scan-sub { font-size: 12px; color: var(--muted); margin-top: 3px; }
.scan-right { margin-left: auto; text-align: right; flex: none; }
/* 状态标签：选择器必须带 .scan-row 前缀。
   信号名直接当类名用（buy/sell/hold/wait），而持仓页那个卡片也叫 .hold
   （padding 11px 0、font-size 13px、border-top），它定义在后面、特异性又和
   .scan-tag 相同，会把标签的 padding、字号、边框全盖掉 —— 表现为「继续持有」
   那个框比其他三个明显大一圈。加一层 .scan-row 就压住了，border 也要显式清零。 */
.scan-row .scan-tag {
  display: inline-block; font-size: 12px; padding: 3px 9px; border-radius: 999px;
  background: #F6EFED; color: var(--muted); font-weight: 600; white-space: nowrap;
  border: 0; line-height: 1.55;
}
.scan-row .scan-tag.buy { background: var(--accent-soft); color: #A82638; }
.scan-row .scan-tag.sell { background: #EFF9F4; color: var(--down); }
.scan-hold { font-size: 11.5px; margin-top: 4px; font-variant-numeric: tabular-nums; }
.scan-chev {
  width: 15px; height: 15px; flex: none; fill: none;
  stroke: #C9B9B7; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}

@media (max-width: 760px) {
  .scan-row { padding: 11px 2px; gap: 8px; }
  .scan-chev { display: none; }
  .scan-title b { font-size: 14px; }
  .scan-sub { font-size: 11.5px; }
}

/* 风控 / 扫描这类短字段：手机上不必一行一个，两列三列更省滚动 */
@media (max-width: 760px) {
  .grid.two.tight { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .grid.three.tight { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .grid.four.tight { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 12px; }
  .grid.tight .field label { font-size: 12px; }
  .grid.tight .input { padding: 9px 10px; font-size: 14px; }
  .grid.tight .hint { font-size: 11.5px; }
}

/* ------------------------------------------------------------------ 技术面：K 线 / 体检 / 归因
   原则：默认折叠、进页面只多一行标题；展开后才出现图与细节，
   避免把「技术面能力强弱不一」的团队一次性淹没在指标里。 */
.chips.mini { margin-top: 0; gap: 6px; }
.chips.mini .chip { padding: 4px 10px; font-size: 12px; }
.chip.active {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
  font-weight: 600;
}
.kl-tools { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.kl-legend { margin-bottom: 4px; font-size: 12px; }
.kl-legend i { width: 8px; height: 8px; border-radius: 2px; }
.kl-tip {
  position: absolute; z-index: 4; pointer-events: none;
  background: rgba(255, 255, 255, .97);
  border: 1px solid var(--line); border-radius: 9px;
  padding: 7px 9px; font-size: 11.5px; line-height: 1.6;
  box-shadow: 0 8px 24px rgba(96, 30, 40, .14);
  min-width: 132px;
}
.kl-tip-date { color: var(--muted); margin-bottom: 2px; font-variant-numeric: tabular-nums; }
.kl-tip-row { display: flex; justify-content: space-between; gap: 12px; font-variant-numeric: tabular-nums; }
.kl-tip-row span { color: var(--muted); }
.kl-tip-note { color: var(--muted); margin-top: 2px; font-variant-numeric: tabular-nums; }
#kl-card .fold-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 归因 */
.attr-dim { margin-bottom: 14px; }
.attr-dim:last-of-type { margin-bottom: 4px; }
.attr-title { font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }
.attr-groups { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.attr-cell {
  border: 1px solid var(--line); border-radius: 10px;
  padding: 8px 10px; background: #FFFDFC;
}
.ac-label { font-size: 12px; color: var(--text); display: flex; align-items: baseline; gap: 5px; }
.ac-n { color: var(--muted); font-size: 11px; }
.ac-val { font-size: 16px; font-weight: 650; margin-top: 2px; font-variant-numeric: tabular-nums; }
.ac-sub { font-size: 11px; color: var(--muted); margin-top: 1px; }

/* 买点体检 */
.hgrid { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.hrow {
  display: grid; grid-template-columns: 56px 52px 1fr 1fr 1.3fr;
  align-items: center; padding: 8px 12px; font-size: 13px;
  border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums;
}
.hrow:last-child { border-bottom: 0; }
.hrow.hhead { background: #FFFBF8; font-size: 11.5px; color: var(--muted); padding: 6px 12px; }
.hrow span:nth-child(n+3) { text-align: right; }
.hday { color: var(--muted); }
.hbase { color: var(--muted); }
.hbase i { font-style: normal; font-size: 11px; opacity: .7; }
.hyears {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px 14px;
  margin-top: 12px; font-size: 12.5px;
}
.hyears b { font-size: 12.5px; color: var(--text); font-weight: 600; }
.hyears span { display: inline-flex; align-items: baseline; gap: 4px; }
.hyears i { font-style: normal; color: var(--muted); font-size: 12px; }
.hyears em { font-style: normal; font-weight: 600; font-variant-numeric: tabular-nums; }
.hyears small { color: var(--muted); font-size: 11px; }
.hverdict { margin-top: 12px; padding: 8px 10px; background: #FFFBF8;
  border-left: 2px solid var(--line); border-radius: 0 8px 8px 0; }

/* 我的策略 */
.saved-list { display: flex; flex-direction: column; }
.saved-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 0; border-bottom: 1px solid var(--line);
}
.saved-item:first-child { padding-top: 4px; }
.saved-item:last-child { border-bottom: 0; padding-bottom: 0; }
.sv-main { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 3px; }
.sv-main b { font-size: 14px; font-weight: 600; }
.sv-meta { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.sv-acts { display: flex; gap: 6px; flex: none; }
@media (max-width: 760px) {
  .saved-item { flex-wrap: wrap; }
  .sv-acts { width: 100%; justify-content: flex-end; }
}

/* 指标说明 */
.gloss-index { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.gloss-chip {
  font: inherit; font-size: 12px; padding: 4px 10px; cursor: pointer;
  border: 1px solid var(--line); border-radius: 999px;
  background: #fff; color: var(--text);
}
.gloss-chip:hover { border-color: var(--muted); color: var(--accent); }
.gloss-item {
  padding: 13px 0; border-bottom: 1px solid var(--line);
  transition: background-color .4s ease;
}
.gloss-item:last-child { border-bottom: 0; padding-bottom: 0; }
.gloss-item.flash { background: var(--accent-soft); }
.gi-title { font-size: 14px; font-weight: 650; margin-bottom: 7px; }
.gi-kv {
  display: grid; grid-template-columns: 34px minmax(0, 1fr);
  gap: 4px 10px; margin: 0; font-size: 13px; line-height: 1.7;
}
.gi-kv dt { color: var(--muted); font-size: 12px; padding-top: 1px; }
.gi-kv dd { margin: 0; color: var(--text); }
.gi-tip {
  margin-top: 7px; padding: 6px 10px; font-size: 12.5px; line-height: 1.65;
  color: var(--muted); background: #FFFBF8; border-radius: 8px;
}

/* 扫描页技术面徽标与面板 */
.scan-score {
  display: inline-block; margin-top: 5px; padding: 2px 8px;
  border: 1px solid var(--line); border-radius: 999px;
  background: #fff; color: var(--muted);
  font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums;
  cursor: pointer; white-space: nowrap;
}
.scan-score:hover { border-color: var(--accent); color: var(--accent); }
.scan-score.active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.scan-score.strong { color: #A82638; border-color: #F0CDD2; background: #FDF3F4; }
.scan-score.weak { color: var(--down); border-color: #CFE8DC; background: #F3FAF6; }
.tech-panel {
  margin: 2px 0 10px; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 11px;
  background: #FFFCFC;
}
.tech-panel[hidden] { display: none; }
.tech-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 9px; }
.tech-tag {
  font-size: 11.5px; padding: 2px 8px; border-radius: 999px;
  background: #F6EFED; color: var(--muted);
}
.tech-tag.up { background: #FBEDEF; color: #A82638; }
.tech-tag.down { background: #EFF9F4; color: var(--down); }
.tech-tag.flat { background: #F6EFED; color: var(--muted); }
.tech-kv { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px 14px; }
.tech-kv .tk { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; }
.tech-kv .tk span { color: var(--muted); flex: none; }
.tech-kv .tk b { font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
.tech-levels {
  display: flex; flex-wrap: wrap; gap: 14px;
  margin-top: 10px; padding-top: 9px; border-top: 1px dashed var(--line);
  font-size: 12px; color: var(--muted);
}
.tech-levels b { color: var(--text); font-variant-numeric: tabular-nums; }
.tech-acts { display: flex; align-items: center; gap: 10px; margin-top: 10px; flex-wrap: wrap; }

@media (max-width: 760px) {
  .attr-groups { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hrow { grid-template-columns: 46px 40px 1fr 1fr 1.4fr; padding: 7px 10px; font-size: 12.5px; }
  .hrow.hhead { font-size: 11px; padding: 6px 10px; }
  .hbase i { font-size: 10.5px; }
  .tech-kv { grid-template-columns: 1fr; gap: 5px; }
  .kl-legend { gap: 10px; font-size: 11.5px; }
  .tech-acts .hint { font-size: 11px; }
}

/* 涨跌色：fmt.cls() 只吐 up / down 两个类名，但以前只有 .metric .v 有颜色，
   于是记录页、扫描页、批量表里的数字全是黑的。这里补一条全局规则。 */
.up { color: var(--up); }
.down { color: var(--down); }

/* ------------------------------------------------------------------ 首页 */
/* 首页标题与副标题固定分两行、左对齐：.page-head 是 flex-wrap，
   副标题在宽屏会被挤到「晚上好」右边，窄屏又换行，一页一个样。 */
.home-head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
  padding-bottom: 6px;
}
.home-head .meta { max-width: 100%; }
/* 首页顶部三个入口：今日次数 / 市场 / 讨论区。
   三等分排满一行，高度、字号、圆角、描边全部统一 —— 三个并排的东西只要
   高度差 1px 或字号差 1px，整排看上去就是歪的。所以盒模型统一写在
   .home-bar .xxx 这一层（两个类，压过下面 .mkt-chip 的单类规则），
   各入口自己的规则只改内容，不改盒子。 */
.home-bar {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 16px;
}
.home-bar .quota-chip,
.home-bar .mkt-chip,
.home-bar .chat-chip {
  height: 34px; box-sizing: border-box; min-width: 0; padding: 0 8px;
  display: flex; align-items: center; justify-content: center; gap: 4px;
  border-radius: 10px; background: #fff; border: 1px solid var(--line);
  box-shadow: var(--shadow-card); font-size: 12.5px; color: var(--text);
  text-decoration: none; white-space: nowrap; overflow: hidden;
}
.quota-chip b { font-size: 16px; font-weight: 700; color: #8E1F2E; line-height: 1; }
.quota-chip > span { font-size: 12px; color: var(--muted); }
.home-bar .mkt-chip .st {
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* 讨论区：未读数只在有新消息时出现，红色小药丸跟在名字后面 */
.chat-chip svg {
  width: 15px; height: 15px; flex: none;
  fill: none; stroke: var(--accent); stroke-width: 1.9;
  stroke-linecap: round; stroke-linejoin: round;
}
.chat-chip .cn {
  flex: none; min-width: 17px; height: 17px; padding: 0 5px;
  border-radius: 9px; background: var(--accent); color: #fff;
  font-size: 10.5px; font-weight: 700; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
}
.chat-chip .cn[hidden] { display: none; }
/* 「继续上次」刻意做成一行小字：能看见、但不跟主按钮抢注意力 */
.draft-link {
  border: 0; background: none; padding: 2px 0; cursor: pointer;
  font-size: 12px; color: var(--muted); text-decoration: underline;
  text-decoration-color: rgba(107, 95, 97, .35); text-underline-offset: 3px;
}
.draft-link:hover { color: var(--accent); }
.home-bar .spacer { flex: 1; }

.entries { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.entries.tri { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 14px; }
.entry {
  position: relative; display: flex; flex-direction: column; gap: 9px;
  padding: 18px; border-radius: var(--radius);
  background: linear-gradient(180deg, #fff 0%, #FFFCFC 100%);
  border: 1px solid var(--line); box-shadow: var(--shadow-card);
  color: inherit;
  transition: border-color .16s, box-shadow .16s, transform .06s;
}
.entry:hover { border-color: #E2C8CC; box-shadow: 0 10px 26px -16px rgba(96, 30, 40, .3); }
.entry:active { transform: translateY(1px); }
/* 图标与名称同一行：名称在右，右侧不再空一大块 */
.entry .ehead { display: flex; align-items: center; gap: 10px; }
.entry .ehead h3 { flex: 1; min-width: 0; }
.entry .ehead .go {
  margin-left: auto; flex: none; white-space: nowrap;
  font-size: 12.5px; color: var(--accent); font-weight: 600;
}
.entry .ico {
  width: 36px; height: 36px; border-radius: 10px; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(180deg, #FBEDEF, #F8E3E6); color: var(--accent);
  box-shadow: inset 0 0 0 1px rgba(185, 48, 68, .07);
}
.entry .ico svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.entry h3 { margin: 0; font-size: 15.5px; font-weight: 680; letter-spacing: -.1px; white-space: nowrap; }
.entry.main h3 { font-size: 17px; }
.entry p { margin: 0; font-size: 12.5px; color: var(--muted); line-height: 1.62; }
.entry .meta { display: flex; flex-wrap: wrap; gap: 5px; margin-top: auto; }
.entry .meta span {
  font-size: 11px; color: #7B6C6E; background: #FAF4F3;
  border: 1px solid #F1E6E4; padding: 1px 6px; border-radius: 6px;
}
/* 主卡的行动按钮：首页以前全是白卡白字，没有一个落点，看着很空 */
.entry-btn {
  align-self: flex-start; margin-top: 4px;
  display: inline-flex; align-items: center; gap: 3px;
  padding: 8px 18px; border-radius: 9px;
  background: linear-gradient(180deg, #B93044 0%, #8E1F2E 100%);
  border: 1px solid #8E1F2E; color: #fff;
  font-size: 13.5px; font-weight: 620; letter-spacing: .3px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), 0 6px 16px -6px rgba(150, 26, 46, .42);
}
.entry-btn i { font-style: normal; opacity: .8; margin-left: 1px; }
.entry.main:hover .entry-btn { filter: brightness(1.04); }

.card h2 .more { margin-left: auto; font-size: 12.5px; font-weight: 500; color: var(--accent); }

/* 最近回测：整行可点，手机上也保持三列对齐 */
.rec {
  display: grid; grid-template-columns: 1.6fr 1.1fr .9fr 1fr .8fr;
  align-items: center; gap: 10px;
  padding: 9px 4px; border-top: 1px solid #F7EFEE;
  color: inherit; font-size: 13px;
}
.rec:first-of-type { border-top: 0; }
.rec:hover { background: #FFFBFA; }
.rec .nm b { font-size: 13.5px; }
.rec .nm span { color: var(--muted); margin-left: 6px; font-size: 11.5px; }
.rec .st { color: #5B4E50; font-size: 12.5px; }
.rec .num { text-align: right; font-weight: 620; font-variant-numeric: tabular-nums; }
.rec .dd { text-align: right; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.rec .tm { text-align: right; color: #9A8C8E; font-size: 11.5px; }

/* 记录页里的批量批次：列比单只记录少，一眼看清「跑了几只、成没成」 */
.brec {
  display: grid; grid-template-columns: 1fr auto auto auto;
  align-items: center; gap: 12px;
  padding: 10px 4px; border-top: 1px solid #F7EFEE;
  color: inherit; font-size: 13px;
}
.brec:first-of-type { border-top: 0; }
.brec:hover { background: #FFFBFA; }
.brec .nm b { font-size: 13.5px; }
.brec .nm span { color: var(--muted); margin-left: 6px; font-size: 12px; }
.brec .st { color: #5B4E50; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.brec .tm { color: #9A8C8E; font-size: 11.5px; font-variant-numeric: tabular-nums; }
.brec .go { color: var(--accent); font-size: 12.5px; font-weight: 600; white-space: nowrap; }

/* ------------------------------------------------------------------ 批量回测 */
.watch-pool { display: flex; flex-wrap: wrap; gap: 7px; }
.pool-chip {
  display: inline-flex; align-items: baseline; gap: 5px;
  padding: 5px 10px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line); background: #fff; color: var(--text);
  font-size: 13px; font-weight: 500;
}
.pool-chip span { font-size: 10.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.pool-chip.on {
  border-color: #E1BFC4; background: var(--accent-soft); color: #8E1F2E;
  box-shadow: inset 0 0 0 1px rgba(185, 48, 68, .08);
}
.pool-chip.on span { color: #A6757C; }

.batch-paste { margin-top: 12px; }.batch-paste summary {
  cursor: pointer; font-size: 12.5px; color: var(--accent);
  list-style: none; padding: 4px 0;
}
.batch-paste summary::-webkit-details-marker { display: none; }
.batch-paste summary::before { content: '+ '; font-weight: 700; }
.batch-paste[open] summary::before { content: '− '; }
.batch-paste textarea { margin-top: 8px; }

.progress {
  height: 7px; border-radius: 99px; background: #F3E7E6; overflow: hidden;
}
.progress i {
  display: block; height: 100%; border-radius: 99px;
  background: linear-gradient(90deg, #C74A5C, #8E1F2E);
  transition: width .3s ease;
}

.cmp-table th[data-sort] { cursor: pointer; user-select: none; }
.cmp-table th[data-sort]:hover { color: var(--accent); }
.cmp-table th.sorted { color: var(--accent); }
.cmp-table tbody tr[data-code] { cursor: pointer; }
.cmp-table tbody tr[data-code]:hover { background: #FFFBFA; }
.dotc {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  margin-right: 6px; vertical-align: middle;
}

/* ------------------------------------------------------------------ 多策略对比 */
.pick-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.pick {
  text-align: left; cursor: pointer; padding: 11px 12px;
  border-radius: 11px; border: 1px solid var(--line); background: #fff;
  display: flex; flex-direction: column; gap: 3px;
}
.pick b { font-size: 13.5px; font-weight: 650; }
.pick span { font-size: 11.5px; color: var(--muted); line-height: 1.5; }
.pick.on {
  border-color: #E1BFC4; background: linear-gradient(180deg, #FDF7F7, #FBEDEF);
  box-shadow: inset 0 0 0 1px rgba(185, 48, 68, .08);
}

/* 「策略」下拉改成的按钮：名字可能很长，超出就省略，别把整行撑开 */
.strat-pick {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  text-align: left; cursor: pointer; background: #fff;
}
.strat-pick span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.strat-pick svg {
  width: 14px; height: 14px; flex: none;
  fill: none; stroke: var(--muted); stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
}
.pick.on b { color: #8E1F2E; }

/* ------------------------------------------------------------------ 参数热力图 */
.hm-table { width: 100%; border-collapse: separate; border-spacing: 4px; }
.hm-table th {
  font-size: 11.5px; font-weight: 500; color: var(--muted);
  padding: 2px 4px; text-align: center; white-space: nowrap;
}
.hm-table td.hm-side {
  font-size: 11.5px; color: var(--muted); white-space: nowrap;
  text-align: right; padding-right: 6px;
}
.hm-cell {
  text-align: center; font-size: 12.5px; font-weight: 600;
  font-variant-numeric: tabular-nums;
  padding: 9px 6px; border-radius: 8px; min-width: 54px;
  border: 1px solid rgba(239, 226, 224, .8);
}
.hm-cell.dead { background: #F7F2F1; color: #B9ABAD; font-weight: 400; }
.hm-cell.base { outline: 2px dashed #8E1F2E; outline-offset: -2px; }
.hm-sum {
  display: flex; flex-wrap: wrap; gap: 14px;
  margin-top: 12px; font-size: 12.5px; color: var(--muted);
}
.hm-sum b { color: var(--text); font-variant-numeric: tabular-nums; }
.hm-now { color: #8E1F2E; }

@media (max-width: 760px) {
  .entries, .entries.tri { grid-template-columns: 1fr 1fr; }
  .entries .entry.main { grid-column: 1 / -1; }
  /* 三张次要卡里最后一张占满一行，2 + 1 比 2 + 半空更像有意的排版 */
  .entries.tri .entry:last-child { grid-column: 1 / -1; }
  .entry { padding: 14px; }
  .entry p { font-size: 12px; }
  .entry .entry-btn { width: 100%; justify-content: center; margin-top: 2px; }
  /* 半栏宽放不下「名称 + 去xx ›」，会挤成竖排；卡片整体就是链接，去掉这行更清爽 */
  .entry .ehead .go { display: none; }
  .entry h3 { font-size: 15px; overflow: hidden; text-overflow: ellipsis; }
  .entry.main h3 { font-size: 16.5px; }
  .rec { grid-template-columns: 1fr auto; grid-template-areas: "nm num" "st dd"; row-gap: 2px; }
  .rec .nm { grid-area: nm; }
  .rec .num { grid-area: num; }
  .rec .st { grid-area: st; font-size: 11.5px; }
  .rec .dd { grid-area: dd; font-size: 11px; }
  .rec .tm { display: none; }
  .brec { grid-template-columns: 1fr auto auto; gap: 8px; padding: 9px 2px; }
  .brec .tm { display: none; }
  .pick-grid { grid-template-columns: 1fr 1fr; }
  .hm-cell { min-width: 0; padding: 8px 3px; font-size: 11.5px; }
  .hm-table th { font-size: 10.5px; }
  .hm-sum { gap: 10px; font-size: 11.5px; }
}

/* ==================================================================
   市场状态 / 策略说明书 / 仓位计算 / 我的持仓
   配色和既有页面保持一致：浅粉底 + 砖红强调，涨红跌绿（A 股习惯）。
   ================================================================== */
.row.between { justify-content: space-between; flex-wrap: nowrap; }
.tag.line { background: #fff; color: var(--muted); border: 1px solid var(--line); }
.tag.up { background: #FBEDEF; color: #B4232A; }
.tag.down { background: #EDF8F2; color: #0D7A50; }
.tag.warn { background: var(--warn-bg); color: var(--warn); }

/* ---- 首页：今日次数右边那枚「市场」胶囊 ---- */
.mkt-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 11px; border-radius: 10px;
  background: #fff; border: 1px solid var(--line);
  box-shadow: var(--shadow-card); color: inherit; font-size: 12.5px;
  transition: border-color .16s, box-shadow .16s;
}
.mkt-chip:hover { border-color: #E2C8CC; }
.mkt-chip b { font-size: 12.5px; font-weight: 650; }
.mkt-chip .st { color: var(--muted); }
.mkt-chip .mdot { width: 7px; height: 7px; border-radius: 50%; background: #C9B6B8; flex: none; }
.mkt-chip.up .mdot { background: var(--up); }
.mkt-chip.up .st { color: var(--up); font-weight: 600; }
.mkt-chip.down .mdot { background: var(--down); }
.mkt-chip.down .st { color: var(--down); font-weight: 600; }
.mkt-chip.range .mdot { background: #D9A03C; }
.mkt-chip.range .st { color: #9A6410; font-weight: 600; }
.mkt-chip i { font-style: normal; color: var(--muted); opacity: .7; }

/* 主卡里多一行「继续上次」：挂在卡片内、主按钮下方，字号压到最小
   水平居中是为了和上面的按钮共用一条中轴，但仍用 12px 灰字，不抢焦点 */
.entry.has-foot { padding-bottom: 14px; }
.entry .ebody { display: flex; flex-direction: column; gap: 9px; color: inherit; }
.entry.has-foot .draft-link {
  margin-top: 2px; align-self: center; text-align: center;
}

/* 首页「我的持仓」小横条：没有持仓时整块不渲染，所以不会占位置 */
.hold-strip {
  display: flex; align-items: center; gap: 11px;
  margin-top: 14px; padding: 12px 14px; border-radius: var(--radius);
  background: linear-gradient(180deg, #fff, #FFFCFC);
  border: 1px solid var(--line); box-shadow: var(--shadow-card);
  color: inherit;
}
.hold-strip:hover { border-color: #E2C8CC; }
.hold-strip.urgent { border-color: #E7C9CC; background: linear-gradient(180deg, #FFFDFD, #FDF3F4); }
.hold-strip .hs-ico {
  width: 32px; height: 32px; flex: none; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(180deg, #FBEDEF, #F8E3E6); color: var(--accent);
}
.hold-strip .hs-ico svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.hold-strip .hs-t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.hold-strip .hs-t b { font-size: 14px; }
.hold-strip .hs-t span { font-size: 12px; color: var(--muted); }
.hold-strip .hs-go { font-size: 12.5px; color: var(--accent); font-weight: 600; white-space: nowrap; }
.hold-strip .hs-go .dot {
  display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: var(--up); margin-right: 5px; vertical-align: 1px;
}

.fld { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.fld .lb { font-size: 11px; color: var(--muted); }
.fld .input { width: 100%; }
.mgrid { display: grid; gap: 8px; }
.mgrid.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.mgrid.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cell {
  background: #FFFBFB; border: 1px solid #F5E9E7; border-radius: 9px;
  padding: 7px 9px; display: flex; flex-direction: column; gap: 1px;
}
.cell span { font-size: 10.5px; color: var(--muted); }
.cell b { font-size: 14px; font-variant-numeric: tabular-nums; }
.cell b small { font-size: 9.5px; font-weight: 500; color: var(--muted); }
/* ---- 市场状态页 ---- */
.mkt-hero {
  border: 1px solid #F0DADE; border-radius: var(--radius);
  background: linear-gradient(180deg, #FFFDFD, #FDF3F4);
  padding: 13px 14px; margin-bottom: 14px;
}
.mkt-hero h3 { margin: 0; font-size: 16px; display: flex; align-items: center; gap: 8px; }
.mkt-hero .tag { font-size: 12px; padding: 2px 9px; }
.mkt-hero table.mini { margin-top: 4px; font-size: 12.5px; }
.mkt-hero table.mini td { padding: 6px 0; border-bottom: 1px solid #F6E7E7; text-align: left; }
.mkt-hero table.mini td:first-child { color: var(--muted); font-size: 12px; }
.mkt-hero table.mini td:nth-child(2) { text-align: right; font-variant-numeric: tabular-nums; }
.mkt-hero table.mini td:last-child { text-align: right; font-weight: 600; white-space: nowrap; }
.mkt-hero table.mini tr:last-child td { border-bottom: 0; }
.mkt-hero .hint { margin-top: 7px; line-height: 1.7; }

.man { display: flex; flex-direction: column; gap: 12px; margin-top: 10px; }
.man-b { border-left: 2px solid #EBD3D6; padding-left: 11px; }
.man-b .k { font-size: 11.5px; color: var(--accent); font-weight: 650; letter-spacing: .2px; }
.man-b .v { font-size: 13px; line-height: 1.6; }
.man-b .stat { font-size: 11.5px; color: var(--muted); margin-top: 2px; line-height: 1.6; }

table.adapt { font-size: 12px; }
table.adapt th { font-size: 11px; color: var(--muted); font-weight: 500; padding: 7px 6px; }
table.adapt td { padding: 8px 6px; font-variant-numeric: tabular-nums; }
table.adapt th, table.adapt td { white-space: nowrap; }
table.adapt th.tl, table.adapt td.tl { text-align: left; white-space: nowrap; }
table.adapt td.tl b { font-size: 12.5px; }
table.adapt td.tl .ty {
  font-size: 10px; color: var(--muted); margin-left: 5px;
  background: #FAF4F3; border: 1px solid #F1E6E4; border-radius: 4px; padding: 0 3px;
}
table.adapt .cur { background: #FFF6F7; }
table.adapt th.cur { color: #8E1F2E; font-weight: 700; }
table.adapt .muted span { opacity: .55; }

/* ---- 策略说明书 ---- */
.pb-hero {
  border: 1px solid #F0DADE; border-radius: var(--radius);
  background: linear-gradient(180deg, #FFFDFD, #FCF3F4);
  padding: 14px; margin-bottom: 14px;
}
.pb-hero .pb-sum { font-size: 13px; line-height: 1.7; margin-top: 9px; }
.pb-card .no {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; border-radius: 6px; margin-right: 6px;
  background: var(--accent-soft); color: var(--accent);
  font-size: 11px; font-weight: 700; vertical-align: 1px;
}
.pb-text { font-size: 13px; line-height: 1.85; color: #3A3132; margin-top: 8px; }
.pb-link { font-size: 12px; color: var(--accent); white-space: nowrap; }
.pb-card + .pb-card { margin-top: 0; }

/* ---- 我的持仓 ---- */
.hold-sum { background: linear-gradient(180deg, #FFFDFD, #FCF3F4); border-color: #F0DADE; }
.hold {
  padding: 11px 0; border-top: 1px solid #F7EFEE; font-size: 13px;
}
.hold:first-of-type { border-top: 0; }
.hold .h1 { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.hold .h1 b { font-size: 14px; }
.hold .code { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.hold .h2 {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 8px; margin-top: 2px; font-size: 11.5px; color: var(--muted);
}
.hold .h2 b { font-size: 14px; color: var(--text); font-variant-numeric: tabular-nums; }
.hold .h2 b.up { color: var(--up); } .hold .h2 b.down { color: var(--down); }
.hold .h3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 7px; }
.hold .h3 > div { display: flex; flex-direction: column; gap: 1px; }
.hold .h3 span { font-size: 10.5px; color: var(--muted); }
.hold .h3 b { font-size: 12.5px; font-variant-numeric: tabular-nums; }
.hold-act { display: flex; gap: 6px; margin-top: 9px; }
.hold .badge { font-size: 10px; padding: 1px 6px; }

.btn.tiny {
  font-size: 11.5px; padding: 4px 10px; border-radius: 7px; min-height: 0;
}

/* 「我的」页工具区 */
.tool-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 10px; }
.tool {
  display: flex; flex-direction: column; gap: 3px; padding: 12px;
  border: 1px solid var(--line); border-radius: 11px; background: #fff;
  color: inherit; box-shadow: var(--shadow-card);
}
.tool:hover { border-color: #E2C8CC; }
.tool b { font-size: 13.5px; }
.tool span { font-size: 11.5px; color: var(--muted); line-height: 1.55; }

/* 记一笔弹层 */
.ps-form { padding: 4px 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.ps-form .input { width: 100%; }

@media (max-width: 760px) {
  .mgrid.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  table.adapt .hide-sm,
  table.adapt th.hide-sm { display: none; }
  table.adapt { font-size: 11.5px; }
  table.adapt td { padding: 7px 4px; }
  table.adapt td.tl b { font-size: 12px; }
  .tool-grid { grid-template-columns: 1fr; }
  .mkt-hero h3 { font-size: 15px; }
  .hold-strip { padding: 11px 12px; }
  .entry.has-foot .draft-link { font-size: 11.5px; }
}

/* ==================================================================
   我的（设置页版式）+ 交易偏好 + 盘中计算
   这一段是 2026-11 加的。类名统一带 me- / set- / cq- / ig- / fl- 前缀，
   避免和业务卡片类名撞车（历史上 .hold / .buy 就撞过）。
   ================================================================== */

/* ---------------------------------------------------------- 我的：身份卡 */
.me-hero {
  background: linear-gradient(158deg, #FFF9F9 0%, #fff 58%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 18px;
  margin-bottom: 14px;
}
.me-top { display: flex; align-items: center; gap: 12px; }
.me-ava {
  width: 46px; height: 46px; flex: none;
  border-radius: 14px;
  display: grid; place-items: center;
  background: linear-gradient(160deg, #B93044, #8E1F2E);
  color: #fff; font-size: 19px; font-weight: 700;
  box-shadow: 0 6px 16px -8px rgba(150, 26, 46, .65);
}
.me-id { display: flex; flex-direction: column; min-width: 0; }
.me-id b { font-size: 17px; letter-spacing: -.2px; }
.me-id span { font-size: 12px; color: var(--muted); }
.me-nums {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 14px; padding-top: 13px;
  border-top: 1px solid var(--line);
}
.me-nums a { text-align: center; color: inherit; }
.me-nums a + a { border-left: 1px solid var(--line); }
.me-nums b { display: block; font-size: 18px; font-variant-numeric: tabular-nums; }
.me-nums span { font-size: 11.5px; color: var(--muted); }

/* ---------------------------------------------------------- 我的：分组列表 */
.set-group {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  margin-bottom: 14px;
}
.set-head {
  padding: 12px 16px 7px;
  font-size: 12px; color: var(--muted);
  display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
}
.set-head span { font-size: 11.5px; opacity: .78; }
.set-row {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 13px 16px;
  background: #fff; border: 0; border-top: 1px solid #F6EFEE;
  text-align: left; font-size: 14.5px; color: var(--text);
  cursor: pointer; transition: background .12s;
}
.set-row:first-of-type { border-top: 0; }
.set-row:active { background: #FDF7F7; }
.set-row.dim { color: var(--muted); cursor: default; }
.set-k { flex: none; }
.set-v {
  margin-left: auto; color: var(--muted); font-size: 13px;
  max-width: 62%; text-align: right;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.set-chev { flex: none; color: #CBB8B6; font-size: 16px; line-height: 1; }

/* 退出登录：从底部大红块改成居中小字，降低误触 */
.btn.link-quiet {
  display: block; margin: 20px auto 6px;
  background: none; border: 0; box-shadow: none;
  color: var(--muted); font-size: 13.5px; padding: 10px 18px;
}
.btn.link-quiet:hover { background: none; color: var(--accent); }

.about-txt p { margin: 0 0 9px; font-size: 13px; line-height: 1.8; }
.about-txt p:last-child { margin-bottom: 0; }
.about-txt .muted { color: var(--muted); font-size: 12.5px; }

.dlg-fields { display: flex; flex-direction: column; gap: 10px; margin-bottom: 4px; }
.dlg-fields .fld { display: flex; flex-direction: column; gap: 5px; }
.dlg-fields .lb { font-size: 12px; color: var(--muted); }

.meta-link { margin-left: 8px; font-size: 12.5px; white-space: nowrap; }

/* ------------------------------------------- 今日信号：盘后体检 / 盘中计算 胶囊 */
/* 两个视图共用同一套策略与口径，做成并列标签；在手机上占满一行，一眼能看见 */
.seg {
  display: flex;
  gap: 4px;
  padding: 4px;
  margin: 0 0 14px;
  background: var(--accent-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
}
.seg-i {
  flex: 1 1 0;
  min-width: 0;
  padding: 9px 6px;
  text-align: center;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
  transition: background .18s ease, color .18s ease, box-shadow .18s ease;
}
.seg-i.on {
  background: var(--card);
  color: var(--accent);
  box-shadow: 0 1px 2px rgba(96, 30, 40, .07), 0 6px 16px -10px rgba(96, 30, 40, .38);
}
.seg-i:active { opacity: .82; }
@media (min-width: 900px) { .seg { max-width: 340px; } }

/* ---------------------------------------------------------- 盘中计算：结论卡 */
.calc-verdict {
  position: relative; overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  background: #fff;
  padding: 15px 18px 15px 21px;
  margin-bottom: 14px;
}
.calc-verdict::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: var(--muted);
}
.calc-verdict.buy::before { background: var(--up); }
.calc-verdict.sell::before { background: var(--down); }
.calc-verdict.hold::before { background: var(--warn); }
.calc-verdict.buy { background: linear-gradient(118deg, #FDF1F1, #fff 62%); }
.calc-verdict.sell { background: linear-gradient(118deg, #EEF8F3, #fff 62%); }
.calc-verdict.hold { background: linear-gradient(118deg, #FDF6E8, #fff 62%); }
.cv-top { display: flex; align-items: center; gap: 10px; }
.cv-label { font-size: 21px; font-weight: 750; letter-spacing: -.5px; }
.calc-verdict.buy .cv-label { color: var(--up); }
.calc-verdict.sell .cv-label { color: var(--down); }
.calc-verdict.hold .cv-label { color: var(--warn); }
.calc-verdict.wait .cv-label { color: var(--muted); }
.cv-time { margin-left: auto; font-size: 11.5px; color: var(--muted); }
.cv-strat { font-size: 13px; margin-top: 5px; }
.cv-tip { font-size: 12.5px; color: var(--muted); margin-top: 3px; line-height: 1.7; }
.cv-hold {
  margin-top: 10px; padding-top: 9px;
  border-top: 1px dashed var(--line);
  font-size: 12.5px; color: var(--muted);
}

.calc-warn {
  background: var(--warn-bg);
  border: 1px solid #F0E2C4;
  border-radius: 10px;
  padding: 10px 13px;
  margin-bottom: 14px;
}
.calc-warn p { margin: 0; font-size: 12.5px; color: #7A4F0C; line-height: 1.75; }
.calc-warn p + p { margin-top: 6px; }

/* ---------------------------------------------------------- 盘中计算：行情输入 */
.cq-id { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.cq-id b { font-size: 16px; }
.cq-id .code {
  font-size: 12px; color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.cq-phase {
  font-size: 11.5px; padding: 3px 9px; border-radius: 999px;
  background: #F4EDEB; color: var(--muted); flex: none;
}
.cq-phase.intraday { background: var(--accent-soft); color: var(--accent); }
.cq-phase.closed { background: #EEF8F3; color: var(--down); }
.cq-main { display: flex; align-items: flex-end; gap: 12px; margin: 12px 0 11px; }
.cq-main label { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.cq-main label span { font-size: 11.5px; color: var(--muted); }
.cq-main input {
  width: 100%; outline: none;
  font-size: 27px; font-weight: 700; letter-spacing: -.8px;
  padding: 5px 10px; border-radius: 10px;
  border: 1px solid #E8CFD2; background: #FFFBFB; color: var(--accent);
  font-variant-numeric: tabular-nums;
  -webkit-appearance: none; appearance: none;
}
.cq-main input:focus { border-color: var(--accent); box-shadow: 0 0 0 3.5px rgba(185, 48, 68, .12); }
.cq-chg { font-size: 15px; font-weight: 650; padding-bottom: 9px; font-variant-numeric: tabular-nums; }
.cq-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.cq-grid label { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cq-grid label span {
  font-size: 11px; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cq-grid input {
  width: 100%; padding: 7px 9px; font-size: 14px;
  border: 1px solid var(--line); border-radius: 8px; background: #fff;
  font-variant-numeric: tabular-nums; outline: none;
  -webkit-appearance: none; appearance: none;
}
.cq-grid input:focus { border-color: #B93044; box-shadow: 0 0 0 3px rgba(185, 48, 68, .1); }
.cq-foot { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.cq-foot .hint { flex: 1; min-width: 0; font-size: 11.5px; }

/* ---------------------------------------------------------- 盘中计算：翻转价 / 关键价位 */
.fl-row {
  display: flex; align-items: baseline; gap: 10px;
  padding: 10px 0; border-bottom: 1px dashed #F6EFEE;
}
.fl-row:last-of-type { border-bottom: 0; }
.fl-k { font-size: 13px; color: var(--muted); flex: none; }
.fl-v { margin-left: auto; text-align: right; font-size: 13px; }
.fl-v b { font-size: 16px; font-variant-numeric: tabular-nums; margin-right: 6px; }
.fl-v i { font-style: normal; font-size: 12px; }
.fl-row.none .fl-v { color: var(--muted); font-size: 12.5px; }

.lv-row {
  display: grid; grid-template-columns: 76px 1fr auto;
  gap: 3px 10px; align-items: baseline;
  padding: 9px 0; border-bottom: 1px dashed #F6EFEE;
}
.lv-row:last-of-type { border-bottom: 0; }
.lv-k { font-size: 13px; }
.lv-p { font-size: 14px; font-variant-numeric: tabular-nums; }
.lv-d { font-size: 12px; font-variant-numeric: tabular-nums; text-align: right; }
.lv-n { grid-column: 1 / -1; font-size: 11.5px; color: var(--muted); }

/* ---------------------------------------------------------- 盘中计算：指标 */
.ig + .ig { margin-top: 14px; padding-top: 12px; border-top: 1px solid #F6EFEE; }
.ig-h {
  display: flex; align-items: baseline; gap: 8px;
  font-size: 12.5px; font-weight: 650; color: var(--muted);
  margin-bottom: 8px;
}
.ig-h i { font-style: normal; font-size: 11.5px; font-weight: 500; }
.ig-h i.up { color: var(--up); }
.ig-h i.down { color: var(--down); }
.ig-items { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.ig-i {
  min-width: 0; padding: 7px 9px;
  background: #FDFAF9; border: 1px solid #F4EAE8; border-radius: 9px;
}
.ig-l { display: block; font-size: 11px; color: var(--muted); }
.ig-v { display: block; font-size: 14.5px; font-variant-numeric: tabular-nums; }
.ig-v.up { color: var(--up); }
.ig-v.down { color: var(--down); }
.ig-n {
  display: block; font-style: normal; font-size: 10.5px; color: var(--muted);
  margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

@media (max-width: 760px) {
  .cq-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ig-items { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .me-hero { padding: 16px; }
  .set-row { padding: 12px 14px; }
  .set-head { padding: 11px 14px 6px; }
  .cq-main input { font-size: 24px; }
  .cv-label { font-size: 19px; }
}

/* ================================================================== 讨论区
   三个房间 + 消息流 + 吸底输入栏。
   消息统一左对齐（不做左右气泡）：往上翻历史时两列来回跳，读起来累。
   自己发的只加浅红底和「我」标签，位置不变。 */
.chat-tabs {
  display: flex; gap: 4px; padding: 4px;
  background: #F6EDEC; border-radius: 11px; margin: 0 0 10px;
}
.chat-tabs .ct {
  flex: 1 1 0; min-width: 0;
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  padding: 8px 6px; border-radius: 8px; text-decoration: none;
  font-size: 13px; color: var(--muted); white-space: nowrap;
}
.chat-tabs .ct.on {
  background: #fff; color: var(--accent); font-weight: 650;
  box-shadow: 0 1px 2px rgba(96, 30, 40, .08);
}
.chat-tabs .ct-n {
  flex: none; min-width: 15px; height: 15px; padding: 0 4px;
  border-radius: 8px; background: var(--accent); color: #fff;
  font-size: 10px; font-weight: 700; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
}
.chat-tabs .ct-n[hidden] { display: none; }

.chat-rule { font-size: 11.5px; color: #8C7B7D; line-height: 1.75; margin: 0 2px 12px; }
.chat-offline {
  font-size: 12px; color: var(--warn); background: var(--warn-bg);
  border-radius: 8px; padding: 6px 10px; margin-bottom: 8px;
}
.chat-offline[hidden] { display: none; }

.chat-list { display: flex; flex-direction: column; gap: 1px; }
.chat-day { text-align: center; margin: 14px 0 8px; }
.chat-day span {
  font-size: 11px; color: #A29194; background: #F3EAE9;
  padding: 2px 9px; border-radius: 9px;
}
.cm { display: flex; gap: 9px; padding: 6px 0; }
.cm.merged { padding-top: 1px; }
.cm-ava {
  width: 30px; height: 30px; border-radius: 50%; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-size: 13px; font-weight: 700;
}
.cm-ava.ph { background: none; }
/* 右侧留固定 22px 给「⋯」：绝对定位压到正文上是这类界面的经典事故 */
.cm-main { flex: 1 1 auto; min-width: 0; position: relative; padding-right: 22px; }
.cm-head {
  display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap;
  margin-bottom: 2px;
}
.cm-head b { font-size: 12.5px; font-weight: 600; }
.cm-tag {
  font-size: 10px; line-height: 15px; padding: 0 5px; border-radius: 6px;
  color: var(--accent); background: var(--accent-soft);
}
.cm-tag.me { color: #6B5F61; background: #F2EDEC; }
.cm-time { font-size: 10.5px; color: #B0A2A4; margin-left: auto; }
.cm-body {
  font-size: 13.5px; line-height: 1.72;
  white-space: pre-wrap; overflow-wrap: anywhere;
}
/* inline-block 而不是 block：桌面上正文如果撑满整列，浅红底会变成一条横幅，
   看着像整行被选中；贴着文字宽度才像「一句自己说的话」。 */
.cm.mine .cm-body {
  display: inline-block; max-width: 100%;
  background: #FDF3F3; border-radius: 2px 9px 9px 9px;
  padding: 6px 9px; margin-top: 1px;
}
.cm-quote {
  font-size: 11.5px; color: #8C7B7D; background: #F7F1F0;
  border-left: 2px solid #E3CFCF; border-radius: 0 6px 6px 0;
  padding: 3px 8px; margin-bottom: 4px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cm-stock {
  display: inline-flex; align-items: center; gap: 5px;
  margin-top: 6px; padding: 4px 9px; border-radius: 8px;
  background: #FFF8F5; border: 1px solid #F0DDD8;
  font-size: 12px; color: var(--text); text-decoration: none;
}
.cm-stock b { font-variant-numeric: tabular-nums; }
.cm-stock i { font-style: normal; font-size: 11px; color: var(--accent); }
.cm-more {
  position: absolute; right: -2px; top: 0;
  border: 0; background: none; color: #B7ABAC;
  font-size: 15px; line-height: 1; padding: 2px 4px; cursor: pointer;
  opacity: 0; transition: opacity .15s;
}
.cm:hover .cm-more, .cm-more:focus { opacity: 1; }
@media (hover: none) { .cm-more { opacity: .55; } }
.cm-del { padding-left: 39px; }
.cm-del-t { font-size: 12px; color: #A29194; font-style: italic; }

.chat-more-btn {
  display: block; margin: 2px auto 12px; padding: 6px 14px;
  border: 1px solid var(--line); border-radius: 14px; background: #fff;
  font-size: 12px; color: var(--muted); cursor: pointer;
}
.chat-empty {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 44px 12px; text-align: center;
}
.chat-empty b { font-size: 14px; }
.chat-empty span { font-size: 12.5px; color: var(--muted); line-height: 1.7; }
.chat-empty .btn { margin-top: 8px; }

/* 吸底输入栏：fixed 贴住屏幕底部，而不是页面流里的一张 sticky 卡片。
   sticky 有两个治不好的毛病：消息少时它悬在页面中间像加载到一半；
   键盘弹起时布局视口不缩，它被压在键盘底下。fixed 之后位置由
   --kb（JS 读 visualViewport 算出的键盘高度）决定，两件事一起解决。 */
.chat-dock {
  position: fixed; z-index: 26;
  left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 1080px;
  padding: 10px 16px 0;
  bottom: calc(var(--dock-base, 0px) + var(--dock-gap, 14px));
  bottom: calc(max(var(--kb, 0px), var(--dock-base, 0px)) + var(--dock-gap, 14px));
  /* 内容从栏底下滚过时不至于露出半行字；两端渐隐，看着是「滚没了」 */
  background: linear-gradient(to top, var(--bg) 58%, rgba(250, 247, 246, 0));
  pointer-events: none;          /* 只让真正的控件可点，四周空白别挡住列表 */
}
.chat-dock > * { pointer-events: auto; }

.chat-compose {
  margin: 0; padding: 8px;
  background: rgba(255, 253, 253, .97);
  border: 1px solid var(--line); border-radius: 13px;
  box-shadow: 0 10px 28px -20px rgba(96, 30, 40, .5);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
}
.chat-box { display: flex; align-items: flex-end; gap: 7px; }
.chat-att {
  width: 32px; height: 32px; flex: none; border-radius: 9px;
  border: 1px solid var(--line); background: #FFFCFC;
  color: var(--accent); font-size: 15px; font-weight: 700; line-height: 1;
  cursor: pointer;
}
#chat-input {
  flex: 1 1 auto; min-width: 0; resize: none; overflow-y: auto;
  max-height: 108px; padding: 7px 9px;
  border: 1px solid var(--line); border-radius: 9px; background: #fff;
  font-family: inherit; font-size: 13.5px; line-height: 1.6; color: var(--text);
}
#chat-input:focus { outline: none; border-color: #E0BFC3; }
.chat-send { flex: none; min-height: 32px; padding: 0 14px; font-size: 13px; }
.chat-tip { font-size: 10.5px; color: #B0A2A4; margin: 5px 2px 0; }
@media (hover: none) { .chat-tip { display: none; } }
.chat-att-line, .chat-quote {
  display: flex; align-items: center; gap: 6px;
  font-size: 11.5px; color: var(--muted);
  background: #F8F2F1; border-radius: 8px; padding: 5px 8px; margin-bottom: 6px;
}
.chat-att-line[hidden], .chat-quote[hidden] { display: none; }
.chat-quote > span { flex: 1 1 auto; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-att-line > button, .chat-quote > button {
  flex: none; border: 0; background: none; color: #A29194;
  font-size: 15px; line-height: 1; padding: 0 2px; cursor: pointer;
}
.ca-chip { background: #fff; border: 1px solid #EFE0DC; border-radius: 6px; padding: 1px 7px; }
.ca-tip { color: #A29194; }
.chat-lock {
  margin: 0; padding: 11px 12px; text-align: center;
  font-size: 12.5px; color: #8C7B7D;
  background: #F7F1F0; border: 1px dashed #E3D3D0; border-radius: 11px;
}
.chat-more {
  position: fixed; z-index: 27;
  left: 50%; transform: translateX(-50%);
  bottom: calc(var(--dock-base, 0px) + 82px);
  bottom: calc(max(var(--kb, 0px), var(--dock-base, 0px)) + 82px);
  width: fit-content; margin: 0;
  padding: 5px 13px; border-radius: 14px;
  background: var(--accent); color: #fff; font-size: 12px;
  box-shadow: 0 8px 18px -10px rgba(150, 26, 46, .8); cursor: pointer;
}
.chat-more[hidden] { display: none; }

/* 长按/右键的替代：底部动作单 */
.chat-sheet { padding: 16px 16px 12px; }
.chat-sheet h3 {
  margin: 0 0 8px; font-size: 12.5px; font-weight: 500; color: var(--muted);
}
.sheet-btn {
  display: block; width: 100%; text-align: left; cursor: pointer;
  padding: 12px 8px; border: 0; border-top: 1px solid var(--line);
  background: none; font-size: 14px; color: var(--text); font-family: inherit;
}
.sheet-btn.danger { color: var(--accent); }
.sheet-btn.quiet { color: var(--muted); text-align: center; }

@media (max-width: 760px) {
  /* 手机底部有标签栏，输入栏要落在它正上方 */
  :root { --dock-base: calc(var(--tabbar-h) + var(--safe-b)); --dock-gap: 6px; }
  .chat-dock { max-width: none; padding: 8px 12px 0; }
  .chat-tabs .ct { font-size: 12.5px; padding: 8px 4px; }
  .cm-body { font-size: 14px; }
  /* 输入框必须 ≥16px，否则 iOS/微信点进去会把整页放大，看着像被键盘顶乱 */
  #chat-input { font-size: 16px; }
  .cm-main { padding-right: 20px; }
}
@media (max-width: 360px) {
  .home-bar .quota-chip, .home-bar .mkt-chip, .home-bar .chat-chip {
    font-size: 11.5px; padding: 0 6px; gap: 3px;
  }
  .quota-chip b { font-size: 14px; }
  .quota-chip > span { font-size: 10.5px; }
  .chat-chip .cn { min-width: 15px; height: 15px; font-size: 9.5px; }
}

/* 消息少的时候页面也要撑满一屏（备案号才会留在折叠线以下），
   同时给吸底输入栏让出高度 —— border-box 下 padding 算在 min-height 里，
   不会多出一截空白滚动。dvh 是给手机地址栏用的，老浏览器退回 vh。 */
.chat-page {
  display: flex; flex-direction: column;
  padding-bottom: calc(var(--dock-h, 68px) + var(--kb, 0px));
  min-height: calc(100vh - 226px);
}
.chat-page .chat-list { flex: 1 1 auto; }
/* 空房间时把「这里还很安静」放在剩下的空档中间，别挤在标题下面 */
.chat-empty { margin: auto 0; }
@media (max-width: 760px) {
  .chat-page { --dock-h: 72px; min-height: calc(100vh - 262px); }
}
@supports (height: 100dvh) {
  .chat-page { min-height: calc(100dvh - 226px); }
  @media (max-width: 760px) { .chat-page { min-height: calc(100dvh - 262px); } }
}
