/* desk34: A股→缅A UI label */
:root {
  --bg: #101410;
  --bg-2: #171c18;
  --line: #2c3830;
  --ink: #e7efe4;
  --muted: #8d9b90;
  --gold: #e0b85a;
  --gold-ink: #241b0a;
  --up: #e15a4a;
  --down: #2fbf71;
  --flat: #c5cec6;
  --danger: #ffb4a8;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
  color-scheme: dark;
  font-family: "Segoe UI", "PingFang SC", "Noto Sans SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  width: 100%;
  height: 100%;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
}
body { font-size: 15px; line-height: 1.45; overflow: hidden; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.error { color: var(--danger); min-height: 1.2em; }
.up { color: var(--up); }
.down { color: var(--down); }
.flat { color: var(--flat); }

/* A-share convention: up=red, down=green, flat=gray (force over muted parents) */
.up, span.up, strong.up, td.up, .kpi .up, .kpi em .up, .stats .up { color: var(--up) !important; }
.down, span.down, strong.down, td.down, .kpi .down, .kpi em .down, .stats .down { color: var(--down) !important; }
.flat, span.flat, strong.flat, td.flat, .kpi .flat, .kpi em .flat, .stats .flat { color: var(--flat) !important; }

.toolbar.toolbar-inline {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px;
}
.toolbar.toolbar-inline h2 { margin: 0; margin-right: auto; font-size: 16px; }
.toolbar .inline-field {
  display: inline-flex; align-items: center; gap: 8px; margin: 0;
  color: var(--muted); font-size: 12px; white-space: nowrap;
}
.toolbar .inline-field select {
  min-height: 36px; padding: 6px 10px; min-width: 118px; width: auto;
  background: #0e1310; border: 1px solid var(--line); border-radius: 10px; color: inherit;
}
.dash-kpis .kpi { min-height: 92px; }
.tabs {
  display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 14px; padding: 4px;
  background: #0e1310; border: 1px solid var(--line); border-radius: 12px; width: fit-content;
}
.tab-btn {
  border: 0; background: transparent; color: var(--muted); padding: 8px 14px;
  border-radius: 9px; cursor: pointer; font-size: 13px;
}
.tab-btn.on { background: #1a221c; color: var(--text); font-weight: 600; }
.tab-panel.hidden { display: none; }
.channel-placeholder {
  border: 1px dashed var(--line); border-radius: 14px; padding: 18px; color: var(--muted);
}

.num { font-variant-numeric: tabular-nums; }

.shell {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  width: 100vw;
  max-width: 100%;
  height: 100dvh;
  min-height: 100vh;
  overflow: hidden;
}
.side {
  border-right: 1px solid var(--line);
  padding: 22px 16px 28px;
  background: #0d110e;
  height: 100%;
  min-height: 0;
  overflow: auto;
}
.brand { display: flex; gap: 12px; align-items: center; }
.brand strong { display: block; font-size: 16px; letter-spacing: 0.04em; }
.brand em { display: block; color: var(--muted); font-style: normal; font-size: 12px; margin-top: 2px; }
.mark {
  width: 42px; height: 42px; display: grid; place-items: center;
  background: var(--up); color: #fff; font-weight: 700; border-radius: 10px;
}
.side-nav, .tabbar { display: flex; flex-direction: column; gap: 6px; margin-top: 28px; }
.side-nav button, .tabbar button {
  text-align: left; background: transparent; border: 0; border-radius: 10px;
  padding: 10px 12px; color: var(--muted); min-height: 44px;
}
.side-nav button.on, .tabbar button.on { background: #243028; color: var(--ink); }
.side-note { color: var(--muted); font-size: 12px; margin-top: 28px; line-height: 1.6; }

.main {
  min-width: 0;
  height: 100%;
  max-width: none;
  overflow: auto;
  padding: 22px 28px 32px;
}
.top { display: flex; justify-content: space-between; gap: 16px; align-items: flex-end; flex-wrap: wrap; }
.eyebrow { margin: 0 0 4px; color: var(--gold); letter-spacing: 0.14em; font-size: 12px; text-transform: uppercase; }
h1 { margin: 0; font-size: 28px; font-weight: 650; letter-spacing: 0.01em; }
.top-pills { display: flex; gap: 8px; flex-wrap: wrap; }
.pill {
  border: 1px solid var(--line); border-radius: 999px; padding: 6px 10px;
  background: var(--bg-2); font-size: 13px;
}
.pill.live { border-color: #3e6b4e; color: var(--down); }
.pill.halt { border-color: #6a4038; color: var(--up); }
.muted-pill { color: var(--muted); }

.banner {
  margin-top: 14px; padding: 10px 12px; border-radius: 12px;
  background: #2a2416; color: #f0ddb0; border: 1px solid #5c4b28;
}
.view { margin-top: 18px; display: grid; gap: 14px; }

.kpis, .stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.index-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.index-region { display: grid; gap: 10px; margin-top: 2px; }
.index-region > h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}
.index-region > h2::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
  opacity: 0.9;
}
.index-grid-global { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.market-duo, .split.market-duo { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
@media (max-width: 1200px) {
  .index-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .index-grid-global { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .index-grid, .market-duo { grid-template-columns: 1fr; }
  .index-grid-global { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.stats article > span { display: block; color: var(--muted); font-size: 12px; }
.stats article strong span {
  display: inline;
  font-size: inherit;
  font-weight: inherit;
  letter-spacing: inherit;
  color: inherit;
}
.stats article strong { display: block; margin-top: 4px; font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
.pager { display: flex; gap: 10px; align-items: center; margin-top: 12px; flex-wrap: wrap; }
.card {
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 16px; padding: 14px 14px 12px;
}
.card h2 { margin: 0 0 10px; font-size: 15px; font-weight: 650; }
.kpi > span { display: block; color: var(--muted); font-size: 12px; }
/* pct()/pnl()/signedNum() wrap values in span inside strong/em; do not use label styles */
.kpi strong span,
.kpi em span {
  display: inline;
  font-size: inherit;
  font-weight: inherit;
  letter-spacing: inherit;
  color: inherit;
}
.kpi strong { display: block; margin-top: 6px; font-size: 26px; font-weight: 650; letter-spacing: -0.03em; }
.kpi em { display: block; margin-top: 4px; font-style: normal; color: var(--muted); font-size: 12px; }

.index-card { display: flex; flex-direction: column; min-height: 108px; }
.index-card .idx-foot {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 8px; margin-top: auto; padding-top: 8px;
}
.index-card .idx-foot em {
  display: inline; margin-top: 0; font-style: normal; font-size: 20px; font-weight: 700; letter-spacing: -0.02em;
}
@media (max-width: 720px) {
  .index-card .idx-foot em { font-size: 18px; }
}
.index-card .idx-pct { text-align: left; }
.index-card .idx-chg { text-align: right; color: inherit; }
.index-card .idx-when { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; font-weight: 500; }


.chart-wrap { height: 220px; }
canvas { width: 100%; height: 180px; display: block; }
.chart-wrap canvas { height: 100%; }
.rules { display: flex; flex-wrap: wrap; gap: 8px; }
.rules span {
  font-size: 12px; color: var(--muted); border: 1px dashed var(--line); border-radius: 999px; padding: 4px 8px;
}

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 680px; }
th, td { padding: 10px 8px; text-align: left; vertical-align: top; }
th { color: var(--muted); font-size: 12px; font-weight: 600; }
td { border-top: 1px solid #243028; }
.tag {
  display: inline-block; margin-left: 6px; font-size: 11px; border-radius: 999px;
  padding: 1px 6px; border: 1px solid #6a4038; color: var(--up);
}
.tag.ok { border-color: #3e6b4e; color: var(--down); }
.row-actions, .toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.toolbar input, .toolbar select, .stack input, .stack select, .gate-card input, .gate-card select {
  background: #0e1310; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; min-height: 44px;
}
.stack select, .gate-card select { width: 100%; }
.stack { display: grid; gap: 8px; }
.stack label { color: var(--muted); font-size: 12px; }
.stack input, .stack textarea { width: 100%; }
.stack textarea {
  background: #0e1310; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; min-height: 72px;
}
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }

button.primary, button.ghost, button.danger {
  min-height: 44px; border-radius: 12px; padding: 0 14px;
}
button.primary { background: var(--gold); color: var(--gold-ink); border: 0; font-weight: 700; }
button.ghost { background: transparent; border: 1px solid var(--line); color: var(--ink); }
button.danger { background: transparent; border: 1px solid #6a4038; color: var(--danger); }
button:disabled { opacity: 0.55; cursor: not-allowed; }

pre.log, pre.raw {
  white-space: pre-wrap; word-break: break-word; margin: 0;
  font-family: "IBM Plex Mono", "Sarasa Mono SC", "Source Han Mono", ui-monospace, monospace;
  font-size: 12.5px; line-height: 1.55; color: #d5e0d6;
}
.empty {
  border: 1px dashed var(--line); border-radius: 16px; padding: 22px; color: var(--muted);
}
.pending {
  display: grid; gap: 8px;
}
.pending article {
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  border: 1px solid #5c4b28; background: #221d12; border-radius: 14px; padding: 12px;
}
.split { display: grid; grid-template-columns: 1.4fr 0.8fr; gap: 12px; }
.lots { color: var(--muted); font-size: 12px; }

.modal {
  position: fixed; inset: 0; background: rgba(6, 8, 7, 0.72);
  display: grid; place-items: center; padding: 16px 16px calc(24px + env(safe-area-inset-bottom));
  z-index: 100;
}
.modal-card {
  width: min(520px, 100%); background: #161b17; border: 1px solid var(--line);
  border-radius: 18px 18px 14px 14px; padding: 18px; box-shadow: var(--shadow);
}
.modal-card h2 { margin: 0 0 8px; }
.modal-card ul { margin: 8px 0 14px; padding-left: 18px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; }

.gate {
  position: fixed; inset: 0; z-index: 30;
  width: 100%; height: 100dvh; min-height: 100vh;
  display: grid; place-items: center; padding: 24px;
  background:
    radial-gradient(600px 280px at 20% 0%, rgba(225, 90, 74, 0.16), transparent 60%),
    var(--bg);
}
.gate-card { width: min(420px, 100%); display: grid; gap: 10px; }
.gate-card h1 { font-size: 32px; }

.tabbar {
  display: none; position: fixed; left: 0; right: 0; bottom: 0;
  margin: 0; padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
  background: rgba(13, 17, 14, 0.94); border-top: 1px solid var(--line);
  flex-direction: row; z-index: 10; backdrop-filter: blur(8px);
  overflow-x: auto;
}
.tabbar button { flex: 1 0 auto; text-align: center; padding: 8px 6px; font-size: 11px; white-space: nowrap; min-width: 48px; }
.account { display: grid; gap: 8px; border-top: 1px solid var(--line); padding-top: 12px; }
.check { display: flex; align-items: center; gap: 8px; min-height: 44px; }
.map-row { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.4fr) auto; gap: 8px; }
.wx-result { margin: 8px 0 0; white-space: pre-wrap; }
.wx-qr { width: 220px; height: 220px; background: #fff; padding: 8px; border-radius: 8px; }
#wx-qr-box { display: grid; gap: 8px; justify-items: start; margin-top: 8px; }

@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); width: 100%; height: 100dvh; }
  .side { display: none; }
  .tabbar { display: flex; }
  .main { padding: 16px 14px calc(108px + env(safe-area-inset-bottom)); }
  .kpis, .stats, .form-grid, .split, .map-row, .market-duo { grid-template-columns: 1fr; }
  .index-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  h1 { font-size: 24px; }
  .kpi strong { font-size: 22px; }
}


/* —— Desk polish v10: cards, bind, nav, gate —— */
:root {
  --bg: #0c100e;
  --bg-2: #151b17;
  --bg-3: #1b231e;
  --line: #2a3530;
  --line-soft: #22302a;
  --ink: #e8f0e6;
  --muted: #8fa094;
  --gold: #e2bc62;
  --gold-ink: #241b0a;
  --up: #e15a4a;
  --down: #2fbf71;
  --flat: #c5cec6;
  --danger: #ffb4a8;
  --accent: #3d7a5a;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.32);
  --radius: 16px;
  --radius-sm: 12px;
}

body {
  background:
    radial-gradient(900px 420px at 12% -10%, rgba(225, 90, 74, 0.10), transparent 55%),
    radial-gradient(700px 380px at 92% 0%, rgba(226, 188, 98, 0.08), transparent 50%),
    var(--bg);
}

.side {
  background: linear-gradient(180deg, #0d120f 0%, #0a0e0b 100%);
  border-right-color: var(--line-soft);
}
.side-nav button {
  transition: background 0.15s ease, color 0.15s ease, transform 0.12s ease;
}
.side-nav button:hover, .tabbar button:hover {
  color: var(--ink);
  background: rgba(36, 48, 40, 0.55);
}
.side-nav button.on, .tabbar button.on {
  background: linear-gradient(135deg, #2a3a31, #243028);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px rgba(226, 188, 98, 0.18);
}
.mark {
  background: linear-gradient(145deg, #e96a58, #c94436);
  box-shadow: 0 8px 18px rgba(225, 90, 74, 0.28);
}

.card {
  background: linear-gradient(180deg, rgba(27, 35, 30, 0.95), rgba(21, 27, 23, 0.98));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 16px 14px;
  box-shadow: 0 1px 0 rgba(255,255,255,0.03) inset;
}
.card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 8px;
}
.card-head h2 { margin: 0 0 4px; }
.chip {
  flex: 0 0 auto;
  font-size: 12px;
  color: var(--gold);
  border: 1px solid rgba(226, 188, 98, 0.35);
  background: rgba(226, 188, 98, 0.08);
  border-radius: 999px;
  padding: 4px 10px;
  white-space: nowrap;
}

.kpi {
  position: relative;
  overflow: hidden;
}
.kpi strong {
  letter-spacing: -0.04em;
}

.pill {
  background: rgba(21, 27, 23, 0.9);
  backdrop-filter: blur(6px);
}
.pill.live {
  background: rgba(47, 191, 113, 0.08);
}
.pill.halt {
  background: rgba(225, 90, 74, 0.08);
}

button.primary {
  background: linear-gradient(180deg, #ebc875, #d4a84a);
  box-shadow: 0 8px 18px rgba(212, 168, 74, 0.22);
}
button.primary:hover { filter: brightness(1.04); }
button.ghost {
  background: rgba(14, 19, 16, 0.55);
  border-color: var(--line);
}
button.ghost:hover { border-color: #3d4d44; }
button.danger-lite {
  border-color: #6a4038;
  color: var(--danger);
}

.toolbar input, .toolbar select, .stack input, .gate-card input, .form-grid input, .form-grid select {
  background: #0e1310;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.toolbar input:focus, .stack input:focus, .gate-card input:focus, .form-grid input:focus {
  outline: none;
  border-color: rgba(226, 188, 98, 0.55);
  box-shadow: 0 0 0 3px rgba(226, 188, 98, 0.12);
}

.gate {
  background:
    radial-gradient(700px 320px at 18% 0%, rgba(225, 90, 74, 0.18), transparent 60%),
    radial-gradient(560px 280px at 85% 10%, rgba(226, 188, 98, 0.12), transparent 55%),
    var(--bg);
}
.gate-card {
  width: min(440px, 100%);
  background: linear-gradient(180deg, #1a221c, #141a16);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 22px;
  box-shadow: var(--shadow);
}
.gate-card h1 { font-size: 30px; margin-bottom: 4px; }

.table-wrap {
  border-radius: 12px;
  border: 1px solid var(--line-soft);
  background: rgba(10, 14, 11, 0.35);
}
th { letter-spacing: 0.04em; }
td { border-top-color: var(--line-soft); }
tr:hover td { background: rgba(36, 48, 40, 0.28); }

.empty.compact {
  padding: 14px 16px;
  border-radius: 12px;
}

.bind-list { display: grid; gap: 10px; margin: 12px 0 14px; }
.bind-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(14, 19, 16, 0.65);
}
.bind-meta { display: grid; gap: 2px; min-width: 0; }
.bind-meta strong { font-size: 14px; }
.bind-meta em { font-style: normal; font-size: 12px; }
.bind-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
  user-select: none;
}
.switch input {
  width: 42px;
  height: 24px;
  appearance: none;
  background: #2a3330;
  border-radius: 999px;
  position: relative;
  border: 1px solid var(--line);
  cursor: pointer;
  transition: background 0.15s ease;
}
.switch input::after {
  content: "";
  position: absolute;
  top: 2px; left: 2px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #c5cec6;
  transition: transform 0.15s ease, background 0.15s ease;
}
.switch input:checked {
  background: rgba(47, 191, 113, 0.35);
  border-color: #3e6b4e;
}
.switch input:checked::after {
  transform: translateX(18px);
  background: var(--down);
}

.bind-code-panel {
  display: grid;
  gap: 10px;
  justify-items: start;
  margin: 12px 0;
  padding: 14px;
  border-radius: 14px;
  border: 1px dashed rgba(226, 188, 98, 0.45);
  background: rgba(226, 188, 98, 0.06);
}
.bind-code {
  font-family: "IBM Plex Mono", "Sarasa Mono SC", ui-monospace, monospace;
  font-size: 15px;
  letter-spacing: 0.04em;
  word-break: break-all;
  color: var(--gold);
  padding: 8px 10px;
  border-radius: 10px;
  background: #0e1310;
  border: 1px solid var(--line);
  max-width: 100%;
}
.wx-qr {
  width: min(220px, 70vw);
  height: auto;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  margin: 10px 0;
}
.fold {
  margin-top: 12px;
  border-top: 1px solid var(--line-soft);
  padding-top: 10px;
}
.fold summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 10px;
}
.wx-result {
  min-height: 1.3em;
  margin: 8px 0 0;
  white-space: pre-wrap;
  font-size: 13px;
  color: var(--muted);
}
.wx-result.error { color: var(--danger); }

.check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0;
  color: var(--ink);
}

.modal-card {
  background: linear-gradient(180deg, #1a221c, #141a16);
  border-radius: 20px;
}

@media (max-width: 900px) {
  .bind-item { align-items: flex-start; }
  .card-head { flex-direction: column; }
}

/* —— Accounts / permissions page —— */
.account-create-card .card-head,
.account-list-card .card-head {
  margin-bottom: 4px;
}
.account-create-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 8px;
}
.account-create-actions {
  margin-top: 14px;
}
.account-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}
.account-row {
  display: grid;
  grid-template-columns: 40px minmax(160px, 1.3fr) minmax(120px, 0.9fr) minmax(160px, 1.1fr) auto;
  gap: 12px 14px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(14, 19, 16, 0.55);
}
.account-avatar {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-weight: 700;
  color: var(--gold-ink);
  background: linear-gradient(145deg, #e2bc62, #c9a24a);
  flex: 0 0 auto;
}
.account-id { min-width: 0; }
.account-name-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.account-name { font-size: 15px; }
.account-field { margin: 0; min-width: 0; }
.account-field input,
.account-field select { width: 100%; }
.account-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  justify-content: flex-end;
}
.account-actions button {
  min-height: 40px;
  padding: 0 12px;
  white-space: nowrap;
}
/* keep old card class usable for playbook/LLM lists */
.account-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(14, 19, 16, 0.55);
}
.account-card-top {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.account-card-meta { min-width: 0; flex: 1; }
.account-hint { margin: 4px 0 0; font-size: 12px; }
.account-edit-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  line-height: 1.4;
  border: 1px solid var(--line);
  color: var(--muted);
  background: rgba(255,255,255,0.03);
}
.badge-admin {
  color: var(--gold);
  border-color: rgba(226, 188, 98, 0.35);
  background: rgba(226, 188, 98, 0.08);
}
.badge-user {
  color: #9eb8a8;
  border-color: rgba(61, 122, 90, 0.35);
}
.badge-on {
  color: var(--down);
  border-color: rgba(47, 191, 113, 0.35);
  background: rgba(47, 191, 113, 0.08);
}
.badge-off {
  color: var(--danger);
  border-color: rgba(255, 180, 168, 0.35);
  background: rgba(225, 90, 74, 0.08);
}
.empty-hint {
  padding: 18px 8px;
  text-align: center;
}

/* Limit-up / limit-down stock lists: ~10 rows visible, scroll inside */
.limit-stock-scroll {
  max-height: 420px;
  overflow: auto;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: rgba(10, 14, 11, 0.35);
}
.limit-stock-scroll .table-wrap {
  margin: 0;
  border: 0;
  max-height: none;
  overflow: visible;
}
.limit-stock-scroll table thead th {
  position: sticky;
  top: 0;
  background: #151b17;
  z-index: 1;
}

@media (max-width: 1100px) {
  .account-row {
    grid-template-columns: 40px minmax(0, 1fr) minmax(0, 1fr);
  }
  .account-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
    flex-wrap: wrap;
  }
}
@media (max-width: 900px) {
  .account-create-grid,
  .account-edit-grid {
    grid-template-columns: 1fr;
  }
  .account-row {
    grid-template-columns: 40px minmax(0, 1fr);
  }
  .account-field,
  .account-actions {
    grid-column: 1 / -1;
  }
  .limit-stock-scroll {
    max-height: 360px;
  }
}


/* 大盘「涨跌家数」「涨停情绪」统一放大 */
.market-big-stats article > span { font-size: 18px; font-weight: 600; }
.market-big-stats article strong { font-size: 36px; font-weight: 700; letter-spacing: -0.03em; margin-top: 8px; }
/* pct() 会在 strong 内再包一层 span；勿套用标签字号 */
.market-big-stats article strong span {
  display: inline;
  font-size: inherit;
  font-weight: inherit;
  letter-spacing: inherit;
}
@media (max-width: 720px) {
  .market-big-stats article > span { font-size: 16px; }
  .market-big-stats article strong { font-size: 30px; }
}

/* 大盘顶部常驻情绪条 */
.banner.sentiment {
  background: #1a221c;
  color: var(--ink);
  border: 1px solid #3a4a3e;
}
.banner.sentiment .emo-title {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.4;
}
.banner.sentiment .emo-note {
  margin-top: 6px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.45;
}


/* desk26: log toolbars + learn log */
.log-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
  margin-bottom: 10px;
}
.learn-log {
  max-height: 520px;
  overflow: auto;
}


/* desk27: paper-trade fill toasts (per logged-in book) */
.trade-toasts {
  position: fixed;
  right: 16px;
  bottom: 72px;
  z-index: 80;
  display: flex;
  flex-direction: column-reverse;
  gap: 10px;
  max-width: min(420px, calc(100vw - 24px));
  pointer-events: none;
}
.trade-toast {
  pointer-events: auto;
  background: #1c2430;
  border: 1px solid #3d4f66;
  border-radius: 14px;
  padding: 12px 14px;
  box-shadow: 0 10px 28px rgba(0,0,0,.35);
  color: var(--text, #e8eef7);
  animation: trade-toast-in .22s ease-out;
}
.trade-toast.buy { border-color: #6a4038; }
.trade-toast.sell { border-color: #3e6b4e; }
.trade-toast .tt-title { font-weight: 700; font-size: 14px; margin: 0 0 4px; }
.trade-toast.buy .tt-title { color: var(--up, #e07070); }
.trade-toast.sell .tt-title { color: var(--down, #5cbc7a); }
.trade-toast .tt-body { font-size: 13px; color: var(--muted, #9aa8bc); margin: 0; line-height: 1.45; }
.trade-toast button.tt-close {
  position: absolute; right: 8px; top: 6px;
  border: 0; background: transparent; color: #8a97a8; cursor: pointer; font-size: 16px;
}
.trade-toast { position: relative; padding-right: 28px; }
@keyframes trade-toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (max-width: 720px) {
  .trade-toasts { left: 12px; right: 12px; bottom: 64px; max-width: none; }
}


/* desk30: 大盘分区 Tab */
/* desk31: Tab 占满一行加大；A股情绪条在 Tab 下 */
.market-tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  margin: 0 0 14px;
  padding: 6px;
  width: 100%;
  max-width: none;
  box-sizing: border-box;
  background: #0e1310;
  border: 1px solid var(--line);
  border-radius: 14px;
}
.market-tabs .tab-btn {
  flex: 1 1 0;
  min-width: 0;
  text-align: center;
  padding: 12px 10px;
  font-size: 16px;
  font-weight: 600;
  border-radius: 10px;
  letter-spacing: 0.02em;
}
.market-tabs .tab-btn.on {
  background: #1a221c;
  color: var(--text);
}
.market-tab-panel { display: grid; gap: 14px; }
.market-sentiment {
  margin: 0 0 4px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #1a221c;
  color: var(--ink);
  border: 1px solid #3a4a3e;
}
.market-sentiment .emo-title {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.4;
}
.market-sentiment .emo-note {
  margin-top: 6px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.45;
}
@media (max-width: 720px) {
  .market-tabs { gap: 4px; padding: 4px; }
  .market-tabs .tab-btn { padding: 10px 4px; font-size: 14px; }
}


/* desk33: overview charts + minute inflection prices */
tr.stock-row { cursor: pointer; }
tr.stock-row:hover td { background: rgba(224, 184, 90, 0.06); }
tr.stock-row.open td { background: rgba(224, 184, 90, 0.08); }
.chart-toggle {
  display: inline-flex; align-items: center; gap: 4px;
  margin-top: 4px; padding: 2px 8px; border-radius: 999px;
  border: 1px solid var(--line); background: transparent;
  color: var(--muted); font-size: 12px; cursor: pointer;
}
.chart-toggle:hover, .chart-toggle.on {
  border-color: var(--gold); color: var(--gold);
}
tr.chart-panel-row td {
  padding: 0 0 12px !important;
  border-bottom: 1px solid var(--line);
  background: rgba(0,0,0,0.18);
}
.stock-charts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 10px 8px 4px;
}
.stock-chart-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg-2);
  padding: 8px 10px 6px;
  min-width: 0;
}
.stock-chart-card header {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 4px; gap: 8px;
}
.stock-chart-card header strong { font-size: 13px; color: var(--ink); }
.stock-chart-card header span { font-size: 11px; color: var(--muted); }
.stock-chart-wrap { height: 240px; position: relative; }
.stock-chart-wrap canvas { width: 100%; height: 100%; display: block; }
.stock-chart-empty {
  position: absolute; inset: 0; display: grid; place-items: center;
  color: var(--muted); font-size: 12px; padding: 8px; text-align: center;
}
@media (max-width: 820px) {
  .stock-charts { grid-template-columns: 1fr; }
  .stock-chart-wrap { height: 210px; }
}

.spark-min { width: 112px; height: 42px; display: block; }
td.spark-cell { vertical-align: middle; min-width: 120px; }
.buy-legend { font-size: 11px; color: var(--gold); margin-top: 2px; }
.stock-chart-card header .buy-tag {
  color: var(--gold); border: 1px solid rgba(224,184,90,.45);
  border-radius: 999px; padding: 0 6px; font-size: 11px;
}

.stock-chart-card header .inflect-hint {
  color: #c9a84c; font-size: 11px; margin-left: 4px;
}

/* AI 调参对话（学习页 · 管理员） */
.learn-chat-card .learn-chat-log {
  max-height: 320px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 8px 0 12px;
  margin-bottom: 8px;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.learn-chat-msg { display: flex; flex-direction: column; gap: 4px; max-width: 92%; }
.learn-chat-msg.user { align-self: flex-end; }
.learn-chat-msg.assistant { align-self: flex-start; }
.learn-chat-role { font-size: 11px; color: var(--muted); }
.learn-chat-bubble {
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.5;
  white-space: normal;
  word-break: break-word;
}
.learn-chat-msg.user .learn-chat-bubble {
  background: rgba(90, 140, 220, .22);
  border: 1px solid rgba(90, 140, 220, .35);
}
.learn-chat-msg.assistant .learn-chat-bubble {
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
}
.learn-chat-compose textarea {
  width: 100%;
  resize: vertical;
  min-height: 72px;
  margin-bottom: 8px;
  font: inherit;
}

/* desk48 / desk53: watchlist analyze bar + chart signal markers + modal 日K */
.watch-list-card .card-head {
  margin-bottom: 12px;
}
/* desk64: analyze + 重选自选 one row; bigger modal & clearer dayK */
.watch-screen-note {
  margin: 0 0 10px;
  min-height: 1.2em;
}
.watch-screen-note #watch-analyze-status:not(:empty)::after {
  content: " · ";
}
.watch-card-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  max-width: min(100%, 42rem);
}
.watch-analyze-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
}
.watch-analyze-inline input#watch-analyze-code {
  flex: 1 1 12rem;
  width: auto;
  min-width: 10rem;
  max-width: 20rem;
  margin: 0;
  font-variant-numeric: normal;
  letter-spacing: 0;
}
.watch-analyze-inline #watch-analyze-btn {
  flex: 0 0 auto;
}
.watch-list-card .card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px 16px;
  flex-wrap: wrap;
}
.modal-card.stock-analysis-modal {
  /* desk69: ~60vw × ~60vh; day-K | analysis side-by-side; larger body copy */
  width: 60vw;
  max-width: 60vw;
  min-width: min(640px, 96vw);
  height: 60vh;
  min-height: 60vh;
  max-height: 60vh;
  display: flex;
  flex-direction: column;
}
.modal-card.stock-analysis-modal > h2 {
  font-size: 20px;
  margin: 0 0 10px;
  letter-spacing: 0.01em;
}
.stock-analysis-modal .stock-analysis-modal-body {
  max-height: none;
  overflow: auto;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.stock-analysis-modal .stock-analysis-result {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.stock-analysis-split {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 14px 16px;
  align-items: stretch;
  flex: 1 1 auto;
  min-height: 0;
}
.stock-analysis-dayk {
  margin: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.stock-analysis-dayk-wrap {
  flex: 1 1 auto;
  height: auto;
  min-height: 260px;
}
.stock-analysis-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: none;
  overflow: auto;
  padding-right: 4px;
  font-size: 15px;
  line-height: 1.55;
}
.stock-analysis-mark-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
}
.stock-analysis-mark {
  font-size: 13px;
  gap: 4px;
  display: inline-flex;
  align-items: center;
}
.stock-analysis-mark i {
  font-style: normal;
  font-weight: 700;
  margin-right: 2px;
}
.stock-analysis-mark.lg-start { color: #2fbf71; border-color: rgba(47, 191, 113, 0.35); }
.stock-analysis-mark.lg-end { color: #e0b85a; border-color: rgba(224, 184, 90, 0.4); }
.stock-analysis-mark.lg-down { color: #e15a4a; border-color: rgba(225, 90, 74, 0.4); }
@media (max-width: 900px) {
  .stock-analysis-split {
    grid-template-columns: 1fr;
  }
  .stock-analysis-dayk-wrap {
    height: 240px;
    min-height: 200px;
    flex: 0 0 auto;
  }
  .stock-analysis-copy {
    max-height: none;
  }
  .modal-card.stock-analysis-modal {
    width: min(96vw, 720px);
    max-width: 96vw;
    min-width: 0;
    height: auto;
    min-height: 0;
    max-height: min(90vh, 900px);
  }
}
@media (max-width: 720px) {
  .watch-card-actions { max-width: 100%; justify-content: stretch; }
  .watch-analyze-inline { width: 100%; }
  .watch-analyze-inline input#watch-analyze-code { max-width: none; }
}
.stock-analysis-result {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}
.stock-analysis-verdict {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px 14px;
  margin-bottom: 12px;
  font-size: 15px;
}
.stock-analysis-verdict .muted {
  display: block;
  font-size: 13px;
  margin-bottom: 3px;
}
.stock-analysis-verdict strong,
.stock-analysis-verdict .tag,
.stock-analysis-verdict .muted-pill {
  font-size: 16px;
}
.stock-analysis-summary {
  margin: 0 0 8px;
  font-size: 15px;
  line-height: 1.6;
}
.stock-analysis-reasons {
  margin: 0 0 10px;
  padding-left: 1.2rem;
  color: var(--text);
  font-size: 15px;
}
.stock-analysis-reasons li {
  margin: 0.28rem 0;
  line-height: 1.55;
}
.stock-analysis-llm {
  margin: 0 0 8px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: rgba(226, 188, 98, 0.07);
  border: 1px solid rgba(226, 188, 98, 0.22);
  font-size: 15px;
  line-height: 1.55;
}
.stock-analysis-risk {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
}

/* desk70: day-K hover tooltip uses canvas overlay */
/* desk69: larger labels inside analysis modal */
.stock-analysis-modal .stock-chart-card > header {
  font-size: 14px;
  gap: 8px;
}
.stock-analysis-modal .stock-chart-card > header strong {
  font-size: 15px;
}
.stock-analysis-modal .chart-legend {
  font-size: 12px;
}
.stock-analysis-modal .stock-analysis-mark-chips + .muted,
.stock-analysis-modal .stock-analysis-copy > .muted {
  font-size: 14px;
}

.chart-legend {
  margin-left: 6px;
  font-size: 11px;
  color: var(--muted, #8d9b90);
  white-space: nowrap;
}
.chart-legend i {
  font-style: normal;
  margin: 0 2px 0 4px;
  font-weight: 700;
}
.chart-legend .lg-start { color: #2fbf71; }
.chart-legend .lg-end { color: #e0b85a; }
.chart-legend .lg-down { color: #e15a4a; }
.chart-legend .lg-squeeze { color: #7c6cff; }
.chart-legend .lg-break { color: #3db7e8; }
.chart-legend .legend-prio { margin-left: 6px; font-size: 10px; opacity: 0.75; }


/* desk52: watchlist score distribution + threshold-crossing */
.watch-score-stats { display: grid; gap: 12px; }
.watch-score-kpis { flex-wrap: wrap; gap: 8px; }
.watch-score-chip strong { font-weight: 700; }
.watch-score-chip.buy { border-color: #6a4038; }
.watch-score-chip.obs { border-color: #3e5568; }
.watch-score-chip.below { border-color: #3e6b4e; }
.watch-score-hist {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
  min-height: 88px;
  padding: 4px 2px 0;
}
.watch-score-bar {
  display: grid;
  grid-template-rows: 56px auto auto;
  justify-items: center;
  gap: 4px;
  text-align: center;
}
.watch-score-bar-fill {
  align-self: end;
  width: 42%;
  min-width: 10px;
  max-width: 28px;
  border-radius: 6px 6px 2px 2px;
  background: #3e5568;
  min-height: 2px;
}
.watch-score-bar.below .watch-score-bar-fill { background: var(--down); opacity: 0.75; }
.watch-score-bar.obs .watch-score-bar-fill { background: #5a7a92; }
.watch-score-bar.buy .watch-score-bar-fill,
.watch-score-bar.high .watch-score-bar-fill { background: var(--up); opacity: 0.85; }
.watch-score-bar strong { font-size: 16px; font-weight: 700; letter-spacing: -0.02em; }
.watch-score-bar span { font-size: 11px; color: var(--muted); line-height: 1.2; }
@media (max-width: 720px) {
  .watch-score-hist { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}


/* desk65: smooth quote tick + polished watch analyze input */
[data-q-price], [data-q-pct], [data-q-pnl] {
  transition: color 0.25s ease, opacity 0.2s ease;
}
[data-q-price].q-flash,
[data-q-pct].q-flash {
  opacity: 0.72;
}
.watch-analyze-inline input#watch-analyze-code {
  flex: 1 1 13rem;
  width: auto;
  min-width: 11rem;
  max-width: 22rem;
  margin: 0;
  padding: 0.58rem 0.9rem;
  border-radius: 10px;
  border: 1px solid rgba(226, 188, 98, 0.3);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 55%),
    rgba(0, 0, 0, 0.32);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.35;
  font-variant-numeric: normal;
  letter-spacing: 0.01em;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}
.watch-analyze-inline input#watch-analyze-code::placeholder {
  color: rgba(232, 226, 210, 0.42);
}
.watch-analyze-inline input#watch-analyze-code:hover {
  border-color: rgba(226, 188, 98, 0.45);
}
.watch-analyze-inline input#watch-analyze-code:focus {
  outline: none;
  border-color: rgba(226, 188, 98, 0.72);
  box-shadow:
    0 0 0 3px rgba(226, 188, 98, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), transparent 55%),
    rgba(0, 0, 0, 0.38);
}
.watch-analyze-inline #watch-analyze-btn {
  flex: 0 0 auto;
  min-height: 2.35rem;
  padding-left: 1.05rem;
  padding-right: 1.05rem;
  border-radius: 10px;
}


/* desk68: 分时 ~20% of row; larger metric text; spark title centered */
.holdings-table-wrap,
.watch-table-wrap {
  overflow-x: auto;
}
table.holdings-table,
table.watch-table {
  table-layout: fixed;
  width: 100%;
  min-width: 0;
}
table.holdings-table th,
table.holdings-table td,
table.watch-table th,
table.watch-table td {
  vertical-align: middle;
}
/* holdings: 1名称 2分时 3–8指标 9主力 */
table.holdings-table th:nth-child(1),
table.holdings-table td:nth-child(1) {
  width: 12%;
  text-align: left;
}
table.holdings-table th.spark-th,
table.holdings-table th:nth-child(2),
table.holdings-table td.spark-cell {
  width: 20%;
  min-width: 0;
  padding-left: 6px;
  padding-right: 6px;
  text-align: center;
}
table.holdings-table th:nth-child(n+3):nth-child(-n+8),
table.holdings-table td:nth-child(n+3):nth-child(-n+8),
table.holdings-table td.hold-metric {
  width: 7.5%;
  max-width: 7.5rem;
  padding-left: 4px;
  padding-right: 4px;
  text-align: center;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
}
table.holdings-table th:nth-child(n+3):nth-child(-n+8) {
  font-size: 13px;
  font-weight: 600;
}
table.holdings-table th:nth-child(9),
table.holdings-table td:nth-child(9) {
  width: 11%;
  font-size: 12px;
}
/* watch: 1# 2名称 3分时 4–7指标 8理由 */
table.watch-table th:nth-child(1),
table.watch-table td:nth-child(1) {
  width: 2.6rem;
  text-align: center;
  padding-left: 4px;
  padding-right: 4px;
  font-size: 13px;
}
table.watch-table th:nth-child(2),
table.watch-table td:nth-child(2) {
  width: 11%;
  text-align: left;
}
table.watch-table th.spark-th,
table.watch-table th:nth-child(3),
table.watch-table td.spark-cell {
  width: 20%;
  min-width: 0;
  padding-left: 6px;
  padding-right: 6px;
  text-align: center;
}
table.watch-table th:nth-child(n+4):nth-child(-n+7),
table.watch-table td:nth-child(n+4):nth-child(-n+7),
table.watch-table td.watch-metric {
  width: 8%;
  max-width: 7.5rem;
  padding-left: 4px;
  padding-right: 4px;
  text-align: center;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
}
table.watch-table th:nth-child(n+4):nth-child(-n+7) {
  font-size: 13px;
  font-weight: 600;
}
table.watch-table th:nth-child(8),
table.watch-table td:nth-child(8) {
  width: 12%;
  font-size: 12px;
  text-align: left;
}
table.holdings-table td.spark-cell .spark-min,
table.watch-table td.spark-cell .spark-min {
  width: 100% !important;
  max-width: 100%;
  height: 52px;
  display: block;
  margin: 0 auto;
}
/* desk68: spark Y from price range; entry=point markers only; ~20% width */
/* desk67: spark back to desk65 height; clean line + light dots/wash */

th.spark-th {
  text-align: center !important;
}
@media (max-width: 900px) {
  table.holdings-table th:nth-child(2),
  table.holdings-table td.spark-cell,
  table.watch-table th:nth-child(3),
  table.watch-table td.spark-cell {
    width: 18%;
  }
  table.holdings-table,
  table.watch-table {
    min-width: 720px;
  }
}


/* desk67: day-K pan/zoom affordance */
canvas[data-day-canvas],
canvas[data-analyze-day-canvas] {
  touch-action: none;
  cursor: grab;
  width: 100%;
  display: block;
}
canvas[data-day-canvas]:active,
canvas[data-analyze-day-canvas]:active {
  cursor: grabbing;
}
