/* SafeTrade AutoSwap — 浅色主题 */
:root {
  --bg: #f5f6f8;
  --panel: #ffffff;
  --line: #e7e9ee;
  --line-strong: #d8dce4;
  --text: #14171d;
  --text-2: #4a5160;
  --muted: #8b93a3;
  --brand: #2563eb;
  --brand-soft: #eef3ff;
  --up: #dc2626;   /* 涨：红 */
  --down: #16a34a; /* 跌：绿 */
  --teal: #0d9488;
  --warn: #d97706;
  --warn-soft: #fff7ed;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 8px 24px -12px rgba(16, 24, 40, 0.12);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 16px;
  height: 60px;
  padding: 0 24px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.01em;
}

.brand .logo {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: linear-gradient(135deg, #2563eb, #0d9488);
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 13px;
  font-weight: 800;
}

.brand small {
  font-weight: 500;
  color: var(--muted);
  font-size: 12px;
  margin-left: 2px;
}

.topbar .spacer { flex: 1; }

.nav {
  display: flex;
  gap: 4px;
  background: #f1f3f7;
  padding: 3px;
  border-radius: 10px;
}

.nav a {
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--text-2);
  font-weight: 500;
  transition: 0.15s;
}

.nav a.on {
  background: #fff;
  color: var(--text);
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.08);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: #f1f3f7;
  color: var(--text-2);
  border: 1px solid transparent;
}

.status-pill .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted);
}

.status-pill.live { background: #ecfdf5; color: #047857; border-color: #d1fae5; }
.status-pill.live .dot { background: #10b981; box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.16); animation: pulse 2s infinite; }
.status-pill.paused { background: #fff7ed; color: #b45309; border-color: #fed7aa; }
.status-pill.paused .dot { background: #f59e0b; }
.status-pill.dry { background: var(--brand-soft); color: #1d4ed8; border-color: #dbeafe; }
.status-pill.dry .dot { background: var(--brand); }

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.16); }
  50% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0.04); }
}

