:root {
  --bg: #f4f5f7;
  --panel: #fff;
  --head: #f8f9fb;
  --hover: #f6f7f9;
  --text: #1f2329;
  --muted: #868d97;
  --line: #e6e8eb;
  --up: #e5383b;
  --up-soft: #fdecec;
  --up-mid: #f9c9ca;
  --down: #1a8f52;
  --warn: #e07b00;
  --accent: #2a78d6;
  /* 图表系列色(均线 / 分时价格线、均价线), 按固定顺序取用 */
  --series-1: #2a78d6;
  --series-2: #eb6834;
  --series-3: #1baf7a;
  --series-4: #eda100;
  color-scheme: light dark;
}

/* 主题: 默认跟随系统; 设置里选了浅色/深色时 <html data-theme> 强制(深色变量两处保持一致) */
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #101216;
  --panel: #171a1f;
  --head: #1c2026;
  --hover: #1f242b;
  --text: #e4e7eb;
  --muted: #8a919b;
  --line: #2a2f37;
  --up: #f2585b;
  --up-soft: #3a1f22;
  --up-mid: #63292c;
  --down: #1e9e5c;
  --warn: #ffa53d;
  --accent: #3987e5;
  --series-1: #3987e5;
  --series-2: #d95926;
  --series-3: #199e70;
  --series-4: #c98500;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #101216;
    --panel: #171a1f;
    --head: #1c2026;
    --hover: #1f242b;
    --text: #e4e7eb;
    --muted: #8a919b;
    --line: #2a2f37;
    --up: #f2585b;
    --up-soft: #3a1f22;
    --up-mid: #63292c;
    --down: #1e9e5c;
    --warn: #ffa53d;
    --accent: #3987e5;
    --series-1: #3987e5;
    --series-2: #d95926;
    --series-3: #199e70;
    --series-4: #c98500;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  -webkit-text-size-adjust: 100%;
}

button, input, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }

.top, .table-wrap, .foot {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
}

.top { flex: none; padding: 8px 16px 8px; }

.title-row { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; }
.title-info { display: flex; align-items: center; flex-wrap: wrap; flex: 1; min-width: 0; min-height: 32px; gap: 6px 12px; }
.top-actions { display: flex; align-items: center; align-self: flex-start; flex: none; gap: 8px; margin-left: auto; }
h1 { margin: 0; font-size: 21px; letter-spacing: .5px; }
.date { color: var(--muted); font-variant-numeric: tabular-nums; }

.live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.live.on { color: var(--up); border-color: var(--up-mid); background: var(--up-soft); }
.live.on::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--up);
  animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse { 50% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) { .live.on::before { animation: none; } }

.views {
  display: flex;
  gap: 2px;
  margin-left: auto;
  padding: 2px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.views button {
  padding: 4px 12px;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
}
.views button[aria-selected="true"] { background: var(--text); color: var(--panel); font-weight: 600; }

.stats { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 0 6px; }
.stat {
  padding: 3px 9px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}
.stat b { margin-left: 5px; color: var(--text); font-size: 14px; }
.stat.hl b { color: var(--up); }

.toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; }
.tools { display: flex; flex: 1 1 300px; justify-content: flex-end; gap: 8px; min-width: 0; }
.update-note { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 10px; }

.tabs {
  display: flex;
  gap: 2px;
  max-width: 100%;
  padding: 2px;
  overflow-x: auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs button {
  flex: none;
  padding: 4px 11px;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--muted);
  white-space: nowrap;
  cursor: pointer;
}
.tabs button[aria-selected="true"] { background: var(--up-soft); color: var(--up); font-weight: 600; }
.tabs .count { margin-left: 4px; font-size: 12px; font-variant-numeric: tabular-nums; }

.summary { color: var(--muted); font-variant-numeric: tabular-nums; }
.summary b { color: var(--text); }
.summary .sep { margin: 0 6px; }
.warn { color: var(--warn); }

#search {
  flex: 1 1 200px;
  max-width: 300px;
  min-width: 0;
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  outline: none;
}
#search:focus { border-color: var(--accent); }

.tool-btn, .screen-form button, .sheet button {
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--panel);
  white-space: nowrap;
  cursor: pointer;
}
.tool-btn:hover, .screen-form button:hover, .sheet button:hover { border-color: var(--muted); }
button.primary { background: var(--text); border-color: var(--text); color: var(--panel); font-weight: 600; }
button:disabled { opacity: .5; cursor: default; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* ---- 条件选股表单 ---- */

/* 条件区限高、自己滚动, 结果表格至少留一半高度 */
.screen-form {
  max-height: 42vh;
  margin-top: 12px;
  padding: 12px 14px;
  overflow: auto;
  overscroll-behavior: contain;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.f-row { display: flex; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.f-label { flex: none; width: 64px; padding-top: 6px; color: var(--muted); font-size: 13px; }
.f-body { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; min-width: 0; }
.f-pair, .check { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.f-pair input, .f-pair select {
  height: 32px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--bg);
  outline: none;
}
.f-pair input[type="number"] { width: 76px; }
.f-pair input[type="date"] { width: 140px; }
.f-pair input:focus, .f-pair select:focus { border-color: var(--accent); }
.check input { width: 16px; height: 16px; margin: 0; accent-color: var(--text); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { position: relative; display: inline-flex; cursor: pointer; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span, .chip-btn {
  display: inline-block;
  height: auto;
  padding: 4px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--text);
  font-size: 13px;
  line-height: 1.5;
  white-space: nowrap;
}
.screen-form .chip-btn { height: auto; padding: 4px 12px; border-radius: 999px; }
.factor-hint { color: var(--muted); font-size: 12px; }
.factor-help { flex-basis: 100%; font-size: 13px; }
.factor-help > summary { width: fit-content; color: var(--accent); cursor: pointer; }
.factor-explain { max-height: 330px; overflow: auto; line-height: 1.7; padding-right: 10px; }
.factor-explain p { margin: 8px 0; }
.factor-explain dl { display: grid; grid-template-columns: max-content 1fr; gap: 5px 14px; margin: 8px 0; }
.factor-explain dt { font-weight: 600; }
.factor-explain dd { margin: 0; }
.factor-sources a { color: var(--accent); }
.chip input:checked + span, .chip-btn[aria-pressed="true"] { border-color: var(--text); background: var(--text); color: var(--panel); }
.chip input[type="checkbox"]:checked + span::before { content: '✓'; margin-right: 5px; }
.screen-feedback { color: var(--muted); font-size: 12px; }
.screen-feedback.error { color: var(--accent); }
.screen-empty-note { max-width: 640px; margin: 10px auto; font-size: 13px; line-height: 1.7; }
.screen-issues { max-height: 180px; overflow: auto; margin-top: 8px; padding: 8px 12px; border: 1px solid var(--accent); border-radius: 8px; background: var(--panel); font-size: 13px; }
.screen-issues p { margin: 0 0 5px; }
.screen-issue { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; margin-top: 5px; }
.screen-issue .tool-btn { height: 27px; padding: 0 9px; font-size: 12px; }
.condition-invalid { outline: 1px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.chip input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 1px; }

.link-btn.link-btn { height: auto; padding: 0; border: 0; background: none; color: var(--accent); }

.pattern-desc {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 6px 14px;
  max-height: 30vh;
  margin: 0;
  padding: 10px 0 10px 76px;
  overflow: auto;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}
.pattern-desc dt { color: var(--text); font-weight: 600; }
.pattern-desc dd { margin: 0; }

/* 条件区内部滚动时, 「开始选股」始终贴在底部可见 */
.f-actions {
  position: sticky;
  bottom: -12px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 0 -14px -12px;
  padding: 10px 14px 12px;
  background: var(--panel);
}
.f-note { margin: 8px 0 0; color: var(--muted); font-size: 12px; }

/* ---- 表格 ---- */

.table-wrap {
  flex: 1;
  min-height: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--panel);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  transition: opacity .15s;
}
.table-wrap.busy { opacity: .5; }

/* 列宽(10-27 管理员「列调窄到一定程度后左右间距很大」): 各列只按内容/设定的宽度排, 表格比可视区窄时
   多出来的空白全给最右边的填充列(th/td.fill, 宽 100% 吃掉余量), 不再摊进每一列;
   为此每列的最小宽度要等于它的内容宽度(.cw 的 min-width: max-content, 定了宽/换行的列由 app.js 的动态规则覆盖) */
table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-variant-numeric: tabular-nums;
}
.cw { min-width: max-content; }
/* 比单元格窄的内容块(换行列按内容收窄、表头字比数据短时)照样按列的对齐方式靠右/居中 */
th:not(.l):not(.c):not(.name) > .cw, td:not(.l):not(.c):not(.name) > .cw { margin-left: auto; }
.c > .cw { margin-left: auto; margin-right: auto; }
th.fill, td.fill { width: 100%; padding: 0; }

th, td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  text-align: right;
  white-space: nowrap;
}

th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--head);
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  user-select: none;
  -webkit-user-select: none;
  cursor: pointer;
}
th.nosort { cursor: default; }
th:hover:not(.nosort), th[aria-sort] { color: var(--text); }
th .arrow { display: inline-block; width: 10px; margin-left: 2px; font-size: 10px; }

.l { text-align: left; }
.c { text-align: center; }

/* 名称列固定在左侧，手机横向滑动时始终可见 */
.name {
  position: sticky;
  left: 0;
  z-index: 1;
  min-width: 104px;
  background: var(--panel);
  text-align: left;
  box-shadow: 1px 0 0 var(--line);
}
th.name { z-index: 3; background: var(--head); }

tbody tr:hover td { background: var(--hover); }
tbody tr:last-child td { border-bottom: 0; }

