/* ==========================================================================
   欧易观察台 · 机构级暗黑金融交易终端样式 (Cyber-Institutional Theme)
   ========================================================================== */

:root {
  /* 基础深邃黑底色体系 (默认/暗黑模式 - 纯正高级雾黑) */
  --bg-base: #090a0d;
  --bg-sidebar: #050608;
  --bg-surface: #121317;
  --bg-surface-elevated: #181920;
  --bg-surface-hover: #1f2129;
  --bg-glass: rgba(18, 19, 23, 0.85);
  --bg-glass-card: rgba(22, 23, 29, 0.88);

  /* 边框与分割线 */
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-medium: rgba(255, 255, 255, 0.14);
  --border-glow: rgba(59, 130, 246, 0.35);

  /* 文字体系 (提升对比度，杜绝发虚发糊) */
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --text-faint: #64748b;

  /* 金融功能色 (高对比度、纯正不刺眼) */
  --color-brand: #3b82f6;
  --color-brand-glow: rgba(59, 130, 246, 0.22);
  --color-brand-hover: #2563eb;
  
  --color-emerald: #10b981;
  --color-emerald-soft: rgba(16, 185, 129, 0.12);
  --color-emerald-glow: rgba(16, 185, 129, 0.28);
  --color-emerald-text: #34d399;

  --color-amber: #f59e0b;
  --color-amber-soft: rgba(245, 158, 11, 0.12);
  --color-amber-glow: rgba(245, 158, 11, 0.25);
  --color-amber-text: #fbbf24;

  --color-rose: #ef4444;
  --color-rose-soft: rgba(239, 68, 68, 0.12);
  --color-rose-glow: rgba(239, 68, 68, 0.28);
  --color-rose-text: #f87171;

  /* 字体与尺度 */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Inter", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", Menlo, Consolas, "Roboto Mono", monospace;
  --font-display: -apple-system, BlinkMacSystemFont, "Inter", "PingFang SC", sans-serif;

  --radius-xs: 4px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  /* 阴影体系 */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 16px -2px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 12px 36px -4px rgba(0, 0, 0, 0.65);
  --shadow-glow: 0 0 24px -4px var(--color-brand-glow);

  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 220ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* 浅色主题支持 (无论浅色还是深色，用户特别要求：左侧板子始终为纯黑底) */
/* 浅色主题支持 (无论浅色还是深色，用户特别要求：左侧板子始终为纯黑底) */
html.light, [data-theme="light"] {
  --bg-base: #f1f5f9;
  --bg-sidebar: #05080e; /* 左侧板子即使在浅色模式也保持高级黑底 */
  --bg-surface: #ffffff;
  --bg-surface-elevated: #f8fafc;
  --bg-surface-hover: #f1f5f9;
  --bg-glass: rgba(255, 255, 255, 0.88);
  --bg-glass-card: #ffffff;

  --border-subtle: #e2e8f0;
  --border-medium: #cbd5e1;
  --border-glow: rgba(59, 130, 246, 0.25);

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --text-faint: #94a3b8;

  --color-emerald-soft: #ecfdf5;
  --color-emerald-text: #059669;
  --color-amber-soft: #fffbeb;
  --color-amber-text: #d97706;
  --color-rose-soft: #fef2f2;
  --color-rose-text: #dc2626;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 14px -2px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 10px 30px -4px rgba(15, 23, 42, 0.12);
  
  background-color: #f1f5f9 !important;
  color: #0f172a !important;
  color-scheme: light !important;
}

html.light body,
[data-theme="light"] body,
html.light main#workspace,
[data-theme="light"] main#workspace {
  background-color: #f1f5f9 !important;
  color: #0f172a !important;
}

html.light .panel,
[data-theme="light"] .panel,
html.light .card-hero,
[data-theme="light"] .card-hero,
html.light .metric,
[data-theme="light"] .metric,
html.light .table-container,
[data-theme="light"] .table-container,
html.light .table-wrap,
[data-theme="light"] .table-wrap,
html.light .scanner-intro,
[data-theme="light"] .scanner-intro,
html.light .skeleton-card,
[data-theme="light"] .skeleton-card {
  background: #ffffff !important;
  background-color: #ffffff !important;
  background-image: none !important;
  border-color: #e2e8f0 !important;
  color: #0f172a !important;
}

/* 全局重置 */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  min-height: 100%;
  background-color: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

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

button:focus-visible, a:focus-visible, input:focus-visible {
  outline: 2px solid var(--color-brand);
  outline-offset: 2px;
}

[hidden],
#content[hidden],
#terminal[hidden],
.page[hidden] {
  display: none !important;
}

/* 未授权安全守护：当未通过口令鉴权或认证面板展开时，彻底隐藏内容区与一切行情终端组件 */
html:not([data-auth="authorized"]) #content,
html:not([data-auth="authorized"]) #terminal,
html:not([data-auth="authorized"]) .page,
body.is-unauthorized #content,
body.is-unauthorized #terminal,
body.is-unauthorized .page,
body:has(#auth-form:not([hidden])) #content,
body:has(#auth-form:not([hidden])) #terminal,
body:has(#auth-form:not([hidden])) .page {
  display: none !important;
}

.term-pair-empty {
  padding: 24px 12px;
  text-align: center;
  color: #848e9c;
  font-size: 11px;
  line-height: 1.6;
}

.term-pair-empty-hint {
  display: inline-block;
  margin-top: 4px;
  color: #5e6673;
  font-size: 10px;
}

body.is-unauthorized,
body:has(#auth-form:not([hidden])) {
  overflow: auto !important;
  height: auto !important;
  max-height: none !important;
}

body.is-unauthorized #workspace,
body:has(#auth-form:not([hidden])) #workspace {
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
  display: block !important;
  padding: 0 32px 40px !important;
}

.skip {
  position: fixed;
  top: -100px;
  left: 20px;
  z-index: 1000;
  background: var(--color-brand);
  color: #fff;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-weight: 500;
  transition: top var(--transition-fast);
}
.skip:focus {
  top: 16px;
}

/* ==========================================================================
   左侧侧边栏 (极度高级纯正黑底 · 红框指定区域)
   ========================================================================== */
.sidebar {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  width: 248px;
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-subtle);
  padding: 24px 16px 20px;
  display: flex;
  flex-direction: column;
  z-index: 100;
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.4);
}

/* 品牌区 */
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  padding: 8px 10px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.brand-mark-wrap {
  position: relative;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: #000000;
  border: 1px solid rgba(59, 130, 246, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 18px -2px rgba(59, 130, 246, 0.35), inset 0 1px 1px rgba(255, 255, 255, 0.15);
  flex-shrink: 0;
  overflow: hidden;
  padding: 0;
  transition: all var(--transition-normal);
}

.brand:hover .brand-mark-wrap {
  border-color: rgba(96, 165, 250, 0.7);
  box-shadow: 0 0 24px rgba(59, 130, 246, 0.55), inset 0 1px 1px rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
}

.brand-logo-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 11px;
}

.brand-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.brand-name {
  font-family: var(--font-display);
  font-size: 16.5px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #ffffff;
  line-height: 1.25;
}

.brand-tag {
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: #94a3b8;
  margin-top: 3px;
  line-height: 1.2;
}

/* 导航分类标题 */
.nav-section-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #475569;
  padding: 24px 12px 10px;
}

/* 导航菜单 */
.nav-menu {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  color: #94a3b8;
  font-size: 13.5px;
  font-weight: 500;
  text-align: left;
  transition: all var(--transition-fast);
  position: relative;
}

.nav-icon {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  color: #64748b;
  transition: color var(--transition-fast);
  flex-shrink: 0;
}

.nav-icon-img {
  width: 20px;
  height: 20px;
  border-radius: 5px;
  object-fit: cover;
  flex-shrink: 0;
  transition: transform var(--transition-fast), filter var(--transition-fast);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

.nav-item:hover .nav-icon-img {
  transform: scale(1.12);
  filter: brightness(1.2) drop-shadow(0 0 6px rgba(0, 240, 255, 0.5));
}

.nav-item.selected .nav-icon-img {
  transform: scale(1.15);
  filter: brightness(1.25) drop-shadow(0 0 8px rgba(59, 130, 246, 0.7));
}

.section-icon-img {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  object-fit: cover;
  vertical-align: middle;
  margin-right: 8px;
  display: inline-block;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.nav-item:hover {
  background-color: rgba(255, 255, 255, 0.04);
  color: #f1f5f9;
}

.nav-item:hover .nav-icon {
  color: #93c5fd;
}

/* 选中高亮项 - 极具质感的左侧垂直发光胶囊效果 */
.nav-item.selected {
  background: linear-gradient(90deg, rgba(59, 130, 246, 0.16) 0%, rgba(59, 130, 246, 0.03) 100%);
  color: #ffffff;
  font-weight: 600;
}

.nav-item.selected::before {
  content: "";
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 3.5px;
  border-radius: 0 4px 4px 0;
  background-color: #3b82f6;
  box-shadow: 0 0 10px #3b82f6;
}

.nav-item.selected .nav-icon {
  color: #60a5fa;
}

/* 侧边栏底部状态与提示 */
.sidebar-note {
  margin-top: auto;
  padding: 14px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.sidebar-status-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.status-pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--color-emerald);
  box-shadow: 0 0 8px var(--color-emerald);
  display: inline-block;
  animation: pulse-glow 2.5s infinite ease-in-out;
}

.sidebar-status-title {
  font-size: 12px;
  font-weight: 600;
  color: #e2e8f0;
}

.sidebar-note small {
  display: block;
  font-size: 11px;
  line-height: 1.5;
  color: #64748b;
}

.sidebar-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  margin-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.env-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: #94a3b8;
  font-family: var(--font-mono);
}

.env-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #3b82f6;
}

