/* ===== 变量 & 重置 ===== */
:root {
  --bg-primary: #0d1117;
  --bg-secondary: #161b22;
  --bg-tertiary: #1c2333;
  --bg-hover: #21262d;
  --border: #30363d;
  --border-light: #3d444d;
  --text-primary: #e6edf3;
  --text-secondary: #8b949e;
  --text-muted: #6e7681;
  --accent: #388bfd;
  --accent-hover: #58a6ff;
  --green: #3fb950;
  --green-bg: rgba(63, 185, 80, 0.12);
  --red: #f85149;
  --red-bg: rgba(248, 81, 73, 0.12);
  --yellow: #d29922;
  --yellow-bg: rgba(210, 153, 34, 0.12);
  --blue-bg: rgba(56, 139, 253, 0.12);
  --bg-elevated: #1c2128;
  --shadow-color: rgba(0, 0, 0, 0.4);
  --sidebar-width: 210px;
  --topbar-height: 52px;
  --radius: 6px;
  --font-mono: 'Consolas', 'SF Mono', 'Menlo', monospace;
}

[data-theme="light"] {
  --bg-primary: #ffffff;
  --bg-secondary: #f6f8fa;
  --bg-tertiary: #ffffff;
  --bg-hover: #eef1f5;
  --bg-elevated: #ffffff;
  --border: #d0d7de;
  --border-light: #c6cdd5;
  --text-primary: #1f2328;
  --text-secondary: #656d76;
  --text-muted: #8c959f;
  --accent: #0969da;
  --accent-hover: #0550ae;
  --green: #1a7f37;
  --green-bg: rgba(26, 127, 55, 0.12);
  --red: #cf222e;
  --red-bg: rgba(207, 34, 46, 0.12);
  --yellow: #9a6700;
  --yellow-bg: rgba(154, 103, 0, 0.12);
  --blue-bg: rgba(9, 105, 218, 0.12);
  --shadow-color: rgba(31, 35, 40, 0.12);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 13px;
  line-height: 1.5;
  overflow: hidden;
  height: 100vh;
}

/* ===== 顶部栏 ===== */
.topbar {
  height: var(--topbar-height);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 24px;
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
}

.topbar-left { display: flex; align-items: center; gap: 12px; }

.sidebar-toggle-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-primary);
  color: var(--text-primary);
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s, border-color 0.15s;
}
.sidebar-toggle-btn:hover {
  background: var(--bg-hover);
  border-color: var(--border-light);
}
.sidebar-toggle-icon { font-size: 16px; line-height: 1; }

.sidebar-backdrop {
  display: none;
  position: fixed;
  top: var(--topbar-height);
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 89;
}
body.sidebar-open .sidebar-backdrop { display: block; }

.logo { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; }
.logo-icon { color: var(--accent); font-size: 18px; }
.market-status { display: flex; align-items: center; gap: 8px; color: var(--text-secondary); font-size: 12px; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; }
.status-dot.online { background: var(--green); box-shadow: 0 0 6px var(--green); }
.divider { color: var(--border); }

.topbar-center { flex: 1; display: flex; justify-content: center; }
.topbar-status {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-secondary);
  font-size: 13px;
}
.topbar-status-text { color: var(--text-primary); }
.topbar-date { color: var(--text-primary); font-weight: 500; }
.topbar-clock { font-family: var(--font-mono); color: var(--accent); font-weight: 600; }

.filter-label { font-size: 12px; color: var(--text-secondary); margin-right: 4px; }
.filter-sep { font-size: 12px; color: var(--text-muted); margin: 0 4px; }
.filter-hint { margin-left: auto; font-size: 12px; }
.auth-hidden { display: none !important; }
.hidden { display: none !important; }

.search-box { display: flex; }
.search-box input {
  flex: 1;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-right: none;
  border-radius: var(--radius) 0 0 var(--radius);
  padding: 6px 12px;
  color: var(--text-primary);
  font-size: 13px;
  outline: none;
}
.search-box input:focus { border-color: var(--accent); }
.btn-search {
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: #fff;
  padding: 6px 16px;
  cursor: pointer;
  font-size: 13px;
}

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

.theme-switch {
  display: flex;
  align-items: center;
  padding: 2px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  gap: 2px;
}
.theme-switch-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 12px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.theme-switch-btn:hover { color: var(--text-primary); background: var(--bg-hover); }
.theme-switch-btn.active {
  background: var(--accent);
  color: #fff;
}
.topbar-item { display: flex; flex-direction: column; align-items: flex-end; }
.topbar-item .label { font-size: 11px; color: var(--text-muted); }
.topbar-item .value { font-family: var(--font-mono); font-size: 13px; font-weight: 600; }
.topbar-item .value.highlight { color: var(--accent); }
.icon-btn { background: none; border: none; font-size: 18px; cursor: pointer; position: relative; padding: 4px; }
.icon-btn .badge {
  position: absolute; top: -2px; right: -4px;
  background: var(--red); color: #fff; font-size: 10px;
  width: 16px; height: 16px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.user-info { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600;
}

/* ===== 布局 ===== */
.layout {
  display: flex;
  margin-top: var(--topbar-height);
  height: calc(100vh - var(--topbar-height));
}

/* ===== 侧边栏 ===== */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow-y: auto;
  overflow-x: hidden;
  transition: width 0.25s ease, transform 0.25s ease;
}

@media (min-width: 993px) {
  body.sidebar-collapsed .sidebar {
    width: 0;
    border-right: none;
    pointer-events: none;
  }
}

.nav-group { padding: 2px 0 0; }
.nav-group + .nav-group { margin-top: 2px; }
.nav-group-title {
  padding: 2px 16px 2px;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  line-height: 1.3;
}

.nav-list { list-style: none; }
.nav-item {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 16px; cursor: pointer;
  color: var(--text-secondary);
  transition: all 0.15s;
  border-left: 3px solid transparent;
  font-size: 12px;
  line-height: 1.3;
}
.nav-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.nav-item.active {
  background: var(--blue-bg);
  color: var(--accent);
  border-left-color: var(--accent);
  font-weight: 500;
}
.nav-icon { font-size: 14px; width: 18px; text-align: center; flex-shrink: 0; }

.sidebar-footer {
  margin-top: auto;
  padding: 8px 16px;
  border-top: 1px solid var(--border);
}
.system-info { font-size: 11px; color: var(--text-muted); line-height: 1.6; }

