/* =======================================================================
   智眸 Web 桌面版 · 视觉与 App 保持一致
   浅色：底 #F5F7FA / 卡 #FFF / 主色红 #E8443A
   深色：底 #1F2630 / 卡 #2E3744（App「深灰蓝」主题）
   ======================================================================= */

:root {
  --bg: #f5f7fa;
  --surface: #ffffff;
  --surface-2: #f1f4f9;
  --surface-3: #fafbfd;
  --line: #e9edf4;
  --line-strong: #dfe5ef;
  --text: #15181d;
  --sub: #6b7280;
  --weak: #9aa3b2;
  --brand: #e8443a;
  --brand-soft: #fdecea;
  --up: #e5484d;
  --down: #12a150;
  --warn: #f59e0b;
  --ok: #12a150;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 8px 24px -16px rgba(16, 24, 40, .18);
  --radius: 14px;
}

html[data-theme="dark"] {
  --bg: #1f2630;
  --surface: #2e3744;
  --surface-2: #262e3a;
  --surface-3: #232a36;
  --line: #3a4453;
  --line-strong: #454f60;
  --text: #f2f3f5;
  --sub: #96a0b0;
  --weak: #6b7484;
  --brand: #f4625a;
  --brand-soft: #3a2a2a;
  --up: #ff6b63;
  --down: #2ecc7a;
  --ok: #2ecc7a;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 12px 28px -18px rgba(0, 0, 0, .6);
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body {
  height: 100%;
  margin: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei",
    "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  font-size: 13px;
  -webkit-font-smoothing: antialiased;
}

button, input { font-family: inherit; }

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: var(--weak); }
::-webkit-scrollbar-track { background: transparent; }

.muted { color: var(--sub); font-size: 12px; }
.mono { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }

/* ------------------------------------------------------------------ 框架 */
.shell {
  display: flex;
  height: 100vh;
  min-width: 1040px;
}

/* ------------------------------- 侧栏 */
.side {
  width: 216px;
  flex: 0 0 216px;
  background: var(--surface);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 20px 14px 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 6px 22px;
}

.brand-logo {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(145deg, #f2635a, #d8342b);
  color: #fff;
  font-size: 17px;
  font-weight: 700;
  display: grid;
  place-items: center;
  box-shadow: 0 6px 14px -6px rgba(232, 68, 58, .7);
}

.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-text b { font-size: 15px; letter-spacing: .4px; }
.brand-text span { font-size: 10.5px; color: var(--weak); }

.nav { display: flex; flex-direction: column; gap: 3px; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--sub);
  text-decoration: none;
  cursor: pointer;
  font-size: 13.5px;
  transition: background .14s, color .14s;
}

.nav-item:hover { background: var(--surface-2); color: var(--text); }

.nav-item.active {
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 600;
}

.nav-item svg { flex: 0 0 17px; }

.side-foot {
  margin-top: auto;
  padding: 12px 8px 2px;
  border-top: 1px solid var(--line);
}

.side-tip { font-size: 11px; color: var(--weak); }
.side-ver { font-size: 11px; color: var(--weak); margin-top: 3px; }

/* ------------------------------- 主区 */
.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.topbar {
  height: 58px;
  flex: 0 0 58px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 22px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.crumb { font-size: 15px; font-weight: 600; min-width: 56px; }

.search-wrap {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 300px;
  height: 34px;
  padding: 0 11px;
  border-radius: 9px;
  background: var(--surface-2);
  border: 1px solid transparent;
  color: var(--weak);
  transition: border-color .15s, background .15s;
}

.search-wrap:focus-within { border-color: var(--brand); background: var(--surface); }

.search-wrap input {
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 13px;
}

.search-wrap input::placeholder { color: var(--weak); }

.top-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.conn {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--surface-2);
  font-size: 12.5px;
  color: var(--sub);
  cursor: pointer;
  user-select: none;
  transition: background .15s;
}

.conn:hover { background: var(--surface-3); }
.conn i { width: 7px; height: 7px; border-radius: 50%; background: var(--weak); }
.conn.ok i { background: var(--ok); box-shadow: 0 0 0 3px rgba(18, 161, 80, .14); }
.conn.warn i { background: var(--warn); box-shadow: 0 0 0 3px rgba(245, 158, 11, .14); }
.conn.bad i { background: var(--up); box-shadow: 0 0 0 3px rgba(229, 72, 77, .14); }
.conn b { font-weight: 600; color: var(--text); }