.chain-badge {
  font-size: 10px;
  font-weight: 600;
  color: #64748b;
  padding: 2px 7px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

/* ==========================================================================
   主工作区 (Main Workspace)
   ========================================================================== */
main#workspace {
  margin-left: 248px;
  width: calc(100% - 248px);
  padding: 0 40px 48px;
  min-height: 100vh;
  box-sizing: border-box;
}

/* 顶部栏 (Topbar) */
.topbar {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
  gap: 20px;
}

.breadcrumb-container {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}

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

.breadcrumb-slash {
  color: var(--border-medium);
  font-size: 11px;
}

.breadcrumb-current {
  color: var(--text-primary);
  font-weight: 600;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
  flex-shrink: 0;
}

/* ==========================================================================
   盘口模式分段切换胶囊 (Segmented Mode Switch Capsule)
   ========================================================================== */
.mode-switch-capsule {
  display: inline-flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 3px;
  border-radius: var(--radius-sm);
  gap: 3px;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.2);
}

html.light .mode-switch-capsule,
[data-theme="light"] .mode-switch-capsule {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.08);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.04);
}

.mode-capsule-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: calc(var(--radius-sm) - 2px);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
}

.mode-capsule-btn:hover:not(.active) {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
}

html.light .mode-capsule-btn:hover:not(.active),
[data-theme="light"] .mode-capsule-btn:hover:not(.active) {
  background: rgba(0, 0, 0, 0.03);
}

.capsule-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.4;
  transition: all 0.2s ease;
}

/* 模拟盘激活状态 */
#btn-mode-paper.active {
  background: rgba(59, 130, 246, 0.18);
  border-color: rgba(59, 130, 246, 0.45);
  color: #93c5fd;
  font-weight: 600;
  box-shadow: 0 1px 4px rgba(59, 130, 246, 0.15);
}

#btn-mode-paper.active .capsule-dot {
  background: #60a5fa;
  opacity: 1;
  box-shadow: 0 0 6px #60a5fa;
}

html.light #btn-mode-paper.active,
[data-theme="light"] #btn-mode-paper.active {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1d4ed8;
  box-shadow: 0 1px 3px rgba(37, 99, 235, 0.1);
}

html.light #btn-mode-paper.active .capsule-dot,
[data-theme="light"] #btn-mode-paper.active .capsule-dot {
  background: #2563eb;
  box-shadow: 0 0 4px rgba(37, 99, 235, 0.5);
}

/* 真实盘激活状态 */
#btn-mode-live.active {
  background: rgba(16, 185, 129, 0.18);
  border-color: rgba(16, 185, 129, 0.45);
  color: #6ee7b7;
  font-weight: 600;
  box-shadow: 0 1px 4px rgba(16, 185, 129, 0.15);
}

#btn-mode-live.active .capsule-dot {
  background: #34d399;
  opacity: 1;
  box-shadow: 0 0 6px #34d399;
}

html.light #btn-mode-live.active,
[data-theme="light"] #btn-mode-live.active {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #047857;
  box-shadow: 0 1px 3px rgba(5, 150, 105, 0.1);
}

html.light #btn-mode-live.active .capsule-dot,
[data-theme="light"] #btn-mode-live.active .capsule-dot {
  background: #059669;
  box-shadow: 0 0 4px rgba(5, 150, 105, 0.5);
}

/* ==========================================================================
   真实盘模式状态与接口反馈横幅 (Live Notice Banner)
   ========================================================================== */
.live-notice-banner {
  background: linear-gradient(180deg, rgba(16, 185, 129, 0.08) 0%, rgba(15, 23, 42, 0.4) 100%);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  margin-bottom: 24px;
  animation: slideDownFade 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

html.light .live-notice-banner,
[data-theme="light"] .live-notice-banner {
  background: linear-gradient(180deg, #ecfdf5 0%, #ffffff 100%);
  border: 1px solid #a7f3d0;
  box-shadow: 0 4px 16px -2px rgba(16, 185, 129, 0.08);
}

@keyframes slideDownFade {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.live-notice-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

html.light .live-notice-head,
[data-theme="light"] .live-notice-head {
  border-bottom-color: rgba(0, 0, 0, 0.06);
}

.live-notice-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #34d399;
}

html.light .live-notice-badge,
[data-theme="light"] .live-notice-badge {
  color: #065f46;
  font-weight: 700;
}

.live-notice-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 8px #34d399;
}

html.light .live-notice-dot,
[data-theme="light"] .live-notice-dot {
  background: #059669;
  box-shadow: 0 0 6px rgba(5, 150, 105, 0.4);
}

.live-notice-tip {
  font-size: 12px;
  color: var(--text-muted);
}

html.light .live-notice-tip,
[data-theme="light"] .live-notice-tip {
  color: #475569;
  font-weight: 500;
}

.live-notice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}

.live-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

html.light .live-card,
[data-theme="light"] .live-card {
  background: #ffffff;
  border-color: #cbd5e1;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.04);
}

.live-card-top {
  display: flex;
  align-items: center;
  gap: 8px;
}

.live-card-top strong {
  font-size: 13px;
  color: var(--text-primary);
  flex: 1;
}

html.light .live-card-top strong,
[data-theme="light"] .live-card-top strong {
  color: #0f172a;
  font-weight: 700;
}

.live-icon {
  font-size: 13px;
  font-weight: 700;
}

.live-card.ready .live-icon {
  color: #34d399;
}

.live-card.pending .live-icon {
  color: #fbbf24;
}

.live-card.locked .live-icon {
  color: #f87171;
}

html.light .live-card.ready .live-icon,
[data-theme="light"] .live-card.ready .live-icon {
  color: #047857;
}

html.light .live-card.pending .live-icon,
[data-theme="light"] .live-card.pending .live-icon {
  color: #b45309;
}

html.light .live-card.locked .live-icon,
[data-theme="light"] .live-card.locked .live-icon {
  color: #dc2626;
}

.live-card p {
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--text-secondary);
  margin: 0;
}

html.light .live-card p,
[data-theme="light"] .live-card p {
  color: #334155;
  font-size: 12px;
  line-height: 1.55;
  font-weight: 400;
}

.live-state-tag {
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 4px;
  white-space: nowrap;
}

.ready-tag {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

html.light .ready-tag,
[data-theme="light"] .ready-tag {
  background: #ecfdf5;
  color: #047857;
  border-color: #a7f3d0;
  font-weight: 600;
}

.pending-tag {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

html.light .pending-tag,
[data-theme="light"] .pending-tag {
  background: #fffbeb;
  color: #b45309;
  border-color: #fde68a;
  font-weight: 600;
}

.locked-tag {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

html.light .locked-tag,
[data-theme="light"] .locked-tag {
  background: #fef2f2;
  color: #b91c1c;
  border-color: #fecaca;
  font-weight: 600;
}

/* 真实盘当日已实现盈亏特殊提示色 */
.metric-val-pending {
  font-size: 24px !important;
  color: var(--text-secondary) !important;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* 原生钱包数量保留 SOL 的 9 位与 USDC 的 6 位精度。 */
.metric strong.native-quantity {
  font-size: clamp(24px, 2.4vw, 40px);
  overflow-wrap: anywhere;
}

#live-wallet-message {
  overflow-wrap: anywhere;
}

/* 同步时间与微光指示器 */
.sync-indicator {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
}

.sync-pulse {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-emerald);
  box-shadow: 0 0 6px var(--color-emerald);
}

#sync-time {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

/* 徽章 (Badges) */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: var(--radius-sm);
  background: rgba(59, 130, 246, 0.12);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.25);
  font-size: 11.5px;
  font-weight: 600;
  padding: 4px 10px;
  white-space: nowrap;
}

.badge.amber, .amber-badge {
  background: var(--color-amber-soft) !important;
  color: var(--color-amber-text) !important;
  border-color: rgba(245, 158, 11, 0.3) !important;
}

.badge.red {
  background: var(--color-rose-soft) !important;
  color: var(--color-rose-text) !important;
  border-color: rgba(239, 68, 68, 0.3) !important;
}

.badge.green {
  background: var(--color-emerald-soft) !important;
  color: var(--color-emerald-text) !important;
  border-color: rgba(16, 185, 129, 0.3) !important;
}

.count-badge {
  font-family: var(--font-mono);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  border-color: var(--border-subtle);
}

/* 按钮体系 */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: var(--radius-sm);
  background: var(--color-brand);
  color: #ffffff;
  padding: 7px 14px;
  font-size: 12.5px;
  font-weight: 500;
  border: 1px solid transparent;
  transition: all var(--transition-fast);
}

.button:hover {
  background: var(--color-brand-hover);
  box-shadow: 0 2px 10px rgba(37, 99, 235, 0.35);
}

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

.button.secondary:hover {
  background: var(--bg-surface-elevated);
  border-color: var(--border-medium);
  box-shadow: var(--shadow-sm);
}

.icon-btn-text {
  padding: 6px 12px;
}

.refresh-icon {
  transition: transform var(--transition-normal);
}

button.refreshing .refresh-icon {
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.icon-button {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.icon-button:hover {
  background: var(--bg-surface-elevated);
  border-color: var(--border-medium);
  color: var(--text-primary);
}

/* 主题图标控制 */
html.dark .theme-icon-moon { display: none; }
html.dark .theme-icon-sun { display: block; stroke: #fbbf24; }
html.light .theme-icon-sun { display: none; }
html.light .theme-icon-moon { display: block; stroke: #475569; }

/* 页面大标题区 */
.heading {
  padding: 28px 0 22px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
}

.eyebrow-container {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.eyebrow-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(59, 130, 246, 0.12);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.2);
}

.eyebrow {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
}

h1#page-title {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  line-height: 1.3;
  margin-bottom: 6px;
}

#page-subtitle {
  font-size: 13.5px;
  color: var(--text-secondary);
}

.connection-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 20px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  font-size: 12px;
  color: var(--text-secondary);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--color-emerald);
  box-shadow: 0 0 8px var(--color-emerald);
}

.status-dot.warning {
  background-color: var(--color-amber);
  box-shadow: 0 0 8px var(--color-amber);
}