/* ===== 主内容 ===== */
.main-content { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 20px 24px; min-width: 0; }
.view { display: none; }
.view.active { display: block; }

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 20px;
}
.page-header h1 { font-size: 20px; font-weight: 600; margin-bottom: 4px; }
.page-desc { font-size: 12px; color: var(--text-secondary); }
.page-date { color: var(--text-secondary); font-size: 13px; white-space: nowrap; }
.page-actions { display: flex; gap: 8px; }

.role-badge {
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  background: var(--blue-bg);
  color: var(--accent);
  border: 1px solid rgba(56, 139, 253, 0.3);
}
.role-badge.sales { background: var(--green-bg); color: var(--green); border-color: rgba(63, 185, 80, 0.3); }

/* ===== 统计卡片 ===== */
.stat-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.stat-cards.mini { grid-template-columns: repeat(4, 1fr); }
.stat-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.stat-card.accent { border-color: rgba(56, 139, 253, 0.4); background: linear-gradient(135deg, var(--bg-secondary), rgba(56, 139, 253, 0.06)); }
.stat-label { font-size: 11px; color: var(--text-secondary); margin-bottom: 6px; }
.stat-value { font-size: 20px; font-weight: 700; font-family: var(--font-mono); }
.stat-change { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

/* ===== 面板 ===== */
.panel {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 16px;
  overflow: hidden;
}
.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}
.panel-header h3 { font-size: 14px; font-weight: 600; }
.panel-body { padding: 16px; }
.panel-body.no-padding { padding: 0; }
.panel-footer { padding: 10px 16px; border-top: 1px solid var(--border); }
.panel-actions { display: flex; gap: 8px; align-items: center; }
.panel-actions button:disabled { opacity: 0.45; cursor: not-allowed; }
.badge-count { font-size: 12px; color: var(--text-muted); }

/* ===== 网格 & 分栏 ===== */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.split-layout { display: grid; grid-template-columns: 1fr 340px; gap: 16px; align-items: start; }
.sticky-panel { position: sticky; top: 0; }

/* ===== 表格 ===== */
.data-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.data-table th {
  text-align: left;
  padding: 8px 12px;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  font-weight: 500;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.data-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 12px;
  vertical-align: middle;
}
.data-table.compact td, .data-table.compact th { padding: 6px 10px; }
.data-table tbody tr:hover { background: var(--bg-hover); }
.data-table.clickable tbody tr { cursor: pointer; }
.data-table.clickable tbody tr.selected { background: var(--blue-bg); }
.highlight-row { background: rgba(63, 185, 80, 0.06) !important; }

.up { color: var(--green); }
.down { color: var(--red); }
.buy-text { color: var(--green); font-weight: 600; }
.sell-text { color: var(--red); font-weight: 600; }
.warn { color: var(--yellow); }
.text-muted { color: var(--text-muted); }

/* ===== 标签 ===== */
.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 500;
  font-family: sans-serif;
  white-space: nowrap;
}
.tag-primary { background: var(--blue-bg); color: var(--accent); }
.tag-success { background: var(--green-bg); color: var(--green); }
.tag-warning { background: var(--yellow-bg); color: var(--yellow); }
.tag-danger { background: var(--red-bg); color: var(--red); }
.tag-info { background: rgba(139, 148, 158, 0.15); color: var(--text-secondary); }
.tag-muted { background: rgba(139, 148, 158, 0.1); color: var(--text-muted); }

/* ===== 信评风控灯 ===== */
.risk-light { font-size: 16px; cursor: help; }
.risk-light.sm { font-size: 12px; }
.risk-light.green { color: var(--green); text-shadow: 0 0 6px rgba(63, 185, 80, 0.5); }
.risk-light.yellow { color: var(--yellow); text-shadow: 0 0 6px rgba(210, 153, 34, 0.5); }
.risk-light.red { color: var(--red); text-shadow: 0 0 6px rgba(248, 81, 73, 0.5); }

.legend-bar { display: flex; gap: 20px; font-size: 11px; color: var(--text-secondary); }
.legend-item { display: flex; align-items: center; gap: 6px; }

/* ===== 按钮 ===== */
.btn {
  padding: 8px 16px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.15s;
}
.btn-primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-ghost { background: transparent; color: var(--text-secondary); border-color: var(--border); }
.btn-ghost:hover { background: var(--bg-hover); color: var(--text-primary); }
.btn-danger-text { color: var(--red) !important; }
.btn-sm { padding: 4px 12px; font-size: 12px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--bg-tertiary); color: var(--text-primary); cursor: pointer; }
.btn-sm:hover { background: var(--bg-hover); }
.btn-sm.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-xs { padding: 2px 8px; font-size: 11px; border-radius: 4px; border: 1px solid var(--border); background: var(--bg-tertiary); color: var(--text-primary); cursor: pointer; }
.btn-xs.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-xs.btn-danger-text { color: var(--red); border-color: transparent; background: var(--red-bg); }
.btn-xs:disabled { opacity: 0.4; cursor: not-allowed; }
.link { color: var(--accent); font-size: 12px; cursor: pointer; text-decoration: none; }
.link:hover { text-decoration: underline; }

/* ===== 表单 ===== */
.input, .select-sm, .input-sm, .input-xs {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 12px;
  color: var(--text-primary);
  font-size: 13px;
  outline: none;
  width: 100%;
}
.input:focus { border-color: var(--accent); }
.input-sm, .select-sm { padding: 5px 10px; font-size: 12px; width: auto; }
.input-xs { padding: 3px 6px; font-size: 12px; width: 80px; font-family: var(--font-mono); }
.select-sm { cursor: pointer; }

.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 12px; color: var(--text-secondary); margin-bottom: 6px; }
.form-actions-row { display: flex; gap: 8px; margin-top: 12px; }

.filter-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.filter-bar.inline { margin-bottom: 0; }

/* ===== Tab ===== */
.tab-bar { display: flex; gap: 0; margin-bottom: 16px; border-bottom: 1px solid var(--border); }
.tab-bar-item {
  padding: 8px 20px;
  background: none; border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 13px;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  display: flex; align-items: center; gap: 6px;
}
.tab-bar-item.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 500; }
.tab-bar-item:hover { color: var(--text-primary); }
.tab-count {
  background: var(--bg-tertiary);
  padding: 1px 6px;
  border-radius: 8px;
  font-size: 10px;
}

