:root {
  --bg: #0b0e14;
  --panel: #141922;
  --panel-2: #1a212c;
  --border: #242c39;
  --text: #dfe6ef;
  --muted: #7f8b9c;
  --up: #f0453a;
  --down: #12c46b;
  --accent: #4a8cff;
  --warn: #f0b23a;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

/* ------------------------------- 顶栏 ------------------------------- */
.topbar {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 12px 22px;
  background: linear-gradient(180deg, #151b25 0%, #101520 100%);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
  flex-wrap: wrap;
}

.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 16px; letter-spacing: .3px; white-space: nowrap; }
.logo { font-size: 20px; }

/* ---------------------------- 主导航 ---------------------------- */
.mainnav {
  display: flex;
  gap: 4px;
  padding: 3px;
  border-radius: 10px;
  background: #0d121a;
  border: 1px solid var(--border);
  white-space: nowrap;
  /* 导航项变多后（6 个），窄屏必须允许换行，否则会把整页撑宽 */
  flex-wrap: wrap;
}
.mainnav a {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 15px;
  border-radius: 7px;
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
  transition: all .13s;
}
.mainnav a:hover { color: var(--text); background: #1a2230; }
.mainnav a.active {
  background: #23304a;
  color: #8fb6ff;
  font-weight: 600;
  box-shadow: inset 0 0 0 1px #2f4166;
}
.mainnav .nav-ico { font-size: 14px; }

/*
 * ---------------- 顶栏：高度 + 字号统一（2026-10-09 版，用户指定以此为准） ----------------
 *
 * 用户原话：「这一个版本改完的结果就是我想要的」——所以下面这组规则**不要动、不要回退**。
 *
 * 之前同一行里混着 4 种字号：导航 13、标签按钮 12.5、查询按钮 14、日期框 13、
 * 轮动状态 11.5、快捷股票 12、自选输入框 13。现在除 logo 图标外，全部指向 --topbar-font。
 * 高度也提了一点：padding 12px → 14px，并加 min-height: 64px（窄屏 58px）；
 * 控件统一 min-height: 34px，不再一个 32 一个 38。
 */
:root { --topbar-font: 14px; }
.topbar { padding: 14px 22px; min-height: 64px; }
.topbar .brand-name,
.topbar .mainnav a,
.topbar .mainnav .nav-ico,
.topbar .tab,
.topbar .btn-primary,
.topbar .lan-btn,
.topbar .hm-date label,
.topbar .wv-status,
.topbar .wv-status span,
.topbar input,
.topbar select,
.topbar .chip,
.topbar .wl-add,
.topbar .wl-add input,
.topbar .val-status,
.topbar .val-status span,
.topbar #addInput,
.topbar #searchInput,
.topbar #dateInput { font-size: var(--topbar-font); }

.topbar .logo { font-size: calc(var(--topbar-font) + 5px); }

.topbar .tab,
.topbar .btn-primary { display: inline-flex; align-items: center; min-height: 34px; }
.topbar .tab { padding: 6px 12px; }
.topbar .btn-primary { padding: 7px 18px; }
.topbar .mainnav a { padding: 8px 16px; }
.topbar .chip { padding: 5px 11px; }

.search-wrap { position: relative; display: flex; gap: 8px; flex: 1 1 340px; max-width: 520px; }

#searchInput {
  flex: 1;
  padding: 9px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #0d121a;
  color: var(--text);
  outline: none;
  font-size: 14px;
  transition: border-color .15s;
}
#searchInput:focus { border-color: var(--accent); }
#searchInput::placeholder { color: #55606f; }

.btn-primary {
  padding: 9px 20px;
  border-radius: 8px;
  border: none;
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.btn-primary:hover { background: #3c7ae8; }

.suggest {
  position: absolute;
  top: 44px;
  left: 0;
  right: 76px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  display: none;
  z-index: 100;
  max-height: 320px;
  overflow-y: auto;
  box-shadow: 0 12px 32px rgba(0,0,0,.5);
}
.suggest.show { display: block; }
.suggest-item { padding: 9px 14px; cursor: pointer; display: flex; justify-content: space-between; gap: 10px; }
.suggest-item:hover, .suggest-item.active { background: #232c3a; }
.suggest-item .s-name { font-weight: 600; }
.suggest-item .s-code { color: var(--muted); font-size: 12px; }

.quick { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  padding: 6px 11px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: #171f2b;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
}
.chip:hover { color: var(--text); border-color: var(--accent); }

/* ----------------------------- 大盘状态条 ----------------------------- */
.market-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 22px;
  padding: 7px 22px;
  background: #0d121a;
  border-bottom: 1px solid var(--border);
  font-size: 12.5px;
  align-items: baseline;
}
.market-item { display: flex; gap: 7px; align-items: baseline; white-space: nowrap; }
.market-item .m-label { color: var(--muted); }
.market-item .m-val { font-variant-numeric: tabular-nums; }
/* 广度数据和指数之间加一条分隔，视觉上分成「指数 / 广度」两组 */
.market-breadth:first-of-type { padding-left: 14px; border-left: 1px solid #1e2733; }
.market-breadth .m-val { font-weight: 600; }

/* ------------------------------- 布局 ------------------------------- */
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 14px;
  padding: 14px 22px 0;
  /*
   * 用户 2026-10-11：「整体高度与右边板块保持一致……可以灵活对齐」。
   * 用 stretch 让左右两栏同高（原来 start 时左栏自然高度、底部和右栏差一两百像素），
   * 多出来的高度交给左栏的分时卡片吸收（见 .intraday-card 的 flex:1），
   * K 线图保持 720px 固定，不会被拉长。
   */
  align-items: stretch;
}

.chart-col {
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  min-width: 0;
}

.stock-header {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.stock-title {
  display: flex; align-items: baseline; gap: 10px;
  flex-wrap: wrap; row-gap: 6px; min-width: 0; max-width: 100%;
}
.stock-title h1 { margin: 0; font-size: 20px; font-weight: 700; }
.stock-title .code { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.stock-price { display: flex; align-items: baseline; gap: 10px; }
.stock-price .price { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stock-price .change { font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }

.live-box { display: flex; flex-direction: column; gap: 3px; padding-left: 14px; border-left: 1px solid var(--border); }
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; font-weight: 700; padding: 2px 9px; border-radius: 20px;
  background: #1c2432; color: var(--muted); white-space: nowrap;
}
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.live { background: rgba(240,69,58,.14); color: #ff6b60; }
.badge.live::before { animation: pulse 1.4s infinite; }
.badge.auction { background: rgba(240,178,58,.14); color: var(--warn); }
.badge.lunch, .badge.pre { background: rgba(240,178,58,.12); color: var(--warn); }
.badge.closed { background: rgba(74,140,255,.12); color: #7ea6f0; }
.badge.holiday { background: #1c2432; color: #6d7887; }
.updated { font-size: 11px; color: #5b6675; font-variant-numeric: tabular-nums; white-space: nowrap; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .25; } }

.tab.on { color: #8fb6ff; }
.tab.on::after { content: ' ●'; font-size: 8px; }
.stock-meta { display: flex; gap: 18px; margin-left: auto; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.stock-meta b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }

.up { color: var(--up) !important; }
.down { color: var(--down) !important; }
.flat { color: var(--muted) !important; }

/* 加自选按钮 */
.star-btn {
  padding: 4px 11px; border-radius: 7px; border: 1px solid var(--border);
  background: transparent; color: var(--muted); font-size: 12px; cursor: pointer;
  white-space: nowrap;
}
.star-btn:hover { border-color: #6b7686; color: var(--text); }
.star-btn.on { background: rgba(240,178,58,.15); border-color: rgba(240,178,58,.45); color: var(--warn); font-weight: 600; }
#backBoardBtn {
  position: fixed;
  right: 18px;
  bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  z-index: 90;
  background: rgba(35,62,104,.96);
  border-color: #5d83bd;
  color: #e8f0ff;
  box-shadow: 0 6px 18px rgba(0,0,0,.3);
}

/* 所属板块条 */
.sector-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 9px 18px; border-bottom: 1px solid var(--border);
  font-size: 12px; background: #12171f;
}
.sector-bar:empty { display: none; }
.sector-bar .sb-label { color: #566273; font-size: 11.5px; }
.sector-tag {
  padding: 3px 10px; border-radius: 20px; font-size: 11.5px;
  background: #1c2432; color: #93a1b3; border: 1px solid #26303d;
}
.sector-tag.ind { background: rgba(74,140,255,.14); color: #8fb6ff; border-color: rgba(74,140,255,.3); }
.sector-tag.reg { background: rgba(18,196,107,.12); color: #5fd39a; border-color: rgba(18,196,107,.28); }

.toolbar {
  display: flex;
  gap: 18px;
  padding: 9px 18px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  align-items: center;
  background: #12171f;
}
.group { display: flex; align-items: center; gap: 4px; }
.group.right { margin-left: auto; }
/* 实时控件做紧凑处理，避免撑宽工具栏导致换行 */
.group.right .tab { padding: 4px 8px; font-size: 12px; }
.group-label { color: #566273; font-size: 11.5px; margin-right: 4px; letter-spacing: .5px; }
.tab {
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: 12.5px;
  cursor: pointer;
  transition: all .12s;
}
.tab:hover { color: var(--text); background: #1d2532; }
.tab.active { background: #23304a; color: #8fb6ff; border-color: #2f4166; }
.tab.off { opacity: .38; }

.chart { width: 100%; height: 720px; }
.chart-tip { padding: 10px 18px; color: var(--muted); font-size: 12.5px; border-top: 1px solid var(--border); }

/* ------------------------------ 侧边栏 ------------------------------ */
/*
 * 右栏：让卡片把整列高度撑满并把多余空间均分到卡片之间（space-between），
 * 这样右栏底边与左栏对齐，不会在「风险提示」下面留一大块空白。
 * 注意只给右栏 stretch，左栏保持自然高度，避免 K 线图卡片内部出现空白。
 */
.side-col {
  display: flex; flex-direction: column; gap: 12px; min-width: 0;
  align-self: stretch; justify-content: space-between;
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
}
.card-title {
  font-size: 13px;
  font-weight: 700;
  color: #a9b6c7;
  letter-spacing: .6px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* 研判卡片 */
.verdict-body { display: flex; gap: 16px; align-items: center; }
.score-ring { position: relative; width: 116px; height: 116px; flex: 0 0 116px; }
.ring { width: 116px; height: 116px; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: #232c39; stroke-width: 9; }
.ring-fg {
  fill: none;
  stroke: var(--accent);
  stroke-width: 9;
  stroke-linecap: round;
  stroke-dasharray: 326.7;
  stroke-dashoffset: 326.7;
  transition: stroke-dashoffset .6s ease, stroke .3s;
}
.ring-text {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.ring-text span { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1; }
.ring-text small { color: var(--muted); font-size: 10.5px; margin-top: 4px; }

.verdict-info { flex: 1; min-width: 0; }
.advice { font-size: 19px; font-weight: 700; margin-bottom: 3px; }
.action { font-size: 12.5px; color: #97a4b5; margin-bottom: 10px; }
.metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; }
.metrics > div { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 12px; min-width: 0; }
/* 标签和数值都不许折行：否则「建议仓位 减至2成以下」会断开，整块排版就散了 */
.metrics label { color: var(--muted); white-space: nowrap; flex: 0 0 auto; }
.metrics b { font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; }

.score-bar { margin-top: 14px; }
.score-bar-inner {
  height: 7px;
  border-radius: 4px;
  background: linear-gradient(90deg, #12c46b 0%, #4a5568 50%, #f0453a 100%);
  position: relative;
}
#scoreBarFill {
  position: absolute; top: -3px;
  width: 5px; height: 13px; border-radius: 3px;
  background: #fff; box-shadow: 0 0 8px rgba(255,255,255,.8);
  left: 50%; transform: translateX(-50%);
  transition: left .6s ease;
}
.score-scale { display: flex; justify-content: space-between; font-size: 10.5px; color: #5b6675; margin-top: 5px; }

/* 交易计划 */
.plan-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.plan-item {
  background: #111721;
  border: 1px solid #1e2733;
  border-radius: 8px;
  padding: 9px 11px;
}
.plan-item .p-label { font-size: 11px; color: var(--muted); margin-bottom: 4px; }
.plan-item .p-val { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.plan-item .p-sub { font-size: 10.5px; color: #5f6a79; margin-top: 2px; }
.plan-item.wide { grid-column: 1 / -1; }

/* 关键价位 */
.level-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 7px 0; border-bottom: 1px dashed #1e2733; font-size: 12.5px;
}
.level-row:last-child { border-bottom: none; }
.level-row .l-price { font-weight: 700; font-variant-numeric: tabular-nums; }
.level-row .l-label { color: var(--muted); font-size: 11px; text-align: right; max-width: 62%; }

/* 共振 */
.tf-row { display: flex; gap: 10px; margin-bottom: 8px; }
.tf-box {
  flex: 1; background: #111721; border: 1px solid #1e2733;
  border-radius: 8px; padding: 8px 10px;
}
.tf-box .tf-label { font-size: 11px; color: var(--muted); }
.tf-box .tf-val { font-size: 14px; font-weight: 700; margin-top: 3px; }
.tf-box .tf-sub { font-size: 10.5px; color: #5f6a79; margin-top: 2px; }
/* 周线证据行（2026-10-12）：与「多周期共振」同块展示，不新开板块 */
.wk-line { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.wk-tag { font-size: 11px; padding: 2px 8px; border-radius: 20px; background: #1d2530; color: #93a1b3; }
.wk-tag.ok { background: #14302a; color: #42d98c; }
.wk-tag.warn { background: #3a2f14; color: #e0c56a; }
.wk-tag.no { background: #2a1f1d; color: #ff8b80; }
/* 大盘状态标签（2026-10-12）：三档各有历史证据（见 scripts/market-regime-study.js） */
.market-regime .m-val { font-weight: 700; }
.market-regime.up .m-val { color: #42d98c; }
.market-regime.mid .m-val { color: #e8c46a; }
.market-regime.down .m-val { color: #ff8b80; }
.market-regime .m-sub { font-size: 10.5px; color: #5f6a79; }
.resonance-text { font-size: 12.5px; line-height: 1.65; color: #9dabbb; }

/* 风险 */
.risk-list { margin: 0; padding-left: 16px; }
.risk-list li { font-size: 12.5px; line-height: 1.7; color: #a9b6c7; margin-bottom: 4px; }
.risk-list li::marker { color: var(--warn); }

/* --------------------------- 信号明细区块 --------------------------- */
.signals-section, .indicator-section { padding: 18px 22px 0; }
.signals-section h2, .indicator-section h2 { font-size: 15px; margin: 0 0 12px; font-weight: 700; }
.signals-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.signals-head h2 { margin: 0; }
.filters { display: flex; gap: 4px; }

.signals-body { display: flex; flex-direction: column; gap: 14px; }
.cat-block { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 12px 16px; }
.cat-name { font-size: 12.5px; font-weight: 700; color: #8fb6ff; margin-bottom: 9px; letter-spacing: .5px; }
.sig-row {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 9px 0; border-bottom: 1px dashed #1e2733;
}
.sig-row:last-child { border-bottom: none; }
.sig-badge {
  flex: 0 0 52px; text-align: center; padding: 3px 0; border-radius: 5px;
  font-size: 11.5px; font-weight: 700;
}
.sig-badge.buy { background: rgba(240,69,58,.15); color: var(--up); }
.sig-badge.sell { background: rgba(18,196,107,.15); color: var(--down); }
.sig-badge.neutral { background: rgba(127,139,156,.15); color: var(--muted); }
.sig-main { flex: 1; min-width: 0; }
.sig-name { font-weight: 600; font-size: 13px; margin-bottom: 3px; display: flex; align-items: center; gap: 7px; }
.sig-strength { color: var(--warn); font-size: 10px; letter-spacing: -1px; }
.sig-desc { font-size: 12.5px; color: #8e9cad; line-height: 1.65; }

/* --------------------------- 指标数值区块 --------------------------- */
.indicator-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.ind-card { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 10px 13px; }
.ind-name { font-size: 11.5px; color: var(--muted); margin-bottom: 5px; }
.ind-val { font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; }
.ind-sub { font-size: 11px; color: #5f6a79; margin-top: 3px; }

.footer { padding: 22px; margin-top: 18px; border-top: 1px solid var(--border); }
.footer p { margin: 0; font-size: 12px; color: #66717f; line-height: 1.8; max-width: 1100px; }
.footer b { color: #8b96a5; }

.loading { opacity: .45; pointer-events: none; transition: opacity .2s; }

/* ---------------------- 手机访问（二维码浮层） ---------------------- */
.lan-btn { border: 1px solid var(--border); white-space: nowrap; }
.lan-panel {
  position: fixed;
  top: 64px;
  right: 16px;
  z-index: 200;
  background: var(--panel-2);
  border: 1px solid #2f4166;
  border-radius: 14px;
  padding: 18px 20px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, .6);
  text-align: center;
  min-width: 250px;
  /* 本人 + 访客两块二维码叠起来会超过手机屏幕，必须限高并在内部滚动（2026-10-18） */
  max-height: calc(100vh - 24px);
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}
.lan-title { font-size: 14px; font-weight: 700; margin-bottom: 12px; }
.lan-tabs { display: flex; gap: 6px; margin-bottom: 14px; }
.lan-tabs button {
  flex: 1; padding: 7px 6px; border-radius: 8px; border: 1px solid var(--border);
  background: #161d27; color: #9fb0c6; font-size: 12px; cursor: pointer; white-space: nowrap;
}
.lan-tabs button.active { background: #4a8cff; border-color: #4a8cff; color: #fff; font-weight: 600; }
.lan-tab-body { display: none; }
.lan-tab-body.active { display: block; }
.lan-qr { background: #fff; border-radius: 10px; padding: 10px; display: inline-block; line-height: 0; }
.lan-qr svg { width: 190px; height: 190px; display: block; }
.lan-url {
  margin-top: 12px; font-size: 15px; font-weight: 700; color: #8fb6ff;
  font-variant-numeric: tabular-nums; user-select: all;
}
.lan-hint { margin-top: 10px; font-size: 11.5px; color: var(--muted); line-height: 1.7; }
.lan-close {
  margin-top: 12px; padding: 6px 18px; border-radius: 8px;
  border: 1px solid var(--border); background: #1a2230; color: var(--text);
  font-size: 12.5px; cursor: pointer;
}
.lan-loading { color: var(--muted); font-size: 12.5px; padding: 10px; }

/*
 * 顶栏（.topbar）是 position: sticky，但 html/body 上的 overflow-x: hidden
 * 会把 body 变成滚动容器，结果就是「往下滑，导航栏跟着一起跑」。
 * overflow-x: clip 同样裁掉横向溢出，但不会创建滚动容器，sticky 才生效。
 * 不支持 clip 的老浏览器退回 hidden：顶栏不吸顶，但页面不会横向溢出。
 */
html, body { max-width: 100%; overflow-x: hidden; }
@supports (overflow-x: clip) {
  html, body { overflow-x: clip; }
}

/* 顶栏高度由 lan.js 实测写进来，吸顶表头 / 粘性侧栏都靠它对齐 */
:root { --topbar-h: 57px; }

/* ---------------- 政策面 / 新闻面 / 产业景气 ---------------- */
.collapsed { display: none !important; }
.coll-btn {
  flex: 0 0 auto; padding: 3px 11px; border-radius: 7px; cursor: pointer;
  background: #141b26; border: 1px solid var(--border); color: #93a1b3;
  font-size: 11.5px; line-height: 1.6; white-space: nowrap;
}
.coll-btn:hover { background: #1a2230; color: var(--text); }
.theme-body { font-size: 12px; line-height: 1.75; }
.theme-loading { color: var(--muted); font-size: 11.5px; line-height: 1.7; }
.theme-top { display: flex; align-items: baseline; gap: 9px; }
.theme-score { font-size: 26px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.theme-headline { flex: 1; min-width: 0; font-size: 12px; color: #c3cddb; }
.theme-points { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.theme-point {
  font-size: 10.5px; padding: 1px 7px; border-radius: 5px;
  background: #141b26; border: 1px solid var(--border); color: #93a1b3;
}
.theme-themes { margin-top: 7px; font-size: 11px; color: #5f6a79; }
.theme-chip {
  display: inline-block; margin: 0 3px; padding: 1px 6px; border-radius: 5px;
  background: rgba(74,140,255,.12); color: #8fb6ff; font-size: 10.5px;
}
.theme-sec { margin-top: 10px; padding-top: 9px; border-top: 1px dashed #1e2733; }
.theme-sec-h { font-size: 11.5px; font-weight: 700; color: #c3cddb; margin-bottom: 4px; }
.theme-sec-t { font-size: 11.5px; color: #93a1b3; line-height: 1.8; }
.theme-news { margin: 6px 0 0; padding-left: 0; list-style: none; }
.theme-news li { font-size: 11px; line-height: 1.7; color: #7f8b9c; margin-bottom: 4px; }
.theme-news a { color: #8fb6ff; text-decoration: none; }
.theme-news a:hover { text-decoration: underline; }
.theme-news .n-date { color: #566273; font-variant-numeric: tabular-nums; margin-right: 5px; }
.theme-news .n-media { color: #566273; margin-left: 5px; }
.theme-none { margin-top: 5px; font-size: 11px; color: #5f6a79; }
.theme-kv { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 5px; font-size: 11px; color: #7f8b9c; }
.theme-note {
  margin-top: 10px; padding: 8px 10px; border-radius: 8px; font-size: 10.5px; line-height: 1.8;
  background: rgba(240,178,58,.06); border: 1px solid rgba(240,178,58,.2); color: #a89154;
}

/* ------------------------------ 手机端适配 ------------------------------ */
@media (max-width: 768px) {
  .topbar { padding: 10px 12px; gap: 8px 10px; }
  /* 关键：nowrap 的弹性子项必须允许收缩，否则会把整页撑宽导致横向溢出 */
  .topbar > * { min-width: 0; }
  .market-bar { min-width: 0; }
  .toolbar { min-width: 0; }
  .stock-meta { min-width: 0; }
  .metrics b { white-space: normal; overflow-wrap: anywhere; text-align: right; }
  .quick { min-width: 0; }

  .brand { font-size: 15px; gap: 6px; }
  .logo { font-size: 18px; }
  .brand-name { font-size: 15px; }

  /*
   * 顶栏排列顺序（所有页面统一，用户要求：导航必须在最上面那一行的正下方）：
   *   ① 品牌 + 手机访问  →  ② 导航栏  →  ③ 页面自己的控件（日期 / 状态 / 刷新 / 加入自选…）
   * 之前各页自己的控件没有 order，默认排在导航前面，所以「短线战法/主升浪/自选」这些
   * 页面的控件会跑到导航栏上方，看起来顶栏结构每页都不一样。
   */
  .topbar > * { order: 6; }
  .brand { order: 1; }

  /*
   * 顶栏导航：手机端永远保持「一行」，和昨天那版一致。
   * 装得下 → flex 均分，把整行铺满；装不下 → 在导航条内部横向滑动（不再折成两列网格）。
   * 折成两列会把表头高度顶高一倍，也会让每个板块的顶栏看起来不一样。
   */
  .mainnav {
    order: 3; width: 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
  }
  .mainnav::-webkit-scrollbar { display: none; }
  .mainnav a { flex: 1 1 auto; justify-content: center; padding: 8px 6px; font-size: 12px; gap: 5px; }

  .lan-btn { order: 2; margin-left: auto; padding: 7px 10px; font-size: 12px; }

  .search-wrap { order: 4; flex: 1 1 100%; max-width: none; }
  #searchInput { font-size: 15px; }
  .btn-primary { padding: 9px 16px; }
  .suggest { right: 72px; }

  .quick { order: 5; flex-wrap: nowrap; overflow-x: auto; width: 100%; padding-bottom: 2px; }
  .chip { flex: 0 0 auto; }

  .market-bar { gap: 18px; padding: 7px 12px; }

  .layout { grid-template-columns: 1fr; padding: 10px 12px 0; gap: 10px; }

  .stock-header { padding: 12px; gap: 8px 12px; }
  .stock-title h1 { font-size: 17px; }
  .stock-title .code { font-size: 11.5px; }
  .stock-price .price { font-size: 20px; }
  .stock-price .change { font-size: 13px; }
  .live-box { padding-left: 10px; }
  .stock-meta { margin-left: 0; width: 100%; gap: 10px; font-size: 11.5px; }

  .toolbar { flex-wrap: nowrap; overflow-x: auto; gap: 12px; padding: 8px 12px; }
  .group { flex: 0 0 auto; }
  .group.right { margin-left: 0; }

  .chart { height: 520px; }
  .chart-tip { padding: 8px 12px; font-size: 11.5px; }

  .side-col { gap: 10px; }
  .card { padding: 12px 13px; }
  .metrics { grid-template-columns: 1fr 1fr; }

  .footer { padding: 16px 12px; margin-top: 14px; }
  .footer p { font-size: 11.5px; }
  .signals-section, .indicator-section { padding: 14px 12px 0; }
  .indicator-grid { grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); }

  .lan-panel { top: auto; bottom: 12px; right: 12px; left: 12px; }
  .lan-panel { padding: 14px 14px 10px; max-height: calc(100vh - 24px); }
  .lan-qr svg { width: min(190px, 44vw); height: auto; }
  .lan-close { width: 100%; }
}

/* 平板/窄窗口：单列但不走手机规则，避免与 768 断点互相覆盖 */
@media (min-width: 769px) and (max-width: 1200px) {
  .layout { grid-template-columns: 1fr; }
  .chart { height: 620px; }
}

/*
 * 中等宽度（769~1400px）：导航项已经 7 个，再和搜索框/日期框挤一行会把控件压变形
 * （短线战法页的日期框一度被压成竖排文字）。这里让导航独占一行，其余控件留在第一行。
 */
@media (min-width: 769px) and (max-width: 1560px) {
  /*
   * 2026-10-10 用户要求：导航不再独占一行（见文件末尾 @media min-width:769px 那段，
   * 搜索框 + 分析 要挪到快捷股那一行、并排在快捷股前面）。这里只保留「本页控件排最后」。
   */
  .topbar > * { order: 6; }
}

/* 小屏手机：保持一行，靠缩小内边距 + 导航条内部横滑容纳 8 个入口 */
@media (max-width: 430px) {
  .mainnav { gap: 2px; padding: 3px; }
  .mainnav a { flex: 0 0 auto; padding: 7px 9px; font-size: 12px; gap: 4px; }
  .mainnav .nav-ico { font-size: 12px; }
}

/*
 * 顶栏字号按屏幕分档：宽屏 14，平板/手机 13.5，小屏手机 13。
 * 只改这一个变量，顶栏里所有控件一起变，不会再出现"同一行四种字号"。
 */
@media (max-width: 768px) {
  /* 手机端顶栏完全沿用原来的排列规则（上面 768 断点里那套），这里不再有任何覆盖 */
}

/*
 * 表格单元格一律垂直居中（再显式声明一次）。
 * 之前全局写了 table td，但页面各自的 .xxx-table td 优先级更高，
 * 个别列会出现"内容顶在格子上边"的情况（用户反馈：选股逻辑那一列）。
 */
.hm-table td, .wv-table td, .wl-table td, .val-table td, .pos-table td,
.bt-table td, .hb-table td, .cp-screen-table td, .rot-study-table td {
  vertical-align: middle;
}

/*
 * ---------------- 全站表格排版约定 ----------------
 * 用户明确要求：表格里每一行的内容统一「水平左对齐 + 垂直居中」。
 * 之前各页的 td 默认 vertical-align: top，行一高（比如"入选理由"很长）
 * 左上角那几列就飘在顶上，看着很乱。
 *
 * 唯一例外：带 .num 的数值列（价格/涨跌幅/评分）保持右对齐——
 * 数字按位对齐才方便比大小。要改一起改，别单页覆盖。
 */
/* 全站表格：每一列都左对齐（用户 2026-10-11 明确要求，包括数字列） */
table th, table td { text-align: left; vertical-align: middle; }
table th.num, table td.num { text-align: left; }

/*
 * ---------------- 手机端：宽表格必须能横向滑动 ----------------
 *
 * 问题：表格比手机屏宽时，如果没有任何「可横向滚动的容器」，内容会溢出到页面上；
 * 而 html/body 设了 overflow-x: clip（为了顶栏 sticky 生效），溢出的部分会被裁掉，
 * 手指也滑不到 —— 那种表格在手机上看不全也滑不动。
 *
 * 做法：让表格自己变成横向滚动容器。
 * `display:block` 之后表格盒子宽度 = 容器宽度（不再被内容撑宽），
 * 里面的行/单元格仍按表格布局排（浏览器会自动包一层匿名 table box），
 * 内容超出时就在表格内部横滑。
 *
 * 注意配套：一定要给滚动容器 `min-width: 0`，
 * 否则在 flex/grid 父容器里它会被内容撑宽，内部就不会出现滚动条了。
 */
/*
 * 宽表格在手机上要能横向滑动。
 * ⚠ 不要给 table 本身加 display:block + overflow-x —— 那样会改变表头和列宽的排版。
 * 正确做法是外面套一个滚动容器：HTML/JS 会给每个 <table> 包一层 .tbl-scroll
 * （在 lan.js 里用 MutationObserver 自动包，动态渲染的表格也覆盖得到）。
 */
.tbl-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  min-width: 0;
  max-width: 100%;
}

/*
 * ------------------ 「今日结论」回测 · 每日自进化（三页共用） ------------------
 * 短线战法 / 主升浪 / 价值筛选 三个页面用的是同一块，所以样式放全站样式表。
 */
.concl-bt {
  margin: 14px 22px 0; background: var(--panel);
  border: 1px solid var(--border); border-radius: 12px; padding: 13px 16px;
}
.cb-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cb-title { font-size: 13.5px; font-weight: 700; }
.cb-sub { font-size: 11.5px; color: var(--muted); flex: 1; min-width: 0; }
.cb-sum { margin-top: 9px; font-size: 11.5px; line-height: 1.85; color: #93a1b3; }
.cb-sum b { color: #e2e8f0; }
.cb-table { width: 100%; border-collapse: collapse; font-size: 11.5px; margin-top: 8px; }
.cb-table th {
  text-align: left; font-size: 11px; color: #66748a; font-weight: 600;
  padding: 5px 9px; border-bottom: 1px solid var(--border); white-space: nowrap;
}
.cb-table td { padding: 5px 9px; border-bottom: 1px dashed #1a2230; vertical-align: middle; }
.cb-table tr:last-child td { border-bottom: none; }
.cb-table .num { text-align: left; font-variant-numeric: tabular-nums; }
.cb-table .cb-ok { color: #42d98c; }
.cb-table .cb-bad { color: #ff8b80; }
.cb-table .cb-thin {
  margin-left: 5px; padding: 0 5px; border-radius: 4px; font-size: 10px;
  background: #1c2432; color: #7f8b9c;
}
.cb-table .cb-dim { color: #5f6a79; font-size: 10.5px; }
.cb-cfg {
  margin-top: 10px; padding: 8px 11px; border-radius: 8px; font-size: 11px; line-height: 2;
  background: rgba(74,140,255,.06); border: 1px solid rgba(74,140,255,.2); color: #93a1b3;
}
.cb-cfg b { color: #c3cddb; }
.cb-log {
  margin-top: 8px; font-size: 10.5px; color: #5f6a79; line-height: 1.9;
  max-height: 96px; overflow-y: auto; white-space: pre-wrap;
}
/* 模拟组合（按纪律执行）：净值 / 回撤 / 胜率 + 迷你曲线 + 最近成交 */
.cb-pf {
  margin-top: 10px; padding: 9px 11px; border-radius: 8px; font-size: 11.5px; line-height: 1.9;
  background: #101722; border: 1px solid #24304a; color: #93a1b3;
}
.cb-pf b { color: #e2e8f0; }
.cb-pf-curve { display: block; width: 260px; max-width: 100%; height: 40px; margin: 6px 0 2px; }
.cb-pf-warn {
  margin-top: 6px; padding: 6px 9px; border-radius: 7px; font-size: 11px; line-height: 1.8;
  background: rgba(240,178,58,.07); border: 1px solid rgba(240,178,58,.22); color: #c9a86a;
}
.cb-pf-rules { margin-top: 6px; font-size: 10.5px; color: #5f6a79; line-height: 1.8; }
.cb-pf-note { margin-top: 5px; font-size: 10.5px; color: #5f6a79; line-height: 1.8; }
@media (max-width: 900px) {
  .concl-bt { margin-left: 12px; margin-right: 12px; }
}

/* 已经自带滚动容器的表格（例如 .hb-table 早就写了 display:block）保持原样即可 */
.hb-table, .bt-table-wrap, .wv-body, .val-body, .pos-body, .cp-screen-body {
  min-width: 0;
  max-width: 100%;
}

/*
 * 还有一类"撑宽"陷阱：宽表格放在 grid 容器里时，
 * grid 项默认 min-width:auto —— 它不会缩到比内容更窄，
 * 于是表格把整列撑宽、整页跟着溢出（`.tbl-scroll` 自己写了 min-width:0 也没用，
 * 因为被撑宽的是它的【父级 grid 项】）。
 * 下面这几个就是实测被撑宽的容器。
 */
.hb-main > *, .cp-layout > *, .cp-form > *, .wv-main > *, .val-main > *, .pos-main > * {
  min-width: 0;
}

/*
 * 顶栏字号按屏幕分档：宽屏 14 / ≤768px 13.5 / ≤430px 13。
 * 放在文件最后，保证覆盖前面那些零散写的 font-size / padding。
 *
 * 手机端导航仍然保持「一整行」：8 个入口在 13.5px 下刚好铺满 740px 宽的手机；
 * 更窄时在导航条内部横滑（见上面 @media max-width:768px 里的 nowrap + overflow-x），
 * 不会折成两列网格。导航项内边距从 8px 收到 6px 就是为了让它仍能一行放下。
 */
@media (max-width: 768px) {
  :root { --topbar-font: 13.5px; }
  .topbar { padding: 12px; min-height: 58px; }
  .mainnav { gap: 3px; }
  .topbar .mainnav a { padding: 8px 6px; }
}
@media (max-width: 430px) {
  :root { --topbar-font: 13px; }
  .topbar { padding: 11px 10px; }
  .mainnav { gap: 2px; padding: 3px; }
  .topbar .mainnav a { padding: 7px 9px; }
}

/*
 * ≥769px（平板 / 桌面）顶栏排三行 —— 用户 2026-10-10 明确要求：
 *   ① 品牌 + 导航 + 手机访问 同一行（导航不再独占一行）
 *   ② 搜索框 + 分析 挪到下一行，和快捷股（贵州茅台…）同一行，且排在快捷股**前面**
 *   ③ 本页自己的控件（日期 / 状态 / 刷新…）再往下
 * 放在文件最后，覆盖前面 769~1560 那段旧规则。
 */
@media (min-width: 769px) {
  .topbar > * { order: 6; }
  .topbar > .brand { order: 1; }
  .topbar > .mainnav { order: 2; }
  .topbar > .lan-btn { order: 3; margin-left: 0; }
  /*
   * flex-basis: 100% 是关键：只写 order 的话，只要这一行还有空隙，
   * 搜索框还是会被塞回导航那一行（order 只管顺序，不管换行）。
   * 给成 100% 的基准宽度 → 它一定放不进当前行 → 换行；
   * 换行后再被 max-width: 520px 收住，所以不会真的占满一整行。
   */
  .topbar > .search-wrap { order: 4; flex-basis: 100%; }
  .topbar > .quick { order: 5; }
}

/*
 * 内容区缩放守卫（不涉及冻结顶栏）：
 * 浏览器放大后，grid/flex 子项默认 min-width:auto 会被长文本或表格的最小内容宽度撑开；
 * 这里统一允许内容区收缩，并给标题/段落/标签加长词换行兜底。
 */
main, main section, main article, main aside, main div {
  min-width: 0;
}
main :where(h1, h2, h3, h4, p, li, label, span, b, strong) {
  overflow-wrap: anywhere;
}