/* ---------- 布局 ---------- */
.wrap {
  max-width: 1280px;
  margin: 0 auto;
  padding: 22px 24px 56px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

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

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

.card-head h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.card-head .sub {
  font-size: 12px;
  color: var(--muted);
  font-weight: 400;
}

.card-head .spacer { flex: 1; }

/* ---------- KPI ---------- */
.kpis {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}

.kpi {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.kpi .label {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
}

.kpi .value {
  font-size: 24px;
  font-weight: 680;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
}

.kpi .value .unit {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  margin-left: 5px;
  letter-spacing: 0;
}

.kpi .foot {
  margin-top: 8px;
  font-size: 11.5px;
  color: var(--muted);
  display: flex;
  gap: 8px;
  align-items: center;
}

.kpi.accent {
  background: linear-gradient(150deg, #ffffff 0%, #f7faff 100%);
  border-color: #dbe6ff;
}

.kpi.accent .value { color: #1d4ed8; }

.tag {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 600;
  background: #f1f3f7;
  color: var(--text-2);
}

.tag.green { background: #ecfdf5; color: #047857; }
.tag.blue { background: var(--brand-soft); color: #1d4ed8; }
.tag.amber { background: var(--warn-soft); color: #b45309; }

/* ---------- 日历区 ---------- */
.grid-2 {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: 18px;
  align-items: stretch;
}

.month-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.month-nav button {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text-2);
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 13px;
  transition: 0.15s;
}

.month-nav button:hover { background: #f7f8fa; border-color: var(--line-strong); }

.month-title {
  font-size: 13px;
  font-weight: 600;
  min-width: 92px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.cal-body { padding: 14px 18px 8px; }

.cal-week {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin-bottom: 6px;
}

.cal-week span {
  text-align: center;
  font-size: 11px;
  color: var(--muted);
  padding: 4px 0;
  font-weight: 500;
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.cal-cell {
  position: relative;
  aspect-ratio: 1 / 0.92;
  border-radius: 10px;
  border: 1px solid #eef0f4;
  background: #fbfcfd;
  padding: 7px 8px;
  cursor: default;
  transition: transform 0.12s, box-shadow 0.12s, border-color 0.12s;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 62px;
  overflow: hidden;
}

.cal-cell.out { opacity: 0.35; border-style: dashed; }
.cal-cell.has-data { cursor: pointer; }
.cal-cell.has-data:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px -8px rgba(37, 99, 235, 0.4);
  border-color: #bfdbfe;
}
.cal-cell.today { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand) inset; }
.cal-cell.selected { border-color: var(--brand); box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.22); }

.cal-date {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
}

.cal-amt {
  font-size: 12px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cal-cell.lv0 { background: #fbfcfd; }
.cal-cell.lv1 { background: #eff5ff; border-color: #dbeafe; }
.cal-cell.lv2 { background: #dbeafe; border-color: #bfdbfe; }
.cal-cell.lv3 { background: #bdd4fb; border-color: #a4c4f8; }
.cal-cell.lv4 { background: #8db4f6; border-color: #7aa6f2; color: #0b1b33; }
.cal-cell.lv5 { background: #5b8ff0; border-color: #4a80e6; color: #fff; }
.cal-cell.lv5 .cal-date { color: rgba(255, 255, 255, 0.85); }

.cal-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 18px 16px;
  font-size: 11.5px;
  color: var(--muted);
}

.legend {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.legend i {
  width: 13px;
  height: 13px;
  border-radius: 4px;
  display: block;
  border: 1px solid rgba(0, 0, 0, 0.04);
}

/* ---------- 当日明细 ---------- */
.day-panel { display: flex; flex-direction: column; }

.day-amount {
  padding: 20px 18px 6px;
}

.day-amount .big {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.025em;
  font-variant-numeric: tabular-nums;
}

.day-amount .big small {
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
  margin-left: 5px;
  letter-spacing: 0;
}

.day-amount .date { font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }

.day-list {
  flex: 1;
  overflow: auto;
  padding: 8px 10px 14px;
  max-height: 330px;
}

.day-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 9px;
  font-size: 12.5px;
}

.day-row:hover { background: #f8fafc; }

.coin-badge {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  font-size: 10px;
  font-weight: 700;
  background: var(--brand-soft);
  color: #1d4ed8;
  flex: none;
}

.day-row .meta { flex: 1; min-width: 0; }
.day-row .meta b { font-weight: 620; font-size: 12.5px; }
.day-row .meta span { display: block; color: var(--muted); font-size: 11px; margin-top: 1px; }
.day-row .amt { font-weight: 650; font-variant-numeric: tabular-nums; }

/* 区分「程序自己下的单」与「交易所历史成交」 */
.src-tag {
  margin-left: 6px;
  padding: 0 5px;
  border-radius: 5px;
  background: #f1f5f9;
  color: #64748b;
  font-size: 10px;
  font-weight: 600;
  line-height: 16px;
  vertical-align: 1px;
}

.empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.7;
}

.empty .ico { font-size: 22px; display: block; margin-bottom: 8px; opacity: 0.6; }

/* ---------- 价格曲线 ---------- */
.chart-wrap { padding: 8px 10px 14px; position: relative; }
.chart-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px 0;
}

.seg {
  display: inline-flex;
  background: #f1f3f7;
  border-radius: 9px;
  padding: 3px;
  gap: 2px;
}

.seg button {
  border: 0;
  background: transparent;
  padding: 5px 11px;
  border-radius: 7px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-2);
  cursor: pointer;
  transition: 0.15s;
}

.seg button.on { background: #fff; color: var(--brand); box-shadow: 0 1px 2px rgba(16, 24, 40, 0.08); }

.price-now {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 14px 18px 0;
}

.price-now .p {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.025em;
  font-variant-numeric: tabular-nums;
}

.price-now .chg { font-size: 12.5px; font-weight: 650; }
.chg.up { color: var(--up); }
.chg.down { color: var(--down); }

svg.chart { display: block; width: 100%; height: auto; }

.chart-tip {
  position: absolute;
  pointer-events: none;
  background: rgba(20, 23, 29, 0.92);
  color: #fff;
  font-size: 11px;
  padding: 6px 9px;
  border-radius: 7px;
  white-space: nowrap;
  transform: translate(-50%, -120%);
  opacity: 0;
  transition: opacity 0.1s;
  z-index: 5;
  line-height: 1.5;
}

/* ---------- 表格 ---------- */
.table-scroll { overflow-x: auto; }

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

table.tbl th {
  text-align: left;
  padding: 10px 18px;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  background: #fcfcfd;
}

table.tbl td {
  padding: 11px 18px;
  border-bottom: 1px solid #f2f4f7;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

table.tbl tbody tr:last-child td { border-bottom: 0; }
table.tbl tbody tr:hover { background: #fafbfc; }

.mono { font-variant-numeric: tabular-nums; }
.right { text-align: right; }

/* ---------- 登录 / 设置浮层 ---------- */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(4px);
  display: grid;
  place-items: center;
  z-index: 100;
  padding: 20px;
}

.overlay.hidden { display: none; }

.modal {
  width: 100%;
  max-width: 380px;
  background: #fff;
  border-radius: 18px;
  padding: 26px;
  box-shadow: 0 24px 60px -20px rgba(15, 23, 42, 0.4);
}

.modal h1 {
  margin: 0 0 6px;
  font-size: 19px;
  letter-spacing: -0.02em;
}

.modal p.hint {
  margin: 0 0 18px;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.6;
}

.field { margin-bottom: 12px; }

.field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 6px;
}

input[type="text"], input[type="password"], input[type="number"], select, textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  font-size: 13px;
  font-family: inherit;
  color: var(--text);
  background: #fff;
  transition: 0.15s;
  outline: none;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 16px;
  border-radius: 9px;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: 0.15s;
  white-space: nowrap;
}

.btn:hover { background: #f8fafc; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.btn.primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}
.btn.primary:hover { background: #1d4ed8; }

.btn.danger { color: #b91c1c; border-color: #fecaca; background: #fff; }
.btn.danger:hover { background: #fef2f2; }

.btn.block { width: 100%; }
.btn.sm { padding: 6px 11px; font-size: 12px; border-radius: 8px; }

.error-text {
  color: #b91c1c;
  font-size: 12px;
  margin-top: 10px;
  min-height: 16px;
}

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #14171d;
  color: #fff;
  font-size: 12.5px;
  padding: 10px 18px;
  border-radius: 10px;
  opacity: 0;
  transition: 0.25s;
  z-index: 200;
  pointer-events: none;
  max-width: 90vw;
}

.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  border-radius: 11px;
  font-size: 12.5px;
  line-height: 1.5;
  border: 1px solid #fde68a;
  background: var(--warn-soft);
  color: #92400e;
}

.banner.info { background: var(--brand-soft); border-color: #dbeafe; color: #1e40af; }
.banner.hidden { display: none; }
.banner b { font-weight: 650; }

/* ---------- 自适应 ---------- */
@media (max-width: 1080px) {
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid-2 { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  .wrap { padding: 16px 12px 40px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .topbar { padding: 0 14px; gap: 10px; }
  .brand small { display: none; }
  .nav { display: none; }
  .cal-cell { min-height: 48px; padding: 5px 6px; }
  .cal-amt { font-size: 10px; }
  .cal-date { font-size: 10px; }
}

/* ---------- 行内换行 ---------- */
.row.wrap { flex-wrap: wrap; }

/* ---------- 看板：账号切换器 ---------- */
.acct-bar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 0 2px;
  margin-bottom: 14px;
  scrollbar-width: thin;
}
.acct-bar::-webkit-scrollbar { height: 6px; }
.acct-bar::-webkit-scrollbar-thumb { background: #dde1e8; border-radius: 99px; }

.acct {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
  padding: 8px 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--panel);
  cursor: pointer;
  transition: 0.13s;
  user-select: none;
  line-height: 1.25;
}
.acct:hover { border-color: #c3d5f7; box-shadow: var(--shadow); }
.acct.on { border-color: var(--brand); background: var(--brand-soft); }
.acct.on .a-name { color: #1d4ed8; }

.acct .a-dot { width: 7px; height: 7px; border-radius: 50%; background: #cbd5e1; flex: none; }
.acct .a-dot.live { background: #16a34a; box-shadow: 0 0 0 3px rgba(22,163,74,0.12); }
.acct .a-dot.off { background: #cbd5e1; }
.acct .a-dot.err { background: #dc2626; box-shadow: 0 0 0 3px rgba(220,38,38,0.12); }

.acct .a-main { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.acct .a-name {
  font-size: 12.5px;
  font-weight: 650;
  max-width: 148px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.acct .a-sub { font-size: 10.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.acct .a-amt { font-size: 12px; font-weight: 700; color: var(--teal); font-variant-numeric: tabular-nums; }
.acct.all .a-name { max-width: none; }

@media (max-width: 720px) {
  .acct .a-sub { display: none; }
  .acct .a-name { max-width: 104px; }
}

/* ---------- 后台：账号卡片 ---------- */
.cred.off { opacity: 0.72; background: #fbfcfd; }
.cred .badge-line { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.cred .mini-switch { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--text-2); cursor: pointer; user-select: none; margin-left: auto; }
.cred .mini-switch input { display: none; }
.cred .mini-switch .tr { width: 34px; height: 19px; border-radius: 999px; background: #d8dce4; position: relative; transition: .18s; flex: none; }
.cred .mini-switch .tr::after { content: ""; position: absolute; top: 2.5px; left: 2.5px; width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: .18s; }
.cred .mini-switch input:checked + .tr { background: #16a34a; }
.cred .mini-switch input:checked + .tr::after { transform: translateX(15px); }

/* ---------- 顶栏：自动刷新倒计时 ---------- */
.rt {
  position: relative;
  width: 34px;
  height: 34px;
  flex: none;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: #f1f3f7;
}
.rt-ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}
.rt-bg { fill: none; stroke: #e3e8f1; stroke-width: 3; }
.rt-fg {
  fill: none;
  stroke: var(--brand);
  stroke-width: 3;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.24s linear;
}
.rt-num {
  position: relative;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.rt.soon .rt-num { color: var(--brand); }
.rt.soon .rt-fg { stroke: #f59e0b; }

/* ---------- 登录：单密码输入 ---------- */
.pw-row { display: flex; gap: 8px; align-items: stretch; }
.pw-row input { flex: 1; min-width: 0; }
.pw-eye {
  flex: none;
  padding: 0 13px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text-2);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: 0.15s;
}
.pw-eye:hover { background: #f7f8fa; border-color: var(--line-strong); }
.pw-eye.on { background: var(--brand-soft); color: #1d4ed8; border-color: #dbeafe; }

/* ---------- 看板：日历与价格曲线并排 ---------- */
.dash-split { grid-template-columns: minmax(0, 0.94fr) minmax(0, 1.26fr); }

.cal-card,
.price-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* 日历紧凑化：格子变矮、字号略小，整体高度与右侧曲线对齐 */
.cal-card .cal-body { padding: 10px 14px 6px; }
.cal-card .cal-grid,
.cal-card .cal-week { gap: 5px; }
.cal-card .cal-cell {
  aspect-ratio: auto;
  min-height: 44px;
  padding: 5px 7px;
  border-radius: 8px;
}
.cal-card .cal-date { font-size: 10.5px; }
.cal-card .cal-amt { font-size: 11px; }
.cal-card .cal-foot { padding: 4px 14px 12px; }
.cal-card .legend i { width: 11px; height: 11px; }

/* 右侧价格卡：图表吃掉剩余高度，和日历底部对齐 */
.price-card .price-now { padding: 12px 18px 0; }
.price-card .chart-wrap {
  flex: 1;
  min-height: 0;
  display: flex;
  padding-bottom: 10px;
}
.price-card #priceChart { flex: 1; min-height: 200px; min-width: 0; }
.price-card svg.chart { height: 100%; }

/* ---------- 当日明细（通栏） ---------- */
.day-panel.wide .day-total {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
.day-panel.wide .day-total small {
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  margin-left: 4px;
  letter-spacing: 0;
}
.day-panel.wide .day-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 2px 12px;
  align-content: start;
  padding: 6px 12px 14px;
  max-height: 208px;
}
.day-panel.wide .empty { grid-column: 1 / -1; }

@media (max-width: 1080px) {
  .dash-split { grid-template-columns: 1fr; }
  .price-card #priceChart { min-height: 240px; }
}

#gateKeep {
  margin: 12px 0 0;
  font-size: 11.5px;
  text-align: center;
  line-height: 1.6;
}

/* ---------- 矿池钱包（PRL） ---------- */
.pool-card .pool-total {
  font-size: 12px;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
}
.pool-card .pool-total b { font-size: 13px; color: var(--text); }
.pool-body { padding: 6px 10px 10px; }
.pool-item { border-radius: 10px; }
.pool-item + .pool-item { border-top: 1px solid var(--line); }
.pool-row {
  display: grid;
  grid-template-columns: minmax(188px, 1.45fr) repeat(4, minmax(102px, 1fr)) 84px;
  gap: 10px;
  align-items: center;
  padding: 11px 8px;
  cursor: pointer;
  border-radius: 10px;
  transition: background 0.15s;
}
.pool-row:hover { background: #f8fafc; }
.pool-item.open > .pool-row { background: #f8fafc; }

.pw-id { display: flex; align-items: center; gap: 9px; min-width: 0; }
.pw-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: #cbd5e1; }
.pw-dot.live { background: #16a34a; box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.12); }
.pw-dot.err { background: #dc2626; box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12); }
.pw-name { min-width: 0; }
.pw-name b { display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 650; }
.pw-name code {
  display: block;
  margin-top: 2px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10.5px;
  color: var(--muted);
}

.pw-cell { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.pw-cell .k { font-size: 10.5px; color: var(--muted); }
.pw-cell .v {
  font-size: 14px;
  font-weight: 650;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.pw-cell .v i {
  font-style: normal;
  font-size: 10.5px;
  font-weight: 500;
  color: var(--muted);
  margin-left: 3px;
}
.pw-cell .s { font-size: 10.5px; color: var(--muted); white-space: nowrap; }
.pw-cell .s.bad { color: #b45309; font-weight: 600; }

.pw-toggle {
  justify-self: end;
  padding: 4px 9px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: #fff;
  color: var(--text-2);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}
.pw-toggle:hover { border-color: #bfdbfe; color: var(--brand); }

.pool-err {
  margin: -4px 8px 10px;
  padding: 7px 10px;
  border-radius: 8px;
  background: var(--warn-soft);
  border: 1px solid #fed7aa;
  color: #9a3412;
  font-size: 11.5px;
  line-height: 1.5;
}
/* 矿池数据拉取失败：把原因直接写在卡片里，不留「永远加载中」 */
.pool-fail {
  margin: 8px 8px 12px;
  padding: 14px 16px;
  border-radius: 10px;
  background: #fffbf5;
  border: 1px solid #fed7aa;
}
.pool-fail .pf-t { font-size: 12.5px; font-weight: 600; color: #9a3412; margin-bottom: 4px; }
.pool-fail .pf-m {
  font-size: 12px;
  color: #7c2d12;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  word-break: break-all;
  line-height: 1.6;
}
.pool-fail .pf-h { margin: 6px 0 10px; font-size: 11.5px; color: var(--text-2); line-height: 1.6; }
.pool-fail .btn { font-size: 11.5px; }

.pool-detail { padding: 0 6px 10px; }.pool-detail.hidden { display: none; }
.pool-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 16px;
  padding: 2px 10px 9px;
  font-size: 11px;
  color: var(--muted);
}
.pool-meta b { color: var(--text-2); font-variant-numeric: tabular-nums; }
.pool-note { padding: 2px 10px 8px; font-size: 11px; color: var(--muted); }
.pool-tbl { font-size: 11.5px; }
.pool-tbl th { font-size: 10.5px; white-space: nowrap; }
.pool-tbl td { white-space: nowrap; }

@media (max-width: 900px) {
  .pool-row { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 8px; }
  .pw-id { grid-column: 1 / -1; }
  .pw-toggle { grid-column: 1 / -1; justify-self: start; }
}