.icon-btn {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--sub);
  cursor: pointer;
  font-size: 14px;
  display: grid;
  place-items: center;
  transition: .15s;
}

.icon-btn:hover { border-color: var(--line-strong); color: var(--text); }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 15px;
  border: 0;
  border-radius: 9px;
  background: var(--brand);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: filter .15s, transform .06s;
}

.btn:hover { filter: brightness(1.05); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.ghost { background: var(--surface-2); color: var(--text); border: 1px solid var(--line); }

/* ------------------------------- 视图 */
.view {
  flex: 1;
  overflow-y: auto;
  padding: 18px 22px 40px;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 10px;
}

.panel-head h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 7px;
}

.head-tools { display: flex; align-items: center; gap: 12px; }

/* ------------------------------- 统计卡 */
.stat-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr) 1.35fr;
  gap: 12px;
  margin-bottom: 14px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow);
  min-height: 84px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
}

.stat-card .s-top { display: flex; align-items: center; justify-content: space-between; }
.stat-card .s-name { font-size: 12px; color: var(--sub); font-weight: 600; letter-spacing: .3px; }
.stat-card .s-price { font-size: 20px; font-weight: 700; letter-spacing: -.3px; }
.stat-card .s-chg { font-size: 12.5px; font-weight: 600; }
.stat-card.wide { gap: 8px; }
.stat-rows { display: flex; flex-direction: column; gap: 6px; }
.stat-line { display: flex; justify-content: space-between; font-size: 12px; }
.stat-line span { color: var(--sub); }
.stat-line b { font-weight: 600; }

.skeleton {
  background: linear-gradient(100deg, var(--surface) 30%, var(--surface-2) 50%, var(--surface) 70%);
  background-size: 220% 100%;
  animation: sk 1.2s infinite linear;
}
@keyframes sk { to { background-position: -220% 0; } }

/* ------------------------------- 榜单 */
.board-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 14px;
}

.board { padding: 0 6px 8px; }

.b-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 9px;
  cursor: pointer;
  transition: background .12s;
}

.b-row:hover { background: var(--surface-2); }
.b-idx { width: 16px; font-size: 11px; color: var(--weak); }
.b-sym { font-weight: 600; font-size: 12.5px; min-width: 74px; }
.b-price { margin-left: auto; font-size: 12.5px; color: var(--sub); }
.b-chg { width: 74px; text-align: right; font-weight: 600; font-size: 12.5px; }

.dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; }
.dot.up { background: var(--up); }
.dot.down { background: var(--down); }
.dot.ok { background: var(--ok); }
.dot.key { background: #8b7cf6; }
.dot.warn { background: var(--warn); }
.dot.bad { background: var(--up); }

/* ------------------------------- 表格 */
.table-panel { display: flex; flex-direction: column; overflow: hidden; }
.table-scroll { max-height: calc(100vh - 400px); overflow-y: auto; }

.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

.tbl thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--surface-3);
  color: var(--sub);
  font-weight: 600;
  font-size: 11.5px;
  text-align: left;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.tbl th.num, .tbl td.num { text-align: right; }
.tbl th.sortable { cursor: pointer; user-select: none; }
.tbl th.sortable:hover { color: var(--text); }
.tbl th.sorted { color: var(--brand); }
.tbl th.sorted::after { content: " ↓"; font-size: 10px; }
.tbl th.sorted.asc::after { content: " ↑"; }

.tbl tbody tr {
  cursor: pointer;
  transition: background .1s;
}

.tbl tbody tr:hover { background: var(--surface-2); }
.tbl td { padding: 9px 12px; border-bottom: 1px solid var(--line); }

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

.coin-cell { display: flex; align-items: center; gap: 9px; }

.coin-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  background: #94a3b8;
  flex: 0 0 26px;
  letter-spacing: -.3px;
}

.coin-name { display: flex; flex-direction: column; line-height: 1.3; }
.coin-name b { font-size: 12.5px; font-weight: 600; }
.coin-name span { font-size: 10.5px; color: var(--weak); }