/* ===== 工作流步骤 ===== */
.workflow-steps {
  display: flex;
  align-items: center;
  margin-bottom: 20px;
  padding: 16px 20px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.step {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}
.step-num {
  width: 24px; height: 24px;
  border-radius: 50%;
  border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 600;
}
.step.done { color: var(--green); }
.step.done .step-num { background: var(--green-bg); border-color: var(--green); color: var(--green); }
.step.active { color: var(--accent); font-weight: 500; }
.step.active .step-num { background: var(--blue-bg); border-color: var(--accent); color: var(--accent); }
.step-line { flex: 1; height: 2px; background: var(--border); margin: 0 8px; min-width: 20px; }
.step-line.done { background: var(--green); }

/* ===== 投标进程 ===== */
.progress-track { display: flex; align-items: center; gap: 4px; }
.track-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--border);
  flex-shrink: 0;
}
.track-dot.done { background: var(--accent); }
.track-dot.active { background: var(--yellow); box-shadow: 0 0 4px var(--yellow); }
.track-dot.win { background: var(--green); }
.track-dot.lose { background: var(--red); }
.track-label { font-size: 11px; color: var(--text-muted); margin-left: 6px; font-family: sans-serif; }

/* ===== 首页专用 ===== */
.todo-list { list-style: none; }
.todo-item {
  display: flex;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  align-items: flex-start;
}
.todo-item:last-child { border-bottom: none; }
.todo-item.urgent { color: var(--yellow); }
.todo-type {
  background: var(--bg-tertiary);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10px;
  white-space: nowrap;
  flex-shrink: 0;
}

.snapshot-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.snapshot-item {
  padding: 12px;
  background: var(--bg-tertiary);
  border-radius: var(--radius);
  text-align: center;
}
.snapshot-label { font-size: 11px; color: var(--text-muted); margin-bottom: 4px; }
.snapshot-value { font-size: 18px; font-weight: 700; font-family: var(--font-mono); }
.snapshot-sub { font-size: 10px; color: var(--text-muted); margin-top: 2px; }

/* ===== 债券信息卡片 ===== */
.bond-info-card {
  background: var(--bg-tertiary);
  border-radius: var(--radius);
  padding: 12px;
  margin-bottom: 16px;
}
.info-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  font-size: 12px;
}
.info-label { color: var(--text-secondary); }

/* ===== 分配配售 ===== */
.alloc-info {
  display: flex;
  gap: 24px;
  margin-bottom: 12px;
  padding: 10px 12px;
  background: var(--bg-tertiary);
  border-radius: var(--radius);
}
.alloc-row { font-size: 12px; color: var(--text-secondary); }
.alloc-row strong { color: var(--text-primary); margin-left: 8px; font-family: var(--font-mono); }

/* ===== 标位录入 ===== */
.bid-summary-compact {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: 16px;
  row-gap: 6px;
  padding: 10px 12px;
  margin-bottom: 14px;
  background: var(--bg-tertiary);
  border-radius: var(--radius);
  font-size: 12px;
  line-height: 1.4;
}
.bid-summary-item { display: inline-flex; align-items: baseline; white-space: nowrap; }
.bid-summary-label { color: var(--text-muted); margin-right: 4px; }
.bid-summary-val { color: var(--text-primary); font-family: var(--font-mono); }
.bid-summary-item:nth-child(3) .bid-summary-val { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bid-lines-form {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  margin-bottom: 14px;
}
.bid-line-row {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  margin-bottom: 8px;
  font-size: 12px;
  font-family: var(--font-mono);
}
.bid-line-row:last-of-type { margin-bottom: 10px; }
.bid-line-no {
  width: 22px;
  flex-shrink: 0;
  color: var(--text-muted);
  font-weight: 600;
}
.bid-line-row .input-sm {
  width: 72px;
  padding: 4px 6px;
  font-size: 12px;
  font-family: var(--font-mono);
}
.bid-line-row .bid-line-yield,
.bid-line-row .bid-line-price { width: 64px; }
.bid-line-unit, .bid-line-sep { color: var(--text-muted); flex-shrink: 0; margin: 0 2px; }
.bid-line-remove {
  margin-left: 8px;
  padding: 0 6px;
  border: none;
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  flex-shrink: 0;
}
.bid-line-remove:hover { color: var(--red); }
.bid-line-total {
  padding-top: 8px;
  border-top: 1px dashed var(--border);
  font-size: 12px;
  color: var(--text-secondary);
}
.bid-line-total strong {
  color: var(--accent-hover);
  font-family: var(--font-mono);
  font-size: 14px;
  margin: 0 4px;
}
.bid-entry-meta { margin-top: 0; }
.bid-entry-meta .form-group { margin-bottom: 0; }
.bid-entry-fields {
  border-top: 1px solid var(--border);
  padding-top: 12px;
}
.bid-entry-fields .form-group-full { margin-bottom: 10px; }
.bid-entry-fields label {
  display: block;
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.field-hint {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 4px;
}
.select-input {
  cursor: pointer;
  appearance: auto;
}
.client-inst-wrap { position: relative; }
.client-inst-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 28px;
  margin-bottom: 8px;
}
.client-inst-empty {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 28px;
}
.client-inst-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  background: rgba(56, 139, 253, 0.12);
  border: 1px solid rgba(56, 139, 253, 0.3);
  border-radius: 4px;
  font-size: 11px;
  color: var(--text-primary);
}
.client-inst-type {
  font-size: 10px;
  color: var(--text-muted);
  padding-left: 4px;
  border-left: 1px solid var(--border);
}
.client-inst-remove {
  margin-left: 2px;
  padding: 0 2px;
  border: none;
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
}
.client-inst-remove:hover { color: var(--red); }
.client-inst-add-row {
  display: flex;
  gap: 6px;
  align-items: center;
}
.client-inst-add-row .input { flex: 1; }
.btn-add-client-inst {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  padding: 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--accent);
  background: var(--bg-hover);
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
}
.btn-add-client-inst:hover {
  background: rgba(56, 139, 253, 0.15);
  border-color: var(--accent);
}
.client-inst-picker {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  margin-top: 4px;
  max-height: 200px;
  overflow-y: auto;
  background: var(--bg-elevated);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  box-shadow: 0 8px 24px var(--shadow-color);
  z-index: 10;
}
.client-inst-picker.hidden { display: none; }
.client-picker-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 12px;
  border: none;
  background: none;
  text-align: left;
  cursor: pointer;
  font-size: 12px;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border);
}
.client-picker-item:last-child { border-bottom: none; }
.client-picker-item:hover { background: var(--bg-hover); }
.client-picker-item.added { opacity: 0.5; cursor: default; }
.client-picker-name { flex: 1; }
.client-picker-type { font-size: 10px; color: var(--text-muted); }
.client-picker-badge { font-size: 10px; color: var(--accent); }
.client-picker-empty {
  padding: 12px;
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
}
.bid-lines-list { margin-bottom: 8px; }
.bid-lines-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 8px;
  border-top: 1px dashed var(--border);
}
.btn-add-bid-line {
  width: 28px;
  height: 28px;
  padding: 0;
  font-size: 18px;
  line-height: 1;
  font-weight: 600;
  color: var(--accent);
  background: var(--bg-hover);
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
  flex-shrink: 0;
}
.btn-add-bid-line:hover {
  background: rgba(56, 139, 253, 0.15);
  border-color: var(--accent);
}
.bid-lines-toolbar .bid-line-total {
  border-top: none;
  padding-top: 0;
  margin: 0;
}

