/* ---------- Login ---------- */
.login {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 32px 16px;
  background:
    radial-gradient(1200px 600px at 10% -10%, #e2ede6 0%, transparent 60%),
    radial-gradient(900px 500px at 110% 110%, #efeadb 0%, transparent 55%),
    var(--bg);
}
.login-card {
  width: 100%;
  max-width: 440px;
  padding: 32px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
}
.login-card .brand {
  margin-bottom: 28px;
}
.login-card h1 {
  font-size: 24px;
}
.login-lead {
  margin: 6px 0 24px;
  color: var(--text-2);
}
#login-form,
#shared-form {
  display: grid;
  gap: 14px;
}
.login-block {
  display: grid;
  gap: 12px;
  padding: 16px 0;
  border-top: 1px solid var(--border);
}
.login-block h2,
.login-block summary {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.login-block summary {
  cursor: pointer;
  color: var(--text-3);
  font-weight: 500;
}
.login-hint {
  font-size: 12px;
  color: var(--text-3);
}
.login-error {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--danger-line, #efc3b8);
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 13px;
}
a.btn.block {
  text-align: center;
  text-decoration: none;
}
a.btn.disabled {
  pointer-events: none;
  opacity: 0.5;
}
.role-picker {
  border: 0;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
}
.role-picker legend {
  padding: 0;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
}
.role-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition:
    border-color 0.15s,
    background-color 0.15s;
}
.role-option:hover {
  border-color: var(--border-strong);
}
.role-option:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.role-option input {
  margin-top: 3px;
}
.role-option span {
  display: grid;
  gap: 1px;
}
.role-option strong {
  font-weight: 600;
  font-size: 14px;
}
.login-foot {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  color: var(--text-3);
  font-size: 12px;
}

/* ---------- Brand ---------- */
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
/* The cat-head mark (inline SVG in index.html, the same drawing as the tab icon): white on the accent square, centred. */
.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 16px;
  flex: none;
}
.brand-text {
  display: grid;
  font-weight: 600;
  font-size: 15px;
  line-height: 1.25;
  letter-spacing: 0.01em;
}
.brand-text small {
  font-weight: 400;
  font-size: 12px;
}

/* ---------- App shell ---------- */
.app {
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
  min-height: 100dvh;
}
.sidebar {
  position: sticky;
  top: 0;
  height: 100dvh;
  overflow-y: auto;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.sidebar .brand {
  padding: 4px 8px;
}
#nav {
  display: grid;
  gap: 18px;
}
.nav-group {
  display: grid;
  gap: 2px;
}
.nav-label {
  padding: 0 10px 4px;
  font-size: 12px;
  color: var(--text-3);
  font-weight: 500;
}
#nav button {
  justify-content: flex-start;
  width: 100%;
  min-height: var(--control-h);
  padding: 0 10px;
  gap: 10px;
  background: transparent;
  border-color: transparent;
  color: var(--text-2);
  font-weight: 500;
  box-shadow: none;
}
#nav button svg {
  width: 18px;
  height: 18px;
  color: var(--text-3);
}
#nav button:hover {
  background: var(--surface-3);
  color: var(--text);
}
#nav button.active {
  background: var(--accent-soft);
  color: var(--accent-text);
  font-weight: 600;
}
#nav button.active svg {
  color: var(--accent);
}
/* The narrow top bar's parts and the bottom bar: shown only on a phone or narrow window (pages.css, ≤900px). */
.topbar-mark,
.page-name,
.me,
.tabbar {
  display: none;
}
.brand-mark > svg {
  width: 72%;
  height: 72%;
  display: block;
}
.topbar-mark {
  width: 28px;
  height: 28px;
  flex: none;
}
.me {
  position: relative;
  flex: none;
}
.me-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: var(--z-toast);
  min-width: 200px;
  display: grid;
  gap: 2px;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}
.me-menu .btn {
  justify-content: flex-start;
  width: 100%;
}
.me-who {
  display: grid;
  gap: 2px;
  padding: 8px 10px 10px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}
