:root {
  --bg-page: #f4f6f9;
  --bg-surface: #ffffff;
  --bg-elevated: #f8fafc;
  --bg-hover: #f1f5f9;
  --bg-header: rgba(255, 255, 255, 0.92);
  --border-subtle: #e2e8f0;
  --border-strong: #cbd5e1;
  --border-accent: rgba(5, 150, 105, 0.35);
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --emerald: #059669;
  --emerald-bright: #10b981;
  --emerald-soft: rgba(5, 150, 105, 0.10);
  --up-color: #059669;
  --up-bg: rgba(5, 150, 105, 0.10);
  --down-color: #e11d48;
  --down-bg: rgba(225, 29, 72, 0.10);
  --amber-color: #d97706;
  --seg-others-bg: #cbd5e1;
  --seg-tick-bg: #e2e8f0;
  --rank-1-color: #b45309;
  --rank-2-color: #334155;
  --rank-3-color: #c2410c;
  --fee-banner-bg: linear-gradient(135deg, #ffffff 0%, #f0fdf4 100%);
  --inspector-bg: #f0fdf4;
  --backdrop-bg: rgba(15, 23, 42, 0.45);
  --drawer-shadow: -12px 0 40px rgba(15, 23, 42, 0.14);
  --ambient-glow: radial-gradient(60% 280px at 50% 0%, rgba(16, 185, 129, 0.07), transparent 75%);
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --shadow-card: 0 1px 3px rgba(15, 23, 42, 0.04), 0 4px 12px rgba(15, 23, 42, 0.03);
  color-scheme: light;
}

/* Linear 流光暗黑 (Linear Obsidian) 主题变量 */
:root[data-theme="dark"],
body[data-theme="dark"] {
  --bg-page: #07090e;
  --bg-surface: #0d1119;
  --bg-elevated: #131924;
  --bg-hover: rgba(255, 255, 255, 0.04);
  --bg-header: rgba(11, 15, 23, 0.88);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --border-accent: rgba(16, 185, 129, 0.38);
  --text-primary: #f3f6fa;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --emerald: #10b981;
  --emerald-bright: #34d399;
  --emerald-soft: rgba(16, 185, 129, 0.14);
  --up-color: #10b981;
  --up-bg: rgba(16, 185, 129, 0.14);
  --down-color: #f43f5e;
  --down-bg: rgba(244, 63, 94, 0.14);
  --amber-color: #f59e0b;
  --seg-others-bg: #334155;
  --seg-tick-bg: rgba(255, 255, 255, 0.09);
  --rank-1-color: #fbbf24;
  --rank-2-color: #e2e8f0;
  --rank-3-color: #fb923c;
  --fee-banner-bg: linear-gradient(135deg, rgba(16, 185, 129, 0.11) 0%, #0d1119 100%);
  --inspector-bg: rgba(16, 185, 129, 0.08);
  --backdrop-bg: rgba(2, 4, 10, 0.76);
  --drawer-shadow: -12px 0 44px rgba(0, 0, 0, 0.72);
  --ambient-glow: radial-gradient(55% 320px at 18% 0%, rgba(16, 185, 129, 0.12), transparent 75%),
                  radial-gradient(45% 280px at 85% 0%, rgba(56, 189, 248, 0.08), transparent 75%);
  --shadow-card: 0 4px 16px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  background-color: var(--bg-page);
  color: var(--text-primary);
  overflow-x: hidden;
}

body {
  background-color: var(--bg-page);
  background-image: var(--ambient-glow);
  background-repeat: no-repeat;
  background-size: 100% 520px;
  color: var(--text-primary);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", sans-serif;
  line-height: 1.5;
  min-height: 100vh;
  min-height: 100dvh;
  padding-bottom: 32px;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

.mono {
  font-family: "JetBrains Mono", "SFMono-Regular", Menlo, Monaco, Consolas, monospace;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" on, "zero" on;
}

.muted {
  color: var(--text-muted);
}

.small {
  font-size: 0.78rem;
}

.accent-text,
.up-text {
  color: var(--up-color);
}

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

.text-right {
  text-align: right;
}

/* ================= 顶部通栏导航 ================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--bg-header);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-subtle);
}

.header-inner {
  max-width: 1360px;
  margin: 0 auto;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: nowrap;
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.brand-logo {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--emerald-soft);
  border: 1px solid var(--border-accent);
  color: var(--emerald);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.brand-logo svg {
  width: 18px;
  height: 18px;
}

.brand-title-row {
  display: flex;
  align-items: center;
  gap: 7px;
}

.brand-title-row h1 {
  font-family: "Plus Jakarta Sans", "Inter", sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.zero-fee-pill {
  background: var(--emerald-soft);
  color: var(--emerald);
  border: 1px solid var(--border-accent);
  font-size: 0.68rem;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 6px;
  white-space: nowrap;
}

.brand-subtitle {
  color: var(--text-muted);
  font-size: 0.72rem;
  white-space: nowrap;
}

.main-tabs {
  display: flex;
  align-items: center;
  gap: 3px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  padding: 3px;
  border-radius: 10px;
  flex-shrink: 0;
}

.tab-btn {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid transparent;
  padding: 6px 10px;
  border-radius: 7px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.tab-btn:hover:not(:disabled) {
  color: var(--text-primary);
}

.tab-btn.active {
  background: var(--bg-surface);
  color: var(--emerald);
  border-color: var(--border-accent);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

.tab-btn:disabled,
.tab-btn.is-soon,
.mob-nav-btn:disabled,
.mob-nav-btn.is-soon {
  opacity: 0.52;
  cursor: not-allowed;
  color: var(--text-muted);
}

.nav-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  flex-wrap: nowrap;
  flex-shrink: 0;
}

.nav-actions .btn-ghost,
.nav-actions .wallet-btn {
  padding: 6px 11px;
  font-size: 0.78rem;
  white-space: nowrap;
}

/* 白天 / 黑夜双模主题切换胶囊 */
.theme-switch-btn {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 2px;
  cursor: pointer;
  transition: border-color 0.15s ease;
  flex-shrink: 0;
}

.theme-switch-btn:hover {
  border-color: var(--border-strong);
}

.theme-opt {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 26px;
  border-radius: 6px;
  font-size: 0.86rem;
  line-height: 1;
  color: var(--text-secondary);
  transition: all 0.15s ease;
}

:root:not([data-theme="dark"]) .theme-opt[data-theme-opt="light"],
.theme-opt.active {
  background: var(--bg-surface);
  color: var(--emerald);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}

:root[data-theme="dark"] .theme-opt[data-theme-opt="dark"],
:root[data-theme="dark"] .theme-opt.active,
body[data-theme="dark"] .theme-opt.active {
  background: var(--emerald-soft);
  color: var(--emerald);
  box-shadow: inset 0 0 0 1px var(--border-accent);
}

.saved-counter {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  padding-right: 10px;
  border-right: 1px solid var(--border-subtle);
}

.saved-counter[hidden] {
  display: none !important;
}

.saved-highlight {
  color: var(--emerald);
  font-weight: 700;
  font-size: 0.84rem;
}

.wallet-soon-badge {
  font-size: 0.72rem;
  color: var(--text-muted);
  border: 1px dashed var(--border-strong);
  padding: 5px 8px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  flex-shrink: 0;
}

@media (max-width: 1260px) {
  .brand-subtitle {
    display: none;
  }
}

@media (min-width: 821px) and (max-width: 1120px) {
  .header-inner {
    flex-wrap: wrap;
    row-gap: 8px;
  }

  .brand-group {
    order: 1;
  }

  .nav-actions {
    order: 2;
    margin-left: auto;
  }

  .main-tabs {
    order: 3;
    width: 100%;
    justify-content: flex-start;
    overflow-x: auto;
  }
}

/* ================= 主容器与顶部指标条 ================= */
.app-shell {
  max-width: 1360px;
  margin: 0 auto;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.metrics-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
  gap: 10px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 11px 16px;
  box-shadow: var(--shadow-card);
}

.metric-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.76rem;
}

.metric-item strong {
  font-size: 0.86rem;
  color: var(--text-primary);
}

.wallet-bar {
  display: none !important;
}

.status-banner {
  padding: 11px 15px;
  border-radius: var(--radius-md);
  font-size: 0.86rem;
  font-weight: 500;
  word-break: break-word;
}

.status-banner.success {
  background: var(--up-bg);
  border: 1px solid var(--emerald);
  color: var(--emerald);
}

.status-banner.error {
  background: var(--down-bg);
  border: 1px solid var(--down-color);
  color: var(--down-color);
}

.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-card);
}

