/* 记账应用自定义样式（配合 ZUI 3.0 组件使用） */

:root {
  --jz-bg: #f3f5f8;
  --jz-surface: #ffffff;
  --jz-surface-muted: #f8fafc;
  --jz-text: #152033;
  --jz-text-secondary: #3d4b63;
  --jz-muted: #7a8699;
  --jz-line: #e6ebf2;
  --jz-line-strong: #d5dde8;
  --jz-primary: #1a6fd4;
  --jz-primary-soft: #eef4fc;
  --jz-primary-hover: #155db3;
  --jz-green: #0f8a4b;
  --jz-green-soft: #e8f7ef;
  --jz-red: #d12b2b;
  --jz-red-soft: #fdeeee;
  --jz-amber: #c47b0a;
  --jz-amber-soft: #fff6e8;
  --jz-shadow: 0 1px 2px rgba(21, 32, 51, 0.04), 0 8px 24px rgba(21, 32, 51, 0.05);
  --jz-shadow-sm: 0 1px 2px rgba(21, 32, 51, 0.05);
  --jz-radius: 10px;
  --jz-radius-sm: 6px;
  --jz-sidebar: 232px;
  --jz-space: 12px;
}

html, body {
  background: var(--jz-bg);
  color: var(--jz-text);
  margin: 0;
  min-height: 100vh;
}

body {
  min-width: 1280px;
}

.num,
.stat-value,
.stat-cny,
.stat-sub,
.stat-break-val,
.alloc-value,
.inst-value-block strong,
.rate-value,
.rate-output,
.rate-summary-main {
  font-variant-numeric: tabular-nums;
}

/* ---------- 应用壳 ---------- */
.app-shell {
  display: flex;
  min-height: 100vh;
  min-width: 1280px;
  background: var(--jz-bg);
}

.sidebar {
  position: sticky;
  top: 0;
  z-index: 80;
  display: flex;
  flex-direction: column;
  width: var(--jz-sidebar);
  height: 100vh;
  flex: none;
  background: var(--jz-surface);
  border-right: 1px solid var(--jz-line);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 16px 16px;
}

.brand-logo,
.topbar-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: #172033;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
}

.brand-title,
.topbar-title {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
}

.brand-sub,
.topbar-sub {
  margin-top: 2px;
  color: var(--jz-muted);
  font-size: 11px;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1 1 auto;
  min-height: 0;
  padding: 4px 10px 12px;
  overflow: auto;
}

.nav-item,
.sidebar-link {
  font-family: inherit;
  appearance: none;
  text-decoration: none;
}
.nav-item {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  width: 100%;
  margin: 0;
  padding: 9px 10px 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--jz-text-secondary);
  text-align: left;
  cursor: pointer;
}

.nav-item:hover {
  background: #f6f8fb;
  color: var(--jz-text);
}

.nav-item.is-on {
  background: var(--jz-primary-soft);
  color: var(--jz-primary);
}

.nav-item-label {
  grid-column: 1;
  font-size: 13px;
  font-weight: 700;
}

.nav-item-count {
  grid-column: 2;
  grid-row: 1;
  color: inherit;
  font-size: 11px;
  opacity: 0.72;
}

.nav-item-value {
  grid-column: 1 / -1;
  margin-top: 3px;
  color: #8490a4;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.nav-item.is-on .nav-item-value {
  color: #5d82b0;
}

.sidebar-footer {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 10px 14px;
  border-top: 1px solid var(--jz-line);
}

.sidebar-link {
  display: block;
  width: 100%;
  margin: 0;
  padding: 8px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #5f6d82;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}

.sidebar-link:hover,
a.sidebar-link:hover {
  background: var(--jz-primary-soft);
  color: var(--jz-primary);
}

a.nav-item {
  color: inherit;
}

.app-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1 1 auto;
}

.toolbar {
  position: sticky;
  top: 0;
  z-index: 70;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 28px 12px;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--jz-line);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.6);
}

.toolbar-copy {
  min-width: 0;
}

.toolbar-copy h1 {
  margin: 0;
  color: var(--jz-text);
  font-size: 22px;
  font-weight: 700;
  line-height: 1.25;
}

.toolbar-sub {
  margin: 4px 0 0;
  color: var(--jz-muted);
  font-size: 12px;
}

.toolbar-actions {
  display: flex;
  align-items: center;
  flex: none;
  gap: 8px;
  padding-top: 2px;
}

.toolbar .btn {
  border-radius: var(--jz-radius-sm);
}

.toolbar .btn.secondary {
  border-color: var(--jz-line);
  background: #fff;
  color: #4b5a70;
}

.toolbar .btn.secondary:hover {
  border-color: #c9d8ea;
  background: var(--jz-primary-soft);
  color: var(--jz-primary);
}