.me-who small {
  font-size: var(--fs-xs);
}
/* 全部: every tab, rising from the bottom on a phone, centred on a wide screen. */
dialog.sheet {
  width: min(480px, 100vw);
  max-height: 80dvh;
  padding: 0;
  overflow: auto;
}
.sheet-head {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.sheet-list {
  display: grid;
  gap: 16px;
  padding: 12px 12px calc(16px + env(safe-area-inset-bottom));
}
.sheet-list button {
  justify-content: flex-start;
  width: 100%;
  min-height: var(--control-h-lg);
  padding: 0 10px;
  gap: 10px;
  background: transparent;
  border-color: transparent;
  color: var(--text-2);
  font-weight: 500;
  box-shadow: none;
}
.sheet-list button:hover:not(:disabled) {
  background: var(--surface-3);
  border-color: transparent;
  color: var(--text);
}
.sheet-list button svg {
  width: 18px;
  height: 18px;
  color: var(--text-3);
}
.sheet-list button.active {
  background: var(--accent-soft);
  color: var(--accent-text);
  font-weight: 600;
}
.main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.topbar {
  position: sticky;
  top: 0;
  z-index: var(--z-topbar);
  height: var(--topbar);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 32px;
  background: rgb(245 246 243 / 0.86);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--border);
}
.env {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-2);
  min-width: 0;
}
.identity {
  display: flex;
  align-items: center;
  gap: 10px;
}
.who {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}
.avatar {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent-text);
  font-weight: 600;
  font-size: 13px;
}
#content {
  width: 100%;
  max-width: 1360px;
  padding: 28px 32px 64px;
  outline: none;
}

/* A tab switching (spec 2026-10-06 §2.9): after 150 ms (a quick read shows nothing) the old page is hidden and the
   new tab's name shows over a placeholder. Reduced motion skips the animations, and with them the placeholder. */
#content.switching {
  position: relative;
  min-height: 360px;
}
#content.switching > * {
  animation: switching-hide 0s 150ms forwards;
}
/* Pinned to the screen, not the page: the old page may have been scrolled far down. */
#content.switching::before,
#content.switching::after {
  position: fixed;
  left: calc(var(--sidebar) + 32px);
  right: 32px;
  visibility: hidden;
}
#content.switching::before {
  content: attr(data-loading);
  top: calc(var(--topbar) + 28px);
  font-size: var(--fs-xl);
  font-weight: 600;
  color: var(--text);
  animation: switching-show 0s 150ms forwards;
}
#content.switching::after {
  content: "";
  top: calc(var(--topbar) + 80px);
  height: 240px;
  border-radius: var(--radius-lg);
  background: linear-gradient(90deg, var(--surface-3), var(--surface-2), var(--surface-3));
  background-size: 200% 100%;
  animation:
    switching-show 0s 150ms forwards,
    placeholder-sheen 1.2s linear 150ms infinite;
}
@keyframes switching-hide {
  to {
    visibility: hidden;
  }
}
@keyframes switching-show {
  to {
    visibility: visible;
  }
}
@keyframes placeholder-sheen {
  to {
    background-position: -200% 0;
  }
}
/* ---------- Page scaffolding ---------- */
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 20px;
}
.page-intro {
  margin-top: 6px;
  max-width: 72ch;
  color: var(--text-2);
  font-size: 13px;
  text-wrap: pretty;
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
}
/* One sentence, at most two lines (one on a phone); a tap shows the rest (spec §2.7). */
.intro-text {
  min-width: 0;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  cursor: pointer;
}
.intro-text.open {
  display: block;
}
.page-intro [data-guide] {
  flex: none;
  min-height: 0;
  padding: 0 4px;
  color: var(--accent);
  font-size: var(--fs-sm);
}
.page-title {
  min-width: 0;
}
/* A long explanation folded under one line (「口径说明」). */
.explain {
  font-size: var(--fs-sm);
  color: var(--text-2);
}
.explain > summary {
  width: max-content;
  cursor: pointer;
  color: var(--accent);
}
.explain > div {
  display: grid;
  gap: var(--space-2);
  max-width: 80ch;
  margin-top: var(--space-2);
}
.page-actions {
  display: flex;
  gap: 8px;
  flex: none;
}
.stack {
  display: grid;
  gap: 20px;
}
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
/* Inside a stack (查用户's 积分 card) the stack's gap spaces the stats: no second gap below them. */
.stack > .stats {
  margin-bottom: 0;
}
.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  display: grid;
  gap: 2px;
  box-shadow: var(--shadow-sm);
}
.stat-label {
  font-size: 12px;
  color: var(--text-3);
  font-weight: 500;
}
.stat-value {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.3;
}
.stat-hint {
  font-size: 12px;
  color: var(--text-3);
}
.stat.warn .stat-value {
  color: var(--warn);
}
.stat.danger .stat-value {
  color: var(--danger);
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.card-head p {
  margin-top: 3px;
  font-size: 13px;
  color: var(--text-3);
  max-width: 80ch;
}
.card-body {
  padding: 20px;
}
.card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}
.callout {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--warn-line);
  background: var(--warn-soft);
  color: #5d4200;
  font-size: 13px;
}
.callout svg {
  width: 16px;
  height: 16px;
  flex: none;
  margin-top: 2px;
}
.callout.info {
  border-color: #cfdeec;
  background: var(--info-soft);
  color: #234a6d;
}
.callout.neutral {
  border-color: var(--border);
  background: var(--surface-2);
  color: var(--text-2);
}
/* Money owed back to buyers (关单后到账待退款). */
.callout.danger {
  border-color: var(--danger-line);
  background: var(--danger-soft);
  color: var(--danger);
}
/* A callout in the page flow, above the stats: aligned with them, spaced like them. */
.page-callout {
  margin: 0 0 20px;
}
.toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
/* A toolbar whose fields carry a label above them: buttons sit on the fields' baseline, at the fields' height. */
.toolbar:has(> label.field) {
  align-items: flex-end;
}
.toolbar:has(> label.field) > .btn:not(.icon) {
  height: var(--control-h);
}
.toolbar .spacer {
  flex: 1;
}
/* What a search box finds, under it (the box itself shows a short placeholder). */
.search-hint {
  flex-basis: 100%;
  order: 10;
  margin-top: -6px;
  font-size: var(--fs-xs);
  color: var(--text-3);
}
/* A list's search box takes most of the toolbar's free room, so its placeholder shows whole on a desktop screen, what
   Enter finds included (「（回车查全部记录）」, capacity stage 5). */
