/* ============================================================
   大盘云图 · 样式
   深浅双主题，配色取自原站 CSS 变量
   ============================================================ */
:root {
  --brand: #ef4444;
  --brand-foreground: #fff;
  --radius: 10px;
  --font: Arial, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --transition: .15s cubic-bezier(.4,0,.2,1);
}

/* ---------- 暗色（默认，对齐原站 dark） ---------- */
html[data-mode="dark"] {
  --background: #0f1319;
  --card: #1d2227;
  --card-foreground: #e2e5e8;
  --muted: #292e34;
  --muted-foreground: #93a0b0;
  --border: rgba(255,255,255,.10);
  --foreground: #ebeef2;
  --accent: #292e34;
  --panel: #161b21;
  --panel-2: #1d2227;
  --shadow: 0 8px 30px rgba(0,0,0,.55);
  --hover: rgba(255,255,255,.06);
}
/* ---------- 亮色：暖白护眼（刻意压低亮度与饱和度，长时间盯盘不刺眼） ----------
   要点：
   ① 底不用纯白 —— 用带暖调的米白 #f4f1ea，蓝光更少
   ② 卡片比底更亮一档但不刺眼 #fbf9f4
   ③ 文字不用纯黑 —— #2f2c28 暖深灰，对比够但不生硬
   ④ 灰色系整体偏暖，避免发青
   ------------------------------------------------------------------ */
html[data-mode="light"] {
  --background: #f4f1ea;      /* 暖米白底（非纯白） */
  --card: #fbf9f4;            /* 卡片：比底亮一点点 */
  --card-foreground: #2f2c28; /* 暖深灰，不用纯黑 */
  --muted: #eae5da;           /* 暖灰填充 */
  --muted-foreground: #6b6459;/* 暖灰次要文字（比原来浅，更柔） */
  --border: #ddd6c8;          /* 暖调边框 */
  --foreground: #2f2c28;
  --accent: #eae5da;
  --panel: #fbf9f4;
  --panel-2: #f0ece3;         /* 内嵌面板：略深于卡片 */
  --shadow: 0 8px 26px rgba(80,68,48,.13);
  --hover: rgba(90,76,52,.055);
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: var(--font);
  background: var(--background);
  color: var(--foreground);
  overflow: hidden;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  /* ★ 纵向 flex：顶栏/情绪带/自选栏 高度自适应，layout 吃掉剩余空间。
     之前用 calc(100% - 52px) 硬算，后加了情绪带+自选栏就溢出了 72px。 */
  display: flex;
  flex-direction: column;
  height: 100dvh;
}
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select { font-family: inherit; }

