/* ============================================================
   A股事件筛选器 — 设计令牌
   ============================================================ */
:root {
  --bg: #f2f5fa;
  --bg-soft: #e9eef7;
  --panel: #ffffff;
  --panel-2: #f7f9fd;
  --line: #e3e9f3;
  --line-strong: #d3dceb;
  --ink: #0d1a2d;
  --ink-2: #43536b;
  --muted: #8593a8;
  --brand: #2b59ff;
  --brand-soft: #eaf0ff;
  --up: #dd3b4b;
  --up-soft: #fdeef0;
  --down: #109c60;
  --down-soft: #e8f8f0;
  --amber: #b8770a;
  --amber-soft: #fdf3e2;
  --violet: #6c4cf1;
  --violet-soft: #f0ecff;
  --shadow-sm: 0 1px 2px rgba(13, 26, 45, .05);
  --shadow-md: 0 1px 2px rgba(13, 26, 45, .05), 0 12px 28px -18px rgba(13, 26, 45, .35);
  --radius: 16px;
  --radius-sm: 10px;
  --topbar-h: 66px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
}

[data-theme="dark"] {
  --bg: #080e18;
  --bg-soft: #0e1626;
  --panel: #111a2a;
  --panel-2: #16202f;
  --line: #1f2b3e;
  --line-strong: #2a3950;
  --ink: #e9eff9;
  --ink-2: #b3c1d6;
  --muted: #7c8ca6;
  --brand: #6d8dff;
  --brand-soft: #17233c;
  --up: #ff6b75;
  --up-soft: #2c1a1e;
  --down: #35c98b;
  --down-soft: #10261d;
  --amber: #e5aa4a;
  --amber-soft: #2a2214;
  --violet: #a08cff;
  --violet-soft: #1e1a33;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-md: 0 1px 2px rgba(0, 0, 0, .4), 0 16px 36px -22px rgba(0, 0, 0, .9);
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -.01em; }
p { margin: 0; }
button { font-family: inherit; font-size: inherit; color: inherit; cursor: pointer; }
a { color: var(--brand); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.muted { color: var(--muted); font-weight: 400; }
svg { display: block; }

/* ============================== 顶栏 ============================== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--panel) 88%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: 1560px;
  margin: 0 auto;
  min-height: var(--topbar-h);
  padding: 10px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-mark {
  width: 40px; height: 40px; flex: none;
  display: grid; place-items: center;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(140deg, #3c6bff, #6a3cff 55%, #8a2be2);
  box-shadow: 0 6px 16px -6px rgba(43, 89, 255, .7);
}
.brand-mark svg { width: 24px; height: 24px; }
.brand-text { min-width: 0; }
.brand-text h1 { font-size: 17px; line-height: 1.25; white-space: nowrap; }
.brand-text p { font-size: 12px; color: var(--muted); letter-spacing: .02em; }

.topbar-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  height: 28px; padding: 0 11px;
  border-radius: 999px;
  font-size: 12px; font-weight: 600;
  background: var(--brand-soft);
  color: var(--brand);
  border: 1px solid color-mix(in srgb, var(--brand) 18%, transparent);
  white-space: nowrap;
}
.pill.subtle { background: var(--panel-2); color: var(--ink-2); border-color: var(--line); font-weight: 500; }
.pill .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.pill.is-demo { background: var(--amber-soft); color: var(--amber); border-color: color-mix(in srgb, var(--amber) 25%, transparent); }
.pill.is-bad { background: var(--up-soft); color: var(--up); border-color: color-mix(in srgb, var(--up) 25%, transparent); }

.ghost-btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 32px; padding: 0 12px;
  border-radius: 9px;
  border: 1px solid var(--line-strong);
  background: var(--panel);
  font-size: 13px; font-weight: 550;
  color: var(--ink-2);
  transition: .16s ease;
}
.ghost-btn svg { width: 15px; height: 15px; }
.ghost-btn:hover { color: var(--brand); border-color: color-mix(in srgb, var(--brand) 45%, transparent); background: var(--brand-soft); }
.ghost-btn.sm { height: 30px; padding: 0 10px; font-size: 12.5px; }
.ghost-btn.is-on { color: var(--brand); border-color: var(--brand); background: var(--brand-soft); }

.icon-btn {
  width: 32px; height: 32px; flex: none;
  display: grid; place-items: center;
  border-radius: 9px;
  border: 1px solid var(--line-strong);
  background: var(--panel);
  color: var(--ink-2);
  transition: .16s ease;
}
.icon-btn svg { width: 16px; height: 16px; }
.icon-btn:hover { color: var(--brand); border-color: color-mix(in srgb, var(--brand) 45%, transparent); }
.icon-btn .i-dark { display: none; }
[data-theme="dark"] .icon-btn .i-dark { display: block; }
[data-theme="dark"] .icon-btn .i-light { display: none; }
#btnFilterMobile { display: none; }

/* ============================== 布局 ============================== */
.shell {
  max-width: 1560px;
  margin: 0 auto;
  padding: 20px 22px 40px;
  display: grid;
  grid-template-columns: 262px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}
.main { min-width: 0; display: flex; flex-direction: column; gap: 16px; }

/* ============================== 侧栏筛选 ============================== */
.sidebar {
  position: sticky;
  top: calc(var(--topbar-h) + 16px);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 15px;
  max-height: calc(100vh - var(--topbar-h) - 34px);
  overflow: auto;
}
.side-head { display: flex; align-items: center; justify-content: space-between; }
.side-head h2 { font-size: 14px; }
.link-btn {
  border: 0; background: none; padding: 0;
  font-size: 12.5px; color: var(--brand); font-weight: 550;
}
.link-btn:hover { text-decoration: underline; }

.field { display: flex; flex-direction: column; gap: 7px; }
.field > label { font-size: 12px; font-weight: 600; color: var(--ink-2); letter-spacing: .02em; }
.field.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.field.two > div { display: flex; flex-direction: column; gap: 7px; }
.hint { font-size: 11.5px; color: var(--muted); }

.search {
  display: flex; align-items: center; gap: 7px;
  height: 36px; padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--panel-2);
  transition: .16s ease;
}
.search:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 14%, transparent); background: var(--panel); }
.search svg { width: 15px; height: 15px; color: var(--muted); flex: none; }
.search input {
  flex: 1; min-width: 0; border: 0; outline: 0; background: none;
  font-size: 13px; color: var(--ink);
}
.search input::placeholder { color: var(--muted); }
.search kbd {
  font-family: var(--font); font-size: 10.5px; color: var(--muted);
  border: 1px solid var(--line-strong); border-radius: 4px;
  padding: 0 4px; line-height: 15px; background: var(--panel);
}