.toolbar .search {
  flex: 4 1 400px;
  max-width: 560px;
}
/* The 已归档 toolbar (商品与库存): the search box and the type select share one row. */
.toolbar > #archive-search {
  flex: 1 1 260px;
  max-width: 420px;
  width: auto;
}
.toolbar > #archive-kind {
  flex: 0 0 auto;
  width: auto;
}
.search {
  position: relative;
  width: 280px;
  max-width: 100%;
}
.search svg {
  position: absolute;
  left: 10px;
  top: 50%;
  width: 16px;
  height: 16px;
  transform: translateY(-50%);
  color: var(--text-3);
  pointer-events: none;
}
.search input {
  padding-left: 32px;
  background: var(--surface);
}
/* The group is one control tall: its padding and border plus the buttons inside make --control-h. */
.segmented {
  display: inline-flex;
  max-width: 100%;
  flex-wrap: wrap;
  padding: 3px;
  gap: 2px;
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.segmented button {
  min-height: calc(var(--control-h) - 8px);
  padding: 0 12px;
  background: transparent;
  border-color: transparent;
  color: var(--text-2);
  font-size: 13px;
  box-shadow: none;
}
.segmented button:hover:not(:disabled) {
  background: rgb(255 255 255 / 0.6);
  border-color: transparent;
  color: var(--text);
}
.segmented button.on {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
}
.segmented .count {
  font-size: 12px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}
.result-count {
  font-size: 13px;
  color: var(--text-3);
}
.list-foot {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: center;
  padding: 16px 0 4px;
}
.empty {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 48px 24px;
  text-align: center;
  color: var(--text-3);
}
.empty svg {
  width: 36px;
  height: 36px;
  color: #b9c3bb;
  margin-bottom: 4px;
}
.empty strong {
  color: var(--text);
  font-weight: 600;
  font-size: 14px;
}
.empty.card {
  padding: 56px 24px;
}
/* 商品与库存's sub-pages, above its parts. */
.segmented.subviews {
  margin-bottom: 16px;
}

/* ---------- Tables ---------- */
.table-card {
  overflow: hidden;
}
.table-wrap {
  overflow-x: auto;
}
table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}
th {
  position: sticky;
  top: 0;
  z-index: 1;
  text-align: left;
  font-weight: 500;
  font-size: 12px;
  color: var(--text-3);
  background: var(--surface-2);
  white-space: nowrap;
}
th,
td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
tbody tr:last-child td {
  border-bottom: 0;
}
tbody tr:hover td {
  background: #fbfcfa;
}
tr.group-row th {
  position: static;
  background: var(--surface-3);
  color: var(--text-2);
  font-weight: 600;
  font-size: 12px;
  padding: 8px 14px;
}
tr.group-row .count {
  font-weight: 400;
  color: var(--text-3);
  margin-left: 6px;
}
td.right,
th.right {
  text-align: right;
}
.cell-stack {
  display: grid;
  gap: 3px;
}
.cell-stack.start {
  justify-items: start;
}
.nowrap {
  white-space: nowrap;
}
.cell-sub {
  color: var(--text-3);
  font-size: 12px;
}
.truncate {
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.thumb {
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
  object-fit: contain;
  background: var(--surface-3);
  border: 1px solid var(--border);
  flex: none;
}
.product-line {
  display: flex;
  gap: 10px;
  align-items: center;
  min-width: 200px;
}
.id-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-2);
  background: var(--surface-3);
  border: 1px solid transparent;
  border-radius: 5px;
  padding: 1px 6px;
  min-height: 0;
  font-weight: 400;
  box-shadow: none;
  cursor: copy;
}
.id-chip:hover:not(:disabled) {
  background: var(--accent-soft);
  border-color: transparent;
  color: var(--accent-text);
}
/* 查用户: a 游园号 that opens that buyer's page (gardenIdLink). */
.link-btn {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  color: var(--accent);
  cursor: pointer;
  text-decoration: underline dotted;
}