.stock-link {
  display: block;
  padding: 0;
  border: 0;
  background: none;
  text-align: left;
  cursor: pointer;
}
.stock-link .n { display: block; font-weight: 600; }
.stock-link .code { color: var(--muted); font-size: 12px; }
.stock-link:hover .n { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.stock-heading { display: flex; align-items: flex-start; gap: 8px; }
.stock-heading .stock-link { flex: 1; min-width: 0; overflow: hidden; }
.stock-heading .stock-link .n { overflow: hidden; text-overflow: ellipsis; }
.stock-comments-link { flex: none; font: inherit; font-size: 11px; padding: 1px 4px; border: 1px solid color-mix(in srgb, var(--accent) 24%, var(--line)); border-radius: 4px; background: color-mix(in srgb, var(--accent) 7%, var(--panel)); color: var(--accent); cursor: pointer; }
.stock-comments-link:hover { background: color-mix(in srgb, var(--accent) 16%, var(--panel)); }
.pe-inline { display: block; margin: 3px 0; color: var(--muted); font-size: 11px; }
.pe-inline > span:not(.muted) { color: var(--text); }
.pe-asof { margin-left: 5px; color: var(--muted); font-size: 10px; }

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

.badge {
  display: inline-block;
  min-width: 44px;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--up-soft);
  color: var(--up);
  font-size: 12px;
  text-align: center;
}
.badge.b2 { background: var(--up-mid); }
.badge.b3 { background: var(--up); color: #fff; font-weight: 600; }

.type { color: var(--muted); font-size: 13px; }
.type.yz { color: var(--up); font-weight: 600; }
.type.tz { color: var(--warn); }

.tag {
  display: inline-block;
  margin: 1px 4px 1px 0;
  padding: 0 6px;
  border-radius: 4px;
  background: var(--bg);
  border: 1px solid var(--line);
  font-size: 12px;
}

td.spark-cell { padding-top: 4px; padding-bottom: 4px; }
.spark { display: block; margin: 0 auto; overflow: visible; }
/* 表格里的分时/年K缩略图(10-27): 横向铺满列宽(拖列宽时跟着伸缩, 左右留单元格内边距), 高度随宽度略长(30~46px); 线条粗细不随拉伸变 */
.spark.fluid { width: 100%; height: auto; aspect-ratio: 96 / 30; min-height: 30px; max-height: 46px; }
.spark.fluid line, .spark.fluid polyline, .spark.fluid path { vector-effect: non-scaling-stroke; }
.spark polyline { fill: none; stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; }
.spark.up polyline { stroke: var(--up); }
.spark.down polyline { stroke: var(--down); }
.spark.flat polyline { stroke: var(--muted); }
.spark .base { stroke: var(--line); stroke-width: 1; }
.spark-ph { display: block; width: 100%; height: 30px; margin: 0 auto; }
.kyear-detail { width: 100%; cursor: help; }
.ky-metrics { display: flex; flex-wrap: nowrap; justify-content: space-between; gap: 6px; margin-bottom: 3px; overflow: hidden; color: var(--muted); font-size: 10px; line-height: 1.45; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ky-metrics > span { display: inline-flex; flex: 0 0 auto; gap: 2px; white-space: nowrap; }
.ky-metrics > span:focus-visible { outline: 1px solid var(--accent); outline-offset: -1px; border-radius: 2px; }
.ky-metrics b { font-weight: 500; }
.ky-samples { display: block; color: var(--muted); font-size: 9px; line-height: 1.3; text-align: right; white-space: nowrap; }
.ky-missing { display: block; color: var(--muted); font-size: 10px; white-space: normal; }

td.mainbz { color: var(--muted); font-size: 13px; }
small.yoy { margin-left: 2px; font-size: 11px; }

/* 列宽拖动手柄(表头右边缘), 内容包在 .cw 里由动态样式定宽 */
.col-rs {
  position: absolute;
  top: 0;
  right: 0;
  width: 9px;
  height: 100%;
  cursor: col-resize;
  touch-action: none;
}
.col-rs::after {
  content: "";
  position: absolute;
  top: 28%;
  bottom: 28%;
  right: 3px;
  width: 2px;
  border-radius: 1px;
}
th:hover .col-rs::after { background: var(--line); }
.col-rs:hover::after, .col-resizing .col-rs::after { background: var(--accent); }
body.col-resizing { cursor: col-resize; user-select: none; -webkit-user-select: none; }

/* 字号/行距(设置) */
:root[data-fs="s"] body { font-size: 13px; }
:root[data-fs="l"] body { font-size: 15.5px; }
:root[data-density="compact"] th, :root[data-density="compact"] td { padding: 5px 8px; }
:root[data-density="loose"] th, :root[data-density="loose"] td { padding: 13px 14px; }

.empty { padding: 48px 16px; color: var(--muted); text-align: center; }
.empty[hidden] { display: none; }
.empty button {
  margin-top: 10px;
  padding: 6px 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  cursor: pointer;
}

.foot a { color: var(--accent); }
.foot {
  flex: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 2px 16px;
  padding: 5px 16px calc(5px + env(safe-area-inset-bottom));
  color: var(--muted);
  font-size: 12px;
}

/* ---- 弹窗 ---- */

.sheet {
  width: min(760px, calc(100vw - 32px));
  max-height: calc(100dvh - 48px);
  padding: 0;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  color: var(--text);
  box-shadow: 0 12px 40px rgba(0, 0, 0, .18);
}
.sheet::backdrop { background: rgba(0, 0, 0, .35); }
.sheet { scrollbar-gutter: stable; }
.sheet-foot .push { margin-left: auto; }
.sheet-head {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  padding: 12px 16px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}
.sheet h2 { margin: 0; font-size: 17px; }
.sheet .x.x { width: 36px; height: 36px; margin-left: auto; padding: 0; border: 0; font-size: 22px; line-height: 1; color: var(--muted); }
.sheet-tip { margin: 12px 16px 4px; color: var(--muted); font-size: 13px; }
.sheet-foot {
  position: sticky;
  bottom: 0;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 16px;
  background: var(--panel);
  border-top: 1px solid var(--line);
}

.col-list { margin: 0; padding: 4px 8px 8px; list-style: none; }
.col-head { display: grid; grid-template-columns: 18px 22px minmax(0, 1fr) auto 40px 36px 36px; gap: 8px; padding: 0 16px; color: var(--muted); font-size: 12px; text-align: center; }
.col-head span { white-space: nowrap; }
.col-head span:nth-child(3) { text-align: left; }
.col-list .col-wrap { width: 18px; height: 18px; margin: 0 auto; accent-color: var(--text); }
.col-list li {
  display: grid;
  grid-template-columns: 18px 22px minmax(0, 1fr) auto 40px 36px 36px;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 8px;
}
.col-list li:hover { background: var(--hover); }
.col-list li.dragging { opacity: .4; }
.col-list .grip { color: var(--muted); cursor: grab; text-align: center; }
.col-list .col-show { width: 18px; height: 18px; margin: 0; accent-color: var(--text); }
.col-list .col-label {
  min-width: 0;
  height: 32px;
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: none;
  outline: none;
}
.col-list .col-label:hover { border-color: var(--line); }
@media (hover: none) { .col-list .col-label { border-color: var(--line); } }
.col-list .col-label:focus { border-color: var(--accent); background: var(--bg); }
.col-list .col-base { color: var(--muted); font-size: 12px; white-space: nowrap; }
.sheet .col-list button { width: 36px; height: 32px; padding: 0; }

/* 个股弹窗贴顶显示: 默认垂直居中时, K线/主营构成陆续加载、内容变高, 整个弹窗会跟着上下跳 */
.stock { width: min(1173px, calc(100vw - 32px)); margin: 24px auto auto; max-height: calc(100dvh - 48px); } /* 10-26 管理员「K线弹窗再宽三分之一」: 880 → 1173 */

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--muted);
  cursor: pointer;
}
.icon-btn:hover { color: var(--text); border-color: var(--muted); }