/* ===== 首页模块卡片 ===== */
.home-metrics-row {
  grid-template-columns: repeat(3, 1fr);
  margin-bottom: 20px;
}
.home-metric-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 120px;
}
.home-metric-card .stat-value { margin-bottom: 2px; }
.home-card-btn {
  margin-top: auto;
  align-self: flex-start;
  font-size: 11px;
  padding: 4px 10px;
}
.home-main-grid { margin-bottom: 20px; }
.home-left-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}
.home-issuance-compact .panel-header { padding: 10px 14px; }
.home-issuance-compact .panel-body { padding: 8px 12px; }
.home-issuance-summary { display: flex; flex-direction: column; gap: 8px; }
.home-issuance-total {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 6px 10px;
  background: var(--bg-tertiary);
  border-radius: var(--radius);
}
.home-issuance-total-label {
  font-size: 11px;
  color: var(--text-muted);
}
.home-issuance-total-val {
  font-size: 16px;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--accent-hover);
}
.home-issuance-total-sep { color: var(--text-muted); }
.home-category-table {
  width: 100%;
  font-size: 11px;
  border-collapse: collapse;
}
.home-category-table th,
.home-category-table td {
  padding: 4px 8px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.home-category-table th {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 10px;
  padding-top: 0;
}
.home-category-table td:last-child,
.home-category-table th:last-child {
  text-align: right;
  font-family: var(--font-mono);
}
.home-category-table tbody tr:last-child td { border-bottom: none; }
.home-trade-panel .panel-header { padding: 10px 14px; }
.home-trade-table {
  width: 100%;
  font-size: 11px;
  border-collapse: collapse;
}
.home-trade-table th,
.home-trade-table td {
  padding: 6px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.home-trade-table th {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 10px;
  background: var(--bg-tertiary);
}
.home-trade-table td.trade-count,
.home-trade-table th:nth-child(2) {
  text-align: center;
  width: 72px;
}
.home-trade-table td.trade-amount,
.home-trade-table th:nth-child(3) {
  text-align: right;
  font-family: var(--font-mono);
  width: 100px;
}
.home-trade-table tbody tr:last-child td { border-bottom: none; }
.home-todo-list .todo-section-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  padding: 10px 0 4px;
  list-style: none;
  border-bottom: 1px solid var(--border);
  margin-top: 4px;
}
.home-todo-list .todo-section-title:first-child { margin-top: 0; padding-top: 0; }
.home-todo-panel .panel-body { max-height: 420px; overflow-y: auto; }
@media (max-width: 1200px) {
  .home-metrics-row { grid-template-columns: 1fr; }
}

/* ===== 滚动条 ===== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-light); }

/* ===== 响应式 ===== */
@media (max-width: 1200px) {
  .grid-2, .split-layout, .stat-cards.mini, .parse-layout, .crm-layout { grid-template-columns: 1fr; }
  .workflow-steps { overflow-x: auto; }
  .parse-arrow { transform: rotate(90deg); text-align: center; }
}

/* ===== 智能助手 ===== */
.ai-badge {
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 11px;
  background: linear-gradient(135deg, rgba(56,139,253,0.2), rgba(163,113,247,0.2));
  color: #a371f7;
  border: 1px solid rgba(163, 113, 247, 0.3);
}

.smart-shortcuts {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.shortcut-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.15s;
}
.shortcut-card:hover { border-color: var(--accent); background: var(--blue-bg); }
.shortcut-icon { font-size: 24px; }
.shortcut-title { font-weight: 600; font-size: 13px; margin-bottom: 2px; }
.shortcut-desc { font-size: 11px; color: var(--text-muted); }

.parse-layout {
  display: grid;
  grid-template-columns: 1fr 40px 1fr;
  gap: 12px;
  align-items: stretch;
  margin-bottom: 16px;
}
.parse-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: var(--accent);
  font-weight: bold;
}
.parse-input {
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6;
  resize: vertical;
  min-height: 160px;
}
.example-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 10px 0;
}
.chip-btn {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 3px 10px;
  font-size: 11px;
  color: var(--text-secondary);
  cursor: pointer;
  font-family: var(--font-mono);
}
.chip-btn:hover { border-color: var(--accent); color: var(--accent); }

.parse-result { min-height: 200px; }
.parse-result.empty { display: flex; align-items: center; justify-content: center; }
.parse-empty-hint { color: var(--text-muted); font-size: 13px; }

.result-fields { display: flex; flex-direction: column; gap: 10px; }
.result-field {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 8px;
  padding: 8px 10px;
  background: var(--bg-tertiary);
  border-radius: var(--radius);
  font-size: 12px;
}
.result-field .field-label { color: var(--text-secondary); }
.result-field .field-value { font-family: var(--font-mono); font-weight: 600; }
.result-field .field-value.highlight { color: var(--accent); }
.result-json {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.6;
  color: var(--green);
  margin-top: 10px;
  white-space: pre-wrap;
  word-break: break-all;
}

.format-spec code {
  display: block;
  background: var(--bg-tertiary);
  padding: 10px 12px;
  border-radius: var(--radius);
  font-size: 11px;
  color: var(--accent);
  margin-bottom: 8px;
}
.spec-fields { display: flex; flex-wrap: wrap; gap: 12px; font-size: 11px; color: var(--text-muted); }
.text-sans { font-family: sans-serif !important; }

/* ===== CRM ===== */
.crm-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 16px;
  align-items: start;
}
.crm-list-panel { margin-bottom: 0; }

.customer-list { list-style: none; }
.customer-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s;
}
.customer-item:hover { background: var(--bg-hover); }
.customer-item.active { background: var(--blue-bg); border-left: 3px solid var(--accent); }
.customer-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 600;
  flex-shrink: 0;
}
.customer-name { font-weight: 600; font-size: 13px; }
.customer-type { font-size: 11px; color: var(--text-muted); }
.match-score {
  margin-left: auto;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  font-family: var(--font-mono);
}
.match-score.high { color: var(--green); }

