/* ============================================================
   纳指 QDII 基金限购额度监测 - 全局样式
   ============================================================ */
:root {
  color-scheme: dark;
  --brand: #2962ff;
  --brand-dark: #1e53e5;
  --brand-light: rgba(41,98,255,.14);
  --success: #22ab94;
  --warning: #ffb020;
  --danger: #ff5b66;
  --neutral: #8b8f9e;
  --bg: #0b0f14;
  --surface: #111722;
  --surface-raised: #161c27;
  --surface-hover: #1a2230;
  --border: #242b38;
  --border-strong: #303848;
  --text: #c9d1dd;
  --text-strong: #f1f4f8;
  --text-muted: #7e8796;
  --radius: 6px;
  --shadow: none;
  --shadow-md: 0 12px 28px rgba(0,0,0,.32);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
}

/* ---- 布局 ---- */
.app-layout { display: flex; min-height: 100vh; }

.sidebar {
  width: 220px;
  background: #080d12;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: transform .2s;
}

.sidebar-logo {
  padding: 18px 16px 14px;
  border-bottom: 1px solid var(--border);
}
.sidebar-logo h1 { font-size: 14px; font-weight: 700; color: var(--text-strong); line-height: 1.32; letter-spacing: .01em; }
.sidebar-logo p { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

.sidebar-nav { flex: 1; padding: 12px 0; overflow-y: auto; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 16px;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 13px;
  border-radius: 0;
  transition: background .15s, color .15s;
  border: none; background: none; width: 100%; text-align: left;
}
.nav-item:hover { background: var(--surface-hover); color: var(--text-strong); }
.nav-item.active {
  background: linear-gradient(90deg, rgba(41,98,255,.18), rgba(41,98,255,.04));
  color: var(--text-strong);
  font-weight: 600;
  border-left: 2px solid var(--brand);
  padding-left: 14px;
}
.nav-item .icon { font-size: 14px; width: 20px; text-align: center; color: var(--text-muted); }
.nav-item.active .icon { color: var(--brand); }

.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-muted);
}
.sidebar-footer .user-email { font-weight: 500; color: var(--text-strong); margin-bottom: 6px; word-break: break-all; }

.main-content {
  margin-left: 220px;
  flex: 1;
  min-width: 0;
  padding: 18px 22px;
  min-height: 100vh;
}

/* ---- 页面标题 ---- */
.page-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}
.page-title { font-size: 20px; font-weight: 700; color: var(--text-strong); }
.page-subtitle { font-size: 13px; color: var(--text-muted); margin-top: 2px; }