/* ---------- 顶栏 ---------- */
.topbar {
  display: flex; align-items: center; gap: 14px;
  height: 52px; padding: 0 14px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: relative; z-index: 40;
}
.brand { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 16px; letter-spacing: .3px; white-space: nowrap; }
.brand-mark {
  width: 22px; height: 22px; border-radius: 5px; flex: none;
  background: linear-gradient(135deg, #ef4444 0%, #f59e0b 50%, #22c55e 100%);
}
.topbar-sep { width: 1px; height: 22px; background: var(--border); flex: none; }

/* 市场标签页 */
.tabs { display: flex; gap: 3px; overflow-x: auto; scrollbar-width: none; flex: 1 1 auto; min-width: 0; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  padding: 6px 11px; border-radius: 7px; font-size: 13px; font-weight: 500;
  color: var(--muted-foreground); white-space: nowrap; transition: var(--transition);
}
.tab:hover { background: var(--hover); color: var(--foreground); }
.tab.active { background: var(--brand); color: var(--brand-foreground); font-weight: 600; }

/* 周期切换 */
.periods { display: flex; gap: 2px; background: var(--muted); border-radius: 8px; padding: 3px; flex: none; }
.period {
  padding: 5px 12px; border-radius: 6px; font-size: 12.5px; font-weight: 600;
  color: var(--muted-foreground); transition: var(--transition); white-space: nowrap;
}
.period.active { background: var(--card); color: var(--foreground); box-shadow: 0 1px 3px rgba(0,0,0,.16); }

/* 图标按钮 */
.icon-btn {
  width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center;
  color: var(--muted-foreground); transition: var(--transition); flex: none;
}
.icon-btn:hover { background: var(--hover); color: var(--foreground); }
.icon-btn.on { background: var(--brand); color: var(--brand-foreground); }
.icon-btn svg { width: 17px; height: 17px; }

/* ---------- 主体布局 ---------- */
.layout { display: flex; flex: 1 1 auto; min-height: 0; position: relative; }

/* 侧栏 */
.sidebar {
  width: 206px; flex: none; background: var(--card);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column; overflow-y: auto; min-height: 0;
  padding: 7px 9px; gap: 8px;
  scrollbar-width: thin; scrollbar-color: var(--border) transparent;
  overscroll-behavior: contain;
}
.sidebar::-webkit-scrollbar { width: 5px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
.sidebar::-webkit-scrollbar-thumb:hover { background: var(--muted-foreground); }
.sidebar.hidden { display: none; }
.side-sec-title {
  font-size: 10.5px; font-weight: 700; letter-spacing: .6px;
  color: var(--muted-foreground); text-transform: uppercase;
  margin-bottom: 4px; line-height: 1.25;
}
#boardList > .side-sec-title, .sidebar > div > .side-sec-title { margin-top: 0; }
.side-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 4px 7px; border-radius: 6px; font-size: 12.5px; line-height: 1.5;
  color: var(--foreground); transition: var(--transition); width: 100%; text-align: left;
}
.side-item:hover { background: var(--hover); }
.side-item.active { background: var(--brand); color: var(--brand-foreground); font-weight: 600; }
.side-item .pct { font-variant-numeric: tabular-nums; font-weight: 600; font-size: 12px; }
.pct.up { color: #f2545b; }
.pct.down { color: #2ec27e; }
.pct.flat { color: var(--muted-foreground); }
html[data-up="green"] .pct.up { color: #2ec27e; }
html[data-up="green"] .pct.down { color: #f2545b; }

/* 统计卡 */
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
.stat {
  background: var(--panel-2); border: 1px solid var(--border);
  border-radius: 6px; padding: 4px 7px;
}
.stat-label { font-size: 10px; color: var(--muted-foreground); margin-bottom: 1px; line-height: 1.3; }
.stat-value { font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.3; }
.stat-value.sm { font-size: 12px; }

/* 画布区 */
.canvas-wrap { flex: 1 1 auto; position: relative; min-width: 0; overflow: hidden; background: var(--background); }
#map { display: block; width: 100%; height: 100%; touch-action: none; }

/* 右下角控制条 */
/* 控制条样式已废弃（按钮已移除，滚轮/快捷键替代）——保留选择器以兼容旧缓存 */
.controls {
  position: absolute; right: 12px; bottom: 12px; z-index: 20;
  display: flex; flex-direction: row; gap: 6px;
  padding: 5px; border-radius: 11px;
  background: color-mix(in srgb, var(--card) 82%, transparent);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.ctrl-btn {
  width: 30px; height: 30px; border-radius: 7px;
  background: transparent; border: none;
  display: grid; place-items: center; color: var(--muted-foreground);
  transition: var(--transition);
}
.ctrl-btn:hover { color: var(--foreground); background: var(--panel-2); }
.ctrl-btn svg { width: 15px; height: 15px; }

/* 图例（已移入侧栏 —— 不再浮在画布上遮挡色块） */
.side-legend { display: flex; flex-direction: column; }
.legend {
  position: static;                 /* 取消绝对定位 */
  display: flex; align-items: center; gap: 6px;
  padding: 0 2px; margin-top: 2px;
  background: none; border: none; box-shadow: none;
  white-space: nowrap;
}
.legend-bar { flex: 1 1 auto; height: 7px; border-radius: 4px; min-width: 60px; }
.legend-tick {
  font-variant-numeric: tabular-nums; font-weight: 600;
  color: var(--muted-foreground); font-size: 10px; flex: none;
}
.side-legend .legend-note {
  font-size: 10px; color: var(--muted-foreground);
  margin-top: 3px; padding: 0 2px; line-height: 1.4;
}

/* 悬浮详情卡 */
.hovercard {
  position: absolute; z-index: 30; pointer-events: none;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 10px; padding: 9px 11px; min-width: 168px;
  box-shadow: var(--shadow); display: none;
  font-size: 12.5px;
}
.hovercard.show { display: block; }
.hc-name { font-weight: 700; font-size: 13.5px; margin-bottom: 1px; }
.hc-code { font-size: 11px; color: var(--muted-foreground); font-family: var(--mono); margin-bottom: 6px; }
.hc-row { display: flex; justify-content: space-between; gap: 14px; padding: 2px 0; }
.hc-row span:first-child { color: var(--muted-foreground); }
.hc-row span:last-child { font-weight: 600; font-variant-numeric: tabular-nums; }

/* 详细面板（点击块弹出） */
.detail {
  position: absolute; top: 0; right: 0; bottom: 0; width: 340px; z-index: 50;
  background: var(--card); border-left: 1px solid var(--border);
  box-shadow: var(--shadow); transform: translateX(100%);
  transition: transform .22s cubic-bezier(.4,0,.2,1);
  display: flex; flex-direction: column;
}
.detail.open { transform: translateX(0); }
.detail-head { padding: 14px 14px 10px; border-bottom: 1px solid var(--border); }
.detail-title { font-size: 17px; font-weight: 700; }
.detail-sub { font-size: 12px; color: var(--muted-foreground); margin-top: 3px; font-family: var(--mono); }
.detail-close { position: absolute; top: 11px; right: 11px; }
.detail-body { flex: 1 1 auto; overflow-y: auto; padding: 12px 14px; }
.detail-big { font-size: 30px; font-weight: 700; font-variant-numeric: tabular-nums; margin-bottom: 12px; }
.detail-rows { display: flex; flex-direction: column; gap: 0; }
.dr { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.dr:last-child { border-bottom: none; }
.dr span:first-child { color: var(--muted-foreground); }
.dr span:last-child { font-weight: 600; font-variant-numeric: tabular-nums; }

/* 板块成分列表 */
.rank-row {
  display: flex; align-items: center; gap: 6px; padding: 1px 5px;
  border-radius: 5px; font-size: 12.5px; line-height: 1.5;
  cursor: pointer; transition: var(--transition);
}
.rank-row:hover { background: var(--hover); }
.rank-dot { width: 8px; height: 8px; border-radius: 2px; flex: none; }
.rank-name { flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-pct { font-weight: 700; font-variant-numeric: tabular-nums; font-size: 12px; }

/* 设置面板 */
.drawer {
  position: absolute; top: 0; right: 0; bottom: 0; width: 320px; z-index: 60;
  background: var(--card); border-left: 1px solid var(--border);
  box-shadow: var(--shadow); transform: translateX(100%);
  transition: transform .22s cubic-bezier(.4,0,.2,1);
  display: flex; flex-direction: column;
}
.drawer.open { transform: translateX(0); }
.drawer-head { display: flex; align-items: center; justify-content: space-between;
  padding: 13px 14px; border-bottom: 1px solid var(--border); font-weight: 700; font-size: 15px; }
.drawer-body { flex: 1 1 auto; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 18px; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field > label { font-size: 12px; font-weight: 600; color: var(--muted-foreground); }
.opt-row { display: flex; flex-wrap: wrap; gap: 6px; }
.opt {
  padding: 6px 11px; border-radius: 7px; border: 1px solid var(--border);
  background: var(--panel-2); font-size: 12.5px; color: var(--muted-foreground);
  transition: var(--transition);
}
.opt:hover { border-color: var(--brand); color: var(--foreground); }
.opt.active { background: var(--brand); border-color: var(--brand); color: var(--brand-foreground); font-weight: 600; }

/* 主题色板预览 */
.swatch-row { display: flex; align-items: center; gap: 4px; }
.swatch { width: 17px; height: 17px; border-radius: 4px; border: 1px solid var(--border); }

/* 空状态 */
.empty {
  position: absolute; inset: 0; display: grid; place-items: center;
  color: var(--muted-foreground); font-size: 14px; text-align: center; padding: 24px;
}
.empty.hidden { display: none; }

/* 加载 */
.loading { position: absolute; inset: 0; display: grid; place-items: center; background: var(--background); z-index: 70; }
.loading.hidden { display: none; }
.spinner { width: 30px; height: 30px; border: 3px solid var(--border); border-top-color: var(--brand); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* 悬浮提示条 */
.toast {
  position: absolute; left: 50%; transform: translateX(-50%) translateY(-8px);
  bottom: 62px; z-index: 80; background: var(--card);
  border: 1px solid var(--border); border-radius: 9px;
  padding: 9px 15px; font-size: 13px; box-shadow: var(--shadow);
  opacity: 0; transition: var(--transition); pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* 帮助浮层 */
.modal-mask {
  position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 90;
  display: none; place-items: center; padding: 24px;
}
.modal-mask.open { display: grid; }
.modal {
  background: var(--card); border: 1px solid var(--border); border-radius: 14px;
  max-width: 560px; width: 100%; max-height: 82vh; overflow-y: auto;
  box-shadow: var(--shadow);
}
.modal-head { display: flex; align-items: center; justify-content: space-between;
  padding: 15px 17px; border-bottom: 1px solid var(--border); font-weight: 700; font-size: 16px; }
.modal-body { padding: 17px; font-size: 13.5px; line-height: 1.85; }
.modal-body h4 { margin: 0 0 8px; font-size: 14px; }
.modal-body ul { margin: 0 0 16px; padding-left: 19px; }
.modal-body li { margin-bottom: 5px; color: var(--muted-foreground); }
.modal-body kbd {
  display: inline-block; min-width: 20px; text-align: center;
  padding: 1px 6px; border-radius: 5px; border: 1px solid var(--border);
  background: var(--muted); font-family: var(--mono); font-size: 11.5px;
  font-weight: 600; color: var(--foreground);
}

/* 全屏 */
body.fs .layout { flex: 1 1 auto; }

/* 响应式 */
@media (max-width: 900px) {
  .sidebar { position: absolute; left: 0; top: 0; bottom: 0; z-index: 45; box-shadow: var(--shadow); }
  .detail, .drawer { width: min(340px, 88vw); }
}
/* ============================================================
   大盘云图 · 追加样式 v2
   K线容器 / 状态栏 / 新悬浮卡
   ============================================================ */

/* 顶栏副标题 */
.brand-sub { font-size: 11px; font-weight: 500; color: var(--muted-foreground); letter-spacing: 0; }

/* 实时状态 */
.status {
  display: flex; align-items: center; gap: 6px; flex: none;
  font-size: 11.5px; padding: 5px 10px; border-radius: 7px;
  background: var(--muted); color: var(--muted-foreground);
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.status .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--muted-foreground); flex: none; }
.status.live { color: #2ec27e; background: rgba(46,194,126,.12); }
.status.live .dot { background: #2ec27e; animation: pulse 2s cubic-bezier(.4,0,.6,1) infinite; }
.status.offline { color: var(--muted-foreground); }
@keyframes pulse { 0%,100% { opacity: 1 } 50% { opacity: .35 } }


/* ---------- 悬浮卡（含K线） ---------- */
.hovercard {
  position: absolute; z-index: 30; pointer-events: none;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 12px; padding: 11px 13px 10px;
  width: 480px; box-shadow: var(--shadow); display: none;
}
.hovercard.show { display: block; }
/* 悬浮卡标题栏 —— 随涨跌变色的实心条（对齐原站视觉）
   涨=红底 / 跌=绿底 / 平=灰底；文字一律白色保证对比度 */
.hc-head {
  display: flex; align-items: center; gap: 8px;
  margin: -9px -11px 8px;          /* 抵消卡片内边距，做成通栏 */
  padding: 7px 11px;
  border-radius: 9px 9px 0 0;
  background: var(--hc-head-bg, #2f3542);
  color: #fff;
  transition: background .18s ease;
}
.hc-head.up   { --hc-head-bg: linear-gradient(180deg, #d0343b, #b32b31); }
.hc-head.down { --hc-head-bg: linear-gradient(180deg, #1f9e55, #178044); }
.hc-head.flat { --hc-head-bg: linear-gradient(180deg, #5a6472, #454d59); }
.hc-name { font-weight: 700; font-size: 16px; color: #fff; text-shadow: 0 1px 1px rgba(0,0,0,.22); }
.hc-code { font-size: 11.5px; color: rgba(255,255,255,.78); font-family: var(--mono); }
.hc-price { margin-left: auto; font-weight: 700; font-size: 16px; color: #fff;
            font-variant-numeric: tabular-nums; }
.hc-pct { font-weight: 700; font-size: 16px; color: #fff; font-variant-numeric: tabular-nums;
          padding-left: 8px; margin-left: 2px; border-left: 1px solid rgba(255,255,255,.32); }

#hover-kline {
  display: block; width: 100%; height: 300px;
  border-radius: 7px; background: var(--panel-2);
  border: 1px solid var(--border);
}
.hc-klegend {
  display: flex; gap: 12px; flex-wrap: wrap;
  font-size: 12px; color: var(--muted-foreground);
  margin: 7px 0 9px; font-variant-numeric: tabular-nums; min-height: 15px;
}
.hc-klegend .kma1 { color: #4a9eff; }
.hc-klegend .kma2 { color: #3ad1d6; }
.hc-klegend .kma3 { color: #e05fd8; }
.hc-klegend b { font-weight: 700; }

.hc-meta { display: flex; gap: 16px; font-size: 13.5px; color: var(--muted-foreground); flex-wrap: wrap; }
.hc-meta b { color: var(--foreground); font-weight: 600; font-variant-numeric: tabular-nums; }
.hc-meta2 { font-size: 12.5px; color: var(--muted-foreground); margin-top: 4px; opacity: .85; }

/* ---------- 详情面板里的 K 线 ---------- */
#detail-kline {
  display: block; width: 100%; height: 168px;
  border-radius: 8px; background: var(--panel-2);
  border: 1px solid var(--border); margin-bottom: 6px;
}
.detail-body .hc-klegend { margin-bottom: 12px; }

/* ---------- 侧栏小元素 ---------- */
.side-item .cnt { font-size: 10px; opacity: .5; margin-left: 2px; }
.mini-empty { font-size: 11.5px; color: var(--muted-foreground); padding: 3px 4px; }
.rank-name .code { color: var(--muted-foreground); font-size: 10.5px; font-family: var(--mono); margin-left: 3px; }

/* 搜索框 */
#search-input {
  width: 100%; padding: 11px 13px; border-radius: 9px;
  border: 1px solid var(--border); background: var(--panel-2);
  color: var(--foreground); font-size: 14px; outline: none;
}
#search-input:focus { border-color: var(--brand); }
#search-results { margin-top: 12px; max-height: 46vh; overflow-y: auto; }

/* 禁用的设置项 */
.opt[disabled] { cursor: default; opacity: .85; }
.opt[disabled]:hover { border-color: var(--brand); }

/* 亮色模式下悬浮卡 K 线的网格线要换色 */
html[data-mode="light"] .hc-klegend { color: #5c6b7f; }

/* 亮色模式下 K 线网格线用暖灰，减少线条存在感 */
html[data-mode="light"] .hc-klegend { color: #6b6459; }
/* ============================================================
   盯盘增强：情绪带 / 自选栏 / 动效
   ------------------------------------------------------------
   动效原则：只在"变化"和"操作"时动，绝不重复播放。
   ★ 不做 prefers-reduced-motion 降级 —— 用户系统关了动画，
     守卫会静默禁用，他会以为功能没做出来。
   ============================================================ */

/* ---------- 自选栏 ---------- */
.watchbar {
  display: flex; align-items: center; gap: 10px; flex: none;
  min-height: 42px; padding: 5px 12px;
  background: var(--panel-2); border-bottom: 1px solid var(--border);
  overflow-x: auto; overflow-y: hidden; scrollbar-width: thin;
}
.watchbar::-webkit-scrollbar { height: 5px; }
.watchbar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
.wb-label {
  display: flex; align-items: center; gap: 5px; flex: none;
  font-size: 11px; font-weight: 700; letter-spacing: .5px;
  color: var(--muted-foreground); text-transform: uppercase;
}
.wb-label svg { width: 13px; height: 13px; }
.wb-items { display: flex; gap: 7px; flex: 1 1 auto; }
.wb-chip {
  display: flex; align-items: center; gap: 7px; flex: none;
  padding: 5px 9px; border-radius: 8px;
  background: var(--card); border: 1px solid var(--border);
  cursor: pointer; transition: var(--transition);
  position: relative; overflow: hidden;
}
.wb-chip:hover { border-color: var(--brand); transform: translateY(-1px); }
.wb-chip .wb-name { font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.wb-chip .wb-pct { font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.wb-chip .wb-spark { width: 38px; height: 16px; flex: none; opacity: .9; }
.wb-chip .wb-del {
  width: 15px; height: 15px; border-radius: 4px; flex: none;
  display: grid; place-items: center; color: var(--muted-foreground);
  opacity: 0; transition: var(--transition);
}
.wb-chip:hover .wb-del { opacity: 1; }
.wb-chip .wb-del:hover { background: var(--destructive, #d73431); color: #fff; }
.wb-chip .wb-del svg { width: 10px; height: 10px; }
.wb-empty { font-size: 12px; color: var(--muted-foreground); padding: 2px 4px; }
.wb-empty b { color: var(--foreground); font-weight: 700; }
.wb-empty.hidden { display: none; }

/* 自选异动：整条脉冲一下（一次性，不循环） */
@keyframes wbPulse {
  0%   { box-shadow: 0 0 0 0 rgba(255,236,180,.75); }
  100% { box-shadow: 0 0 0 9px rgba(255,236,180,0); }
}
.wb-chip.pulse { animation: wbPulse .85s cubic-bezier(.2,.7,.3,1) 1; }
.wb-chip.pulse-down { animation: wbPulseDown .85s cubic-bezier(.2,.7,.3,1) 1; }
@keyframes wbPulseDown {
  0%   { box-shadow: 0 0 0 0 rgba(196,224,255,.75); }
  100% { box-shadow: 0 0 0 9px rgba(196,224,255,0); }
}

/* ---------- 星标按钮 ---------- */
.star-btn {
  position: absolute; top: 42px; right: 44px;
  width: 28px; height: 28px; border-radius: 7px;
  display: grid; place-items: center;
  color: var(--muted-foreground); transition: var(--transition);
}
.star-btn:hover { background: var(--hover); color: var(--foreground); }
.star-btn svg { width: 15px; height: 15px; }
.star-btn.on { color: #e8b64c; }
.star-btn.on svg { fill: #e8b64c; }
.star-btn.bump { animation: starBump .34s cubic-bezier(.3,1.6,.5,1) 1; }
@keyframes starBump {
  0%   { transform: scale(1); }
  45%  { transform: scale(1.28); }
  100% { transform: scale(1); }
}

/* ---------- 悬浮卡淡入（操作反馈，120ms） ---------- */
@keyframes hcIn {
  from { opacity: 0; transform: scale(.97); }
  to   { opacity: 1; transform: scale(1); }
}
.hovercard.show { animation: hcIn .12s cubic-bezier(.2,.8,.3,1) 1; }

/* ---------- 统计数字变化时轻微高亮 ---------- */
@keyframes numFlash {
  0%   { background: rgba(255,236,180,.30); }
  100% { background: transparent; }
}
.stat-value.flash { animation: numFlash .9s ease-out 1; border-radius: 4px; }

/* ---------- 异动提示条（右上角浮出，一次性） ---------- */
.move-toast {
  position: absolute; top: 12px; right: 14px; z-index: 75;
  display: flex; flex-direction: column; gap: 6px;
  pointer-events: none; max-width: 300px;
}
.move-item {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 11px; border-radius: 9px;
  background: var(--card); border: 1px solid var(--border);
  box-shadow: var(--shadow); font-size: 12.5px;
  animation: mvIn .28s cubic-bezier(.2,.9,.3,1) 1;
}
.move-item.mv-out { animation: mvOut .34s ease-in 1 forwards; }
@keyframes mvIn {
  from { opacity: 0; transform: translateX(18px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes mvOut {
  to { opacity: 0; transform: translateX(18px); }
}
.move-item .mv-name { font-weight: 600; }
.move-item .mv-delta { font-weight: 700; font-variant-numeric: tabular-nums; }
.move-item .mv-arrow { color: var(--muted-foreground); font-size: 11px; }

/* ---------- 交易所标签 ---------- */
.wb-chip .wb-ex { font-size: 9.5px; color: var(--muted-foreground); font-family: var(--mono); }

/* 全屏时隐藏情绪带，纯云图（自选已在侧栏内，随侧栏一起隐藏） */

/* 响应式 */
@media (max-width: 900px) {
  .watchbar { min-height: 38px; }
  .move-toast { max-width: 200px; }
}

/* ============================================================
   自选移入侧栏：改为紧凑竖向行
   ============================================================ */
.side-watch { display: flex; flex-direction: column; }
.side-watch .wb-items {
  display: flex; flex-direction: column; gap: 2px;
  flex: none; max-height: 132px; overflow-y: auto;
  scrollbar-width: thin;
}
.side-watch .wb-items::-webkit-scrollbar { width: 4px; }
.side-watch .wb-items::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* 自选行：名称 + 迷你走势 + 涨跌，一行放下 */
.wb-chip {
  display: flex; align-items: center; gap: 6px;
  padding: 3px 6px; border-radius: 6px;
  background: transparent; border: 1px solid transparent;
  cursor: pointer; transition: var(--transition);
  position: relative; overflow: hidden; flex: none;
  line-height: 1.5;
}
.wb-chip:hover { background: var(--hover); border-color: var(--border); transform: none; }
.wb-chip .wb-name {
  font-size: 12px; font-weight: 600; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
  flex: 1 1 auto; min-width: 0;
}
.wb-chip .wb-spark { width: 30px; height: 13px; flex: none; opacity: .85; }
.wb-chip .wb-pct {
  font-size: 11.5px; font-weight: 700;
  font-variant-numeric: tabular-nums; flex: none;
}
.wb-chip .wb-del {
  width: 14px; height: 14px; border-radius: 4px; flex: none;
  display: grid; place-items: center; color: var(--muted-foreground);
  opacity: 0; transition: var(--transition);
}
.wb-chip:hover .wb-del { opacity: 1; }
.wb-chip .wb-del:hover { background: var(--destructive, #d73431); color: #fff; }
.wb-chip .wb-del svg { width: 9px; height: 9px; }
.wb-chip .wb-ex { display: none; }

/* 空态：侧栏里要更紧凑 */
.side-watch .wb-empty {
  font-size: 10.5px; color: var(--muted-foreground);
  padding: 2px 4px; line-height: 1.5;
}
.side-watch .wb-empty b { color: var(--foreground); font-weight: 700; }
.side-watch .wb-empty.hidden { display: none; }

/* K线图片兜底样式（新浪静态图，原站同款） */
.hc-klinebox { position: relative; }
/* 静态图片（本地 file:// 无代理时的降级方案）
   ★ 新浪图原始尺寸 545x300 —— 高度设 300 可 1:1 显示不模糊 */
.hc-kimg {
  display: block; width: 100%; height: 300px;
  object-fit: contain; border-radius: 7px;
  background: var(--panel-2); border: 1px solid var(--border);
}
#dt-body .hc-kimg { height: 340px; border-radius: 8px; }

/* ============================================================
   全屏显示模式（用户可选）
   ------------------------------------------------------------
   blocks  = 只保留红绿色块区域（最纯粹的盯盘视图）
   sidebar = 保留侧栏（色块 + 自选/统计/榜单）
   all     = 保留全部（顶栏 + 情绪带 + 侧栏）
   ============================================================ */

/* 任何全屏模式下，色块区域都吃掉全部剩余空间 */
body.fs .layout { flex: 1 1 auto; min-height: 0; }

/* --- blocks：只留色块 --- */
body.fs.fs-hide-top .topbar { display: none; }
body.fs.fs-hide-sidebar .sidebar { display: none; }

/* --- sidebar：留侧栏，隐藏顶栏与情绪带 --- */
body.fs.fs-keep-sidebar .topbar { display: none; }

/* 全屏时右上角异动提示缩小一点，别抢戏 */
body.fs .move-toast { max-width: 260px; top: 10px; right: 12px; }
