:root {
  --bg: #f5f6f8;
  --card: #fff;
  --line: #e6e8ec;
  --text: #1c1d21;
  --muted: #7c828c;
  --accent: #2f6bff;
  --ok: #12915a;
  --radius: 14px;
}
* { box-sizing: border-box; }
body {
  margin: 0 auto;
  max-width: 1180px;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  padding: 0 14px 48px;
}
.muted { color: var(--muted); }
button { font: inherit; cursor: pointer; border-radius: 10px; border: 1px solid var(--line); background: #fff; padding: 8px 14px; }
button.primary, .login-box button { background: var(--accent); border-color: var(--accent); color: #fff; }
button.ghost { background: transparent; }
a.ghost {
  background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 8px 14px;
  color: var(--text); text-decoration: none; font: inherit; align-self: center;
}
a.ghost:hover { border-color: var(--accent); color: var(--accent); }
input { font: inherit; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }

.topbar {
  display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between;
  background: #fff; border-bottom: 1px solid var(--line); padding: 14px 16px; position: sticky; top: 0; z-index: 5;
  margin: 0 -14px 14px;
}
.brand { display: flex; gap: 12px; align-items: center; }
.brand h1 { font-size: 17px; margin: 0; }
.brand p { margin: 2px 0 0; font-size: 12px; }
.logo { width: 38px; height: 38px; border-radius: 12px; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 700; }
.actions { display: flex; gap: 8px; }

.stats { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.chip { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 16px; min-width: 96px; display: flex; flex-direction: column; }
.chip .num { font-size: 22px; font-weight: 700; }
.chip .lab { font-size: 12px; color: var(--muted); }
.chip.warn { border-color: #ffd9bd; background: #fff7f1; }
.chip.warn .num { color: #ff6a00; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.card.priced { border-color: #cdeadd; }
.thumb { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; background: #f1f2f5; display: block; }
.thumb.placeholder { display: grid; place-items: center; color: var(--muted); font-size: 13px; }
.body { padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.name { font-weight: 600; }
.sku div { white-space: pre-wrap; font-size: 13px; color: #444a55; }
.meta { font-size: 12px; color: var(--muted); }
.row { display: flex; align-items: center; gap: 8px; margin-top: auto; padding-top: 8px; }
.row input { width: 110px; font-family: ui-monospace, monospace; }
.row label { font-size: 13px; color: var(--muted); }
.saved { color: var(--ok); font-size: 12px; min-height: 16px; }
.link { display: inline-block; font-size: 13px; color: var(--accent); text-decoration: none; word-break: break-all; }
.empty { grid-column: 1 / -1; background: #fff; border: 1px dashed var(--line); border-radius: var(--radius); padding: 40px; text-align: center; }

.login-mask { position: fixed; inset: 0; background: rgba(20,22,26,.55); display: grid; place-items: center; z-index: 20; }
.login-mask[hidden] { display: none; }
.login-box { background: #fff; padding: 26px; border-radius: 16px; width: min(340px, 90vw); display: flex; flex-direction: column; gap: 10px; }
.login-box h1 { margin: 0; font-size: 20px; }
.login-box p { margin: 0; }
.error { color: #d93636; font-size: 13px; min-height: 18px; }