.profile-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}
.profile-card {
  padding: 10px;
  background: var(--bg-tertiary);
  border-radius: var(--radius);
}
.profile-label { font-size: 10px; color: var(--text-muted); margin-bottom: 4px; }
.profile-value { font-size: 13px; font-weight: 600; }
.profile-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.profile-tag {
  padding: 3px 10px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 11px;
  color: var(--text-secondary);
}

.match-list { list-style: none; }
.match-item {
  padding: 12px;
  background: var(--bg-tertiary);
  border-radius: var(--radius);
  margin-bottom: 10px;
  border: 1px solid var(--border);
}
.match-item:last-child { margin-bottom: 0; }
.match-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.match-bond { font-weight: 600; }
.match-score-badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  background: var(--bg-hover);
  color: var(--text-secondary);
  font-family: var(--font-mono);
}
.match-score-badge.high { background: var(--green-bg); color: var(--green); }
.match-reason { font-size: 12px; color: var(--text-secondary); margin-bottom: 8px; line-height: 1.5; }
.match-action { display: flex; gap: 6px; }

/* ===== 定价 ===== */
.pricing-result.hidden { display: none; }
.factor-list { display: flex; flex-direction: column; gap: 12px; }
.factor-item {
  padding: 12px;
  background: var(--bg-tertiary);
  border-radius: var(--radius);
  border-left: 3px solid var(--border);
}
.factor-item:nth-child(1) { border-left-color: #a371f7; }
.factor-item:nth-child(2) { border-left-color: var(--accent); }
.factor-item:nth-child(3) { border-left-color: var(--yellow); }
.factor-item:nth-child(4) { border-left-color: var(--green); }
.factor-header {
  display: flex;
  justify-content: space-between;
  font-weight: 600;
  font-size: 12px;
  margin-bottom: 6px;
}
.factor-weight { font-size: 10px; color: var(--text-muted); font-weight: normal; }
.factor-content { font-size: 12px; color: var(--text-secondary); line-height: 1.5; margin-bottom: 4px; }
.factor-impact { font-size: 11px; color: var(--text-muted); }
.factor-impact.up { color: var(--green); }

.quote-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}
.quote-item { text-align: center; padding: 10px; background: var(--bg-tertiary); border-radius: var(--radius); }
.quote-label { font-size: 11px; color: var(--text-muted); margin-bottom: 4px; }
.quote-value { font-size: 16px; font-weight: 700; font-family: var(--font-mono); }

.chart-placeholder {
  height: 180px;
  background: var(--bg-tertiary);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1px dashed var(--border);
}
.chart-placeholder-text { font-size: 14px; margin-bottom: 4px; }

.advice-list { list-style: none; }
.advice-list li {
  padding: 8px 0 8px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  position: relative;
  line-height: 1.5;
}
.advice-list li::before { content: '•'; position: absolute; left: 0; color: var(--accent); }
.advice-list li:last-child { border-bottom: none; }

@media (max-width: 1200px) {
  .smart-shortcuts { grid-template-columns: repeat(2, 1fr); }
  .profile-grid { grid-template-columns: repeat(2, 1fr); }
  .quote-board-layout { grid-template-columns: 1fr; }
}

/* ===== 二级 Tab ===== */
.secondary-tab-panel.hidden { display: none; }

/* ===== 对峙报价板 ===== */
.quote-board-layout {
  display: grid;
  grid-template-columns: 220px 1fr 300px;
  gap: 16px;
  align-items: start;
  margin-bottom: 16px;
}

.board-watchlist { list-style: none; }
.board-watchlist li {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  gap: 2px 8px;
  transition: background 0.15s;
}
.board-watchlist li:hover { background: var(--bg-hover); }
.board-watchlist li.active {
  background: var(--blue-bg);
  border-left: 3px solid var(--accent);
}
.bw-name { font-weight: 600; font-size: 12px; grid-column: 1; }
.bw-code { font-size: 10px; color: var(--text-muted); grid-column: 1; font-family: var(--font-mono); }
.bw-yield { font-family: var(--font-mono); font-weight: 700; font-size: 13px; grid-row: 1 / 3; grid-column: 2; align-self: center; }
.bw-spread { font-size: 10px; color: var(--text-muted); grid-column: 1; display: none; }

.board-center .panel-header { flex-wrap: wrap; gap: 8px; }
.board-meta {
  display: flex;
  gap: 16px;
  font-size: 11px;
  color: var(--text-secondary);
}
.board-meta strong { font-family: var(--font-mono); color: var(--text-primary); }

.standoff-board {
  display: grid;
  grid-template-columns: 1fr 200px 1fr;
  min-height: 320px;
}

.board-side { display: flex; flex-direction: column; }
.board-side-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border);
  font-size: 12px;
}
.side-label { font-weight: 700; }
.side-sub { font-size: 10px; color: var(--text-muted); }

.ofr-side .board-side-header { border-left: 3px solid var(--red); }
.bid-side .board-side-header { border-right: 3px solid var(--green); }

.board-rows { flex: 1; display: flex; flex-direction: column; }

.board-row {
  display: grid;
  grid-template-columns: 1fr 70px 40px 36px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 12px;
  transition: background 0.12s;
  align-items: center;
}
.bid-side .board-row {
  grid-template-columns: 40px 70px 1fr 36px;
}
.board-row:hover { background: var(--bg-hover); }
.board-row.selected { background: var(--blue-bg); outline: 1px solid var(--accent); }
.board-row.best { font-weight: 700; }
.board-row.ofr .row-yield { color: var(--red); text-align: left; }
.board-row.bid .row-yield { color: var(--green); text-align: right; }
.board-row.ofr.best { background: rgba(248, 81, 73, 0.08); }
.board-row.bid.best { background: rgba(63, 185, 80, 0.08); }
.row-qty { text-align: center; color: var(--text-secondary); }
.row-broker { text-align: center; color: var(--text-muted); font-size: 10px; }
.row-settle { text-align: center; color: var(--text-muted); font-size: 10px; }

.board-mid {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 16px 12px;
  background: var(--bg-tertiary);
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
}
.mid-spread {
  text-align: center;
  padding: 10px 16px;
  background: var(--bg-primary);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  font-size: 11px;
  color: var(--text-secondary);
}
.mid-spread strong { display: block; font-size: 20px; color: var(--yellow); font-family: var(--font-mono); margin-top: 4px; }
.mid-last { text-align: center; font-size: 11px; color: var(--text-secondary); }
.mid-last strong { display: block; font-size: 22px; font-family: var(--font-mono); margin: 4px 0; }
.mid-qty { font-size: 10px; color: var(--text-muted); }
.mid-actions { display: flex; gap: 6px; }