/* ---- 卡片 ---- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px;
  margin-bottom: 12px;
}
.card-title { font-size: 14px; font-weight: 600; margin-bottom: 12px; color: var(--text-strong); }

/* ---- 状态标签 ---- */
.badge {
  display: inline-flex; align-items: center;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.badge-normal { background: rgba(34,171,148,.16); color: #4dd9c5; }
.badge-limited { background: rgba(245,166,35,.16); color: #ffcf70; }
.badge-suspended { background: rgba(255,91,102,.12); color: #ff8a93; }
.badge-manual { background: rgba(41,98,255,.16); color: #7ea1ff; }
.badge-crawler { background: rgba(8,145,178,.16); color: #67e8f9; }

/* ---- 表格 ---- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th {
  text-align: left; padding: 8px 10px;
  font-size: 11px; font-weight: 600;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
td {
  padding: 10px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  vertical-align: middle;
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--surface-hover); }

/* ---- 按钮 ---- */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 11px;
  border-radius: var(--radius);
  font-size: 13px; font-weight: 500;
  cursor: pointer; border: none;
  transition: opacity .15s, transform .1s;
  text-decoration: none;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { opacity: .9; }
.btn-secondary { background: var(--surface-raised); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--surface-hover); color: var(--text-strong); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { opacity: .9; }
.btn-sm { padding: 4px 8px; font-size: 12px; }
.btn-icon { padding: 6px 8px; }

/* ---- 表单 ---- */
.form-group { margin-bottom: 14px; }
.form-label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 5px; }
.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
  background: #0b0f14;
  color: var(--text);
  transition: border-color .15s;
  outline: none;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px rgba(41,98,255,.2);
}
.form-hint { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.form-row { display: flex; gap: 12px; }
.form-row .form-group { flex: 1; }

/* ---- 通知 ---- */
.toast-container {
  position: fixed; top: 16px; right: 16px;
  z-index: 9999;
  display: flex; flex-direction: column; gap: 8px;
}
.toast {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 12px 16px;
  font-size: 13px;
  max-width: 320px;
  animation: slideIn .2s ease;
}
.toast-success { border-left: 3px solid var(--success); }
.toast-error { border-left: 3px solid var(--danger); }
.toast-info { border-left: 3px solid var(--brand); }
.toast-warning { border-left: 3px solid var(--warning); }
@keyframes slideIn { from { transform: translateX(20px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---- 空状态 ---- */
.empty-state {
  text-align: center; padding: 48px 24px;
  color: var(--text-muted);
}
.empty-state .icon { font-size: 34px; margin-bottom: 10px; }
.empty-state p { font-size: 14px; }

/* ---- 加载 ---- */
.loading { text-align: center; padding: 32px; color: var(--text-muted); }
.spinner {
  display: inline-block; width: 20px; height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin .6s linear infinite;
  vertical-align: middle; margin-right: 8px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- 额度数值 ---- */
.quota-value {
  font-size: 15px; font-weight: 700;
}
.quota-value.suspended { color: #ff8a93; }
.quota-value.limited { color: var(--warning); }
.quota-value.normal { color: var(--success); }

/* ---- 看板网格 ---- */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}
.fund-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px;
  transition: border-color .15s, background .15s;
}
.fund-card:hover { background: #171b26; border-color: var(--border-strong); }
.fund-card-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 10px; }
.fund-title-block { min-width: 0; flex: 1; }
.fund-name-primary {
  color: var(--text-strong);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
  word-break: break-word;
}
.fund-name-secondary {
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.35;
  word-break: break-word;
}
.fund-code-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
}
.fund-code { font-size: 12px; font-weight: 700; color: var(--text-muted); letter-spacing: .02em; }
.copy-code-btn {
  padding: 2px 6px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #0b0f14;
  color: var(--text-muted);
  font-size: 11px;
  cursor: pointer;
}
.copy-code-btn:hover {
  border-color: var(--brand);
  color: var(--brand);
}
.fund-name { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.fund-quota { font-size: 24px; font-weight: 800; margin: 10px 0 6px; letter-spacing: .01em; }
.fund-meta { font-size: 11px; color: var(--text-muted); }
.fund-actions { display: flex; gap: 6px; margin-top: 10px; }

/* ---- 行情表 ---- */
.market-board {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.02);
}
.market-table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
}
.market-table {
  min-width: 1040px;
  table-layout: fixed;
}
.market-table th:nth-child(1), .market-table td:nth-child(1) { width: 30%; }
.market-table th:nth-child(2), .market-table td:nth-child(2) { width: 18%; }
.market-table th:nth-child(3), .market-table td:nth-child(3) { width: 10%; }
.market-table th:nth-child(4), .market-table td:nth-child(4) { width: 12%; }
.market-table th:nth-child(5), .market-table td:nth-child(5) { width: 14%; }
.market-table th:nth-child(6), .market-table td:nth-child(6) { width: 16%; }
.market-table th {
  height: 32px;
  padding: 0;
  background: #0d121b;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.market-table td {
  height: 48px;
  padding: 6px 14px;
  border-bottom: 1px solid rgba(36,43,56,.72);
}
.market-table tbody tr:last-child td {
  border-bottom: none;
}
.market-row:hover td {
  background: rgba(41,98,255,.045);
}
.market-sort-btn {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 4px;
  width: 100%;
  height: 32px;
  padding: 0 14px;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  cursor: pointer;
}
.is-right .market-sort-btn {
  justify-content: flex-end;
}
.market-sort-btn:hover,
.market-sort-btn.is-active {
  color: var(--text-strong);
}
.market-sort-arrow {
  color: var(--text-muted);
  font-size: 10px;
  line-height: 1;
  opacity: .78;
}
.market-sort-btn.is-active .market-sort-arrow {
  color: var(--brand);
  opacity: 1;
}
.is-right {
  text-align: right;
}
.market-symbol {
  min-width: 0;
}
.market-symbol-name {
  color: var(--text-strong);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.market-symbol-sub {
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.market-symbol-code {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
  color: var(--text-muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
}
.market-link-btn,
.market-action-btn {
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 11px;
  padding: 0;
}
.market-link-btn:hover,
.market-action-btn:hover {
  color: var(--brand);
}
.market-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
}
.market-status span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--neutral);
}
.market-status.normal span { background: var(--success); }
.market-status.limited span { background: var(--warning); }
.market-status.suspended span { background: #c4525d; }
.market-status.unknown { color: var(--text-muted); }
.market-quota {
  display: inline-block;
  font-variant-numeric: tabular-nums;
  font-size: 15px;
  font-weight: 750;
}
.market-quota.normal { color: var(--success); }
.market-quota.limited { color: var(--warning); }
.market-quota.muted,
.market-muted {
  color: var(--text-muted);
}
.market-source {
  display: inline-flex;
  align-items: center;
  margin-left: 8px;
  padding: 1px 5px;
  border: 1px solid rgba(41,98,255,.25);
  border-radius: 4px;
  color: #7ea1ff;
  font-size: 11px;
}
.market-source.manual {
  color: #7ea1ff;
}
.market-actions {
  display: inline-flex;
  justify-content: flex-end;
  gap: 12px;
}
.sparkline-cell {
  padding-top: 4px;
  padding-bottom: 4px;
}
.market-sparkline {
  --sparkline-color: var(--neutral);
  --sparkline-fill: rgba(139,143,158,.12);
  display: grid;
  grid-template-columns: minmax(86px, 1fr) 54px;
  align-items: center;
  gap: 9px;
  min-height: 34px;
}
.market-sparkline.is-positive {
  --sparkline-color: var(--success);
  --sparkline-fill: rgba(34,171,148,.12);
}
.market-sparkline.is-negative {
  --sparkline-color: var(--danger);
  --sparkline-fill: rgba(255,91,102,.10);
}
.market-sparkline.is-flat {
  --sparkline-color: #9aa3b2;
  --sparkline-fill: rgba(154,163,178,.10);
}
.market-sparkline-svg {
  display: block;
  width: 100%;
  height: 32px;
  min-width: 86px;
}
.market-sparkline-fill {
  fill: var(--sparkline-fill);
}
.market-sparkline-path {
  fill: none;
  stroke: var(--sparkline-color);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.market-sparkline-zero {
  stroke: rgba(126,135,150,.22);
  stroke-width: 1;
  stroke-dasharray: 3 4;
}
.market-sparkline-dot {
  fill: var(--sparkline-color);
  stroke: #0b0f14;
  stroke-width: 1;
}
.market-sparkline-value {
  color: var(--sparkline-color);
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}
.market-sparkline.is-loading .market-sparkline-value,
.market-sparkline.is-empty .market-sparkline-value {
  color: var(--text-muted);
  font-weight: 600;
}
.market-sparkline-loader,
.market-sparkline-empty-line {
  display: block;
  height: 1px;
  width: 100%;
  background: linear-gradient(90deg, transparent, rgba(126,135,150,.35), transparent);
}
.market-sparkline-loader {
  animation: sparklinePulse 1.2s ease-in-out infinite;
}
@keyframes sparklinePulse {
  0%, 100% { opacity: .35; }
  50% { opacity: .85; }
}
.market-snapshot {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0;
  width: 100%;
  max-width: 100%;
  margin-bottom: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #0d121b;
  overflow: hidden;
}
.market-snapshot[hidden] {
  display: none;
}
.market-snapshot-item {
  min-width: 0;
  padding: 8px 12px;
  border-right: 1px solid var(--border);
}
.market-snapshot-item:last-child {
  border-right: 0;
}
.market-snapshot-label {
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.2;
}
.market-snapshot-main {
  margin-top: 3px;
  color: var(--text-strong);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.market-snapshot-value {
  margin-top: 2px;
  font-size: 13px;
  font-weight: 760;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}
.market-snapshot-value.positive { color: var(--success); }
.market-snapshot-value.negative { color: var(--danger); }
.market-snapshot-value.warning { color: var(--warning); }
.market-snapshot-value.danger { color: var(--danger); }
.market-snapshot-value.neutral { color: var(--text-muted); }

/* ---- 历史时间轴 ---- */
.timeline { position: relative; padding-left: 20px; }
.timeline::before {
  content: ''; position: absolute; left: 6px; top: 0; bottom: 0;
  width: 2px; background: var(--border);
}
.timeline-item { position: relative; margin-bottom: 16px; }
.timeline-dot {
  position: absolute; left: -17px; top: 4px;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--brand);
  border: 2px solid var(--surface);
}
.timeline-dot.suspended { background: var(--danger); }
.timeline-dot.limited { background: var(--warning); }
.timeline-dot.normal { background: var(--success); }
.timeline-content { background: var(--surface-raised); border-radius: var(--radius); padding: 10px 12px; }
.timeline-date { font-size: 11px; color: var(--text-muted); margin-bottom: 4px; }
.timeline-text { font-size: 13px; }

/* ---- 对比视图 ---- */
.compare-bar-wrap { margin-bottom: 8px; }
.compare-bar-label { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 3px; }
.compare-bar-track { height: 8px; background: var(--bg); border-radius: 4px; overflow: hidden; }
.compare-bar-fill { height: 100%; border-radius: 4px; transition: width .4s; }
.compare-bar-fill.normal { background: var(--success); }
.compare-bar-fill.limited { background: var(--warning); }
.compare-bar-fill.suspended { background: var(--danger); }

/* ---- 业绩走势 ---- */
.performance-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 18px;
}
.performance-control-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.performance-fund-picker {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px;
}
.performance-fund-option {
  display: grid;
  grid-template-columns: 16px 10px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  background: #0b0f14;
}
.performance-fund-option.is-active {
  border-color: var(--brand);
  background: var(--brand-light);
}
.performance-fund-option input {
  width: 14px;
  height: 14px;
}
.performance-color-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex: none;
}
.performance-fund-text {
  min-width: 0;
  display: grid;
  gap: 1px;
}
.performance-fund-text strong {
  font-size: 12px;
  line-height: 1.2;
}
.performance-fund-text span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  color: var(--text-muted);
}
.performance-range-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.performance-range-btn {
  min-width: 72px;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #0b0f14;
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
}
.performance-range-btn.is-active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}
.performance-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.performance-summary-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px;
}
.performance-summary-top {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}
.performance-summary-name {
  min-height: 34px;
  margin-top: 6px;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.4;
}
.performance-summary-return {
  margin-top: 8px;
  font-size: 24px;
  font-weight: 800;
  color: var(--neutral);
}
.performance-summary-return.is-positive { color: var(--success); }
.performance-summary-return.is-negative { color: var(--danger); }
.performance-summary-meta {
  margin-top: 2px;
  font-size: 11px;
  color: var(--text-muted);
}
.performance-chart-card {
  overflow: hidden;
}
.performance-chart-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.performance-chart-head .card-title {
  margin-bottom: 2px;
}
.performance-chart-meta {
  font-size: 12px;
  color: var(--text-muted);
}
.performance-chart-wrap {
  width: 100%;
  overflow-x: auto;
}
.performance-chart {
  display: block;
  min-width: 760px;
  width: 100%;
  height: auto;
}
.performance-grid-line {
  stroke: var(--border);
  stroke-width: 1;
}
.performance-zero-line {
  stroke: var(--text-muted);
  stroke-width: 1;
  stroke-dasharray: 4 4;
  opacity: .65;
}
.performance-axis-label {
  fill: var(--text-muted);
  font-size: 11px;
}
.performance-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}
.performance-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
}
.performance-error-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  color: var(--danger);
  font-size: 12px;
}