/* ================= TOP 100 持仓监控全景与数据表 ================= */
.tab-pane {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.tab-pane[hidden] {
  display: none !important;
}

.top100-overview-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.top100-overview-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 16px;
}

.top100-hero-eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.eyebrow-text {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
}

.pill-badge {
  font-size: 0.72rem;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

.pill-badge.accent {
  background: var(--emerald-soft);
  border-color: var(--border-accent);
  color: var(--emerald);
  font-weight: 600;
}

.top100-hero-value-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 4px;
  flex-wrap: wrap;
}

.hero-number {
  font-family: "Plus Jakarta Sans", "JetBrains Mono", monospace;
  font-size: 1.85rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.hero-unit {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-muted);
}

.hero-share-badge {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--emerald);
  background: var(--emerald-soft);
  padding: 2px 8px;
  border-radius: 6px;
}

.top100-kpi-strip {
  display: grid;
  grid-template-columns: repeat(4, auto);
  gap: 24px;
}

.kpi-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.kpi-val {
  font-size: 0.96rem;
  font-weight: 700;
  color: var(--text-primary);
}

.kpi-sep {
  margin: 0 4px;
  color: var(--border-strong);
}

/* 5段式筹码分布条 */
.concentration-bar-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 4px;
}

.concentration-bar {
  height: 10px;
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  padding: 1px;
  display: flex;
  gap: 2px;
  overflow: hidden;
}