.board-detail-panel .panel-body { padding: 14px; }
.board-detail-empty {
  text-align: center;
  padding: 24px 12px;
  color: var(--text-secondary);
  font-size: 12px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  margin-bottom: 16px;
}
.detail-empty-icon { font-size: 28px; margin-bottom: 8px; color: var(--text-muted); }
.board-detail-content.hidden { display: none; }
.detail-bond { font-size: 15px; font-weight: 600; margin-bottom: 12px; }
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}
.detail-cell {
  padding: 8px;
  background: var(--bg-tertiary);
  border-radius: var(--radius);
  font-size: 11px;
}
.detail-cell span { display: block; color: var(--text-muted); margin-bottom: 2px; }
.detail-cell strong { font-family: var(--font-mono); font-size: 13px; }
.detail-standard {
  margin-bottom: 12px;
  padding: 10px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.detail-standard code { font-size: 11px; color: var(--green); word-break: break-all; }

.board-quick-form {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.quick-form-title { font-size: 12px; font-weight: 600; margin-bottom: 10px; color: var(--text-secondary); }

/* ===== 发行 / 投标分类 ===== */
.category-tabs { margin-bottom: 12px; }
.issuance-split .split-main { min-width: 0; }
.issuance-panel.hidden, .overview-panel.hidden { display: none; }

.table-scroll-wrap {
  overflow-x: auto;
  max-width: 100%;
}
.table-scroll-wrap .data-table { min-width: max-content; }
.table-scroll-wrap .sticky-col {
  position: sticky;
  left: 0;
  z-index: 2;
  background: var(--bg-secondary);
  box-shadow: 2px 0 4px rgba(0,0,0,0.2);
}
.table-scroll-wrap thead .sticky-col { background: var(--bg-tertiary); }

.category-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  margin-bottom: 10px;
  background: var(--blue-bg);
  color: var(--accent);
  border: 1px solid rgba(56, 139, 253, 0.3);
}
.category-badge.local { background: var(--yellow-bg); color: var(--yellow); border-color: rgba(210,153,34,0.3); }
.category-badge.credit { background: rgba(163,113,247,0.12); color: #a371f7; border-color: rgba(163,113,247,0.3); }

.scroll-info {
  max-height: 280px;
  overflow-y: auto;
  margin-bottom: 14px;
}
.scroll-info .info-row { font-size: 11px; }

.overview-status-tabs { margin-top: -8px; margin-bottom: 16px; }
.overview-detail-panel { margin-top: 0; }
.detail-action-btns {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.detail-action-btns .btn-xs { margin: 0; }
.my-bid-bond-link {
  color: var(--accent);
  text-decoration: none;
  cursor: pointer;
}
.my-bid-bond-link:hover { text-decoration: underline; }
.overview-row-selected { background: var(--blue-bg) !important; }
.issuance-full { width: 100%; }
.issuance-full .panel-footer { margin-top: -16px; border: 1px solid var(--border); border-top: none; border-radius: 0 0 var(--radius) var(--radius); }

.alloc-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }

/* ===== 弹窗 ===== */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  width: 520px;
  max-width: 96vw;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4);
}
.modal.modal-lg { width: 720px; }
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.modal-header h3 { font-size: 16px; }
.modal-close {
  background: none; border: none; font-size: 22px;
  color: var(--text-secondary); cursor: pointer; line-height: 1;
}
.modal-close:hover { color: var(--text-primary); }
.modal-body { padding: 20px; overflow-y: auto; flex: 1; }
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

/* ===== 表头排序筛选 ===== */
.data-table th.th-sortable { padding: 0; vertical-align: middle; }
.th-inner {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 6px 8px;
  min-height: 32px;
}
.th-sort-btn {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  padding: 0;
  font-family: sans-serif;
  white-space: nowrap;
}
.th-sort-btn:hover { color: var(--text-primary); }
.th-sortable.sort-asc .th-sort-btn,
.th-sortable.sort-desc .th-sort-btn { color: var(--accent); }
.th-sort-icon { font-size: 10px; opacity: 0.6; flex-shrink: 0; }
.th-filter-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 10px;
  padding: 2px 4px;
  border-radius: 3px;
  flex-shrink: 0;
}
.th-filter-btn:hover { background: var(--bg-hover); color: var(--accent); }
.th-filter-pop {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 50;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px;
  min-width: 160px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}
