/* AI 选股页：在 style.css 的基础上加的。 */
.screen-page { overflow: auto; }
.screen-page #app { height: auto; min-height: 100%; }
.tool-nav { display: flex; gap: 4px; }
.tool-nav a {
  padding: 4px 10px; border-radius: 6px; color: #4e5969; text-decoration: none; border: 1px solid transparent;
}
.tool-nav a:hover { background: #f2f3f5; }
.tool-nav a.on { background: #e8f3ff; color: var(--accent); border-color: #bedaff; font-weight: 600; }

.sc-main { width: 100%; max-width: 1280px; margin: 0 auto; padding: 12px 16px 40px; display: flex; flex-direction: column; gap: 12px; }
.ask, .understood, .results, .welcome {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px;
}
.ask-row { display: flex; gap: 8px; align-items: stretch; }
.ask-row textarea { font-size: 15px; padding: 9px 10px; resize: vertical; min-height: 44px; }
.ask-row button { padding: 0 22px; font-size: 15px; }
.chips-line { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 8px; }
.ex-list { display: contents; }
.ex {
  border: 1px solid var(--line); background: #f7f8fa; border-radius: 14px; padding: 3px 10px; font-size: 12px;
  color: #4e5969; cursor: pointer; max-width: 100%; overflow: hidden; text-overflow: ellipsis;
}
.ex:hover { border-color: #bedaff; color: var(--accent); }

.welcome { color: #4e5969; display: flex; flex-direction: column; gap: 6px; }
.w-title { font-weight: 700; font-size: 16px; color: var(--text); }

.u-head, .r-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.u-head .small-btn { margin-left: auto; }
.conds { display: flex; flex-wrap: wrap; gap: 8px; }
.cond {
  display: inline-flex; align-items: center; gap: 6px; border: 1px solid #bedaff; background: #f2f8ff;
  border-radius: 8px; padding: 5px 6px 5px 10px; cursor: pointer; max-width: 100%;
}
.cond.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.cond.on .cnt, .cond.on .x, .cond.on .ed { color: #fff; }
.cond .lb { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cond .cnt { font-size: 12px; color: var(--accent); font-variant-numeric: tabular-nums; white-space: nowrap; }
.cond .src { font-size: 11px; color: #6741d9; background: #f3f0ff; border-radius: 4px; padding: 0 4px; }
.cond.on .src { background: rgba(255, 255, 255, .25); color: #fff; }
.cond .unk { font-size: 11px; color: var(--muted); white-space: nowrap; }
.cond.on .unk { color: rgba(255, 255, 255, .8); }
.cond .dflt { font-size: 11px; color: var(--warn); background: var(--warn-bg); border-radius: 4px; padding: 0 4px; }
.cond.on .dflt { background: rgba(255, 255, 255, .25); color: #fff; }
.cond .ed, .cond .x {
  border: none; background: transparent; padding: 0 4px; color: var(--muted); font-size: 13px; line-height: 1;
}
.cond .x:hover { color: var(--bad); }
.cond .ed:hover { color: var(--accent); }
.cond.bad { border-color: #ffd8a8; background: var(--warn-bg); }
.unmapped, .alts { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 13px; }
.um { background: #f2f3f5; border: 1px dashed #c9cdd4; color: #4e5969; border-radius: 6px; padding: 3px 8px; }
.alt { background: #fff; border: 1px dashed #bedaff; color: var(--accent); border-radius: 6px; padding: 3px 8px; cursor: pointer; }
.notes { margin: 8px 0 0; padding-left: 18px; color: var(--muted); font-size: 12px; }
.notes li { margin: 2px 0; }

.views { display: flex; gap: 6px; flex-wrap: wrap; }
.views button.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.views .n { font-variant-numeric: tabular-nums; margin-left: 4px; font-weight: 600; }
.r-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.table-wrap { overflow: auto; max-height: calc(100vh - 140px); border: 1px solid var(--line); border-radius: 6px; }
.rtable { border-collapse: collapse; width: 100%; font-size: 13px; font-variant-numeric: tabular-nums; }
.rtable th, .rtable td { padding: 6px 8px; border-bottom: 1px solid #f0f2f5; text-align: right; white-space: nowrap; }
.rtable th {
  position: sticky; top: 0; background: #f7f8fa; z-index: 1; font-weight: 600; color: #4e5969; cursor: pointer;
  user-select: none;
}
.rtable th.l, .rtable td.l { text-align: left; }
.rtable th .arrow { color: var(--accent); margin-left: 2px; }
.rtable th.cc { color: var(--accent); max-width: 160px; overflow: hidden; text-overflow: ellipsis; }
.rtable tbody tr:hover { background: #f7faff; }
.rtable td.hit { background: #ebfbee; color: #1b5e20; }
.rtable td.miss { background: #fff5f5; color: #a61e1e; }
.rtable td.unk { color: var(--muted); }
.rtable td .cd { color: var(--muted); font-size: 12px; }
.rtable td.nm { font-weight: 600; }
.rtable .add { padding: 1px 6px; font-size: 12px; }
.rtable .add[disabled] { color: var(--muted); }
.r-empty { padding: 24px; text-align: center; color: var(--muted); }
.disclaimer { margin-top: 8px; color: var(--muted); font-size: 12px; }

.dlg { border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; width: min(440px, calc(100vw - 32px)); }
.dlg-wide { width: min(760px, calc(100vw - 32px)); }
.dlg::backdrop { background: rgba(0, 0, 0, .25); }
.dlg-title { font-weight: 700; font-size: 16px; margin-bottom: 10px; }
.dlg .row { display: flex; align-items: center; gap: 8px; margin: 8px 0; flex-wrap: wrap; }
.dlg .row > select, .dlg .row > input { flex: 1; min-width: 120px; }
.dlg .row input[type=number] { width: 110px; flex: none; }
.dlg-btns { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.help-body { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px 16px; margin: 10px 0; }
.help-body .grp b { display: block; margin-bottom: 2px; }
.help-body .grp span { color: #4e5969; font-size: 13px; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: #1d2129; color: #fff;
  padding: 8px 14px; border-radius: 8px; font-size: 13px; z-index: 50; max-width: calc(100vw - 32px);
}
.busy { opacity: .55; pointer-events: none; }

@media (max-width: 720px) {
  .sc-main { padding: 10px 16px 30px; }
  .ask-row { flex-direction: column; }
  .ask-row button { padding: 9px; }
  .top .actions { margin-left: 0; }
  .r-actions { margin-left: 0; }
  .table-wrap { max-height: none; }
}

/* 窄屏不被长例句、长条件撑宽：弹性布局里子元素默认最小宽度是整段文字宽，要显式放开 */
.ex, .cond, .alt, .um, .cond .lb, .views button { min-width: 0; }
.sc-main > section { min-width: 0; }
.alt, .um { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