.toolbar .btn.primary {
  box-shadow: none;
}

.sync-jobs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.sync-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 7px;
  border-radius: 999px;
  background: #f3f5f8;
  color: var(--jz-muted);
  font-size: 11px;
  line-height: 1.6;
}

.sync-chip.is-run {
  background: #eef6ff;
  color: var(--jz-primary);
}

.sync-chip.is-run::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--jz-primary);
  animation: syncPulse 1s ease-in-out infinite;
}

@keyframes syncPulse {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 1; }
}

/* ---------- 主内容 ---------- */
.workspace {
  width: 100%;
  max-width: 1680px;
  padding: 20px 28px 8px;
}

#alertArea { margin-bottom: 4px; }
#alertArea .alert {
  margin-bottom: 10px;
  border: 1px solid #f3d19e;
  border-radius: var(--jz-radius-sm);
  background: var(--jz-amber-soft);
  color: #9a5b12;
  box-shadow: none;
}

/* ---------- 统计卡片 ---------- */
.stat-grid {
  display: grid;
  grid-template-columns: 1.35fr 1fr 1fr 1fr;
  gap: var(--jz-space);
  margin: 0 0 16px;
}

.stat-card {
  position: relative;
  padding: 16px 18px 14px;
  overflow: hidden;
  border: 1px solid var(--jz-line);
  border-radius: var(--jz-radius);
  background: var(--jz-surface);
  box-shadow: var(--jz-shadow-sm);
}

.stat-card-hero {
  border-color: #c9ddf5;
  background: linear-gradient(180deg, #f7fbff 0%, #ffffff 100%);
}

.stat-label {
  margin-bottom: 6px;
  color: var(--jz-muted);
  font-size: 12px;
  font-weight: 600;
}

.stat-value {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.01em;
}

.stat-card-hero .stat-value {
  font-size: 32px;
}

.stat-cny {
  margin-top: 4px;
  color: #66748a;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
}

.stat-note,
.stat-sub {
  margin-top: 6px;
  color: var(--jz-muted);
  font-size: 12px;
}

.stat-break {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px dashed var(--jz-line);
}

.stat-break-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  line-height: 1.35;
}

.stat-break-name { color: #66748a; }
.stat-break-val { font-weight: 600; white-space: nowrap; }

.pnl-pos { color: var(--jz-green); }
.pnl-neg { color: var(--jz-red); }

/* ---------- 面板 ---------- */
.alloc-grid .panel,
.data-panel,
.inst-panel,
.empty-state {
  border: 1px solid var(--jz-line);
  border-radius: var(--jz-radius);
  background: var(--jz-surface);
  box-shadow: var(--jz-shadow-sm);
}

.alloc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--jz-space);
  margin-bottom: 16px;
}

.panel-heading {
  display: flex;
  align-items: center;
}
.alloc-grid .panel-heading,
.data-panel .panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 46px;
  padding: 0 16px;
  border-bottom: 1px solid #edf0f5;
}

.alloc-grid .panel-title,
.data-panel .panel-title,
.inst-name {
  color: #273249;
  font-size: 14px;
  font-weight: 700;
}

.alloc-grid .panel-title span,
.data-panel .panel-title .cell-sub {
  margin-left: 6px;
  color: var(--jz-muted);
  font-size: 12px;
  font-weight: 400;
}

.data-panel .panel-title .cell-sub {
  display: block;
  margin: 3px 0 0;
}

.alloc-grid .panel-body { padding: 8px 16px 10px; }
.data-panel .panel-body { padding: 0; }
.data-panel { margin-bottom: 14px; }

.alloc-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  font-size: 13px;
}

