/* 卖货助手 · Gaoyang's tool. House signature: dark base, amber accent, figures as visuals.
   Readability rules carried over from Confirmatch (design/references/READABILITY.md): one typeface built for
   letterform distinction, body text ≥ 16 px, metadata ≥ 14 px, every text pair ≥ 7:1, sentence case,
   nothing truncated, visible focus. Buyer-facing pages (/p, /s) are a separate light "supplier sheet" style. */
@import url('https://fonts.googleapis.com/css2?family=Atkinson+Hyperlegible+Next:wght@400;500;700;800&family=Atkinson+Hyperlegible+Mono:wght@400;700&display=swap');

:root {
  --bg: #121417;        /* page */
  --panel: #1b1e23;     /* cards */
  --panel2: #22262c;    /* hover rows, inputs */
  --line: #2f343c;
  --edge: #6b727c;      /* control borders, 4.6:1 on panel */
  --text: #f2f2f0;      /* 16.9:1 on bg */
  --muted: #b9bec6;     /* 9.9:1 on bg, 8.5:1 on panel */
  --amber: #f2a93b;     /* accent, 9.6:1 on bg; dark text on it 9.6:1 */
  --amber-soft: #3a2a10;
  --ok: #86d99a;        /* 10.8:1 on bg */
  --ok-soft: #173321;
  --danger: #ff8a80;    /* 7.6:1 on bg */
  --danger-soft: #3d1b19;
  --link: #9cc4ff;      /* 10.1:1 on bg */
  --focus: #ffdd00;
  --sans: "Atkinson Hyperlegible Next", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  --mono: "Atkinson Hyperlegible Mono", ui-monospace, Menlo, monospace;
  --fs-s: 0.875rem; --fs: 1rem; --fs-m: 1.1875rem; --fs-l: 1.5rem; --fs-xl: 2rem;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--sans); color: var(--text); background: var(--bg); font-size: var(--fs); line-height: 1.5; font-variant-numeric: tabular-nums; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
main { max-width: 1100px; margin: 0 auto; padding: 14px 14px 64px; }
h1 { font-size: var(--fs-l); margin: 8px 0 14px; line-height: 1.25; }
h2 { font-size: var(--fs-m); margin: 0 0 10px; }
small, .muted { color: var(--muted); font-weight: 400; }
code { font-family: var(--mono); background: var(--panel2); padding: 1px 6px; border-radius: 4px; font-size: 0.95em; }
.hidden { display: none !important; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; box-shadow: 0 0 0 5px #000; }

.top { display: flex; align-items: center; gap: 14px; padding: 10px 14px; background: var(--panel); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; overflow-x: auto; }
.brand { font-weight: 800; color: var(--amber); font-size: var(--fs-m); white-space: nowrap; }
.brand:hover { text-decoration: none; }
nav { display: flex; gap: 2px; }
nav a { padding: 6px 10px; border-radius: 8px; color: var(--text); white-space: nowrap; }
nav a.on { background: var(--amber); color: #121417; font-weight: 700; }
nav a:hover { text-decoration: none; background: var(--panel2); }
nav a.on:hover { background: var(--amber); }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin: 0 0 14px; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 760px) { .cols { grid-template-columns: 1fr; } }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 8px 0; }
.row.between { justify-content: space-between; }
.row.end { justify-content: flex-end; }

/* figures as visuals: the tiles are the numbers */
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 14px; }
@media (max-width: 760px) { .tiles { grid-template-columns: repeat(2, 1fr); } }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; color: var(--text); display: flex; flex-direction: column; gap: 2px; }
.tile:hover { text-decoration: none; border-color: var(--amber); }
.tile b { font-size: var(--fs-xl); color: var(--amber); line-height: 1.1; }
.tile span { color: var(--muted); font-size: var(--fs-s); }
.checklist li { margin: 6px 0; }
ul.plain { list-style: none; padding: 0; margin: 0; }
ul.plain li { padding: 6px 0; border-bottom: 1px dashed var(--line); }

table { width: 100%; border-collapse: collapse; font-size: var(--fs); }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; line-height: 1.4; }
th { color: var(--muted); font-weight: 500; }
td.due { color: var(--danger); font-weight: 700; }
.table-wrap { overflow-x: auto; }
table.ai td b { color: var(--amber); }