.status-dot.error {
  background-color: var(--color-rose);
  box-shadow: 0 0 8px var(--color-rose);
}

/* 提示通知条 (Notice Banners) */
.notice {
  padding: 12px 18px;
  border-radius: var(--radius-md);
  margin-bottom: 20px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
}

.notice-demo {
  background: rgba(59, 130, 246, 0.08);
  border-color: rgba(59, 130, 246, 0.22);
  color: #93c5fd;
}

.notice-icon {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(59, 130, 246, 0.15);
  font-weight: 700;
  font-size: 12px;
  flex-shrink: 0;
}

.notice-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.notice-body strong {
  font-size: 12.5px;
  color: #bfdbfe;
}

.notice.error {
  background: var(--color-rose-soft);
  border-color: rgba(239, 68, 68, 0.25);
  color: var(--color-rose-text);
}

/* 认证表单面板 (Auth Panel) */
.auth-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  padding: 32px;
  max-width: 540px;
  margin: 20px auto 40px;
  box-shadow: var(--shadow-lg);
}

.auth-header {
  display: flex;
  gap: 16px;
  margin-bottom: 22px;
}

.auth-icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.25);
  color: #60a5fa;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.auth-panel h2 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.auth-panel p {
  font-size: 12.5px;
  color: var(--text-secondary);
}

.auth-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.input-with-button {
  display: flex;
  gap: 10px;
}

.input-with-button input {
  flex: 1;
  background: var(--bg-base);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 13px;
  transition: border-color var(--transition-fast);
}

.input-with-button input:focus {
  border-color: var(--color-brand);
}

.primary-glow {
  box-shadow: 0 0 16px rgba(59, 130, 246, 0.4);
}

.auth-options {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.auth-duration-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.duration-label {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
  white-space: nowrap;
}

.duration-select {
  flex: 1;
  background: var(--bg-base);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  color: var(--text-primary);
  font-size: 12.5px;
  outline: none;
  cursor: pointer;
  transition: border-color var(--transition-fast), background var(--transition-fast);
}

.duration-select:focus {
  border-color: var(--color-brand);
}

.auth-security-tip {
  font-size: 11.5px;
  color: var(--text-muted);
  line-height: 1.5;
}

#auth-error {
  display: block;
  margin-top: 10px;
  color: var(--color-rose-text);
  font-size: 12px;
}

/* ==========================================================================
   核心指标卡片 (Metrics Grid)
   ========================================================================== */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.metric {
  position: relative;
  background: var(--bg-surface);
  border: 1px solid rgba(255, 255, 255, 0.09) !important;
  border-radius: var(--radius-lg);
  padding: 24px;
  overflow: hidden;
  box-shadow: 0 4px 16px -2px rgba(0, 0, 0, 0.4), inset 0 1px 0 0 rgba(255, 255, 255, 0.05);
  transition: transform var(--transition-fast), border-color var(--transition-fast);
}

html:not(.light) .metric,
html.dark .metric {
  background: linear-gradient(180deg, #181920 0%, #131418 100%) !important;
}

.metric:hover {
  border-color: rgba(255, 255, 255, 0.16) !important;
  transform: translateY(-2px);
  box-shadow: 0 6px 22px -2px rgba(0, 0, 0, 0.55), inset 0 1px 0 0 rgba(255, 255, 255, 0.08);
}

.metric-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.metric-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
}

.metric-currency {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
}

.metric strong {
  display: block;
  font-family: var(--font-mono);
  font-size: 38px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  margin: 10px 0 12px;
  line-height: 1.15;
}

.metric-foot {
  font-size: 12px;
  color: var(--text-muted);
}

/* 顶部微发光渐变氛围 */
.metric-card-glow {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent 0%, rgba(59, 130, 246, 0.4) 50%, transparent 100%);
  opacity: 0.6;
}

.metric-pnl .metric-card-glow {
  background: linear-gradient(90deg, transparent 0%, rgba(16, 185, 129, 0.4) 50%, transparent 100%);
}

/* ==========================================================================
   面板容器 (Panels & Cards)
   ========================================================================== */
.panel {
  background: var(--bg-surface);
  border: 1px solid rgba(255, 255, 255, 0.09) !important;
  border-radius: var(--radius-lg);
  margin-bottom: 24px;
  overflow: hidden;
  box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.45), inset 0 1px 0 0 rgba(255, 255, 255, 0.05);
}

html:not(.light) .panel,
html.dark .panel {
  background: linear-gradient(180deg, #17181e 0%, #121316 100%) !important;
}

.card-hero {
  border-color: rgba(255, 255, 255, 0.12) !important;
  background: var(--bg-surface);
  box-shadow: 0 6px 24px -2px rgba(0, 0, 0, 0.5), inset 0 1px 0 0 rgba(255, 255, 255, 0.05);
}

html:not(.light) .card-hero,
html.dark .card-hero {
  background: linear-gradient(180deg, #1a1b22 0%, #131418 100%) !important;
}

.panel-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 22px 26px 18px;
  gap: 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.sub-label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #60a5fa;
  margin-bottom: 4px;
}

.panel-heading h2 {
  font-size: 16.5px;
  font-weight: 650;
  color: var(--text-primary);
  margin: 0;
}

.panel-heading p {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

.action-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-brand);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.15);
  transition: all var(--transition-fast);
}

.action-link-btn:hover {
  background: rgba(59, 130, 246, 0.15);
  color: #93c5fd;
}

.overview-grid {
  display: grid;
  grid-template-columns: 1.45fr 1fr;
  gap: 20px;
}

/* 边界列表 (Boundary Lines) */
.boundary {
  padding: 8px 26px 16px;
}

.boundary div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 13px;
}

.boundary div:last-child {
  border-bottom: none;
}

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

.boundary b {
  font-weight: 600;
  color: var(--text-primary);
}

.muted-tag {
  color: var(--text-faint) !important;
  font-weight: 400 !important;
}

/* 持仓退出压力进度条 */
.exit-row {
  padding: 20px 26px 24px;
}

.exit-name {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.exit-values {
  display: flex;
  justify-content: space-between;
  margin-bottom: 16px;
}

.exit-values > div {
  font-size: 12px;
  color: var(--text-muted);
}

.exit-values b {
  display: block;
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  margin-top: 4px;
}

.pressure {
  height: 8px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
}

.pressure span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #3b82f6 0%, #10b981 100%);
  border-radius: 4px;
  transition: width var(--transition-normal);
}

.pressure-label {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 8px;
}

/* 告警与提醒行 (Alert Rows) */
.alert-row {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 14px 26px;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 13px;
}

.alert-row:last-child {
  border-bottom: none;
}

.alert-level {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  background: var(--color-amber-soft);
  color: var(--color-amber-text);
  border: 1px solid rgba(245, 158, 11, 0.25);
  white-space: nowrap;
}

.alert-level.critical {
  background: var(--color-rose-soft);
  color: var(--color-rose-text);
  border-color: rgba(239, 68, 68, 0.25);
}

/* 空状态展示 (Empty States) */
.empty {
  padding: 36px 26px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

.empty strong {
  display: block;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}

/* ==========================================================================
   表格体系 (Modern Financial Tables)
   ========================================================================== */
.table-wrap {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

th {
  font-weight: 600;
  color: var(--text-muted);
  font-size: 12.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: rgba(255, 255, 255, 0.02);
  padding: 13px 18px;
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}

td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-primary);
  white-space: nowrap;
  transition: background-color var(--transition-fast);
}

tbody tr:hover td {
  background-color: rgba(255, 255, 255, 0.03);
}

th:first-child, td:first-child {
  padding-left: 26px;
}

th:last-child, td:last-child {
  padding-right: 26px;
}

tr:last-child td {
  border-bottom: none;
}

td.numeric {
  font-family: var(--font-mono);
  font-size: 13.5px;
}

td small {
  display: block;
  color: var(--text-muted);
  font-size: 12px;
  margin-top: 3px;
  font-family: var(--font-sans);
}

/* 代币徽标按钮 */
.token-button, .coin-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-align: left;
}

.coin-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.2) 0%, rgba(16, 185, 129, 0.2) 100%);
  border: 1px solid var(--border-medium);
  font-weight: 700;
  font-size: 13px;
  color: #93c5fd;
  flex-shrink: 0;
}

.token-button:hover span {
  color: #60a5fa;
}

/* 搜索框 */
.search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 12px;
  color: var(--text-muted);
  pointer-events: none;
}

.search-wrap input {
  background: var(--bg-base);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  padding: 8px 12px 8px 34px;
  color: var(--text-primary);
  font-size: 12.5px;
  width: 260px;
  transition: all var(--transition-fast);
}

.search-wrap input:focus {
  border-color: var(--color-brand);
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.2);
  width: 300px;
}

/* 账户事实信息网格 (Account Facts) */
.account-inline {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  padding: 18px 26px 22px;
}

.account-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  padding: 16px 26px;
}