/* Catalog table */
.product-cell {
  display: flex;
  gap: 12px;
  align-items: center;
  min-width: 260px;
}
.product-cell .meta {
  display: grid;
  gap: 4px;
  flex: 1;
  min-width: 160px;
}
/* A button or a status among a product's details (归档, 棋盘上) keeps its own width instead of stretching across the column. */
.product-cell .meta > .btn,
.product-cell .meta > .pill {
  justify-self: start;
}
.size-field {
  display: flex;
  align-items: center;
  gap: 8px;
}
.size-field > span {
  flex: none;
  font-size: 12px;
  color: var(--text-3);
}
.size-field input {
  flex: 1;
  min-width: 0;
}
.thumb-upload {
  position: relative;
  width: 56px;
  height: 56px;
  flex: none;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface-3);
  cursor: pointer;
}
.thumb-upload img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.thumb-upload span {
  position: absolute;
  inset: auto 0 0 0;
  padding: 2px 0;
  text-align: center;
  font-size: var(--fs-xs);
  color: #fff;
  background: rgb(20 36 29 / 0.62);
  opacity: 0;
  transition: opacity 0.15s;
}
.thumb-upload:hover span,
.thumb-upload:focus-within span {
  opacity: 1;
}
.stock-controls {
  display: flex;
  gap: 6px;
  align-items: center;
}
.stock-controls input {
  width: 84px;
}
.stock-cell {
  display: grid;
  gap: 6px;
  justify-items: start;
}
.shelf-books {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  font-size: 12px;
  color: var(--text-3);
}
.shelf-books b {
  font-size: 14px;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
/* Disclosure card (details.card) */
details.card > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  border-radius: var(--radius-lg);
}
details.card > summary::-webkit-details-marker {
  display: none;
}
details.card > summary:hover {
  background: var(--surface-2);
}
details.card[open] > summary {
  border-bottom: 1px solid var(--border);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
details.card > summary .chev,
details.inline > summary .chev {
  width: 16px;
  height: 16px;
  color: var(--text-3);
  transition: transform 0.2s;
  flex: none;
}
details[open] > summary .chev {
  transform: rotate(180deg);
}
details.card > summary p {
  font-size: 13px;
  color: var(--text-3);
  margin-top: 2px;
}
details.inline {
  margin-top: 12px;
}
details.inline > summary {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  font-weight: 500;
  color: var(--accent);
}
details.inline > summary::-webkit-details-marker {
  display: none;
}
details.inline > summary:hover {
  color: var(--accent-hover);
}

/* Draft bar */
.draftbar {
  position: sticky;
  top: calc(var(--topbar) + 8px);
  z-index: var(--z-sticky);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 10px 12px 10px 16px;
  margin-bottom: 20px;
  background: rgb(255 255 255 / 0.94);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}
.draftbar-info {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--text-3);
}
.draftbar-actions {
  display: flex;
  gap: 8px;
}
.draft-state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
  color: var(--text-2);
}
.draft-state::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #9fb0a4;
}
.draft-state.dirty {
  color: var(--warn);
}
.draft-state.dirty::before {
  background: #e0a526;
  box-shadow: 0 0 0 3px rgb(224 165 38 / 0.2);
}
.steps-hint {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.steps-hint b {
  font-weight: 500;
  color: var(--text-2);
}

/* Mengli */
.mengli {
  display: grid;
  grid-template-columns: 168px minmax(0, 1fr) minmax(0, 1.1fr);
  gap: 24px;
  align-items: start;
}
.mengli-photo {
  width: 168px;
  height: 168px;
  border-radius: var(--radius-lg);
  object-fit: contain;
  background: var(--surface-3);
  border: 1px solid var(--border);
}
.facts {
  display: grid;
  gap: 12px;
  margin: 0;
}
.facts div {
  display: grid;
  gap: 2px;
}
.facts dt {
  font-size: 12px;
  color: var(--text-3);
}
.facts dd {
  margin: 0;
  font-weight: 500;
}
.facts dd.big {
  font-size: 20px;
  font-weight: 600;
}
.retired {
  margin-top: 16px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  font-size: 12px;
  color: var(--text-3);
}

/* Board art */
.spec-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.spec-list span {
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 5px;
  background: var(--surface-3);
  color: var(--text-2);
}
.board-art-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}
.board-art-cell {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 12px;
  background: var(--surface);
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}
.board-art-cell:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow);
}
.board-art-cell .cell-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-3);
  font-weight: 500;
}
.handoff-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}
.handoff-cell {
  display: flex;
  flex-direction: column;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 12px;
  background: var(--surface);
}
/* 棋盘接班: the form for a product already in the catalogue sits under the new-successor form, set apart from it. */
.handoff-cell form + form {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--border-strong);
}
.handoff-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.handoff-reserve input {
  width: 84px;
  margin-left: 6px;
}
.handoff-queue {
  margin: 0;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.handoff-queue li {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}
.handoff-queue img {
  width: 44px;
  height: auto;
}
.handoff-actions {
  margin-left: auto;
  display: flex;
  gap: 4px;
}
#handoff-notices p {
  margin: 0 0 4px;
}
.board-art-cell > .label-img {
  display: block;
  width: 100%;
  height: 104px;
  margin: 10px 0 8px;
  object-fit: contain;
  background: var(--surface-2);
  border-radius: var(--radius);
}
.board-art-cell .cell-name {
  font-weight: 500;
  line-height: 1.4;
}
.board-art-cell .cell-meta {
  margin-top: 4px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.board-art-cell details {
  margin-top: auto;
  padding-top: 10px;
}
.board-art-cell form {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}
.board-art-preview {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--border-strong);
  display: grid;
  gap: 10px;
}
.compare {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
.compare figure {
  margin: 0;
  display: grid;
  gap: 4px;
  justify-items: center;
  font-size: var(--fs-xs);
  color: var(--text-3);
}
.compare img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

/* Rules */
.rules {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 8px 24px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.rules li {
  display: flex;
  gap: 10px;
  align-items: baseline;
  padding: 8px 0;
  border-bottom: 1px dashed var(--border);
}
.rules li > span:last-child {
  min-width: 0;
  overflow-wrap: anywhere;
}
.rules .step {
  flex: none;
  width: 52px;
  font-size: 12px;
  color: var(--text-3);
}

