/* 深色交易终端风格 */
:root {
  --bg: #0f1218; --panel: #171b24; --panel2: #1e2330; --line: #2a3040;
  --text: #d6dae3; --muted: #8590a6; --accent: #2563eb;
  --up: #26a69a; --down: #ef5350; --warn: #f0b429;
  /* --up / --down 是固定的「好 / 坏」色（对勾、违规、错误）；价格方向（涨跌、盈亏、买卖）用 --gain / --loss，
     可在「交易设置 → 涨跌颜色」里对调（js/updown.js 给 <html> 或某一行加 data-ud）。默认 = 绿涨红跌 */
  --gain: #26a69a; --loss: #ef5350; --gain-fg: #7fd6cb; --loss-fg: #ff9c9a;
  --edge-tint: #ad1cf3;
  color-scheme: dark; /* 原生控件 / 滚动条也走暗色，避免 macOS、Windows 上出现亮色滚动条 */
}
[data-ud="gu"] { --gain: #26a69a; --loss: #ef5350; --gain-fg: #7fd6cb; --loss-fg: #ff9c9a; }
[data-ud="ru"] { --gain: #ef5350; --loss: #26a69a; --gain-fg: #ff9c9a; --loss-fg: #7fd6cb; }
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--bg); color: var(--text); font: 13px/1.5 -apple-system, "Segoe UI", "Microsoft YaHei", sans-serif; display: flex; flex-direction: column; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
h2 { font-size: 15px; margin: 0 0 8px; }
h3 { font-size: 13px; margin: 8px 0 6px; color: var(--muted); font-weight: 600; display: flex; justify-content: space-between; align-items: center; }

#topbar { display: flex; align-items: center; gap: 16px; padding: 0 14px; height: 40px; flex: none; z-index: 20; background: var(--panel); border-bottom: 1px solid var(--line); position: relative; }
.brand { font-weight: 700; letter-spacing: 1px; color: var(--text); text-decoration: none; }
.brand:hover { color: var(--sh-text-hi, #fff); }
.statusline { color: var(--muted); flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.statusline b { color: var(--text); font-weight: 600; }
.statusline .sep { margin: 0 6px; opacity: .5; }
.toast { position: absolute; right: 14px; top: 44px; z-index: 50; background: var(--panel2); border: 1px solid var(--line); padding: 2px 10px; border-radius: 4px; max-width: 50%; }
.toast.warn { border-color: var(--warn); color: var(--warn); }
.errbar { background: var(--sh-danger-bg, #5b1f22); color: var(--sh-danger-fg, #ffd5d5); padding: 6px 14px; cursor: pointer; }
/* 隐私政策提示条：在顶栏下面占一行，不浮在内容上（不挡操作） */
.privacy-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; flex: none; padding: 6px 14px; background: var(--panel2); border-bottom: 1px solid var(--line); color: var(--text); font-size: 12px; }
.privacy-bar .pb-text { flex: 1 1 260px; min-width: 0; }
.privacy-bar .pb-actions { display: flex; align-items: center; gap: 12px; flex: none; margin-left: auto; }
.privacy-bar a { text-decoration: underline; text-underline-offset: 2px; white-space: nowrap; }
.privacy-bar button { flex: none; }
/* 注册时同意《隐私政策》：不预先勾选 */
.reg-privacy { display: flex; flex-direction: column; gap: 6px; }
label.reg-privacy-label { align-items: flex-start; gap: 8px; font-size: 13px; line-height: 1.5; cursor: pointer; }
label.reg-privacy-label input { flex: none; width: 18px; height: 18px; margin: 1px 0 0; padding: 0; accent-color: var(--accent); cursor: pointer; }
.reg-privacy-label a { text-decoration: underline; text-underline-offset: 2px; }
.reg-privacy .login-err { margin: 0; }
@media (max-width: 760px) {
  .privacy-bar { padding: 6px 10px; }
  .privacy-bar a, .privacy-bar button { display: inline-flex; align-items: center; min-height: 36px; }
}

button, select, input { font: inherit; color: var(--text); background: var(--panel2); border: 1px solid var(--line); border-radius: 4px; padding: 4px 8px; }
button { cursor: pointer; }
button:hover:not(:disabled) { border-color: var(--accent); }
button:disabled { opacity: .4; cursor: not-allowed; }
button.primary { background: var(--accent); border-color: var(--accent); color: var(--sh-on-fill, #fff); }
button.buy { color: var(--gain); } button.sell { color: var(--loss); }
button.danger { background: var(--sh-danger-fill, #6b2226); border-color: var(--sh-danger-line, #8f2f35); color: var(--sh-on-fill, #fff); }
button.ghost { background: transparent; }
button.small { padding: 0 6px; font-size: 12px; }
button.big { width: 100%; padding: 8px; margin-top: 8px; }
label { display: flex; flex-direction: column; gap: 2px; color: var(--muted); font-size: 12px; }
label.inline { flex-direction: row; align-items: center; gap: 4px; color: var(--text); }
/* 勾选框那一行：只有勾选框和文字能点，label 不占满整行（需求 37 D9）；挤在 .row 里的也不再被拉满 */
label.inline:not(.facet), label.attach-chk { display: inline-flex; width: fit-content; max-width: 100%; }
.row > label.inline { flex: none; }
input[type=number], input[type=search] { width: 100%; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; }
.row { display: flex; gap: 6px; align-items: flex-end; margin: 6px 0; flex-wrap: wrap; }
.row > button, .row > label { flex: 1; }
.row.between { justify-content: space-between; align-items: center; }
.row.between > div { display: flex; gap: 6px; }
.row.between button { flex: none; }
.grid2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
.grid2.tight { gap: 6px; margin-top: 6px; }

/* 选题 */
.picker { flex: 1; min-height: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 12px; overflow: auto; align-content: start; }
.picker .wide { grid-column: 1 / -1; }
.facet-list { max-height: 260px; overflow: auto; margin: 8px 0; border: 1px solid var(--line); border-radius: 4px; }
.facet { display: flex; gap: 8px; padding: 3px 8px; cursor: pointer; align-items: center; }
.facet:hover { background: var(--panel2); }
.facet .n { margin-left: auto; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { padding: 2px 10px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; user-select: none; }
.chip.on { background: var(--accent); border-color: var(--accent); color: var(--sh-on-fill, #fff); }
.tbl-scroll { overflow-x: auto; }
.ex-table th { color: var(--muted); font-weight: 600; font-size: 12px; white-space: nowrap; cursor: help; }
.ex-table td, .ex-table th { padding: 4px 8px; text-align: right; white-space: nowrap; }
.ex-table td:first-child, .ex-table th:first-child { text-align: left; }
.ex-table tbody tr { cursor: pointer; }
.ex-table tbody tr:hover td { background: var(--panel2); }
.ex-table tbody tr.empty { cursor: default; }
.ex-table tbody tr.empty:hover td { background: none; }
.ex-table tbody tr.empty td { text-align: left; padding: 14px 8px; white-space: normal; }
.ex-table .id { font-family: Consolas, monospace; color: var(--muted); }
.ex-table .tag { font-size: 11px; color: var(--warn); }
.ex-table .ctx-ok { font-size: 11px; color: var(--muted); }
.pager { justify-content: center; }
.pager > button { flex: none; }

/* 练习 */
.practice { flex: 1; display: grid; grid-template-columns: 1fr 320px; gap: 10px; padding: 10px; min-height: 0; }
.chart-col { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.chart-toolbar { display: flex; gap: 14px; align-items: center; padding: 4px 8px; background: var(--panel); border: 1px solid var(--line); border-bottom: 0; border-radius: 6px 6px 0 0; }
.clock { margin-left: auto; color: var(--muted); }
.legend { color: var(--muted); display: inline-flex; align-items: center; gap: 4px; }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 2px; }
.sw.ext { background: var(--sh-sw-ext, #7b8aa8); }
.chart { flex: 1; min-height: 0; border: 1px solid var(--line); border-radius: 0 0 6px 6px; background: var(--panel); }
.side { overflow-y: auto; display: flex; flex-direction: column; gap: 8px; min-height: 0; padding-right: 2px; }
/* 桌面：结束本题 / 换题固定在侧栏底部，900px 高的窗口不用滚到底也能点到（≤1000px 改为底部操作条） */
.side-actions { position: sticky; bottom: 0; z-index: 3; display: flex; gap: 6px; align-items: stretch;
                margin-top: auto; padding: 8px 0 6px; background: var(--panel); border-top: 1px solid var(--line); }
.side-actions > button { flex: 1; min-width: 0; margin-top: 0; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; margin: 0; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.pos { color: var(--gain); } .neg { color: var(--loss); }
/* 过程检查的「好 / 坏」（设了止损 / 没设）：不随涨跌颜色变 */
.t-ok { color: var(--up); } .t-bad { color: var(--down); }
.tbl { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.tbl td, .tbl th { padding: 2px 4px; border-bottom: 1px solid var(--line); text-align: left; }
.tbl td:last-child { text-align: right; }
.hint { font-size: 12px; margin: 0; }

/* 复盘 */
.review { position: fixed; inset: 0; top: 40px; background: var(--sh-scrim, rgba(8,10,14,.92)); overflow: auto; padding: 16px; z-index: 5; }
.review-box { max-width: 1000px; margin: 0 auto; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 16px; }
.review-meta { color: var(--muted); margin-bottom: 8px; }
.review-meta b { color: var(--text); }
/* 游客的题结束后：复盘顶部的「这次复盘还没保存」横幅（需求 26 D9）。桌面：左边标题 + 说明，右边按钮；手机：紧凑，按钮另起一行 */
.save-banner { margin: 0 0 10px; padding: 8px 12px; border: 1px solid var(--sh-sel-line, #2f4f86); border-left: 4px solid var(--accent); border-radius: 6px; background: linear-gradient(180deg, var(--sh-sel-bg, #19223a), var(--sh-panel-deep, #141822)); }
.save-banner[data-kind="guest"] { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "head actions" "body actions" "msg msg"; column-gap: 16px; align-items: center; }
.save-banner .save-head { grid-area: head; display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }
.save-banner .save-title { color: var(--text); overflow-wrap: anywhere; }
.save-banner .save-body { grid-area: body; margin: 2px 0 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.save-banner .save-msg { grid-area: msg; margin: 6px 0 0; color: var(--warn); font-size: 13px; line-height: 1.45; }
.save-banner .save-actions { grid-area: actions; display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px 14px; }
.save-banner .save-actions button { min-height: 36px; }
.save-banner .save-actions .linklike { background: none; border: 0; padding: 0 2px; color: var(--accent); text-decoration: underline; }
.save-banner .save-x { display: none; background: none; border: 0; padding: 0; min-width: 32px; min-height: 32px; color: var(--muted); font-size: 22px; line-height: 1; }
.save-banner[data-kind="guest"] .save-x { display: inline-flex; align-items: center; justify-content: center; }
.save-banner[data-kind="late"] { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; }
.save-banner .save-line { margin: 0; color: var(--text); flex: 1 1 14em; }
.save-banner[data-kind="late"] .save-msg { flex: 1 1 100%; margin: 0; }
@media (max-width: 600px) {
  .save-banner { margin-bottom: 8px; padding: 4px 10px 6px; }
  .save-banner[data-kind="guest"] { grid-template-columns: minmax(0, 1fr); grid-template-areas: "head" "body" "actions" "msg"; }
  .save-banner .save-body { margin-top: 0; font-size: 12px; line-height: 1.4; }
  .save-banner .save-actions { justify-content: flex-start; gap: 0 12px; margin-top: 4px; }
  .save-banner .save-actions button { min-height: 32px; }
  .save-banner .save-actions button.primary { flex: 0 0 auto; padding: 2px 12px; }
  .save-banner .save-x { min-height: 28px; }
}
.mk-trial-note { margin: 0 0 8px; }
/* 复盘「标的」后面的 ⓘ：说明名称是当前名称（docs/26）；悬停有原生提示，点按展开 .sec-note-text（触屏没有悬停） */
.sec-note-btn { background: none; border: 0; padding: 0 4px; min-width: 24px; min-height: 24px; margin: 0; color: var(--muted); font: inherit; font-weight: 400; cursor: help; line-height: 1; }
.sec-note-btn:hover, .sec-note-btn:focus-visible { color: var(--text); }
.sec-note-text { font-size: 12px; margin-top: 2px; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; margin: 8px 0; }
.stat { background: var(--panel2); border-radius: 4px; padding: 6px 10px; }
.stat .k { color: var(--muted); font-size: 12px; } .stat .v { font-size: 16px; font-weight: 600; }
.eq-chart { height: 200px; border: 1px solid var(--line); border-radius: 4px; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.floating { position: fixed; right: 340px; top: 50px; z-index: 4; }

@media (max-width: 1000px) {
  /* 练习页的紧凑布局（图表定高 + 底部操作条）集中在文件末尾，便于覆盖这里的基线规则 */
  .picker, .cols { grid-template-columns: minmax(0, 1fr); }   /* 不用 1fr：里面有不能折行的东西时轨道会撑过屏宽，右边被截（需求 37 QA） */
  .floating { right: 14px; }
  /* 下拉框 / 输入框按内容的固有宽度撑开（选项文字很长时比屏幕还宽），手机上不能超出所在的框 */
  .picker select, .picker input:not([type="checkbox"]):not([type="radio"]) { max-width: 100%; min-width: 0; box-sizing: border-box; }
  .picker > * { min-width: 0; }
  .setup-pick { max-width: 100%; }
}

/* ---- 壳：页面容器、导航、用户区 ---- */
.page-practice { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.page-ext { flex: 1; min-height: 0; overflow: auto; padding: 12px; }
.nav { display: flex; gap: 4px; }
.nav a { color: var(--muted); text-decoration: none; padding: 4px 10px; border-radius: 4px; }
.nav a:hover { color: var(--text); background: var(--panel2); }
.nav a.on { color: var(--sh-on-fill, #fff); background: var(--accent); }
.userbox { display: flex; align-items: center; gap: 8px; }
.userbox b { color: var(--text); }
.userbox .ub-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* 手机横屏（宽 ≤1000、高度不够两行顶栏）：长用户名先截断，不把整页撑出横向滚动条（需求 28 D5） */
@media (max-width: 1000px) { .userbox .ub-name { max-width: 5em; } }
a { color: var(--sh-link, #6aa5ff); }

/* 页签 / 分段按钮 */
.tabs { display: inline-flex; gap: 0; }
.tab { border-radius: 0; margin-left: -1px; padding: 3px 12px; background: var(--panel2); }
.tab:first-child { border-radius: 4px 0 0 4px; margin-left: 0; }
.tab:last-child { border-radius: 0 4px 4px 0; }
.tab.on { background: var(--accent); border-color: var(--accent); color: var(--sh-on-fill, #fff); position: relative; }
.tf-group .tab { padding: 1px 9px; font-size: 12px; }

/* 登录弹窗 */
.modal { position: fixed; inset: 0; background: var(--sh-scrim, rgba(8,10,14,.75)); z-index: 100; display: flex; align-items: center; justify-content: center; }
.modal-box { width: 320px; max-width: calc(100vw - 32px); background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.login-err { color: var(--sh-danger-fg, #ffb4b4); background: var(--sh-danger-bg, #5b1f22); padding: 4px 8px; border-radius: 4px; }

/* 选题：周期与叠加形态 */
.hz-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.overlay-list { display: flex; flex-wrap: wrap; gap: 6px 14px; max-height: 120px; overflow: auto; }
.overlay-list .grp { width: 100%; color: var(--muted); font-size: 11px; }
.overlay-list label.inline { cursor: pointer; }

/* 图表：信号图例与提示 */
.chart-wrap { position: relative; flex: 1; min-height: 360px; display: flex; flex-direction: column; }
.sig-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; padding: 3px 8px; background: var(--panel); border: 1px solid var(--line); border-bottom: 0; color: var(--muted); font-size: 12px; }
.sig-legend .g { font-size: 13px; margin-right: 3px; }
.sig-tip { position: absolute; z-index: 6; pointer-events: none; background: var(--panel2); border: 1px solid var(--line); border-radius: 4px; padding: 3px 8px; font-size: 12px; max-width: 220px; }
/* 拖动挂单价线 / 右侧价签时的浮动提示：买绿卖红，与图上价格线同色 */
.drag-tip { position: absolute; z-index: 7; pointer-events: none; background: var(--panel2); border: 1px solid var(--line); border-radius: 4px; padding: 3px 8px; font-size: 12px; white-space: nowrap; transform: translate(-50%, -160%); box-shadow: 0 2px 10px var(--sh-shadow, rgba(0, 0, 0, .45)); }
.drag-tip.buy { border-color: var(--gain); color: var(--gain-fg); }
.drag-tip.sell { border-color: var(--loss); color: var(--loss-fg); }
.drag-tip.be-tip { white-space: normal; width: max-content; max-width: 240px; text-align: left; border-color: var(--sh-orange, #f5a623); }
.kv .be-row { cursor: pointer; }
.kv .be-row:is(dt) { text-decoration: underline dotted; text-underline-offset: 3px; }
.kv dd.be-note { grid-column: 1 / -1; text-align: left; font-size: 12px; color: var(--muted); }
.review-meta a { margin-right: 14px; }

/* 窄屏顶栏（两行 grid）见文件末尾的 @media (max-width: 760px) */

/* ---- 易用性（docs/12 §3.1） ---- */
.small-text { font-size: 12px; font-weight: 400; }
kbd { display: inline-block; padding: 0 4px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 3px; background: var(--panel2); font: 11px/1.4 Consolas, monospace; color: var(--text); }
.hint { line-height: 1.5; }
p.hint { margin: 2px 0 6px; }

/* 顶栏：忙碌指示与帮助 */
.busy { display: inline-flex; align-items: center; gap: 6px; color: var(--warn); font-size: 12px; white-space: nowrap; }
.spin { width: 11px; height: 11px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: tt-spin .7s linear infinite; }
@keyframes tt-spin { to { transform: rotate(360deg); } }
.help-btn { width: 24px; height: 24px; padding: 0; border-radius: 50%; font-weight: 700; flex: none; }
/* 语言切换（js/i18n.js，docs/24）：显示「另一种」语言 */
.lang-btn { height: 24px; min-width: 40px; padding: 0 8px; font-weight: 600; flex: none; }
/* 英文模式下静态文字译完前先不显示，避免闪一下中文（i18n.js 最多 1.5 秒后移除） */
html.i18n-wait body { visibility: hidden; }

/* 选题：怎么练、开始区、高级设置 */
.howto { border-color: var(--sh-sel-line, #2f4f86); background: linear-gradient(180deg, var(--sh-sel-bg, #19223a), var(--panel)); }
.howto h2 { margin: 0; }
.steps { margin: 6px 0 0; padding-left: 20px; display: grid; gap: 4px; }
.steps li { line-height: 1.6; }
.steps .muted { display: block; font-size: 12px; }
.start-row { display: flex; gap: 14px; align-items: center; margin: 10px 0 4px; flex-wrap: wrap; }
.start-btn { width: auto; min-width: 180px; margin: 0; font-size: 15px; padding: 10px 20px; flex: none; }
.start-info { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 220px; }
.pick-summary b { color: var(--text); }
.adv { margin-top: 8px; }
.adv > summary { cursor: pointer; color: var(--muted); user-select: none; padding: 2px 0; }
.adv > summary:hover { color: var(--text); }
.adv[open] > summary { margin-bottom: 6px; }
.adv-grid { gap: 10px 16px; }
/* 交易卡里的挂单区（需求 31：止损 / 止盈并进挂单，不再折叠） */
.pend-box { margin-top: 10px; border-top: 1px solid var(--line); padding-top: 8px; }
.pend-title { margin: 0 0 4px; font-size: 13px; font-weight: 600; color: var(--muted); display: flex; align-items: center; gap: 2px; }
/* ⓘ 小提示（需求 31 D11 / D12）：桌面悬停弹出，手机点一下弹出、点别处消失；交易面板里的说明都用它，不写成大段文字 */
.lbl { display: flex; align-items: center; gap: 2px; }
.info { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; border-radius: 50%;
        color: var(--muted); font-size: 14px; font-weight: 400; line-height: 1; cursor: help; user-select: none; -webkit-tap-highlight-color: transparent; }
.info:hover, .info.open, .info:focus-visible { color: var(--text); outline: none; }
.info-pop { display: none; position: absolute; z-index: 40; top: calc(100% + 6px); left: -8px; width: 260px; max-width: calc(100vw - 16px); box-sizing: border-box;
            padding: 8px 10px; background: var(--panel2); border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 4px 14px var(--sh-shadow, rgba(0, 0, 0, .5));
            color: var(--text); font-size: 12px; font-weight: 400; line-height: 1.5; text-align: left; white-space: normal; cursor: auto; }
.info.open > .info-pop { display: block; }
@media (hover: hover) { .info:hover > .info-pop { display: block; } }
@media (pointer: coarse) { .info { width: 28px; height: 28px; font-size: 18px; } }
/* 图上委托单的「×」（需求 31 D14）：有委托时 #chart 右边让出一条 28px 的窄道，每张委托在价签旁边有一个 ×；点击区域 28×28 */
.ord-x { display: none; position: absolute; right: 0; bottom: 0; width: 28px; z-index: 6; overflow: hidden; background: var(--panel);
         border: 1px solid var(--line); border-left: 0; border-radius: 0 0 6px 0; box-sizing: border-box; }
.chart-wrap.has-ordx > .ord-x { display: block; }
.chart-wrap.has-ordx > .chart { margin-right: 28px; border-radius: 0 0 0 6px; }
.ord-x-btn { position: absolute; left: 0; width: 28px; height: 28px; padding: 0; display: flex; align-items: center; justify-content: center;
             background: transparent; border: 0; cursor: pointer; }
.ord-x-btn > span { display: flex; align-items: center; justify-content: center; width: 16px; height: 16px; border: 1px solid currentColor; border-radius: 50%;
                    font-size: 13px; line-height: 1; }
.ord-x-btn:hover > span, .ord-x-btn:focus-visible > span { background: var(--sh-hover-veil, rgba(255, 255, 255, .18)); }
.ord-x-btn:hover { background: transparent; }
.adv-grid .hint { font-size: 11px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.facet .zh { color: var(--text); }
.facet .en { color: var(--muted); font-size: 11px; margin-left: 4px; }

/* 练习：前一日上下文、风险提示 */
.sw.ctx { background: var(--sh-sw-ctx, #4a5468); opacity: .7; }
.chart-toolbar { flex-wrap: wrap; row-gap: 2px; }
.risk-line { margin-top: 6px; padding: 4px 8px; border-radius: 4px; background: var(--panel2); font-size: 12px; }
.risk-line.warn { color: var(--warn); border: 1px solid var(--sh-warn-line, rgba(240,180,41,.4)); }
.chart { cursor: crosshair; }

/* 复盘：过程检查 */
.process { margin: 8px 0 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--sh-panel-deep, #141822); }
.process h3 { margin-top: 0; justify-content: flex-start; gap: 10px; }
.trades-line { margin: 4px 0 2px; font-weight: 600; }
.trades-line:empty { display: none; }
.wb-line { margin: 4px 0 8px; padding: 6px 10px; border-radius: 4px; background: var(--panel2); }
.wb-line.in { border-left: 3px solid var(--warn); }
.wb-line.out { border-left: 3px solid var(--up); }
.flags { margin: 0 0 8px; padding: 0; list-style: none; display: grid; gap: 4px; }
.flags li { padding: 4px 10px; border-radius: 4px; background: var(--sh-tint-down-soft, rgba(239,83,80,.12)); border-left: 3px solid var(--down); }
.flags li .code { color: var(--down); font-weight: 600; margin-right: 6px; }
.ok-line { padding: 4px 10px; border-radius: 4px; background: var(--sh-tint-up-soft, rgba(38,166,154,.12)); border-left: 3px solid var(--up); margin-bottom: 8px; }
/* 每笔盈亏表（js/trips.js，需求 20）：主表 8 列，每行的详情在行下面；宽度 < 640px 改成每笔一张卡片（表格和卡片同时在 DOM 里，CSS 切换） */
.rt-wrap { margin-top: 6px; }
.rt-table th { color: var(--muted); font-weight: 600; font-size: 12px; white-space: nowrap; }
.rt-table td, .rt-table th { text-align: right; padding: 4px 6px; white-space: nowrap; }
.rt-table td:first-child, .rt-table th:first-child, .rt-table td.rt-mood, .rt-table th.rt-mood { text-align: left; }
.rt-table td.rt-mood { white-space: normal; min-width: 8em; }
.rt-all { margin-left: 6px; padding: 0 8px; min-height: 22px; font-size: 12px; font-weight: 400; line-height: 20px; }
.rt-exp { display: inline-flex; align-items: center; gap: 4px; min-height: 28px; padding: 2px 6px 2px 2px; background: transparent; border-color: transparent; color: inherit; font: inherit; }
.rt-exp:hover { background: var(--panel2); }
.rt-caret { display: inline-block; flex: none; width: 1em; color: var(--muted); font-size: 11px; transition: transform .12s; }
[aria-expanded="true"] > .rt-caret, [aria-expanded="true"] .rt-caret { transform: rotate(90deg); }
.rt-table tr.rt-row.open td { border-bottom-color: transparent; }
.rt-table tr.rt-detail td { padding: 0 8px 10px 28px; text-align: left; white-space: normal; }
.rt-det { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 6px 18px; margin: 0; font-size: 13px; }
.rt-kv { min-width: 0; }
.rt-kv dt { color: var(--muted); font-size: 12px; }
.rt-kv dd { margin: 0; overflow-wrap: anywhere; }
.rt-full { grid-column: 1 / -1; }
.rt-note { color: var(--muted); font-size: 12px; line-height: 1.5; }
.rt-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.rt-chip { padding: 1px 9px; border: 1px solid var(--down); border-radius: 10px; background: var(--sh-tint-down-faint, rgba(239, 83, 80, .08)); color: var(--down); font-size: 12px; cursor: help; }
.rt-cards-bar, .rt-cards { display: none; }
@media (max-width: 639px) {
  .rt-tbl-box { display: none; }
  .rt-cards-bar { display: flex; justify-content: flex-end; margin: 0 0 6px; }
  .rt-cards { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
  .rt-card { min-width: 0; border: 1px solid var(--line); border-radius: 6px; background: var(--panel2); }
  .rt-card-btn { display: block; width: 100%; min-height: 44px; padding: 8px 12px; border: 0; border-radius: 6px; background: transparent; color: inherit; font: inherit; text-align: left; }
  .rt-card-btn > span { display: block; overflow-wrap: anywhere; }
  /* 需求 25 D8：一段（含它后面的「 ·」）整个不断开；父级的 overflow-wrap: anywhere 不能管到它 */
  .rt-seg { white-space: nowrap; overflow-wrap: normal; word-break: keep-all; }
  .rt-card-l1 { font-weight: 600; font-variant-numeric: tabular-nums; }
  /* 第 2、3 行是次要信息，12px：375px 下「风险 0.09% · 最大浮盈 +12.35R · 效率 100%」中英文都放得进一行（需求 24 D3） */
  .rt-card-l2, .rt-card-l3 { margin-top: 2px; padding-left: 13px; color: var(--muted); font-size: 12px; line-height: 1.5; }
  .rt-card-l2 { font-variant-numeric: tabular-nums; }
  .rt-card-l1 .rt-caret { margin-right: 0; }
  .rt-card-det { padding: 8px 12px 10px; border-top: 1px solid var(--line); }
  .rt-card-det .rt-det { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 14px; }
  .rt-all { min-height: 36px; padding: 0 12px; }
}
.chk-ok { color: var(--up); } .chk-bad { color: var(--down); } .chk-mid { color: var(--warn); }

/* 操作引导浮层 */
.tour { position: fixed; inset: 0; z-index: 90; }
.tour-hole { position: fixed; border-radius: 6px; box-shadow: 0 0 0 9999px var(--sh-scrim, rgba(5,7,12,.72)); border: 2px solid var(--accent); transition: all .2s ease; pointer-events: none; }
.tour-box { position: fixed; width: 320px; max-width: calc(100vw - 24px); background: var(--panel); border: 1px solid var(--accent); border-radius: 8px; padding: 12px 14px; box-shadow: 0 8px 30px var(--sh-shadow, rgba(0,0,0,.5)); }
.tour-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 6px; }
.tour-text { line-height: 1.65; }
.tour-actions { margin-top: 10px; margin-bottom: 0; }
.tour-actions > button { flex: none; }
.tour-actions #tour-skip { margin-right: auto; }

@media (max-width: 760px) {
  .grid3, .adv-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .start-btn { width: 100%; }
}
.warn-text { color: var(--warn); }
.statusline .pos { color: var(--gain); } .statusline .neg { color: var(--loss); }
input.flash { animation: tt-flash .9s ease; }
@keyframes tt-flash { 0% { box-shadow: 0 0 0 2px var(--accent); border-color: var(--accent); } 100% { box-shadow: 0 0 0 0 transparent; } }

/* ---- 按形态出题 / 形态题（docs/13 §4） ---- */
.setup-box { display: flex; gap: 6px 14px; align-items: flex-start; flex-wrap: wrap; margin: 10px 0 2px; padding: 8px 10px; border: 1px dashed var(--line); border-radius: 6px; }
.setup-pick { flex: none; min-width: 240px; color: var(--text); }
.setup-pick select { min-width: 240px; max-width: 100%; }
.setup-note { flex: 1; min-width: 240px; margin: 0; font-size: 12px; }
.setup-note b { color: var(--text); font-weight: 600; }
/* 按形态出题时，形态标签 / 价格 / 年份筛选不起作用：置灰、不可点，顶部一句说明 */
.setup-lock-note { margin: 4px 0 8px; padding: 6px 8px; border-left: 3px solid var(--line); font-size: 12px; }
#filter-card.setup-locked > :not(h2):not(.setup-lock-note) { opacity: .45; pointer-events: none; }
.anchor-tag { font-size: 12px; padding: 0 8px; border-radius: 10px; border: 1px solid var(--warn); color: var(--warn); white-space: nowrap; cursor: help; }
.statusline .anchor { color: var(--warn); }
.anchor-tip { border-color: var(--sh-warn-line, rgba(240,180,41,.55)); background: var(--sh-tint-warn-faint, rgba(240,180,41,.06)); }
.anchor-tip h3 { margin-top: 0; color: var(--warn); }
.anchor-tip-text { line-height: 1.6; font-size: 12px; }
.review-anchor { margin: 0 0 8px; padding: 6px 10px; border-radius: 4px; background: var(--panel2); border-left: 3px solid var(--warn); }

/* ---- 练习天数与延长练习（docs/14 §1.3） ---- */
.days-box { display: flex; gap: 6px 14px; align-items: center; flex-wrap: wrap; margin: 10px 0 2px; padding: 8px 10px; border: 1px dashed var(--line); border-radius: 6px; }
.days-pick { flex: none; display: flex; flex-wrap: wrap; max-width: 100%; align-items: center; gap: 6px 8px; color: var(--text); }
.days-input { display: inline-flex; align-items: center; gap: 4px; }
.days-input input { width: 90px; }
.days-input input.invalid { border-color: var(--down); }
.days-info { flex: 1; min-width: 200px; display: flex; flex-direction: column; gap: 2px; }
.days-info .hint { margin: 0; }
.days-err { color: var(--sh-danger-fg, #ffb4b4); }
.end-hint { margin: 8px 0; padding: 6px 8px; border-left: 3px solid var(--warn); background: var(--sh-tint-warn-faint, rgba(240,180,41,.07)); font-size: 12px; line-height: 1.6; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.end-hint button { flex: none; }
.end-hint-btns { display: flex; flex-wrap: wrap; gap: 6px; }
.days-chips { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.ext-box > summary { color: var(--text); }
.ext-err { margin-top: 4px; color: var(--warn); font-size: 12px; line-height: 1.5; }

/* ---- 首屏主次、进度、状态栏层级、手机操作条（体验审阅后的改进） ---- */
/* 键盘重度使用：焦点必须看得见（鼠标点击不出框） */
:focus-visible { outline: 2px solid var(--sh-focus, #60a5fa); outline-offset: 1px; }
:focus:not(:focus-visible) { outline: none; }
/* button.big 的 width:100% 优先级更高，这里要写得更具体，主按钮才回到正常宽度 */
button.big.start-btn { width: auto; min-width: 200px; max-width: 280px; margin: 0; }
.picker .overlay-card { align-self: start; }

/* ---- 选题页「按目标挑题」折叠区 ---- */
.pick-more { grid-column: 1 / -1; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; }
.pick-more > summary { cursor: pointer; user-select: none; padding: 10px 12px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; list-style: none; }
.pick-more > summary::-webkit-details-marker { display: none; }
.pick-more > summary::before { content: "▸"; color: var(--muted); }
.pick-more[open] > summary::before { content: "▾"; }
.pick-more > summary:hover .pm-title { color: var(--sh-text-hi, #fff); }
.pm-title { font-weight: 600; }
.pm-sub { flex-basis: 100%; font-size: 12px; padding-left: 1.2em; }
.pm-badge { padding: 1px 8px; border-radius: 10px; background: var(--sh-tint-warn-soft, rgba(245, 158, 11, .16)); border: 1px solid var(--sh-warn-line, #b7791f); color: var(--sh-warn-fg, #f6c453); font-size: 12px; }
.pick-more[open] > summary { border-bottom: 1px solid var(--line); }
.pick-more-body { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 12px; }
.pick-more-body .wide { grid-column: 1 / -1; }
.pick-more-body .overlay-card { align-self: start; }
@media (max-width: 1000px) { .pick-more-body { grid-template-columns: minmax(0, 1fr); padding: 8px; } .pick-more-body > * { min-width: 0; } }

/* ---- 复盘「教练小结」 ---- */
.coach { margin: 0 0 10px; padding: 10px 12px; border: 1px solid var(--sh-sel-line, #2f4f86); border-left: 4px solid var(--accent); border-radius: 6px; background: linear-gradient(180deg, var(--sh-sel-bg, #19223a), var(--sh-panel-deep, #141822)); }
.coach h3 { margin: 0 0 6px; justify-content: flex-start; }
.coach-row { display: flex; gap: 8px; margin: 3px 0; line-height: 1.5; }
.coach-row .k { flex: none; color: var(--muted); min-width: 7.5em; }
.coach.good { border-color: var(--sh-ok-line, #1f6f4a); border-left-color: var(--sh-ok-edge, #26a69a); background: linear-gradient(180deg, var(--sh-ok-bg, #14281f), var(--sh-panel-deep, #141822)); }
.coach.neutral { border-left-color: var(--muted); border-color: var(--line); background: var(--sh-panel-deep, #141822); }
@media (max-width: 600px) { .coach-row { flex-direction: column; gap: 0; } .coach-row .k { min-width: 0; } }

.progress-box { display: flex; align-items: center; gap: 6px 14px; flex-wrap: wrap; margin-left: auto; min-width: 0; }
.progress-box:empty { display: none; }
.progress-box .pg-nums { display: flex; gap: 6px; }
.progress-box .pg-nums a { display: flex; flex-direction: column; align-items: center; min-width: 58px; padding: 4px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel2); color: var(--text); text-decoration: none; }
.progress-box .pg-nums a:hover { border-color: var(--accent); }
.progress-box .pg-nums .n { font-size: 18px; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; }
.progress-box .pg-nums .k { font-size: 12px; color: var(--muted); }
.progress-box .pg-nums a.has-wb .n { color: var(--warn); }
.progress-box .pg-last { font-size: 12px; }

/* 题目列表：整页都没数据的列隐藏（loadList 按当前页切换） */
.ex-table.hide-price .c-price, .ex-table.hide-pmc .c-pmc, .ex-table.hide-pmv .c-pmv, .ex-table.hide-done .c-done { display: none; }

/* 状态栏：盈亏放大，止损 / 登录状态做成小标签 */
.statusline .st-big { font-size: 15px; }
.st-chip { display: inline-block; padding: 0 7px; border: 1px solid var(--line); border-radius: 10px; font-size: 12px; line-height: 18px; color: var(--muted); background: var(--panel2); vertical-align: 1px; }
.st-chip.warn { color: var(--sh-on-bright, #1a1300); background: var(--warn); border-color: var(--warn); font-weight: 600; }
button.st-chip { cursor: pointer; font: inherit; font-size: 12px; line-height: 18px; padding: 0 7px; }
button.st-chip.warn:hover:not(:disabled) { border-color: var(--sh-ring, #fff); }
/* 手机状态栏的「委托 n」入口（需求 28 D3）：桌面不显示，委托单就在右侧栏里 */
.st-chip.ord, .ord-sep { display: none; }
@media (max-width: 1000px) {
  .ord-sep { display: inline; }
  button.st-chip.ord { display: inline-block; cursor: pointer; min-height: 28px; padding: 0 10px; line-height: 26px; color: var(--accent); border-color: var(--accent); background: var(--sh-tint-accent-soft, rgba(37, 99, 235, .14)); font-weight: 600; }
}

/* 手机端底部操作条：宽屏不显示（≤1000px 的完整样式见文件末尾） */
.mbar { display: none; }

@media (max-width: 760px) {
  button.big.start-btn { width: 100%; max-width: none; }
  .progress-box { margin-left: 0; }
  .start-row .progress-box { order: -1; flex-basis: 100%; }
  /* 常用操作按钮接近 44px，减少误触 */
  #card-replay button, #card-trade button, .start-row button, .alt-card { min-height: 44px; }
}

/* ---- 选题页单一主路径：周期三选一、摘要、开始按钮、其他练法 ---- */
.start-title { font-size: 18px; margin: 0 0 10px; }
.hz-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.hz-card { display: flex; flex-direction: column; gap: 3px; align-items: flex-start; text-align: left; padding: 12px 14px; border-radius: 8px; background: var(--panel2); line-height: 1.4; }
.hz-card b { font-size: 16px; color: var(--text); }
.hz-card span { font-size: 12px; color: var(--muted); }
.hz-card.on { background: var(--sh-tint-accent-soft, rgba(37, 99, 235, .18)); border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.hz-card.on b { color: var(--sh-text-hi, #fff); }
.hz-card.on span { color: var(--sh-text-2, #b9c6e4); }
.start-card .pick-summary { margin: 12px 0 2px; font-size: 14px; color: var(--muted); }
.start-card .start-row { margin: 8px 0 10px; }
button.big.start-btn { min-width: 260px; max-width: none; font-size: 18px; font-weight: 700; padding: 14px 40px; border-radius: 8px; }
.alt-row { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: stretch; margin: 6px 0 4px; }
.alt-label { align-self: center; font-size: 12px; }
.alt-card { display: flex; flex-direction: column; gap: 1px; padding: 7px 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel2); color: var(--text); text-decoration: none; min-width: 200px; }
.alt-card:hover { border-color: var(--accent); }
.alt-card b { color: var(--sh-link, #8fb7ff); font-weight: 600; }
.alt-card span { font-size: 12px; }
.adv-now { margin: 0 0 8px; }
.start-card .adv { margin-top: 10px; border-top: 1px solid var(--line); padding-top: 6px; }
.howto { margin-top: 0; }
@media (max-width: 600px) {
  .hz-cards { grid-template-columns: 1fr; gap: 6px; }
  .hz-card { flex-direction: row; align-items: baseline; gap: 10px; padding: 9px 12px; }
  .hz-card b { flex: none; min-width: 2.2em; }
  button.big.start-btn { min-width: 0; width: 100%; }
  .alt-card { flex: 1 1 100%; }
  .alt-label { flex-basis: 100%; }
}

/* ---- 品种 / 市场卡片（docs/27）：沿用 .hz-card 外观 ---- */
.start-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.start-head > button { flex: none; }
.hz-cards.ac-cards { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); margin-bottom: 8px; }
.hz-cards.mk-cards { grid-template-columns: repeat(2, 1fr); margin-bottom: 8px; }
.hz-card.hz-off { opacity: .45; cursor: not-allowed; }
.hz-card.locked b { color: var(--muted); }
.hz-card.soon { border-style: dashed; }
.hz-card .hz-badge { font-style: normal; font-size: 11px; line-height: 1.5; padding: 0 6px; border: 1px solid var(--warn); border-radius: 999px; color: var(--warn); }
@media (max-width: 600px) {
  .hz-cards.ac-cards, .hz-cards.mk-cards { grid-template-columns: 1fr; }
}

/* ---- 我的市场（docs/product/05）：单市场一行、「更多市场」、选市场勾选区（弹窗和账号页共用） ---- */
.mk-line { margin: 0 0 8px; font-size: 14px; }
.mk-line .linklike { display: inline-flex; align-items: center; }
.mk-line .linklike, .mk-more button, .pg-mk-bar .linklike { min-height: 32px; }
.mk-more { margin: 0 0 8px; }
.mp { display: flex; flex-direction: column; gap: 14px; }
.mp-h { margin: 0 0 6px; font-size: 14px; color: var(--muted); font-weight: 600; }
.mp-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.mp-card { position: relative; min-height: 44px; padding-right: 34px; }
.mp-card .mp-tick { position: absolute; right: 12px; top: 10px; font-style: normal; font-size: 15px; color: var(--muted); }
.mp-card.on .mp-tick { color: var(--accent); font-weight: 700; }
.mp-card.mp-fresh:not(.on) { border-color: var(--accent); border-style: dashed; }
.mp-card.mp-fresh:not(.on) .mp-tick { color: var(--accent); }
.hz-card .hz-badge.mp-owned { border-color: var(--accent); color: var(--accent); }
.hz-card .hz-badge.trial { border-color: var(--up); color: var(--up); white-space: nowrap; }   /* 游客「可免费试 N 道」：不是锁，用绿色（需求 26） */
.mp-soon-list { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.mp-soon-item { display: inline-flex; flex-direction: row; align-items: center; gap: 8px; min-height: 36px; cursor: pointer; color: var(--text); font-size: 14px; }
.mp-soon-item input { width: 18px; height: 18px; margin: 0; }
.mp-note { margin: 0; }
@media (max-width: 600px) {
  .mp-grid { grid-template-columns: 1fr; }
  .mp-card .mp-tick { top: 50%; transform: translateY(-50%); }
  .mp-soon-item { min-height: 44px; }
  .hz-cards.mk-cards .hz-card, .hz-cards.ac-cards .hz-card { min-height: 44px; }
  .mk-line .linklike, .mk-more button, .pg-mk-bar .linklike { min-height: 44px; padding: 0 4px; }
}

/* ---- 练习页右侧：下一步、推进、交易、持仓 ---- */
.next-step { border-left: 4px solid var(--accent); background: linear-gradient(180deg, var(--sh-sel-bg, #19223a), var(--panel)); }
.next-step .ns-label { font-size: 11px; color: var(--muted); letter-spacing: 1px; }
.next-step .ns-title { font-size: 15px; font-weight: 700; margin: 1px 0 3px; }
.next-step .ns-title .sep { color: var(--muted); font-weight: 400; }
.next-step .ns-text { line-height: 1.6; }
.next-step .ns-actions { margin: 8px 0 0; }
.next-step[data-state="nostop"] { border-color: var(--warn); border-left-color: var(--warn); background: var(--sh-tint-warn-soft, rgba(240, 180, 41, .10)); }
.next-step[data-state="nostop"] .ns-title { color: var(--warn); }
.next-step[data-state="end"], .next-step[data-state="wait"] { border-left-color: var(--warn); }
button.big.next-btn { margin: 4px 0 6px; padding: 12px; font-size: 16px; font-weight: 700; }
.sub-row { margin: 4px 0; }
.sub-row > button { flex: 1; }
.clr-row { margin: 2px 0 6px; }
.clr-row > button { color: var(--muted); }
.more-adv, .acct-more, .tips-box { margin-top: 8px; }
.tips-box { padding: 0 2px; }
.acct-more .kv { margin-top: 2px; }
.tips-box .hint { margin: 2px 0 6px; }

/* 手机：持仓没设止损时，操作条上方的细提示条 */
.mstop { display: none; }
@media (max-width: 760px) {
  .mstop { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 4px 4px 10px;
           border: 1px solid var(--sh-warn-line, rgba(240, 180, 41, .5)); border-radius: 6px; background: var(--sh-tint-warn-soft, rgba(240, 180, 41, .14)); color: var(--warn); font-size: 13px; }
  .mstop.hidden { display: none; }
  .mbar button.warnbtn { padding: 5px 14px; font-size: 13px; background: var(--warn); border-color: var(--warn); color: var(--sh-on-bright, #1a1300); }
}

/* 心态标签行（js/mood.js，docs/41）：下单后出现的一行小标签。桌面在「交易」卡片最上面，手机在底部操作条上方 */
.mood-row { margin: 0 0 8px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel2); }
.mood-row.hidden { display: none; }
.mood-head { display: flex; align-items: center; gap: 8px; font-size: 13px; margin-bottom: 4px; }
.mood-prompt { font-weight: 600; }
.mood-skip, .mood-done { font-size: 12px; flex: 1; min-width: 0; }
.mood-done { color: var(--up); }
.mood-x { margin-left: auto; padding: 0 8px; min-height: 28px; line-height: 1; font-size: 18px; background: transparent; border-color: transparent; color: var(--muted); }
.mood-x:hover { color: var(--text); }
/* 桌面：五个标签在侧栏的交易卡里放不下一排（每个只有 45px，字会被拆开），按每个至少 86px 自动折成两行；手机见下面的 @media，固定一排 */
.mood-chips { display: grid; grid-template-columns: repeat(auto-fit, minmax(86px, 1fr)); gap: 6px; }
.mood-chip { display: flex; align-items: center; justify-content: center; gap: 4px; padding: 4px 4px; min-height: 36px; font-size: 13px; line-height: 1.2; text-align: center; border-radius: 6px; }
.mood-chip kbd { flex: none; }
.mood-note-row { margin-top: 6px; }
.mood-note-input { width: 100%; box-sizing: border-box; font-size: 13px; }
.mood-chip.on { background: var(--accent); border-color: var(--accent); color: var(--sh-on-fill, #fff); }
.mood-ok { flex: none; font-weight: 700; }
.mood-name { min-width: 0; overflow-wrap: anywhere; }
.mood-row-m { display: none; }
@media (max-width: 760px) {
  #mood-row { display: none; }
  .mood-row-m { grid-column: 1 / -1; display: block; margin: 0; padding: 4px 6px; }
  .mood-row-m.hidden { display: none; }
  .mood-row-m .mood-head { margin-bottom: 2px; }
  /* 需求 20 D12：五个标签固定一排（不换行）：缩小间距、内边距和字号，标签名在格子里自己折行 */
  .mood-row-m .mood-chips { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; }
  .mood-row-m .mood-chip { min-height: 44px; font-size: 12px; padding: 2px 1px; }
  .mood-row-m .mood-chip kbd { display: none; }
  /* 标签行 / 止损提示出现时底部操作条变高：留白和图表高度跟着 --mbar-h（app.js 量出来的操作条实际高度）走，图表稍微矮一点也要让出页面（需求 28 D2） */
  .practice.has-mood .chart-col { min-height: 220px; }
  .practice.has-mood.has-mstop .chart-col { min-height: 200px; }
}
.mood-sum { margin: 8px 0 0; font-size: 14px; }
.check-row { display: flex; flex-direction: column; gap: 2px; align-items: flex-start; font-size: 12px; color: var(--muted); }
/* 「成交后自动挂止损」（需求 32）：勾选框和提示同一行 */
.attach-row { align-items: center; gap: 10px; }
.attach-row > label.attach-chk { flex: 0 1 auto; flex-direction: row; align-items: center; gap: 6px; color: var(--text); cursor: pointer; }
.attach-row input[type="checkbox"] { width: auto; margin: 0; }
.attach-hint { color: var(--warn); }
/* 复盘里的回退提示：灰色，不算过程问题 */
.stepback-note { margin: 8px 0 0; font-size: 13px; color: var(--muted); }
.check-row input[type="checkbox"] { width: auto; margin: 0; }

/* 画线工具栏（js/drawings.js）：浮在图表左上角，竖排，可收起 */
.draw-bar { position: absolute; left: 6px; top: 6px; z-index: 5; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 3px; background: var(--sh-float, rgba(23, 27, 36, .92)); border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 2px 8px var(--sh-shadow, rgba(0, 0, 0, .35)); }
.draw-bar button { width: 28px; height: 28px; padding: 0; display: inline-flex; align-items: center; justify-content: center; background: transparent; border: 1px solid transparent; border-radius: 4px; color: var(--sh-text-2, #aab3c5); }
.draw-bar button:hover:not(:disabled) { background: var(--sh-hover, #2a3040); color: var(--sh-text-hi, #fff); border-color: transparent; }
.draw-bar button.on { background: var(--accent); color: var(--sh-on-fill, #fff); }
.draw-bar button:disabled { opacity: .3; }
.draw-bar .db-body { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.draw-bar.collapsed .db-body { display: none; }
.draw-bar.collapsed .db-toggle { color: var(--sh-text-2, #aab3c5); }
.draw-bar:not(.collapsed) .db-toggle { color: var(--warn); }
.draw-bar .db-sep { width: 18px; height: 1px; background: var(--line); margin: 2px 0; }
.draw-bar .db-color i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--sh-swatch-ring, rgba(255, 255, 255, .25)); }
.draw-bar .db-palette { display: grid; grid-template-columns: repeat(2, 12px); gap: 3px; padding: 2px 0; }
.draw-bar .db-palette button { width: 12px; height: 12px; border-radius: 50%; background: var(--c); border: 1px solid var(--sh-swatch-line, rgba(0, 0, 0, .4)); }
.draw-bar .db-palette button:hover:not(:disabled) { background: var(--c); transform: scale(1.25); }
.draw-bar .db-palette button.on { background: var(--c); box-shadow: 0 0 0 2px var(--sh-ring, #fff); }
/* 窄屏：按钮至少 44px（触屏好点）；展开后两列排，8 个工具 + 颜色 / 撤销 / 重做 / 删除 / 清除放得下，放不下时工具栏自己滚 */
@media (max-width: 760px) {
  .draw-bar { max-height: calc(100% - 12px); }
  .draw-bar button { width: 44px; height: 44px; }
  .draw-bar .db-body { display: grid; grid-template-columns: repeat(2, 44px); gap: 2px; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
  .draw-bar .db-sep { display: none; }
  .draw-bar .db-palette { grid-column: 1 / -1; grid-template-columns: repeat(4, 20px); justify-content: center; gap: 6px; padding: 4px 0; }
  .draw-bar .db-palette button { width: 20px; height: 20px; }
}

/* 委托单（Active Orders） */
.orders-tbl th { font-weight: 500; font-size: 11px; }
.orders-tbl td:nth-child(2), .orders-tbl td:nth-child(3), .orders-tbl td:nth-child(4) { text-align: right; }
.ord-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; vertical-align: 1px; }

/* 技术指标下拉（docs/16 §6）：勾选即生效 */
.ind-wrap { position: relative; }
.ind-btn { padding: 1px 9px; font-size: 12px; background: var(--panel2); display: inline-flex; align-items: center; gap: 4px; }
.ind-btn[aria-expanded="true"] { border-color: var(--accent); }
.ind-count:not(:empty) { background: var(--accent); color: var(--sh-on-fill, #fff); border-radius: 8px; padding: 0 5px; font-size: 11px; line-height: 15px; }
.ind-btn .caret { font-size: 10px; color: var(--muted); }
.ind-pop { position: absolute; top: calc(100% + 6px); left: 0; z-index: 30; width: 360px; max-width: calc(100vw - 24px); max-height: min(78vh, 640px); overflow-y: auto; padding: 8px 10px 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 24px var(--sh-shadow, rgba(0, 0, 0, .45)); }
.ind-top { display: none; justify-content: space-between; align-items: center; }
.ind-h { font-size: 12px; font-weight: 600; margin: 8px 0 4px; }
.ind-h .muted { font-weight: 400; margin-left: 4px; }
.ind-top + .ind-h { margin-top: 4px; }
.ind-pop .ind-h:first-child { margin-top: 4px; }
.ind-list { display: flex; flex-direction: column; gap: 2px; margin-bottom: 6px; }
.ind-row { display: flex; align-items: center; justify-content: space-between; gap: 6px; flex-wrap: wrap; }
.ind-item { display: flex; flex-direction: row; align-items: center; gap: 5px; padding: 3px 4px; border-radius: 4px; cursor: pointer; font-size: 13px; white-space: nowrap; }
.ind-item:hover { background: var(--panel2); }
.ind-item i { width: 10px; height: 3px; border-radius: 2px; flex: none; }
.ind-item input { margin: 0; }
.ind-params { display: inline-flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.ind-p { display: inline-flex; flex-direction: row; align-items: center; gap: 3px; font-size: 12px; color: var(--muted); }
.ind-pop input[type="number"] { width: 56px; padding: 2px 4px; font-size: 13px; text-align: center; }
.ind-ma { display: flex; flex-direction: column; gap: 3px; }
.ind-ma-row { display: flex; align-items: center; gap: 6px; }
.ind-ma-row select, .ind-add select { width: 64px; padding: 2px 4px; font-size: 13px; }
.ind-ma-name { flex: 1; font-size: 12px; color: var(--muted); }
.ind-color { width: 28px; height: 24px; padding: 0; border: 1px solid var(--line); border-radius: 4px; background: none; cursor: pointer; flex: none; }
.ind-del { padding: 0 8px; font-size: 16px; line-height: 22px; background: var(--panel2); }
.ind-empty { font-size: 12px; padding: 2px 4px; }
.ind-add { display: flex; align-items: center; gap: 6px; margin-top: 6px; }
.ind-msg { min-height: 16px; font-size: 12px; color: var(--warn, #f0b429); margin-top: 2px; }
.ind-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; border-top: 1px solid var(--line); padding-top: 6px; font-size: 12px; }

/* K 线读数：鼠标所在那根（不在图上时为最新一根）的开高低收量与指标值；不挡鼠标 */
.ohlc { position: absolute; left: 46px; top: 4px; right: 70px; z-index: 4; pointer-events: none; font-size: 12px; line-height: 1.55; color: var(--muted); font-variant-numeric: tabular-nums; text-shadow: 0 0 3px var(--panel), 0 0 3px var(--panel), 0 0 2px var(--panel); }
.ohlc-row { display: flex; flex-wrap: wrap; gap: 0 10px; }
.ohlc-row span { white-space: nowrap; }
.ohlc-t { color: var(--text); }
.ohlc em { font-style: normal; color: var(--sh-muted, #7d879b); margin-right: 3px; }
.ohlc b { font-weight: 600; }
.ohlc .up { color: var(--gain); }
.ohlc .down { color: var(--loss); }
.ohlc-row.ind i { display: inline-block; width: 9px; height: 2px; margin-right: 4px; vertical-align: middle; }
.tf-group .tab-day { margin-left: 6px; border-radius: 4px; }
@media (max-width: 760px) {
  .ohlc { left: 42px; right: 56px; font-size: 11px; gap: 0 8px; }
  .ohlc-row { gap: 0 7px; }
  .ind-btn { min-height: 44px; padding: 4px 12px; font-size: 14px; }
  /* 手机：贴底的整宽面板，所有可点的东西至少 44px */
  .ind-pop { position: fixed; left: 8px !important; right: 8px; bottom: 8px; top: auto; width: auto; max-width: none; max-height: 78vh; padding: 10px 12px 12px; z-index: 60; }
  .ind-top { display: flex; min-height: 44px; }
  .ind-close { min-width: 44px; min-height: 44px; font-size: 22px; }
  .ind-pop .ind-h:first-child { margin-top: 4px; }
  .ind-row { min-height: 44px; }
  .ind-item { min-height: 44px; padding: 4px; font-size: 15px; }
  .ind-item input[type="checkbox"] { width: 22px; height: 22px; }
  .ind-pop input[type="number"], .ind-ma-row select, .ind-add select { min-height: 44px; width: 64px; font-size: 16px; }
  .ind-ma-row select, .ind-add select { width: 76px; }
  .ind-color { width: 44px; height: 44px; }
  .ind-del, .ind-add button { min-width: 44px; min-height: 44px; }
  .ind-p { font-size: 13px; gap: 4px; }
  .ind-foot button { min-height: 44px; padding: 4px 14px; }
}

/* ==========================================================================
   响应式（手机 / 平板 / 手机横屏）
   必须放在文件最后：图表区、顶栏、操作条的基础规则分散在上面，
   只有靠后的声明才能稳定覆盖它们（不靠 !important）。
   ========================================================================== */

/* ---- ≤1000px：单列、图表定高、底部操作条 ----
   覆盖 844×390 手机横屏、768×1024 平板竖屏、390×844 手机竖屏三种情况：
   图表区按视口扣掉顶栏 / 工具栏 / 操作条后定高，交易面板接在下面滚动。 */
@media (max-width: 1000px) {
  /* iOS Safari：表单控件 <16px 时聚焦会自动放大页面。只放大控件，不动正文 */
  input, select, textarea { font-size: 16px; }

  /* 底部留白 = 操作条的实际高度（--mbar-h，app.js 的 ResizeObserver 写入，已含安全区）+ 一点空隙；量不到时退回 76px。
     原来按「有没有心态标签 / 止损提示」分几档写死（76 / 132 / 184 / 262 / 312px，三处互相覆盖），操作条一变高最下面的内容就被盖住（需求 28） */
  .practice { display: flex; flex-direction: column; gap: 8px; min-height: 0; overflow: auto;
              padding: 8px 8px calc(var(--mbar-h, calc(76px + env(safe-area-inset-bottom))) + 12px); }
  .chart-col { flex: none; min-height: 240px; height: clamp(240px, calc(100dvh - 114px - var(--mbar-h, 76px)), 620px); }
  .chart-wrap { flex: 1; min-height: 0; }
  .chart { min-height: 0; height: auto; }
  .side { flex: none; overflow: visible; padding-right: 0; }

  /* 桌面侧栏底部那组按钮在窄屏收起，改用底部操作条里的「结束」 */
  .side-actions { display: none; }

  .mbar { display: grid; grid-template-columns: 1.25fr 1fr 1fr 1fr 1fr; gap: 6px;
          position: fixed; left: 0; right: 0; bottom: 0; z-index: 4;
          padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
          background: var(--panel); border-top: 1px solid var(--line); }
  .mbar button { padding: 10px 0; font-size: 15px; font-weight: 600; min-height: 44px; }
  /* 「结束」走 danger 视觉（深红底 + 浅红字），和做多 / 做空的绿红文字区分开 */
  .mbar .end, .mbar button[data-for="btn-end"] { background: var(--sh-danger-bg, #2a1518); border-color: var(--sh-danger-line, #8f2f35); color: var(--sh-danger-fg, #ff9c9a); }
  .mbar .end:hover:not(:disabled), .mbar button[data-for="btn-end"]:hover:not(:disabled) { background: var(--sh-danger-bg-hi, #3a1a1e); border-color: var(--down); color: var(--sh-on-fill, #fff); }
}

/* ---- 两行顶栏：窄屏 或 竖屏平板（761–1000 且高度够） ----
   第一行：品牌 / 导航（可横向滑） / 帮助 / 语言 / 用户；第二行：状态栏。
   原来是 flex-wrap，中文会排成两三行、英文四行，状态栏被挤到看不见。
   横屏手机（844×390 之类）高度不够，仍保留 40px 单行，把高度让给图表。 */
@media (max-width: 760px), (max-width: 1000px) and (min-height: 520px) {
  body #topbar { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto auto;
                 grid-template-areas: "brand nav help lang user" "status status status status status";
                 height: auto; min-height: 0; padding: 6px 10px; row-gap: 4px; column-gap: 6px; align-items: center;
                 /* static：不建层叠上下文，#toast 才能浮在复盘全屏层（z-index:25）之上 */
                 position: static; z-index: auto; }
  #topbar .brand { grid-area: brand; font-size: 12px; letter-spacing: 0; white-space: nowrap; }
  #topbar #nav { grid-area: nav; flex-wrap: nowrap; min-width: 0; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none;
                 -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 16px), transparent);
                 mask-image: linear-gradient(to right, #000 calc(100% - 16px), transparent); }
  #topbar #nav::-webkit-scrollbar { display: none; }
  #topbar #nav a { flex: none; display: inline-flex; align-items: center; min-height: 44px; padding: 4px 8px; white-space: nowrap; }
  #topbar #statusline { grid-area: status; display: block; flex: none; min-width: 0; white-space: normal; font-size: 12px; line-height: 1.4; padding-right: 64px; }
  #topbar #btn-help { grid-area: help; width: 30px; height: 30px; }
  #topbar .lang-btn { grid-area: lang; height: 30px; min-width: 42px; }
  #topbar #userbox { grid-area: user; justify-self: end; flex-wrap: nowrap; gap: 4px; min-width: 0; max-width: 100%; white-space: nowrap; }
  #topbar #userbox > .muted { display: none; }                       /* 窄屏省掉「已登录：」前缀 */
  #topbar #userbox .ub-name { flex: 0 1 auto; min-width: 0; max-width: 12em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  #topbar #userbox .pg-tag, #topbar #userbox button { flex: none; }
  #topbar #userbox button { padding: 2px 6px; font-size: 12px; white-space: nowrap; }
  #topbar #busy { grid-area: status; justify-self: end; align-self: start; }
  /* 提示条不进 grid：固定在底部操作条上方，页面滚动时也看得见 */
  #topbar .toast { position: fixed; top: auto; left: 10px; right: 10px; max-width: none; z-index: 60;
                   bottom: calc(var(--mbar-h, calc(76px + env(safe-area-inset-bottom))) + 8px); text-align: center; }

  /* 复盘是全屏覆盖层：顶栏变高后 top:40px 会被顶栏压住，改为盖住整屏 */
  .review { top: 0; z-index: 25; }
}

/* ≤430 的大屏手机：保留品牌，导航单独占一行。
   两行放不下「品牌 + 4 个导航项」，硬塞会只露出半个导航；把导航放第二行后
   品牌仍在左上角，练习/历史/错题本/形态库一次可见；状态栏移到第三行。 */
@media (max-width: 430px) {
  body #topbar {
    /* 用户盒占剩下的宽度（minmax(0,1fr)）：原来是 auto，用户名 + 管理员 + 退出放不下时整格缩成 0，内容溢出去盖住语言按钮 */
    grid-template-columns: auto auto auto minmax(0, 1fr);
    grid-template-areas:
      "brand help lang user"
      "nav nav nav nav"
      "status status status status";
  }
  #topbar .brand { display: block; }
  /* 三行顶栏比两行高约 34px：图表区同步减高，避免练习页内容溢出、
     把工具栏顶部顶到状态栏底下（英文 390px 实测会被裁掉一截） */
  .chart-col { height: clamp(220px, calc(100dvh - 139px - var(--mbar-h, 76px)), 600px); }
}

/* ---- ≤380px：iPhone SE / 320px 宽，再收一点，保证不横向溢出 ---- */
@media (max-width: 380px) {
  body #topbar { padding: 6px 8px; column-gap: 5px; }
  #topbar #nav a { padding: 4px 7px; }
  #topbar .lang-btn { min-width: 36px; padding: 0 5px; }
  .mbar { grid-template-columns: 1.2fr 1fr 1fr 1fr 1fr; gap: 4px; padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); }
  .mbar button { font-size: 14px; padding: 9px 0; }
}

/* ---- ≤340px（需求 27：英文比中文长）---- */
@media (max-width: 340px) {
  /* 手机底部的五个心态标签每格只有 ~56px，英文「Confident」会被从中间拆开：再缩小一点字号 */
  .mood-row-m .mood-chip { font-size: 11px; padding: 2px 0; }
  /* 窄屏：管理员小标签先藏起来，把宽度让给用户名（用户名放不下就省略号，「退出」始终在） */
  #topbar #userbox .pg-tag { display: none; }
}

/* 复盘：股票涨跌幅 vs 我的账户收益率 */
.compare { margin: 0 0 10px; }
.compare-cards { margin-bottom: 6px; }
.compare-cards .stat.secondary { opacity: .92; border-style: dashed; }
.compare-verdict { font-size: 15px; font-weight: 600; margin: 2px 0 2px; }
.compare-verdict.pos { color: var(--gain); }
.compare-verdict.neg { color: var(--loss); }
.compare-hint { font-size: 12px; margin-top: 2px; }

.pick-foot { margin: 4px 0 8px; text-align: center; }
.pick-foot a, #reg-disclaimer a { text-decoration: underline; text-underline-offset: 2px; }
/* ---- 用 Google 登录（docs/28）：白底按钮、灰边框，暗色站点里也保持 Google 的规范外观 */
.oauth-wrap { display: flex; flex-direction: column; gap: 10px; }
.gbtn { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; padding: 8px 12px; background: #fff; color: #3c4043; border: 1px solid #dadce0; border-radius: 4px; font-weight: 500; cursor: pointer; }
.gbtn:hover { background: #f8f9fa; border-color: #c6c9cc; }
.gbtn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.gbtn svg { flex: none; }
.or-divider { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; }
.or-divider::before, .or-divider::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.oauth-done { margin: 40px 16px; text-align: center; color: var(--muted); }

/* 指标对话框：搜索框与小标题；顶部（标题 + 搜索 + 提示）滚动时固定 */
.ind-sticky { position: sticky; top: -8px; z-index: 2; background: var(--panel); margin: -8px -10px 0; padding: 8px 10px 2px; }
.ind-search { width: 100%; box-sizing: border-box; padding: 4px 8px; font-size: 13px; }
.ind-subh { font-size: 11px; color: var(--muted); letter-spacing: .06em; margin: 6px 0 1px 4px; }
.ind-row { min-height: 28px; }
.ind-p input[type="number"] { width: 52px; }
@media (max-width: 760px) {
  .ind-sticky { margin: -10px -12px 0; padding: 10px 12px 2px; top: -10px; }
  .ind-search { min-height: 44px; font-size: 16px; }
  .ind-subh { font-size: 12px; margin-top: 10px; }
  .ind-p input[type="number"] { width: 60px; }
}
.ind-pop .ind-add input[type="number"] { width: 112px; }

.stat .sub { font-size: 11px; font-weight: 400; margin-top: 1px; }

/* 按风险算股数 */
.size-row { gap: 8px; }
.size-row label { flex: 1; }
.size-msg { color: var(--warn); margin: 0 0 4px; }
.size-out { margin: 0 0 4px; min-height: 0; }
.size-out:empty { display: none; }
.msize { display: none; }
@media (max-width: 760px) {
  /* 底部条上方一行：风险 % 输入、算股数按钮、结果；和 mstop 一样占满一行 */
  .msize { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; }
  .msize label { display: flex; flex-direction: row; align-items: center; gap: 4px; font-size: 13px; color: var(--muted); flex: none; }
  .msize input { width: 64px; min-height: 44px; font-size: 16px; padding: 4px 6px; text-align: center; }
  .msize button { min-height: 44px; padding: 4px 14px; font-size: 14px; flex: none; }
  .msize-out { font-size: 12px; color: var(--muted); line-height: 1.3; min-width: 0; flex: 1; }
  .msize-out.warn-text { color: var(--warn); }
  /* 需求 88：预计亏损 / 盈利 / 盈亏比单独占一行，不折行（放不下由 app.js 换短写法） */
  .msize { flex-wrap: wrap; }
  .msize-pnl { flex: 0 0 100%; min-width: 0; font-size: 12px; line-height: 1.3; color: var(--muted); white-space: nowrap; overflow: hidden; }
  .msize-pnl:empty { display: none; }
  .size-row input, #btn-size { min-height: 44px; }
}

/* ---- 复盘区块（js/reflect.js）：评分星 + 复盘笔记 + 加入错题本；复盘卡片和历史详情共用 ---- */
.rf { margin: 10px 0 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--sh-panel-deep, #141822); }
.rf h3 { margin-top: 0; justify-content: flex-start; gap: 10px; }
.rf-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin: 4px 0; }
.rf-label { color: var(--muted); font-size: 13px; }
.rf-stars { display: inline-flex; }
.rf-star { min-width: 44px; min-height: 44px; padding: 0; border: 0; background: transparent; color: var(--muted); font-size: 26px; line-height: 1; border-radius: 6px; }
.rf-star.on { color: var(--warn); }
.rf-star:hover:not(:disabled) { color: var(--warn); border: 0; }
.rf-star:focus-visible, .rf-link:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.rf-link { min-height: 44px; padding: 0 6px; border: 0; background: transparent; color: var(--sh-link, #8fb7ff); text-decoration: underline; font-size: 13px; }
.rf-link:hover:not(:disabled) { border: 0; color: var(--sh-link-hi, #b9d0ff); }
.rf-hint { font-size: 12px; margin: 0 0 4px; }
.rf-in { color: var(--up); font-size: 13px; }
.rf-in a { color: var(--sh-link, #8fb7ff); }
.rf-add { min-height: 36px; padding: 4px 14px; }
.rf-text { display: block; width: 100%; min-height: 96px; resize: vertical; font: inherit; line-height: 1.5; color: var(--text); background: var(--panel2); border: 1px solid var(--line); border-radius: 4px; padding: 8px 10px; }
.rf-text:focus { outline: 0; border-color: var(--accent); }
.rf-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 22px; margin-top: 2px; }
.rf-status { font-size: 12px; color: var(--muted); }
.rf-status.err { color: var(--down); }
.rf-retry { min-height: 36px; font-size: 12px; color: var(--down); }
.rf-loading { padding: 4px 0; }
@media (max-width: 760px) {
  .rf { padding: 8px 10px; }
  .rf-add, .rf-retry { min-height: 44px; }
  .rf-add { padding: 4px 16px; }
  .rf-text { min-height: 120px; font-size: 16px; }
}

.unsub { max-width: 480px; margin: 48px auto; padding: 0 16px; }
.unsub h1 { font-size: 20px; margin: 0 0 8px; }