.tag {
  font-size: 9.5px;
  padding: 1px 5px;
  border-radius: 5px;
  background: var(--surface-2);
  color: var(--sub);
  font-style: normal;
  font-weight: 600;
}

.tag.perp { background: rgba(139, 124, 246, .14); color: #7c6cf0; }

.spark { width: 74px; height: 22px; }

.up { color: var(--up); }
.down { color: var(--down); }

.pill-chg {
  display: inline-block;
  min-width: 62px;
  padding: 2px 7px;
  border-radius: 6px;
  text-align: right;
  font-weight: 600;
}

.pill-chg.up { background: rgba(229, 72, 77, .1); }
.pill-chg.down { background: rgba(18, 161, 80, .1); }

.table-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.tbl-empty { padding: 40px; text-align: center; color: var(--weak); }

/* ------------------------------- 数据源 */
.source-top { display: flex; flex-direction: column; gap: 12px; margin-bottom: 14px; }

.summary {
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 18px 22px;
}

.sum-left { display: flex; flex-direction: column; }
.sum-num { font-size: 34px; font-weight: 700; line-height: 1; letter-spacing: -1px; }
.sum-label { font-size: 11.5px; color: var(--sub); margin-top: 6px; }
.sum-mid { display: flex; flex-direction: column; gap: 6px; }
.sum-line { font-size: 12.5px; color: var(--sub); display: flex; gap: 5px; align-items: baseline; }
.sum-line b { color: var(--text); font-size: 13.5px; }
.summary .btn { margin-left: auto; }

.legend {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 12px 18px;
  font-size: 11.5px;
  color: var(--sub);
  flex-wrap: wrap;
}
.legend span { display: flex; align-items: center; gap: 6px; }

.source-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 12px;
}

.src-card { padding: 0 0 8px; display: flex; flex-direction: column; align-self: stretch; }

.src-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 15px 9px;
  border-bottom: 1px solid var(--line);
}

.src-head h4 { margin: 0; font-size: 13px; font-weight: 600; }
.src-head .meta { font-size: 11px; color: var(--weak); }

.src-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 15px;
  font-size: 12px;
}

.src-item:hover { background: var(--surface-2); }
.src-item .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.src-item .host { font-size: 10.5px; color: var(--weak); }
.src-item .ms { font-variant-numeric: tabular-nums; font-weight: 600; width: 62px; text-align: right; flex: 0 0 62px; }
.src-item .ms.slow { color: var(--warn); }
.src-item .code { font-size: 10px; color: var(--weak); width: 40px; text-align: right; flex: 0 0 40px; }

/* ------------------------------- 关于 */
.about { padding: 26px 30px; max-width: 780px; line-height: 1.75; }
.about h2 { margin: 0 0 10px; font-size: 20px; }
.about h3 { margin: 20px 0 6px; font-size: 14px; }
.about ul { margin: 0; padding-left: 18px; color: var(--sub); }
.about p { color: var(--sub); }

/* ------------------------------- 抽屉 */
.drawer-mask {
  position: fixed;
  inset: 0;
  background: rgba(16, 22, 32, .38);
  backdrop-filter: blur(1px);
  z-index: 40;
  animation: fade .15s ease-out;
}

@keyframes fade { from { opacity: 0; } }

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(760px, 68vw);
  background: var(--surface);
  border-left: 1px solid var(--line);
  z-index: 41;
  display: flex;
  flex-direction: column;
  box-shadow: -20px 0 50px -30px rgba(0, 0, 0, .5);
  animation: slide .18s cubic-bezier(.2, .8, .3, 1);
}

@keyframes slide { from { transform: translateX(30px); opacity: .4; } }

.drawer-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}

