/* amazon.jeffai.net — single hand-written stylesheet. System fonts, no CDN, light payload. */
:root {
  --bg: #f6f7f9; --card: #ffffff; --ink: #1a1d21; --muted: #6b7280;
  --line: #e5e7eb; --accent: #d9480f; --accent-soft: #fff1e9;
  --up: #15803d; --up-bg: #eafaf0; --down: #b91c1c; --down-bg: #fdecec;
  --heat: #b45309; --heat-bg: #fef3c7; --new: #c026d3; --shadow: 0 1px 3px rgba(0,0,0,.06);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14161a; --card: #1d2025; --ink: #e6e8eb; --muted: #9aa2ad;
    --line: #2b2f36; --accent: #ff7a45; --accent-soft: #33231b;
    --up: #4ade80; --up-bg: #16261b; --down: #f87171; --down-bg: #2a1a1a;
    --heat: #fbbf24; --heat-bg: #33280f; --new: #e879f9; --shadow: 0 1px 3px rgba(0,0,0,.3);
  }
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 14px; line-height: 1.5;
}
a { color: inherit; text-decoration: none; }
.muted { color: var(--muted); }
.de { font-size: 12px; font-weight: 400; }

/* top bar */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 18px; background: var(--card); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 5; flex-wrap: wrap; gap: 8px;
}
.brand a { font-weight: 700; font-size: 16px; }
nav { display: flex; gap: 6px; align-items: center; }
nav a { padding: 6px 12px; border-radius: 8px; color: var(--muted); }
nav a.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
nav a:hover { color: var(--ink); }

.banner { padding: 10px 18px; font-weight: 600; }
.banner.warn { background: var(--down-bg); color: var(--down); }
.freshness { padding: 8px 18px; color: var(--muted); font-size: 12px; border-bottom: 1px solid var(--line); }

main { padding: 18px; max-width: 1200px; margin: 0 auto; }
footer { padding: 20px 18px; text-align: center; }
section { margin-bottom: 28px; }
h2 { font-size: 16px; margin: 0 0 12px; }
.note { font-size: 12px; margin-top: 8px; }
.empty { padding: 40px; text-align: center; color: var(--muted); background: var(--card);
  border: 1px dashed var(--line); border-radius: 12px; }
.crumbs { margin-bottom: 14px; color: var(--muted); }
.crumbs strong { color: var(--ink); }

/* tables */
.grid { width: 100%; border-collapse: collapse; background: var(--card);
  border: 1px solid var(--line); border-radius: 12px; overflow: hidden; box-shadow: var(--shadow); }
.grid th, .grid td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.grid thead th { background: color-mix(in srgb, var(--card) 92%, var(--ink)); font-size: 12px; color: var(--muted); position: sticky; top: 56px; }
.grid tbody tr:last-child td { border-bottom: none; }
.grid tbody tr:hover { background: color-mix(in srgb, var(--card) 90%, var(--accent)); }
.num { text-align: right; white-space: nowrap; }
.items td { border-bottom: 1px solid var(--line); }
.rank { font-variant-numeric: tabular-nums; font-weight: 600; }

/* overflow guard for wide tables */
section, main { overflow-x: auto; }

/* product cell */
.prod { display: flex; gap: 10px; align-items: center; max-width: 520px; }
.prod-title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; font-size: 13px; }
.prod:hover .prod-title { color: var(--accent); }
.thumb { width: 48px; height: 48px; object-fit: contain; background: #fff; border-radius: 6px;
  border: 1px solid var(--line); flex: 0 0 auto; }
.thumb.sm { width: 34px; height: 34px; }
.thumb.noimg { display: inline-flex; align-items: center; justify-content: center;
  font-size: 10px; color: var(--muted); }
.clamp { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.topprod { display: flex; gap: 8px; align-items: center; max-width: 360px; }

/* badges & deltas */
.tag { display: inline-block; padding: 1px 6px; border-radius: 6px; font-size: 11px; font-weight: 600; margin-left: 4px; }
.tag.new { background: color-mix(in srgb, var(--new) 15%, transparent); color: var(--new); }
.heat { display: inline-block; min-width: 40px; text-align: center; padding: 2px 8px; border-radius: 6px;
  background: var(--heat-bg); color: var(--heat); font-weight: 700; font-variant-numeric: tabular-nums; }
.delta { font-weight: 600; font-variant-numeric: tabular-nums; }
.delta.big { font-size: 15px; }
.d-up { color: var(--up); }
.d-down { color: var(--down); }
.d-flat, .d-none { color: var(--muted); font-weight: 400; }
.pricedelta { font-size: 11px; margin-left: 4px; }
.pricedelta.up { color: var(--down); }   /* price up = bad for buyer, red */
.pricedelta.down { color: var(--up); }
.vel { font-size: 11px; color: var(--up); margin-left: 4px; }
.warn-text { color: var(--down); }

/* toolbar / chips */
.toolbar { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 14px; }
.filters { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.lbl { font-size: 12px; color: var(--muted); margin-right: 2px; }
.chip { padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--card); font-size: 12px; color: var(--muted); }
.chip:hover { color: var(--ink); }
.chip.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.chip.sm { padding: 2px 8px; }
.btn { color: var(--accent); font-weight: 600; font-size: 12px; white-space: nowrap; }
.catlink { display: flex; flex-direction: column; }

/* hot cards */
.cardgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.hotcard { background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow); }
.hotcard:hover { border-color: var(--accent); }
.hotcard .thumb { width: 100%; height: 120px; border: none; border-bottom: 1px solid var(--line); border-radius: 0; }
.hotcard-body { padding: 8px 10px; display: flex; flex-direction: column; gap: 4px; }
.hot-badge { align-self: flex-start; background: var(--heat-bg); color: var(--heat);
  font-weight: 700; font-size: 11px; padding: 1px 8px; border-radius: 6px; }
.hot-cat { font-size: 11px; color: var(--muted); }
.hot-title { font-size: 12px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.6em; }
.hot-meta { display: flex; gap: 8px; align-items: center; font-size: 12px; flex-wrap: wrap; }

/* login */
.login-body { display: flex; min-height: 100vh; align-items: center; justify-content: center; }
.login-card { background: var(--card); padding: 32px; border-radius: 16px; box-shadow: var(--shadow);
  border: 1px solid var(--line); width: 320px; text-align: center; }
.login-card h1 { font-size: 18px; margin: 0 0 6px; }
.login-card input { width: 100%; padding: 10px 12px; margin: 14px 0 10px; border: 1px solid var(--line);
  border-radius: 8px; background: var(--bg); color: var(--ink); font-size: 15px; }
.login-card button { width: 100%; padding: 10px; border: none; border-radius: 8px;
  background: var(--accent); color: #fff; font-size: 15px; font-weight: 600; cursor: pointer; }
.login-card .err { color: var(--down); font-size: 13px; }

@media (max-width: 640px) {
  .prod { max-width: 240px; }
  .grid th, .grid td { padding: 6px; }
  .thumb { width: 40px; height: 40px; }
}
