:root {
  color-scheme: light;
  --surface: #ffffff;
  --canvas: #f4f2ee;
  --ink: #1f1d1a;
  --muted: #6b665f;
  --line: #e6e1d9;
  --track: #ece8e1;
  --accent: #b5482a;
  --accent-hover: #963a20;
  --accent-ink: #ffffff;
  --accent-light: #fbeee8;
  --green: #2f7d4f;
  --green-light: #e8f5ec;
  --amber: #8f5410;
  --amber-light: #fff4dd;
  --amber-line: #ecd3a6;
  --red: #c0392b;
  --red-light: #fdecea;
  --info: #2b5fb8;
  --info-light: #e8effb;
  --hot: #c2410c;
  --hot-light: #fff1e6;
  --solid: #26231f;
  --solid-ink: #ffffff;
  --thead: #f8f5f0;
  --hover: #faf7f2;
  --field: #ffffff;
  --field-line: #d9d3c9;
  --shadow: 0 1px 2px rgba(40, 30, 20, .05), 0 6px 18px rgba(40, 30, 20, .05);
  --radius: .9rem;
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
}

/* 夜间模式：点过按钮就按选择来；没点过时跟随系统。两处的取值保持一致。 */
:root[data-theme="dark"] {
  color-scheme: dark;
  --surface: #1e1c19;
  --canvas: #141311;
  --ink: #ece8e1;
  --muted: #a39c92;
  --line: #35312b;
  --track: #2d2a25;
  --accent: #ec8a66;
  --accent-hover: #f3a184;
  --accent-ink: #1e1c19;
  --accent-light: #3a2219;
  --green: #6cc08b;
  --green-light: #1b3324;
  --amber: #e6b566;
  --amber-light: #33270f;
  --amber-line: #5a4520;
  --red: #ff8a7a;
  --red-light: #3d1f1b;
  --info: #8fb3f2;
  --info-light: #1c2940;
  --hot: #ff9a5c;
  --hot-light: #3b2413;
  --solid: #ece8e1;
  --solid-ink: #1e1c19;
  --thead: #24211d;
  --hover: #26231f;
  --field: #171613;
  --field-line: #413c34;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    color-scheme: dark;
    --surface: #1e1c19;
    --canvas: #141311;
    --ink: #ece8e1;
    --muted: #a39c92;
    --line: #35312b;
    --track: #2d2a25;
    --accent: #ec8a66;
    --accent-hover: #f3a184;
    --accent-ink: #1e1c19;
    --accent-light: #3a2219;
    --green: #6cc08b;
    --green-light: #1b3324;
    --amber: #e6b566;
    --amber-light: #33270f;
    --amber-line: #5a4520;
    --red: #ff8a7a;
    --red-light: #3d1f1b;
    --info: #8fb3f2;
    --info-light: #1c2940;
    --hot: #ff9a5c;
    --hot-light: #3b2413;
    --solid: #ece8e1;
    --solid-ink: #1e1c19;
    --thead: #24211d;
    --hover: #26231f;
    --field: #171613;
    --field-line: #413c34;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3);
  }
}