.data-table th.th-sortable { position: relative; }
.th-filter-pop.open { display: block; }
.th-filter-input {
  width: 100%;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 5px 8px;
  color: var(--text-primary);
  font-size: 11px;
  margin-bottom: 6px;
}
.position-analysis-table .group-header {
  text-align: center;
  font-weight: 700;
  font-size: 12px;
  padding: 10px 8px;
  border-bottom: 1px solid var(--border);
}
.position-analysis-table .group-cb { background: rgba(56, 139, 253, 0.15); color: var(--accent); }
.position-analysis-table .group-sc { background: rgba(63, 185, 80, 0.12); color: var(--green); }
.position-analysis-table .group-nd { background: rgba(210, 153, 34, 0.12); color: var(--yellow); }
.position-analysis-table .group-ex { background: rgba(163, 113, 247, 0.15); color: #a371f7; }
.position-analysis-table .group-today { background: rgba(56, 139, 253, 0.22); color: var(--accent-hover); }
.position-analysis-table .group-ib { background: rgba(46, 160, 167, 0.15); color: #2ea0a7; }
.position-analysis-table .group-ex-avail { background: rgba(163, 113, 247, 0.22); color: #c297ff; }
.position-metrics-row {
  display: grid;
  grid-template-columns: 1.55fr 1fr 1fr 1fr 1fr 1fr 1fr;
  gap: 8px;
  margin-bottom: 20px;
  align-items: stretch;
}
.position-metrics-row .position-hero-card {
  padding: 16px 18px;
  border-width: 2px;
  border-color: rgba(56, 139, 253, 0.55);
  background: linear-gradient(135deg, rgba(56, 139, 253, 0.14), var(--bg-secondary) 55%);
  box-shadow: 0 4px 16px rgba(56, 139, 253, 0.12);
}
.position-metrics-row .position-metric-card {
  padding: 10px 10px;
  min-width: 0;
}
.position-metrics-row .stat-label-row {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 4px;
  min-height: 18px;
}
.position-metrics-row .stat-label {
  font-size: 10px;
  line-height: 1.3;
  margin-bottom: 0;
  white-space: nowrap;
}
.position-metrics-row .position-hero-card .stat-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-hover);
}
.position-metrics-row .stat-value {
  font-size: 16px;
  line-height: 1.2;
}
.position-metrics-row .stat-value-hero {
  font-size: 28px;
  line-height: 1.15;
  margin: 4px 0 2px;
}
.position-metrics-row .stat-change {
  font-size: 10px;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.metric-hint {
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
  cursor: help;
}
.metric-hint-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  color: var(--text-muted);
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 50%;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.metric-hint:hover .metric-hint-icon,
.metric-hint:focus .metric-hint-icon,
.metric-hint:focus-within .metric-hint-icon {
  color: var(--accent);
  border-color: var(--accent);
  background: rgba(56, 139, 253, 0.12);
}
.metric-hint-tip {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translateX(-50%);
  z-index: 50;
  width: 240px;
  padding: 8px 10px;
  font-size: 11px;
  line-height: 1.45;
  color: var(--text-primary);
  background: var(--bg-elevated);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  box-shadow: 0 8px 24px var(--shadow-color);
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.12s, visibility 0.12s;
  text-align: left;
  white-space: normal;
}
.metric-hint-tip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -5px;
  border: 5px solid transparent;
  border-top-color: var(--border-light);
}
.position-hero-card .metric-hint-tip { width: 280px; }
.position-metrics-row .position-metric-card:nth-child(n+5) .metric-hint-tip {
  left: auto;
  right: 0;
  transform: none;
}
.position-metrics-row .position-metric-card:nth-child(n+5) .metric-hint-tip::after {
  left: auto;
  right: 8px;
  margin-left: 0;
}
.metric-hint:hover .metric-hint-tip,
.metric-hint:focus .metric-hint-tip,
.metric-hint:focus-within .metric-hint-tip {
  opacity: 1;
  visibility: visible;
}
@media (max-width: 1280px) {
  .position-metrics-row {
    grid-template-columns: repeat(4, 1fr);
  }
  .position-metrics-row .position-hero-card {
    grid-column: span 2;
  }
  .position-metrics-row .stat-value-hero { font-size: 24px; }
}
@media (max-width: 900px) {
  .position-metrics-row { grid-template-columns: repeat(2, 1fr); }
  .position-metrics-row .position-hero-card { grid-column: span 2; }
}
.stat-cards-4 { grid-template-columns: repeat(4, 1fr); }
.stat-cards-5 { grid-template-columns: repeat(5, 1fr); }
@media (max-width: 1200px) {
  .stat-cards-4 { grid-template-columns: repeat(2, 1fr); }
  .stat-cards-5 { grid-template-columns: repeat(3, 1fr); }
}
.position-analysis-table .header-sub-row th {
  font-size: 10px;
  white-space: nowrap;
  padding: 6px 8px;
}
.position-analysis-table .summary-row { background: var(--bg-tertiary); }
.position-analysis-table .summary-row td { font-family: var(--font-mono); }

/* 债券简称标位汇总悬浮提示 */
.bond-name-hover {
  cursor: help;
  border-bottom: 1px dashed var(--text-muted);
  position: relative;
}
.bid-position-tooltip {
  position: fixed;
  z-index: 1000;
  width: 200px;
  padding: 6px 8px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  box-shadow: 0 8px 24px var(--shadow-color);
  font-size: 11px;
  line-height: 1.35;
  color: var(--text-primary);
  pointer-events: auto;
  opacity: 0;
  transition: opacity 0.12s;
}
.bid-position-tooltip.visible { opacity: 1; }
.bid-position-tooltip .tooltip-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 4px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
}
.bid-position-tooltip .tooltip-title {
  flex: 1;
  font-weight: 600;
  font-size: 11px;
  line-height: 1.35;
  color: var(--accent-hover);
}
.bid-position-tooltip .tooltip-copy-btn {
  flex-shrink: 0;
  padding: 1px 6px;
  font-size: 10px;
  line-height: 1.4;
  color: var(--text-muted);
  background: var(--bg-hover);
  border: 1px solid var(--border);
  border-radius: 3px;
  cursor: pointer;
}
.bid-position-tooltip .tooltip-copy-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
}
.bid-position-tooltip .tooltip-body {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.bid-position-tooltip .tooltip-row {
  display: grid;
  grid-template-columns: 52px 1fr;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.35;
  font-variant-numeric: tabular-nums;
}
.bid-position-tooltip .tooltip-yield { color: var(--text-muted); }
.bid-position-tooltip .tooltip-amt { text-align: right; color: var(--text-primary); }

/* 报价意向对峙列表 */
.cash-quote-panel-body { overflow: hidden; }
.cash-quote-table-wrap { overflow-x: hidden; width: 100%; }
.cash-quote-table {
  table-layout: fixed;
  width: 100%;
  font-size: 10px;
}
.cash-quote-table .cash-quote-group-row th {
  text-align: center;
  font-weight: 600;
  padding: 4px 2px;
  font-size: 10px;
}
.cash-quote-table .group-bid-h {
  background: rgba(46, 160, 67, 0.12);
  color: var(--green);
  border-bottom: 2px solid var(--green);
}
.cash-quote-table .group-ofr-h {
  background: rgba(248, 81, 73, 0.12);
  color: var(--red);
  border-bottom: 2px solid var(--red);
}
.cash-quote-table .cash-quote-cols-row th {
  font-size: 9px;
  white-space: nowrap;
  padding: 3px 1px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cash-quote-table td {
  padding: 3px 1px;
  font-family: var(--font-mono);
  font-size: 9px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}
.cash-quote-table td.bid-cell { background: rgba(46, 160, 67, 0.04); }
.cash-quote-table td.ofr-cell { background: rgba(248, 81, 73, 0.04); }
.cash-quote-table td.empty-cell { color: var(--text-muted); cursor: default; }
.cash-quote-table td.quote-selected { outline: 1px solid var(--accent); background: rgba(88, 166, 255, 0.12) !important; }
.cash-quote-table tr.quote-row-selected { background: rgba(88, 166, 255, 0.06); }
.cash-quote-table .cash-quote-actions-h { width: 48px; min-width: 48px; font-size: 9px; }
.cash-quote-table .cash-quote-actions-col { cursor: default; overflow: visible; }
.cash-quote-table .cash-quote-actions {
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: flex-start;
}
.cash-quote-table .cash-quote-actions .btn-xs { font-size: 9px; padding: 1px 4px; line-height: 1.2; }
.cash-quote-detail-panel { margin-top: 12px; }
.cash-trade-table {
  table-layout: fixed;
  width: 100%;
  font-size: 10px;
}
.cash-trade-table th,
.cash-trade-table td {
  padding: 4px 2px;
  font-size: 9px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cash-trade-table td.trade-row-cell { cursor: pointer; }
.cash-trade-table td.trade-row-cell.trade-selected {
  outline: 1px solid var(--accent);
  background: rgba(88, 166, 255, 0.12);
}
.cash-trade-table .cash-trade-actions {
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: flex-start;
}
.cash-trade-table .cash-trade-actions .btn-xs { font-size: 9px; padding: 1px 4px; line-height: 1.2; }
.cash-trade-table .cash-trade-actions-col { cursor: default; overflow: visible; }
.quote-detail-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px 12px;
}
.quote-detail-item .field-label { font-size: 10px; color: var(--text-muted); }
.quote-detail-item .field-value { font-size: 12px; font-weight: 600; font-family: var(--font-mono); }
.quote-form-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px 16px;
}
@media (max-width: 900px) {
  .quote-form-grid { grid-template-columns: repeat(2, 1fr); }
  .quote-detail-grid { grid-template-columns: repeat(3, 1fr); }
}
.page-actions { display: flex; gap: 8px; align-items: center; }
.modal-section-title { font-size: 13px; margin: 12px 0 8px; color: var(--text-muted); font-weight: 600; }
.modal-section-title:first-child { margin-top: 0; }

/* 客户管理 */
.crm-tab-pane { margin-top: 12px; }
.crm-output-table-wrap { overflow-x: auto; }
.crm-output-table { font-size: 11px; }
.crm-output-table .crm-output-group-row th { text-align: center; background: var(--bg-tertiary); }
.crm-output-table td.crm-name-cell {
  font-weight: 600;
  cursor: pointer;
  color: var(--accent-hover);
  white-space: nowrap;
}
.crm-output-table tr.crm-row-active td.crm-name-cell { color: var(--accent); }
.crm-output-table tr.crm-row-active { background: var(--blue-bg); }
.crm-basic-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}
.crm-bond-history-grid .inner-panel { margin: 0; border: 1px solid var(--border); }
.crm-bond-history-grid .inner-panel .panel-header { padding: 8px 12px; }
.crm-bond-history-grid .inner-panel .panel-header h3 { font-size: 12px; }
.panel-header-actions { display: flex; align-items: center; gap: 10px; }