/* ---- 通知徽章 ---- */
.notif-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px;
  background: var(--danger); color: #fff;
  border-radius: 9px; font-size: 10px; font-weight: 700;
  padding: 0 4px;
}

/* ---- 认证页 ---- */
.auth-page {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at top, #1e2433 0%, #0f131a 52%, #080b10 100%);
}
.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 20px 40px rgba(0,0,0,.15);
  padding: 36px 32px;
  width: 100%; max-width: 400px;
}
.auth-logo { text-align: center; margin-bottom: 24px; }
.auth-logo h1 { font-size: 20px; font-weight: 800; color: var(--text-strong); }
.auth-logo p { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.auth-tabs { display: flex; border-bottom: 1px solid var(--border); margin-bottom: 20px; }
.auth-tab {
  flex: 1; padding: 10px; text-align: center;
  cursor: pointer; font-size: 14px; font-weight: 500;
  color: var(--text-muted); border-bottom: 2px solid transparent;
  transition: color .15s, border-color .15s;
  background: none; border-top: none; border-left: none; border-right: none;
}
.auth-tab.active { color: var(--brand); border-bottom-color: var(--brand); }
.auth-error { background: rgba(242,54,69,.16); color: #ff7b86; border: 1px solid rgba(242,54,69,.3); padding: 10px 12px; border-radius: var(--radius); font-size: 13px; margin-bottom: 12px; }

/* ---- 响应式 ---- */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: none; }
  .main-content { margin-left: 0; padding: 16px; }
  .page-header { flex-direction: column; align-items: stretch; }
  .page-header > div:last-child { justify-content: flex-end; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .form-row { flex-direction: column; }
  .performance-controls { grid-template-columns: 1fr; }
  .performance-fund-picker { grid-template-columns: 1fr; }
  .market-snapshot { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .market-snapshot-item:nth-child(2n) { border-right: 0; }
  .market-snapshot-item:nth-child(n+3) { border-top: 1px solid var(--border); }
  .dashboard-toolbar { align-items: stretch; flex-direction: column; }
  .dashboard-toolbar-group { flex-direction: column; align-items: stretch; }
  .dashboard-toolbar-side { align-items: stretch; justify-content: space-between; }
  .dashboard-search, .dashboard-filter { max-width: none; width: 100%; }
  .mobile-menu-btn { display: flex !important; }
}

.mobile-menu-btn {
  display: none;
  position: fixed; top: 12px; left: 12px;
  z-index: 200;
  background: var(--surface-raised); color: var(--text-strong);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 10px; cursor: pointer; font-size: 18px;
}

/* ---- 分隔线 ---- */
.divider { height: 1px; background: var(--border); margin: 16px 0; }

/* ---- 统计数字 ---- */
.stat-row { display: flex; gap: 0; margin-bottom: 10px; flex-wrap: wrap; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.stat-card {
  flex: 1; min-width: 120px;
  background: transparent;
  border: none;
  border-right: 1px solid var(--border);
  border-radius: 0;
  padding: 8px 12px;
  text-align: left;
  cursor: pointer;
  color: inherit;
  transition: background .15s, box-shadow .15s;
}
.stat-card:last-child { border-right: none; }
.stat-card:hover,
.stat-card.is-active {
  background: rgba(41,98,255,.06);
  box-shadow: inset 0 2px 0 rgba(41,98,255,.65);
}
.stat-value { font-size: 18px; line-height: 1.05; font-weight: 760; color: var(--brand); }
.stat-label { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* ---- 工作台工具条 ---- */
.dashboard-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  padding: 8px;
  background: #0d121b;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.dashboard-toolbar[hidden] { display: none; }
.dashboard-toolbar-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}
.dashboard-toolbar-side {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
}
.dashboard-search {
  max-width: 360px;
}
.dashboard-filter {
  width: auto;
  min-width: 136px;
}
.dashboard-toolbar-meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  font-size: 12px;
  white-space: nowrap;
}
.dashboard-toolbar-meta span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 7px;
  border: 1px solid rgba(126,135,150,.18);
  border-radius: 4px;
  background: rgba(11,15,20,.62);
}
.dashboard-range-tabs {
  display: inline-flex;
  align-items: center;
  padding: 2px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #0b0f14;
}
.dashboard-range-btn {
  min-width: 38px;
  height: 24px;
  padding: 0 8px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
}
.dashboard-range-btn:hover {
  color: var(--text-strong);
}
.dashboard-range-btn.is-active {
  background: var(--surface-hover);
  color: var(--text-strong);
  box-shadow: inset 0 0 0 1px rgba(41,98,255,.32);
}
.dashboard-sort-reset {
  height: 30px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #0b0f14;
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
}
.dashboard-sort-reset:hover,
.dashboard-sort-reset.is-active {
  color: var(--text-strong);
  border-color: rgba(41,98,255,.45);
  background: rgba(41,98,255,.10);
}

/* ---- 模态框 ---- */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.68);
  z-index: 500;
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 20px 40px rgba(0,0,0,.2);
  padding: 24px;
  width: 100%; max-width: 480px;
  max-height: 90vh; overflow-y: auto;
}
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.modal-title { font-size: 16px; font-weight: 700; }
.modal-close { background: none; border: none; font-size: 20px; cursor: pointer; color: var(--text-muted); padding: 0 4px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }

