/* app.css — 暖色简约风 */
:root {
  --bg: #faf5ee;            /* 暖米色底 */
  --fg: #3d2b1f;            /* 暖深棕字 */
  --muted: #97826f;         /* 暖灰棕 */
  --accent: #c05621;        /* 赤陶橙 (主交互色) */
  --accent-soft: #f6e3d3;   /* 赤陶浅底 */
  --up: #d4380d;            /* 涨: A股红 (行情语义, 不随主题) */
  --down: #1a7f37;          /* 跌: A股绿 */
  --card: #fffdf8;          /* 奶油卡片 */
  --line: #ecdfd0;          /* 暖细线 */
  --nav: #43291a;           /* 导航暖深棕 */
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font: 14px/1.5 -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
}

/* ── 顶部导航: 暖深棕 + 像素貔貅 ─────────────────────────── */
.topnav {
  display: flex; align-items: center; gap: 14px;
  padding: 10px 20px; background: var(--nav); color: #f7ece0;
}
.topnav .brand {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 700; margin-right: 6px; color: #fff;
  text-decoration: none;
  image-rendering: pixelated;
}
.topnav .brand img { width: 24px; height: 24px; image-rendering: pixelated; }
.topnav a { color: #d9c4ae; text-decoration: none; padding: 4px 10px; border-radius: 6px; }
.topnav a.active { color: #fff; background: var(--accent); }
.topnav a:hover { color: #fff; background: rgba(255, 255, 255, 0.12); }
.nav-right { margin-left: auto; color: #b39a82; font-size: 12px; }

/* ── 登录态 / 用户管理入口 ─────────────────────────────── */
.nav-user { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: #d9c4ae; }
.nav-user #nav-username { color: #f2c49b; font-weight: 600; }
.nav-user a { color: #d9c4ae; }
.nav-user a:hover { color: #fff; }

/* ── 登录页 ────────────────────────────────────────────── */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, #faf5ee 0%, #f3e2ce 55%, #ecd9c0 100%);
}
.login-card {
  width: min(360px, 92vw); padding: 34px 34px 28px; text-align: center;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 10px 34px rgba(80, 50, 20, 0.10);
}
.login-logo { width: 64px; height: 64px; image-rendering: pixelated; margin-bottom: 6px; }
.login-card h1 { margin: 0 0 2px; font-size: 20px; color: var(--fg); letter-spacing: 1px; }
.login-sub { margin: 0 0 20px; color: var(--muted); font-size: 12px; }
.login-card label {
  display: block; text-align: left; margin-bottom: 14px;
  font-size: 12px; color: var(--muted);
}
.login-card label span { display: block; margin-bottom: 5px; }
.login-card input {
  width: 100%; padding: 9px 11px; font-size: 14px;
  border: 1px solid var(--line); border-radius: 8px;
  background: #fff; color: var(--fg); outline: none;
}
.login-card input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(192, 86, 33, 0.12); }
.login-card button {
  width: 100%; padding: 10px 0; margin-top: 4px; font-size: 15px; letter-spacing: 6px;
  color: #fff; background: var(--accent); border: none; border-radius: 8px; cursor: pointer;
}
.login-card button:hover { background: #a8491b; }
.login-card button:disabled { opacity: 0.6; cursor: default; }
.login-msg {
  margin-top: 12px; padding: 8px 10px; font-size: 13px;
  color: #9a4a12; background: #fdeee0; border: 1px solid #f3c9a6; border-radius: 6px;
}

/* ── 用户管理页操作列 ──────────────────────────────────── */
.op-btn {
  padding: 3px 10px; margin-right: 6px; font-size: 12px;
  border: 1px solid var(--line); border-radius: 6px; background: #fff;
  color: var(--fg); cursor: pointer;
}
.op-btn:hover { border-color: var(--accent); color: var(--accent); }
.op-btn.danger { color: #b3261e; }
.op-btn.danger:hover { border-color: #b3261e; }

/* ── 首页 hero: 像素貔貅 + 标语 ─────────────────────────── */
.hero {
  display: flex; align-items: center; gap: 18px;
  padding: 22px 24px; margin-bottom: 20px;
  background: linear-gradient(135deg, #fff8ec 0%, #fdeede 100%);
  border: 1px solid var(--line); border-radius: 12px;
}
.hero img { width: 72px; height: 72px; image-rendering: pixelated; }
.hero .hero-text h1 { margin: 0 0 4px; font-size: 20px; color: var(--fg); }
.hero .hero-text p { margin: 0; color: var(--muted); font-size: 13px; }

/* ── 降级横幅 ──────────────────────────────────────────── */
.banner { padding: 8px 20px; font-size: 13px; }
.banner-warn { background: #fdeee0; color: #9a4a12; border-bottom: 1px solid #f3c9a6; }
.banner-warn a { margin-left: 12px; color: #9a4a12; }
.banner-info { background: #eaf3ea; color: #2f6b3a; border-bottom: 1px solid #bcd9c2; }

/* ── 布局 ──────────────────────────────────────────────── */
.container { max-width: 1800px; margin: 0 auto; padding: 20px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 16px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-bottom: 24px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; }
.card h3 { margin: 0 0 8px; font-size: 13px; color: var(--muted); font-weight: 600; }
.big { font-size: 22px; font-weight: 700; }
.up { color: var(--up); } .down { color: var(--down); }

/* 盘中放量榜: 连续放量置顶行高亮 (v0.4 2026-08-19, 2026-09-03 恢复) */
#vol-surge-table tr.pinned {
  background: rgba(255, 77, 79, 0.08);
  font-weight: 600;
}
.ts-badge { margin-top: 8px; font-size: 11px; color: var(--muted); }

.section { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 16px; }
.section h2 { margin: 0 0 12px; font-size: 15px; }

/* ── 筛选/按钮: 赤陶橙主色 ─────────────────────────────── */
.filter-bar { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 12px; align-items: end; }
.filter-bar label { font-size: 12px; color: var(--muted); display: flex; flex-direction: column; gap: 4px; }
.filter-bar input, .filter-bar select {
  padding: 5px 8px; border: 1px solid var(--line); border-radius: 6px; font-size: 13px;
  background: #fff; color: var(--fg);
}
.filter-bar button {
  padding: 6px 14px; border: 1px solid var(--line); border-radius: 6px;
  background: #fff; color: var(--fg); cursor: pointer; font-size: 13px;
}
.filter-bar button[type="submit"] { background: var(--accent); color: #fff; border-color: var(--accent); }
.filter-bar button[type="submit"]:hover { background: #a8491b; }
.pager { display: flex; justify-content: center; margin-top: 14px; }
.pager button { padding: 6px 22px; font-size: 13px; }

/* ── 表格 ──────────────────────────────────────────────── */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); font-size: 13px; }
.table th { color: var(--muted); font-weight: 600; font-size: 12px; }
.table tr:hover td { background: #fdf4ea; }
.table a { color: var(--accent); }

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

/* ── 风格观察 + 分时图 ─────────────────────────────────── */
.verdict-badge {
  float: right; font-size: 12px; font-weight: 600; color: var(--accent);
  background: var(--accent-soft); border-radius: 6px; padding: 3px 10px;
}
.chart-block { margin-top: 14px; }
.chart-block h3 { margin: 0 0 6px; font-size: 13px; color: var(--muted); font-weight: 600; }
.legend { display: flex; gap: 14px; margin-bottom: 4px; }
.legend-item { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--fg); }
.legend-item i { width: 14px; height: 3px; border-radius: 2px; display: inline-block; }
.overlay-legend { flex-wrap: wrap; gap: 6px 12px; }
.overlay-item { cursor: pointer; padding: 1px 6px; border-radius: 4px; }
.overlay-item:hover { background: #fdf4ea; }
.overlay-item.active { background: var(--accent-soft); font-weight: 600; }
/* 板块榜单: 名字+涨幅+金额+占比色条 */
.sector-col-title { margin: 0 0 8px; font-size: 13px; font-weight: 600; }
.sector-item {
  position: relative; display: flex; align-items: center; gap: 8px;
  padding: 6px 8px 6px 10px; margin-bottom: 4px; border-radius: 6px;
  cursor: pointer; overflow: hidden; border: 1px solid transparent;
}
.sector-item:hover { background: #fdf4ea; }
.sector-item.active { background: var(--accent-soft); border-color: var(--accent); }
.sector-bar {
  position: absolute; left: 0; top: 0; bottom: 0; opacity: 0.16;
  border-radius: 6px 0 0 6px;
}
.sector-item.active .sector-bar { opacity: 0.32; }
.sector-name { flex: 1; z-index: 1; font-size: 13px; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; }
.sector-pct { z-index: 1; width: 56px; text-align: right; font-size: 12px; }
.sector-amt { z-index: 1; width: 64px; text-align: right; font-size: 13px; font-weight: 600; }
.trend-svg { width: 100%; height: auto; display: block; background: #fffdf8; }
.board-flow-svg { height: auto; }
.board-flow-svg .bf-label-hit { cursor: pointer; }
.board-flow-svg .bf-label-hit:hover + rect,
.board-flow-svg .bf-label-hit:hover { fill: rgba(192, 86, 33, 0.08); }
.bf-play-btn {
  margin-left: 10px; padding: 2px 12px; font-size: 12px; font-weight: 600;
  border: 1px solid var(--border); border-radius: 14px; cursor: pointer;
  background: var(--card); color: var(--accent);
  vertical-align: middle; transition: background 0.15s;
}
.bf-play-btn:hover { background: var(--accent-soft); }
.gidx-cards .gidx-card { cursor: pointer; transition: border-color 0.15s, transform 0.1s; min-width: 128px; }
.gidx-cards .gidx-card:hover { border-color: var(--accent); transform: translateY(-1px); }
.gidx-tabs { display: flex; gap: 4px; margin-bottom: 8px; }
.gidx-tab { border: 1px solid var(--border); background: var(--card); color: var(--muted-foreground);
  padding: 4px 16px; border-radius: 6px; font-size: 13px; cursor: pointer; transition: all 0.15s; }
.gidx-tab:hover { border-color: var(--accent); color: var(--foreground); }
.gidx-tab.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.gidx-tag { font-size: 10px; font-weight: 500; color: var(--muted);
  border: 1px solid var(--border); border-radius: 8px; padding: 0 6px;
  margin-left: 4px; vertical-align: 2px; }

/* ── 指数卡片内嵌迷你分时 sparkline ──────────────────────────────── */
.gidx-spark { margin-top: 6px; height: 40px; overflow: hidden; position: relative; }
.gidx-spark-svg { width: 100%; height: 40px; display: block; }
.gidx-spark-empty { font-size: 11px; text-align: center; line-height: 40px; }

/* ── 悬停浮窗: 鼠标右上方弹出完整分时图 ──────────────────────────── */
.gidx-hover-pop {
  position: fixed; z-index: 9999; display: none;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 10px; padding: 10px 12px 6px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.18), 0 2px 8px rgba(0,0,0,0.10);
  width: 420px; pointer-events: none;
}
.gidx-hover-head { font-size: 13px; margin-bottom: 4px; white-space: nowrap; }
.gidx-hover-head .up { color: #c0392b; font-weight: 600; }
.gidx-hover-head .down { color: #1a7f37; font-weight: 600; }
.gidx-hover-pop .trend-svg { width: 100%; height: auto; }
.axis-text { font-size: 10px; fill: var(--muted); }

/* ── 抽屉 ──────────────────────────────────────────────── */
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(420px, 90vw);
  background: var(--card); border-left: 1px solid var(--line); box-shadow: -4px 0 16px rgba(80, 50, 20, .10);
  padding: 16px; z-index: 10;
}
.drawer header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; font-weight: 600; }
.drawer pre { background: var(--bg); padding: 12px; border-radius: 6px; overflow: auto; font-size: 12px; }

.footer { text-align: center; color: var(--muted); font-size: 11px; padding: 18px 0 26px; }

/* ---------------- 涨停板: 连板梯队 (2026-09-04) ---------------- */
.zt-ladder { display:flex; flex-wrap:wrap; gap:8px; }
.zt-lv {
  display:flex; align-items:center; gap:8px;
  padding:6px 10px; border-radius:8px;
  background:#faf3e6; border:1px solid #eadfca;
}
.zt-lv.zt-lv-hot {
  background:#fdeae0; border-color:#e8b795;
}
.zt-lv-badge {
  font-weight:700; font-size:13px; color:#c05621;
  min-width:44px; text-align:center;
}
.zt-lv-hot .zt-lv-badge { color:#b93a1f; font-size:14px; }
.zt-lv-count { font-size:12px; color:#78716c; }
.zt-lv-reps { font-size:12px; color:#57534e; max-width:520px; }

/* 版面加宽后: 数据表单元格默认不折行（涨停板等宽表; 2026-09-04） */
.table th, .table td { white-space: nowrap; }

/* 可排序表头 (2026-09-04) */
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { color: var(--accent); }
.sort-arrow { font-size: 11px; opacity: 0.7; }

/* 涨停板 11 列宽表: 紧凑间距 + 首列固定宽避免挤压 (2026-09-04) */
#limit-up-table th, #limit-up-table td { padding: 7px 8px; font-size: 12px; }

/* 回到顶部按钮 (2026-09-04) */
#back-to-top {
  position: fixed; right: 24px; bottom: 24px; z-index: 999;
  border: none; border-radius: 22px; padding: 0 16px; height: 40px;
  background: var(--accent); color: #fff; cursor: pointer;
  box-shadow: 0 2px 12px rgba(0,0,0,0.25);
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 600; line-height: 1;
  transition: opacity 0.2s, transform 0.2s;
}
#back-to-top:hover { transform: translateY(-2px); }
#back-to-top:active { transform: translateY(0); }
#back-to-top .bt-icon {
  width: 0; height: 0; font-size: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-bottom: 8px solid #fff;
}
#back-to-top[hidden] { display: none; }

/* 日K hover tooltip (2026-09-05 完整版) */
.kline-tooltip {
  position: absolute; z-index: 9999;
  background: #fffdf8; border: 1px solid var(--border, #e0d5c0);
  border-radius: 8px; padding: 0; box-shadow: 0 4px 24px rgba(0,0,0,0.18);
  width: 900px; font-size: 12px;
}
.kline-tip-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 6px 10px; border-bottom: 1px solid #f0e6d0; gap: 8px;
}
.kline-tip-title { font-weight: 600; color: var(--accent, #b93a2b); font-size: 13px; white-space: nowrap; }
.kline-tip-periods { display: flex; gap: 3px; flex-wrap: wrap; }
.kline-tip-zoom { display: flex; gap: 3px; margin-left: auto; }
.kline-zoom-btn {
  border: 1px solid #e0d5c0; border-radius: 4px; padding: 1px 8px;
  font-size: 14px; cursor: pointer; background: #fffdf8; color: var(--muted, #a0927e);
  line-height: 1.3;
}
.kline-zoom-btn:hover { background: #f0e6d0; }
.kline-tab {
  border: 1px solid #e0d5c0; border-radius: 4px; padding: 2px 8px;
  font-size: 11px; cursor: pointer; background: #fffdf8; color: var(--muted, #a0927e);
  line-height: 1.4;
}
.kline-tab.active { background: var(--accent, #b93a2b); color: #fff; border-color: var(--accent, #b93a2b); }
.kline-tip-main { padding: 4px 6px 0; }
.kline-tip-sub { padding: 0 6px; }
.kline-tip-indicators { display: flex; gap: 3px; padding: 4px 10px 6px; border-top: 1px solid #f0e6d0; }
.kline-ind-tab {
  border: 1px solid #e0d5c0; border-radius: 4px; padding: 2px 10px;
  font-size: 11px; cursor: pointer; background: #fffdf8; color: var(--muted, #a0927e);
}
.kline-ind-tab.active { background: var(--accent, #b93a2b); color: #fff; border-color: var(--accent, #b93a2b); }
.kline-tooltip .trend-svg { width: 100%; height: auto; background: transparent; }
.kline-hover { position: relative; }