/* ===== 侧边栏抽屉 & 全端响应式 ===== */
@media (max-width: 992px) {
  .sidebar {
    position: fixed;
    top: var(--topbar-height);
    left: 0;
    bottom: 0;
    z-index: 90;
    width: min(var(--sidebar-width), 82vw);
    transform: translateX(-100%);
    box-shadow: 4px 0 24px var(--shadow-color);
  }
  body.sidebar-open .sidebar {
    transform: translateX(0);
    pointer-events: auto;
  }

  .main-content { padding: 16px; }
  .page-header { flex-direction: column; gap: 12px; align-items: flex-start; }
  .page-header h1 { font-size: 18px; }
  .panel-header { flex-wrap: wrap; gap: 10px; }
  .panel-actions { flex-wrap: wrap; }
  .stat-cards, .stat-cards.mini, .stat-cards-4, .stat-cards-5 {
    grid-template-columns: repeat(2, 1fr);
  }
  .smart-shortcuts { grid-template-columns: repeat(2, 1fr); }
  .topbar-center { display: none; }
  .topbar { gap: 12px; padding: 0 12px; }
  .user-info > span:not(.avatar) { display: none; }
}

@media (max-width: 768px) {
  :root { --topbar-height: 48px; }
  .logo-text { font-size: 13px; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .main-content { padding: 12px; }
  .page-header h1 { font-size: 16px; }
  .page-desc { font-size: 11px; }
  .role-badge { font-size: 10px; padding: 3px 8px; }
  .stat-cards, .stat-cards.mini, .stat-cards-4, .stat-cards-5,
  .smart-shortcuts, .profile-grid, .snapshot-grid,
  .alloc-form-row, .crm-basic-summary, .quote-form-grid {
    grid-template-columns: 1fr;
  }
  .position-metrics-row { grid-template-columns: 1fr !important; }
  .position-metrics-row .position-hero-card { grid-column: span 1 !important; }
  .workflow-steps { flex-wrap: nowrap; padding-bottom: 4px; }
  .step span:not(.step-num) { font-size: 10px; }
  .tab-bar { overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; }
  .tab-bar-item { flex-shrink: 0; }
  .panel-body.no-padding { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .table-scroll-wrap { max-width: 100%; }
  .modal {
    width: calc(100vw - 24px) !important;
    max-width: calc(100vw - 24px);
    max-height: calc(100vh - var(--topbar-height) - 24px);
    margin: 12px;
  }
  .modal.modal-lg { width: calc(100vw - 24px) !important; }
  .modal-body { padding: 14px; }
  .modal-footer { flex-wrap: wrap; gap: 8px; }
  .bid-line-row { flex-wrap: wrap; gap: 6px; }
  .bid-summary-item:nth-child(3) .bid-summary-val { max-width: 100%; }
  .alloc-form-row { grid-template-columns: 1fr; }
  .icon-btn { font-size: 16px; }
  .theme-switch { display: none; }
  .overview-detail-panel .panel-header,
  .overview-panel .panel-header { align-items: flex-start; }
  .detail-action-btns { flex-wrap: wrap; }
  .btn-sm { font-size: 11px; padding: 4px 8px; }
  .cash-quote-table, .cash-trade-table { font-size: 8px; }
  .quote-detail-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
  .logo-text { max-width: 100px; }
  .topbar-right { gap: 8px; }
  .stat-cards, .stat-cards.mini { grid-template-columns: 1fr; }
  .page-actions { width: 100%; flex-wrap: wrap; }
  .panel-actions { width: 100%; }
  .workflow-steps .step-line { min-width: 12px; }
  .nav-item { padding: 8px 16px; font-size: 13px; }
  .quote-detail-grid { grid-template-columns: 1fr; }
}

@media (min-width: 993px) and (max-width: 1200px) {
  .main-content { padding: 16px 18px; }
  .stat-cards.mini { grid-template-columns: repeat(2, 1fr); }
}