.wallet-address { grid-column: 1 / -1; min-width: 0; }
.wallet-address dd { overflow-wrap: anywhere; font-size: 13px; }
.wallet-asset-label { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.wallet-asset-label small { overflow-wrap: anywhere; white-space: normal; color: var(--text-muted); font-size: 10px; }

.fact dt {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.fact dd {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.account-message {
  margin: 12px 26px 18px;
  font-size: 12.5px;
  color: var(--text-secondary);
}

.account-message.error {
  background: var(--color-rose-soft);
  color: var(--color-rose-text);
  border: 1px solid rgba(239, 68, 68, 0.25);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
}

/* 持仓卡片 (Position Cards) */
.position-card {
  padding: 26px;
  margin-bottom: 20px;
}

.position-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.position-facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.position-note {
  background: rgba(255, 255, 255, 0.02);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 20px;
  border: 1px solid var(--border-subtle);
}

/* 系统信息 */
.system-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.system-grid .panel {
  padding: 26px 28px;
  background: linear-gradient(180deg, #17181e 0%, #121316 100%) !important;
  border: 1px solid rgba(255, 255, 255, 0.09) !important;
  box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.45), inset 0 1px 0 0 rgba(255, 255, 255, 0.05);
}

.system-grid .panel h2 {
  font-size: 18.5px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 16px;
}

.system-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 14px;
}

.system-line span {
  color: #cbd5e1;
  font-size: 14px;
  font-weight: 400;
}

.system-line b {
  font-family: var(--font-mono);
  color: #f8fafc;
  font-size: 14px;
  font-weight: 600;
}

.blocker {
  font-size: 13.5px;
  margin: 12px 0;
  color: var(--color-amber-text);
  padding: 10px 14px;
  background: rgba(245, 158, 11, 0.14);
  border-left: 3px solid var(--color-amber);
  border-radius: 0 6px 6px 0;
  line-height: 1.5;
}

/* 底部栏 (Footer) */
.app-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 30px;
  margin-top: 40px;
  border-top: 1px solid var(--border-subtle);
  font-size: 11.5px;
  color: var(--text-muted);
}

.footer-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.footer-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-emerald);
}

.footer-right {
  display: flex;
  gap: 12px;
}

.security-tag {
  color: #60a5fa;
  font-family: var(--font-mono);
}

/* 弹窗 (Dialog) */
dialog#token-dialog {
  width: min(840px, calc(100vw - 40px));
  max-height: 90vh;
  margin: auto;
  border: 1px solid var(--border-medium);
  background: var(--bg-surface);
  color: var(--text-primary);
  border-radius: var(--radius-xl);
  padding: 0;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.8);
  overflow: hidden;
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
}

.dialog-card {
  padding: 28px;
  overflow-y: auto;
  max-height: 90vh;
}

.dialog-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 20px;
}

.dialog-head h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
}

.address-line {
  font-family: var(--font-mono);
  font-size: 12px;
  background: var(--bg-base);
  border: 1px solid var(--border-subtle);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  color: #93c5fd;
  word-break: break-all;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 20px 0;
}

.detail-box {
  background: var(--bg-base);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 18px;
}

.detail-box h3 {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 14px;
}

.detail-box p {
  font-size: 12px;
  color: var(--text-muted);
  margin: 8px 0;
}

.pool-item {
  background: var(--bg-base);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-top: 12px;
}

.pool-item b {
  font-size: 13px;
  color: var(--text-primary);
}

.pool-item p {
  font-size: 11.5px;
  color: var(--text-muted);
  margin: 6px 0;
  word-break: break-all;
}

/* Toast 提示 */
.toast {
  position: fixed;
  bottom: 28px;
  right: 28px;
  background: #1e293b;
  color: #f8fafc;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: var(--shadow-lg);
  z-index: 9999;
  animation: slide-up 200ms ease;
}

@keyframes slide-up {
  from { transform: translateY(12px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* 盈亏色彩体系：红色是加，绿色是减 (红涨绿跌，符合中国金融习惯) */
.positive {
  color: var(--color-rose-text) !important;
}

.negative {
  color: var(--color-emerald-text) !important;
}

html.light .positive {
  color: #dc2626 !important;
}

html.light .negative {
  color: #059669 !important;
}

/* 骨架屏 */
.skeleton-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.skeleton-card {
  height: 160px;
  border-radius: var(--radius-lg);
  background: linear-gradient(90deg, var(--bg-surface) 25%, var(--bg-surface-elevated) 50%, var(--bg-surface) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.8s infinite;
  border: 1px solid var(--border-subtle);
}

@keyframes skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

@keyframes pulse-glow {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.9); }
}

/* ==========================================================================
   响应式断点适配 (Responsive Breakpoints)
   ========================================================================== */
@media (min-width: 801px) and (max-width: 1100px) {
  .wallet-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .wallet-metrics > .metric:last-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 1100px) {
  .sidebar {
    width: 200px;
    padding: 20px 12px 16px;
  }
  main#workspace {
    margin-left: 200px;
    width: calc(100% - 200px);
    padding: 0 24px 32px;
  }
  .overview-grid {
    grid-template-columns: 1fr;
  }
  .metric strong {
    font-size: 30px;
  }
  .position-facts {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 800px) {
  .topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 0;
  }
  .top-actions {
    width: 100%;
    flex-wrap: wrap;
    gap: 8px;
  }
  .top-actions .button, .top-actions .icon-button {
    flex-shrink: 0;
    white-space: nowrap;
    min-height: 44px;
  }
  .sidebar {
    position: static;
    width: 100%;
    padding: 14px 16px;
    border-right: none;
    border-bottom: 1px solid var(--border-subtle);
    box-shadow: none;
  }
  .nav-section-title, .sidebar-note, .sidebar-bottom, .brand-tag {
    display: none;
  }
  .nav-menu {
    flex-direction: row;
    overflow-x: auto;
    padding: 10px 0 4px;
    gap: 6px;
  }
  .nav-item {
    flex: 0 0 auto;
    min-height: 44px;
    width: auto;
    white-space: nowrap;
    padding: 8px 12px;
    font-size: 13px;
  }
  .nav-item.selected::before {
    top: auto;
    bottom: 0;
    left: 8px;
    right: 8px;
    width: auto;
    height: 3px;
    border-radius: 4px 4px 0 0;
  }
  main#workspace {
    margin-left: 0;
    width: 100%;
    padding: 0 16px 28px;
  }
  .heading {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .metrics-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .system-grid {
    grid-template-columns: 1fr;
  }
  .account-inline, .account-facts {
    grid-template-columns: 1fr;
  }
  .app-footer {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }
}

@media (max-width: 480px) {
  .top-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 44px;
    grid-template-areas: "mode sync sync" "refresh disconnect theme";
  }
  #mode-badge { grid-area: mode; justify-self: start; }
  .sync-indicator { grid-area: sync; justify-self: end; }
  #refresh { grid-area: refresh; }
  #disconnect { grid-area: disconnect; }
  #theme { grid-area: theme; width: 44px; height: 44px; }
}

/* ==========================================================================
   决策证据记录 (Decision Records)
   ========================================================================== */
.record {
  padding: 18px 26px;
  border-top: 1px solid var(--border-subtle);
  transition: background-color var(--transition-fast);
}

.record:first-child {
  border-top: none;
}

.record:hover {
  background-color: rgba(255, 255, 255, 0.02);
}

.record-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 8px;
}

.record-head b {
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.03em;
}

.record p {
  font-size: 12.5px;
  color: var(--text-secondary);
  margin: 5px 0;
  line-height: 1.5;
}

.record p:first-of-type {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-muted);
}

.record p:last-child {
  font-size: 11px;
  color: var(--text-faint);
}

/* 兼容与工具样式 */
.text-button {
  background: none;
  border: 0;
  color: var(--color-brand);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  cursor: pointer;
}

.text-button:hover {
  color: #93c5fd;
  text-decoration: underline;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.account-overview .panel-heading {
  padding-bottom: 14px;
}

.account-table td {
  white-space: normal;
  overflow-wrap: anywhere;
}

.account-table td.numeric {
  min-width: 100px;
}

@media (max-width: 600px) {
  .token-table thead, .account-table thead {
    display: none;
  }
  .token-table table, .token-table tbody, .token-table tr, .token-table td,
  .account-table table, .account-table tbody, .account-table tr, .account-table td {
    display: block;
    width: 100%;
  }
  .token-table tr, .account-table tr {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-subtle);
  }
  .token-table td, .account-table td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 0 !important;
    border: none;
    white-space: normal;
  }
  .token-table td:not(:first-child)::before, .account-table td:not(:first-child)::before {
    content: attr(data-label);
    font-size: 11px;
    color: var(--text-muted);
    padding-right: 12px;
  }
}

/* ==========================================================================
   亮面 (浅色模式) 专业背景板与卡片重构
   消除沉闷黑斑，保持纯净通透与高对比度，左侧侧边栏保持高贵黑底
   ========================================================================== */
html.light .card-hero {
  background: linear-gradient(180deg, rgba(59, 130, 246, 0.04) 0%, #ffffff 100%) !important;
  border: 1px solid #cbd5e1 !important;
  box-shadow: 0 4px 16px -2px rgba(15, 23, 42, 0.06) !important;
}

html.light .panel {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04) !important;
}

html.light .metric {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.03) !important;
}

html.light .metric-currency {
  background: #f1f5f9 !important;
  color: #64748b !important;
}

html.light .panel-heading {
  border-bottom: 1px solid #f1f5f9 !important;
}

html.light .boundary div {
  border-bottom: 1px solid #f1f5f9 !important;
}

html.light .sub-label {
  color: #2563eb !important;
}

html.light .action-link-btn {
  background: rgba(59, 130, 246, 0.08) !important;
  border-color: rgba(59, 130, 246, 0.2) !important;
  color: #2563eb !important;
}

html.light .action-link-btn:hover {
  background: rgba(59, 130, 246, 0.14) !important;
  color: #1d4ed8 !important;
}

html.light .connection-pill,
html.light .sync-indicator {
  background: #ffffff !important;
  border-color: #e2e8f0 !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04) !important;
}

html.light .button.secondary,
html.light .icon-button {
  background: #ffffff !important;
  border-color: #cbd5e1 !important;
  color: #0f172a !important;
}

html.light .button.secondary:hover,
html.light .icon-button:hover {
  background: #f8fafc !important;
  border-color: #94a3b8 !important;
}

html.light .search-wrap input {
  background: #f8fafc !important;
  border-color: #cbd5e1 !important;
  color: #0f172a !important;
}

html.light .search-wrap input:focus {
  background: #ffffff !important;
  border-color: #3b82f6 !important;
}

html.light th {
  background: #f8fafc !important;
  border-bottom: 1px solid #e2e8f0 !important;
  color: #64748b !important;
}

html.light td {
  border-bottom: 1px solid #f1f5f9 !important;
  color: #0f172a !important;
}