.d-title { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 700; }
.d-price { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.drawer-head .icon-btn { margin-left: auto; }

.drawer-body { flex: 1; padding: 14px 16px 18px; display: flex; flex-direction: column; gap: 10px; min-height: 0; }

.d-toolbar { display: flex; align-items: center; gap: 14px; }
.d-ohlc { display: flex; gap: 14px; font-size: 11.5px; color: var(--sub); font-variant-numeric: tabular-nums; flex-wrap: wrap; }
.d-ohlc b { color: var(--text); font-weight: 600; }

#kline { width: 100%; flex: 1; min-height: 320px; }

/* 分段控件 */
.seg {
  display: inline-flex;
  background: var(--surface-2);
  border-radius: 8px;
  padding: 2px;
  gap: 2px;
}

.seg button {
  border: 0;
  background: transparent;
  color: var(--sub);
  font-size: 11.5px;
  padding: 5px 11px;
  border-radius: 6px;
  cursor: pointer;
  transition: .13s;
}

.seg button:hover { color: var(--text); }
.seg button.on { background: var(--surface); color: var(--brand); font-weight: 600; box-shadow: 0 1px 3px rgba(0, 0, 0, .08); }

/* ------------------------------- toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 34px;
  transform: translateX(-50%);
  background: rgba(24, 30, 40, .92);
  color: #fff;
  padding: 9px 16px;
  border-radius: 10px;
  font-size: 12.5px;
  z-index: 60;
  animation: fade .16s;
}

@media (max-width: 1320px) {
  .stat-row { grid-template-columns: repeat(3, 1fr) 1.3fr; }
  .stat-row .stat-card:nth-child(4) { display: none; }
}

/* =======================================================================
   v1.1 新增：账号、自选、管理后台
   ======================================================================= */

.btn.block { width: 100%; justify-content: center; }
.btn.lg { height: 40px; font-size: 14px; border-radius: 10px; }

.side-foot .btn.block { height: 34px; font-size: 13px; }

.ucard { display: flex; align-items: center; gap: 9px; padding: 2px 2px 8px; }
.uavatar {
  width: 30px; height: 30px; border-radius: 9px;
  background: linear-gradient(145deg, #f2635a, #d8342b);
  color: #fff; font-size: 12px; font-weight: 700;
  display: grid; place-items: center; flex: 0 0 30px;
}
.uinfo { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.uinfo b { font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uinfo span { font-size: 10.5px; color: var(--weak); }

.uacts { display: flex; gap: 14px; padding: 0 2px 4px; }
.linkbtn {
  border: 0; background: none; padding: 0; cursor: pointer;
  font-size: 11.5px; color: var(--sub);
}
.linkbtn:hover { color: var(--brand); }

.notice {
  display: flex; align-items: flex-start; gap: 9px;
  background: var(--brand-soft); border: 1px solid rgba(232, 68, 58, .18);
  color: var(--brand); border-radius: 12px;
  padding: 12px 16px; margin-bottom: 14px; font-size: 12.5px; line-height: 1.6;
}

.col-star { width: 42px; min-width: 42px; }
.star {
  border: 0; background: none; cursor: pointer; padding: 0;
  font-size: 14px; line-height: 1; color: var(--line-strong);
  transition: color .12s, transform .12s;
}
.star:hover { transform: scale(1.15); }
.star.on { color: #f0b90b; }

/* ---------------- 弹窗 ---------------- */
.modal-mask {
  position: fixed; inset: 0; z-index: 70;
  background: rgba(16, 22, 32, .42);
  display: flex; align-items: center; justify-content: center;
  animation: fade .15s;
}

.modal {
  width: 400px;
  background: var(--surface);
  border-radius: 18px;
  box-shadow: 0 30px 70px -30px rgba(0, 0, 0, .55);
  overflow: hidden;
  animation: pop .18s cubic-bezier(.2, .9, .3, 1);
}

.modal.small { width: 360px; }

@keyframes pop { from { transform: translateY(10px) scale(.98); opacity: .6; } }

.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px 6px;
}
.modal-head h2 { margin: 0; font-size: 17px; }

.modal-tabs {
  display: flex; gap: 20px; padding: 6px 20px 0;
  border-bottom: 1px solid var(--line);
}
.modal-tabs button {
  border: 0; background: none; cursor: pointer;
  padding: 8px 2px 11px; font-size: 13.5px; color: var(--sub);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.modal-tabs button.on { color: var(--brand); border-color: var(--brand); font-weight: 600; }

.modal-body { padding: 16px 20px 20px; display: flex; flex-direction: column; gap: 12px; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 11.5px; color: var(--sub); }

.field input, .txt {
  height: 38px; border-radius: 9px;
  border: 1px solid var(--line); background: var(--surface-2);
  padding: 0 12px; font-size: 13px; color: var(--text);
  outline: none; transition: border-color .15s, background .15s;
}
.field input:focus, .txt:focus { border-color: var(--brand); background: var(--surface); }

select.txt { padding: 0 8px; cursor: pointer; }

.form-err {
  background: rgba(229, 72, 77, .09);
  color: var(--up); border-radius: 8px;
  padding: 8px 11px; font-size: 12px;
}

.form-tip { margin: 2px 0 0; font-size: 11px; color: var(--weak); text-align: center; }

/* ---------------- 管理后台 ---------------- */
.admin-top { display: grid; grid-template-columns: 1fr 1.15fr; gap: 12px; margin-bottom: 14px; }

.admin-stat { display: flex; align-items: center; gap: 34px; padding: 20px 24px; }
.admin-stat div { display: flex; flex-direction: column; gap: 5px; }
.admin-stat b { font-size: 26px; font-weight: 700; line-height: 1; }
.admin-stat span { font-size: 11.5px; color: var(--sub); }

.admin-switch { padding: 16px 20px; display: flex; flex-direction: column; gap: 12px; }
.as-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.as-row > div { display: flex; flex-direction: column; gap: 3px; }
.as-row b { font-size: 13px; }
.as-row span { font-size: 11px; color: var(--sub); }
.as-row .txt { flex: 1; }

.switch { position: relative; display: inline-flex; width: 42px; height: 24px; flex: 0 0 42px; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch i {
  position: absolute; inset: 0; border-radius: 999px;
  background: var(--line-strong); transition: background .16s;
}
.switch i::after {
  content: ""; position: absolute; top: 3px; left: 3px;
  width: 18px; height: 18px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .16s;
}
.switch input:checked + i { background: var(--brand); }
.switch input:checked + i::after { transform: translateX(18px); }

.mini {
  border: 1px solid var(--line); background: var(--surface);
  color: var(--sub); border-radius: 7px; cursor: pointer;
  font-size: 11.5px; padding: 4px 9px; margin-left: 5px;
}
.mini:hover { color: var(--brand); border-color: var(--brand); }
.mini.danger:hover { color: var(--up); border-color: var(--up); }
.badge {
  display: inline-block; padding: 2px 7px; border-radius: 5px;
  font-size: 10.5px; font-weight: 600;
}
.badge.admin { background: rgba(232, 68, 58, .12); color: var(--brand); }
.badge.user { background: var(--surface-2); color: var(--sub); }
.badge.on { background: rgba(18, 161, 80, .12); color: var(--ok); }
.badge.off { background: rgba(229, 72, 77, .12); color: var(--up); }

#searchWrap.hide { display: none; }

/* =======================================================================
   v1.2：分组导航 + 通用功能页
   ======================================================================= */

.nav-group { margin-bottom: 2px; }
.nav-group > .nav-label {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 12px 5px; font-size: 10.5px; letter-spacing: .08em;
  color: var(--weak); text-transform: uppercase; cursor: pointer; user-select: none;
}
.nav-group > .nav-label svg { transition: transform .18s; opacity: .7; }
.nav-group.collapsed > .nav-label svg { transform: rotate(-90deg); }
.nav-group.collapsed .nav-sub { display: none; }

.nav-sub { display: flex; flex-direction: column; gap: 1px; }
.nav-sub .nav-item {
  padding: 6px 12px 6px 14px; font-size: 12.5px;
  border-left: 2px solid transparent; border-radius: 0 8px 8px 0;
}
.nav-sub .nav-item.active { border-left-color: var(--brand); background: var(--brand-soft); }

.page-body { display: flex; flex-direction: column; gap: 14px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
@media (max-width: 1180px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } .grid-3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 900px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

.kpi { padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; }
.kpi .k-label { font-size: 11.5px; color: var(--sub); }
.kpi .k-val { font-size: 22px; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi .k-sub { font-size: 11px; color: var(--weak); }

.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.toolbar .txt { height: 34px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--line); background: var(--surface); color: var(--sub);
  border-radius: 999px; padding: 5px 11px; font-size: 12px; cursor: pointer;
  transition: all .14s;
}
.chip:hover { color: var(--text); border-color: var(--line-strong); }
.chip.on { background: var(--brand); border-color: var(--brand); color: #fff; }

.bar { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--brand); border-radius: 999px; }

.gauge { display: flex; align-items: center; gap: 14px; }
.gauge-num { font-size: 40px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }

.news-list { display: flex; flex-direction: column; }
.news-item { padding: 14px 18px; border-bottom: 1px solid var(--line); display: flex; gap: 12px; }
.news-item:last-child { border-bottom: 0; }
.news-item .nt { font-size: 13.5px; font-weight: 600; line-height: 1.5; margin-bottom: 5px; }
.news-item .nb { font-size: 12px; color: var(--sub); line-height: 1.65; }
.news-item .nm { font-size: 10.5px; color: var(--weak); margin-top: 6px; display: flex; gap: 10px; }

.empty-state { padding: 44px 20px; text-align: center; color: var(--weak); font-size: 12.5px; }

.loading-row { padding: 30px; text-align: center; color: var(--weak); font-size: 12.5px; }
.spinner {
  width: 18px; height: 18px; border: 2px solid var(--line-strong);
  border-top-color: var(--brand); border-radius: 50%;
  animation: spin .8s linear infinite; display: inline-block; vertical-align: -3px; margin-right: 8px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.tag-pill {
  display: inline-block; padding: 1px 6px; border-radius: 4px;
  font-size: 10px; font-weight: 600; background: var(--surface-2); color: var(--sub);
}
.pos { color: var(--up); }
.neg { color: var(--down); }
.mono { font-variant-numeric: tabular-nums; }

.side { overflow-y: auto; }
.nav { overflow: visible; }

/* v1.2 修复：合约表格操作列按钮换行导致右侧被裁 */
.table-scroll { overflow-x: auto; }
.tbl td .mini { white-space: nowrap; }
.tbl td .mini { margin-left: 0; padding: 3px 7px; font-size: 11px; }
.table-scroll .tbl { min-width: 100%; }

/* =======================================================================
   v1.3：登录门禁
   ======================================================================= */
.gate {
  position: fixed; inset: 0; z-index: 90; display: flex;
  background: var(--bg);
}
.gate-left {
  flex: 1 1 56%; padding: 56px 6vw 40px; display: flex; flex-direction: column;
  background:
    radial-gradient(900px 480px at -10% -10%, rgba(232,68,58,.16), transparent 62%),
    radial-gradient(700px 420px at 110% 110%, rgba(46,186,198,.14), transparent 60%),
    var(--surface-2);
  position: relative; overflow: hidden;
}
html[data-theme="dark"] .gate-left {
  background:
    radial-gradient(900px 480px at -10% -10%, rgba(244,98,90,.18), transparent 62%),
    radial-gradient(700px 420px at 110% 110%, rgba(46,186,198,.14), transparent 60%),
    var(--surface);
}
.gate-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 60px; }
.brand-logo.lg { width: 46px; height: 46px; border-radius: 14px; font-size: 22px; }
.gate-brand b { display: block; font-size: 17px; letter-spacing: .04em; }
.gate-brand span { font-size: 11.5px; color: var(--sub); letter-spacing: .1em; }
.gate-left h1 {
  font-size: 34px; line-height: 1.35; margin: 0 0 34px; letter-spacing: -.01em;
  font-weight: 800;
}
.gate-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 16px; max-width: 520px; }
.gate-list li { display: flex; gap: 12px; align-items: flex-start; }
.gate-list i {
  font-style: normal; color: var(--brand); font-size: 13px; line-height: 22px;
  width: 22px; height: 22px; border-radius: 7px; background: var(--brand-soft);
  display: inline-flex; align-items: center; justify-content: center; flex: none;
}
.gate-list b { display: block; font-size: 13.5px; margin-bottom: 3px; }
.gate-list span { font-size: 12px; color: var(--sub); line-height: 1.6; }
.gate-foot { margin-top: auto; font-size: 11px; color: var(--weak); }

.gate-right {
  flex: 0 0 40%; min-width: 400px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; padding: 40px; gap: 18px;
  background: var(--surface);
  border-left: 1px solid var(--line);
}
.gate-card { width: 100%; max-width: 348px; }
.gate-tabs { display: flex; gap: 20px; border-bottom: 1px solid var(--line); margin-bottom: 22px; }
.gate-tabs button {
  background: none; border: 0; padding: 0 0 10px; font-size: 15px; cursor: pointer;
  color: var(--sub); border-bottom: 2px solid transparent; font-weight: 600;
}
.gate-tabs button.on { color: var(--text); border-bottom-color: var(--brand); }
.gate-body { display: flex; flex-direction: column; gap: 14px; }
.gate-body .field input { height: 40px; }
.gate-meta { font-size: 11px; color: var(--weak); }
.form-tip { font-size: 11.5px; color: var(--sub); line-height: 1.7; margin: 2px 0 0; }
.form-err {
  font-size: 12px; color: var(--up); background: rgba(229,72,77,.08);
  border: 1px solid rgba(229,72,77,.2); border-radius: 8px; padding: 8px 10px;
}
@media (max-width: 980px) {
  .gate-left { display: none; }
  .gate-right { flex: 1 1 100%; min-width: 0; }
}

/* ---------------- 版本发布面板 ---------------- */
.release-body { display: flex; gap: 20px; padding: 16px 18px 20px; }
.rel-form { flex: 1 1 auto; display: flex; flex-direction: column; gap: 12px; }
.rel-row { display: flex; gap: 12px; align-items: flex-end; }
.rel-row > .field { flex: 1; }
.rel-check { font-size: 12px; color: var(--sub); display: flex; align-items: center; gap: 6px; white-space: nowrap; padding-bottom: 9px; }
.rel-actions { display: flex; align-items: center; gap: 12px; }
.rel-form textarea.txt { height: auto; padding: 9px 11px; resize: vertical; line-height: 1.6; }
.rel-side { flex: 0 0 260px; border-left: 1px solid var(--line); padding-left: 18px; }
.rel-side > b { font-size: 12.5px; display: block; margin-bottom: 10px; }
.rel-history { display: flex; flex-direction: column; gap: 10px; max-height: 220px; overflow: auto; }
.rel-item { font-size: 11.5px; border-bottom: 1px dashed var(--line); padding-bottom: 8px; }
.rel-h { display: flex; align-items: baseline; gap: 8px; }

/* ---------------- v1.3 页面通用件 ---------------- */
.heat { display: grid; gap: 6px; }
.heat-cell {
  border-radius: 8px; padding: 8px 10px; font-size: 11.5px;
  border: 1px solid var(--line); background: var(--surface-3);
  display: flex; flex-direction: column; gap: 2px;
}
.heat-cell b { font-size: 12.5px; }
.tagline { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.bubble {
  max-width: 84%; padding: 11px 13px; border-radius: 12px; font-size: 12.5px;
  line-height: 1.72; white-space: pre-wrap; word-break: break-word;
}
.bubble.long { background: rgba(229,72,77,.09); border: 1px solid rgba(229,72,77,.22); align-self: flex-start; }
.bubble.short { background: rgba(18,161,80,.09); border: 1px solid rgba(18,161,80,.22); align-self: flex-end; }
.bubble.judge { background: var(--surface-2); border: 1px solid var(--line); align-self: center; max-width: 96%; }
.bubble .who { display: block; font-size: 10.5px; color: var(--sub); margin-bottom: 5px; font-weight: 600; }
.debate { display: flex; flex-direction: column; gap: 12px; padding: 16px 18px; }
.step-list { display: flex; flex-direction: column; gap: 8px; }
.step {
  display: flex; gap: 10px; align-items: flex-start; font-size: 12.5px; line-height: 1.65;
  padding: 10px 12px; border-radius: 10px; background: var(--surface-3); border: 1px solid var(--line);
}
.step em { font-style: normal; color: var(--brand); font-weight: 700; flex: none; width: 18px; }
.kv { display: grid; grid-template-columns: 96px 1fr; gap: 8px 12px; font-size: 12.5px; }
.kv span { color: var(--sub); }
.hl { background: rgba(245,158,11,.14); border-radius: 4px; padding: 0 3px; }