/* 基础设置弹窗 */
.settings { width: min(600px, calc(100vw - 32px)); }
.set-body { padding: 0 16px; }
.set-group { padding: 10px 0; border-bottom: 1px solid var(--line); }
.set-group h3 { margin: 0 0 4px; color: var(--muted); font-size: 13px; font-weight: 500; }
.set-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; padding: 7px 0; }
.set-row > span { flex: none; }
.seg { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 9px; }
.sheet .seg button { height: 30px; padding: 0 12px; border: 0; border-radius: 6px; background: none; color: var(--muted); }
.sheet .seg button[aria-pressed="true"] { background: var(--text); color: var(--panel); font-weight: 600; }
.set-ctl { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px 8px; }
.sheet .set-act { height: 32px; padding: 0 12px; }
.set-link { display: block; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; color: var(--accent); text-decoration: none; }
.set-link span { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; }
.set-link:hover { border-color: var(--accent); }
.push-status { margin-top: 10px; padding: 10px 12px; border-radius: 9px; background: var(--bg); font-size: 13px; }
.push-status h4 { margin: 0 0 4px; font-size: 13px; }
.push-status p { margin: 2px 0; }
.push-status .sep { margin: 0 6px; color: var(--muted); }
.push-status .up-ok { color: var(--accent); }
.push-recent { margin: 6px 0 0; padding: 0; list-style: none; }
.push-recent li { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.push-status .pk-h { margin-top: 10px; }
.sd-title { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; min-width: 0; }
.sd-code { color: var(--muted); font-variant-numeric: tabular-nums; }
.sd-tags .tag { margin: 0 4px 0 0; }
.sd-quote { display: flex; align-items: baseline; gap: 8px; margin-left: auto; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sd-quote b { font-size: 20px; }
.sd-quote small { color: var(--muted); }
.sd-quote + .x.x { margin-left: 0; }

.sd-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 16px 0; }
.sd-tabs { display: flex; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 9px; }
.sheet .sd-tabs button { height: 30px; padding: 0 14px; border: 0; border-radius: 6px; background: none; color: var(--muted); }
.sheet .sd-tabs button[aria-selected="true"] { background: var(--text); color: var(--panel); font-weight: 600; }
.sd-zoom { display: flex; gap: 6px; }
.sheet .sd-zoom button { width: 34px; height: 32px; padding: 0; }

.sd-chart { position: relative; padding: 6px 16px 0; transition: opacity .15s; }
.sd-chart.busy { opacity: .5; }
.sd-chart canvas { display: block; width: 100%; height: 360px; touch-action: pan-y; cursor: crosshair; }
.chart-readout {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 14px;
  min-height: 22px;
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.chart-readout .rk { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.chart-readout .rk.t { color: var(--text); }
.chart-readout .rk i { display: inline-block; width: 12px; height: 2px; border-radius: 1px; }
.chart-readout b { color: var(--text); font-weight: 600; }
.chart-readout b.up { color: var(--up); }
.chart-readout b.down { color: var(--down); }

/* 加载失败提示盖在图上, 不挤动下面的内容 */
.sd-status {
  position: absolute;
  top: 45%;
  left: 16px;
  right: 16px;
  z-index: 1;
  color: var(--warn);
  font-size: 13px;
  text-align: center;
}
.sd-src { margin-left: auto; color: var(--muted); font-size: 12px; white-space: nowrap; }
.sd-quarter { margin: 0 0 8px; color: var(--muted); font-size: 13px; }
.sd-quarter b { color: var(--text); }
.sd-quarter b.up { color: var(--up); }
.sd-quarter b.down { color: var(--down); }
.sd-quarter .sep { margin: 0 6px; }
.sd-info { padding: 8px 16px 0; }
.sd-asof { margin: 4px 0; color: var(--muted); font-size: 12px; }
.sd-info dl { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0 16px; margin: 0; }
.sd-info dl div { display: flex; justify-content: space-between; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.sd-info dt { color: var(--muted); }
.sd-info dd { margin: 0; font-variant-numeric: tabular-nums; }

.sd-mainbz { min-height: 140px; padding: 12px 16px 0; }
.sd-mainbz h3 { margin: 0 0 6px; font-size: 14px; }
.sd-mainbz h3 small { margin-left: 6px; color: var(--muted); font-weight: 400; }
.bz-list { margin: 0; padding: 0; list-style: none; }
.bz-list li { display: grid; grid-template-columns: minmax(0, 1fr) 26% 52px 64px; align-items: center; gap: 10px; padding: 4px 0; }
.bz-list .bz-head { padding: 0 0 2px; color: var(--muted); font-size: 12px; }
.bz-list .bz-head span:nth-child(n+3), .bz-yoy { text-align: right; font-variant-numeric: tabular-nums; }
.bz-name { overflow-wrap: anywhere; }
.bz-bar { height: 8px; background: var(--bg); border-radius: 4px; overflow: hidden; }
.bz-bar i { display: block; height: 100%; background: var(--series-1); border-radius: 0 4px 4px 0; }
.bz-pct { text-align: right; font-variant-numeric: tabular-nums; }

.sd-links { display: flex; gap: 16px; padding: 12px 16px 16px; font-size: 13px; }
.sd-links a { color: var(--accent); text-decoration: none; }
.sd-links a:hover { text-decoration: underline; }

/* 每只股票独立的评论区，沿用当前主题颜色。 */
.sd-comments { margin: 14px 16px 0; padding: 12px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); scroll-margin-top: 64px; }
.sd-comments-head { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.sd-comments h3 { margin: 0; font-size: 14px; }
.sd-comments h3 small { margin-left: 6px; color: var(--muted); font-weight: 400; }
#sc-refresh { margin-left: auto; }
.sd-comments a { color: var(--accent); text-decoration: none; }
.sd-comments a:hover { text-decoration: underline; }
#sc-original { font-size: 12px; }
.sc-summary { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }
#sc-load-status.sc-error { color: var(--up); }
#sc-load-status { color: var(--muted); font-size: 13px; margin-top: 10px; }
.sc-list { list-style: none; margin: 0; padding: 0; max-height: 340px; overflow-y: auto; overscroll-behavior: contain; }
.sc-item { padding: 12px 0; border-bottom: 1px solid var(--line); }
.sc-item:last-child { border-bottom: 0; }
.sc-item > a { display: block; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.7; font-size: 13px; }
.sc-item-meta { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: 4px; }
.sc-counts { margin-left: auto; }
.sc-pagination { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 10px; font-size: 12px; color: var(--muted); }
.sc-pagination[hidden] { display: none; }
.stock.comments-only { width: min(850px, calc(100vw - 32px)); }
.stock.comments-only .sd-bar, .stock.comments-only .sd-chart, .stock.comments-only .sd-info, .stock.comments-only .sd-mainbz, .stock.comments-only .sd-links { display: none; }
.stock.comments-only .sd-comments { margin-top: 0; border-top: 0; border-bottom: 0; }
.stock.comments-only .sc-list { max-height: calc(100dvh - 245px); }

@media (min-width: 1472px) {
  .table-wrap { border: 1px solid var(--line); border-radius: 10px; }
}

@media (max-width: 640px) {
  body { font-size: 13px; }
  .top { padding: 8px 12px 8px; }
  h1 { font-size: 18px; }
  .views { margin-left: 0; width: 100%; order: 2; }
  .views button { flex: 1; }
  .icon-btn { order: 1; margin-left: auto; }
  .stats { order: 3; width: 100%; }
  :root[data-fs="s"] body { font-size: 12px; }
  :root[data-fs="l"] body { font-size: 14.5px; }
  .chart-readout { min-height: 58px; } /* 手机上读数会折成三行, 先把高度留出来, 数据到了不把图往下顶 */
  .stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-top: 8px; }
  .stat { display: flex; flex-direction: column; align-items: center; padding: 5px 0; font-size: 12px; }
  .stat b { margin: 0; font-size: 15px; }
  .toolbar { margin-top: 8px; gap: 8px; }
  .tabs, .tools, .summary { flex: 1 1 100%; }
  .tabs button { flex: 1 0 auto; padding: 5px 8px; }
  .search-box { max-width: none; }
  th, td { padding: 8px 9px; }
  .name { min-width: 92px; }

  .foot { padding-left: 12px; padding-right: 12px; }

  .screen-form { padding: 8px 10px; max-height: 50dvh; }
  .f-actions { bottom: -8px; margin: 0 -10px -8px; padding: 8px 10px; }
  .f-row { flex-direction: column; gap: 6px; }
  .f-label { width: auto; padding-top: 0; }
  .f-body { gap: 8px 12px; }
  .f-pair input[type="number"] { width: 64px; }
  .f-pair input[type="date"] { width: 132px; }
  .pattern-desc { grid-template-columns: 1fr; gap: 2px; padding-left: 0; }
  .pattern-desc dd { margin-bottom: 6px; }

  .sheet, .stock {
    width: 100vw;
    max-width: none;
    height: 100dvh;
    max-height: none;
    margin: 0;
    border: 0;
    border-radius: 0;
  }
  .sheet-head { flex-wrap: wrap; padding: 10px 12px; }
  .sd-quote { margin-left: 0; order: 3; flex-basis: 100%; }
  .sd-quote + .x.x { margin-left: auto; }
  .sd-bar, .sd-chart, .sd-info, .sd-mainbz { padding-left: 12px; padding-right: 12px; }
  .sd-chart canvas { height: 46dvh; }
  .col-list li, .col-head { grid-template-columns: 16px 20px minmax(0, 1fr) 36px 34px 34px; }
  .col-list .col-base, .col-head span:nth-child(4) { display: none; }
  .stock { margin: 0; }
}

/* ---- 数据源页(sources.html) ---- */

body.doc { display: block; height: auto; }
.doc .top { padding-bottom: 0; }
.back { margin-left: auto; color: var(--accent); text-decoration: none; white-space: nowrap; }
.back:hover { text-decoration: underline; }
.doc-main { width: 100%; max-width: 1440px; margin: 0 auto; padding: 0 16px 8px; }
.doc-card { margin: 12px 0; padding: 14px 16px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; }
.doc-card h2 { margin: 0 0 8px; font-size: 16px; }
.doc-card p { margin: 6px 0; }
.doc-tip { color: var(--muted); font-size: 12.5px; }
.doc-table { margin: 8px 0 0; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.doc-table table { width: 100%; min-width: 900px; }
.doc-table th { position: static; cursor: default; white-space: nowrap; }
.doc-table td.c { white-space: nowrap; }
.doc-table th, .doc-table td { vertical-align: top; white-space: normal; }
.doc .small { font-size: 12px; }
.doc .err { max-width: 280px; overflow-wrap: anywhere; }
.doc code { padding: 0 4px; border-radius: 4px; background: var(--bg); font-size: 12px; }
.st { display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 4px; font-size: 11px; font-weight: 400; white-space: nowrap; }
.st-ok { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); }
.st-warn { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); }
.st-bad { background: var(--up-soft); color: var(--up); }
.st-idle { background: var(--bg); color: var(--muted); }
.paid { color: var(--up); font-weight: 600; }
.down-t { color: var(--up); }
.apis { margin-top: 4px; color: var(--muted); font-size: 11.5px; }
.hbars { display: block; margin: 0 auto; }
.hbars .ok { fill: var(--series-1); opacity: .55; }
.hbars .bad { fill: var(--up); }
.doc-list { margin: 0; padding-left: 20px; }
.doc-list li { margin: 6px 0; }

/* ---- 主营构成: 分项数据 + 每项的大白话(模型生成); 不换行时两行(数据 / 大白话), 换行时每项一行 ---- */
.fund-summary { display: flex; align-items: baseline; gap: 3px; padding: 0 0 4px; margin-bottom: 4px; border-bottom: 1px solid var(--line); white-space: nowrap; color: var(--text); cursor: help; font-size: 11px; line-height: 1.45; }
.fund-summary i { font-style: normal; color: var(--muted); flex-shrink: 0; }
.fund-summary b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; }
.fund-summary:focus-visible { outline: 1px solid var(--accent); outline-offset: 2px; }
.fund-grade.g-0, .fund-grade.g-1 { color: var(--down); }
.fund-grade.g-3, .fund-grade.g-4 { color: var(--up); }
.fund-grade.g-0, .fund-grade.g-4 { font-weight: 650; }
.fund-grade.g-pending { color: var(--muted); }
#fund-pop { position: fixed; z-index: 95; width: 450px; max-width: calc(100vw - 16px); max-height: calc(100vh - 20px); overflow-y: auto; box-sizing: border-box; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel); color: var(--text); box-shadow: 0 8px 30px #0004; font-size: 12px; line-height: 1.5; }
#fund-pop .fund-title, #fund-pop .fund-group { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
#fund-pop .fund-title > span, #fund-pop .fund-group > span { font-size: 10.5px; color: var(--muted); }
#fund-pop section { padding-top: 6px; margin-top: 6px; border-top: 1px solid var(--line); }
#fund-pop dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 12px; margin: 5px 0 0; }
#fund-pop dl > div { display: flex; justify-content: space-between; gap: 5px; }
#fund-pop dt { color: var(--muted); }
#fund-pop dd { margin: 0; font-variant-numeric: tabular-nums; }
#fund-pop p { margin: 7px 0 0; color: var(--muted); }
#fund-pop .fund-note { font-size: 10.5px; }
#fund-pop .fund-key-fields { display: flex; justify-content: space-between; gap: 8px; margin-top: 7px; padding: 5px 0; }
#fund-pop .fund-key-fields span { display: flex; gap: 4px; align-items: baseline; }
#fund-pop .fund-key-fields i { font-style: normal; color: var(--muted); }
#fund-pop .fund-cap { color: var(--warn); font-size: 11px; }
#fund-pop .fund-score-table { width: 100%; border-collapse: collapse; font-size: 11px; margin-top: 5px; }
#fund-pop .fund-score-table th, #fund-pop .fund-score-table td { position: static; background: transparent; padding: 3px 4px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
#fund-pop .fund-score-table th:first-child, #fund-pop .fund-score-table td:first-child { text-align: left; }
#fund-pop .fund-score-table th { font-size: 10.5px; color: var(--muted); }
#fund-pop .fund-sources { font-size: 10px; }
#fund-pop .fund-sources a { color: var(--accent); }
.archive-picker { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.archive-picker select { width: 174px; max-width: 174px; height: 28px; padding: 2px 5px; color: var(--text); background: var(--panel); border: 1px solid var(--line); border-radius: 6px; font: inherit; text-overflow: ellipsis; }
.archive-status { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; color: var(--accent); }
.archive-mode #screen-form { opacity: .55; }
.analysis-heading button:disabled { opacity: .55; cursor: default; }
.bz-data, .bz-ex { display: block; overflow: hidden; text-overflow: ellipsis; }
.bz-ex { margin-top: 2px; color: var(--muted); font-size: 12px; opacity: .85; }
.bz-ex::before { content: "💡 "; }
td.mainbz .bz-n { margin-right: 2px; color: var(--text); }
.bz-rows { display: block; }
.bz-it { display: block; padding: 1px 0; }
.bz-it + .bz-it { border-top: 1px dashed color-mix(in srgb, var(--line) 75%, transparent); }
.bz-x { margin-left: 6px; color: var(--muted); font-size: 12px; opacity: .9; }
.bz-x::before { content: "· "; }
.ai-wait { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; opacity: .75; }
.ai-wait::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 5px; border: 1.5px solid currentColor; border-top-color: transparent; border-radius: 50%; vertical-align: -1px; animation: spin .9s linear infinite; }
/* 行业地位: 不换行时最多两行, 悬停看全文 */
td.pos { font-size: 13px; }
.pos-text { display: block; white-space: normal; line-height: 1.45; opacity: .9; }
.pos-text.clamp2 { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.sd-pos { margin: 0 0 10px; padding: 8px 10px; border-radius: 8px; background: color-mix(in srgb, var(--accent) 7%, var(--bg)); font-size: 13px; line-height: 1.65; }
.sd-pos b { margin-right: 6px; }
.sd-pos .spinner { vertical-align: -2px; }
.bz-ex2 { display: block; margin-top: 1px; color: var(--muted); font-size: 12px; line-height: 1.4; }

/* ---- 模型配置弹窗 ---- */
.ai-sheet { width: min(680px, calc(100vw - 32px)); }
.ai-body { padding: 0 16px 16px; }
.ai-slot { margin: 12px 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; }
.ai-slot header { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; }
.ai-slot h3 { margin: 0; font-size: 15px; }
.ai-cur { color: var(--accent); font-size: 13px; }
.ai-desc { margin: 4px 0 8px; font-size: 12.5px; }
.ai-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 5px 0; }
.ai-row > span:first-child { flex: none; width: 64px; color: var(--muted); font-size: 13px; }
.ai-row select, .ai-row input { height: 32px; padding: 0 8px; border: 1px solid var(--line); border-radius: 7px; background: var(--bg); outline: none; }
.ai-row select { flex: 1 1 220px; min-width: 0; }
.ai-row input.ai-len { width: 80px; }
.ai-row input.ai-code { width: 120px; }
.ai-row select:focus, .ai-row input:focus { border-color: var(--accent); }
.ai-pnote, .ai-mnote, .ai-bizstat { margin: 0 0 2px 76px; font-size: 12px; }
.ai-pnote:empty, .ai-mnote:empty { display: none; }
.ai-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.ai-result { margin-top: 8px; padding: 8px 10px; border-radius: 8px; background: var(--bg); font-size: 13px; white-space: pre-wrap; }
.ai-result.ok { color: var(--accent); }
.ai-result.err { color: var(--warn); }
.ai-meta { margin-bottom: 6px; color: var(--muted); font-size: 12px; }
.ai-text { line-height: 1.65; }
@media (max-width: 640px) {
  .ai-pnote, .ai-mnote, .ai-bizstat { margin-left: 0; }
  .ai-sheet { width: 100vw; }
}

/* ---- 加载动画(10-26): 顶部进度条、转圈、骨架闪光; 系统设了「减少动态效果」时只保留静态样子 ---- */

#topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  height: 2px;
  overflow: hidden;
  pointer-events: none;
  opacity: 0;
  transition: opacity .3s;
}
#topbar::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 40%;
  background: linear-gradient(90deg, transparent, var(--accent), var(--up), transparent);
  animation: topbar 1.1s ease-in-out infinite;
}
body.loading #topbar { opacity: 1; }
@keyframes topbar { from { left: -40%; } to { left: 100%; } }