html.light tbody tr:hover td {
  background-color: #f8fafc !important;
}

html.light .record {
  border-top: 1px solid #f1f5f9 !important;
}

html.light .record:hover {
  background-color: #f8fafc !important;
}

html.light .position-card {
  background: #ffffff !important;
  border-color: #e2e8f0 !important;
}

html.light .position-top {
  border-bottom-color: #f1f5f9 !important;
}

html.light .position-note {
  background: #f8fafc !important;
  border-color: #e2e8f0 !important;
  color: #475569 !important;
}

html.light .pressure {
  background: #f1f5f9 !important;
  border-color: #e2e8f0 !important;
}

html.light .auth-panel {
  background: #ffffff !important;
  border-color: #e2e8f0 !important;
}

html.light .auth-panel input {
  background: #f8fafc !important;
  border-color: #cbd5e1 !important;
}

html.light .duration-select {
  background: #f8fafc !important;
  border-color: #cbd5e1 !important;
  color: #0f172a !important;
}

html.light dialog#token-dialog {
  background: #ffffff !important;
  border-color: #e2e8f0 !important;
  color: #0f172a !important;
}

html.light .detail-box,
html.light .pool-item,
html.light .address-line {
  background: #f8fafc !important;
  border-color: #e2e8f0 !important;
}

html.light .address-line {
  color: #1e40af !important;
}

html.light .system-grid .panel {
  background: #ffffff !important;
  border-color: #e2e8f0 !important;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04) !important;
}

html.light .system-grid .panel h2 {
  color: #0f172a !important;
}

html.light .system-line {
  border-bottom-color: #f1f5f9 !important;
}

html.light .system-line span {
  color: #475569 !important;
}

html.light .system-line b {
  color: #0f172a !important;
}

html.light .blocker {
  color: #b45309 !important;
  background: #fffbeb !important;
  border-left: 3px solid #d97706 !important;
}

/* 亮面下的提示标识与标签高清晰度 */
html.light .muted-tag {
  color: #64748b !important;
  font-weight: 500 !important;
}

html.light .eyebrow-badge {
  background: #eff6ff !important;
  color: #1d4ed8 !important;
  border: 1px solid #bfdbfe !important;
  font-weight: 600 !important;
}

html.light .coin-icon {
  background: #eff6ff !important;
  color: #2563eb !important;
  border: 1px solid #bfdbfe !important;
  font-weight: 600 !important;
}

html.light .badge {
  background: #eff6ff !important;
  color: #1d4ed8 !important;
  border-color: #bfdbfe !important;
}

html.light .badge.green {
  background: #ecfdf5 !important;
  color: #047857 !important;
  border-color: #a7f3d0 !important;
}

html.light .badge.amber,
html.light .amber-badge {
  background: #fffbeb !important;
  color: #b45309 !important;
  border-color: #fde68a !important;
}

html.light .badge.red {
  background: #fef2f2 !important;
  color: #b91c1c !important;
  border-color: #fecaca !important;
}

html.light .count-badge {
  background: #f1f5f9 !important;
  color: #475569 !important;
  border-color: #cbd5e1 !important;
}

html.light .breadcrumb-prefix {
  color: #475569 !important;
}

html.light .breadcrumb-slash {
  color: #94a3b8 !important;
}

html.light .security-tag {
  background: #eff6ff !important;
  color: #1d4ed8 !important;
  border-color: #bfdbfe !important;
}

html.light .version-tag {
  color: #64748b !important;
}

/* 亮面模式下的 DEX 扫描与决策面板高对比度支持 */
html.light .scanner-intro {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 4px 16px -2px rgba(15, 23, 42, 0.06) !important;
}

html.light .scanner-intro .eyebrow {
  color: #2563eb !important;
}

html.light .scanner-intro h2 {
  color: #0f172a !important;
}

html.light .scanner-intro p {
  color: #475569 !important;
}

html.light .scanner-metric {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04) !important;
}

html.light .scanner-metric span {
  color: #475569 !important;
}

html.light .scanner-metric strong {
  color: #0f172a !important;
}

html.light .scanner-provider {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04) !important;
}

html.light .scanner-link {
  color: #0f172a !important;
}

html.light .scanner-provider p {
  color: #334155 !important;
}

html.light .scanner-provider small {
  color: #64748b !important;
}

html.light #scanner > .panel {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04) !important;
}

html.light #scanner .panel-heading {
  border-bottom: 1px solid #f1f5f9 !important;
}

html.light #scanner .panel-heading h2 {
  color: #0f172a !important;
}

html.light #scanner-sync {
  color: #64748b !important;
}

html.light .scanner-filters label {
  color: #475569 !important;
}

html.light .scanner-filters input,
html.light .scanner-filters select {
  background: #f8fafc !important;
  border-color: #cbd5e1 !important;
  color: #0f172a !important;
}

html.light .scanner-note {
  color: #64748b !important;
}

html.light .scanner-table th {
  background: #f8fafc !important;
  color: #475569 !important;
  border-bottom: 1px solid #e2e8f0 !important;
}

html.light .scanner-table td {
  color: #0f172a !important;
  border-bottom: 1px solid #f1f5f9 !important;
}

html.light .scanner-table td > span,
[data-theme="light"] .scanner-table td > span,
html.light .scanner-table td > div > span,
[data-theme="light"] .scanner-table td > div > span {
  color: #0f172a !important;
}

html.light .scanner-table td small,
[data-theme="light"] .scanner-table td small,
html.light .scanner-table td > div > small,
[data-theme="light"] .scanner-table td > div > small {
  color: #64748b !important;
}

html.light .scanner-table tbody tr:hover td,
[data-theme="light"] .scanner-table tbody tr:hover td {
  background-color: #f8fafc !important;
}

html.light .scanner-token strong {
  color: #0f172a !important;
}

html.light .scanner-address {
  color: #2563eb !important;
}

html.light .scanner-risk.flagged,
[data-theme="light"] .scanner-risk.flagged {
  color: #dc2626 !important;
  background: #fef2f2 !important;
  border: 1px solid #fecaca;
}

html.light .scanner-risk.unknown,
[data-theme="light"] .scanner-risk.unknown {
  color: #d97706 !important;
  background: #fffbeb !important;
  border: 1px solid #fde68a;
}

html.light .scanner-risk.no_reported_flags,
[data-theme="light"] .scanner-risk.no_reported_flags {
  color: #475569 !important;
  background: #f1f5f9 !important;
  border: 1px solid #e2e8f0;
}

html.light .decision-verdict.block,
[data-theme="light"] .decision-verdict.block,
html.light .decision-check.block,
[data-theme="light"] .decision-check.block {
  color: #dc2626 !important;
}

html.light .decision-verdict.wait,
[data-theme="light"] .decision-verdict.wait,
html.light .decision-check.wait,
[data-theme="light"] .decision-check.wait {
  color: #d97706 !important;
}

html.light .decision-verdict.review,
[data-theme="light"] .decision-verdict.review {
  color: #2563eb !important;
}

html.light .decision-verdict.observe,
[data-theme="light"] .decision-verdict.observe {
  color: #475569 !important;
}

html.light .scanner-decision-cell small,
[data-theme="light"] .scanner-decision-cell small {
  color: #64748b !important;
}

html.light .scanner-source-state {
  color: #475569 !important;
  background: #f1f5f9 !important;
}

html.light .scanner-source-state.ok {
  color: #047857 !important;
  background: #ecfdf5 !important;
}

html.light .scanner-source-state.error,
html.light .scanner-source-state.degraded,
html.light .scanner-source-state.stale,
html.light .scanner-warning {
  color: #b45309 !important;
  background: #fffbeb !important;
}

#scanner-alerts {
  margin: 0 28px 14px !important;
  box-sizing: border-box;
}
#scanner-alerts:empty {
  display: none !important;
  margin: 0 !important;
}
#scanner-alerts .scanner-warning {
  margin: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  line-height: 1.6 !important;
  color: #fbbf24 !important;
  display: block !important;
  box-sizing: border-box !important;
}
#scanner-alerts .scanner-warning::before {
  display: none !important;
}

html.light #scanner-alerts .scanner-warning,
[data-theme="light"] #scanner-alerts .scanner-warning {
  color: #b45309 !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

html.light .scanner-dialog {
  background: #ffffff !important;
  border-color: #e2e8f0 !important;
  color: #0f172a !important;
}

html.light .scanner-dialog h3 {
  color: #0f172a !important;
}

html.light .scanner-dialog dt {
  color: #64748b !important;
}

html.light .scanner-dialog dd {
  color: #0f172a !important;
}

html.light .scanner-dialog-foot {
  border-top: 1px solid #e2e8f0 !important;
}

html.light .decision-row {
  background: #ffffff !important;
  border-color: #e2e8f0 !important;
}

html.light .decision-meta {
  color: #64748b !important;
}

html.light .decision-reason {
  color: #334155 !important;
}

/* ==========================================================================
   8. 实时行情纯看板模式 (单页自适应 · 零页面滚动 · 纯看盘大屏)
   ========================================================================== */