/* ---- 切换开关 ---- */
.toggle-wrap { display: flex; align-items: center; gap: 10px; }
.toggle {
  position: relative; width: 40px; height: 22px;
  cursor: pointer;
}
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; inset: 0;
  background: var(--border); border-radius: 11px;
  transition: background .2s;
}
.toggle-slider::before {
  content: ''; position: absolute;
  width: 16px; height: 16px;
  left: 3px; top: 3px;
  background: #fff; border-radius: 50%;
  transition: transform .2s;
}
.toggle input:checked + .toggle-slider { background: var(--brand); }
.toggle input:checked + .toggle-slider::before { transform: translateX(18px); }

/* ---- 一键导入弹窗 ---- */
.import-controls {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 0; border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
}
.import-hint { font-size: 12px; color: var(--text-muted); margin-left: auto; }
.import-fund-list {
  max-height: 360px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 6px;
}
.import-fund-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 6px;
  border: 1px solid var(--border); cursor: pointer;
  transition: background .15s, border-color .15s;
}
.import-fund-item:hover { background: var(--surface-hover); }
.import-fund-item.is-added {
  opacity: .55; cursor: not-allowed;
  background: var(--surface-raised);
}
.import-checkbox {
  width: 16px; height: 16px; accent-color: var(--brand);
  cursor: pointer; flex-shrink: 0;
}
.import-fund-item.is-added .import-checkbox { cursor: not-allowed; }
.import-fund-code {
  font-weight: 700; font-size: 14px; color: var(--text-strong);
  min-width: 60px;
}
.import-fund-name {
  font-size: 13px; color: var(--text-muted); flex: 1;
}