.dist-seg {
  height: 100%;
  transition: width 0.3s ease;
}

.seg-top10 { background: #10b981; border-radius: 999px 0 0 999px; }
.seg-top50 { background: #14b8a6; }
.seg-top100 { background: #06b6d4; }
.seg-pool { background: #6366f1; }
.seg-others { background: var(--seg-others-bg); border-radius: 0 999px 999px 0; flex: 1; }

.concentration-legend {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.76rem;
  color: var(--text-secondary);
}

.legend-items {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.legend-items span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  display: inline-block;
}

.click-guide-hint {
  color: var(--emerald);
  font-weight: 500;
}

/* 一体化表格与筛选栏 */
.top100-table-card {
  padding: 0;
  overflow: hidden;
}

.top100-toolbar {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  background: var(--bg-surface);
}

.filter-pills-group {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
}

.flt-pill {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

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

.flt-pill:hover {
  border-color: var(--border-strong);
}

.flt-pill.active {
  background: var(--emerald);
  border-color: var(--emerald);
  color: #ffffff;
}

.toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 260px;
  justify-content: flex-end;
}

.period-switch {
  display: flex;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  padding: 2px;
  border-radius: 8px;
}

.period-btn {
  background: transparent;
  border: none;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
}

.period-btn.active {
  background: var(--bg-surface);
  color: var(--emerald);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08), inset 0 0 0 1px var(--border-accent);
}

.search-box {
  width: 230px;
  max-width: 100%;
}

.search-box input {
  padding: 6px 11px;
  font-size: 0.78rem;
  background: var(--bg-elevated);
}

/* 桌面端表格 */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.holders-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.8rem;
}

.holders-table thead tr {
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.holders-table th {
  padding: 11px 16px;
  font-weight: 600;
  white-space: nowrap;
}

.holders-table tbody tr {
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: background-color 0.12s ease;
}

.holders-table tbody tr:hover {
  background-color: var(--bg-hover);
}

.holders-table td {
  padding: 13px 16px;
  vertical-align: middle;
}

.holder-addr-cell {
  display: flex;
  align-items: center;
  gap: 11px;
}

.rank-badge {
  width: 25px;
  height: 25px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  flex-shrink: 0;
}

.rank-badge.rank-1 {
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.45);
  color: var(--rank-1-color);
}

.rank-badge.rank-2 {
  background: rgba(100, 116, 139, 0.15);
  border-color: rgba(100, 116, 139, 0.4);
  color: var(--rank-2-color);
}

.rank-badge.rank-3 {
  background: rgba(234, 88, 12, 0.14);
  border-color: rgba(234, 88, 12, 0.4);
  color: var(--rank-3-color);
}

.addr-orb {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  font-weight: 700;
  color: #ffffff;
  flex-shrink: 0;
}

.addr-primary {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}

.holders-table tbody tr:hover .addr-primary {
  color: var(--emerald);
}

.addr-sub {
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* 深度背景条单元格 */
.balance-depth-cell {
  position: relative;
}

.balance-depth-content {
  position: relative;
  z-index: 2;
}

.balance-main {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
}

.balance-sub {
  font-size: 0.71rem;
  color: var(--text-secondary);
}

.depth-bg-bar {
  position: absolute;
  right: 10px;
  top: 8px;
  bottom: 8px;
  background: rgba(16, 185, 129, 0.09);
  border-radius: 6px 0 0 6px;
  pointer-events: none;
  z-index: 1;
}

/* 10 段式仓位格栅条 */
.retention-cell-wrap {
  width: 148px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.retention-top-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.74rem;
}

.segmented-meter {
  display: flex;
  gap: 3px;
}

.seg-tick {
  height: 7px;
  flex: 1;
  border-radius: 2px;
  background: var(--seg-tick-bg);
}

.seg-tick.fill-high { background: #10b981; }
.seg-tick.fill-mid { background: #f59e0b; }
.seg-tick.fill-low { background: #f43f5e; }

/* 净变动胶囊 */
.delta-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.76rem;
  font-weight: 700;
}

.delta-pill.up {
  background: var(--up-bg);
  color: var(--up-color);
}

.delta-pill.down {
  background: var(--down-bg);
  color: var(--down-color);
}

.delta-sub {
  font-size: 0.7rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.last-action-wrap {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.detail-trigger-btn {
  padding: 4px 9px;
  border-radius: 6px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: all 0.15s ease;
}

.holders-table tbody tr:hover .detail-trigger-btn {
  border-color: var(--emerald);
  color: var(--emerald);
  background: var(--emerald-soft);
}

/* 手机端卡片列表 */
.mobile-only-cards {
  display: none;
  padding: 12px;
  flex-direction: column;
  gap: 10px;
}

.mobile-holder-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 13px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  cursor: pointer;
}

.mobile-holder-card:active {
  border-color: var(--emerald);
}

.mob-card-top,
.mob-card-mid,
.mob-card-bot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.mob-card-bot {
  padding-top: 8px;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.75rem;
}

/* ================= 地址历史详情抽屉 (Slide-Over / Bottom Sheet) ================= */
body.modal-open {
  overflow: hidden !important;
  overscroll-behavior: none;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: var(--backdrop-bg);
  backdrop-filter: blur(4px);
  display: flex;
  justify-content: flex-end;
  align-items: stretch;
  overscroll-behavior: contain;
  touch-action: none;
}

.modal-backdrop[hidden] {
  display: none !important;
}

.modal-drawer {
  width: 100%;
  max-width: 560px;
  height: 100%;
  background: var(--bg-surface);
  border-left: 1px solid var(--border-strong);
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  overscroll-behavior: contain;
  box-shadow: var(--drawer-shadow);
}

.drawer-header {
  flex-shrink: 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  z-index: 3;
}

.drawer-scroll-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
  padding: 18px 22px calc(28px + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.drawer-scroll-body > * {
  flex-shrink: 0;
}

.drawer-addr-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.drawer-orb {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.84rem;
  font-weight: 700;
  color: #ffffff;
  flex-shrink: 0;
}

.drawer-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.drawer-full-addr {
  font-size: 0.72rem;
  color: var(--text-secondary);
  word-break: break-all;
  margin-top: 3px;
}

.close-drawer-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.9rem;
}

.curve-box {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 14px;
}

.curve-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  margin-bottom: 6px;
}

.curve-svg {
  width: 100%;
  height: 76px;
  display: block;
}

.drawer-kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.drawer-kpi-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 11px 13px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.drawer-kpi-val {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
}

.drawer-history-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.drawer-history-toolbar h4 {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
}

.timeline-list {
  border-left: 2px solid var(--border-strong);
  margin-left: 8px;
  padding-left: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.timeline-item {
  flex-shrink: 0;
  position: relative;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.78rem;
}

.timeline-dot {
  position: absolute;
  left: -22px;
  top: 15px;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #3b82f6;
  border: 2px solid var(--bg-surface);
}

.timeline-dot.buy { background: var(--up-color); }
.timeline-dot.sell { background: var(--down-color); }

.timeline-top,
.timeline-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.timeline-delta {
  font-size: 0.9rem;
  font-weight: 700;
}

.timeline-foot {
  padding-top: 6px;
  margin-top: 2px;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.72rem;
  color: var(--text-muted);
}

.timeline-foot a {
  color: var(--emerald);
  text-decoration: none;
  font-weight: 600;
}

/* ================= Transfer / Swap 表单与对比横幅 ================= */
.fee-comparison-banner {
  background: var(--fee-banner-bg);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  box-shadow: var(--shadow-card);
}

.fee-banner-text {
  flex: 1 1 320px;
}

.fee-banner-text h2 {
  font-size: 1.1rem;
  margin-bottom: 4px;
  color: var(--text-primary);
}

.fee-comparison-cards {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.fee-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  min-width: 120px;
}

.fee-box.ours,
.fee-box.saved {
  border-color: var(--border-accent);
}

.strike-fee {
  color: var(--down-color);
  text-decoration: line-through;
  font-size: 0.98rem;
}

.zero-fee {
  color: var(--emerald);
  font-size: 1rem;
}

form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-row.two-col {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

label {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-primary);
}

.balance-inline {
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  gap: 6px;
}

input,
select {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 0.92rem;
  outline: none;
  transition: border-color 0.15s ease;
  width: 100%;
}

input:focus,
select:focus {
  border-color: var(--emerald);
  background: var(--bg-surface);
}

select option {
  background-color: var(--bg-surface);
  color: var(--text-primary);
}

input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text-primary);
  -webkit-box-shadow: 0 0 0 1000px var(--bg-elevated) inset;
  transition: background-color 5000s ease-in-out 0s;
}

.input-with-unit {
  position: relative;
  display: flex;
  align-items: center;
}

.input-with-unit input {
  padding-right: 76px;
}

.unit-badge {
  position: absolute;
  right: 10px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--emerald);
  background: var(--emerald-soft);
  padding: 3px 8px;
  border-radius: 6px;
}

.preset-pills {
  display: flex;
  gap: 5px;
}

.pill-btn {
  background: var(--bg-elevated);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
}

.pill-btn:hover,
.pill-btn.accent {
  color: var(--emerald);
  border-color: var(--border-accent);
  background: var(--emerald-soft);
}

.postage-hint {
  background: var(--bg-elevated);
  border-left: 3px solid var(--emerald);
  padding: 8px 12px;
  border-radius: 4px;
}

.segmented-control {
  display: flex;
  background: var(--bg-elevated);
  padding: 4px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  gap: 6px;
}

.segment-btn {
  flex: 1;
  background: transparent;
  color: var(--text-secondary);
  border: none;
  padding: 9px;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
}

.segment-btn.active {
  background: var(--bg-surface);
  color: var(--emerald);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08), inset 0 0 0 1px var(--border-accent);
}

.mode-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}

.mode-card {
  text-align: left;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.mode-card.active {
  background: var(--emerald-soft);
  border-color: var(--emerald);
}

.mode-card-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.mode-card.active .mode-card-title {
  color: var(--emerald);
}

.mode-card-desc {
  font-size: 0.78rem;
  line-height: 1.4;
}

.quote-box {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 16px;
}

.quote-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
  margin-bottom: 10px;
}

.quote-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.8rem;
}