body.view-terminal:not(.is-unauthorized):not(:has(#auth-form:not([hidden]))) {
  overflow: hidden !important;
  height: 100vh !important;
  max-height: 100vh !important;
}

body.view-terminal:not(.is-unauthorized):not(:has(#auth-form:not([hidden]))) #workspace {
  height: 100vh !important;
  max-height: 100vh !important;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
  padding: 0 !important;
}

/* 隐藏外层多余的标题栏和底部版权栏，让位于专业看板全屏展示（仅限通过授权后生效） */
body.view-terminal:not(.is-unauthorized):not(:has(#auth-form:not([hidden]))) .heading,
body.view-terminal:not(.is-unauthorized):not(:has(#auth-form:not([hidden]))) .app-footer,
body.view-terminal:not(.is-unauthorized):not(:has(#auth-form:not([hidden]))) #demo-banner,
body.view-terminal:not(.is-unauthorized):not(:has(#auth-form:not([hidden]))) #error-banner {
  display: none !important;
}

body.view-terminal:not(.is-unauthorized):not(:has(#auth-form:not([hidden]))) .topbar {
  flex-shrink: 0 !important;
  margin-bottom: 0 !important;
  padding: 8px 16px !important;
  border-bottom: 1px solid #1c1f26 !important;
  height: 48px !important;
  background: #0b0d11 !important;
}

body.view-terminal:not(.is-unauthorized):not(:has(#auth-form:not([hidden]))) #content {
  flex: 1 !important;
  height: calc(100vh - 48px) !important;
  min-height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
}

body.view-terminal #content[hidden],
body.view-terminal.is-unauthorized #content,
body.view-terminal:has(#auth-form:not([hidden])) #content,
body.view-terminal #terminal[hidden],
body.view-terminal.is-unauthorized #terminal,
body.view-terminal:has(#auth-form:not([hidden])) #terminal {
  display: none !important;
}

#terminal {
  flex: 1 !important;
  height: 100% !important;
  max-height: 100% !important;
  min-height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
}

#terminal[hidden] {
  display: none !important;
}

.terminal-shell {
  display: flex !important;
  flex-direction: column !important;
  height: 100% !important;
  min-height: 0 !important;
  background: #08090b !important;
  color: #eaecef !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  border-radius: 0 !important;
  border: none !important;
  overflow: hidden !important;
}

/* 顶部报价条：高度紧凑 */
.terminal-top-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  background: #0f1217;
  border-bottom: 1px solid #1c1f26;
  flex-shrink: 0;
  gap: 16px;
  height: 52px;
  box-sizing: border-box;
}

.terminal-token-meta {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: nowrap;
}

.terminal-token-badge {
  display: flex;
  align-items: center;
  gap: 10px;
}

.token-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #627eea, #3b5998);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  color: #fff;
  box-shadow: 0 0 10px rgba(98, 126, 234, 0.3);
}

.token-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.token-symbol {
  font-size: 16px;
  font-weight: 800;
  color: #ffffff;
  margin: 0;
  letter-spacing: -0.02em;
}

.token-fullname {
  font-size: 11px;
  color: #848e9c;
}

.online-indicator {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #0ecb81;
  box-shadow: 0 0 8px #0ecb81;
  animation: pulse-online 2s infinite;
}

@keyframes pulse-online {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

.token-contract-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  color: #5e6673;
}

.contract-age {
  color: #848e9c;
}

.contract-addr {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, monospace;
  color: #848e9c;
  cursor: pointer;
}

.copy-tiny-btn, .external-tiny-link {
  background: transparent;
  border: none;
  color: #848e9c;
  cursor: pointer;
  padding: 2px;
  display: inline-flex;
  align-items: center;
  border-radius: 3px;
  transition: all 0.15s;
}

.copy-tiny-btn:hover, .external-tiny-link:hover {
  color: #eaecef;
  background: rgba(255, 255, 255, 0.08);
}

/* 核心大字价格与涨跌 */
.terminal-price-block {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.price-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.term-big-price {
  font-size: 20px;
  font-weight: 800;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, monospace;
  color: #0ecb81;
  letter-spacing: -0.03em;
  transition: color 0.3s;
}

.term-big-price.up {
  color: #0ecb81 !important;
}

.term-chg-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
}

.term-chg-pill.positive {
  background: rgba(14, 203, 129, 0.15);
  color: #0ecb81;
}

.term-chg-pill.negative {
  background: rgba(246, 70, 93, 0.15);
  color: #f6465d;
}

.price-sub {
  display: flex;
  gap: 10px;
  font-size: 10px;
  color: #848e9c;
}

.price-sub b {
  color: #b7bdc6;
  font-weight: 500;
}

/* 关键指标四联 */
.terminal-stats-grid {
  display: flex;
  align-items: center;
  gap: 16px;
  border-left: 1px solid #1c1f26;
  padding-left: 16px;
}

.stat-item {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.stat-label {
  font-size: 10px;
  color: #5e6673;
}

.stat-value {
  font-size: 12px;
  font-weight: 600;
  color: #eaecef;
}

.stat-value.highlight {
  color: #f0b90b;
}

.stat-value.safe {
  color: #0ecb81;
}

/* 数据源药丸状态 */
.terminal-top-actions {
  display: flex;
  align-items: center;
}

.feed-status-pill {
  display: flex;
  align-items: center;
  gap: 5px;
  background: rgba(14, 203, 129, 0.08);
  border: 1px solid rgba(14, 203, 129, 0.25);
  padding: 3px 8px;
  border-radius: 20px;
  font-size: 10px;
  color: #0ecb81;
  font-weight: 600;
}

.pulse-green {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #0ecb81;
  animation: pulse-dot 1.5s infinite;
}

@keyframes pulse-dot {
  0% { opacity: 0.4; }
  50% { opacity: 1; }
  100% { opacity: 0.4; }
}

/* 核心三栏布局：完全充满剩余垂直高度 */
.terminal-main-layout {
  display: grid;
  grid-template-columns: 280px 1fr 300px;
  flex: 1 !important;
  min-height: 0 !important;
  height: 100% !important;
  overflow: hidden !important;
  background: #08090b;
}

/* 左栏：市场列表 */
.terminal-col-left {
  background: #0c0e12;
  border-right: 1px solid #1c1f26;
  display: flex;
  flex-direction: column;
  overflow: hidden !important;
  height: 100% !important;
  min-height: 0 !important;
}

.market-box-header {
  padding: 8px 10px;
  border-bottom: 1px solid #1c1f26;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
}

.market-search-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #14171d;
  border: 1px solid #232730;
  border-radius: 6px;
  padding: 5px 8px;
  color: #848e9c;
}

.market-search-wrap input {
  background: transparent;
  border: none;
  outline: none;
  color: #eaecef;
  font-size: 11px;
  width: 100%;
}

.market-search-wrap input::placeholder {
  color: #5e6673;
}

.chain-tab-bar {
  display: flex;
  gap: 4px;
  overflow-x: auto;
}

.chain-tab {
  background: #14171d;
  border: 1px solid transparent;
  color: #848e9c;
  font-size: 10px;
  padding: 3px 7px;
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}

.chain-tab:hover {
  color: #eaecef;
}

.chain-tab.active {
  background: #1e2329;
  border-color: #2b313a;
  color: #f0b90b;
  font-weight: 600;
}

.market-sort-header {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: #5e6673;
  padding: 2px 4px 0 4px;
  cursor: pointer;
}

.market-pair-list {
  flex: 1 !important;
  min-height: 0 !important;
  overflow-y: auto !important;
  padding: 4px;
}

.market-pair-list::-webkit-scrollbar {
  width: 4px;
}

.market-pair-list::-webkit-scrollbar-thumb {
  background: #1f232b;
  border-radius: 2px;
}

.pair-card-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s;
  border: 1px solid transparent;
  margin-bottom: 2px;
}

.pair-card-item:hover {
  background: #14171d;
}

.pair-card-item.selected {
  background: #181d25;
  border-color: #28303e;
}

.pair-left {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.pair-symbol-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.pair-symbol {
  font-size: 12px;
  font-weight: 700;
  color: #ffffff;
}

.pair-chain-badge {
  font-size: 9px;
  padding: 1px 4px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.08);
  color: #848e9c;
}

.pair-chain-badge.solana {
  background: rgba(153, 69, 255, 0.15);
  color: #a855f7;
}

.pair-chain-badge.ethereum {
  background: rgba(98, 126, 234, 0.15);
  color: #60a5fa;
}

.pair-sub-meta {
  font-size: 10px;
  color: #5e6673;
  font-family: ui-monospace, SFMono-Regular, monospace;
}

.pair-fav-btn {
  background: transparent;
  border: none;
  color: #4b5260;
  font-size: 13px;
  cursor: pointer;
  padding: 0 3px;
  line-height: 1;
  transition: all 0.15s;
}

.pair-fav-btn:hover {
  color: #f0b90b;
  transform: scale(1.15);
}

.pair-fav-btn.active {
  color: #f0b90b;
  text-shadow: 0 0 6px rgba(240, 185, 11, 0.7);
}

.pair-cand-badge {
  font-size: 9px;
  padding: 1px 4px;
  border-radius: 3px;
  background: rgba(14, 203, 129, 0.15);
  color: #0ecb81;
  border: 1px solid rgba(14, 203, 129, 0.3);
}

.pair-cand-badge.warning {
  background: rgba(240, 185, 11, 0.15);
  color: #f0b90b;
  border-color: rgba(240, 185, 11, 0.3);
}

.pair-hot-badge {
  font-size: 9px;
  padding: 1px 4px;
  border-radius: 3px;
  background: rgba(246, 70, 93, 0.18);
  color: #f6465d;
  border: 1px solid rgba(246, 70, 93, 0.35);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.pair-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
}

.pair-price {
  font-size: 12px;
  font-weight: 700;
  font-family: ui-monospace, SFMono-Regular, monospace;
  color: #eaecef;
}

.pair-chg {
  font-size: 10px;
  font-weight: 600;
  font-family: ui-monospace, SFMono-Regular, monospace;
}

.pair-chg.positive {
  color: #0ecb81;
}

.pair-chg.negative {
  color: #f6465d;
}

/* 中栏：全高度专业 K 线与成交量大图看板 */
.terminal-col-center {
  background: #08090b;
  display: flex;
  flex-direction: column;
  overflow: hidden !important;
  border-right: 1px solid #1c1f26;
  height: 100% !important;
  min-height: 0 !important;
}

.chart-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 12px;
  background: #0c0e12;
  border-bottom: 1px solid #1c1f26;
  flex-shrink: 0;
  gap: 10px;
  height: 38px;
  box-sizing: border-box;
}

.chart-tab-group {
  display: flex;
  gap: 4px;
}

.chart-mode-tab {
  background: transparent;
  border: none;
  color: #848e9c;
  font-size: 11px;
  padding: 3px 6px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.15s;
}

.chart-mode-tab.active {
  color: #eaecef;
  font-weight: 700;
  border-bottom-color: #f0b90b;
}

.chart-period-group {
  display: flex;
  gap: 2px;
}

.period-btn {
  background: transparent;
  border: none;
  color: #848e9c;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s;
}

.period-btn:hover {
  color: #eaecef;
  background: rgba(255, 255, 255, 0.05);
}

.period-btn.active {
  background: #1e2329;
  color: #f0b90b;
  font-weight: 700;
}

.chart-tools-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.tool-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  background: #14171d;
  border: 1px solid #232730;
  color: #848e9c;
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s;
}

.tool-btn:hover {
  color: #eaecef;
  border-color: #363c48;
}

.tool-btn.active-tool {
  background: #181d25;
  color: #eaecef;
}

.tool-btn.annot-active {
  background: rgba(246, 70, 93, 0.18) !important;
  color: #ff6578 !important;
  border-color: rgba(246, 70, 93, 0.55) !important;
  box-shadow: 0 0 8px rgba(246, 70, 93, 0.25);
}

/* 缩放控制器样式 */
.chart-zoom-group {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: rgba(20, 23, 29, 0.7);
  padding: 1px 4px;
  border-radius: 4px;
  border: 1px solid #1f242d;
}

.zoom-btn {
  padding: 2px 6px;
  font-size: 10px;
  height: 20px;
  line-height: 1;
}

.zoom-btn:hover {
  background: #1e2430;
  color: #f0b90b;
  border-color: #3b4252;
}

.zoom-btn:active {
  transform: scale(0.96);
}

.zoom-pill {
  font-size: 10px;
  color: #848e9c;
  padding: 0 4px;
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-weight: 600;
  user-select: none;
}

/* K线图表指示条 */
.chart-quote-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 12px;
  background: #08090b;
  font-size: 10px;
  color: #848e9c;
  flex-shrink: 0;
  font-family: ui-monospace, SFMono-Regular, monospace;
  height: 26px;
  box-sizing: border-box;
  overflow: hidden;
}

/* 实时走动动态脉冲徽章 */
.kl-live-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(14, 203, 129, 0.12);
  border: 1px solid rgba(14, 203, 129, 0.3);
  padding: 1px 6px;
  border-radius: 10px;
  font-size: 9px;
  font-weight: 700;
  color: #0ecb81;
  letter-spacing: 0.3px;
  user-select: none;
}

.kl-live-badge.historical {
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.35);
  color: #60a5fa;
}

.pulse-beacon {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: #0ecb81;
  position: relative;
  display: inline-block;
  box-shadow: 0 0 6px rgba(14, 203, 129, 0.8);
  animation: beacon-heartbeat 1.4s ease-in-out infinite;
}

@keyframes beacon-heartbeat {
  0% {
    transform: scale(0.85);
    opacity: 0.6;
    box-shadow: 0 0 2px rgba(14, 203, 129, 0.4);
  }
  50% {
    transform: scale(1.25);
    opacity: 1;
    box-shadow: 0 0 8px rgba(14, 203, 129, 0.95);
  }
  100% {
    transform: scale(0.85);
    opacity: 0.6;
    box-shadow: 0 0 2px rgba(14, 203, 129, 0.4);
  }
}

.k-countdown-wrap {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #12141a;
  padding: 1px 6px;
  border-radius: 3px;
  border: 1px solid #1c2029;
  font-size: 9px;
}

.k-countdown-wrap .cd-label {
  color: #5e6673;
}

.k-countdown-wrap .k-countdown {
  color: #f0b90b;
  font-weight: 600;
}

.chart-quote-banner .k-item b.positive {
  color: #0ecb81;
}

.chart-quote-banner .k-item b.negative {
  color: #f6465d;
}

/* 画布主视窗：完全占满中间垂直空间 */
.chart-stage {
  flex: 1 !important;
  min-height: 0 !important;
  height: 100% !important;
  position: relative;
  background: #08090b;
  overflow: hidden !important;
}

#kline-canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
}

.chart-watermark {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 54px;
  font-weight: 900;
  color: rgba(255, 255, 255, 0.025);
  pointer-events: none;
  user-select: none;
  letter-spacing: 0.15em;
}

.chart-loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(8, 9, 11, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: #848e9c;
  gap: 8px;
  z-index: 10;
}

.spinner-dot {
  width: 12px;
  height: 12px;
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-top-color: #f0b90b;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* 行情来源标签与"无真实数据"空状态：不用编造数据填充时，明确告诉用户缺什么 */
.term-source-tag {
  display: inline-flex;
  align-items: center;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(132, 142, 156, 0.35);
  font-size: 11px;
  line-height: 16px;
  color: #848e9c;
  white-space: nowrap;
}

.chart-empty-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 24px;
  text-align: center;
  font-size: 13px;
  color: #848e9c;
  background: rgba(8, 9, 11, 0.55);
  z-index: 9;
  pointer-events: none;
}

.trade-empty-hint {
  padding: 16px 8px;
  text-align: center;
  font-size: 12px;
  color: #848e9c;
}

html.light .chart-empty-overlay,
[data-theme="light"] .chart-empty-overlay {
  background: rgba(255, 255, 255, 0.7);
  color: #5e6673;
}

/* 图片红框悬浮操作条 */
.chart-annotation-bar {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(14, 17, 23, 0.94);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(246, 70, 93, 0.45);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.65), 0 0 12px rgba(246, 70, 93, 0.2);
  border-radius: 6px;
  padding: 5px 12px;
  z-index: 25;
  animation: annot-bar-pop 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

@keyframes annot-bar-pop {
  from {
    opacity: 0;
    transform: translate(-50%, -10px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

.annot-badge {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  color: #f6465d;
}

.annot-hint {
  font-size: 11px;
  color: #848e9c;
  border-left: 1px solid #232832;
  padding-left: 8px;
}

.annot-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.annot-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  background: #181d26;
  border: 1px solid #28303d;
  color: #eaecef;
  font-size: 11px;
  font-weight: 500;
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s;
}

.annot-btn:hover {
  background: #232b38;
  border-color: #3f4b5f;
  color: #ffffff;
}

.annot-btn:active {
  transform: scale(0.96);
}

.annot-btn#btn-annot-copy:hover {
  background: rgba(14, 203, 129, 0.15);
  border-color: rgba(14, 203, 129, 0.5);
  color: #0ecb81;
}

.annot-btn#btn-annot-download:hover {
  background: rgba(56, 136, 255, 0.15);
  border-color: rgba(56, 136, 255, 0.5);
  color: #60a5fa;
}

.annot-btn#btn-annot-clear:hover {
  background: rgba(246, 70, 93, 0.15);
  border-color: rgba(246, 70, 93, 0.5);
  color: #f6465d;
}