.btn { display: inline-block; padding: 8px 14px; border-radius: 8px; border: 1px solid var(--edge); background: var(--panel2); color: var(--text); cursor: pointer; font-size: var(--fs); font-family: inherit; line-height: 1.3; }
.btn.primary { background: var(--amber); border-color: var(--amber); color: #121417; font-weight: 700; }
.btn.ok { background: var(--ok); border-color: var(--ok); color: #121417; font-weight: 700; }
.btn.danger { color: var(--danger); border-color: var(--danger); background: transparent; }
.btn.tiny { padding: 2px 8px; font-size: var(--fs-s); }
.btn:disabled { color: var(--muted); background: var(--panel); border-color: var(--line); cursor: default; }
.btn:hover:not(:disabled) { filter: brightness(1.08); text-decoration: none; }

.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; background: var(--panel2); color: var(--text); font-size: var(--fs-s); }
.badge.available { background: var(--ok-soft); color: var(--ok); }
.badge.reserved { background: var(--amber-soft); color: var(--amber); }
.badge.sold { background: var(--panel2); color: var(--muted); }
.filters a { display: inline-block; padding: 4px 10px; border-radius: 999px; margin-right: 4px; color: var(--text); }
.filters a.on { background: var(--text); color: var(--bg); font-weight: 700; }
.filters a:hover { text-decoration: none; background: var(--panel2); }
.filters a.on:hover { background: var(--text); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.lot { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; color: var(--text); display: flex; flex-direction: column; }
.lot:hover { text-decoration: none; border-color: var(--amber); }
.thumb { aspect-ratio: 4 / 3; background: var(--panel2); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.lot-body { padding: 8px 10px; display: flex; flex-direction: column; gap: 2px; font-size: var(--fs-s); }
.lot-body > div:first-child b { font-size: var(--fs); }
.price { font-weight: 700; color: var(--amber); font-size: var(--fs); }

.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
.photos figure { margin: 0; position: relative; }
.photos img, .photos video { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; background: #000; display: block; }
.photos .del { position: absolute; top: 6px; right: 6px; background: var(--panel); }

.fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px 12px; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field.wide { grid-column: 1 / -1; }
label { font-size: var(--fs-s); color: var(--muted); }
label.check { color: var(--text); font-size: var(--fs); display: inline-flex; gap: 6px; align-items: center; padding: 4px 0; }
label.btn { color: var(--text); font-size: var(--fs); }
input, select, textarea { font: inherit; padding: 9px 10px; border: 1px solid var(--edge); border-radius: 8px; background: var(--panel2); color: var(--text); width: 100%; font-size: var(--fs); }
input::placeholder, textarea::placeholder { color: #8d939c; }
select option { background: var(--panel2); color: var(--text); }
input[type="date"] { color-scheme: dark; }
textarea { resize: vertical; }
.checks { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.grid-checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; margin-bottom: 10px; }
.lot-check { border: 1px solid var(--line); border-radius: 10px; padding: 6px; }
.lot-check img { width: 52px; height: 52px; object-fit: cover; border-radius: 6px; }

pre.msg { white-space: pre-wrap; word-break: break-word; background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: 12px; font: inherit; font-size: var(--fs); line-height: 1.5; margin: 6px 0; }
.draft { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 10px; }
.draft-head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

.overlay { position: fixed; inset: 0; background: var(--bg); display: flex; align-items: center; justify-content: center; z-index: 20; padding: 16px; }
.overlay .card { width: 100%; max-width: 440px; }
.overlay h1 { color: var(--amber); }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 8px 14px; border-radius: 8px; opacity: 0; transition: opacity .2s; pointer-events: none; z-index: 30; font-weight: 700; }
.toast.show { opacity: 1; }
.share { background: var(--amber-soft); color: var(--text); border: 1px solid var(--amber); border-radius: 8px; padding: 10px; word-break: break-all; font-family: var(--mono); font-size: var(--fs-s); }

/* 03 · weekly approval, draft lots from video */
.badge.draft { background: var(--amber); color: #121417; font-weight: 700; }
p.due { color: var(--danger); font-weight: 700; }
section.week { border-left: 4px solid var(--amber); }
.lead-card { background: var(--panel2); margin: 12px 0; }
.lead-card h3 { margin: 0; font-size: var(--fs-m); }
blockquote { margin: 8px 0; padding: 8px 12px; border-left: 3px solid var(--edge); color: var(--muted); font-style: italic; }
table.ai tr.low td { background: var(--amber-soft); }
.draft-lot { border: 2px solid var(--amber); }
.draft textarea[data-edit] { width: 100%; }