* { box-sizing: border-box; }
body, h1, h2, h3, p { margin: 0; }
body { background: var(--canvas); color: var(--ink); }
a { color: var(--accent); text-decoration: none; }
button, select, input { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
button:disabled { cursor: not-allowed; opacity: .55; }
:focus-visible { outline: 3px solid var(--info); outline-offset: 3px; }
.skip { position: absolute; left: 1rem; top: -5rem; z-index: 20; padding: .6rem 1rem; background: var(--surface); }
.skip:focus { top: 1rem; }
.icon { width: 1.1rem; height: 1.1rem; flex: none; fill: currentColor; }

/* 整体框架 */
.workspace { display: grid; grid-template-columns: 218px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; align-self: start; height: 100vh; overflow-y: auto; padding: 1.1rem .75rem 1rem; color: var(--muted); background: var(--surface); border-right: 1px solid var(--line); }
.brand { display: flex; gap: .6rem; align-items: center; padding: .1rem .6rem 1rem; color: var(--ink); }
.brand-mark { flex: 0 0 1.5rem; width: 1.5rem; height: 1.5rem; border-radius: .45rem; background: linear-gradient(135deg, var(--accent), var(--hot)); }
.brand b { display: block; font-size: 1rem; white-space: nowrap; }
.brand small { color: var(--muted); font-size: .77rem; }
.brand-mini { display: none; align-items: center; gap: .5rem; color: var(--ink); font-weight: 700; white-space: nowrap; }
.nav-group { margin-top: .7rem; }
.nav-label { color: var(--muted); padding: .18rem .65rem; font-size: .76rem; }
.nav-link { display: flex; gap: .55rem; align-items: center; color: var(--muted); border-radius: .6rem; padding: .5rem .65rem; font-size: .9rem; }
.nav-link[aria-current] { background: var(--accent-light); color: var(--accent); font-weight: 650; }
.nav-link:hover { background: var(--hover); color: var(--ink); }
.nav-link[aria-current]:hover { background: var(--accent-light); color: var(--accent); }
.workspace-main { min-width: 0; }
.topbar { min-height: 56px; display: flex; align-items: center; justify-content: space-between; gap: .65rem; padding: .5rem 1.6rem; background: var(--surface); border-bottom: 1px solid var(--line); }
.topbar-left, .actions, .pill-group, .page-tools { display: flex; gap: .55rem; align-items: center; flex-wrap: wrap; }
.tabbar { display: none; }
main { padding: 1.35rem 1.6rem 2rem; max-width: 1540px; margin: 0 auto; }
.page-head { display: flex; justify-content: space-between; gap: 1rem; align-items: end; margin-bottom: 1rem; flex-wrap: wrap; }
h1 { font-size: clamp(1.4rem, 2.4vw, 1.75rem); letter-spacing: .01em; }
h2 { font-size: 1.08rem; }
h3 { font-size: .97rem; }
.subtext { color: var(--muted); font-size: .86rem; }
.source-line { display: flex; align-items: center; gap: .65rem; flex-wrap: wrap; color: var(--muted); font-size: .86rem; }
.badge { display: inline-flex; align-items: center; font-size: .78rem; font-weight: 600; border-radius: 999px; background: var(--accent-light); color: var(--accent); padding: .16rem .6rem; white-space: nowrap; }
.badge.ok { background: var(--green-light); color: var(--green); }
.badge.warn { background: var(--amber-light); color: var(--amber); }
.badge.kind { margin-left: .4rem; border-radius: .4rem; padding: .05rem .42rem; background: var(--track); color: var(--muted); font-weight: 500; vertical-align: .12em; }
.badge.state { margin-left: .4rem; border-radius: .4rem; padding: .05rem .42rem; background: transparent; box-shadow: inset 0 0 0 1px var(--accent); color: var(--accent); font-weight: 500; vertical-align: .12em; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .3rem; background: var(--surface); color: var(--ink); padding: .47rem .8rem; border: 1px solid var(--line); border-radius: .6rem; font-size: .9rem; font-weight: 570; white-space: nowrap; }
.btn:hover { background: var(--hover); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.small { font-size: .82rem; padding: .32rem .62rem; }

/* 卡片、统计、图表 */
.grid { display: grid; gap: .9rem; }
.stats { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: .9rem; }
.stats.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stats.five { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.split { grid-template-columns: minmax(0, 1.66fr) minmax(0, 1fr); }
.even { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stack > * + * { margin-top: .85rem; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; min-width: 0; box-shadow: var(--shadow); }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: .6rem; margin-bottom: .75rem; flex-wrap: wrap; }
.stat { padding: .9rem 1rem .85rem; }
.stat-label { display: block; color: var(--muted); font-size: .86rem; }
.stat-value { color: var(--ink); display: block; margin-top: .2rem; font-size: clamp(1.2rem, 2.5vw, 1.7rem); line-height: 1.28; font-weight: 700; letter-spacing: -.02em; overflow-wrap: anywhere; }
.numeric { font-variant-numeric: tabular-nums; }
.up { color: var(--green); }
.down { color: var(--red); }
.muted { color: var(--muted); }
.metric-line { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .58rem 0; border-bottom: 1px solid var(--line); font-size: .92rem; }
.metric-line:last-child { border-bottom: 0; }
.util-bar { height: .5rem; border-radius: 999px; background: var(--track); overflow: hidden; margin: .7rem 0 1rem; }
.util-bar span { display: block; height: 100%; background: var(--info); }
.chart { display: block; width: 100%; height: auto; margin-top: .3rem; }
.chart text { font-size: 11px; fill: var(--muted); }
.chart line { stroke: var(--line); }
.chart polyline { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.chart circle { fill: var(--accent); }

/* 表格 */
.table-card { padding: 0; overflow: hidden; }
.table-card .card-head { margin: 0; padding: .85rem 1rem; }
.table-scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; min-width: 640px; }
th, td { padding: .63rem .85rem; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; font-size: .86rem; }
thead { background: var(--thead); }
th { color: var(--muted); font-weight: 600; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--hover); }
td b { display: block; }
td small { color: var(--muted); font-size: .76rem; }
.table-card td.numeric b { color: var(--accent); font-size: .95rem; }
.compact-asset { display: none; }
.pagination { display: flex; justify-content: space-between; align-items: center; gap: .6rem; padding: .7rem 1rem; border-top: 1px solid var(--line); flex-wrap: wrap; }
.empty { color: var(--muted); padding: 1.35rem; text-align: center; }

/* 表单 */
.filters, .form-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .68rem; align-items: end; }
.form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid .wide, .filters .wide { grid-column: 1 / -1; }
label { display: grid; gap: .24rem; min-width: 0; font-size: .84rem; color: var(--muted); font-weight: 560; }
input, select { min-width: 0; width: 100%; border: 1px solid var(--field-line); border-radius: .55rem; padding: .45rem .6rem; background: var(--field); color: var(--ink); font-size: .94rem; }
input[type=file] { padding: .38rem; }
.box-note { border: 1px solid var(--amber-line); border-radius: .7rem; background: var(--amber-light); color: var(--amber); padding: .65rem .8rem; font-size: .87rem; }
.error { color: var(--red); font-size: .89rem; }
.notice { position: fixed; z-index: 15; bottom: 1rem; right: 1.2rem; max-width: min(420px, 90vw); padding: .7rem 1rem; border-radius: .7rem; background: var(--solid); color: var(--solid-ink); box-shadow: 0 6px 20px rgba(0, 0, 0, .22); }
.notice.error { background: #a23024; color: #ffffff; }
dialog { border: 1px solid var(--line); border-radius: var(--radius); width: min(690px, 94vw); max-height: 90vh; color: var(--ink); background: var(--surface); padding: 1.1rem; }
dialog::backdrop { background: rgba(20, 16, 12, .5); }
.dialog-actions { display: flex; gap: .55rem; justify-content: end; margin-top: .8rem; }
.line-title { margin-bottom: .45rem; }
.import-fields { list-style: none; padding: 0; margin: .65rem 0 0; }
.import-fields li { padding: .38rem 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
code { font-size: .86em; }

/* 抽签行情 */
.draw-head { display: flex; justify-content: space-between; align-items: end; flex-wrap: wrap; gap: .6rem 1.2rem; margin-bottom: .9rem; }
.draw-head h1 { line-height: 1.25; }
.draw-head .subtext { margin-top: .25rem; }
.draw-totals { display: flex; flex-wrap: wrap; gap: .5rem; }
.total-chip { display: inline-flex; align-items: baseline; gap: .35rem; padding: .28rem .75rem; border-radius: 999px; background: var(--green-light); color: var(--green); font-size: .86rem; font-weight: 600; white-space: nowrap; }
.total-chip b { font-size: 1.05rem; }
.total-chip.urgent { background: var(--red-light); color: var(--red); }
.total-chip.warn { background: var(--amber-light); color: var(--amber); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* 定时采集状态 */
.collector { padding: .8rem 1rem; margin-bottom: .8rem; }
.collector-head { display: flex; align-items: center; gap: .55rem; flex-wrap: wrap; }
.collector-head strong::before { content: "⏱ "; }
.collector-next { margin-left: auto; color: var(--muted); font-size: .86rem; }
.collector-next.late { color: var(--amber); }
.collector-bar { height: .3rem; margin: .55rem 0 .5rem; }
.collector .box-note { margin-top: .55rem; }

/* 热度榜 */
.heat { padding: 0; margin-bottom: .8rem; overflow: hidden; }
.heat summary { display: flex; align-items: center; gap: .3rem .6rem; flex-wrap: wrap; padding: .7rem 1rem; cursor: pointer; list-style: none; }
.heat summary::-webkit-details-marker { display: none; }
.heat summary::before { content: "▸"; color: var(--muted); font-size: .8rem; }
.heat[open] summary::before { content: "▾"; }
.heat-title { display: inline-flex; align-items: center; gap: .3rem; color: var(--hot); font-weight: 700; }
.heat-window { margin-left: auto; }
.heat-about { flex-basis: 100%; font-size: .8rem; }
.heat [data-heat-count] { background: var(--hot-light); color: var(--hot); }
.heat-list { list-style: none; margin: 0; padding: 0 1rem .2rem; }
.heat-list li { display: grid; grid-template-columns: auto minmax(0, 1fr) 4.2rem 6.4rem 6rem; align-items: center; gap: .75rem; padding: .44rem 0; border-top: 1px solid var(--line); font-size: .88rem; }
.heat-list li.ended { opacity: .55; }
.heat-tier { display: grid; place-items: center; width: 1.55rem; height: 1.55rem; border-radius: .4rem; background: var(--track); color: var(--muted); font-size: .78rem; font-weight: 700; }
.heat-tier[data-tier="full"] { background: var(--solid); color: var(--solid-ink); }
.heat-tier[data-tier="hot"] { background: var(--red); color: #ffffff; }
.heat-tier[data-tier="warm"] { background: var(--hot-light); color: var(--hot); }
.heat-name { display: flex; align-items: baseline; flex-wrap: wrap; gap: .1rem .55rem; min-width: 0; }
.heat-name b { overflow-wrap: anywhere; }
.heat-name small { color: var(--muted); font-size: .78rem; }
.heat-name small em { font-style: normal; color: var(--hot); font-weight: 600; }
.heat-spark { display: flex; align-items: flex-end; gap: 2px; height: 1.25rem; }
.heat-spark i { flex: 1; min-width: 2px; border-radius: 1px; background: var(--hot); opacity: .7; }
.heat-count { color: var(--muted); font-size: .8rem; white-space: nowrap; }
.heat-speed { text-align: right; white-space: nowrap; }
.heat-speed b { font-size: .98rem; }
.heat-speed small { margin-left: .12rem; color: var(--muted); font-size: .76rem; }
.heat .empty { padding: .4rem 1rem 1rem; text-align: left; font-size: .86rem; }
.heat-more { display: block; width: 100%; padding: .5rem 1rem; border: 0; border-top: 1px solid var(--line); background: none; color: var(--accent); font-size: .84rem; font-weight: 600; }
.heat-more:hover { background: var(--hover); }

/* 品类、已选条件、工具条 */
.draw-categories { margin-bottom: .45rem; }
.conds-hint { margin-bottom: .2rem; font-size: .8rem; }
.conds-line { display: flex; align-items: center; gap: .3rem .55rem; flex-wrap: wrap; min-height: 1.9rem; margin-bottom: .55rem; }
.conds-summary { display: flex; align-items: center; flex-wrap: wrap; gap: .35rem; flex: 1; min-width: 0; }
.conds-line .quiet-btn { padding: .2rem .7rem; font-size: .8rem; }
.cond-chip { display: inline-flex; align-items: center; gap: .1rem; padding: .08rem .15rem .08rem .6rem; border-radius: 999px; background: var(--info-light); color: var(--info); font-size: .8rem; font-weight: 600; }
.cond-chip.off { background: var(--track); color: var(--muted); }
.cond-chip button { display: grid; place-items: center; width: 1.45rem; height: 1.45rem; padding: 0; border: 0; border-radius: 50%; background: none; color: inherit; font-size: 1rem; line-height: 1; }
.cond-chip button:hover { background: var(--surface); }
.draw-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: .55rem .8rem; padding: .6rem .8rem; }
.btn.dark { background: var(--solid); border-color: var(--solid); color: var(--solid-ink); }
.btn.dark:hover { background: var(--solid); opacity: .88; }
.urgent-note { color: var(--red); font-size: .86rem; font-weight: 600; white-space: nowrap; }
.urgent-note::before { content: "⚠ "; }
.draw-count { margin-left: auto; font-size: .9rem; white-space: nowrap; }
.draw-count b { font-size: 1.05rem; }
.pager { display: flex; align-items: center; flex-wrap: wrap; gap: .3rem; }
.pager:empty { display: none; }
.pager.bottom { justify-content: center; margin-top: .9rem; }
.page-number[aria-current] { background: var(--solid); border-color: var(--solid); color: var(--solid-ink); }
.pager-gap { padding: 0 .15rem; color: var(--muted); }

/* 筛选面板 */
.conds { margin-top: .6rem; padding: .25rem 1rem .8rem; }
.cond { padding: .7rem 0; border-bottom: 1px solid var(--line); }
.cond-head { display: flex; align-items: center; justify-content: space-between; gap: .6rem; margin-bottom: .45rem; }
.cond-head b { font-size: .92rem; }
.cond-off, .cond-check { display: inline-flex; align-items: center; gap: .35rem; color: var(--muted); font-size: .8rem; font-weight: 500; cursor: pointer; }
.cond-off input, .cond-check input { flex: none; width: 1rem; height: 1rem; padding: 0; accent-color: var(--accent); }
.cond-row { display: flex; align-items: center; flex-wrap: wrap; gap: .4rem; }
.cond-row + .cond-row { margin-top: .45rem; }
.cond .subtext { font-size: .8rem; }
.cond > .subtext { margin-top: .35rem; }
.conds .chip { padding: .28rem .7rem; }
.conds .chip span { color: var(--muted); font-weight: 400; }
.wide-input { width: min(100%, 20rem); }
.short-input { width: 6.4rem; }
.price-input { width: 7rem; }
input[aria-invalid="true"] { border-color: var(--red); }
.cond-check { align-items: flex-start; margin-top: .65rem; }
.cond-check input { margin-top: .2rem; }
.cond-check span { display: grid; gap: .08rem; }
.cond-check b { color: var(--ink); font-size: .86rem; }
.cond-check small { font-size: .78rem; }
.cond-actions { display: flex; align-items: center; flex-wrap: wrap; gap: .6rem; padding-top: .7rem; }
.cond-actions .subtext { flex: 1; min-width: 12rem; font-size: .8rem; }

.chip-row { display: flex; flex-wrap: wrap; gap: .45rem; }
.chip, .quiet-btn, .query-advanced summary, .estimate-advanced summary, .quote-breakdown summary {
  font-weight: 600;
  font-size: .85rem;
  cursor: pointer;
}
.chip, .quiet-btn {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 999px;
  padding: .36rem .82rem;
  color: var(--muted);
}
.chip { display: inline-flex; align-items: center; gap: .4rem; }
.chip span { font-size: .8rem; color: inherit; font-variant-numeric: tabular-nums; }
.chip:hover, .quiet-btn:hover { background: var(--hover); color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--solid); border-color: var(--solid); color: var(--solid-ink); }
.quiet-btn[aria-pressed="true"] { background: var(--accent-light); border-color: var(--accent); color: var(--accent); }
.query-advanced summary, .estimate-advanced summary, .quote-breakdown summary { color: var(--accent); padding: .44rem 0; }
.query-advanced { padding-top: .35rem; border-top: 1px solid var(--line); }
.query-advanced[open] .filters { margin-top: .4rem; }
.draw-sort label { display: flex; align-items: center; gap: .5rem; white-space: nowrap; }
.draw-sort select { width: auto; font-size: .88rem; }
.draw-results { margin-top: .8rem; }

/* 精选好货、近日成交：结构条、日期、卡片 */
:root { --kind-role: #c8643c; --kind-equipment: #4d7fd6; --kind-accessory: #3fa37c; --kind-pet: #9a6bd0; --kind-petEquipment: #c98a2b; --kind-jade: #3aa0b5;
  --band-a: #7a6ad8; --band-b: #3f78d4; --band-c: #2f9c8f; --band-d: #d07a2e; }
[data-tone="role"] { background-color: var(--kind-role); }
[data-tone="equipment"] { background-color: var(--kind-equipment); }
[data-tone="accessory"] { background-color: var(--kind-accessory); }
[data-tone="pet"] { background-color: var(--kind-pet); }
[data-tone="petEquipment"] { background-color: var(--kind-petEquipment); }
[data-tone="jade"] { background-color: var(--kind-jade); }
[data-tone="band-a"] { background-color: var(--band-a); }
[data-tone="band-b"] { background-color: var(--band-b); }
[data-tone="band-c"] { background-color: var(--band-c); }
[data-tone="band-d"] { background-color: var(--band-d); }
.structure { margin-bottom: .8rem; }
.structure .card-head { margin-bottom: .6rem; }
.structure-gap { height: .9rem; }
.share-bar { display: flex; gap: 2px; height: .85rem; border-radius: 999px; overflow: hidden; background: var(--track); }
.share-bar i { display: block; height: 100%; min-width: 3px; }
.share-legend { display: flex; flex-wrap: wrap; gap: .25rem .4rem; margin-top: .55rem; font-size: .83rem; color: var(--muted); }
.share-legend > * { display: inline-flex; align-items: center; gap: .35rem; padding: .16rem .55rem; border: 1px solid transparent; border-radius: 999px; background: none; color: inherit; }
.share-legend button:hover { background: var(--hover); color: var(--ink); }
.share-legend button[aria-pressed="true"] { border-color: var(--ink); color: var(--ink); background: var(--surface); font-weight: 600; }
.share-legend i { width: .62rem; height: .62rem; border-radius: 50%; flex: none; }
.share-legend b { color: var(--ink); }
.share-legend small { font-size: .78rem; }
.day-card { margin-bottom: .8rem; }
.day-tabs { display: flex; gap: .4rem; overflow-x: auto; padding-bottom: .5rem; scrollbar-width: thin; }
.day-tab { display: inline-flex; align-items: baseline; gap: .4rem; flex: none; padding: .38rem .8rem; border: 1px solid var(--line); border-radius: .6rem; background: var(--surface); color: var(--muted); font-weight: 650; font-size: .9rem; }
.day-tab small { font-size: .76rem; font-weight: 500; }
.day-tab:hover { background: var(--hover); color: var(--ink); }
.day-tab[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.sold-note { margin-bottom: .8rem; }
.goods-toolbar .conds-summary { flex: 0 1 auto; }
.goods-toolbar .wide-input { width: min(100%, 15rem); }
.goods-card header h3 .badge.ok { margin-left: .4rem; border-radius: .4rem; padding: .05rem .42rem; font-weight: 500; vertical-align: .12em; }
.goods-line { display: flex; gap: .4rem; margin-top: .25rem; font-size: .88rem; overflow-wrap: anywhere; }
.goods-line span { flex: none; color: var(--accent); font-size: .7rem; line-height: 2; }
.goods-line.minor { margin-top: .05rem; color: var(--muted); font-size: .84rem; }
.goods-line.minor span { color: var(--muted); }
.draw-card header p.sold-speed { margin-top: .15rem; color: var(--green); font-size: .84rem; font-weight: 600; }
.cross-fee { color: var(--muted); font-size: .8rem; white-space: nowrap; }
.below-median { padding: .1rem .5rem; border-radius: .4rem; background: var(--green-light); color: var(--green); font-size: .78rem; font-weight: 650; white-space: nowrap; cursor: help; }
[data-recent][aria-busy="true"], [data-sales][aria-busy="true"] { opacity: .6; transition: opacity .15s; }

/* 登录页 */
.login-body { display: grid; place-items: center; min-height: 100vh; padding: 1rem; }
.login-card { width: min(100%, 24rem); display: grid; gap: .9rem; padding: 1.4rem; }
.login-brand { display: flex; align-items: center; gap: .6rem; }
.login-brand h1 { font-size: 1.3rem; }
.login-card .btn { width: 100%; padding: .6rem; }

/* 命中提醒 */
.hits { position: fixed; z-index: 14; top: 4.2rem; right: 1rem; display: grid; gap: .5rem; width: min(22rem, calc(100vw - 2rem)); pointer-events: none; }
.hits > * { pointer-events: auto; }
.hit-card { padding: 0; border-left: 4px solid var(--accent); box-shadow: 0 8px 26px rgba(0, 0, 0, .18); overflow: hidden; }
.hit-card header { display: flex; align-items: center; gap: .5rem; padding: .4rem .7rem; background: var(--accent-light); color: var(--accent); font-size: .84rem; }
.hit-card header span { color: var(--muted); }
.hit-card header button { margin-left: auto; border: 0; background: none; color: var(--muted); font-size: 1.1rem; line-height: 1; padding: .1rem .3rem; }
.hit-body { display: flex; gap: .7rem; padding: .65rem .7rem .3rem; }
.hit-body .market-thumb { --thumb-size: 3.4rem; }
.hit-body h3 small { color: var(--muted); font-weight: 400; }
.hit-price { display: flex; align-items: baseline; flex-wrap: wrap; gap: .35rem; margin: .1rem 0; }
.hit-price strong { color: var(--accent); font-size: 1.1rem; }
.hit-price span { padding: 0 .4rem; border-radius: .35rem; background: var(--track); color: var(--muted); font-size: .76rem; }
.hit-card footer { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .5rem; padding: .5rem .7rem .7rem; }
.hits-more { justify-self: end; box-shadow: 0 4px 14px rgba(0, 0, 0, .15); }
.remind .cond-check { display: flex; margin-top: .4rem; }
.remind .cond-check small { margin-left: .4rem; padding: 0 .35rem; border-radius: .3rem; background: var(--track); display: inline; }
.remind .cond-check span { display: block; }
.remind-hint { margin: .6rem 0 0; }
.remind-extra { margin: .7rem 0 .4rem; }
.hit-log { margin-top: .5rem; }
.hit-log summary { color: var(--accent); font-size: .84rem; font-weight: 600; cursor: pointer; }
.hit-log .metric-line { font-size: .84rem; flex-wrap: wrap; }

/* 抽签日报 */
[data-report][aria-busy="true"] { opacity: .6; transition: opacity .15s; }
[data-tone="band-e"] { background-color: #b0527a; }
.report-brief { margin-bottom: .9rem; }
.report-brief ul { margin: .5rem 0 0; padding-left: 1.2rem; }
.report-brief li { padding: .15rem 0; }
.report-grid { margin-bottom: .9rem; align-items: start; }
.report-grid td small { display: inline; margin-left: .3rem; }
.report-grid td.numeric b { display: inline; }
.report-grid td:nth-child(2) small { display: block; margin-left: 0; }
.report-sub { margin-top: 1rem; }
.area-row { border-top: 1px solid var(--line); padding: .5rem 0; }
.area-row:first-of-type { border-top: 0; }
.area-row summary { display: flex; justify-content: space-between; gap: .6rem; cursor: pointer; font-size: .9rem; }
.area-row summary span { color: var(--muted); font-size: .84rem; }
.area-row p { margin-top: .35rem; }
.report-hours { margin-bottom: .9rem; }
.hour-chart { display: grid; grid-template-columns: repeat(24, minmax(0, 1fr)); gap: 3px; height: 10rem; margin-top: .4rem; }
.hour-col { display: grid; grid-template-rows: minmax(0, 1fr) 1.1rem; min-width: 0; }
.hour-bars { display: flex; align-items: flex-end; justify-content: center; gap: 1px; min-height: 0; }
.hour-bars i, .hour-legend i { display: block; flex: 1; max-width: .7rem; min-height: 1px; border-radius: 2px 2px 0 0; background: var(--accent); }
.hour-bars i.avg, .hour-legend i.avg { background: var(--track); box-shadow: inset 0 0 0 1px var(--line); }
.hour-col small { color: var(--muted); font-size: .68rem; text-align: center; }
.hour-legend { display: flex; gap: 1rem; margin: .3rem 0 .5rem; }
.hour-legend span { display: inline-flex; align-items: center; gap: .35rem; }
.hour-legend i { width: .7rem; height: .7rem; flex: none; border-radius: 2px; }
.school-chip { cursor: default; }
.report-moves, .report-weeks { margin-top: .9rem; }
.report-moves h3 { margin-bottom: .3rem; }
.report-moves small { color: var(--muted); font-weight: 400; margin-left: .4rem; }
.week-card .stat-value small { font-size: .8rem; font-weight: 500; }
.report-foot { margin-top: .8rem; }

/* 成交价查询 */
.stats.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stats.two > :first-child { background: var(--solid); border-color: var(--solid); color: var(--solid-ink); }
.stats.two > :first-child .stat-label, .stats.two > :first-child .subtext, .stats.two > :first-child .stat-value { color: inherit; }
.sales-library { margin-bottom: .6rem; }
.sales-form { display: grid; gap: .6rem; margin-bottom: .8rem; padding: .8rem; }
.sales-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(8.6rem, 1fr)); gap: .5rem; }
.sales-fields > :first-child { grid-column: span 2; }
.sales-form select, .sales-form input { font-size: .88rem; }
.sales-actions { display: flex; align-items: center; flex-wrap: wrap; gap: .6rem .9rem; }
.sales-actions .cond-check { margin-top: 0; align-items: center; }
.sales-actions .cond-check input { margin-top: 0; }
.my-server { display: flex; align-items: center; gap: .45rem; font-size: .84rem; white-space: nowrap; }
.my-server select { width: auto; max-width: 11rem; }
.sales-actions .btn.primary { margin-left: auto; }
.sales-tip { margin: 0 0 .7rem; font-size: .82rem; }
.sales-table .asset-cell { align-items: flex-start; }
.sales-table .asset-cell b { display: inline; white-space: normal; }
.sales-table .asset-cell b a { color: var(--ink); }
.sales-table .asset-cell b a:hover { color: var(--accent); }
.sales-table .sn { margin-left: .3rem; font-weight: 400; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .72rem; }
.sales-table .badge { margin-left: .35rem; padding: .02rem .4rem; border-radius: .35rem; font-size: .72rem; }
.sales-table .asset-cell small { display: block; white-space: normal; }
.mini-tag { display: inline-block; margin-left: .3rem; padding: 0 .35rem; border-radius: .3rem; background: var(--info-light); color: var(--info); font-size: .72rem; }
.draw-table .asset-cell b { white-space: normal; overflow-wrap: anywhere; }
.draw-table tr[data-tone="urgent"] td:first-child { box-shadow: inset 3px 0 0 var(--red); }
.draw-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); gap: .8rem; }
.draw-card { display: flex; flex-direction: column; gap: .62rem; padding: .9rem; }
.draw-card[data-tone="urgent"] { border-color: var(--red); }
.draw-card header { display: flex; align-items: flex-start; gap: .8rem; }
.draw-card header .market-thumb { --thumb-size: 5rem; border-radius: .7rem; }
.draw-identity { flex: 1; min-width: 0; }
.draw-card header h3 { font-size: 1.05rem; line-height: 1.4; overflow-wrap: anywhere; }
.draw-card header h3 small { color: var(--muted); font-size: .84rem; font-weight: 400; }
.draw-card header p { margin-top: .1rem; font-size: .8rem; overflow-wrap: anywhere; }
.draw-countdown { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: .65rem; margin-top: .3rem; color: var(--muted); font-size: .84rem; }
.draw-card[data-tone="closed"] .draw-bar { display: none; }
.draw-card:not([data-tone="closed"]) .draw-remaining::before { content: "还剩 "; }
.draw-clock { color: var(--ink); font-size: .98rem; }
.draw-clock[data-tone="urgent"] { color: var(--red); }
.draw-clock[data-tone="closed"] { color: var(--muted); font-size: .86rem; font-weight: 500; }
.draw-bar { height: .38rem; border-radius: 999px; background: var(--track); overflow: hidden; }
.draw-bar i { display: block; height: 100%; border-radius: inherit; background: var(--info); transition: width 1s linear; }
.draw-card[data-tone="urgent"] .draw-bar i { background: var(--red); }
.draw-facts { font-size: .86rem; overflow-wrap: anywhere; }
.draw-traits { display: flex; flex-wrap: wrap; gap: .35rem; font-size: .76rem; }
.draw-traits span { padding: .1rem .5rem; border-radius: .4rem; background: var(--info-light); color: var(--info); overflow-wrap: anywhere; }
.draw-traits span.plain { background: var(--track); color: var(--muted); }
.draw-card footer { display: flex; align-items: center; flex-wrap: wrap; gap: .45rem .65rem; margin-top: auto; padding-top: .62rem; border-top: 1px dashed var(--line); }
.draw-heat { padding: .16rem .6rem; border-radius: .5rem; background: var(--track); color: var(--muted); font-size: .82rem; font-weight: 500; white-space: nowrap; }
.draw-heat[data-level="hot"] { background: var(--hot-light); color: var(--hot); font-weight: 650; }
.draw-price { color: var(--accent); font-size: 1.3rem; letter-spacing: -.01em; }
.draw-card footer .actions { margin-left: auto; }
.go-official { border-color: var(--accent); background: var(--accent-light); color: var(--accent); font-weight: 650; }
.go-official:hover { background: var(--accent-light); }
.estimate-action { color: var(--muted); }
.asset-cell { display: flex; align-items: center; gap: .55rem; }
.market-thumb { position: relative; flex: 0 0 var(--thumb-size, 3.25rem); width: var(--thumb-size, 3.25rem); height: var(--thumb-size, 3.25rem); display: grid; place-items: center; overflow: hidden; background-color: var(--track); border: 1px solid var(--line); border-radius: .75rem; }
.asset-cell .market-thumb { --thumb-size: 2.55rem; border-radius: .55rem; }
.market-thumb img { display: block; width: 100%; height: 100%; object-fit: contain; }
.market-thumb.has-image[data-kind] { border: 1px solid var(--line); background: #ffffff; background-image: none; }
.thumb-caption { padding: .1rem .24rem; color: var(--muted); font-size: .62rem; line-height: 1.2; text-align: center; }
.market-thumb[data-kind] { border: 0; color: #ffffff; font-weight: 700; background-image: linear-gradient(135deg, #8a8378, #5f594f); }
.market-thumb[data-kind="role"] { background-image: linear-gradient(135deg, #c8643c, #9c3d22); }
.market-thumb[data-kind="equipment"] { background-image: linear-gradient(135deg, #4d7fd6, #2b56a8); }
.market-thumb[data-kind="accessory"] { background-image: linear-gradient(135deg, #3fa37c, #23785a); }
.market-thumb[data-kind="pet"] { background-image: linear-gradient(135deg, #9a6bd0, #6d44a5); }
.market-thumb[data-kind="petEquipment"] { background-image: linear-gradient(135deg, #c98a2b, #9a6414); }
.market-thumb[data-kind="jade"] { background-image: linear-gradient(135deg, #3aa0b5, #1f7286); }
.thumb-glyph { font-size: 1.15rem; line-height: 1; }
.asset-cell .thumb-glyph { font-size: .95rem; }

/* 角色估价 */
.estimate-grid { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); align-items: start; }
.estimate-source, .estimate-lookup { margin-bottom: .85rem; }
.estimate-source { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .6rem 1.5rem; }
.estimate-source h2 { margin: .15rem 0 .2rem; overflow-wrap: anywhere; }
.estimate-source strong { display: block; font-size: 1.22rem; }
.estimate-lookup { display: flex; gap: .6rem; align-items: end; }
.estimate-lookup label { flex: 1; }
.estimate-advanced { border-top: 1px solid var(--line); margin-top: .25rem; }
.estimate-advanced > .form-grid { padding: .3rem 0; }
.estimate-result .card-head { margin-bottom: .65rem; }
.quote-lead { padding: .8rem .95rem; border: 1px solid transparent; border-radius: .7rem; background: var(--accent-light); color: var(--accent); }
.quote-lead > span { font-size: .86rem; font-weight: 650; }
.quote-lead strong { display: block; font-size: clamp(1.6rem, 3.2vw, 2.3rem); letter-spacing: -.03em; line-height: 1.25; overflow-wrap: anywhere; }
.quote-lead p { margin-top: .38rem; color: var(--muted); font-size: .83rem; overflow-wrap: anywhere; }
.quote-facts { display: grid; gap: .46rem .75rem; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: .75rem 0 .6rem; }
.quote-facts span { color: var(--muted); font-size: .77rem; }
.quote-facts b { display: block; font-size: .94rem; overflow-wrap: anywhere; }
.quote-note { margin-bottom: .65rem; color: var(--muted); font-size: .85rem; }
.quote-breakdown { margin-top: .45rem; border-top: 1px solid var(--line); }
.quote-breakdown .metric-line { flex-wrap: wrap; font-size: .85rem; }

@media (max-width: 1280px) {
  .stats.five { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1020px) {
  .workspace { grid-template-columns: 184px minmax(0, 1fr); }
  main, .topbar { padding-left: 1rem; padding-right: 1rem; }
  .filters { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* 手机：侧边栏收进「更多」，底部放导航 */
@media (max-width: 760px) {
  .workspace { grid-template-columns: minmax(0, 1fr); }
  .sidebar { display: none; }
  .sidebar.open { display: block; position: fixed; z-index: 10; top: 57px; left: 0; bottom: calc(58px + env(safe-area-inset-bottom)); width: min(80vw, 255px); height: auto; border-right: 1px solid var(--line); box-shadow: 8px 0 24px rgba(0, 0, 0, .18); }
  .sidebar.open .brand { display: none; }
  .brand-mini { display: inline-flex; }
  .topbar { position: sticky; top: 0; z-index: 9; }
  .topbar-left, .topbar .actions { flex-wrap: nowrap; min-width: 0; }
  .topbar .actions { flex: none; }
  /* 手机顶栏放不下两个小标：有采集状态时只留它（它已经说明了数据新不新） */
  .topbar-left:has([data-collector-chip]:not([hidden])) [data-market-badge] { display: none; }
  .topbar-left .badge { overflow: hidden; text-overflow: ellipsis; }
  /* 手机上「数据入口」收进「更多」里的导入行情，顶栏只留一行 */
  .topbar .actions a.btn { display: none; }
  main { padding-bottom: calc(5.2rem + env(safe-area-inset-bottom)); }
  .tabbar { position: fixed; z-index: 11; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); padding: .3rem .25rem calc(.3rem + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--line); }
  .tab { display: grid; justify-items: center; gap: .1rem; min-height: 46px; padding: .28rem 0; border: 0; background: none; color: var(--muted); font-size: .72rem; }
  .tab[aria-current], .tab[aria-expanded="true"] { color: var(--accent); font-weight: 650; }
  .tab .icon { width: 1.2rem; height: 1.2rem; }
  .notice { bottom: calc(4.4rem + env(safe-area-inset-bottom)); }
  .hits { top: 3.9rem; right: .6rem; }
  .sales-table table { min-width: 0; }
  .sales-table th, .sales-table td { padding: .6rem .42rem; }
  .sales-table tr > :nth-child(n+2):nth-child(-n+4), .sales-table tr > :nth-child(8) { display: none; }
  .sales-table .compact-asset { display: block; }
  .sales-actions .btn.primary { margin-left: 0; }
  .stats, .stats.three, .stats.five { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats.three > :first-child, .stats.five > :last-child { grid-column: 1 / -1; }
  .goods-toolbar .wide-input { flex: 1; min-width: 8rem; }
  .day-tab { min-height: 44px; }
  .split, .even, .estimate-grid { grid-template-columns: minmax(0, 1fr); }
  .has-estimate .estimate-result { grid-row: 1; }
  .draw-card footer button, .draw-card footer a, .chip, .draw-sort select, .draw-toolbar .btn, .estimate-advanced summary, .estimate-grid .btn { min-height: 44px; }
  .draw-sort label { font-size: 0; gap: 0; }
  .draw-count { margin-left: 0; }
  .draw-toolbar .pager { margin-left: auto; }
  .heat-list li { grid-template-columns: auto minmax(0, 1fr) auto; }
  .heat-spark, .heat-count { display: none; }
  .collector-next { flex-basis: 100%; margin-left: 0; }
  .short-input { width: 5.2rem; }
  .chip-row { flex-wrap: nowrap; overflow-x: auto; max-width: 100%; padding-bottom: .15rem; scrollbar-width: none; }
  .chip { flex: none; }
  .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .market-table table { min-width: 0; }
  .market-table th, .market-table td { padding: .6rem .42rem; white-space: normal; }
  .market-table tr > :nth-child(n+2):nth-child(-n+4) { display: none; }
  .market-table td:nth-child(5), .market-table td:nth-child(7) { white-space: nowrap; }
  .market-table .compact-asset { display: block; overflow-wrap: anywhere; }
  /* 手机表格里名称不拆行，色块缩小一点让出位置 */
  .market-table .asset-cell b { white-space: nowrap; }
  .market-table .asset-cell .market-thumb { --thumb-size: 2.1rem; }
}
@media (max-width: 460px) {
  .draw-sort select { max-width: 10rem; }
  .estimate-lookup { flex-wrap: wrap; }
  .estimate-lookup label { flex-basis: 100%; }
}
@media (max-width: 390px) {
  main, .topbar { padding-left: .7rem; padding-right: .7rem; }
  .mobile-hide { display: none; }
  .stat { padding: .65rem; }
}