.quote-primary.good {
  color: var(--emerald);
  font-size: 1rem;
}

.quote-primary.bad,
.quote-error {
  color: var(--down-color);
}

.payload-preview {
  border-top: 1px solid var(--border-subtle);
  padding-top: 8px;
  font-size: 0.78rem;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.payload-preview code {
  color: var(--emerald);
  word-break: break-all;
}

/* 按钮 */
.btn-primary,
.btn-Sign,
.btn-connected,
.btn-secondary,
.btn-danger,
.btn-ghost {
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  border: 1px solid transparent;
}

.btn-primary {
  background: var(--emerald);
  color: #ffffff;
}

.btn-primary:hover:not(:disabled) {
  background: var(--emerald-bright);
}

.btn-Sign {
  background: linear-gradient(90deg, #059669, #10b981);
  color: #ffffff;
  font-size: 0.96rem;
  padding: 12px 18px;
  margin-top: 12px;
  box-shadow: 0 4px 14px rgba(5, 150, 105, 0.22);
}

.btn-connected {
  background: var(--emerald-soft);
  color: var(--emerald);
  border-color: var(--border-accent);
}

.btn-ghost {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border-color: var(--border-subtle);
}

.btn-secondary {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border-color: var(--border-subtle);
}

.btn-danger {
  background: var(--down-bg);
  color: var(--down-color);
  border-color: var(--down-color);
}

.full-width {
  width: 100%;
}

button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* PSBT Inspector */
.inspector-wrapper {
  margin-top: 16px;
}

.inspector-card {
  background: var(--inspector-bg);
  border: 1px solid var(--emerald);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.inspector-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.verified-pill {
  background: var(--emerald-soft);
  color: var(--emerald);
  border: 1px solid var(--border-accent);
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 600;
}

.inspector-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  font-size: 0.8rem;
  background: var(--bg-surface);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

.inspector-meta-grid > div {
  display: flex;
  flex-direction: column;
}

.psbt-vout-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.psbt-vout-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
}

.vout-badge {
  background: var(--emerald-soft);
  color: var(--emerald);
  font-family: monospace;
  font-size: 0.76rem;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: 5px;
  white-space: nowrap;
}

.vout-info {
  flex: 1;
  min-width: 0;
}

.vout-role {
  font-size: 0.84rem;
  font-weight: 600;
}

.vout-addr {
  font-size: 0.76rem;
  color: var(--text-muted);
  word-break: break-all;
}

.vout-val {
  font-weight: 700;
  color: var(--emerald);
  white-space: nowrap;
}

/* History */
.section-heading {
  font-size: 1.05rem;
  margin-bottom: 14px;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.history-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.history-sub a {
  color: var(--emerald);
  text-decoration: none;
}

.tx-kind-badge {
  background: var(--emerald-soft);
  color: var(--emerald);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 5px;
  margin-right: 6px;
}

.history-actions {
  display: flex;
  gap: 8px;
}

.empty-state {
  text-align: center;
  padding: 32px 16px;
  color: var(--text-muted);
}

/* ================= 手机端响应式与底部导航栏 ================= */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 40;
  background: var(--bg-header);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--border-subtle);
  padding: 6px 10px calc(6px + env(safe-area-inset-bottom));
  justify-content: space-around;
}

.mob-nav-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 4px 12px;
  cursor: pointer;
}

