/* ==========================================
   锦程财经 - 小锦的智能财富管家
   配色：中国股市红涨绿跌
   ========================================== */

:root {
  --bg-primary: #f0f2f5;
  --bg-sidebar: #0f1923;
  --bg-sidebar-hover: #1a2d3d;
  --bg-card: #ffffff;
  --bg-table-header: #f7f8fa;
  --bg-table-row-hover: #f0f4ff;
  --text-primary: #1a1a2e;
  --text-secondary: #6b7280;
  --text-muted: #9ca3af;
  --text-sidebar: #a0b4c8;
  --text-sidebar-active: #ffffff;
  --color-up: #e83939;
  --color-up-bg: #fef2f2;
  --color-down: #39b54a;
  --color-down-bg: #f0fdf4;
  --color-accent: #4a90d9;
  --color-accent-light: #e8f0fe;
  --color-gold: #d4a843;
  --color-gold-bg: #fefce8;
  --border-color: #e5e7eb;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --sidebar-width: 220px;
  --transition: 0.2s ease;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  display: flex;
  min-height: 100vh;
}

/* ========== 侧边栏 ========== */
.sidebar {
  width: var(--sidebar-width);
  min-height: 100vh;
  background: var(--bg-sidebar);
  color: var(--text-sidebar);
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0; top: 0; bottom: 0;
  z-index: 100;
  overflow-y: auto;
}

.sidebar-header {
  padding: 24px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.logo-icon {
  width: 38px; height: 38px;
  background: linear-gradient(135deg, var(--color-accent), #6366f1);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: bold;
  color: #fff;
}

.logo-text {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-sidebar-active);
  letter-spacing: 2px;
}

.sidebar-tagline {
  font-size: 12px;
  color: var(--text-muted);
  margin-left: 48px;
}

.sidebar-nav {
  flex: 1;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-sidebar);
  text-decoration: none;
  font-size: 15px;
  transition: all var(--transition);
  cursor: pointer;
}

.nav-item:hover {
  background: var(--bg-sidebar-hover);
  color: var(--text-sidebar-active);
}

.nav-item.active {
  background: var(--color-accent);
  color: #fff;
  font-weight: 600;
}

.nav-icon { font-size: 18px; width: 20px; text-align: center; }

.sidebar-footer {
  padding: 14px 20px;
  border-top: 1px solid rgba(255,255,255,0.08);
  font-size: 12px;
}

.update-time {
  color: var(--text-sidebar-active);
  font-size: 14px;
  font-family: 'Courier New', monospace;
}

.update-status {
  color: var(--text-muted);
  margin-top: 2px;
  font-size: 12px;
}

.update-status.live { color: var(--color-down); }

.backup-tools {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.backup-btn {
  flex: 1;
  padding: 7px 4px;
  font-size: 12px;
  color: var(--text-sidebar-active);
  background: rgba(74,144,217,0.18);
  border: 1px solid rgba(74,144,217,0.45);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.backup-btn:hover {
  background: rgba(74,144,217,0.38);
  border-color: var(--color-accent);
}

/* ========== 主内容区 ========== */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  padding: 24px 28px;
  max-width: calc(100vw - var(--sidebar-width));
  overflow-x: hidden;
}

.view { display: none; }
.view.active { display: block; animation: fadeIn 0.3s ease; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ========== 页面头部 ========== */
.page-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.page-header h1 {
  font-size: 26px;
  font-weight: 700;
  color: var(--text-primary);
}

.page-date {
  font-size: 14px;
  color: var(--text-muted);
  margin-left: auto;
}

.header-actions {
  display: flex;
  gap: 10px;
  margin-left: auto;
}

.filter-select, .search-input {
  padding: 8px 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 14px;
  background: var(--bg-card);
  color: var(--text-primary);
  outline: none;
  transition: border var(--transition);
}

.filter-select:focus, .search-input:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px var(--color-accent-light);
}

.search-input { width: 200px; }
.search-input::placeholder { color: var(--text-muted); }

.back-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 14px;
  color: var(--text-secondary);
  transition: all var(--transition);
  white-space: nowrap;
}

.back-btn:hover {
  color: var(--color-accent);
  border-color: var(--color-accent);
}

.fund-code-badge, .stock-code-badge {
  background: var(--color-accent-light);
  color: var(--color-accent);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
}

/* 数据来源标识 */
.data-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  margin-left: 8px;
}
.data-badge.real {
  background: #e6f7e6;
  color: #1a7a1a;
  border: 1px solid #b7e4b7;
}
.data-badge.sim {
  background: #fff3e0;
  color: #e65100;
  border: 1px solid #ffcc80;
}

/* ========== 概览卡片 ========== */
.overview-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

.overview-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: var(--shadow-sm);
  border: 1px solid transparent;
}