.annot-close-btn {
  background: transparent !important;
  border: 1px solid transparent !important;
  color: #848e9c !important;
  padding: 4px 6px !important;
}

.annot-close-btn:hover {
  color: #f6465d !important;
  background: rgba(246, 70, 93, 0.1) !important;
  border-color: rgba(246, 70, 93, 0.3) !important;
}

/* 右栏：交易动态成交流水 */
.terminal-col-right {
  background: #0c0e12;
  display: flex;
  flex-direction: column;
  overflow: hidden !important;
  height: 100% !important;
  min-height: 0 !important;
}

.trades-panel-head {
  padding: 8px 12px;
  border-bottom: 1px solid #1c1f26;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
}

.trades-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.trades-title-row h3 {
  font-size: 12px;
  font-weight: 700;
  color: #ffffff;
  margin: 0;
}

.trades-unit-switch {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  color: #5e6673;
}

.unit-opt {
  cursor: pointer;
}

.unit-opt.active {
  color: #f0b90b;
  font-weight: 700;
}

.trades-col-names {
  display: grid;
  grid-template-columns: 80px 65px 75px 1fr;
  font-size: 10px;
  color: #5e6673;
  padding: 0 4px;
}

.trades-col-names .right {
  text-align: right;
}

.trades-stream-wrap {
  flex: 1 !important;
  min-height: 0 !important;
  overflow-y: auto !important;
  padding: 4px 6px;
}

.trades-stream-wrap::-webkit-scrollbar {
  width: 4px;
}

.trades-stream-wrap::-webkit-scrollbar-thumb {
  background: #1f232b;
  border-radius: 2px;
}

.trade-row-item {
  display: grid;
  grid-template-columns: 80px 65px 75px 1fr;
  align-items: center;
  font-size: 10.5px;
  padding: 3.5px 4px;
  border-radius: 4px;
  font-family: ui-monospace, SFMono-Regular, monospace;
  animation: fadeInTrade 0.3s ease-out;
  transition: background 0.15s;
}

.trade-row-item:hover {
  background: #14171d;
}

@keyframes fadeInTrade {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.trade-val {
  font-weight: 700;
}

.trade-val.buy {
  color: #0ecb81;
}

.trade-val.sell {
  color: #f6465d;
}

.trade-cap {
  color: #848e9c;
}

.trade-addr {
  color: #5e6673;
}

.trade-time {
  text-align: right;
  color: #5e6673;
  font-size: 9.5px;
}

/* 底部跑马灯行情条 */
.terminal-marquee-bar {
  display: flex;
  align-items: center;
  background: #060709;
  border-top: 1px solid #1c1f26;
  padding: 4px 12px;
  font-size: 10.5px;
  overflow: hidden !important;
  flex-shrink: 0;
  gap: 12px;
  height: 28px;
  box-sizing: border-box;
}

.marquee-tag {
  background: rgba(240, 185, 11, 0.15);
  color: #f0b90b;
  font-weight: 700;
  font-size: 9.5px;
  padding: 1px 5px;
  border-radius: 3px;
  white-space: nowrap;
}

.marquee-track {
  display: flex;
  gap: 24px;
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: none;
}

.marquee-track::-webkit-scrollbar {
  display: none;
}

.marquee-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: opacity 0.15s;
}