.spinner {
  display: inline-block;
  width: 1em;
  height: 1em;
  margin-right: .45em;
  vertical-align: -.15em;
  border: 2px solid color-mix(in srgb, var(--accent) 22%, transparent);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .75s linear infinite;
}
.spinner.lg { width: 28px; height: 28px; margin: 0 0 10px; border-width: 3px; }
@keyframes spin { to { transform: rotate(360deg); } }
.loader { display: flex; flex-direction: column; align-items: center; color: var(--muted); }
.dots::after { content: "…"; display: inline-block; width: 1.2em; text-align: left; animation: dots 1.2s steps(4, end) infinite; overflow: hidden; vertical-align: bottom; }
@keyframes dots { from { width: 0; } to { width: 1.2em; } }

.skel {
  display: inline-block;
  height: .8em;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--line) 0%, color-mix(in srgb, var(--line) 35%, var(--panel)) 50%, var(--line) 100%);
  background-size: 200% 100%;
  animation: skel 1.3s ease-in-out infinite;
  vertical-align: middle;
}
@keyframes skel { from { background-position: 100% 0; } to { background-position: -100% 0; } }
.skel-line { width: 70%; min-width: 48px; }
.skel-num { width: 42px; }
tr.skel-row td { pointer-events: none; }
tr.skel-row td .skel { width: 64%; }
tr.skel-row td.name .skel { width: 72px; height: 1.6em; }
.spark-ph {
  border-radius: 4px;
  background: linear-gradient(90deg, transparent 0%, color-mix(in srgb, var(--line) 70%, transparent) 50%, transparent 100%);
  background-size: 200% 100%;
  animation: skel 1.6s ease-in-out infinite;
}
.bz-skel { display: grid; gap: 8px; padding: 4px 0; }
.bz-skel .skel { height: 10px; }

/* 选股/切周期时: 内容调淡 + 中间转圈 */
.table-wrap.busy { opacity: .62; }
.busy-chip {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 20;
  display: none;
  align-items: center;
  padding: 8px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--muted);
  box-shadow: 0 6px 24px rgba(0, 0, 0, .12);
  transform: translate(-50%, -50%);
}
body.screening .busy-chip { display: inline-flex; }
.sd-chart.busy::after {
  content: "";
  position: absolute;
  top: calc(50% - 16px);
  left: calc(50% - 16px);
  width: 32px;
  height: 32px;
  border: 3px solid color-mix(in srgb, var(--accent) 22%, transparent);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .75s linear infinite;
}
button.loading { position: relative; color: transparent !important; pointer-events: none; }
button.loading::after {
  content: "";
  position: absolute;
  top: calc(50% - 8px);
  left: calc(50% - 8px);
  width: 16px;
  height: 16px;
  border: 2px solid color-mix(in srgb, currentColor 25%, transparent);
  border-color: var(--muted);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .75s linear infinite;
}
@media (prefers-reduced-motion: reduce) {
  #topbar::before, .spinner, .skel, .spark-ph, .dots::after, .sd-chart.busy::after, button.loading::after { animation-duration: 3s; }
}

/* ---- 风格: 只换表格外的背景与特效, 表格里的字不变、颜色只做同色系微调 ----
   <html data-style> 风格, data-mode 实际明暗(跟随系统时由脚本算出), data-fx 特效强度(off/soft/normal) */

:root { --bg-page: var(--bg); --panel-glass: var(--panel); --fx-star: 255, 255, 255; --fx-dust: 120, 170, 255; --fx-alpha: 1; }
body { background: var(--bg-page); background-attachment: fixed; }
.top, .table-wrap, .foot, .doc-main { position: relative; z-index: 1; }
/* 搜索下拉跟随标题栏处于表格之上，避免被固定表头挡住。 */
.top { z-index: 4; }

#fx { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
#fx canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.fx-glow { position: absolute; inset: -20%; opacity: 0; }
.fx-formulas span {
  position: absolute;
  color: rgb(var(--fx-star));
  font: italic 400 17px/1.2 "Times New Roman", "STIX Two Math", "Cambria Math", Georgia, serif;
  white-space: nowrap;
  opacity: 0;
  animation: fx-float var(--d, 30s) ease-in-out var(--delay, 0s) infinite alternate;
}
.fx-formulas sub, .fx-formulas sup { font-size: .7em; }
@keyframes fx-float {
  0% { opacity: 0; transform: translate3d(0, 24px, 0) rotate(calc(var(--r, 0deg) * -1)); }
  15% { opacity: var(--o, .12); }
  85% { opacity: var(--o, .12); }
  100% { opacity: 0; transform: translate3d(var(--dx, 30px), -36px, 0) rotate(var(--r, 0deg)); }
}

/* 特效风格下: 表格区和表头上方的小卡片带一点通透, 背后的粒子隐约可见; 固定的表头、名称列保持不透明(滚动时不串影) */
:root[data-style]:not([data-style="classic"]) .table-wrap, :root[data-style]:not([data-style="classic"]) .screen-form { background: var(--panel-glass); }
:root[data-style]:not([data-style="classic"]) .f-actions { background: var(--panel); }

/* 表头星光: 每个表头格一颗小四角星, 位置和节奏错开, 慢慢一闪 */
thead th { --sx: 18%; --sy: 5px; --sd: 0s; --sdur: 5.2s; }
thead th:nth-child(3n+1) { --sx: 72%; --sy: 7px; --sd: 1.3s; }
thead th:nth-child(3n+2) { --sx: 40%; --sy: calc(100% - 13px); --sd: 2.6s; --sdur: 6.4s; }
thead th:nth-child(4n) { --sx: 86%; --sd: 3.9s; --sdur: 4.6s; }
thead th:nth-child(5n) { --sx: 8%; --sy: calc(100% - 15px); --sd: .6s; }
:root[data-fx="soft"] thead th { --sk: 1.7; }
:root[data-style]:not([data-style="classic"]):not([data-fx="off"]) thead th:not(.fill)::before {
  content: "";
  position: absolute;
  top: var(--sy);
  left: var(--sx);
  width: 9px;
  height: 9px;
  pointer-events: none;
  background: radial-gradient(circle, rgba(var(--fx-star), 1) 0%, rgba(var(--fx-star), .85) 30%, rgba(var(--fx-dust), .5) 60%, transparent 75%);
  clip-path: polygon(50% 0, 60% 40%, 100% 50%, 60% 60%, 50% 100%, 40% 60%, 0 50%, 40% 40%); /* 四角星 ✦ */
  opacity: 0;
  animation: twinkle calc(var(--sdur) * var(--sk, 1)) ease-in-out var(--sd) infinite;
}
@keyframes twinkle {
  0%, 60%, 100% { opacity: 0; transform: scale(.3); }
  70% { opacity: .9; transform: scale(1.1); }
  76% { opacity: .55; transform: scale(.8); }
  84% { opacity: .85; transform: scale(1); }
  92% { opacity: 0; transform: scale(.4); }
}
:root[data-style]:not([data-style="classic"]) tbody tr:hover td { box-shadow: inset 0 1px 0 color-mix(in srgb, var(--accent) 14%, transparent), inset 0 -1px 0 color-mix(in srgb, var(--accent) 14%, transparent); }
@media (prefers-reduced-motion: reduce) { thead th::before { animation: none !important; opacity: .5 !important; } .fx-formulas span { animation: none; opacity: var(--o, .1); } }