.mob-nav-btn.active {
  color: var(--emerald);
}

.mob-nav-icon {
  font-size: 1.05rem;
}

@media (max-width: 820px) {
  body {
    padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  }

  .main-tabs,
  .wallet-soon-badge,
  .saved-counter,
  .desktop-only-table,
  .brand-subtitle,
  .desktop-only-metric,
  .click-guide-hint,
  .wallet-bar.is-disconnected,
  .mobile-bottom-nav {
    display: none !important;
  }

  .mobile-only-cards {
    display: flex !important;
    padding: 8px;
    gap: 6px;
  }

  /* 顶部导航栏：单行 46px 高密度 App Bar，不折行 */
  .header-inner {
    padding: 7px 12px;
    gap: 8px;
    flex-wrap: nowrap;
  }

  .header-left {
    gap: 8px;
    flex-wrap: nowrap;
    min-width: 0;
  }

  .brand-group {
    gap: 7px;
  }

  .brand-logo {
    width: 28px;
    height: 28px;
    border-radius: 7px;
  }

  .brand-logo svg {
    width: 15px;
    height: 15px;
  }

  .brand-title-row {
    gap: 6px;
  }

  .brand-title-row h1 {
    font-size: 0.98rem;
  }

  .zero-fee-pill {
    font-size: 0.62rem;
    padding: 1px 5px;
    white-space: nowrap;
  }

  .nav-actions {
    gap: 5px;
    flex-wrap: nowrap;
    flex-shrink: 0;
  }

  .theme-switch-btn {
    padding: 2px;
  }

  .theme-opt {
    width: 24px;
    height: 22px;
    font-size: 0.78rem;
  }

  .nav-actions .btn-ghost,
  .nav-actions .wallet-btn {
    padding: 5px 8px;
    font-size: 0.72rem;
    border-radius: 6px;
    white-space: nowrap;
  }

  /* 主容器间距全面收紧 */
  .app-shell {
    padding: 8px 10px;
    gap: 8px;
  }

  .tab-pane {
    gap: 8px;
  }

  /* 顶部链上指标条：单行横向滚动行情条 (34px) */
  .metrics-strip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px;
    border-radius: 9px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  .metrics-strip::-webkit-scrollbar {
    display: none;
  }

  .metric-item {
    flex-direction: row;
    align-items: baseline;
    gap: 5px;
    font-size: 0.7rem;
    white-space: nowrap;
    flex-shrink: 0;
    padding-right: 10px;
    border-right: 1px solid var(--border-subtle);
  }

  .metric-item:nth-child(4),
  .metric-item:last-of-type {
    border-right: none;
    padding-right: 0;
  }

  .metric-item strong {
    font-size: 0.76rem;
  }

  /* TOP 100 筹码全景与 KPI 概览卡：紧凑化 */
  .card.top100-overview-card {
    padding: 10px 12px;
    border-radius: 12px;
    gap: 7px;
  }

  .top100-overview-header {
    gap: 7px;
  }

  .top100-hero-block {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 3px;
  }

  .top100-hero-eyebrow {
    gap: 4px;
    justify-content: space-between;
    flex-wrap: nowrap;
  }

  .eyebrow-text {
    font-size: 0.68rem;
    letter-spacing: 0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
  }

  .pill-badge {
    font-size: 0.64rem;
    padding: 1px 5px;
    white-space: nowrap;
    flex-shrink: 0;
  }

  .top100-hero-value-row {
    margin-top: 0;
    gap: 6px;
    align-items: baseline;
  }

  .hero-number {
    font-size: 1.22rem;
    line-height: 1.18;
  }

  .hero-unit {
    font-size: 0.74rem;
  }

  .hero-share-badge {
    font-size: 0.68rem;
    padding: 1px 6px;
    margin-left: auto;
  }

  /* 4 项百强 KPI：单行非对称 4 列看板 */
  .top100-kpi-strip {
    grid-template-columns: 1.15fr 1.25fr 0.8fr 0.8fr;
    width: 100%;
    gap: 6px;
    padding-top: 6px;
    border-top: 1px solid var(--border-subtle);
  }

  .kpi-cell {
    gap: 1px;
    min-width: 0;
  }

  .kpi-cell .small {
    font-size: 0.62rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .kpi-val {
    font-size: 0.73rem;
    white-space: nowrap;
  }

  .kpi-sep {
    margin: 0 2px;
  }

  /* 5 段式筹码集中度条与单行滚动图例 */
  .concentration-bar-wrap {
    gap: 4px;
    padding-top: 0;
  }

  .concentration-bar {
    height: 6px;
  }

  .concentration-legend {
    font-size: 0.64rem;
    gap: 4px;
  }

  .legend-items {
    flex-wrap: nowrap;
    gap: 10px;
    overflow-x: auto;
    width: 100%;
    scrollbar-width: none;
  }

  .legend-items::-webkit-scrollbar {
    display: none;
  }

  .legend-items span {
    white-space: nowrap;
    flex-shrink: 0;
    gap: 4px;
  }

  .dot {
    width: 6px;
    height: 6px;
  }

  /* 筛选与搜索工具栏：紧凑双行 */
  .top100-table-card {
    border-radius: 12px;
  }

  .top100-toolbar {
    padding: 8px 10px;
    gap: 6px;
  }

  .filter-pills-group {
    width: 100%;
    gap: 4px;
    scrollbar-width: none;
  }

  .filter-pills-group::-webkit-scrollbar {
    display: none;
  }

  .flt-pill {
    padding: 4px 8px;
    font-size: 0.7rem;
    border-radius: 6px;
  }

  .toolbar-right {
    width: 100%;
    flex: 1 1 100%;
    gap: 6px;
  }

  .period-btn {
    padding: 3px 8px;
    font-size: 0.7rem;
  }

  .search-box {
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
  }

  .search-box input {
    padding: 3px 9px;
    height: 30px;
    font-size: 16px;
  }

  /* 手机端百强地址卡片：高密度双行布局 */
  .mobile-holder-card {
    padding: 8px 10px;
    gap: 4px;
    border-radius: 9px;
  }

  .holder-addr-cell {
    gap: 6px;
    min-width: 0;
  }

  .rank-badge {
    width: 22px;
    height: 20px;
    font-size: 0.66rem;
    border-radius: 5px;
  }

  .addr-orb {
    width: 20px;
    height: 20px;
    font-size: 0.58rem;
  }

  .addr-primary {
    font-size: 0.76rem;
  }

  .delta-pill {
    padding: 1px 5px;
    font-size: 0.66rem;
    border-radius: 4px;
  }

  .mob-unchanged-tag {
    font-size: 0.64rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    padding: 0 4px;
    border-radius: 4px;
  }

  .mob-balance-box {
    display: flex;
    align-items: baseline;
    gap: 4px;
    flex-shrink: 0;
  }

  .mob-balance-box .balance-main {
    font-size: 0.8rem;
  }

  .mob-balance-box .balance-sub {
    font-size: 0.66rem;
  }

  .mob-card-mid {
    font-size: 0.68rem;
  }

  .mob-detail-link {
    font-weight: 600;
    font-size: 0.68rem;
  }

  .modal-backdrop {
    align-items: flex-end;
  }

  .modal-drawer {
    max-width: 100%;
    height: 86vh;
    height: 86dvh;
    max-height: 86dvh;
    border-left: none;
    border-top: 1px solid var(--border-strong);
    border-radius: 22px 22px 0 0;
    padding: 0;
  }

  .drawer-header {
    padding: 14px 16px 11px;
  }

  .drawer-full-addr {
    font-size: 0.68rem;
    line-height: 1.3;
  }

  .drawer-scroll-body {
    padding: 12px 16px calc(28px + env(safe-area-inset-bottom, 0px));
    gap: 11px;
  }

  .curve-box {
    padding: 9px 12px;
  }

  .curve-svg {
    height: 48px;
  }

  .drawer-kpi-grid {
    gap: 8px;
  }

  .drawer-kpi-card {
    padding: 8px 10px;
  }

  .drawer-kpi-val {
    font-size: 0.86rem;
  }

  .drawer-history-toolbar {
    position: sticky;
    top: -12px;
    z-index: 4;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-subtle);
    padding: 8px 0;
  }

  @media (max-width: 480px) {
    .zero-fee-pill {
      display: none;
    }
  }

  input,
  select {
    font-size: 16px;
  }
}