.alloc-name {
  width: 84px;
  flex: none;
  overflow: hidden;
  color: #526077;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.alloc-bar { flex: 1 1 auto; }

.alloc-value {
  width: 150px;
  flex: none;
  color: #455269;
  text-align: right;
  white-space: nowrap;
}

.alloc-row .progress { height: 6px; border-radius: 99px; background: #edf1f6; }
.alloc-row .progress-bar { border-radius: 99px; background: #5b9ce8; }

/* ---------- 来源筛选 ---------- */
.source-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 16px;
}

.source-filter {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 128px;
  margin: 0;
  padding: 8px 12px 7px;
  border: 1px solid var(--jz-line);
  border-radius: 8px;
  background: #fff;
  color: #526077;
  cursor: pointer;
  text-align: left;
  line-height: 1.2;
}

.source-filter:hover { border-color: #c5d4e8; background: #f8fbff; }
.source-filter.is-on {
  border-color: #b9d0ee;
  background: #f4f8ff;
  box-shadow: inset 0 0 0 1px #d6e6fa;
  color: var(--jz-primary);
}
.source-filter.is-manual { border-color: #f3d19e; color: #9a5b12; }
.source-filter.is-manual:hover { border-color: #e8b86a; background: #fffaf3; }
.source-filter.is-manual.is-on {
  border-color: #f0c078;
  background: #fff7ed;
  box-shadow: inset 0 0 0 1px #fde4c3;
  color: #9a5b12;
}
.source-filter-label { font-size: 12px; font-weight: 700; }
.source-filter-meta {
  margin-top: 3px;
  color: #8490a4;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.source-filter.is-on .source-filter-meta,
.source-filter.is-manual.is-on .source-filter-meta { color: inherit; opacity: 0.78; }
.source-filter-review { color: #c2410c; font-weight: 700; }

.cash-sum-total td { font-weight: 700; background: #fafbfd; }

/* ---------- 区块标题 ---------- */
.holdings-section { padding-top: 4px; }
.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin: 4px 0 12px;
  padding-top: 16px;
  border-top: 1px solid #e3e9f1;
}
.section-heading h2 {
  margin: 0;
  color: var(--jz-text);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
}
.section-heading p {
  margin: 6px 0 0;
  color: var(--jz-muted);
  font-size: 12px;
}
.section-count {
  padding: 4px 9px;
  border: 1px solid #e0e7f0;
  border-radius: 99px;
  background: #fff;
  color: #69768b;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

/* ---------- 账户面板 ---------- */
.inst-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.inst-title-wrap { min-width: 220px; }
.inst-assets-count { margin-top: 4px; color: var(--jz-muted); font-size: 12px; }
.inst-value-block {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  margin-left: auto;
  margin-right: 16px;
}
.inst-value-block span { color: var(--jz-muted); font-size: 11px; line-height: 1; }
.inst-value-block strong { margin-top: 4px; color: #273249; font-size: 16px; }
.inst-note { font-size: 12px; color: #98a2b8; }

.inst-panel { margin-bottom: 12px; overflow: hidden; }
.inst-panel .panel-heading {
  display: flex;
  align-items: center;
  min-height: 58px;
  padding: 0 16px;
  border-bottom: 1px solid var(--jz-line);
  background: #fbfcfe;
}
.inst-panel .panel-actions { display: flex; align-items: center; gap: 4px; }
.inst-panel .panel-actions .btn {
  margin: 0;
  border-radius: 5px;
  color: #617087;
  border-color: transparent;
  background: transparent;
}
.inst-panel .panel-actions .btn:hover {
  color: var(--jz-primary);
  background: var(--jz-primary-soft);
}
.inst-panel .panel-body { padding: 0; }

.table-wrap { overflow-x: auto; }
.data-table,
.asset-table {
  width: 100%;
  margin: 0;
  border-collapse: collapse;
}
.data-table thead th,
.asset-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  height: 36px;
  padding: 0 12px;
  border-bottom: 1px solid var(--jz-line);
  background: #f7f9fc;
  color: #758197;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  letter-spacing: 0.02em;
}
.data-table td,
.asset-table td {
  padding: 10px 12px;
  border-color: #edf0f4;
  vertical-align: middle !important;
  color: #344055;
  font-size: 13px;
}
.data-table tbody tr:hover,
.asset-table tbody tr:hover { background: #f4f8ff; }
.empty-row { padding: 22px 12px !important; }
.asset-table { table-layout: fixed; }
.asset-table td.num,
.asset-table th.text-right,
.data-table td.text-right,
.data-table th.text-right,
.exchange-rate-table td.text-right,
.exchange-rate-table th.text-right {
  font-variant-numeric: tabular-nums;
}
.asset-col-name { width: 17%; }
.asset-col-type { width: 8%; }
.asset-col-qty { width: 9%; }
.asset-col-price { width: 10%; }
.asset-col-value { width: 11%; }
.asset-col-cost { width: 10%; }
.asset-col-pnl { width: 10%; }
.asset-col-actions { width: 15%; }
.asset-name-cell { padding-left: 16px !important; }
.cell-main { color: #263147; font-weight: 650; }
.source-tag {
  font-size: 10px;
  font-weight: 500;
  vertical-align: 1px;
  margin-left: 5px;
  padding: 0 5px;
  line-height: 17px;
}
.cell-sub .source-tag { margin-left: 0; margin-right: 4px; }
.source-tag-api { background: var(--jz-green-soft); color: #157b4c; border-color: transparent; }
.source-tag-chain { background: var(--jz-primary-soft); color: var(--jz-primary); border-color: transparent; }
.source-tag-manual { background: var(--jz-amber-soft); color: #b45309; border-color: transparent; }
.source-tag-review { font-weight: 700; background: #ffedd5; color: #c2410c; }
.source-when { color: #98a2b8; }
.uid-tag {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 11px;
  font-weight: 500;
  color: #7b879c;
  margin-left: 6px;
  letter-spacing: 0.02em;
}
.cell-sub {
  margin-top: 2px;
  color: #8490a4;
  font-size: 11px;
  white-space: normal;
}
.num { white-space: nowrap; }
.text-error { color: var(--jz-red); }
.text-warn { color: #d97706; }
.text-ok { color: var(--jz-green); }
.op-btns { white-space: nowrap; }
.op-btns .btn {
  min-width: 0;
  margin-right: 2px;
  padding: 2px 6px;
  color: #7a8699;
  border-color: transparent;
  background: transparent;
}
.op-btns .btn:hover {
  color: var(--jz-primary);
  background: var(--jz-primary-soft);
}

/* ---------- 空状态 / 提示 ---------- */
.empty-state {
  margin: 12px 0 32px;
  border-style: dashed;
  box-shadow: none;
}
.empty-state-inline { margin: 0; }
.empty-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-bottom: 10px;
  border-radius: 10px;
  background: #172033;
  color: #fff;
  font-size: 18px;
  font-weight: 700;
}

/* ---------- 表单 ---------- */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 14px;
}
.form-item label {
  display: block;
  margin-bottom: 4px;
  color: #4c5568;
  font-size: 13px;
}
.form-item.span2 { grid-column: span 2; }
.form-item-action {
  display: flex;
  align-items: flex-end;
}
.field-row {
  display: flex;
  gap: 8px;
}
.field-row .flex-1 { flex: 1 1 auto; min-width: 0; }
.trusted-add {
  display: grid;
  grid-template-columns: 1fr 160px auto;
  gap: 8px;
  align-items: center;
}
.trusted-hint { margin-bottom: 8px; }
.trusted-table-wrap { margin-top: 10px; }
.settings-lead,
.addr-bal-lead {
  margin: 0 0 12px;
  color: var(--jz-muted);
  font-size: 12px;
}
.hint { color: #98a2b8; font-weight: 400; font-size: 12px; }
.hint-line {
  min-height: 16px;
  margin-top: 4px;
  font-size: 12px;
}
.rpc-panel {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid #e7ecf2;
}
.rpc-panel-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 9px;
  color: #334155;
  font-size: 13px;
}
.rpc-panel-heading span { color: #98a2b8; font-size: 11px; font-weight: 400; }
.rpc-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.rpc-item {
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid #e3e9f1;
  border-radius: 6px;
  background: #fafbfd;
}
.rpc-item-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.rpc-item-top strong { color: #3b4a60; font-size: 12px; }
.rpc-state {
  padding: 1px 5px;
  border-radius: 99px;
  font-size: 10px;
}
.rpc-state.is-ok { background: var(--jz-green-soft); color: #157b4c; }
.rpc-state.is-error { background: var(--jz-red-soft); color: #b6463e; }
.rpc-item-meta { overflow: hidden; margin-top: 4px; color: #8793a5; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.rpc-empty { grid-column: 1 / -1; color: #98a2b8; font-size: 12px; }
.tx-pos {
  margin-bottom: 12px;
  padding: 8px 12px;
  border-radius: 8px;
  background: #f6f8fc;
  color: #4c5568;
  font-size: 13px;
}
.tx-list-summary {
  margin-bottom: 10px;
  color: #4c5568;
  font-size: 13px;
}
.export-choices {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.export-choice {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 72px;
  padding: 12px 16px;
  line-height: 1.4;
  text-align: center;
}
.export-choice .cell-sub {
  margin-top: 4px;
  text-align: center;
}
.export-note { margin-top: 12px; }

/* ---------- 弹窗 ---------- */
.modal { z-index: 1050; }
.modal-content {
  border: 1px solid var(--jz-line);
  border-radius: var(--jz-radius);
  box-shadow: var(--jz-shadow);
}
.modal-header {
  min-height: 56px;
  padding: 12px 18px;
  border-bottom: 1px solid #edf0f5;
}
.modal-title { font-size: 16px; font-weight: 700; }
.modal-body { padding: 16px 18px; }
.modal-footer {
  padding: 12px 18px;
  border-top: 1px solid #edf0f5;
  background: var(--jz-surface-muted);
}
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  z-index: 1040;
}
.modal-lg { width: min(720px, 94vw); }
.modal-footer .btn { min-width: 72px; }

/* ---------- 交易所稳定币汇率 ---------- */
.exchange-rates-dialog { width: min(1180px, 96vw); }
.exchange-rates-header {
  min-height: 68px;
  padding: 14px 20px;
  background: #fff;
  color: var(--jz-text);
  border-bottom: 1px solid #edf0f5;
}
.security-modal-header {
  min-height: 68px;
  padding: 14px 20px;
  background: #fff;
  color: var(--jz-text);
  border-bottom: 1px solid #edf0f5;
}
.exchange-rates-header .btn-close,
.security-modal-header .btn-close { display: none; }
.rate-modal-close {
  min-height: 32px;
  padding: 5px 11px;
  border: 1px solid var(--jz-line);
  border-radius: 6px;
  background: #fff;
  color: #4b5a70;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.rate-modal-close:hover,
.rate-modal-close:focus-visible {
  border-color: #c9d8ea;
  background: var(--jz-primary-soft);
  color: var(--jz-primary);
  outline: 0;
}
.modal-eyebrow {
  margin-bottom: 2px;
  color: var(--jz-primary);
  font-size: 11px;
  font-weight: 700;
}
.exchange-rates-header .modal-title,
.security-modal-header .modal-title { font-size: 18px; line-height: 1.35; }
.rate-cache-hint {
  margin-top: 3px;
  color: var(--jz-muted);
  font-size: 12px;
}

/* ---------- 钱包安全 ---------- */
.wallet-security-dialog { width: min(1040px, 96vw); }
.wallet-security-body { max-height: min(78vh, 760px); padding: 18px 20px; overflow-y: auto; }
.security-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid #e7ebf1;
}
.security-summary { min-width: 0; }
.security-summary strong { display: block; color: #1f2937; font-size: 18px; }
.security-summary span { display: block; margin-top: 3px; color: #7a8699; font-size: 12px; }
.security-actions { display: flex; flex: none; gap: 7px; }
.security-actions .btn:disabled { cursor: wait; opacity: .65; }
.security-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 0;
}
.security-filter {
  margin: 0;
  padding: 5px 10px;
  border: 1px solid var(--jz-line);
  border-radius: 999px;
  background: #fff;
  color: #526077;
  font-size: 12px;
  cursor: pointer;
}
.security-filter span { color: #8490a4; }
.security-filter:hover { border-color: #c5d4e8; background: #f8fbff; }
.security-filter.is-on {
  border-color: #b9d0ee;
  background: #f4f8ff;
  color: var(--jz-primary);
}
.security-head-meta { display: flex; align-items: center; gap: 8px; }
.security-chain {
  padding: 10px 0;
  border-bottom: 1px solid #f0f2f5;
}
.security-chain:last-child { border-bottom: 0; padding-bottom: 0; }
.security-chain-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex: none;
}
.security-cache { color: #7a8699; font-size: 10px; }
.security-more {
  margin-top: 6px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--jz-primary);
  font-size: 12px;
  cursor: pointer;
}
.security-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  padding: 11px 0;
  color: #6f7b8d;
  font-size: 11px;
}
.security-legend span { display: inline-flex; align-items: center; gap: 5px; }
.security-dot { width: 8px; height: 8px; border-radius: 50%; background: #9ca3af; }
.security-dot.is-danger { background: #dc4c42; }
.security-dot.is-review { background: #d88a16; }
.security-dot.is-unknown { background: #7b8798; }
.security-dot.is-safe { background: #1d9b63; }
.security-dot.is-known-contract { border-radius: 2px; background: #20724b; }
.security-list { display: grid; gap: 10px; }
.security-wallet {
  border: 1px solid #dde3eb;
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}
.security-wallet.is-danger { border-left: 4px solid #dc4c42; }
.security-wallet.is-review { border-left: 4px solid #d88a16; }
.security-wallet.is-unknown { border-left: 4px solid #7b8798; }
.security-wallet.is-safe { border-left: 4px solid #1d9b63; }
.security-wallet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 13px;
  background: #f8fafc;
  border-bottom: 1px solid #e8ecf2;
}
.security-wallet-id { min-width: 0; }
.security-wallet-id strong { color: #29364a; font-size: 13px; }
.security-address {
  display: block;
  margin-top: 2px;
  overflow: hidden;
  color: #7e8999;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.security-state {
  flex: none;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}
.security-state.is-danger { background: #fff0ef; color: #b93f37; }
.security-state.is-review { background: #fff7e8; color: #a86810; }
.security-state.is-unknown { background: #eef1f4; color: #657184; }
.security-state.is-safe { background: #e8f7ef; color: #157b4c; }
.security-wallet-body { padding: 11px 13px 12px; }
.security-control-line {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  color: #4e5a6c;
  font-size: 12px;
}
.security-control-line strong { color: #27364b; }
.security-control-line > div { min-width: 0; }
.security-delegation {
  overflow-wrap: anywhere;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  line-height: 1.55;
}
.security-check-time { flex: none; color: #98a1af; font-size: 10px; }
.contract-trust {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin-top: 5px;
  padding: 2px 6px;
  border: 1px solid #d9dee6;
  border-radius: 4px;
  color: #6f7b8d;
  background: #f6f8fa;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.35;
}
.contract-trust.is-known { border-color: #b8dfca; color: #157b4c; background: #edf8f2; }
.contract-trust.is-unknown { color: #6f7b8d; background: #f4f5f7; }
.security-issues { display: grid; gap: 5px; margin-top: 8px; }
.security-issue {
  padding: 7px 9px;
  border-left: 3px solid #c5ccd5;
  background: #f7f9fb;
  color: #606c7e;
  font-size: 11px;
  line-height: 1.5;
}
.security-issue strong { display: block; color: #3b4657; font-size: 12px; }
.security-issue.is-high { border-color: #dc4c42; background: #fff7f6; }
.security-issue.is-medium { border-color: #d88a16; background: #fffaf0; }
.security-issue.is-info { border-color: #7aa8d8; background: #f4f8fc; }
.security-issue.is-unknown { border-color: #7b8798; background: #f4f5f7; }
.security-approvals { margin-top: 10px; border-top: 1px solid #edf0f4; }
.security-approval {
  display: grid;
  grid-template-columns: minmax(80px, .55fr) minmax(150px, 1.45fr) minmax(80px, .65fr);
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px solid #f0f2f5;
  color: #697588;
  font-size: 11px;
}
.security-approval:last-child { border-bottom: 0; }
.security-approval strong { color: #364256; }
.security-approval-target { display: flex; min-width: 0; flex-direction: column; align-items: flex-start; }
.security-approval .is-risk { color: #b93f37; font-weight: 700; }
.security-empty { padding: 48px 20px; color: #8b96a7; text-align: center; font-size: 13px; }
.security-footnote { margin-top: 12px; color: #8b96a7; font-size: 10px; }
.exchange-rates-body { padding: 18px 20px 16px; }
.rate-controls {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  padding: 2px 0 18px;
  border-bottom: 1px solid #edf1f5;
}
.rate-control-group { min-width: 0; }
.rate-control-label {
  margin-bottom: 6px;
  color: var(--jz-muted);
  font-size: 12px;
  font-weight: 600;
}
.rate-segments {
  display: inline-grid;
  grid-template-columns: repeat(4, minmax(58px, 1fr));
  border: 1px solid #dbe2ec;
  border-radius: 6px;
  overflow: hidden;
  background: #f6f8fb;
}
.rate-segments button {
  min-height: 34px;
  padding: 6px 11px;
  border-left: 1px solid #dbe2ec;
  color: #556176;
  font-size: 12px;
  font-weight: 700;
}
.rate-segments button:first-child { border-left: 0; }
.rate-segments button:hover { background: #eaf2fb; color: #1e5f9f; }
.rate-segments button.is-on { background: var(--jz-primary); color: #fff; }
.rate-swap-btn {
  width: 34px;
  height: 34px;
  flex: none;
  margin-bottom: 0;
  border: 1px solid #dbe2ec;
  border-radius: 50%;
  background: #fff;
  color: #54708f;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}
.rate-swap-btn:hover {
  border-color: #9cc4ee;
  background: #edf5ff;
  color: #1669b9;
}
.rate-amount-control { min-width: 150px; }
.rate-amount-input {
  display: flex;
  align-items: center;
  min-height: 34px;
  border: 1px solid #dbe2ec;
  border-radius: 6px;
  background: #fff;
  overflow: hidden;
}
.rate-amount-input input {
  width: 100px;
  min-width: 0;
  padding: 6px 8px;
  border: 0;
  outline: 0;
  color: #172033;
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.rate-amount-input span {
  padding: 0 8px;
  border-left: 1px solid #dbe2ec;
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
}
.rate-amount-presets {
  display: flex;
  gap: 4px;
  margin-top: 5px;
}
.rate-amount-presets button {
  padding: 0 4px;
  border: 0;
  background: transparent;
  color: #6f88a4;
  font-size: 11px;
  cursor: pointer;
}
.rate-amount-presets button:hover,
.rate-amount-presets button.is-on { color: var(--jz-primary); font-weight: 700; }
.rate-direction {
  padding-bottom: 7px;
  color: #8090a8;
  font-size: 20px;
  line-height: 34px;
}
.rate-refresh-btn { min-width: 72px; min-height: 36px; margin-left: auto; }
.rate-refresh-btn:disabled { cursor: wait; opacity: 0.68; }
.rate-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 76px;
  gap: 20px;
  padding: 13px 16px;
  border: 1px solid #dce7e2;
  border-left: 4px solid #20a66a;
  border-radius: 8px;
  background: linear-gradient(105deg, #f5fcf8, #fbfefd);
}
.rate-summary-label { margin-bottom: 3px; color: #68768c; font-size: 11px; }
.rate-summary-main {
  color: #172033;
  font-size: 20px;
  font-weight: 700;
}
.rate-summary-stats {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px 18px;
  color: #6f7c90;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.rate-summary-stats strong { color: #344056; }
.rate-arbitrage {
  display: grid;
  grid-template-columns: minmax(300px, 1fr) auto;
  align-items: center;
  gap: 7px 20px;
  min-height: 72px;
  margin-top: 10px;
  padding: 12px 16px;
  border: 1px solid #dfe5ec;
  border-radius: 8px;
  background: #fbfcfe;
}
.rate-arbitrage-route, .rate-arbitrage-metrics {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 9px;
  font-size: 12px;
}
.rate-arbitrage-route strong { color: #172033; font-size: 14px; }
.rate-arbitrage-label {
  margin-right: 3px;
  color: #196447;
  font-size: 11px;
  font-weight: 700;
}
.rate-arbitrage-action { color: #6c788c; }
.rate-arbitrage-arrow { color: #20a66a; font-size: 16px; }
.rate-arbitrage-metrics { justify-content: flex-end; color: #69768b; font-variant-numeric: tabular-nums; }
.rate-arbitrage-metrics strong { color: #334155; }
.rate-arbitrage-note {
  grid-column: 1 / -1;
  color: #929cac;
  font-size: 10px;
}
.rate-arbitrage-empty {
  grid-column: 1 / -1;
  color: var(--jz-muted);
  font-size: 12px;
  text-align: center;
}
.rate-table-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 18px 0 8px;
  color: #263147;
  font-size: 13px;
}
.rate-table-heading strong { font-size: 14px; }
.rate-table-heading span:not(.rate-table-legend) {
  margin-left: 8px;
  color: #8a95a6;
  font-size: 11px;
  font-weight: 400;
}
.rate-table-legend {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #6c788c;
  font-size: 11px;
}
.legend-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #20a66a;
}
.exchange-rate-table-wrap { margin-top: 14px; border: 1px solid var(--jz-line); border-radius: 6px; }
.exchange-rate-table { min-width: 920px; }
.exchange-rate-table th { color: #657187; font-size: 12px; font-weight: 600; white-space: nowrap; }
.exchange-rate-table td { height: 48px; vertical-align: middle; }
.rate-gap { font-variant-numeric: tabular-nums; white-space: nowrap; }
.rate-gap.is-best { color: #157b4c; font-weight: 700; }
.rate-rel {
  height: 4px;
  margin-top: 5px;
  border-radius: 99px;
  background: #edf1f6;
  overflow: hidden;
}
.rate-rel i {
  display: block;
  height: 100%;
  border-radius: 99px;
  background: #5b9ce8;
}
.is-best-row .rate-rel i { background: #20a66a; }
.exchange-name { display: flex; align-items: center; gap: 7px; font-weight: 700; }
.rate-pair { color: #66738a; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-size: 12px; }
.rate-value { color: #172033; font-size: 14px; font-weight: 700; }
.rate-status, .rate-edge {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 11px;
  line-height: 1.5;
  white-space: nowrap;
}
.rate-status.is-ok { background: var(--jz-green-soft); color: #157b4c; }
.rate-status.is-error { max-width: 130px; overflow: hidden; text-overflow: ellipsis; background: #f1f3f6; color: #7d8797; vertical-align: middle; }
.rate-status.is-loading { background: #eaf2fb; color: #2b6ca8; }
.rate-edge.is-best { background: var(--jz-green-soft); color: #157b4c; }
.rate-edge.is-worst { background: var(--jz-red-soft); color: #b6463e; }
.fee-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 28px;
  color: #66738a;
  font-size: 11px;
  white-space: nowrap;
  cursor: pointer;
}
.fee-toggle input { width: 15px; height: 15px; accent-color: #20a66a; }
.fee-toggle input:disabled { cursor: wait; opacity: 0.6; }
.fee-cell { display: inline-flex; flex-direction: column; align-items: center; gap: 1px; }
.fee-rate { color: #6b778a; font-size: 10px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.fee-rate.is-free { color: #157b4c; font-weight: 700; }
.rate-output { color: #172033; font-weight: 700; white-space: nowrap; }
.fee-route-tag {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 999px;
  background: #f0f2f5;
  color: #788396;
  font-size: 10px;
  white-space: nowrap;
}
.fee-route-tag.is-free { background: var(--jz-green-soft); color: #157b4c; }
.rate-row-unavailable { opacity: 0.72; }
.exchange-rate-table tbody tr:not(.rate-row-unavailable):hover td { background: #f4f9ff; }
.exchange-rate-table tbody tr.is-best-row td { background: #f7fcf8; }
.exchange-rate-table tbody tr.is-best-row:hover td { background: #eefaf3; }
.rate-empty { height: 180px !important; color: var(--jz-muted); text-align: center; }
.rate-loading-line {
  width: min(380px, 70%);
  height: 9px;
  border-radius: 4px;
  background: linear-gradient(90deg, #eef1f5 25%, #dfe5ed 50%, #eef1f5 75%);
  background-size: 200% 100%;
  animation: rateLoading 1.2s linear infinite;
}
@keyframes rateLoading { to { background-position: -200% 0; } }
.rate-footnote { margin-top: 10px; color: #8994a6; font-size: 11px; }

.asset-clickable { cursor: pointer; }
.asset-clickable:hover .cell-main { color: var(--jz-primary); }
.sym-row-clickable { cursor: pointer; }
.sym-row-clickable:hover td { background: rgba(26, 111, 212, 0.06); }
.addr-bal-group { margin-bottom: 16px; }
.addr-bal-label { font-size: 13px; font-weight: 600; color: #334155; margin: 0 0 8px; }
.addr-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-size: 12px; word-break: break-all; }
.addr-row-stake .addr-mono { color: #64748b; }
.addr-row-stake td:first-child { padding-left: 28px; }
.yield-lot-line { color: #5b6b86; font-variant-numeric: tabular-nums; }

/* ---------- 页脚 ---------- */
.footer {
  margin-top: auto;
  padding: 22px 28px 24px;
  color: #98a2b8;
  font-size: 12px;
  text-align: center;
}

.hidden { display: none !important; }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.login-body {
  min-width: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--jz-bg);
}
.login-card {
  width: 100%;
  max-width: 360px;
  background: var(--jz-surface);
  border: 1px solid var(--jz-line);
  border-radius: 12px;
  padding: 28px 24px 24px;
  box-shadow: var(--jz-shadow);
}
.login-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}
.login-err { margin: 10px 0 0; font-size: 13px; }
.login-btn { width: 100%; margin-top: 14px; }

@media (max-width: 1440px) {
  .stat-grid { grid-template-columns: 1.2fr 1fr 1fr 1fr; }
  .stat-card-hero .stat-value { font-size: 28px; }
}

/* ---------- 资产曲线 ---------- */
.range-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.range-chip {
  appearance: none;
  padding: 6px 12px;
  border: 1px solid var(--jz-line);
  border-radius: 999px;
  background: #fff;
  color: var(--jz-text-secondary);
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
}
.range-chip:hover {
  border-color: #c9ddf5;
  color: var(--jz-primary);
}
.range-chip.is-on {
  border-color: #c9ddf5;
  background: var(--jz-primary-soft);
  color: var(--jz-primary);
  font-weight: 700;
}
.history-chart-body {
  position: relative;
  padding: 8px 8px 4px;
}
.history-chart {
  position: relative;
  min-height: 360px;
}
.history-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 280px;
  color: var(--jz-muted);
  font-size: 13px;
}
.chart-grid { stroke: #e8edf4; stroke-width: 1; }
.chart-axis { fill: #8a96a8; font-size: 11px; }
.chart-area { fill: rgba(26, 111, 212, 0.12); stroke: none; }
.chart-line {
  fill: none;
  stroke: var(--jz-primary);
  stroke-width: 2.2;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.chart-dot {
  fill: #fff;
  stroke: var(--jz-primary);
  stroke-width: 2;
}
.chart-dot.is-on { fill: var(--jz-primary); }
.chart-hit { fill: transparent; cursor: crosshair; }
.chart-tooltip {
  position: absolute;
  z-index: 5;
  min-width: 140px;
  padding: 8px 10px;
  border: 1px solid var(--jz-line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--jz-shadow-sm);
  pointer-events: none;
}
.chart-tooltip .tip-date { color: var(--jz-muted); font-size: 11px; }
.chart-tooltip .tip-value { margin-top: 2px; font-size: 15px; font-weight: 700; }
.chart-tooltip .tip-cny,
.chart-tooltip .tip-delta { margin-top: 2px; font-size: 12px; color: var(--jz-text-secondary); }
.history-table-panel .cell-sub { color: var(--jz-muted); font-size: 12px; }
.snapshot-catchup { margin-left: 6px; vertical-align: middle; }
.snapshot-day { cursor: pointer; }
.snapshot-day.is-open { background: var(--jz-primary-soft); }
.snapshot-detail td { background: #f7f9fc; padding: 8px 12px 12px; }
.snapshot-assets { margin: 0; background: #fff; }
.snapshot-assets th, .snapshot-assets td { font-size: 12px; }
.snapshot-empty { color: var(--jz-muted); font-size: 12px; padding: 8px 4px; }
