:root {
  --bg: #f6f7f9; --card: #fff; --ink: #1f2937; --muted: #6b7280;
  --line: #e5e7eb; --brand: #1677ff; --brand-d: #0958d9;
  --green: #067647; --green-bg: #ecfdf3; --amber: #b45309;
}
* { 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", sans-serif; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.topbar { background: #111827; color: #fff; }
.topbar-in { display: flex; align-items: baseline; gap: 12px; padding: 14px 16px; }
.brand { color: #fff; font-size: 19px; font-weight: 800; text-decoration: none; }
.tagline { color: #9ca3af; font-size: 13px; }
.searchbar { display: flex; gap: 10px; margin: 22px 0 12px; }
.searchbar input { flex: 1; height: 44px; border: 1px solid #cbd5e1; border-radius: 8px;
  padding: 0 14px; font-size: 15px; }
.searchbar input:focus { outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(22,119,255,.12); }
.searchbar button, .filters button { height: 44px; border: 0; border-radius: 8px;
  background: var(--brand); color: #fff; font-size: 15px; font-weight: 700;
  padding: 0 22px; cursor: pointer; }
.searchbar button:hover { background: var(--brand-d); }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: end;
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: 12px 14px; margin-bottom: 6px; }
.filters label { display: grid; gap: 4px; font-size: 12px; color: var(--muted); }
.filters select, .filters input { height: 36px; border: 1px solid #cbd5e1;
  border-radius: 6px; padding: 0 8px; font-size: 14px; min-width: 110px; }
.filters .dash { align-self: center; color: var(--muted); }
.filters button { height: 36px; font-size: 14px; padding: 0 14px; }
.filters button.secondary { background: #fff; color: var(--brand);
  border: 1px solid var(--brand); }
.filters button.ghost { background: transparent; color: var(--muted); }
.status { color: var(--muted); font-size: 13px; margin: 10px 2px; min-height: 20px; }
.notice { background: #fffbeb; border: 1px solid #fde68a; color: var(--amber);
  border-radius: 8px; padding: 10px 14px; margin: 10px 0; font-size: 14px; }
.hidden { display: none !important; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 14px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; }
.card h3 { margin: 0; font-size: 15px; line-height: 1.45; }
.card h3 a { color: var(--ink); text-decoration: none; }
.card h3 a:hover { color: var(--brand-d); text-decoration: underline; }
.price-row { display: flex; align-items: baseline; gap: 10px; }
.price-row strong { color: #dc2626; font-size: 21px; }
.stock { color: var(--muted); font-size: 13px; }
.offers { display: grid; gap: 6px; font-size: 13px; }
.offer { display: flex; justify-content: space-between; gap: 8px;
  border-top: 1px dashed var(--line); padding-top: 6px; }
.offer a.shop { color: #334155; font-weight: 600; text-decoration: none;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.offer a.shop:hover { text-decoration: underline; }
.offer .p { color: #dc2626; font-weight: 700; white-space: nowrap; }
.card-foot { display: flex; justify-content: space-between; align-items: center;
  margin-top: 2px; }
.shops-n { font-size: 12px; color: var(--muted); }
.details-btn { border: 1px solid var(--brand); background: #fff; color: var(--brand);
  border-radius: 6px; font-size: 13px; font-weight: 600; padding: 6px 12px; cursor: pointer; }
.details-btn:hover { background: #eff6ff; }
.badge { display: inline-block; background: var(--green-bg); color: var(--green);
  font-size: 12px; font-weight: 700; border-radius: 999px; padding: 2px 10px; }
.empty { text-align: center; color: var(--muted); padding: 60px 0; }
.pager { display: flex; justify-content: center; align-items: center; gap: 14px;
  margin: 26px 0 8px; }
.pager button { border: 1px solid var(--brand); background: #fff; color: var(--brand);
  border-radius: 8px; padding: 8px 18px; font-size: 14px; cursor: pointer; }
.pager button:disabled { border-color: var(--line); color: #9ca3af; cursor: not-allowed; }
.meta { text-align: center; color: #9ca3af; font-size: 12px; margin: 18px 0 40px; }
.dialog-backdrop { position: fixed; inset: 0; background: rgba(15,23,42,.5);
  display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 50; }
.dialog { background: #fff; border-radius: 12px; max-width: 860px; width: 100%;
  max-height: 84vh; display: flex; flex-direction: column; }
.dialog-head { display: flex; justify-content: space-between; align-items: center;
  border-bottom: 1px solid var(--line); padding: 14px 18px; }
.dialog-head h2 { margin: 0; font-size: 16px; }
.dialog-head button { border: 0; background: none; font-size: 26px; cursor: pointer;
  color: var(--muted); line-height: 1; }
.dialog-body { overflow: auto; padding: 8px 18px 18px; }
.dtable { width: 100%; border-collapse: collapse; font-size: 14px; }
.dtable th, .dtable td { text-align: left; padding: 10px 8px;
  border-bottom: 1px solid var(--line); }
.dtable th { color: var(--muted); font-size: 12px; position: sticky; top: 0;
  background: #fff; }
.dtable td.num { white-space: nowrap; font-variant-numeric: tabular-nums; }
.dtable .p { color: #dc2626; font-weight: 700; }
.dtable a { color: var(--brand-d); text-decoration: none; }
.dtable a:hover { text-decoration: underline; }
.checked { color: #9ca3af; font-size: 12px; white-space: nowrap; }
@media (max-width: 640px) { .grid { grid-template-columns: 1fr; } }

.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 18px 0 4px; }
.metric { background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: 12px 16px; display: grid; gap: 2px; }
.metric strong { font-size: 22px; }
.metric span { color: var(--muted); font-size: 12px; }
.quick { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 12px; }
.chip { border: 1px solid var(--line); background: var(--card); border-radius: 999px;
  padding: 6px 14px; font-size: 13px; cursor: pointer; color: #334155; }
.chip:hover { border-color: var(--brand); color: var(--brand-d); }
.ghost-chip { color: var(--muted); }
.rep { font-size: 11px; font-weight: 700; border-radius: 999px; padding: 1px 8px; margin-left: 6px; }
.rep-good { background: var(--green-bg); color: var(--green); }
.rep-risk { background: #fef3f2; color: #b42318; }
.votes { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.vote-btn { border: 1px solid var(--line); background: #fff; border-radius: 6px;
  font-size: 14px; padding: 2px 8px; cursor: pointer; }
.vote-btn:hover:not(:disabled) { border-color: var(--brand); }
.vote-btn:disabled { opacity: .55; cursor: not-allowed; }
.vote-btn.voted { border-color: var(--brand); background: #eff6ff; }
.vote-info { font-size: 12px; color: var(--muted); margin-left: 4px; }
@media (max-width: 640px) { .metrics { grid-template-columns: repeat(2, 1fr); } }