.overview-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.card-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.card-stocks .card-icon { background: #fef2f2; color: var(--color-up); }
.card-funds .card-icon { background: #e8f0fe; color: var(--color-accent); }
.card-gold .card-icon { background: #fefce8; color: var(--color-gold); }

.card-label {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.card-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.card-change {
  font-size: 14px;
  font-weight: 600;
}

.card-change.up { color: var(--color-up); }
.card-change.down { color: var(--color-down); }
.card-change.muted { color: var(--text-muted); font-weight: normal; }

/* ========== 迷你图表 ========== */
.mini-charts {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

.mini-chart-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  box-shadow: var(--shadow-sm);
}

.mini-chart-card h3 {
  font-size: 15px;
  color: var(--text-secondary);
  margin-bottom: 10px;
  font-weight: 600;
}

.mini-chart-container {
  width: 100%;
  height: 260px;
}

/* ========== 排行榜 ========== */
.rank-section {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.rank-panel {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  box-shadow: var(--shadow-sm);
}

.rank-title {
  font-size: 15px;
  margin-bottom: 12px;
  font-weight: 600;
}

.up-title { color: var(--color-up); }
.down-title { color: var(--color-down); }

.rank-list { display: flex; flex-direction: column; gap: 8px; }

.rank-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
  cursor: pointer;
}

.rank-item:hover { background: var(--bg-table-row-hover); }

.rank-item-left { display: flex; align-items: center; gap: 10px; }

.rank-num {
  width: 22px; height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  background: var(--bg-primary);
  color: var(--text-muted);
}

.rank-num.top { background: #fef2f2; color: var(--color-up); }

.rank-name { font-size: 14px; font-weight: 500; }
.rank-code { font-size: 12px; color: var(--text-muted); }
.rank-change {
  font-size: 14px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
}

.rank-change.up { color: var(--color-up); background: var(--color-up-bg); }
.rank-change.down { color: var(--color-down); background: var(--color-down-bg); }

/* ========== 数据表格 ========== */
.table-container {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  overflow-x: auto;
  box-shadow: var(--shadow-sm);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.data-table thead {
  background: var(--bg-table-header);
}

.data-table th {
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
  border-bottom: 2px solid var(--border-color);
}

.data-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

/* 排序表头 */
.data-table th.sortable { cursor: pointer; user-select: none; transition: color 0.2s; }
.data-table th.sortable:hover { color: var(--color-accent); }
.data-table th.sorted-desc { color: var(--color-accent); font-weight: 700; }
.data-table th.sorted-asc  { color: var(--color-accent); font-weight: 700; }
.data-table th.sorted-desc::after { content: ' ▼'; font-size: 11px; }
.data-table th.sorted-asc::after  { content: ' ▲'; font-size: 11px; }

.data-table tbody tr {
  transition: background var(--transition);
}

.data-table tbody tr:hover {
  background: var(--bg-table-row-hover);
}

.data-table tbody tr.clickable { cursor: pointer; }

.data-table .up { color: var(--color-up); font-weight: 600; }
.data-table .down { color: var(--color-down); font-weight: 600; }

.detail-btn {
  padding: 5px 12px;
  background: var(--color-accent);
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  transition: opacity var(--transition);
}

.detail-btn:hover { opacity: 0.85; }

.action-td { white-space: nowrap; }
.action-td .detail-btn { margin-right: 4px; }

.delete-btn {
  padding: 5px 10px;
  background: #fdeaea;
  color: #e74c3c;
  border: 1px solid #f5c6c6;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.2s;
}
.delete-btn:hover {
  background: #e74c3c;
  color: #fff;
  border-color: #e74c3c;
}

/* ========== 基金详情 ========== */
.fund-info-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.fund-info-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  text-align: center;
}

.fund-info-card .fic-label {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.fund-info-card .fic-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.fund-info-card .fic-sub {
  font-size: 13px;
}

.fund-info-card .fic-sub.up { color: var(--color-up); }
.fund-info-card .fic-sub.down { color: var(--color-down); }

.detail-chart-section {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}

.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.chart-header h3 {
  font-size: 17px;
  font-weight: 600;
  color: var(--text-primary);
}

.chart-period-btns { display: flex; gap: 4px; }

.period-btn {
  padding: 4px 12px;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-secondary);
  transition: all var(--transition);
}

.period-btn:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.period-btn.active {
  background: var(--color-accent);
  color: #fff;
  border-color: var(--color-accent);
}

.chart-container {
  width: 100%;
  height: 420px;
}

.chart-sm {
  height: 250px;
}

/* ========== 分析指标 ========== */
.analysis-section {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}

.analysis-section h3 {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 14px;
  color: var(--text-primary);
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.metric-card {
  padding: 14px;
  background: var(--bg-primary);
  border-radius: var(--radius-sm);
  text-align: center;
}

.metric-label {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.metric-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
}

.metric-value.up { color: var(--color-up); }
.metric-value.down { color: var(--color-down); }

.metric-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ========== 股票行情卡片 ========== */
.stock-quote-cards {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.stock-quote-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 14px;
  box-shadow: var(--shadow-sm);
  text-align: center;
}

.stock-quote-card .sqc-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.stock-quote-card .sqc-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
}

.stock-quote-card .sqc-value.up { color: var(--color-up); }
.stock-quote-card .sqc-value.down { color: var(--color-down); }

.stock-quote-card.main-price .sqc-value { font-size: 30px; }

/* ========== 量化信号 ========== */
.signal-section {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.section-header h3 {
  font-size: 17px;
  font-weight: 600;
  color: var(--text-primary);
}

.signal-summary {
  font-size: 14px;
  font-weight: 600;
  padding: 4px 14px;
  border-radius: 20px;
}

.signal-summary.bullish { background: var(--color-up-bg); color: var(--color-up); }
.signal-summary.bearish { background: var(--color-down-bg); color: var(--color-down); }
.signal-summary.neutral { background: var(--bg-primary); color: var(--text-secondary); }

.signal-cards {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.signal-card {
  padding: 14px;
  border-radius: var(--radius-sm);
  text-align: center;
  border: 1px solid var(--border-color);
}

.signal-card.buy {
  background: var(--color-up-bg);
  border-color: #fecaca;
}

.signal-card.sell {
  background: var(--color-down-bg);
  border-color: #bbf7d0;
}

.signal-card.hold {
  background: var(--bg-primary);
  border-color: var(--border-color);
}

.signal-card .sig-name {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.signal-card .sig-value {
  font-size: 17px;
  font-weight: 700;
}

.signal-card .sig-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

.signal-card.buy .sig-value { color: var(--color-up); }
.signal-card.sell .sig-value { color: var(--color-down); }
.signal-card.hold .sig-value { color: var(--text-secondary); }

.signal-card .sig-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  margin-top: 4px;
}

.sig-badge.buy { background: var(--color-up); color: #fff; }
.sig-badge.sell { background: var(--color-down); color: #fff; }
.sig-badge.hold { background: var(--text-muted); color: #fff; }

.signal-history { margin-top: 10px; }
.signal-history h4 { font-size: 14px; font-weight: 600; margin-bottom: 10px; color: var(--text-secondary); }

/* 小白解读面板 */
.interpretation-box {
  background: linear-gradient(135deg, #f0f4ff, #f8fafd);
  border: 1px solid #c8d6e5;
  border-radius: 10px;
  padding: 18px 20px;
  margin: 16px 0;
}
.interp-title {
  font-size: 15px;
  font-weight: 700;
  color: #3867d6;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid #dfe6e9;
}
.interp-body { font-size: 14px; line-height: 1.7; color: var(--text-primary); }
.interp-body p { margin: 6px 0; }
.interp-body strong { color: var(--text-primary); }

/* ========== 伦敦金 ========== */
.gold-quote-panel {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 24px 28px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 24px;
}

.gold-price-main { text-align: center; }

.gold-current-price {
  font-size: 45px;
  font-weight: 800;
  color: var(--color-gold);
  font-family: 'Courier New', monospace;
}

.gold-change-group { margin-top: 6px; }

.gold-change-val, .gold-change-pct {
  font-size: 17px;
  font-weight: 600;
  margin: 0 6px;
}

.gold-change-val.up, .gold-change-pct.up { color: var(--color-up); }
.gold-change-val.down, .gold-change-pct.down { color: var(--color-down); }

.gold-details {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px 32px;
}

.gold-detail-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.detail-label { font-size: 13px; color: var(--text-muted); }
.detail-value { font-size: 18px; font-weight: 600; color: var(--text-primary); }
.up-color { color: var(--color-up); }
.down-color { color: var(--color-down); }

/* ========== 自选为空 / 列表为空提示 ========== */
.star-btn {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #d1d5db;
  transition: all 0.2s ease;
  padding: 4px 8px;
  line-height: 1;
  margin-left: auto;
}

.star-btn:hover {
  color: #f59e0b;
  transform: scale(1.15);
}

.star-btn.starred {
  color: #f59e0b;
}

.star-btn.starred:hover {
  color: #d97706;
}

/* 表格中的星标 */
.star-td {
  text-align: center;
  cursor: pointer;
  font-size: 20px;
  color: #d1d5db;
  transition: all 0.2s ease;
}

.star-td:hover {
  color: #f59e0b;
  transform: scale(1.2);
}

.star-td.starred {
  color: #f59e0b;
}

/* ========== 自选为空 ========== */
.wl-empty {
  text-align: center;
  padding: 60px 20px;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.wl-empty-icon {
  font-size: 51px;
  margin-bottom: 16px;
}

.wl-empty h3 {
  font-size: 20px;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.wl-empty p {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.wl-empty-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.action-btn {
  padding: 8px 20px;
  background: var(--color-accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 14px;
  transition: opacity var(--transition);
}

.action-btn:hover { opacity: 0.85; }

.action-btn.primary {
  background: #f59e0b;
  color: #fff;
}

/* 信号灯（通用） */
.signal-light {
  width: 16px; height: 16px;
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(0,0,0,0.15);
  animation: pulse-light 2s infinite;
}

.signal-light.green {
  background: #39b54a;
  box-shadow: 0 0 10px rgba(57,181,74,0.5);
}

.signal-light.yellow {
  background: #f59e0b;
  box-shadow: 0 0 10px rgba(245,158,11,0.5);
}

.signal-light.red {
  background: #e83939;
  box-shadow: 0 0 10px rgba(232,57,57,0.5);
}

@keyframes pulse-light {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.signal-text {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

/* 风险等级 */
.risk-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 700;
}

.risk-low { background: #d1fae5; color: #065f46; }
.risk-mid { background: #fef3c7; color: #92400e; }
.risk-high { background: #fee2e2; color: #991b1b; }

/* ========== 导入弹窗 ========== */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.45);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal-overlay.active {
  display: flex;
}

.modal-dialog {
  background: #fff;
  border-radius: 12px;
  width: 460px;
  max-width: 92vw;
  box-shadow: 0 16px 48px rgba(0,0,0,0.18);
  animation: modal-in 0.25s ease;
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(-16px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.modal-close {
  background: none;
  border: none;
  font-size: 20px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.2s;
}

.modal-close:hover {
  color: var(--text-primary);
  background: var(--bg-primary);
}

.modal-body {
  padding: 20px 24px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
}

.modal-btn {
  padding: 8px 24px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
}

.modal-btn.cancel {
  background: var(--bg-primary);
  color: var(--text-secondary);
}

.modal-btn.cancel:hover {
  background: var(--border-color);
}

.modal-btn.confirm {
  background: var(--color-accent);
  color: #fff;
}

.modal-btn.confirm:hover {
  opacity: 0.85;
}

.modal-btn.confirm:disabled {
  background: #d1d5db;
  cursor: not-allowed;
  opacity: 0.6;
}

.modal-btn.primary { background: var(--color-accent); color: #fff; }
.modal-btn.primary:hover { opacity: 0.85; }
.modal-btn.danger { background: #e2574c; color: #fff; }
.modal-btn.danger:hover { opacity: 0.85; }

/* 导入类型切换 */
.import-type-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
}

.import-type-tab {
  flex: 1;
  padding: 10px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--border-color);
  background: #fff;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  text-align: center;
  transition: all 0.2s;
}

.import-type-tab:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.import-type-tab.active {
  border-color: var(--color-accent);
  background: var(--color-accent-light);
  color: var(--color-accent);
}

/* 输入行 */
.import-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.import-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  min-width: 40px;
  text-align: right;
}

.import-input {
  flex: 1;
  padding: 10px 14px;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 17px;
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.2s;
}

.import-input:focus {
  border-color: var(--color-accent);
}

.import-input::placeholder {
  color: var(--text-muted);
}

.import-search-btn {
  padding: 10px 18px;
  background: var(--bg-primary);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 15px;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 0.2s;
  white-space: nowrap;
}

.import-search-btn:hover {
  background: var(--color-accent);
  color: #fff;
  border-color: var(--color-accent);
}

/* 搜索状态 */
.import-status {
  min-height: 24px;
  font-size: 14px;
  padding: 4px 0;
  text-align: center;
}

.import-status.searching {
  color: #f59e0b;
}

.import-status.success {
  color: var(--color-down);
}

.import-status.error {
  color: var(--color-up);
}

/* 搜索结果预览 */
.import-result {
  background: var(--bg-primary);
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  margin-top: 8px;
  text-align: center;
}

.import-result-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.import-result-code {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.import-result-price {
  font-size: 20px;
  font-weight: 700;
  color: var(--color-accent);
}

/* 手动输入区 */
.import-manual {
  margin-top: 14px;
  padding: 14px 16px;
  background: #fffbeb;
  border-radius: var(--radius-sm);
  border: 1px solid #fde68a;
}

.import-manual::before {
  content: '未找到线上数据，请手动输入信息';
  display: block;
  font-size: 13px;
  color: #92400e;
  margin-bottom: 10px;
  font-weight: 500;
}

/* ========== 批量导入结果列表 ========== */

.import-input.batch {
  font-size: 15px;
}

.batch-results {
  margin-top: 12px;
  max-height: 320px;
  overflow-y: auto;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
}

.batch-results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 1;
}

.batch-check-all {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
}

.batch-check-all input {
  cursor: pointer;
}

.batch-summary {
  font-size: 13px;
  color: var(--text-muted);
}

.batch-list {
  display: flex;
  flex-direction: column;
}

.batch-item {
  display: flex;
  align-items: center;
  padding: 12px 14px;
  gap: 12px;
  border-bottom: 1px solid var(--border-color);
  transition: background 0.15s;
}

.batch-item:last-child {
  border-bottom: none;
}

.batch-item:hover {
  background: var(--bg-primary);
}

.batch-item.found {
  border-left: 3px solid var(--color-down);
}

.batch-item.not-found {
  border-left: 3px solid #f59e0b;
  background: #fffbeb;
}

.batch-item.skipped {
  opacity: 0.5;
  pointer-events: none;
}

.batch-item input[type="checkbox"] {
  cursor: pointer;
  flex-shrink: 0;
}

.batch-item-code {
  font-family: 'SF Mono', Consolas, monospace;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  min-width: 70px;
  flex-shrink: 0;
}

.batch-item-info {
  flex: 1;
  min-width: 0;
}

.batch-item-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.batch-item-price {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.batch-item-status {
  font-size: 13px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  white-space: nowrap;
  flex-shrink: 0;
}

.batch-item-status.found {
  color: var(--color-down);
  background: var(--color-down-bg);
}

.batch-item-status.not-found {
  color: #92400e;
  background: #fef3c7;
}

.batch-item-manual {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-shrink: 0;
}

.batch-item-manual input {
  width: 90px;
  padding: 6px 8px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-size: 13px;
  outline: none;
}

.batch-item-manual input:focus {
  border-color: #f59e0b;
}

.batch-item-manual input.price-input {
  width: 70px;
}

/* ========== 响应式 ========== */
@media (max-width: 1024px) {
  .overview-cards { grid-template-columns: repeat(2, 1fr); }
  .mini-charts { grid-template-columns: 1fr; }
  .rank-section { grid-template-columns: 1fr; }
  .fund-info-cards { grid-template-columns: repeat(2, 1fr); }
  .metrics-grid { grid-template-columns: repeat(2, 1fr); }
  .stock-quote-cards { grid-template-columns: repeat(3, 1fr); }
  .signal-cards { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
  .sidebar { width: 60px; }
  .sidebar .nav-label,
  .sidebar .sidebar-tagline,
  .sidebar .sidebar-footer,
  .logo-text { display: none; }
  .sidebar-header { padding: 16px 10px; }
  .nav-item { justify-content: center; padding: 12px; }
  .logo-icon { width: 32px; height: 32px; font-size: 18px; }
  .main-content { margin-left: 60px; padding: 16px; max-width: calc(100vw - 60px); }
  .overview-cards { grid-template-columns: 1fr; }
  .fund-info-cards { grid-template-columns: 1fr 1fr; }
  .stock-quote-cards { grid-template-columns: repeat(2, 1fr); }
  .signal-cards { grid-template-columns: repeat(2, 1fr); }
  .gold-quote-panel { flex-direction: column; text-align: center; }
  .page-header { flex-direction: column; align-items: flex-start; }
  .header-actions { margin-left: 0; flex-wrap: wrap; }
  .search-input { width: 150px; }
}

/* ==========================================
   资本三流监控仪表盘
   ========================================== */

/* 顶部 */
.cf-header-right { display: flex; align-items: center; gap: 12px; }
.cf-data-time { font-size: 13px; color: var(--text-secondary); }
.cf-refresh-btn {
  padding: 6px 16px; border: 1px solid var(--color-accent); border-radius: 6px;
  background: var(--color-accent-light); color: var(--color-accent);
  font-size: 14px; cursor: pointer; transition: all .2s;
}
.cf-refresh-btn:hover { background: var(--color-accent); color: #fff; }
.cf-refresh-btn:disabled { opacity: .5; cursor: wait; }

/* 摘要卡片 */
.cf-summary-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 20px; }
.cf-summary-card {
  background: var(--bg-card); border-radius: 12px; padding: 20px;
  border-left: 4px solid var(--color-accent);
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
}
.cf-flow-dir { border-left-color: #e83939; }
.cf-flow-vol { border-left-color: #f5a623; }
.cf-flow-spd { border-left-color: #4a90d9; }
.cf-card-title { font-size: 14px; color: var(--text-secondary); margin-bottom: 8px; }
.cf-card-value { font-size: 26px; font-weight: 700; margin-bottom: 4px; }
.cf-card-desc { font-size: 13px; color: var(--text-secondary); line-height: 1.5; }

/* 筛选栏 */
.cf-filter-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 16px;
  padding: 12px 16px; background: var(--bg-card); border-radius: 8px;
  margin-bottom: 16px; box-shadow: 0 1px 4px rgba(0,0,0,.04);
}
.cf-filter-group { display: flex; align-items: center; gap: 6px; }
.cf-filter-label { font-size: 13px; color: var(--text-secondary); margin-right: 2px; }
.cf-search-group { margin-left: auto; }
.cf-search-group input {
  padding: 6px 12px; border: 1px solid var(--border-color); border-radius: 6px;
  font-size: 14px; width: 180px; background: var(--bg-main);
  color: var(--text-primary);
}
.cf-period-btn, .cf-type-btn, .cf-quick-btn {
  padding: 5px 14px; border: 1px solid var(--border-color); border-radius: 6px;
  background: var(--bg-main); color: var(--text-secondary); font-size: 13px;
  cursor: pointer; transition: all .2s;
}
.cf-period-btn:hover, .cf-type-btn:hover, .cf-quick-btn:hover { border-color: var(--color-accent); }
.cf-period-btn.active, .cf-type-btn.active {
  background: var(--color-accent); color: #fff; border-color: var(--color-accent);
}
.cf-quick-btn { font-weight: 600; }
.cf-quick-btn.active { background: var(--color-accent); color: #fff; border-color: var(--color-accent); }
.cf-reset-btn { color: var(--text-secondary) !important; }

/* 表格 */
.cf-table-wrapper {
  background: var(--bg-card); border-radius: 8px; overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,.04);
}
.cf-table { width: 100%; border-collapse: collapse; }
.cf-table thead th {
  padding: 12px 10px; font-size: 13px; font-weight: 600; text-align: left;
  background: var(--bg-main); color: var(--text-secondary);
  border-bottom: 2px solid var(--border-color); white-space: nowrap;
  cursor: default; position: sticky; top: 0; z-index: 1;
}
.cf-table thead th.sortable { cursor: pointer; user-select: none; }
.cf-table thead th.sortable:hover { color: var(--color-accent); }
.cf-table tbody td {
  padding: 10px; font-size: 14px; border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
}
.cf-table tbody tr:hover { background: var(--color-accent-light); }
.cf-table tbody tr:last-child td { border-bottom: none; }
.cf-col-rank { width: 40px; text-align: center; color: var(--text-secondary); }
.cf-col-name { cursor: pointer; color: var(--color-accent); font-weight: 600; }
.cf-col-name:hover { text-decoration: underline; }
.cf-loading { text-align: center; padding: 40px; color: var(--text-secondary); }

/* 表格数值颜色 */
.cf-val-pos { color: #e83939; font-weight: 600; }
.cf-val-neg { color: #39b54a; font-weight: 600; }
.cf-val-neutral { color: var(--text-secondary); }

/* 流向标签 */
.cf-flow-tag {
  display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 12px; font-weight: 600;
}
.cf-flow-tag-in { background: rgba(232,57,57,.12); color: #e83939; }
.cf-flow-tag-out { background: rgba(57,181,74,.12); color: #39b54a; }
.cf-flow-tag-flat { background: rgba(128,128,128,.12); color: #888; }

/* 流量分位条 */
.cf-percentile-bar {
  display: inline-block; width: 60px; height: 6px; background: #e0e0e0;
  border-radius: 3px; margin-left: 6px; vertical-align: middle; position: relative;
}
.cf-percentile-fill { height: 100%; border-radius: 3px; }

/* 表格底部计数 */
.cf-table-footer {
  padding: 10px 16px; font-size: 13px; color: var(--text-secondary);
  background: var(--bg-main); border-top: 1px solid var(--border-color); text-align: right;
}

/* 趋势弹窗 */
.cf-trend-dialog { max-width: 900px; width: 90%; }
.cf-trend-body { padding: 20px; max-height: 70vh; overflow-y: auto; }
.cf-trend-info {
  display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 16px;
  padding: 12px 16px; background: var(--bg-main); border-radius: 8px;
}
.cf-trend-info-item { font-size: 14px; }
.cf-trend-info-item .label { color: var(--text-secondary); margin-right: 4px; }
.cf-trend-info-item .value { font-weight: 600; }

/* ==================== 交易助手面板 ==================== */
.trade-assistant {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  border-radius: 12px; padding: 20px 24px; margin-bottom: 20px;
  border: 1px solid rgba(255,255,255,.08);
}
.ta-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.ta-header h3 {
  font-size: 20px; margin: 0; color: #e0e0e0;
}
.ta-header-right {
  display: flex; align-items: center; gap: 10px;
}
.ta-refresh-btn {
  background: rgba(255,152,0,.15); color: #ff9800; border: 1px solid rgba(255,152,0,.3);
  padding: 4px 12px; border-radius: 12px; font-size: 13px; cursor: pointer;
  font-weight: 600; transition: all .2s;
}
.ta-refresh-btn:hover { background: rgba(255,152,0,.25); }
.ta-refresh-btn:disabled { opacity: .5; cursor: not-allowed; }
.ta-badge {
  font-size: 13px; padding: 4px 12px; border-radius: 12px; font-weight: 600;
}
.ta-live {
  background: rgba(57,181,74,.2); color: #4caf50; border: 1px solid rgba(57,181,74,.3);
}
.ta-closed {
  background: rgba(158,158,158,.2); color: #9e9e9e; border: 1px solid rgba(158,158,158,.3);
}
.ta-loading {
  background: rgba(255,193,7,.15); color: #ffc107; border: 1px solid rgba(255,193,7,.3);
}
.ta-live-dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: #4caf50; margin-right: 4px;
  animation: ta-pulse 2s infinite;
}
.ta-closed-dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: #9e9e9e; margin-right: 4px;
}
@keyframes ta-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}
.ta-loading-msg {
  color: #ffc107; font-size: 14px; text-align: center; padding: 16px 0;
}
.ta-cards {
  display: grid; grid-template-columns: 1fr 1fr 1.5fr; gap: 16px;
}
.ta-card {
  background: rgba(255,255,255,.04); border-radius: 10px; padding: 16px;
  border: 1px solid rgba(255,255,255,.06);
}
.ta-card-up { border-left: 3px solid #e83939; }
.ta-card-down { border-left: 3px solid #39b54a; }
.ta-card-advice { border-left: 3px solid #ff9800; }
.ta-card-num {
  font-size: 39px; font-weight: 700; line-height: 1;
}
.ta-card-up .ta-card-num { color: #e83939; }
.ta-card-down .ta-card-num { color: #39b54a; }
.ta-card-label {
  font-size: 14px; color: #9e9e9e; margin-top: 4px; margin-bottom: 10px;
}
.ta-card-detail { display: flex; flex-direction: column; gap: 6px; }
.ta-card-item {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 13px; color: #b0b0b0;
}
.ta-card-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; margin-right: 8px; }
.ta-card-more { font-size: 12px; color: #666; }
.ta-advice-line {
  font-size: 14px; color: #b0b0b0; margin-bottom: 6px; line-height: 1.5;
}
.ta-advice-neutral { color: #9e9e9e; font-style: italic; }
.ta-advice-line strong { color: #ff9800; }

/* ==================== 交易信号标签 ==================== */
.signal-badge {
  display: inline-block; padding: 3px 10px; border-radius: 6px;
  font-size: 12px; font-weight: 600; white-space: nowrap;
}
.signal-strong-up     { background: rgba(232,57,57,.2);  color: #ff6b6b; border: 1px solid rgba(232,57,57,.4); }
.signal-up            { background: rgba(232,57,57,.12); color: #e83939; border: 1px solid rgba(232,57,57,.25); }
.signal-slight-up     { background: rgba(255,152,0,.12); color: #ff9800; border: 1px solid rgba(255,152,0,.25); }
.signal-flat          { background: rgba(158,158,158,.1); color: #9e9e9e; border: 1px solid rgba(158,158,158,.2); }
.signal-slight-down   { background: rgba(57,181,74,.1);  color: #66bb6a; border: 1px solid rgba(57,181,74,.2); }
.signal-down          { background: rgba(57,181,74,.15); color: #39b54a; border: 1px solid rgba(57,181,74,.3); }
.signal-strong-down   { background: rgba(57,181,74,.2);  color: #00e676; border: 1px solid rgba(57,181,74,.4); }
.signal-no-data       { background: rgba(128,128,128,.08); color: #888; border: 1px solid rgba(128,128,128,.15); }

/* 盘中估值辅助样式 */
.est-time { font-size: 11px; color: #888; }
.est-sim  { font-size: 12px; color: #888; font-style: italic; }
.text-muted { color: #888 !important; }
.signal-td { text-align: center; }

/* 响应式：小屏时交易助手卡片堆叠 */
@media (max-width: 900px) {
  .ta-cards { grid-template-columns: 1fr; }
}

/* ==================== 金十快讯 · AI解读（白色主题 · 并列布局） ==================== */

/* 分类筛选栏 */
.j10-filter-bar {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 16px; flex-wrap: wrap;
  background: #ffffff; padding: 12px 16px; border-radius: 10px;
  border: 1px solid #e5e7eb;
}
.j10-cat-btn {
  background: #f5f7fa; border: 1px solid #dde1e8; border-radius: 6px;
  color: #5a6478; padding: 6px 14px; font-size: 13px; cursor: pointer;
  transition: all .2s; white-space: nowrap;
}
.j10-cat-btn:hover { border-color: #3b82f6; color: #2563eb; background: #eff6ff; }
.j10-cat-btn.active {
  background: #3b82f6; border-color: #3b82f6; color: #fff; font-weight: 600;
}
.j10-cat-btn.j10-important-btn { color: #b45309; border-color: #fde68a; background: #fef3c7; }
.j10-cat-btn.j10-important-btn.active { background: #f59e0b; border-color: #f59e0b; color: #fff; }

/* 快讯卡片流 */
.j10-feed {
  display: flex; flex-direction: column; gap: 12px;
}
.j10-loading {
  text-align: center; color: #888; padding: 40px 20px; font-size: 15px;
}

/* 单条快讯卡片 — 并列布局：左侧快讯 + 右侧解读 */
.j10-item {
  display: flex; flex-direction: row; gap: 0;
  background: #ffffff; border: 1px solid #e5e7eb; border-radius: 10px;
  overflow: hidden; transition: border-color .2s;
}
.j10-item:hover { border-color: #c7cdd8; box-shadow: 0 2px 8px rgba(0,0,0,.06); }
.j10-item.j10-item-important {
  border-left: 3px solid #f59e0b;
}

/* 左侧：快讯内容区 */
.j10-item-left {
  flex: 1 1 55%; min-width: 0;
  padding: 16px 20px;
  border-right: 1px solid #e5e7eb;
  display: flex; flex-direction: column;
}

/* 右侧：AI 解读区（始终可见） */
.j10-item-right {
  flex: 1 1 45%; min-width: 0;
  padding: 16px 20px;
  background: linear-gradient(135deg, #f0f7ff 0%, #f5f0ff 100%);
  display: flex; flex-direction: column; align-items: flex-start;
}
.j10-no-interp {
  color: #b0b8c8; font-size: 13px; padding: 16px 20px;
  display: flex; align-items: center; justify-content: center;
}

/* 快讯头部 */
.j10-item-header {
  display: flex; align-items: center; gap: 8px; margin-bottom: 10px;
  flex-wrap: nowrap;
}
.j10-time {
  color: #3b82f6; font-size: 13px; font-family: 'Consolas','Monaco',monospace;
  font-weight: 600; flex-shrink: 0;
}
.j10-cat-badge {
  font-size: 11px; background: #eff6ff; color: #3b82f6;
  padding: 2px 8px; border-radius: 10px; white-space: nowrap;
  border: 1px solid #bfdbfe;
}
.j10-imp-badge {
  font-size: 11px; background: #fef3c7; color: #b45309;
  padding: 2px 8px; border-radius: 10px; font-weight: 600;
  border: 1px solid #fde68a;
}

/* 快讯正文 */
.j10-content {
  color: #1f2937; font-size: 15px; line-height: 1.75;
  word-break: break-word; flex: 1;
}

/* AI 解读区 */
.j10-interp-icon {
  font-size: 13px; color: #7c3aed; font-weight: 600; margin-bottom: 8px;
  display: flex; align-items: center; gap: 4px;
}
.j10-interp-text {
  font-size: 14px; color: #4b5563; line-height: 1.75;
  flex: 1;
}
.j10-interp-highlight {
  color: #7c3aed; font-weight: 600;
}

/* 响应式：小屏时并列变堆叠 */
@media (max-width: 900px) {
  .j10-filter-bar { gap: 6px; padding: 8px 10px; }
  .j10-cat-btn { font-size: 12px; padding: 5px 10px; }
  .j10-item { flex-direction: column; }
  .j10-item-left { border-right: none; border-bottom: 1px solid #e5e7eb; }
  .j10-item-right { background: #f5f7fa; }
}

/* ==========================================
   首页新布局：投资日历 + 热点板块
   ========================================== */

/* 分区标题 */
.dash-section {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}
.dash-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid #f0f0f5;
}
.dash-section-header h2 {
  font-size: 19px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}
.dash-section-badge {
  font-size: 12px;
  color: var(--color-accent);
  background: var(--color-accent-light);
  padding: 4px 12px;
  border-radius: 10px;
  font-weight: 600;
}
.dash-tabs {
  display: flex;
  gap: 6px;
}
.dash-tab {
  padding: 6px 16px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: var(--bg-primary);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
}
.dash-tab:hover { border-color: var(--color-accent); color: var(--color-accent); }
.dash-tab.active {
  background: var(--color-accent);
  color: #fff;
  border-color: var(--color-accent);
}

/* ===== 经济日历卡片 ===== */
.eco-calendar {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  gap: 16px;
}
.eco-card {
  border: 1px solid var(--border-color);
  border-radius: 10px;
  overflow: hidden;
  transition: box-shadow 0.2s, transform 0.15s;
}
.eco-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  transform: translateY(-1px);
}
.eco-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-color);
}
.eco-card-flag {
  font-size: 20px;
  line-height: 1;
}
.eco-card-country {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}
.eco-card-time {
  font-size: 12px;
  color: var(--text-muted);
  margin-left: auto;
}
.eco-card-importance {
  display: flex;
  gap: 2px;
}
.eco-star { color: #ddd; font-size: 13px; }
.eco-star.on { color: #f5a623; }

.eco-card-body {
  padding: 14px 16px;
}
.eco-card-event {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 10px;
  line-height: 1.3;
}
.eco-card-data {
  display: flex;
  gap: 16px;
  margin-bottom: 12px;
}
.eco-data-item {
  flex: 1;
  text-align: center;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--bg-primary);
}
.eco-data-label {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 2px;
}
.eco-data-value {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
}
.eco-data-value.better { color: var(--color-up); }
.eco-data-value.worse { color: var(--color-down); }
.eco-data-value.warn { color: #f5a623; }

.eco-card-impact {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 8px;
}
.eco-impact-positive { background: #fde8e8; color: #c0392b; }
.eco-impact-negative { background: #e6f7ee; color: #1e8449; }
.eco-impact-neutral { background: #f0f0f5; color: #636e72; }
.eco-impact-warning { background: #fef3c7; color: #92400e; }

.eco-card-analysis {
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-secondary);
  padding: 12px;
  background: #fafbfd;
  border-radius: 8px;
  border-left: 3px solid var(--color-accent);
  margin-top: 6px;
}
.eco-card-analysis strong { color: var(--text-primary); }

.eco-card-footer {
  padding: 8px 16px;
  background: var(--bg-primary);
  border-top: 1px solid var(--border-color);
  font-size: 11px;
  color: var(--text-muted);
  text-align: right;
}
.eco-expand-btn {
  background: none;
  border: none;
  color: var(--color-accent);
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  padding: 2px 8px;
}
.eco-expand-btn:hover { text-decoration: underline; }

.eco-loading {
  text-align: center;
  padding: 40px;
  color: var(--text-secondary);
  font-size: 15px;
}

/* ===== 热点板块表格 ===== */
.sector-hotspots {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.sector-col h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-color);
}
.sector-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s;
  margin-bottom: 2px;
}
.sector-item:hover { background: var(--bg-primary); }
.sector-rank {
  width: 22px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  text-align: center;
  flex-shrink: 0;
}
.sector-rank.top { color: var(--color-up); }
.sector-name {
  flex: 1;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sector-chg {
  font-size: 14px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  flex-shrink: 0;
}
.sector-chg.up { background: #fde8e8; color: var(--color-up); }
.sector-chg.down { background: #e6f7ee; color: var(--color-down); }
.sector-flow {
  font-size: 12px;
  color: var(--text-muted);
  flex-shrink: 0;
  width: 55px;
  text-align: right;
}

/* ===== 关键指标速览 ===== */
.key-metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.key-metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 14px 16px;
  text-align: center;
  transition: transform 0.15s;
}
.key-metric-card:hover { transform: translateY(-2px); }
.key-metric-label {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 6px;
  font-weight: 500;
}
.key-metric-value {
  font-size: 22px;
  font-weight: 800;
  line-height: 1.2;
}
.key-metric-value.red { color: var(--color-down); }
.key-metric-value.green { color: var(--color-up); }
.key-metric-value.gray { color: var(--text-secondary); }
.key-metric-value.orange { color: #e17055; }
.key-metric-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}
.key-metric-trend {
  display: inline-block;
  font-size: 16px;
  vertical-align: middle;
  margin-right: 2px;
}

/* ===== 市场情绪判断 ===== */
.market-mood-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 20px;
}
.mood-headline {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 10px;
}
.mood-headline .mood-emoji {
  font-size: 20px;
  margin-right: 6px;
}
.mood-detail {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 14px;
}
.mood-scores {
  display: flex;
  gap: 24px;
  margin-bottom: 14px;
}
.mood-score-item {
  display: flex;
  align-items: center;
  gap: 6px;
}
.mood-score-label {
  font-size: 12px;
  color: var(--text-muted);
  min-width: 50px;
}
.mood-score-bar {
  height: 8px;
  border-radius: 4px;
  background: #eee;
  width: 80px;
  overflow: hidden;
  position: relative;
}
.mood-score-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.5s;
}
.mood-score-fill.red { background: var(--color-down); }
.mood-score-fill.green { background: var(--color-up); }
.mood-score-fill.orange { background: #e17055; }
.mood-score-num {
  font-size: 12px;
  font-weight: 700;
  min-width: 20px;
}
.mood-suggestion {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 13px;
  color: var(--text-primary);
  line-height: 1.5;
  border-left: 3px solid #f5a623;
}
.mood-suggestion strong {
  color: #f5a623;
}

/* ===== 明日关注 ===== */
.tomorrow-watch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.tw-item {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 14px 16px;
  transition: transform 0.15s;
}
.tw-item:hover { transform: translateY(-2px); }
.tw-item-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.tw-item-flag { font-size: 18px; }
.tw-item-time {
  font-size: 12px;
  color: var(--text-muted);
  background: #f0f0f5;
  padding: 2px 8px;
  border-radius: 4px;
}
.tw-item-importance {
  display: flex;
  gap: 2px;
}
.tw-item-event {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}
.tw-item-hint {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
  background: #fefce8;
  padding: 8px 10px;
  border-radius: 6px;
  border-left: 3px solid #f5a623;
}

/* ===== 今日头条摘要 ===== */
.headline-banner {
  background: linear-gradient(135deg, #3867d6 0%, #6c5ce7 100%);
  border-radius: 10px;
  padding: 16px 20px;
  margin-bottom: 16px;
  color: #fff;
}
.headline-banner h2 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 6px;
  color: #fff;
}
.headline-banner p {
  font-size: 13px;
  line-height: 1.6;
  color: rgba(255,255,255,0.92);
}

/* ===== 日历事件新增：类别标签 & 股市影响 ===== */
.eco-card-category {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 500;
  background: #f0f0f5;
  color: var(--text-secondary);
  margin-left: 8px;
}
.eco-card-stock-impact {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 8px;
  padding: 6px 10px;
  background: #f8f9fa;
  border-radius: 6px;
  border-left: 2px solid var(--color-up);
  line-height: 1.5;
}
.eco-card-stock-impact::before {
  content: '📈 股市影响：';
  font-weight: 600;
  color: var(--text-primary);
}

/* 响应式 */
@media (max-width: 900px) {
  .eco-calendar { grid-template-columns: 1fr; }
  .key-metrics-grid { grid-template-columns: repeat(2, 1fr); }
  .tomorrow-watch { grid-template-columns: 1fr; }
  .mood-scores { flex-direction: column; gap: 10px; }
  .dash-section-header { flex-direction: column; align-items: flex-start; gap: 10px; }
}

/* ==================== 技术学堂 ==================== */
.academy-nav {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  flex-wrap: wrap;
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 0;
}
.academy-nav-item {
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: 8px 8px 0 0;
  cursor: pointer;
  transition: all 0.2s;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
}
.academy-nav-item:hover {
  color: var(--text-primary);
  background: var(--bg-primary);
}
.academy-nav-item.active {
  color: #3867d6;
  border-bottom-color: #3867d6;
}

.academy-panel {
  display: none;
  animation: fadeIn 0.3s ease;
}
.academy-panel.active {
  display: block;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.aca-intro {
  background: linear-gradient(135deg, #f8f9ff 0%, #f0f4ff 100%);
  border-radius: 10px;
  padding: 18px 22px;
  margin-bottom: 20px;
  border-left: 4px solid #3867d6;
}
.aca-intro h2 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}
.aca-intro p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.7;
}
.aca-intro strong {
  color: var(--text-primary);
}

/* K线图解 */
.aca-candle-demo {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 16px;
}
.aca-candle-legend {
  display: flex;
  gap: 24px;
  justify-content: center;
  margin-top: 12px;
  flex-wrap: wrap;
}
.aca-legend-item {
  font-size: 13px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
}
.aca-dot {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 3px;
}
.aca-dot.red { background: #e74c3c; }
.aca-dot.green { background: #27ae60; }
.aca-dot.line { background: #95a5a6; height: 3px; border-radius: 2px; }

/* 提示框 */
.aca-tip-box {
  background: #fff8e1;
  border: 1px solid #ffe082;
  border-radius: 8px;
  padding: 14px 18px;
  font-size: 13px;
  color: var(--text-primary);
  line-height: 1.7;
}
.aca-tip-box strong { color: #f57c00; }

/* K线形态图鉴 */
.aca-patterns-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
.aca-pattern-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 14px;
  transition: transform 0.15s, box-shadow 0.15s;
}
.aca-pattern-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}
.aca-pattern-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.aca-pattern-icon { font-size: 22px; }
.aca-pattern-name { font-size: 15px; font-weight: 700; flex: 1; }
.aca-pattern-tag {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 600;
}
.aca-pattern-tag.pattern-bull { background: #fde8e8; color: #c0392b; }
.aca-pattern-tag.pattern-bear { background: #e6f7ee; color: #1e8449; }
.aca-pattern-tag.pattern-neutral { background: #f0f0f5; color: #636e72; }
.aca-pattern-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
  line-height: 1.5;
}
.aca-pattern-meaning {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 10px;
}
.aca-pattern-action {
  font-size: 12px;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 6px;
  background: #f8f9fa;
}
.pattern-bull .aca-pattern-action { background: #fde8e8; color: #c0392b; }
.pattern-bear .aca-pattern-action { background: #e6f7ee; color: #1e8449; }
.pattern-neutral .aca-pattern-action { background: #f0f0f5; color: #636e72; }

/* 趋势线 */
.aca-trend-demo {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 16px;
}
.aca-trend-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.aca-trend-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 16px;
}
.aca-trend-card h3 {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 10px;
}
.aca-trend-card p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 10px;
}
.aca-trend-card strong { color: var(--text-primary); }
.aca-trend-tip {
  font-size: 12px;
  background: #fff8e1;
  border-radius: 6px;
  padding: 8px 12px;
  color: #f57c00;
  border-left: 3px solid #ffc107;
}

/* 技术指标 */
.aca-indicator-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.aca-indicator-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 18px 20px;
}
.aca-indicator-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.aca-indicator-icon { font-size: 22px; }
.aca-indicator-name { font-size: 18px; font-weight: 700; color: var(--text-primary); }
.aca-indicator-what {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-color);
}
.aca-signal-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 12px;
}
.aca-signal-table th {
  text-align: left;
  font-size: 12px;
  color: var(--text-muted);
  padding: 6px 10px;
  border-bottom: 1px solid var(--border-color);
  font-weight: 600;
}
.aca-signal-table td {
  font-size: 13px;
  padding: 8px 10px;
  border-bottom: 1px solid #f5f5f5;
  vertical-align: top;
}
.aca-sig-name { font-weight: 700; color: var(--text-primary); white-space: nowrap; }
.aca-sig-desc { color: var(--text-secondary); }
.aca-sig-action { font-weight: 600; white-space: nowrap; }
.aca-indicator-tip {
  font-size: 12px;
  background: #f0f4ff;
  border-radius: 6px;
  padding: 8px 12px;
  color: #3867d6;
  border-left: 3px solid #3867d6;
}

/* 实战口诀 */
.aca-cheatsheet-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}
.aca-cheatsheet-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 14px;
  transition: transform 0.15s;
}
.aca-cheatsheet-card:hover { transform: translateY(-2px); }
.aca-cs-icon { font-size: 18px; margin-bottom: 6px; }
.aca-cs-title { font-size: 15px; font-weight: 700; margin-bottom: 4px; }
.aca-cs-tag {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 600;
  display: inline-block;
  margin-bottom: 8px;
}
.aca-cs-tag.tip-bull { background: #fde8e8; color: #c0392b; }
.aca-cs-tag.tip-bear { background: #e6f7ee; color: #1e8449; }
.aca-cs-tag.tip-warn { background: #fef3c7; color: #92400e; }
.aca-cs-tag.tip-neutral { background: #f0f0f5; color: #636e72; }
.aca-cs-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 8px;
}
.aca-cs-action {
  font-size: 12px;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 6px;
  background: #f8f9fa;
}
.tip-bull .aca-cs-action { background: #fde8e8; color: #c0392b; }
.tip-bear .aca-cs-action { background: #e6f7ee; color: #1e8449; }
.tip-warn .aca-cs-action { background: #fef3c7; color: #92400e; }
.tip-neutral .aca-cs-action { background: #f0f0f5; color: #636e72; }

.aca-warning-box {
  background: #fff3e0;
  border: 2px solid #ff9800;
  border-radius: 10px;
  padding: 18px 22px;
}
.aca-warning-box strong { color: #e65100; font-size: 15px; }
.aca-warning-box ul {
  margin: 10px 0 0 0;
  padding-left: 20px;
}
.aca-warning-box li {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.8;
}
.aca-warning-box strong { color: #e65100; }

/* 学堂响应式 */
@media (max-width: 900px) {
  .aca-patterns-grid { grid-template-columns: repeat(2, 1fr); }
  .aca-trend-cards { grid-template-columns: 1fr; }
  .aca-cheatsheet-grid { grid-template-columns: repeat(2, 1fr); }
  .aca-candle-legend { flex-direction: column; gap: 8px; }
}

/* ==========================================
   小锦·金牌顾问 悬浮球 + 抽屉
   沉稳深色调，机构感，区别于快讯活泼风格
   ========================================== */

/* 悬浮球 */
.advisor-fab {
  position: fixed;
  right: 28px;
  bottom: 28px;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0f1923 0%, #1e3a5f 100%);
  box-shadow: 0 6px 20px rgba(15, 25, 35, 0.35), 0 2px 8px rgba(0, 0, 0, 0.15);
  cursor: pointer;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.advisor-fab:hover { transform: scale(1.08) translateY(-2px); box-shadow: 0 10px 28px rgba(15, 25, 35, 0.45); }
.advisor-fab.hidden { transform: scale(0); opacity: 0; pointer-events: none; }
.advisor-fab-icon {
  color: #d4a843;
  font-size: 24px;
  font-weight: bold;
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}
.advisor-fab-pulse {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid #d4a843;
  opacity: 0;
  animation: advisorPulse 2.4s ease-out infinite;
  pointer-events: none;
}
@keyframes advisorPulse {
  0% { transform: scale(1); opacity: 0.6; }
  100% { transform: scale(1.6); opacity: 0; }
}

/* 抽屉 */
.advisor-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 400px;
  max-width: 92vw;
  height: 100vh;
  background: var(--bg-card, #fff);
  box-shadow: -8px 0 30px rgba(0, 0, 0, 0.18);
  z-index: 1001;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", sans-serif;
}
.advisor-drawer.open { transform: translateX(0); }

/* 头部：机构感深色 */
.advisor-header {
  background: linear-gradient(135deg, #0f1923 0%, #1e3a5f 100%);
  color: #fff;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.advisor-id { display: flex; align-items: center; gap: 12px; }
.advisor-avatar {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, #d4a843, #c89735);
  color: #0f1923;
  font-size: 20px; font-weight: bold;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}
.advisor-name { font-size: 16px; font-weight: 600; letter-spacing: 0.5px; }
.advisor-title { font-size: 11.5px; color: #a0b4c8; margin-top: 2px; }
.advisor-close {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #a0b4c8;
  width: 30px; height: 30px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.2s, color 0.2s;
}
.advisor-close:hover { background: rgba(255, 255, 255, 0.22); color: #fff; }

/* 消息区 */
.advisor-body {
  flex: 1;
  overflow-y: auto;
  padding: 18px 16px;
  background: #f7f8fa;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.advisor-msg { display: flex; max-width: 88%; }
.advisor-msg-bot { align-self: flex-start; }
.advisor-msg-user { align-self: flex-end; flex-direction: row-reverse; }
.advisor-msg-content {
  padding: 11px 14px;
  border-radius: 14px;
  font-size: 13.5px;
  line-height: 1.65;
  word-break: break-word;
}
.advisor-msg-bot .advisor-msg-content {
  background: #fff;
  color: var(--text-primary, #1a1a2e);
  border: 1px solid var(--border-color, #e5e7eb);
  border-top-left-radius: 4px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.advisor-msg-user .advisor-msg-content {
  background: linear-gradient(135deg, #1e3a5f, #2c5282);
  color: #fff;
  border-top-right-radius: 4px;
}

/* 快捷建议 chips */
.advisor-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 4px 0 2px;
}
.advisor-chip {
  background: #fff;
  border: 1px solid var(--color-accent, #4a90d9);
  color: var(--color-accent, #4a90d9);
  padding: 6px 12px;
  border-radius: 16px;
  font-size: 12.5px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  font-family: inherit;
}
.advisor-chip:hover { background: var(--color-accent, #4a90d9); color: #fff; }

/* 思考中动画 */
.advisor-thinking .advisor-msg-content { display: inline-flex; gap: 4px; align-items: center; padding: 14px 16px; }
.advisor-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #9ca3af;
  animation: advisorBlink 1.3s infinite ease-in-out both;
}
.advisor-dot:nth-child(2) { animation-delay: 0.2s; }
.advisor-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes advisorBlink {
  0%, 80%, 100% { opacity: 0.3; transform: scale(0.8); }
  40% { opacity: 1; transform: scale(1.1); }
}

/* 输入栏 */
.advisor-input-bar {
  display: flex;
  gap: 8px;
  padding: 12px 14px;
  background: #fff;
  border-top: 1px solid var(--border-color, #e5e7eb);
  flex-shrink: 0;
}
.advisor-input {
  flex: 1;
  border: 1px solid var(--border-color, #e5e7eb);
  border-radius: 20px;
  padding: 9px 14px;
  font-size: 13.5px;
  outline: none;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.advisor-input:focus { border-color: var(--color-accent, #4a90d9); box-shadow: 0 0 0 3px rgba(74, 144, 217, 0.15); }
.advisor-send {
  background: linear-gradient(135deg, #1e3a5f, #2c5282);
  color: #fff;
  border: none;
  width: 40px; height: 40px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
  transition: transform 0.2s, box-shadow 0.2s;
  flex-shrink: 0;
}
.advisor-send:hover { transform: scale(1.08); box-shadow: 0 4px 12px rgba(30, 58, 95, 0.4); }

.advisor-footer-tip {
  padding: 6px 14px 8px;
  font-size: 10.5px;
  color: var(--text-muted, #9ca3af);
  text-align: center;
  background: #fff;
  border-top: 1px solid var(--border-color, #e5e7eb);
  flex-shrink: 0;
}

/* 板块快捷按钮 */
.advisor-quick-btn {
  background: linear-gradient(135deg, #0f1923, #1e3a5f);
  color: #d4a843;
  border: none;
  padding: 6px 12px;
  border-radius: 16px;
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.2s, box-shadow 0.2s;
  white-space: nowrap;
}
.advisor-quick-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 10px rgba(15, 25, 35, 0.25); }

/* 响应式：小屏抽屉占满 */
@media (max-width: 600px) {
  .advisor-drawer { width: 100vw; max-width: 100vw; }
  .advisor-fab { right: 16px; bottom: 16px; width: 52px; height: 52px; }
}

/* ============================================================
   手机端深度适配（≤640px）：把左侧固定侧栏重排为底部导航条，
   所有功能/内容完全保留，仅调整布局与触控体验。
   ============================================================ */
/* 手机端专用：顶部栏与抽屉遮罩，桌面端默认隐藏（必须上移至媒体查询之前，否则会被末尾全局规则覆盖成永久隐藏） */
.mobile-topbar { display: none; }
.nav-overlay { display: none; }

/* —— 栏目板块（手机端首页入口 / 桌面端亦可作站点地图） —— */
.topbar-title { cursor: pointer; }
.launch-header { padding: 6px 2px 16px; }
.launch-header h1 { font-size: 24px; font-weight: 800; margin: 0 0 4px; letter-spacing: 1px; }
.launch-header p { margin: 0; color: var(--text-muted); font-size: 13px; }
/* 手机端首页一键恢复自选（电脑搬过来）。默认隐藏，仅手机宽度显示，避免与桌面侧栏按钮重复 */
.launch-restore-btn {
  display: none;
  margin-top: 14px;
  padding: 13px 18px;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff; border: none; border-radius: 12px;
  font-size: 15px; font-weight: 700; cursor: pointer;
  box-shadow: 0 4px 14px rgba(37, 99, 235, .3);
  width: 100%; max-width: 420px; text-align: left;
}
.launch-restore-btn:active { transform: scale(.985); }
@media (max-width: 768px) {
  .launch-restore-btn { display: inline-block; }
}
.launch-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; max-width: 1000px; }
.launch-card {
  display: flex; flex-direction: column; gap: 6px;
  padding: 18px 16px; background: var(--card-bg, #ffffff);
  border: 1px solid var(--border, #e5e7eb); border-radius: 16px;
  text-decoration: none; color: var(--text-primary, #1a1a2e);
  box-shadow: 0 2px 10px rgba(0, 0, 0, .06);
  transition: transform .12s ease, box-shadow .12s ease;
  min-height: 104px; justify-content: flex-start;
}
.launch-card:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0, 0, 0, .1); }
.launch-card:active { transform: scale(.97); box-shadow: 0 1px 6px rgba(0, 0, 0, .12); }
.lc-icon { font-size: 28px; line-height: 1; }
.lc-title { font-size: 16px; font-weight: 700; }
.lc-sub { font-size: 12px; color: var(--text-muted); line-height: 1.45; }

@media (max-width: 640px) {

  /* —— 顶部栏 + 左侧抽屉式选择栏（保留全部菜单与底部工具） —— */
  .mobile-topbar {
    display: flex;
    position: fixed; top: 0; left: 0; right: 0;
    height: 52px;
    align-items: center;
    gap: 12px;
    padding: 0 14px;
    background: var(--bg-sidebar);
    color: #fff;
    z-index: 1100;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .15);
  }
  .topbar-menu-btn {
    background: none; border: none; color: #fff;
    font-size: 22px; line-height: 1; cursor: pointer;
    padding: 4px 6px;
  }
  .topbar-title { font-size: 17px; font-weight: 700; letter-spacing: 1px; }

  .nav-overlay {
    display: block;
    position: fixed; inset: 0;
    background: rgba(0, 0, 0, .45);
    opacity: 0; pointer-events: none;
    transition: opacity .25s ease;
    z-index: 990;
  }
  .nav-overlay.show { opacity: 1; pointer-events: auto; }

  .sidebar {
    top: 52px; bottom: 0; left: 0; right: auto;
    width: 82%; max-width: 280px;
    height: auto;
    flex-direction: column;
    padding: 0;
    background: var(--bg-sidebar);
    transform: translateX(-100%);
    transition: transform .25s ease;
    z-index: 1000;
    box-shadow: 4px 0 24px rgba(0, 0, 0, .25);
    overflow-y: auto;
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-header { display: block; padding: 22px 20px 14px; position: relative; }
  .sidebar-footer { display: block; }
  .sidebar-nav {
    flex-direction: column;
    gap: 4px;
    padding: 10px;
    flex: 1 1 auto;
    overflow-y: auto;
  }
  .nav-item {
    flex-direction: row;
    justify-content: flex-start;
    align-items: center;
    gap: 12px;
    padding: 13px 14px;
    font-size: 15px;
    border-radius: 10px;
    line-height: 1.3;
  }
  .nav-icon { font-size: 18px; width: 22px; text-align: center; }
  .sidebar .nav-label { display: inline; text-align: left; }
  .nav-item.active { background: var(--bg-sidebar-hover); color: var(--text-sidebar-active); }

  /* —— 主内容让出顶部栏高度 —— */
  .main-content {
    margin-left: 0;
    max-width: 100vw;
    padding: 62px 14px 24px;
  }

  /* —— 概览排版收紧，避免文字跨行难看 —— */
  .dash-section { padding: 16px; margin-bottom: 14px; }
  .dash-section-header { margin-bottom: 14px; padding-bottom: 10px; gap: 8px; }
  .dash-section-header h2 { font-size: 17px; }
  .dash-section-badge { font-size: 11px; padding: 3px 10px; }
  .key-metrics-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .key-metric-card { padding: 12px 10px; }
  .key-metric-label { font-size: 11px; }
  .key-metric-value { font-size: 19px; }
  .key-metric-sub { font-size: 10px; }
  .market-mood-card { padding: 16px; }
  .mood-headline { font-size: 16px; }
  .mood-detail { font-size: 13px; line-height: 1.65; }
  .mood-scores { gap: 12px; }
  .mood-suggestion { font-size: 12px; padding: 10px 12px; }
  .eco-card-header { flex-wrap: wrap; gap: 6px; }
  .eco-card-time { margin-left: 0; }
  .eco-card-category { margin-left: 0; }
  .eco-card-body { padding: 12px 14px; }
  .eco-card-event { font-size: 15px; }
  .eco-card-analysis, .eco-card-stock-impact { font-size: 12px; line-height: 1.7; }
  .eco-card-data { flex-wrap: wrap; gap: 8px; }
  .eco-data-item { min-width: 84px; flex: 1 1 84px; }
  .tomorrow-watch { grid-template-columns: 1fr; gap: 10px; }
  .tw-item-event { font-size: 13px; }
  .headline-banner { padding: 14px 16px; }
  .headline-banner h2 { font-size: 15px; }
  .headline-banner p { font-size: 12px; line-height: 1.6; }
  .page-header h1 { font-size: 18px; line-height: 1.35; }
  .page-date { font-size: 12px; }

  /* —— 卡片栅格：手机单/双列，不删任何内容 —— */
  .overview-cards     { grid-template-columns: 1fr; }
  .fund-info-cards    { grid-template-columns: 1fr; }
  .stock-quote-cards  { grid-template-columns: 1fr; }
  .signal-cards       { grid-template-columns: 1fr; }
  .metrics-grid       { grid-template-columns: 1fr 1fr; }
  .rank-section       { grid-template-columns: 1fr; }
  .cf-summary-cards   { grid-template-columns: 1fr; }
  .key-metrics-grid   { grid-template-columns: 1fr 1fr; }
  .mini-charts        { grid-template-columns: 1fr; }

  /* —— 列表表格：手机改为卡片式，杜绝横向滑动 —— */
  .watchlist-wrap   { overflow: visible; }
  .data-table:not(.watchlist-table) { min-width: 0; }
  .cf-table-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .cf-table         { min-width: 680px; }

  .watchlist-table { display: block; width: 100%; min-width: 0; }
  .watchlist-table thead { display: none; }
  .watchlist-table tbody { display: block; width: 100%; }
  .watchlist-table tr {
    display: block;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    margin-bottom: 12px;
    padding: 10px 12px;
    box-shadow: var(--shadow-sm);
  }
  .watchlist-table td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 7px 2px;
    border-bottom: 1px solid var(--border-color);
    text-align: right;
    white-space: normal;
  }
  .watchlist-table td:last-child { border-bottom: none; }
  .watchlist-table td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 12px;
    text-align: left;
    flex-shrink: 0;
    margin-right: auto;
  }
  .watchlist-table td.td-name {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    padding-bottom: 10px;
    margin-bottom: 4px;
    border-bottom: 1px solid var(--border-color);
  }
  .watchlist-table td.td-name::before { content: ""; display: none; }
  .watchlist-table td.td-name strong { font-size: 16px; }
  .watchlist-table td.td-code { padding-top: 2px; }
  .watchlist-table td.action-td {
    justify-content: flex-start;
    gap: 8px;
    border-bottom: none;
  }
  .watchlist-table td.action-td::before { content: ""; display: none; }
  .watchlist-table td.action-td .detail-btn,
  .watchlist-table td.action-td .delete-btn { flex: 1 1 auto; }

  /* —— 图表容器自适应宽度 —— */
  .chart-container, .mini-chart-container, .kline-chart { width: 100% !important; min-width: 0; }

  /* —— 弹窗/对话框占满 —— */
  .modal-overlay { padding: 12px; align-items: flex-end; }
  .modal-dialog  { width: 100% !important; max-width: 100% !important; margin: 0; max-height: 86vh; }
  .cf-trend-dialog { width: 100% !important; max-width: 100% !important; }

  /* —— 页面头部与操作区堆叠 —— */
  .page-header   { flex-direction: column; align-items: stretch; gap: 10px; }
  .header-actions { width: 100%; }
  .search-input  { width: 100% !important; box-sizing: border-box; }
  .cf-filter-bar { gap: 10px; }
  .cf-search-group { margin-left: 0; width: 100%; }
  .cf-search-group input { width: 100%; box-sizing: border-box; }

  /* —— 金十快讯卡片：左右并列改上下堆叠 —— */
  .j10-item { flex-direction: column; }

  /* —— 通用卡片间距收紧 —— */
  .card, .panel, .cf-summary-card, .ta-card { margin-bottom: 12px; }

  /* —— 悬浮顾问球上移，避免压住底部导航 —— */
  .advisor-fab { right: 14px; bottom: 18px; width: 52px; height: 52px; }

  /* —— 字号微调，提升可读性 —— */
  body { font-size: 14px; }
  .page-header h2 { font-size: 18px; }

  /* —— 栏目板块：手机两列大卡，便于点选 —— */
  .launch-grid { grid-template-columns: 1fr 1fr; gap: 12px; max-width: 100%; }
  .launch-card { min-height: 96px; padding: 16px 14px; border-radius: 14px; }
  .lc-icon { font-size: 26px; }
  .lc-title { font-size: 15px; }
  .lc-sub { font-size: 11px; }

  /* —— 内页头部：操作按钮自动换行，避免横向溢出 —— */
  .header-actions { display: flex; flex-wrap: wrap; gap: 8px; }
  .header-actions .action-btn,
  .header-actions .filter-select,
  .header-actions .advisor-quick-btn { flex: 1 1 auto; min-width: 110px; }
  .page-header .back-btn { width: 100%; }
}

/* 极窄屏（≤380px）再收紧一点 */
@media (max-width: 380px) {
  .metrics-grid, .key-metrics-grid { grid-template-columns: 1fr; }
  .nav-item { padding: 12px 12px; font-size: 14px; }
}

/* 注：.mobile-topbar / .nav-overlay 的桌面隐藏已上移至 ≤640px 媒体查询之前，避免末尾全局规则覆盖手机端显示 */

/* ==================== 自选同步码弹窗 ==================== */
.sync-hint { font-size: 13px; color: #8a94a6; margin: 0 0 10px; line-height: 1.55; }
.sync-textarea {
  width: 100%; box-sizing: border-box; min-height: 170px;
  border: 1px solid #cbd5e1; border-radius: 8px; padding: 10px 12px;
  font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; line-height: 1.45;
  resize: vertical; background: #fff; color: #1e293b;
}

/* ==================== 云端同步设置弹窗 ==================== */
.sync-pin-btn { background: linear-gradient(135deg, #2a6df4, #1e4fd0); color: #fff; font-weight: 600; }
.sync-pin-btn:hover { opacity: 0.88; }
.sync-status { font-size: 14px; color: #1f9d55; font-weight: 600; margin: 0 0 6px; }
.sync-tip { font-size: 13px; color: #8a94a6; line-height: 1.6; margin: 0 0 14px; }
.sync-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.sync-input {
  width: 100%; box-sizing: border-box; padding: 10px 12px; margin-bottom: 12px;
  border: 1px solid #cbd5e1; border-radius: 8px; font-size: 15px; background: #fff; color: #1e293b;
}
.sync-msg { font-size: 13px; color: var(--text-secondary); min-height: 18px; margin: 12px 0 0; }