select {
  height: 36px;
  width: 100%;
  padding: 0 30px 0 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background-color: var(--panel-2);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M6 9l6 6 6-6' stroke='%238593a8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 15px;
  font-size: 13px;
  color: var(--ink);
  appearance: none;
  outline: none;
  transition: .16s ease;
}
select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 14%, transparent); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  height: 28px; padding: 0 9px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: var(--panel-2);
  font-size: 12.5px; font-weight: 550;
  color: var(--ink-2);
  transition: .14s ease;
}
.chip .n { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.chip:hover { border-color: var(--line-strong); background: var(--bg-soft); }
.chip[aria-pressed="true"] { border-color: currentColor; }
.chip[aria-pressed="true"] .n { color: inherit; opacity: .75; }
.chip[data-type="increase"][aria-pressed="true"] { color: var(--up); background: var(--up-soft); }
.chip[data-type="decrease"][aria-pressed="true"] { color: var(--down); background: var(--down-soft); }
.chip[data-type="placement"][aria-pressed="true"] { color: var(--amber); background: var(--amber-soft); }
.chip[data-type="repurchase"][aria-pressed="true"] { color: var(--brand); background: var(--brand-soft); }
.chip[data-type="dividend"][aria-pressed="true"] { color: var(--violet); background: var(--violet-soft); }

.segmented {
  display: grid; grid-template-columns: repeat(4, 1fr);
  padding: 3px; gap: 2px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.segmented button {
  height: 28px; border: 0; border-radius: 7px; background: none;
  font-size: 12.5px; font-weight: 550; color: var(--ink-2);
  transition: .14s ease;
}
.segmented button:hover { color: var(--brand); }
.segmented button.is-active { background: var(--panel); color: var(--brand); box-shadow: var(--shadow-sm); }

.switch { display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--ink-2); cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch .track {
  width: 34px; height: 20px; flex: none; border-radius: 999px;
  background: var(--line-strong); position: relative; transition: .18s ease;
}
.switch .track::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 16px; height: 16px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: .18s ease;
}
.switch input:checked + .track { background: var(--brand); }
.switch input:checked + .track::after { transform: translateX(14px); }

/* ============================== KPI ============================== */
.kpis {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}
.kpi {
  position: relative;
  text-align: left;
  padding: 13px 14px 12px;
  border-radius: 13px;
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: .16s ease;
}
.kpi::before {
  content: ""; position: absolute; inset: 0 auto 0 0; width: 3px;
  background: var(--accent, var(--brand)); opacity: .85;
}
.kpi:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.kpi.is-on { border-color: color-mix(in srgb, var(--accent, var(--brand)) 55%, transparent); background: color-mix(in srgb, var(--accent, var(--brand)) 6%, var(--panel)); }
.kpi .k-label { display: flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--muted); font-weight: 550; }
.kpi .k-label .dot { width: 6px; height: 6px; border-radius: 2px; background: var(--accent, var(--brand)); }
.kpi .k-value {
  margin-top: 5px;
  font-size: 21px; font-weight: 700; letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.kpi .k-value small { font-size: 12px; font-weight: 600; color: var(--ink-2); margin-left: 2px; }
.kpi .k-sub { margin-top: 2px; font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ============================== 卡片 / 图表 ============================== */
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 14px 16px;
  min-width: 0;
}
.chart-row { display: grid; grid-template-columns: 1.55fr 1fr; gap: 14px; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.card-head h3 { font-size: 13.5px; }
.card-head .muted { font-size: 11.5px; }
.chart { height: 190px; position: relative; }
.chart svg { width: 100%; height: 100%; overflow: visible; }

.donut-wrap { display: flex; align-items: center; gap: 14px; }
.donut-wrap > svg { width: 158px; height: 158px; flex: none; }
.donut-legend { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.donut-legend li {
  display: grid; grid-template-columns: 8px minmax(0, 1fr) auto; align-items: center; gap: 7px;
  font-size: 12.5px; color: var(--ink-2);
}
.donut-legend li > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.donut-legend .sw { width: 8px; height: 8px; border-radius: 2px; }
.donut-legend .val { font-variant-numeric: tabular-nums; color: var(--ink); font-weight: 600; }
.donut-center-num { font-size: 17px; font-weight: 700; fill: var(--ink); font-variant-numeric: tabular-nums; }
.donut-center-lbl { font-size: 10px; fill: var(--muted); }

.chart-tip {
  position: fixed; z-index: 90; pointer-events: none;
  padding: 7px 10px; border-radius: 8px;
  background: var(--ink); color: #fff;
  font-size: 11.5px; line-height: 1.5;
  box-shadow: 0 10px 24px -10px rgba(0, 0, 0, .6);
  opacity: 0; transform: translate(-50%, -120%); transition: opacity .12s ease;
  white-space: nowrap;
}
.chart-tip.on { opacity: 1; }
.chart-tip b { font-weight: 650; }

/* ============================== 表格 ============================== */
/* 注意：overflow:hidden/auto 会成为 sticky 的滚动容器，导致表头吸顶错位，
   所以这里用 clip（不产生滚动容器）；窄屏（表格需横向滚动时）关闭吸顶，见下方媒体查询。 */
.table-card { padding: 0; overflow: hidden; overflow: clip; }
.table-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.result { font-size: 13px; color: var(--ink-2); display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.result strong { font-size: 19px; color: var(--ink); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.table-tools { display: flex; gap: 8px; }

.table-scroll { overflow-x: clip; }
table { width: 100%; border-collapse: collapse; min-width: 900px; }
thead th {
  position: sticky; top: var(--topbar-h); z-index: 2;
  background: var(--panel-2);
  font-size: 11.5px; font-weight: 600; color: var(--muted);
  text-align: left; white-space: nowrap;
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
  letter-spacing: .02em;
}
thead th.sortable { cursor: pointer; user-select: none; }
thead th.sortable:hover { color: var(--brand); }
thead th .arrow { display: inline-block; width: 9px; opacity: 0; margin-left: 2px; }
thead th.is-sorted { color: var(--brand); }
thead th.is-sorted .arrow { opacity: 1; }
tbody td {
  padding: 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  font-size: 13px;
  white-space: nowrap;
}
tbody tr { cursor: pointer; transition: background .12s ease; }
tbody tr:hover { background: var(--panel-2); }
tbody tr:last-child td { border-bottom: 0; }
tbody td.c-num, tbody td.c-date, tbody td.c-code { font-variant-numeric: tabular-nums; }
tbody td.c-code { color: var(--ink-2); font-size: 12.5px; letter-spacing: .01em; }
td.c-name .nm { font-weight: 600; color: var(--ink); }
td.c-name .bd { display: block; font-size: 11px; color: var(--muted); margin-top: 1px; }
td.c-party { max-width: 230px; overflow: hidden; text-overflow: ellipsis; color: var(--ink-2); font-size: 12.5px; }
td.c-num.strong { font-weight: 650; }
td.c-date { color: var(--ink-2); font-size: 12.5px; }
td.c-status { color: var(--muted); font-size: 12px; }

.tag {
  display: inline-flex; align-items: center; justify-content: center;
  height: 22px; padding: 0 8px; min-width: 42px;
  border-radius: 6px;
  font-size: 12px; font-weight: 650;
  letter-spacing: .02em;
}
.tag.increase { background: var(--up-soft); color: var(--up); }
.tag.decrease { background: var(--down-soft); color: var(--down); }
.tag.placement { background: var(--amber-soft); color: var(--amber); }
.tag.repurchase { background: var(--brand-soft); color: var(--brand); }
.tag.dividend { background: var(--violet-soft); color: var(--violet); }

.star-btn {
  border: 0; background: none; padding: 2px;
  color: var(--line-strong);
  transition: .14s ease;
  line-height: 0;
}
.star-btn svg { width: 16px; height: 16px; }
.star-btn:hover { color: var(--amber); transform: scale(1.12); }
.star-btn.is-on { color: var(--amber); }

.empty {
  padding: 54px 20px; text-align: center; color: var(--muted);
}
.empty h4 { font-size: 14px; color: var(--ink-2); margin-bottom: 6px; }
.empty button { margin-top: 12px; }

/* 移动端卡片列表 */
.mobile-list { display: none; padding: 10px; gap: 10px; flex-direction: column; }
.m-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 12px;
  background: var(--panel);
  display: flex; flex-direction: column; gap: 8px;
}
.m-card:active { background: var(--panel-2); }
.m-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.m-name { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
.m-name b { font-size: 14px; }
.m-name span { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.m-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px 8px; }
.m-grid div { font-size: 11px; color: var(--muted); }
.m-grid div b { display: block; font-size: 13px; color: var(--ink); font-variant-numeric: tabular-nums; font-weight: 600; }
.m-party { font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 分页 */
.pager {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
}
.pager button {
  min-width: 30px; height: 30px; padding: 0 8px;
  border-radius: 8px; border: 1px solid var(--line-strong);
  background: var(--panel); font-size: 12.5px; color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}
.pager button:hover:not(:disabled) { border-color: var(--brand); color: var(--brand); }
.pager button.is-active { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 650; }
.pager button:disabled { opacity: .45; cursor: default; }
.pager .ellipsis { color: var(--muted); padding: 0 2px; }

.foot { display: flex; flex-direction: column; gap: 4px; font-size: 11.5px; color: var(--ink-2); padding: 4px 2px 0; line-height: 1.7; }
.foot strong { color: var(--ink); }

/* ============================== 详情抽屉 ============================== */
.scrim {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(10, 18, 30, .38);
  backdrop-filter: blur(2px);
  opacity: 0; transition: opacity .2s ease;
}
.scrim.on { opacity: 1; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 70;
  width: min(430px, 100vw);
  background: var(--panel);
  border-left: 1px solid var(--line);
  box-shadow: -20px 0 50px -30px rgba(10, 18, 30, .6);
  transform: translateX(102%);
  transition: transform .26s cubic-bezier(.32, .72, 0, 1);
  display: flex; flex-direction: column;
}
.drawer.on { transform: none; }
.drawer-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 16px 18px 14px;
  border-bottom: 1px solid var(--line);
}
.drawer-title h3 { font-size: 18px; letter-spacing: -.01em; }
.drawer-title p { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; margin-top: 2px; }
.drawer-body { padding: 16px 18px 26px; overflow: auto; display: flex; flex-direction: column; gap: 16px; }

.d-hero {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.d-hero .box {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 10px 12px;
}
.d-hero .box span { font-size: 11.5px; color: var(--muted); }
.d-hero .box b { display: block; margin-top: 3px; font-size: 19px; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }

.d-section h4 { font-size: 12px; color: var(--muted); font-weight: 600; letter-spacing: .04em; margin-bottom: 7px; }
.d-list { display: flex; flex-direction: column; gap: 1px; border-radius: 11px; overflow: hidden; border: 1px solid var(--line); }
.d-list .row {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 9px 12px; background: var(--panel-2); font-size: 12.5px;
}
.d-list .row > span { color: var(--muted); flex: none; }
.d-list .row > b { font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; word-break: break-all; }
.d-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.d-actions .ghost-btn, .d-actions a.ghost-btn { flex: 1; justify-content: center; text-decoration: none; }
.d-note { font-size: 11px; color: var(--muted); line-height: 1.7; }

.toast {
  position: fixed; left: 50%; bottom: 26px; z-index: 100;
  transform: translate(-50%, 12px);
  padding: 9px 16px; border-radius: 999px;
  background: var(--ink); color: var(--panel);
  font-size: 12.5px; font-weight: 550;
  opacity: 0; pointer-events: none; transition: .22s ease;
  box-shadow: 0 14px 30px -14px rgba(0, 0, 0, .7);
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* 窄屏：表格需要横向滚动（overflow:auto 会让 sticky 以容器为参照而错位），关闭吸顶 */
@media (max-width: 1259px) {
  .table-scroll { overflow-x: auto; }
  thead th { position: static; }
}

/* ============================== 响应式 ============================== */
@media (max-width: 1360px) {
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1180px) {
  .shell { grid-template-columns: 236px minmax(0, 1fr); }
  .chart-row { grid-template-columns: 1fr; }
  .chart { height: 170px; }
}
@media (max-width: 980px) {
  #btnFilterMobile { display: inline-flex; }
  .shell { grid-template-columns: minmax(0, 1fr); padding: 14px 14px 34px; gap: 14px; }
  .sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: min(300px, 86vw);
    max-height: none;
    border-radius: 0;
    z-index: 80;
    transform: translateX(-102%);
    transition: transform .26s cubic-bezier(.32, .72, 0, 1);
    padding-top: 18px;
  }
  .sidebar.on { transform: none; }
  .topbar-inner { padding: 9px 14px; }
  .brand-text p { display: none; }
  .topbar-actions .pill.subtle { display: none; }
  .table-scroll { display: none; }
  .mobile-list { display: flex; }
}
@media (max-width: 620px) {
  :root { --topbar-h: 60px; }
  .brand-text h1 { font-size: 15px; }
  .brand-mark { width: 34px; height: 34px; border-radius: 10px; }
  .brand-mark svg { width: 20px; height: 20px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .kpi { padding: 10px 11px; }
  .kpi .k-value { font-size: 18px; }
  .chart-row { gap: 10px; }
  .card { padding: 12px; border-radius: 13px; }
  .card-head { margin-bottom: 4px; }
  .chart { height: 150px; }
  .donut-wrap { flex-direction: column; align-items: stretch; height: auto; }
  .donut-wrap svg { max-width: 150px; margin: 0 auto; }
  .donut-legend { gap: 6px; }
  .table-head { padding: 11px 12px; }
  .result strong { font-size: 17px; }
  .ghost-btn.sm { padding: 0 9px; }
  #btnFavView { display: none; }
  .drawer { width: 100vw; border-left: 0; }
  .d-hero .box b { font-size: 17px; }
  .foot { font-size: 11px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* 选股池标记（来自 BIGApush 收盘选股） */
.pick-badge {
  display: inline-flex; align-items: center; justify-content: center;
  height: 18px; min-width: 18px; padding: 0 4px; margin-left: 5px;
  border-radius: 5px;
  background: var(--brand-soft); color: var(--brand);
  border: 1px solid color-mix(in srgb, var(--brand) 22%, transparent);
  font-size: 10.5px; font-weight: 700; line-height: 1;
  vertical-align: 1px;
  cursor: help;
}
.m-name .pick-badge { margin-left: 4px; }
.pick-section {
  border-left: 2px solid var(--brand);
  padding-left: 10px;
}
.pick-section h4 { color: var(--brand); }