.marquee-item:hover {
  opacity: 0.8;
}

.marquee-name {
  font-weight: 700;
  color: #eaecef;
}

.marquee-chg.positive {
  color: #0ecb81;
}

.marquee-chg.negative {
  color: #f6465d;
}

.marquee-price {
  font-family: ui-monospace, SFMono-Regular, monospace;
  color: #848e9c;
}

/* 响应式调整 */
@media (max-width: 1200px) {
  .terminal-main-layout {
    grid-template-columns: 240px 1fr 260px;
  }
}

@media (max-width: 900px) {
  .terminal-main-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr auto;
    overflow-y: auto;
  }
  .terminal-col-left, .terminal-col-right {
    max-height: 200px;
  }
}

/* 中间项目指标条 (Project Indicator Bar) */
.terminal-project-indicator-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 3px 12px;
  background: #0f1217;
  border-bottom: 1px solid #1c202a;
  font-size: 11px;
  color: #848e9c;
  flex-shrink: 0;
  height: 28px;
  box-sizing: border-box;
}

.proj-ind-left, .proj-ind-center, .proj-ind-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.proj-badge {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 3px;
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.3);
  font-weight: 600;
}

.proj-badge.holding {
  background: rgba(14, 203, 129, 0.15);
  color: #0ecb81;
  border-color: rgba(14, 203, 129, 0.35);
}

.proj-detail {
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: 10.5px;
  color: #eaecef;
}

.proj-cost-label {
  font-size: 10.5px;
  color: #5e6673;
}

.proj-cost-val {
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-weight: 700;
  color: #f0b90b;
  font-size: 11px;
}

.proj-pnl-pill {
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 3px;
  background: rgba(14, 203, 129, 0.15);
  color: #0ecb81;
}

.proj-pnl-pill.negative {
  background: rgba(246, 70, 93, 0.15);
  color: #f6465d;
}

.proj-action-tag {
  font-size: 10px;
  color: #5e6673;
}

.proj-recent-trade {
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: 10.5px;
  color: #d1d5db;
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 覆盖层主容器 (持币地址 & 我的买卖全屏视图) */
.terminal-view-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #08090b;
  z-index: 15;
  display: flex;
  flex-direction: column;
  padding: 16px 20px;
  box-sizing: border-box;
  overflow: hidden;
}

.stage-overlay-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 14px;
  border-bottom: 1px solid #1c202a;
  padding-bottom: 10px;
  flex-shrink: 0;
}

.stage-overlay-head h3 {
  font-size: 14px;
  font-weight: 700;
  color: #eaecef;
  margin: 0;
}

.stage-overlay-sub {
  font-size: 11px;
  color: #5e6673;
}

.stage-table-wrap {
  flex: 1;
  overflow-y: auto;
  border: 1px solid #1c202a;
  border-radius: 6px;
  background: #0c0e12;
}

.stage-table-wrap::-webkit-scrollbar {
  width: 5px;
}

.stage-table-wrap::-webkit-scrollbar-thumb {
  background: #232732;
  border-radius: 3px;
}

.stage-data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
  text-align: left;
}

.stage-data-table th {
  position: sticky;
  top: 0;
  background: #14171e;
  color: #848e9c;
  padding: 8px 12px;
  font-weight: 600;
  border-bottom: 1px solid #1f242e;
  z-index: 2;
}

.stage-data-table td {
  padding: 8px 12px;
  border-bottom: 1px solid #14171d;
  color: #d1d5db;
  font-family: ui-monospace, SFMono-Regular, monospace;
}

.stage-data-table tr:hover td {
  background: #12151b;
}

.side-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 3px;
  display: inline-block;
}

.side-badge.buy {
  background: rgba(14, 203, 129, 0.15);
  color: #0ecb81;
}

.side-badge.sell {
  background: rgba(246, 70, 93, 0.15);
  color: #f6465d;
}

.table-status-pill {
  font-size: 9.5px;
  padding: 1px 5px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.08);
  color: #848e9c;
}

.table-status-pill.success {
  background: rgba(14, 203, 129, 0.12);
  color: #0ecb81;
}

/* ==========================================================================
   欧意 Web3 钱包资产核对与对账说明卡片 (Reconcile Banner)
   ========================================================================== */
.reconcile-banner {
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.7) 0%, rgba(15, 23, 42, 0.85) 100%);
  border: 1px solid rgba(59, 130, 246, 0.25);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  margin-bottom: 24px;
  box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  animation: slideDownFade 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

html.light .reconcile-banner,
[data-theme="light"] .reconcile-banner {
  background: linear-gradient(180deg, #f0f7ff 0%, #ffffff 100%);
  border: 1px solid #bfdbfe;
  box-shadow: 0 4px 16px -2px rgba(59, 130, 246, 0.08);
}

.reconcile-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

html.light .reconcile-header,
[data-theme="light"] .reconcile-header {
  border-bottom-color: rgba(0, 0, 0, 0.06);
}

.reconcile-title {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: #f1f5f9;
}

html.light .reconcile-title,
[data-theme="light"] .reconcile-title {
  color: #0f172a;
}

.reconcile-badge {
  display: inline-block;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 9999px;
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.reconcile-address-tag {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #94a3b8;
}

.reconcile-address-tag code {
  font-family: var(--font-mono);
  background: rgba(0, 0, 0, 0.25);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #38bdf8;
}

html.light .reconcile-address-tag code {
  background: #e2e8f0;
  color: #0284c7;
  border-color: #cbd5e1;
}

.reconcile-equation {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  margin-bottom: 14px;
}

html.light .reconcile-equation,
[data-theme="light"] .reconcile-equation {
  background: #ffffff;
  border-color: #e2e8f0;
}

@media (max-width: 768px) {
  .reconcile-equation {
    grid-template-columns: 1fr;
    gap: 10px;
    text-align: center;
  }
}

.eq-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.eq-label {
  font-size: 12px;
  color: #94a3b8;
}

html.light .eq-label,
[data-theme="light"] .eq-label {
  color: #64748b;
}

.eq-val {
  font-size: 18px;
  font-weight: 700;
  font-family: var(--font-mono);
  color: #f8fafc;
}

html.light .eq-val,
[data-theme="light"] .eq-val {
  color: #0f172a;
}

.eq-green {
  color: #34d399 !important;
}

.eq-amber {
  color: #fbbf24 !important;
}

.eq-sub {
  font-size: 11.5px;
  color: #64748b;
}

html.light .eq-sub,
[data-theme="light"] .eq-sub {
  color: #94a3b8;
}

.eq-operator {
  font-size: 20px;
  font-weight: 700;
  color: #64748b;
  text-align: center;
}

.reconcile-tip {
  font-size: 12.5px;
  line-height: 1.6;
  color: #94a3b8;
  margin: 0;
}

html.light .reconcile-tip,
[data-theme="light"] .reconcile-tip {
  color: #475569;
}

/* 人工交易预览：独立于执行器和账本写入。 */
.manual-panel { margin-bottom:24px; padding:24px; }
.manual-panel > .panel-heading { margin:-24px -24px 20px; }
.manual-grid { display:grid; grid-template-columns:minmax(240px,1fr) minmax(280px,1.3fr); gap:24px; }
.manual-form,.manual-draft-grid { display:grid; gap:14px; align-content:start; }
.manual-draft-grid > .manual-actions { grid-column:1 / -1; }
.manual-draft-grid { align-items:end; }
.manual-draft-grid { grid-template-columns:repeat(4,minmax(0,1fr)); margin-bottom:16px; }
.manual-panel label,.manual-dialog label { display:grid; gap:7px; color:var(--muted,#a6aab3); font-size:13px; }
.manual-panel input,.manual-panel select { width:100%; min-width:0; padding:12px; border:1px solid var(--border,#35363d); border-radius:10px; background:var(--panel,#191b21); color:var(--text,#e9edf3); font:inherit; }
.manual-actions { display:flex; flex-wrap:wrap; gap:10px; align-items:center; }
.manual-actions button,.manual-panel button { padding:11px 15px; border:1px solid var(--border,#35363d); border-radius:10px; background:transparent; color:inherit; cursor:pointer; }
.manual-panel button.primary { background:#fff; color:#16181e; }
.manual-panel button:disabled,.manual-dialog button:disabled { opacity:.5; cursor:not-allowed; }
.manual-note { color:var(--muted,#a6aab3); font-size:12px; line-height:1.7; overflow-wrap:anywhere; }
.manual-facts { display:grid; gap:9px; font-size:13px; line-height:1.6; margin:14px 0; overflow-wrap:anywhere; }
.manual-fact { display:grid; grid-template-columns:120px minmax(0,1fr); gap:12px; }
.manual-fact span:first-child { color:var(--muted,#a6aab3); }
.manual-blockers { margin:20px 0; padding:14px; border:1px solid #705335; border-radius:12px; }
.manual-blockers li { line-height:1.8; font-size:13px; }
.manual-hash-form { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:12px; align-items:end; }
.manual-stats-cards { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:16px; margin:16px 0; }
.manual-stat { padding:18px; border:1px solid var(--border,#35363d); border-radius:12px; }
.manual-stat strong { display:block; font-size:21px; margin:10px 0; }
.manual-dialog { width:min(650px,calc(100vw - 32px)); padding:26px; border:1px solid #45464c; border-radius:16px; background:var(--panel,#191b21); color:var(--text,#e9edf3); }
.manual-dialog::backdrop { background:rgba(0,0,0,.65); }
.manual-dialog .manual-check { display:flex; align-items:start; gap:9px; margin:20px 0; }
@media(max-width:800px) { .manual-grid,.manual-draft-grid,.manual-hash-form,.manual-stats-cards { grid-template-columns:1fr; } .manual-fact { grid-template-columns:95px minmax(0,1fr); } }