/* 星空: 深夜蓝 + 银河、游星与小黑洞; 浅色用清晨淡蓝。左下角保持深蓝 #0c1a38。 */
:root[data-style="starry"][data-mode="dark"] {
  --bg-page: radial-gradient(ellipse 120% 80% at 50% -10%, #1f2a4d 0%, #0d1328 48%, #0c1a38 100%);
  --panel: #10172a; --head: #151e36; --hover: #1a2441; --line: #232e4b; --accent: #6ea4ff;
  --panel-glass: rgba(16, 23, 42, .82); --fx-star: 235, 241, 255; --fx-dust: 140, 185, 255;
}
:root[data-style="starry"][data-mode="light"] {
  --bg-page: linear-gradient(180deg, #e9edfb 0%, #f1effa 55%, #f8f5f1 100%);
  --head: #f5f6fc; --hover: #f1f3fb; --line: #e2e5f1; --accent: #4a63d6;
  --panel-glass: rgba(255, 255, 255, .84); --fx-star: 92, 110, 190; --fx-dust: 108, 124, 220;
}
/* 极光: 缓慢流动的光带 */
:root[data-style="aurora"] .fx-glow {
  opacity: 1;
  background:
    radial-gradient(40% 35% at 20% 25%, rgba(var(--g1), .55), transparent 70%),
    radial-gradient(35% 30% at 75% 20%, rgba(var(--g2), .45), transparent 70%),
    radial-gradient(45% 40% at 60% 80%, rgba(var(--g3), .4), transparent 70%);
  filter: blur(40px);
  animation: aurora 26s ease-in-out infinite alternate;
}
@keyframes aurora { 0% { transform: translate3d(-4%, -2%, 0) rotate(0deg) scale(1); } 50% { transform: translate3d(3%, 2%, 0) rotate(6deg) scale(1.08); } 100% { transform: translate3d(-2%, 4%, 0) rotate(-4deg) scale(1.02); } }
:root[data-style="aurora"][data-mode="dark"] {
  --bg-page: linear-gradient(180deg, #06141a 0%, #08111d 60%, #0b0b17 100%);
  --panel: #0e1a20; --head: #12232b; --hover: #16303a; --line: #1f3540; --accent: #4fd1c5;
  --panel-glass: rgba(14, 26, 32, .8); --fx-star: 220, 255, 250; --fx-dust: 110, 240, 210; --g1: 32, 201, 151; --g2: 124, 92, 255; --g3: 40, 140, 255;
}
:root[data-style="aurora"][data-mode="light"] {
  --bg-page: linear-gradient(180deg, #eef9f6 0%, #f3f1fd 60%, #f7f9fc 100%);
  --head: #f4faf9; --hover: #eef7f5; --line: #dfeceb; --accent: #129c8c;
  --panel-glass: rgba(255, 255, 255, .82); --fx-star: 40, 150, 140; --fx-dust: 90, 120, 230; --g1: 120, 230, 200; --g2: 190, 170, 255; --g3: 150, 200, 255;
}
/* 数学: 浅色方格纸 / 深色黑板, 飘着金融与数学公式 */
:root[data-style="formula"][data-mode="light"] {
  --bg-page: linear-gradient(rgba(60, 90, 140, .06) 1px, transparent 1px) 0 0 / 26px 26px, linear-gradient(90deg, rgba(60, 90, 140, .06) 1px, transparent 1px) 0 0 / 26px 26px, #fbfaf6;
  --panel: #fffefb; --head: #f7f5ee; --hover: #f5f2ea; --line: #e7e2d6; --accent: #3a66b0;
  --panel-glass: rgba(255, 254, 250, .86); --fx-star: 50, 70, 120; --fx-dust: 70, 100, 170;
}
:root[data-style="formula"][data-mode="dark"] {
  --bg-page: linear-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px) 0 0 / 26px 26px, linear-gradient(90deg, rgba(255, 255, 255, .035) 1px, transparent 1px) 0 0 / 26px 26px, #18231f;
  --panel: #16201c; --head: #1b2823; --hover: #20302a; --line: #2a3b34; --accent: #7cc4a4;
  --panel-glass: rgba(22, 32, 28, .84); --fx-star: 236, 240, 228; --fx-dust: 200, 230, 210;
}
/* 设置里的风格选择: 带小色板 */
.style-pick { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; width: 100%; }
.sheet .style-pick button {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  height: auto;
  padding: 6px;
  border-radius: 10px;
  text-align: center;
}
.style-pick i { display: block; height: 34px; border-radius: 6px; border: 1px solid var(--line); background-size: cover; }
.sheet .style-pick button[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; color: var(--accent); font-weight: 600; }
.style-pick [data-v="classic"] i { background: linear-gradient(135deg, #f4f5f7 50%, #101216 50%); }
.style-pick [data-v="starry"] i { background: radial-gradient(1.5px 1.5px at 20% 30%, #fff 50%, transparent), radial-gradient(1px 1px at 70% 60%, #fff 50%, transparent), radial-gradient(1.5px 1.5px at 45% 75%, #cfe0ff 50%, transparent), radial-gradient(1px 1px at 85% 20%, #fff 50%, transparent), radial-gradient(circle at 76% 64%, #ead6a6 0 3px, transparent 3.6px), radial-gradient(ellipse 9px 2.4px at 76% 64%, transparent 55%, rgba(230, 212, 176, .75) 62%, transparent 80%), radial-gradient(ellipse 45% 55% at 26% 62%, rgba(188, 58, 156, .5), transparent 72%), radial-gradient(ellipse at top, #24305a, #070a14); }
.style-pick [data-v="aurora"] i { background: radial-gradient(60% 60% at 25% 30%, rgba(32, 201, 151, .9), transparent 70%), radial-gradient(60% 60% at 80% 40%, rgba(124, 92, 255, .8), transparent 70%), #08111d; }
.style-pick [data-v="formula"] i { background: linear-gradient(rgba(60, 90, 140, .18) 1px, transparent 1px) 0 0 / 8px 8px, linear-gradient(90deg, rgba(60, 90, 140, .18) 1px, transparent 1px) 0 0 / 8px 8px, #fbfaf6; }
.style-pick [data-v="formula"] i::after { content: "∑∫π"; display: block; padding-top: 6px; color: #3a66b0; font: italic 13px Georgia, serif; }
@media (max-width: 640px) { .style-pick { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* 资讯推送状态里的知识库表 */
.kb-table { width: 100%; margin: 6px 0; border-collapse: collapse; font-size: 12.5px; }
.kb-table th, .kb-table td { position: static; padding: 4px 6px; border-bottom: 1px solid var(--line); background: none; white-space: nowrap; cursor: default; }
.kb-table th { color: var(--muted); font-weight: 500; }
.kb-table td.l, .kb-table th.l { text-align: left; white-space: normal; }
.kb-table .gone td { opacity: .5; }
.push-status .kb-scroll { overflow-x: auto; }

/* ---- 名称下小卡片(10-26): 名称、代码下面一行小字, 字段在列设置里选 ---- */
.subcard { display: flex; flex-wrap: wrap; gap: 2px 4px; max-width: 176px; margin-top: 3px; white-space: normal; }
.subcard .sc {
  --c: var(--accent);
  display: inline-flex;
  align-items: baseline;
  gap: 3px;
  padding: 0 5px;
  border-radius: 4px;
  background: color-mix(in srgb, var(--c) 13%, transparent); /* 半透明底色(10-26 晚管理员要求), 各类数据一个色系 */
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 20%, transparent);
  font-size: 11.5px;
  line-height: 1.55;
  white-space: nowrap;
}
.subcard .sc i { color: var(--muted); font-size: 10.5px; font-style: normal; }
.subcard .t-scale { --c: var(--series-1); }
.subcard .t-cat { --c: #8b5cf6; }
.subcard .t-quote { --c: var(--series-3); }
.subcard .t-zt { --c: var(--up); }
.subcard .t-fin { --c: var(--series-4); }
.subcard .t-range { --c: #6366f1; }
.subcard .t-ma { --c: var(--warn); color: var(--warn); font-weight: 600; background: color-mix(in srgb, var(--c) 17%, transparent); }
/* 并购重组标签可点击(虚线底线提示), 点击弹出小窗 */
.subcard .ma-link {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  border-bottom: 1px dashed color-mix(in srgb, var(--c) 55%, transparent);
  padding: 0;
  cursor: pointer;
}
.subcard .ma-link:hover { color: color-mix(in srgb, var(--c) 70%, var(--text)); }

/* ---- 并购重组小窗: 点「⇄ 类型」标签弹出, 显示消息时间与模型评论 ---- */
#ma-pop {
  position: fixed;
  z-index: 60;
  width: 480px;
  max-width: calc(100vw - 16px);
  max-height: min(560px, calc(100dvh - 24px));
  overflow: auto;
  overscroll-behavior: contain;
  padding: 10px 12px 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: color-mix(in srgb, var(--panel) 96%, transparent);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, .16), 0 0 0 1px color-mix(in srgb, var(--warn) 12%, transparent);
  font-size: 12.5px;
  line-height: 1.55;
}
#ma-pop .ma-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
#ma-pop .ma-kind { color: var(--warn); font-weight: 600; }
#ma-pop .ma-date { margin-left: auto; color: var(--muted); font-size: 11.5px; white-space: nowrap; }
#ma-pop .ma-text { margin: 0; }
#ma-pop .ma-note { margin: 6px 0 0; color: var(--muted); font-size: 11px; }
#ma-pop .ma-close { border: 0; background: none; color: var(--muted); padding: 0 3px; font-size: 20px; cursor: pointer; }
#ma-pop .ma-notice { border: 1px solid var(--line); border-radius: 8px; padding: 10px; margin: 10px 0; background: var(--bg); }
#ma-pop h4 { margin: 0 0 6px; font-size: 13px; font-weight: 600; line-height: 1.6; overflow-wrap: anywhere; }
#ma-pop .ma-source { display: flex; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 11px; flex-wrap: wrap; }
#ma-pop .ma-source a { color: var(--accent); text-decoration: none; white-space: nowrap; }
#ma-pop .ma-source a:hover { text-decoration: underline; }
#ma-pop .ma-explain, #ma-pop .ma-impact { margin: 9px 0 0; overflow-wrap: anywhere; }
#ma-pop .ma-explain > span, #ma-pop .ma-impact > span { display: inline-block; font-size: 10.5px; padding: 1px 5px; border-radius: 4px; margin-right: 7px; color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
#ma-pop .ma-impact > span { color: var(--warn); background: color-mix(in srgb, var(--warn) 12%, transparent); }
#ma-pop .ma-original { margin-top: 9px; color: var(--muted); font-size: 11px; }
#ma-pop .ma-original summary { cursor: pointer; }
#ma-pop .ma-original pre { margin: 6px 0 0; white-space: pre-wrap; font: inherit; line-height: 1.7; overflow-wrap: anywhere; max-height: 180px; overflow-y: auto; }

/* ---- 悬浮小卡片(10-26): 鼠标停在某一行, 显示在表格旁边的空白处(两侧都没空白就不显示, 不进表格), 字段在列设置里选 ---- */
.row-card {
  position: fixed;
  z-index: 30;
  top: 0;
  left: 0;
  width: 236px;
  padding: 10px 12px 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--panel) 94%, transparent);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .14), 0 0 0 1px color-mix(in srgb, var(--accent) 10%, transparent);
  font-size: 12.5px;
  pointer-events: none;
  animation: rc-in .16s ease-out;
}
.row-card.glide { transition: top .14s ease-out, left .14s ease-out; }
.row-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 14px;
  right: 14px;
  height: 2px;
  border-radius: 0 0 2px 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: .75;
}
.row-card[data-side="left"]::after, .row-card[data-side="right"]::after {
  content: "";
  position: absolute;
  top: calc(var(--ay, 50%) - 6px);
  width: 10px;
  height: 10px;
  background: var(--panel);
  border: 1px solid var(--line);
  transform: rotate(45deg);
}
.row-card[data-side="left"]::after { right: -6px; border-left: 0; border-bottom: 0; }
.row-card[data-side="right"]::after { left: -6px; border-right: 0; border-top: 0; }
@keyframes rc-in { from { opacity: 0; transform: translateY(4px) scale(.98); } }
.rc-head { display: flex; align-items: baseline; gap: 6px; margin-bottom: 6px; }
.rc-head b { font-size: 14px; }
.rc-code { color: var(--muted); font-size: 12px; }
.rc-pct { margin-left: auto; font-weight: 600; font-variant-numeric: tabular-nums; }
.rc-spark { margin: 0 0 6px; }
.rc-spark .spark { width: 100%; height: 44px; }
.rc-spark .skel { display: block; width: 100%; height: 44px; }
.rc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; margin: 0; }
.rc-grid div { display: flex; justify-content: space-between; gap: 6px; padding: 3px 0; border-bottom: 1px dashed color-mix(in srgb, var(--line) 80%, transparent); }
.rc-grid dt { color: var(--muted); white-space: nowrap; }
.rc-grid dd { margin: 0; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rc-grid .wide { grid-column: 1 / -1; display: block; }
.rc-grid .wide dt { display: inline; margin-right: 6px; }
.rc-grid .wide dd { display: inline; color: var(--warn); white-space: normal; }
.sd-ma { display: block; margin-top: 4px; }
.sd-ma b { margin-right: 6px; color: var(--warn); }

/* 悬浮小卡片只放表格外(10-26 晚管理员「不要显示在表格里面」): 电脑上表格左边空白不够放卡片时, 表格整体右移留出一条; 屏幕够宽(≥1888)照旧居中;
   左侧小游戏(10-27)开着时同样右移, 那条空档归游戏 */
@media (min-width: 1100px) and (hover: hover) and (pointer: fine) {
  :root[data-hcard="on"] .top, :root[data-hcard="on"] .table-wrap, :root[data-hcard="on"] .foot,
  :root[data-game="on"] .top, :root[data-game="on"] .table-wrap, :root[data-game="on"] .foot {
    width: min(1440px, calc(100% - 236px));
    margin-left: max(224px, calc((100% - 1440px) / 2));
    margin-right: auto;
  }
}

/* 小游戏画布(10-27): 与主题背景同层(和 #fx 一样 z-index 0), 没有自己的边框和底色, 游戏直接画在主题背景上;
   表格是半透明玻璃, 游戏元素经过表格后面只会淡淡透出; 不接收鼠标事件(点表格外的空白处即开始) */
#game-canvas { position: fixed; inset: 0; z-index: 0; width: 100%; height: 100%; pointer-events: none; }

/* 搜索框: 全市场股票下拉(10-26 晚) */
.search-box { position: relative; flex: 1 1 200px; max-width: 320px; min-width: 0; }
.search-box #search { width: 100%; max-width: none; }
.search-pop {
  position: absolute;
  z-index: 35;
  top: calc(100% + 4px);
  right: 0;
  width: max(100%, 320px);
  max-height: 380px;
  overflow: auto;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: 0 10px 28px rgba(0, 0, 0, .16);
}
.search-pop button { display: flex; align-items: baseline; gap: 6px; width: 100%; padding: 7px 8px; border: 0; border-radius: 7px; background: none; text-align: left; cursor: pointer; }
.search-pop button[aria-selected="true"], .search-pop button:hover { background: var(--hover); }
.search-pop .code { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.search-pop .sp-meta { min-width: 0; margin-left: auto; overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.search-pop .sp-in { padding: 0 5px; border-radius: 4px; background: color-mix(in srgb, var(--up) 14%, transparent); color: var(--up); font-size: 11px; white-space: nowrap; }
.search-pop .sp-status { padding: 9px 8px; color: var(--muted); font-size: 12px; }
@media (max-width: 640px) { .search-pop { width: 100%; } }

/* 列设置里的「小卡片」字段选择: 点选, 角标是顺序 */
.card-set { margin: 4px 16px 8px; padding-top: 6px; border-top: 1px solid var(--line); scroll-margin-top: 70px; }
.card-set h3 { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; margin: 10px 0 6px; font-size: 14px; }
.card-set h3 small { color: var(--muted); font-size: 12px; font-weight: 400; }
.card-set h3 .link-btn { margin-left: auto; font-size: 12px; font-weight: 400; }
.card-fields { display: flex; flex-wrap: wrap; gap: 6px; }
.sheet .card-fields .cf { height: 30px; padding: 0 10px; border-radius: 999px; color: var(--muted); font-size: 12.5px; }
.sheet .card-fields .cf[aria-pressed="true"] { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--panel)); color: var(--text); }
.card-fields .cf b { display: inline-block; min-width: 16px; height: 16px; margin-right: 4px; padding: 0 3px; border-radius: 8px; background: var(--accent); color: #fff; font-size: 10.5px; line-height: 16px; text-align: center; }
.card-tip { margin: 8px 0 0; color: var(--muted); font-size: 12px; }

/* ---- 鼠标特效层(10-26 起, 取代「光点向停留行聚拢」): 一张不挡点击的画布盖在最上面, 跟着鼠标画和风格配套的小动效 ---- */
#fx-cursor { position: fixed; inset: 0; z-index: 40; width: 100%; height: 100%; pointer-events: none; }

/* ---- 新风格(10-26): 深海 / 水墨 / 赛博 / 樱花 —— 同样只换表格外的背景、特效和同色系配色 ---- */
/* 深海: 幽蓝海水, 上方透下来的光束, 气泡往上冒 */
:root[data-style="ocean"] .fx-glow {
  opacity: 1;
  inset: -10% -20% 30%;
  background: repeating-linear-gradient(100deg, transparent 0 6%, rgba(var(--g1), .07) 8.5%, transparent 11% 18%);
  -webkit-mask-image: linear-gradient(180deg, #000 0%, transparent 85%);
  mask-image: linear-gradient(180deg, #000 0%, transparent 85%);
  animation: rays 16s ease-in-out infinite alternate;
}
@keyframes rays { from { transform: translate3d(-3%, 0, 0) skewX(-5deg); } to { transform: translate3d(3%, 0, 0) skewX(5deg); } }
:root[data-style="ocean"][data-mode="dark"] {
  --bg-page: linear-gradient(180deg, #073650 0%, #04243c 35%, #021628 70%, #010b17 100%);
  --panel: #071a28; --head: #0a2335; --hover: #0e2c41; --line: #163a52; --accent: #3cc4e6;
  --panel-glass: rgba(7, 26, 40, .82); --fx-star: 200, 240, 255; --fx-dust: 120, 220, 255; --g1: 150, 225, 255; --g2: 60, 160, 230; --g3: 140, 255, 230;
}
:root[data-style="ocean"][data-mode="light"] {
  --bg-page: linear-gradient(180deg, #dcf1f9 0%, #e8f6fa 45%, #f5fbfc 100%);
  --head: #f0f8fb; --hover: #e9f5f9; --line: #d6e9f0; --accent: #1288b0;
  --panel-glass: rgba(255, 255, 255, .84); --fx-star: 30, 130, 170; --fx-dust: 40, 150, 200; --g1: 255, 255, 255; --g2: 90, 180, 220; --g3: 60, 190, 200;
}
/* 水墨: 宣纸 + 远山剪影, 淡墨晕开, 偶有飞鸟 */
/* 樱花: 花瓣飘落, 角落一点粉色光晕 */
:root[data-style="sakura"] .fx-glow {
  opacity: 1;
  inset: 0;
  background: radial-gradient(45% 40% at 88% 0%, rgba(var(--g1), .32), transparent 70%), radial-gradient(35% 30% at 4% 100%, rgba(var(--g2), .22), transparent 70%);
}
:root[data-style="sakura"][data-mode="light"] {
  --bg-page: linear-gradient(180deg, #fdeff3 0%, #fcf5f7 55%, #fbf8f5 100%);
  --head: #fdf6f8; --hover: #fbf0f3; --line: #f1e0e5; --accent: #d1567f;
  --panel-glass: rgba(255, 255, 255, .85); --fx-star: 225, 110, 145; --fx-dust: 240, 150, 180; --g1: 255, 190, 210; --g2: 255, 215, 225; --g3: 255, 170, 195;
}
:root[data-style="sakura"][data-mode="dark"] {
  --bg-page: radial-gradient(ellipse 110% 80% at 70% -10%, #40202f 0%, #1d1119 50%, #100a0f 100%);
  --panel: #1b1217; --head: #22161d; --hover: #2b1c25; --line: #37242f; --accent: #f490b4;
  --panel-glass: rgba(27, 18, 23, .84); --fx-star: 255, 205, 220; --fx-dust: 255, 175, 200; --g1: 255, 150, 185; --g2: 200, 90, 140; --g3: 255, 200, 215;
}

/* 萤火森林: 夜间苔绿 + 月下暖金, 日间是鼠尾草绿与米白。风格没有专门的游戏区域。 */
:root[data-style="forest"][data-mode="dark"] {
  --bg-page: radial-gradient(ellipse 72% 90% at 0% 28%, #204539 0%, transparent 72%), radial-gradient(ellipse at 100% 100%, #213d2c, transparent 62%), linear-gradient(150deg, #10271f, #0b1b18 68%, #11271e);
  --panel: #14271f; --head: #1b3229; --hover: #243f32; --line: #30483a; --accent: #bacc8b;
  --text: #e7eee2; --muted: #a2b59f;
  --panel-glass: rgba(20, 39, 31, .94); --fx-star: 230, 237, 160; --fx-dust: 146, 209, 157; --g1: 193, 211, 127; --g2: 104, 190, 143; --g3: 214, 200, 132;
}
:root[data-style="forest"][data-mode="light"] {
  --bg-page: radial-gradient(ellipse at 0% 30%, #d4e2ca, transparent 65%), linear-gradient(140deg, #f0f2e4, #e4eddd 58%, #eef0df);
  --panel: #fbfcf6; --head: #eff3e7; --hover: #e9efdf; --line: #d5dfcb; --accent: #547848;
  --text: #2b3c2e; --muted: #72836b;
  --panel-glass: rgba(251, 252, 246, .94); --fx-star: 140, 155, 58; --fx-dust: 112, 158, 92; --g1: 193, 205, 124; --g2: 130, 177, 122; --g3: 216, 204, 142;
}
:root[data-style="forest"] .fx-glow {
  opacity: .7; inset: 0;
  background: radial-gradient(25% 45% at 3% 78%, rgba(var(--g2), .1), transparent 72%), radial-gradient(32% 28% at 90% 0%, rgba(var(--g1), .1), transparent 74%);
}
:root[data-style="forest"] .table-wrap { box-shadow: 0 12px 42px rgba(9, 35, 21, .08), inset 0 0 0 1px rgba(181, 203, 135, .05); }
:root[data-style="forest"] thead th:not(.fill)::before { clip-path: ellipse(32% 48% at 50% 50%); width: 5px; height: 7px; }
.style-pick [data-v="forest"] i {
  background: radial-gradient(2px 2px at 24% 28%, #eef2a6 35%, rgba(231, 238, 146, .3) 60%, transparent), radial-gradient(2px 2px at 72% 65%, #bfe4a8 35%, transparent), radial-gradient(2px 2px at 45% 72%, #ebdf9d 35%, transparent), repeating-linear-gradient(96deg, transparent 0 16%, rgba(96, 147, 100, .3) 17% 19%, transparent 20% 35%), linear-gradient(135deg, #2f5943, #10271f);
}
.style-pick [data-v="ocean"] i { background: radial-gradient(3px 3px at 30% 70%, rgba(200, 245, 255, .9) 50%, transparent), radial-gradient(2px 2px at 65% 45%, rgba(200, 245, 255, .8) 50%, transparent), repeating-linear-gradient(100deg, transparent 0 18%, rgba(160, 230, 255, .22) 22%, transparent 28% 40%), linear-gradient(180deg, #0b4d6a, #021426); }
.style-pick [data-v="sakura"] i { background: radial-gradient(4px 3px at 25% 35%, #ffb3c9 60%, transparent), radial-gradient(3px 3px at 60% 65%, #ff9dbb 60%, transparent), radial-gradient(4px 3px at 80% 25%, #ffc4d4 60%, transparent), linear-gradient(180deg, #fdeef3, #f9e3ea); }

/* 诡夜古堡：冷雾蓝、氧化铜与骨白。恐怖插画只在空档中，行情沿用清楚的红绿。 */
:root[data-style="horror"][data-mode="dark"] {
  --bg-page: radial-gradient(ellipse 40% 85% at 0% 48%, #203642 0%, transparent 75%), radial-gradient(ellipse at 100% 100%, #192c32, transparent 65%), linear-gradient(160deg, #101a27, #080f19 68%, #0e1d24);
  --panel: #131f2a; --head: #1b2a36; --hover: #243842; --line: #344951; --accent: #b0c6b2;
  --text: #e0e9e7; --muted: #a1b4b8; --panel-glass: rgba(19, 31, 42, .97);
  --fx-star: 161, 211, 189; --fx-dust: 125, 165, 171; --g1: 139, 179, 166; --g2: 102, 141, 163; --g3: 192, 182, 142;
}
:root[data-style="horror"][data-mode="light"] {
  --bg-page: radial-gradient(ellipse at 0% 50%, #bac8cb, transparent 65%), linear-gradient(155deg, #e4e9e7, #cdd8db 65%, #c4d0d0);
  --panel: #f5f7f2; --head: #e5ece8; --hover: #dce8e2; --line: #bdccca; --accent: #41695e;
  --text: #263b40; --muted: #617b7e; --panel-glass: rgba(245, 247, 242, .97);
  --fx-star: 79, 127, 112; --fx-dust: 99, 132, 141; --g1: 96, 140, 122; --g2: 112, 143, 160; --g3: 163, 154, 124;
}
:root[data-style="horror"] .table-wrap {
  border-color: color-mix(in srgb, #8b9c8f 32%, var(--line));
  box-shadow: 0 12px 40px rgba(0, 9, 16, .16), inset 0 0 0 1px rgba(173, 197, 181, .06);
}
:root[data-style="horror"] .views, :root[data-style="horror"] .stat, :root[data-style="horror"] .sheet { border-color: color-mix(in srgb, #849f92 24%, var(--line)); }
:root[data-style="horror"] thead th:not(.fill)::before { background: var(--accent); clip-path: ellipse(25% 48% at 50% 50%); opacity: .08; }
.style-pick [data-v="horror"] i {
  position: relative; overflow: hidden;
  background: radial-gradient(circle at 73% 28%, #203743 0 7px, transparent 7.5px), radial-gradient(circle at 69% 35%, #9bb9b6 0 8px, transparent 8.5px), linear-gradient(160deg, #283d4b, #0d1825 70%);
}
.style-pick [data-v="horror"] i::before {
  content: ""; position: absolute; bottom: 0; left: 16%; width: 48%; height: 29px; background: #607378;
  clip-path: polygon(4% 100%, 4% 40%, 13% 0, 22% 40%, 22% 64%, 44% 39%, 65% 64%, 65% 38%, 76% 10%, 87% 38%, 87% 100%);
}
.style-pick [data-v="horror"] i::after { content: ""; position: absolute; left: 35%; bottom: 0; width: 4px; height: 9px; background: #142831; border-radius: 50% 50% 0 0; box-shadow: -17px -10px 0 -1px #c6cca2, 19px -8px 0 -1px #c6cca2; }

/* 全量股票问答工作台：沿用各主题的表格配色，结果区让每个模型独立滚动。 */
.qa-open { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.qa-open > span:first-child { font-size: 20px; color: var(--accent); line-height: 1; }
#qa-busy-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); animation: qa-pulse 1.5s ease-in-out infinite; }
.qa-dialog.qa-dialog { width: calc(100vw - 32px); max-width: 1880px; height: calc(100dvh - 32px); max-height: calc(100dvh - 32px); padding: 0; overflow: hidden; }
.qa-dialog[open] { display: flex; flex-direction: column; }
.qa-subtitle { color: var(--muted); font-size: 12px; margin-left: 6px; }
.qa-layout { display: grid; grid-template-columns: 188px minmax(0, 1fr); min-height: 0; flex: 1; }
.qa-nav { padding: 24px 12px 16px; border-right: 1px solid var(--line); background: color-mix(in srgb, var(--head) 65%, var(--panel)); display: flex; flex-direction: column; gap: 14px; }
.qa-nav-label { padding: 0 10px; color: var(--muted); font-size: 11px; letter-spacing: 2px; }
.sheet .qa-nav-active { height: auto; text-align: left; padding: 15px 12px; line-height: 1.7; border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); background: color-mix(in srgb, var(--accent) 8%, var(--panel)); color: var(--text); font-size: 14px; font-weight: 600; }
.qa-nav-active span { display: block; color: var(--muted); font-size: 11px; font-weight: 400; margin-top: 7px; white-space: nowrap; }
.qa-nav p, .qa-saved { color: var(--muted); font-size: 11px; line-height: 1.8; padding: 0 10px; }
.qa-saved { margin-top: auto; }
.qa-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; padding: 14px 18px 16px; gap: 10px; overflow: hidden; }
.qa-conditions-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex: none; min-height: 30px; }
.qa-conditions-bar > span { min-width: 0; display: flex; align-items: center; gap: 12px; }
.qa-conditions-bar strong { font-size: 12px; font-weight: 500; white-space: nowrap; }
#qa-conditions-summary { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qa-condition-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.sheet .qa-condition-actions > button { height: 28px; padding: 0 10px; font-size: 12px; flex: none; }
.qa-controls { flex: none; max-height: 48vh; overflow: auto; padding-right: 3px; }
.qa-control-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.qa-preset-label { color: var(--muted); font-size: 12px; margin-right: 4px; }
.qa-control-row select { flex: 1; min-width: 180px; max-width: 680px; }
.qa-main input, .qa-main select, .qa-main textarea { border: 1px solid var(--line); background: var(--bg); color: var(--text); border-radius: 7px; padding: 8px 10px; font: inherit; font-size: 13px; box-sizing: border-box; }
.qa-main input:focus, .qa-main select:focus, .qa-main textarea:focus { outline: 2px solid color-mix(in srgb, var(--accent) 30%, transparent); outline-offset: 1px; }
.qa-muted { color: var(--muted); font-size: 12px; line-height: 1.6; }
#qa-preset-short { margin: 6px 0 2px; }
.qa-prompt-view { margin: 0 0 10px; font-size: 12px; color: var(--muted); }
.qa-prompt-view summary { cursor: pointer; width: fit-content; }
.qa-prompt-view textarea { display: block; width: 100%; margin: 9px 0 7px; line-height: 1.7; min-height: 130px; max-height: 300px; resize: vertical; }
.qa-prompt-actions { display: flex; align-items: center; gap: 10px; }
.sheet #qa-prompt-save { height: 28px; padding: 0 10px; font-size: 12px; }
.qa-editor { border: 1px solid var(--line); border-radius: 9px; padding: 12px; margin-bottom: 10px; background: var(--head); }
.qa-editor-fields { display: grid; grid-template-columns: 1fr 2fr; gap: 10px; }
.qa-editor label { display: flex; flex-direction: column; gap: 5px; margin-bottom: 10px; font-size: 12px; color: var(--muted); }
.qa-editor textarea { width: 100%; resize: vertical; min-height: 120px; }
.qa-editor-actions { display: flex; gap: 8px; }
.qa-model-picker { border: 1px solid var(--line); border-radius: 9px; background: color-mix(in srgb, var(--head) 45%, var(--panel)); }
.qa-model-picker > summary { cursor: pointer; padding: 9px 12px; display: flex; align-items: center; gap: 12px; font-size: 12px; list-style: none; }
.qa-model-picker > summary::before { content: "▸"; color: var(--accent); }
.qa-model-picker[open] > summary::before { content: "▾"; }
#qa-model-count { color: var(--accent); font-size: 12px; }
#qa-model-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(285px, 1fr)); gap: 12px; padding: 0 12px 12px; max-height: 245px; overflow: auto; }
.qa-provider h4 { margin: 4px 0 7px; font-size: 12px; color: var(--muted); }
.qa-model-option { display: flex; align-items: center; gap: 7px; border-bottom: 1px solid var(--line); min-height: 35px; }
.qa-model-option label { display: flex; align-items: center; gap: 6px; min-width: 0; flex: 1; font-size: 12px; cursor: pointer; }
.qa-model-option input { accent-color: var(--accent); width: 14px; height: 14px; flex: none; margin: 0; }
.qa-model-option select { padding: 4px 6px; font-size: 11px; min-width: 62px; max-width: 88px; }
.qa-selected { display: flex; flex-wrap: wrap; gap: 5px; margin: 7px 0; }
.qa-selected span { font-size: 11px; border: 1px solid var(--line); border-radius: 5px; padding: 3px 7px; background: var(--head); color: var(--muted); }
.qa-scope-row { margin-bottom: 7px; gap: 6px; }
.qa-scope-row > span { margin-right: auto; }
.sheet .qa-scope-row button { height: 27px; padding: 0 9px; font-size: 11px; }
.qa-ask-row { display: flex; align-items: stretch; gap: 8px; flex: none; }
.qa-ask-row > textarea { flex: 1; min-width: 0; resize: vertical; min-height: 42px; max-height: 120px; line-height: 1.6; }
.qa-dialog button.primary { background: var(--text); color: var(--panel); border-color: var(--text); }
.qa-results-head { display: flex; justify-content: space-between; gap: 10px; align-items: center; flex: none; min-height: 24px; }
.qa-results { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(var(--qa-cols, 1), minmax(0, 1fr)); grid-auto-rows: 100%; gap: 12px; overflow: auto; }
.qa-empty { grid-column: 1 / -1; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; min-height: 230px; color: var(--muted); border: 1px dashed var(--line); border-radius: 11px; }
.qa-empty > div { font-size: 42px; color: var(--accent); opacity: .6; }
.qa-empty h3 { color: var(--text); font-size: 15px; font-weight: 500; margin: 12px 0 0; }
.qa-empty p { line-height: 1.9; font-size: 12px; }
.qa-card { border: 1px solid var(--line); border-radius: 10px; min-width: 0; min-height: 0; display: flex; flex-direction: column; overflow: hidden; background: var(--panel); }
.qa-card > header { padding: 11px 13px 9px; background: color-mix(in srgb, var(--head) 70%, var(--panel)); border-bottom: 1px solid var(--line); }
.qa-card-title { display: flex; align-items: flex-start; gap: 8px; }
.qa-card-title h3 { flex: 1; min-width: 0; margin: 0; font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
.qa-card-actions { display: flex; align-items: center; gap: 6px; flex: none; }
.qa-card-meta { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-top: 4px; }
.qa-card-effort { flex: none; color: var(--muted); font-size: 10px; font-weight: 400; white-space: nowrap; }
.qa-card-status { font-size: 10px; color: var(--muted); white-space: nowrap; padding: 2px 5px; border: 1px solid var(--line); border-radius: 4px; }
.qa-card[data-status="running"] .qa-card-status { color: var(--accent); }
.qa-card[data-status="done"] .qa-card-status { color: #409a75; }
.qa-card[data-status="error"] .qa-card-status { color: #d66b6b; }
.qa-card-progress { min-width: 0; color: var(--muted); font-size: 11px; min-height: 15px; text-align: right; overflow-wrap: anywhere; }
.qa-card[data-status="running"] .qa-card-progress::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-right: 6px; background: var(--accent); animation: qa-pulse 1.5s ease-in-out infinite; }
.qa-card-scroll { overflow: auto; padding: 12px 14px; flex: 1; min-height: 0; scroll-behavior: auto; }
.qa-card-content { font-size: 13px; line-height: 1.85; color: var(--text); overflow-wrap: anywhere; }
.qa-card-content:empty::before { content: "等候模型的公开分析…"; color: var(--muted); }
.qa-card-content h3 { margin: 14px 0 7px; font-size: 14px; }
.qa-card-content h4 { margin: 12px 0 5px; font-size: 13px; }
.qa-card-content p { margin: 7px 0; }
.qa-card-content ul, .qa-card-content ol { padding-left: 21px; margin: 8px 0; }
.qa-card-content code { background: var(--head); padding: 1px 4px; border-radius: 3px; font-size: 12px; }
.qa-card-content pre { overflow: auto; background: var(--head); padding: 10px; border-radius: 6px; }
.qa-card-content .qa-table-scroll { overflow-x: auto; margin: 10px 0; }
.qa-card-content table { width: 100%; border-collapse: collapse; min-width: 300px; font-size: 11px; }
.qa-card-content th, .qa-card-content td { position: static; padding: 7px 8px; border: 1px solid var(--line); white-space: normal; text-align: left; background: transparent; color: var(--text); box-shadow: none; }
.qa-card-content th::before { display: none !important; }
.qa-card-content th { background: var(--head); }
.qa-card-notes { margin-top: 12px; font-size: 11px; color: var(--muted); }
.qa-card-notes summary { cursor: pointer; }
.qa-card-notes pre { white-space: pre-wrap; line-height: 1.8; max-height: 200px; overflow: auto; }
.qa-card-error { color: #d66b6b; font-size: 12px; margin-top: 8px; }
.sheet .qa-copy { font-size: 11px; height: 24px; padding: 0 8px; white-space: nowrap; }
.qa-error { padding: 9px 12px; border: 1px solid color-mix(in srgb, #d66b6b 40%, var(--line)); border-radius: 7px; color: #d66b6b; font-size: 12px; background: color-mix(in srgb, #d66b6b 5%, var(--panel)); }
.qa-data-dialog.qa-data-dialog { width: min(1100px, calc(100vw - 32px)); max-width: 1100px; height: min(800px, calc(100dvh - 32px)); padding: 0; }
#qa-data-content { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; padding: 16px; line-height: 1.6; font-size: 11px; }
@keyframes qa-pulse { 50% { opacity: .25; } }
@media (max-width: 900px) { .qa-layout { grid-template-columns: 145px minmax(0, 1fr); } .qa-nav { padding: 16px 8px; } .qa-nav-active span { white-space: normal; } .qa-results { --qa-cols: 1 !important; } .qa-subtitle { display: none; } .qa-ask-row { flex-wrap: wrap; } }
@media (max-width: 640px) {
  .qa-dialog.qa-dialog { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; border-radius: 0; border: 0; }
  .qa-layout { display: flex; flex-direction: column; }
  .qa-nav { padding: 6px 12px; border-right: 0; border-bottom: 1px solid var(--line); display: block; }
  .qa-nav-label, .qa-nav p, .qa-saved, .qa-nav-active span { display: none; }
  .sheet .qa-nav-active { border: 0; background: none; padding: 0; font-size: 12px; line-height: 1.5; }
  .qa-nav-active br { display: none; }
  .qa-main { padding: 10px; flex: 1; gap: 8px; }
  .qa-controls { max-height: 47dvh; }
  .qa-control-row select { min-width: 150px; }
  .qa-preset-label { width: 100%; }
  .qa-editor-fields { grid-template-columns: 1fr; }
  .qa-results { grid-auto-rows: minmax(280px, 1fr); }
  .qa-ask-row > textarea { width: 100%; flex-basis: 100%; }
  #qa-model-options { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { #qa-busy-dot, .qa-card[data-status="running"] .qa-card-progress::before { animation: none; } .qa-card-scroll { scroll-behavior: auto; } }

/* 逐股模型解析：列宽仍由原列设置控制，响应只更新对应单元格。 */
.analysis-cell { vertical-align: top; }
.analysis-cell > .cw { white-space: normal; overflow-wrap: anywhere; }
.analysis-heading { display: flex; flex-direction: column; gap: 6px; white-space: normal; text-align: left; }
.analysis-heading-top { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.analysis-title { flex: 1 1 150px; color: var(--text); }
.analysis-heading button, .analysis-retry { font: inherit; font-size: 11px; border: 1px solid var(--line); color: var(--text); border-radius: 5px; background: var(--panel); cursor: pointer; padding: 3px 7px; }
.analysis-heading button:hover, .analysis-retry:hover { border-color: var(--accent); }
.analysis-progress, .analysis-muted { color: var(--muted); font-size: 12px; font-weight: 400; }
.analysis-answer { padding: 6px 0; text-align: left; white-space: normal; }
.analysis-answer + .analysis-answer { border-top: 1px solid var(--line); margin-top: 6px; }
.analysis-answer-label { font-size: 12px; font-weight: 600; color: var(--accent); display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px; margin-bottom: 5px; }
.analysis-answer-label span { font-weight: 400; font-size: 11px; color: var(--muted); }
.analysis-answer-text { white-space: pre-wrap; font-size: 12px; line-height: 1.7; overflow-wrap: anywhere; user-select: text; }
.analysis-layout-setting { display: flex; align-items: center; flex-wrap: wrap; gap: 7px 12px; padding: 0 18px 12px; font-size: 12px; }
.analysis-layout-setting label { color: var(--text); }
.analysis-layout-setting select { padding: 5px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); }
.analysis-layout-setting small { flex-basis: 100%; color: var(--muted); line-height: 1.5; }
.analysis-row-toolbar { display: flex; align-items: center; max-width: 420px; min-width: 0; margin: 0; padding: 0; }
.analysis-row-toolbar .analysis-heading { flex-direction: row; align-items: center; flex-wrap: nowrap; gap: 6px; min-width: 0; }
.analysis-row-toolbar .analysis-heading-top { flex: 0 1 auto; flex-wrap: nowrap; gap: 4px; min-width: 0; }
.analysis-row-toolbar .analysis-title { flex: 0 1 auto; max-width: 142px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.analysis-row-toolbar .analysis-progress, .analysis-row-toolbar .analysis-error { max-width: 140px; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; }
.has-analysis-detail > td { border-bottom-color: transparent; }
.analysis-detail-row > .analysis-detail-cell { padding: 5px 12px 12px; white-space: normal; border-bottom: 2px solid var(--line); }
.analysis-detail-lane { contain: inline-size; min-width: 0; }
.analysis-detail-content.cw { position: sticky; left: 12px; width: min(100%, var(--analysis-row-width, 100%)); min-width: 0; margin: 0; white-space: normal; }
.analysis-model-grid { display: grid; grid-template-columns: repeat(var(--analysis-model-columns, 1), minmax(0, 1fr)); align-items: start; gap: 12px 16px; min-width: 0; }
.analysis-model-grid > .analysis-answer { min-width: 0; padding: 0; }
.analysis-model-grid > .analysis-answer + .analysis-answer { border-top: 0; margin-top: 0; }
.analysis-model-grid .analysis-intel-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(230px, 100%), 1fr)); align-items: start; gap: 8px 12px; }
.analysis-detail-row .analysis-answer-text { max-width: 100%; }
.has-analysis-detail:hover + .analysis-detail-row > td,
.has-analysis-detail:has(+ .analysis-detail-row:hover) > td { background: var(--hover); }
.analysis-wait { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); }
.analysis-skeleton { display: block; height: 24px; width: 90%; margin-top: 7px; }
.analysis-error { color: var(--up); font-weight: 400; font-size: 12px; white-space: pre-wrap; overflow-wrap: anywhere; margin: 4px 0; }
.analysis-retry { margin-top: 5px; }
.analysis-dialog.analysis-dialog { width: min(1040px, calc(100vw - 64px)); max-width: 1040px; padding: 0; }
.analysis-config-body { padding: 4px 18px 16px; }
.analysis-editor-top { display: flex; align-items: center; gap: 10px; margin: 12px 0; }
.analysis-dialog input:not([type="checkbox"]), .analysis-dialog select, .analysis-dialog textarea { font: inherit; font-size: 13px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--text); padding: 6px 9px; box-sizing: border-box; }
.analysis-editor-top select { flex: 1; min-width: 0; }
.analysis-field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; margin: 12px 0; }
.analysis-field textarea { resize: vertical; min-height: 140px; line-height: 1.6; }
.analysis-picker-title { display: flex; gap: 12px; align-items: center; font-size: 13px; margin: 18px 0 8px; }
#analysis-model-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; max-height: 280px; overflow: auto; padding: 8px 10px; border: 1px solid var(--line); border-radius: 7px; }
.analysis-provider h3 { margin: 2px 0 6px; font-size: 12px; color: var(--muted); }
.analysis-model { display: flex; align-items: center; gap: 4px; min-height: 34px; border-bottom: 1px solid var(--line); }
.analysis-model label { flex: 1; min-width: 0; font-size: 12px; display: flex; align-items: center; gap: 5px; cursor: pointer; }
.analysis-model input { accent-color: var(--accent); }
.analysis-model select { width: 66px; padding: 4px; font-size: 11px; }
.analysis-concurrency { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; font-size: 13px; margin-top: 16px; }
.analysis-concurrency input { width: 70px; }
#analysis-save-state { margin-right: auto; align-self: center; }
.analysis-cell[data-analysis-wrap="off"] .analysis-answer-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.analysis-rate-title { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; font-size: 13px; margin: 18px 0 8px; }
.analysis-rate-table { width: 100%; border-collapse: collapse; font-size: 12px; table-layout: fixed; }
.analysis-rate-table th { position: static; text-align: left; background: var(--head); cursor: default; white-space: normal; }
.analysis-rate-table th, .analysis-rate-table td { padding: 9px 10px; border: 1px solid var(--line); vertical-align: middle; }
.analysis-rate-table th:nth-child(1) { width: 18%; }
.analysis-rate-table th:nth-child(2) { width: 14%; }
.analysis-rate-table th:nth-child(3) { width: 23%; }
.analysis-rate-table input { width: 88px; max-width: 100%; }
.analysis-rate-table input[readonly] { opacity: .65; }
.analysis-rate-table td:last-child { white-space: normal; color: var(--muted); font-size: 12px; }
.analysis-rate-table td.analysis-rate-paused { color: var(--up); }
.analysis-rate-table td { text-align: left; }
.analysis-answer-label .analysis-web { color: var(--accent); font-size: 11px; font-weight: 400; }
.analysis-sources { margin-top: 6px; font-size: 11px; line-height: 1.6; white-space: normal; }
.analysis-sources > summary { cursor: pointer; color: var(--muted); }
.analysis-source-links { display: flex; flex-direction: column; gap: 4px; margin-top: 4px; }
.analysis-sources a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; overflow-wrap: anywhere; }
.analysis-report { font-size: 12px; line-height: 1.65; min-width: 0; user-select: text; }
.analysis-concepts { display: flex; flex-wrap: wrap; gap: 5px; margin: 2px 0 8px; }
.analysis-concept { display: inline-flex; align-items: center; gap: 4px; color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); border: 1px solid color-mix(in srgb, var(--accent) 24%, transparent); border-radius: 5px; padding: 1px 7px; line-height: 1.6; font-weight: 500; }
.analysis-concept.inferred { border-style: dashed; }
.analysis-concept small { font-size: 9px; font-weight: 400; opacity: .7; }
.analysis-intel-list { display: flex; flex-direction: column; gap: 9px; }
.analysis-intel-item { border-left: 2px solid color-mix(in srgb, var(--accent) 25%, var(--line)); padding-left: 8px; min-width: 0; }
.analysis-intel-meta { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 2px; font-size: 10px; color: var(--muted); min-width: 0; }
.analysis-intel-meta time { flex: 0 0 auto; font-variant-numeric: tabular-nums; }
.analysis-intel-meta a { min-width: 0; color: var(--accent); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.analysis-intel-meta a:hover { text-decoration: underline; }
.analysis-intel-event { color: var(--text); overflow-wrap: anywhere; }
/* 每条情报附带的主观评价：方向芯片 + 一句话，可点开详细评价弹窗 */
.analysis-intel-impact { display: flex; align-items: center; gap: 6px; margin-top: 4px; max-width: 100%; min-width: 0; padding: 1px 7px; border: 1px dashed transparent; border-radius: 5px; font: inherit; font-size: 11px; line-height: 1.6; color: var(--text); text-align: left; cursor: pointer; background: color-mix(in srgb, var(--accent) 5%, transparent); }
.analysis-intel-impact:hover { border-color: color-mix(in srgb, var(--accent) 40%, transparent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.analysis-intel-impact .analysis-impact-text { min-width: 0; overflow-wrap: anywhere; }
button.analysis-intel-impact { border-bottom-style: dashed; border-bottom-color: color-mix(in srgb, var(--accent) 35%, transparent); }
div.analysis-intel-impact { cursor: default; background: none; }
.analysis-stance { flex: 0 0 auto; display: inline-block; font-size: 10px; line-height: 1.5; padding: 0 5px; border-radius: 4px; border: 1px solid; }
.analysis-stance.positive { color: var(--up); background: color-mix(in srgb, var(--up) 10%, transparent); border-color: color-mix(in srgb, var(--up) 30%, transparent); }
.analysis-stance.negative { color: var(--down); background: color-mix(in srgb, var(--down) 10%, transparent); border-color: color-mix(in srgb, var(--down) 30%, transparent); }
.analysis-stance.strong_positive { color: var(--up); background: color-mix(in srgb, var(--up) 23%, var(--panel)); border-color: color-mix(in srgb, var(--up) 65%, transparent); font-weight: 700; }
.analysis-stance.strong_negative { color: var(--down); background: color-mix(in srgb, var(--down) 23%, var(--panel)); border-color: color-mix(in srgb, var(--down) 65%, transparent); font-weight: 700; }
.analysis-stance.neutral { color: var(--muted); background: color-mix(in srgb, var(--muted) 10%, transparent); border-color: color-mix(in srgb, var(--muted) 28%, transparent); }
.analysis-cell[data-analysis-wrap="off"] .analysis-intel-event,
.analysis-cell[data-analysis-wrap="off"] .analysis-intel-impact { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.analysis-cell[data-analysis-wrap="off"] .analysis-intel-impact .analysis-impact-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* 详细评价弹窗 */
.analysis-impact-dialog { width: min(600px, calc(100vw - 48px)); }
.analysis-impact-body { padding: 14px 18px 16px; overflow-y: auto; }
.analysis-impact-head { display: flex; align-items: baseline; gap: 10px; font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.analysis-impact-head time { font-variant-numeric: tabular-nums; }
.analysis-impact-head a { color: var(--accent); text-decoration: none; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.analysis-impact-head a:hover { text-decoration: underline; }
.analysis-impact-code { margin-left: auto; font-size: 11px; }
.analysis-impact-event { font-size: 13px; line-height: 1.7; color: var(--text); overflow-wrap: anywhere; }
.analysis-impact-brief { display: flex; align-items: baseline; gap: 8px; margin-top: 10px; padding: 8px 10px; border-radius: 8px; background: color-mix(in srgb, var(--accent) 6%, transparent); font-size: 13px; line-height: 1.7; }
.analysis-impact-brief .analysis-impact-text { min-width: 0; overflow-wrap: anywhere; }
.analysis-impact-detail { margin-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.analysis-impact-line { display: flex; align-items: baseline; gap: 8px; font-size: 12.5px; line-height: 1.7; min-width: 0; }
.analysis-impact-line .analysis-impact-text { min-width: 0; overflow-wrap: anywhere; }
.analysis-impact-tag { flex: 0 0 auto; font-size: 11px; color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); border: 1px solid color-mix(in srgb, var(--accent) 24%, transparent); border-radius: 5px; padding: 0 6px; line-height: 1.6; }
.analysis-rate-chips { display: flex; flex-wrap: wrap; gap: 5px; min-width: 0; }
.analysis-rate-chip { font-size: 11px; color: var(--muted); border: 1px solid var(--line); border-radius: 4px; padding: 0 6px; line-height: 1.6; white-space: nowrap; }
.analysis-impact-p { margin: 0; font-size: 12.5px; line-height: 1.7; overflow-wrap: anywhere; }
.analysis-impact-note { margin: 12px 0 0; font-size: 11px; color: var(--muted); }
