:root {
  --bg: #f6f7f9; --card: #fff; --ink: #1d2330; --muted: #6b7385; --line: #e2e5eb;
  --accent: #e8590c; --ok: #2b8a3e; --warn: #b35c00; --err: #c92a2a; --errbg: #fff5f5;
}
* { box-sizing: border-box; }
body { margin: 0; font: 14px/1.5 system-ui, "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif; background: var(--bg); color: var(--ink); padding-bottom: 56px; }
.top { padding: 14px 20px; background: var(--card); border-bottom: 1px solid var(--line); }
h1 { margin: 0; font-size: 18px; }
h1 small, h2 small { color: var(--muted); font-weight: 400; font-size: 12px; margin-left: 6px; }
h2 { margin: 0; font-size: 16px; }
h3 { font-size: 14px; margin: 16px 0 6px; }
main { max-width: 1200px; margin: 0 auto; padding: 16px; display: grid; gap: 16px; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 16px; min-width: 0; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 10px; }
.row { display: flex; gap: 8px; }
.row input { flex: 1; min-width: 0; }
input[type=text] { padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; font: inherit; }
button { padding: 8px 14px; border: 0; border-radius: 6px; background: var(--accent); color: #fff; font: inherit; cursor: pointer; }
button.ghost { background: transparent; color: var(--accent); border: 1px solid var(--accent); padding: 4px 10px; font-size: 12px; }
button:disabled { opacity: .5; cursor: wait; }
.modes { display: flex; gap: 16px; margin-bottom: 8px; }
.hint, .muted { color: var(--muted); font-size: 12px; }
.badge { font-size: 11px; padding: 2px 8px; border-radius: 10px; background: var(--line); color: var(--muted); white-space: nowrap; }
.badge.cache { background: #e7f5ff; color: #1864ab; }
.badge.network { background: #fff4e6; color: var(--warn); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin-top: 10px; }
.card { border: 1px solid var(--line); border-radius: 6px; overflow: hidden; cursor: pointer; background: #fff; display: flex; flex-direction: column; }
.card:hover { border-color: var(--accent); }
.card img { width: 100%; aspect-ratio: 1; object-fit: cover; background: #eee; }
.card .body { padding: 8px; display: flex; flex-direction: column; gap: 4px; }
.card .title { font-size: 12px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.price { color: var(--err); font-weight: 600; }
.id { color: var(--muted); font-size: 11px; font-family: ui-monospace, monospace; }
.error { border: 1px solid #ffc9c9; background: var(--errbg); color: var(--err); border-radius: 6px; padding: 10px 12px; margin-top: 10px; }
.error code { background: #fff; padding: 0 4px; border-radius: 3px; }
.error dl { margin: 6px 0 0; display: grid; grid-template-columns: max-content 1fr; gap: 2px 10px; color: var(--ink); }
.error dt { color: var(--muted); }
.notice { border: 1px solid var(--line); background: #f8f9fa; border-radius: 6px; padding: 10px 12px; margin-top: 10px; }
.detail { display: grid; grid-template-columns: minmax(240px, 360px) 1fr; gap: 20px; }
@media (max-width: 760px) { .detail { grid-template-columns: 1fr; } }
.gallery .main { width: 100%; aspect-ratio: 1; object-fit: contain; border: 1px solid var(--line); border-radius: 6px; background: #fafafa; }
.thumbs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.thumbs img { width: 52px; height: 52px; object-fit: cover; border: 2px solid transparent; border-radius: 4px; cursor: pointer; }
.thumbs img.on { border-color: var(--accent); }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; word-break: break-all; }
.table-wrap { overflow-x: auto; max-height: 420px; overflow-y: auto; border: 1px solid var(--line); border-radius: 6px; }
table { border-collapse: collapse; width: 100%; font-size: 12px; }
th, td { border-bottom: 1px solid var(--line); padding: 6px 8px; text-align: left; vertical-align: top; }
th { background: #f1f3f5; position: sticky; top: 0; }
td img { width: 40px; height: 40px; object-fit: cover; border-radius: 3px; }
pre.raw { max-height: 480px; overflow: auto; background: #1d2330; color: #e9ecef; padding: 12px; border-radius: 6px; font-size: 12px; white-space: pre-wrap; word-break: break-all; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 10px; }
a { color: var(--accent); }
footer { position: fixed; bottom: 0; left: 0; right: 0; background: var(--ink); color: #f1f3f5; padding: 8px 16px; font-size: 12px; display: flex; gap: 20px; flex-wrap: wrap; }
footer .warn { color: #ffa94d; }
.desc-imgs { display: flex; flex-direction: column; align-items: center; gap: 0; max-width: 760px; margin: 0 auto; }
.desc-imgs img { width: 100%; height: auto; display: block; }
.badge.fixture { background: #ebfbee; color: var(--ok); }
.drop { flex: 1; display: flex; align-items: center; gap: 10px; border: 2px dashed var(--line); border-radius: 6px; padding: 10px; cursor: pointer; color: var(--muted); }
.drop.over { border-color: var(--accent); color: var(--accent); }
.drop input { max-width: 220px; }
.upload-preview { width: 64px; height: 64px; object-fit: cover; border-radius: 4px; }
[hidden] { display: none !important; }
a.card { color: inherit; text-decoration: none; }
a.home { color: inherit; text-decoration: none; }
.panel-head .grow { flex: 1; }
.ptitle { font-size: 17px; margin: 0 0 8px; }
.bigprice { font-size: 24px; color: var(--err); font-weight: 700; margin-bottom: 8px; }
.tiers { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.tier { border: 1px solid var(--line); border-radius: 6px; padding: 4px 10px; text-align: center; }
.picker { display: grid; gap: 12px; margin: 8px 0; }
.dim-name { font-weight: 600; margin-bottom: 4px; }
.vals { display: flex; flex-wrap: wrap; gap: 6px; max-height: 260px; overflow-y: auto; }
button.val { display: inline-flex; align-items: center; gap: 6px; background: #fff; color: var(--ink); border: 1px solid var(--line); padding: 4px 10px; font-size: 12px; max-width: 100%; text-align: left; }
button.val img { width: 32px; height: 32px; object-fit: cover; border-radius: 3px; }
button.val:hover { border-color: var(--accent); }
button.val.on { border-color: var(--accent); background: #fff4e6; color: var(--accent); }
button.val.off { opacity: .45; text-decoration: line-through; }
.selected { background: #f8f9fa; border: 1px solid var(--line); border-radius: 6px; padding: 8px 12px; margin-bottom: 12px; }
.selected p { margin: 0; }
details { margin-top: 14px; }
details summary { cursor: pointer; font-weight: 600; }
details .table-wrap { margin-top: 6px; }
/* loader */
@keyframes spin { to { transform: rotate(360deg); } }
.loader { display: flex; align-items: center; gap: 10px; padding: 14px 12px; margin-top: 10px; border: 1px solid var(--line); border-radius: 6px; background: #fffaf5; color: var(--ink); }
.loader .spin { width: 20px; height: 20px; flex: none; border: 3px solid #ffd8a8; border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
.loader .secs { margin-left: auto; color: var(--muted); font-variant-numeric: tabular-nums; }
.uploading { display: flex; align-items: center; gap: 12px; }
.uploading .loader { flex: 1; margin-top: 0; }
button.busy { position: relative; color: transparent !important; }
button.busy::after { content: ''; position: absolute; inset: 0; margin: auto; width: 14px; height: 14px; border: 2px solid rgba(255,255,255,.5); border-top-color: #fff; border-radius: 50%; animation: spin .8s linear infinite; }
input.busy { opacity: .5; }
@media (prefers-reduced-motion: reduce) { .loader .spin, button.busy::after { animation-duration: 2.4s; } }
/* stars + badges */
.rating { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 6px; }
.stars { display: inline-flex; align-items: center; white-space: nowrap; }
.stars-bg { position: relative; color: #dee2e6; font-size: 18px; letter-spacing: 1px; line-height: 1; }
.stars-fg { position: absolute; left: 0; top: 0; overflow: hidden; color: #f59f00; white-space: nowrap; }
.stars-num { font-size: 12px; color: var(--muted); }
.tags { display: flex; flex-wrap: wrap; gap: 4px; }
.tag { font-size: 11px; padding: 1px 6px; border-radius: 4px; background: #f1f3f5; color: var(--muted); white-space: nowrap; }
.tag.premium { background: #fff3bf; color: #8a5a00; font-weight: 600; }
.small { font-size: 12px; }
/* readable JSON */
.json-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 12px; margin-top: 16px; }
.json-box { border: 1px solid var(--line); border-radius: 6px; overflow: hidden; min-width: 0; }
.json-head { display: flex; justify-content: space-between; align-items: center; padding: 6px 10px; background: #f1f3f5; }
.json-head h3 { margin: 0; }
pre.json { margin: 0; padding: 10px 12px; max-height: 380px; overflow: auto; background: #1d2330; color: #e9ecef; font: 12px/1.5 ui-monospace, "SFMono-Regular", Menlo, monospace; white-space: pre-wrap; word-break: break-word; }
.j-k { color: #74c0fc; } .j-s { color: #b2f2bb; } .j-n { color: #ffc078; } .j-b { color: #e599f7; }
/* pagination */
.pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin: 12px 0; }
.pg-list { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
button.pg { min-width: 36px; padding: 6px 10px; background: #fff; color: var(--ink); border: 1px solid var(--line); font-size: 13px; }
button.pg:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
button.pg.on { background: var(--accent); border-color: var(--accent); color: #fff; opacity: 1; cursor: default; }
button.pg:disabled:not(.on) { opacity: .4; cursor: not-allowed; }
.pg-gap { color: var(--muted); padding: 0 2px; }
.pg-go { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; }
.pg-input { width: 64px; padding: 5px 6px; border: 1px solid var(--line); border-radius: 6px; font: inherit; }
@media (max-width: 560px) { .pager { justify-content: center; } }
a.seller-link { font-size: 13px; font-weight: 600; padding: 2px 8px; border: 1px solid var(--accent); border-radius: 4px; text-decoration: none; }
a.seller-link:hover { background: #fff4e6; }

/* login overlay (sessionStorage password, see common.js) */
.login-overlay { position: fixed; inset: 0; z-index: 50; background: rgba(20, 24, 33, .55); display: grid; place-items: center; padding: 16px; }
.login-box { background: var(--card); border-radius: 10px; padding: 22px; width: min(340px, 100%); display: grid; gap: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.25); }
.login-box h2 { margin: 0; font-size: 18px; }
.login-box p { margin: 0; }
.login-box input { padding: 9px 10px; border: 1px solid var(--line); border-radius: 6px; font: inherit; }
