/* ============================================================
   仓库库存图册 · 设计系统
   ============================================================ */
:root {
  --bg: #fafafa;
  --surface: #ffffff;
  --surface-2: #f4f4f5;
  --surface-3: #ececee;
  --ink: #111113;
  --ink-2: #2a2a2e;
  --muted: #6e6e76;
  --muted-2: #9c9ca4;
  --line: #e6e6e8;
  --line-2: #d3d3d7;
  --accent: #111113;
  --accent-dark: #000000;
  --accent-soft: #ececee;
  --coral: #111113;
  --coral-soft: #f0f0f1;
  --teal: #1a1a1e;
  --teal-soft: #ececee;
  --amber: #3a3a3f;
  --amber-soft: #f0f0f1;
  --danger: #c2272d;
  --danger-soft: #fbecec;
  --shadow-sm: 0 1px 3px rgba(17, 17, 19, .06);
  --shadow: 0 12px 34px rgba(17, 17, 19, .10);
  --shadow-lg: 0 28px 80px rgba(17, 17, 19, .18);
  --r-sm: 10px;
  --r: 16px;
  --r-lg: 22px;
  --r-xl: 30px;
  --sans: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
body::before {
  content: "";
  position: fixed;
  inset: -30% -20% auto -20%;
  height: 70vh;
  background:
    radial-gradient(40% 55% at 18% 30%, rgba(17, 17, 19, .05), transparent 70%),
    radial-gradient(35% 50% at 82% 20%, rgba(17, 17, 19, .04), transparent 70%);
  pointer-events: none;
  z-index: 0;
}
#app { position: relative; z-index: 1; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
img { display: block; max-width: 100%; }
::selection { background: var(--accent-soft); color: var(--accent-dark); }

/* ---------- Layout ---------- */
.wrap { width: min(1240px, calc(100% - 40px)); margin-inline: auto; }
.wrap-narrow { width: min(640px, calc(100% - 40px)); margin-inline: auto; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(246, 245, 242, .86);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 68px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: -.02em; font-size: 17px; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 11px;
  background: var(--ink);
  color: #fff; display: grid; place-items: center;
  font-size: 17px; box-shadow: 0 6px 16px rgba(17, 17, 19, .24);
}
.brand-sub { font-weight: 500; color: var(--muted); font-size: 12px; letter-spacing: 0; }
.spacer { flex: 1; }
.top-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--line-2);
  background: var(--surface);
  color: var(--ink);
  padding: 10px 16px;
  border-radius: 999px;
  font-weight: 650;
  font-size: 14px;
  line-height: 1.2;
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease, border-color .16s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); border-color: var(--muted-2); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-primary {
  background: var(--ink);
  border-color: transparent; color: #fff;
  box-shadow: 0 8px 20px rgba(17, 17, 19, .22);
}
.btn-primary:hover { box-shadow: 0 12px 26px rgba(17, 17, 19, .30); border-color: transparent; }
.btn-coral { background: var(--ink); border-color: transparent; color: #fff; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--surface-2); color: var(--ink); box-shadow: none; }
.btn-danger { color: var(--danger); border-color: #f3c9c9; background: var(--danger-soft); }
.btn-sm { padding: 7px 12px; font-size: 13px; }
.btn-lg { padding: 14px 22px; font-size: 15px; }
.btn-icon { width: 38px; height: 38px; padding: 0; border-radius: 12px; }

/* ---------- Typography ---------- */
.eyebrow {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink); background: var(--accent-soft);
  padding: 6px 11px; border-radius: 999px;
}
h1, h2, h3, h4 { margin: 0; letter-spacing: -.03em; line-height: 1.25; }
h1 { font-size: clamp(30px, 5vw, 52px); font-weight: 850; }
h2 { font-size: clamp(22px, 3vw, 30px); font-weight: 800; }
h3 { font-size: 18px; font-weight: 750; }
p { margin: 0; }
.muted { color: var(--muted); }
.tiny { font-size: 12px; }
.small { font-size: 13px; }
.gradient-text {
  color: var(--ink);
}

/* ---------- Hero ---------- */
.hero { padding: 54px 0 26px; }
.hero-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 30px; flex-wrap: wrap; }
.hero h1 { margin-top: 16px; }
.hero p { color: var(--muted); margin-top: 12px; max-width: 560px; font-size: 15px; }
.date-pill {
  display: inline-flex; align-items: center; gap: 9px;
  background: var(--surface); border: 1px solid var(--line);
  padding: 10px 14px; border-radius: 999px; box-shadow: var(--shadow-sm);
  font-weight: 700; font-size: 14px;
}
.date-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ink); box-shadow: 0 0 0 4px var(--accent-soft); }

/* ---------- Toolbar ---------- */
.toolbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 16px 0 20px;
  position: sticky; top: 68px; z-index: 30;
  background: linear-gradient(var(--bg) 78%, rgba(246, 245, 242, 0));
}
.search {
  flex: 1 1 280px; min-width: 200px;
  display: flex; align-items: center; gap: 10px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 999px; padding: 0 16px; height: 44px;
  box-shadow: var(--shadow-sm);
  transition: border-color .15s, box-shadow .15s;
}
.search:focus-within { border-color: var(--ink); box-shadow: 0 0 0 4px var(--accent-soft); }
.search input { border: 0; outline: 0; background: transparent; width: 100%; font-size: 14px; color: var(--ink); }
.search input::placeholder { color: var(--muted-2); }
.search svg { flex: none; color: var(--muted); }
select.field, input.field, textarea.field {
  width: 100%; border: 1px solid var(--line); background: var(--surface);
  border-radius: var(--r-sm); padding: 11px 13px; outline: 0; color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
select.field:focus, input.field:focus, textarea.field:focus {
  border-color: var(--ink); box-shadow: 0 0 0 4px var(--accent-soft);
}
textarea.field { resize: vertical; min-height: 88px; line-height: 1.6; }
.field-sm { height: 44px; border-radius: 999px; padding-inline: 16px; width: auto; min-width: 140px; }
label.lbl { display: block; font-size: 12px; font-weight: 750; color: var(--muted); margin: 0 0 7px 2px; }

/* ---------- Chips ---------- */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 8px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-2);
  border-radius: 999px; padding: 8px 15px; font-size: 13px; font-weight: 700;
  white-space: nowrap; transition: all .16s ease;
}
.chip:hover { border-color: var(--ink); color: var(--ink); }
.chip.active { background: var(--ink); border-color: var(--ink); color: #fff; box-shadow: var(--shadow-sm); }
.chip .count { opacity: .55; margin-left: 5px; font-weight: 600; }
.chip-accent.active { background: var(--ink); border-color: var(--ink); }

/* ---------- Gallery grid ---------- */
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; padding-bottom: 60px; }
@media (max-width: 1040px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) { .grid { grid-template-columns: 1fr; gap: 16px; } }
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform .22s cubic-bezier(.2,.8,.2,1), box-shadow .22s ease;
  animation: rise .4s ease both;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.card-media { position: relative; aspect-ratio: 4 / 3; background: var(--surface-2); overflow: hidden; cursor: zoom-in; }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.card:hover .card-media img { transform: scale(1.035); }
.card-media::after {
  content: ""; position: absolute; inset: auto 0 0 0; height: 42%;
  background: linear-gradient(transparent, rgba(0,0,0,.22)); pointer-events: none;
}
.warehouse-tag {
  position: absolute; top: 12px; left: 12px; z-index: 2;
  background: rgba(255,255,255,.94); backdrop-filter: blur(8px);
  border-radius: 999px; padding: 6px 11px; font-size: 12px; font-weight: 800;
  box-shadow: 0 4px 12px rgba(0,0,0,.12); color: var(--ink);
}
.card-body { padding: 16px 17px 18px; }
.card-title { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 15px; margin-bottom: 10px; }
.card-title .bar { width: 3px; height: 15px; border-radius: 3px; background: var(--ink); }
.info-block { margin-top: 10px; }
.info-label {
  font-size: 10px; font-weight: 850; letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted-2); margin-bottom: 3px;
}
.info-text { font-size: 13.5px; color: var(--ink-2); white-space: pre-wrap; word-break: break-word; line-height: 1.65; }
.info-text.rules { color: var(--ink-2); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.tag { font-size: 11px; font-weight: 700; color: var(--ink); background: var(--accent-soft); border-radius: 6px; padding: 3px 8px; }
.card-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line); font-size: 11px; color: var(--muted-2); }

/* ---------- Empty / loading ---------- */
.empty { text-align: center; padding: 90px 20px; color: var(--muted); }
.empty-icon { font-size: 44px; margin-bottom: 14px; opacity: .7; }
.empty h3 { color: var(--ink); margin-bottom: 8px; }
.loader { display: grid; place-items: center; padding: 100px 20px; color: var(--muted); }
.spinner {
  width: 30px; height: 30px; border: 3px solid var(--line); border-top-color: var(--ink);
  border-radius: 50%; animation: spin .8s linear infinite; margin-bottom: 14px;
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* ---------- Auth / gate ---------- */
.gate-wrap { min-height: calc(100vh - 68px); display: grid; place-items: center; padding: 40px 0 80px; }
.gate {
  width: min(460px, 100%); background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r-xl);
  padding: 36px; box-shadow: var(--shadow-lg);
  animation: rise .5s ease both;
}
.gate .gate-icon {
  width: 56px; height: 56px; border-radius: 18px; display: grid; place-items: center;
  background: var(--ink); color: #fff;
  font-size: 26px; margin-bottom: 20px;
}
.gate h2 { margin-bottom: 8px; }
.gate p { color: var(--muted); font-size: 14px; margin-bottom: 24px; }
.form-row { margin-bottom: 16px; }
.form-row-inline { display: flex; gap: 10px; align-items: end; }
.form-row-inline .form-row { flex: 1; margin: 0; }
.form-error {
  background: var(--danger-soft); color: var(--danger); border-radius: var(--r-sm);
  padding: 10px 13px; font-size: 13px; margin-bottom: 14px; display: none;
}
.form-error.show { display: block; }
.divider { height: 1px; background: var(--line); margin: 24px 0; }
.hint-box { background: var(--surface-2); border-radius: var(--r-sm); padding: 13px 15px; font-size: 12.5px; color: var(--muted); line-height: 1.7; }

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(18, 18, 22, .55); backdrop-filter: blur(8px);
  display: none; align-items: center; justify-content: center; padding: 20px;
}
.modal-overlay.open { display: flex; animation: fade .18s ease both; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: var(--surface); border-radius: var(--r-xl); width: min(940px, 100%);
  max-height: min(90vh, 900px); overflow: auto; box-shadow: var(--shadow-lg);
  animation: pop .22s cubic-bezier(.2,.8,.2,1) both;
}
@keyframes pop { from { opacity: 0; transform: scale(.97) translateY(8px); } to { opacity: 1; transform: none; } }
.modal-head {
  display: flex; align-items: center; gap: 12px;
  padding: 20px 24px; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; background: var(--surface); z-index: 2;
}
.modal-head h3 { flex: 1; }
.modal-body { padding: 24px; }
.modal-foot { padding: 16px 24px; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.lightbox { background: #111114; color: #fff; width: min(1100px, 100%); }
.lightbox .modal-head { background: #111114; border-color: rgba(255,255,255,.12); }
.lightbox .modal-body { padding: 16px; background: #111114; text-align: center; }
.lightbox img { margin: auto; max-height: 68vh; border-radius: 12px; object-fit: contain; }
.lightbox-info { text-align: left; padding: 12px 10px 4px; }
.lightbox-info h3 { color: #fff; margin-bottom: 10px; }
.lightbox-info .info-text { color: #d6d6dd; }
.lightbox-info .info-label { color: #8b8b96; }

/* ---------- Admin ---------- */
.admin-shell { display: grid; grid-template-columns: 230px 1fr; gap: 28px; padding: 28px 0 80px; align-items: start; }
@media (max-width: 900px) { .admin-shell { grid-template-columns: 1fr; gap: 16px; } }
.sidebar {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 12px; box-shadow: var(--shadow-sm);
  position: sticky; top: 92px;
}
@media (max-width: 900px) { .sidebar { position: static; } }
.nav-item {
  width: 100%; text-align: left; border: 0; background: transparent;
  padding: 11px 14px; border-radius: 12px; font-weight: 700; font-size: 14px;
  color: var(--muted); display: flex; align-items: center; gap: 10px; margin-bottom: 3px;
}
.nav-item:hover { background: var(--surface-2); color: var(--ink); }
.nav-item.active { background: var(--ink); color: #fff; }
.nav-sep { height: 1px; background: var(--line); margin: 10px 6px; }
.panel { display: none; }
.panel.active { display: block; animation: rise .3s ease both; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.panel-head h2 { font-size: 25px; }
.panel-head p { color: var(--muted); font-size: 13px; margin-top: 5px; }
.box {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 22px; box-shadow: var(--shadow-sm); margin-bottom: 18px;
}
.box-title { font-weight: 800; font-size: 15px; margin-bottom: 6px; display: flex; align-items: center; gap: 8px; }
.box-desc { color: var(--muted); font-size: 12.5px; margin-bottom: 18px; }
.dropzone {
  border: 2px dashed var(--line-2); border-radius: var(--r); padding: 34px 20px;
  text-align: center; background: var(--surface-2); transition: all .18s ease; cursor: pointer;
}
.dropzone:hover, .dropzone.drag { border-color: var(--ink); background: var(--accent-soft); }
.dropzone .dz-icon { font-size: 34px; margin-bottom: 10px; }
.dropzone b { display: block; font-size: 15px; margin-bottom: 4px; }
.dropzone span { font-size: 12.5px; color: var(--muted); }
.hidden-input { display: none; }

/* Upload queue */
.queue { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; margin-top: 16px; }
.queue-item { position: relative; border-radius: 12px; overflow: hidden; aspect-ratio: 1; background: var(--surface-2); border: 1px solid var(--line); }
.queue-item img { width: 100%; height: 100%; object-fit: cover; }
.queue-item .qstate {
  position: absolute; inset: auto 0 0 0; background: rgba(0,0,0,.65); color: #fff;
  font-size: 10px; padding: 4px 6px; text-align: center;
}
.queue-item.error { border-color: var(--danger); }

/* Grouping board */
.group-toolbar {
  position: sticky; top: 68px; z-index: 26;
  padding: 12px; background: rgba(241, 240, 235, .96);
  backdrop-filter: blur(12px); border: 1px solid var(--line);
  border-radius: var(--r); margin-bottom: 14px;
  box-shadow: 0 6px 18px rgba(24,24,27,.05);
}
.group-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.group-toolbar .lbl-inline { font-size: 12px; font-weight: 800; color: var(--muted); margin-right: 2px; }
.group-toolbar .chip { padding: 7px 12px; font-size: 12.5px; }
.group-toolbar .chip.active { background: var(--ink); border-color: var(--ink); color: #fff; box-shadow: 0 6px 14px rgba(17,17,19,.22); }
.group-toolbar .chip.drop-hover {
  border-color: var(--ink); background: var(--accent-soft); color: var(--ink);
  transform: scale(1.06); box-shadow: 0 0 0 4px rgba(17,17,19,.10);
}
.group-hint { margin-top: 9px; font-size: 11.5px; color: var(--muted); line-height: 1.5; }
.group-stats { font-size: 12px; color: var(--muted); margin-left: auto; }
.group-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(145px, 1fr)); gap: 12px; }
@media (max-width: 620px) {
  .group-grid { grid-template-columns: repeat(auto-fill, minmax(108px, 1fr)); gap: 9px; }
  .group-toolbar { top: 64px; padding: 10px; }
}
.group-card {
  position: relative; border: 2px solid transparent; border-radius: 14px; overflow: hidden;
  background: var(--surface-2); cursor: pointer; transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
  touch-action: manipulation; -webkit-user-select: none; user-select: none;
}
.group-card:hover { box-shadow: var(--shadow); }
.group-card:active { transform: scale(.985); }
.group-card.selected { border-color: var(--ink); box-shadow: 0 0 0 3px var(--accent-soft); }
.group-card.dragging { opacity: .4; }
.group-card.pulse { animation: cardPulse .38s ease; }
@keyframes cardPulse {
  0% { transform: scale(1); }
  45% { transform: scale(1.045); box-shadow: 0 0 0 5px var(--accent-soft); }
  100% { transform: scale(1); }
}
.group-card img { width: 100%; aspect-ratio: 1; object-fit: cover; -webkit-user-drag: none; }
.group-card .check {
  position: absolute; top: 7px; left: 7px; z-index: 3;
  width: 24px; height: 24px; border-radius: 8px;
  background: rgba(255,255,255,.94); border: 1px solid var(--line-2);
  display: grid; place-items: center; font-size: 13px; color: transparent;
  box-shadow: 0 2px 6px rgba(0,0,0,.08);
}
@media (max-width: 620px) {
  .group-card .check { width: 28px; height: 28px; border-radius: 9px; font-size: 14px; }
}
.group-card.selected .check { background: var(--ink); border-color: var(--ink); color: #fff; }
.group-card .gname {
  position: absolute; inset: auto 0 0 0; padding: 6px 8px; font-size: 11px; font-weight: 800;
  color: #fff; background: linear-gradient(transparent, rgba(0,0,0,.8)); pointer-events: none;
}
.group-card .gname.empty-name { color: #ffd9cf; }
.text-apply { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 18px; }
@media (max-width: 700px) { .text-apply { grid-template-columns: 1fr; } }

/* Manage list */
.manage-list { display: flex; flex-direction: column; gap: 10px; }
.manage-row {
  display: flex; align-items: center; gap: 14px; padding: 10px;
  border: 1px solid var(--line); border-radius: 14px; background: var(--surface);
}
.manage-row img { width: 68px; height: 68px; border-radius: 10px; object-fit: cover; flex: none; background: var(--surface-2); }
.manage-main { flex: 1; min-width: 0; }
.manage-main .m-title { font-weight: 750; font-size: 14px; margin-bottom: 3px; }
.manage-main .m-sub { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.badge { display: inline-block; font-size: 10px; font-weight: 800; padding: 3px 8px; border-radius: 6px; background: var(--surface-2); color: var(--muted); }
.badge.on { background: var(--accent-soft); color: var(--ink); }
.badge.off { background: var(--amber-soft); color: var(--ink-2); }
.manage-actions { display: flex; gap: 6px; flex: none; }
@media (max-width: 620px) { .manage-row { flex-wrap: wrap; } .manage-actions { width: 100%; justify-content: flex-end; } }

/* Warehouse rows */
.wh-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.wh-row:last-child { border-bottom: 0; }
.wh-row input { flex: 1; }
.wh-num { width: 26px; height: 26px; border-radius: 8px; background: var(--surface-2); display: grid; place-items: center; font-size: 11px; font-weight: 800; color: var(--muted); }

/* Settings grid */
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 800px) { .settings-grid { grid-template-columns: 1fr; } }
.link-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 0; border-bottom: 1px dashed var(--line); }
.link-row:last-child { border: 0; }
.link-row b { display: block; font-size: 14px; }
.link-row span { font-size: 12px; color: var(--muted); }

/* Toast */
#toast-root { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast {
  background: var(--ink); color: #fff; border-radius: 999px; padding: 11px 18px;
  font-size: 13px; font-weight: 650; box-shadow: var(--shadow-lg);
  animation: toastIn .25s ease both; max-width: min(90vw, 520px); text-align: center;
}
.toast.ok { background: var(--ink); }
.toast.err { background: var(--danger); }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* Setup steps */
.steps { display: flex; gap: 8px; margin-bottom: 26px; }
.step { flex: 1; height: 5px; border-radius: 5px; background: var(--surface-3); }
.step.on { background: var(--ink); }
.step.done { background: var(--muted-2); }
.auth-tabs { display: flex; gap: 6px; background: var(--surface-2); padding: 4px; border-radius: 12px; margin-bottom: 18px; }
.auth-tabs button { flex: 1; border: 0; background: transparent; padding: 8px; border-radius: 9px; font-weight: 750; font-size: 13px; color: var(--muted); }
.auth-tabs button.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.progress-line { height: 6px; border-radius: 6px; background: var(--surface-3); overflow: hidden; margin: 8px 0; }
.progress-line > div { height: 100%; background: var(--ink); width: 0; transition: width .25s ease; }

/* ---------- 仓库分区（客户端） ---------- */
.wh-section { margin-bottom: 40px; }
.wh-section-head {
  display: flex; align-items: center; gap: 12px;
  margin: 18px 0 16px; padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.wh-section-title { display: flex; align-items: center; gap: 10px; }
.wh-section-title h2 { font-size: 22px; }
.wh-pin {
  width: 34px; height: 34px; border-radius: 10px; background: var(--ink); color: #fff;
  display: grid; place-items: center; font-size: 16px;
}
.wh-count {
  font-size: 12px; font-weight: 700; color: var(--muted);
  background: var(--surface-2); padding: 4px 10px; border-radius: 999px;
}

/* ---------- 后台仓库上传窗格 ---------- */
.warehouse-upload-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px;
}
.warehouse-upload-tile {
  position: relative; border: 2px solid var(--line); border-radius: var(--r);
  background: var(--surface); padding: 20px 14px; text-align: center; cursor: pointer;
  transition: all .18s ease; min-height: 130px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 8px;
}
.warehouse-upload-tile:hover {
  border-color: var(--ink); box-shadow: var(--shadow); transform: translateY(-3px);
}
.warehouse-upload-tile .wut-icon {
  width: 46px; height: 46px; border-radius: 13px; background: var(--surface-2);
  display: grid; place-items: center; font-size: 22px; color: var(--ink);
}
.warehouse-upload-tile b { font-size: 15px; }
.warehouse-upload-tile span { font-size: 11.5px; color: var(--muted); }
.warehouse-upload-tile.add-tile { border-style: dashed; color: var(--muted); }
.warehouse-upload-tile.add-tile:hover { color: var(--ink); }
@media (max-width: 620px) {
  .warehouse-upload-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .warehouse-upload-tile { min-height: 108px; padding: 14px 10px; }
}

.footer { padding: 26px 0 40px; text-align: center; color: var(--muted-2); font-size: 12px; }

/* ============================================================
   买家页面暗色主题（body.dark）
   ============================================================ */
body.dark {
  --bg: #0a0a0c;
  --surface: #141417;
  --surface-2: #1d1d21;
  --surface-3: #26262b;
  --ink: #f5f5f7;
  --ink-2: #d8d8de;
  --muted: #9a9aa3;
  --muted-2: #6c6c76;
  --line: #26262b;
  --line-2: #34343a;
  --accent: #f5f5f7;
  --accent-dark: #ffffff;
  --accent-soft: #26262b;
  color: var(--ink);
  background: var(--bg);
}
body.dark::before {
  background:
    radial-gradient(45% 50% at 18% 20%, rgba(245,245,247,.06), transparent 70%),
    radial-gradient(35% 45% at 82% 15%, rgba(245,245,247,.04), transparent 70%);
}
body.dark .topbar {
  background: rgba(10,10,12,.78);
  border-bottom: 1px solid #1d1d21;
}
body.dark .brand-mark { background: #f5f5f7; color: #0a0a0c; box-shadow: 0 6px 18px rgba(0,0,0,.5); }
body.dark .eyebrow { color: #f5f5f7; background: #1d1d21; }
body.dark .hero h1 { color: #fff; }
body.dark .hero p { color: var(--muted); }
body.dark .gradient-text { color: #fff; }
body.dark .date-pill { background: #1d1d21; border-color: #26262b; color: #d8d8de; }
body.dark .date-pill .dot { background: #7cffc4; box-shadow: 0 0 0 4px rgba(124,255,196,.12); }
body.dark .toolbar { background: transparent; }
body.dark .search { background: #141417; border-color: #26262b; color: #f5f5f7; }
body.dark .search input { color: #f5f5f7; }
body.dark .search input::placeholder { color: #6c6c76; }
body.dark .search:focus-within { border-color: #f5f5f7; box-shadow: 0 0 0 4px rgba(245,245,247,.08); }
body.dark select.field { background: #141417; border-color: #26262b; color: #f5f5f7; }

/* 多排网格：电脑 2 列、手机 1 列 */
body.dark .grid { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 20px; }
@media (max-width: 620px) { body.dark .grid { grid-template-columns: 1fr; gap: 14px; } }

body.dark .card {
  background: #141417;
  border-color: #222226;
  box-shadow: 0 8px 24px rgba(0,0,0,.35);
}
body.dark .card:hover { box-shadow: 0 16px 40px rgba(0,0,0,.55); }
body.dark .card-media { background: #1d1d21; }
body.dark .card-media::after { background: linear-gradient(transparent, rgba(0,0,0,.5)); }
body.dark .card-body { background: #141417; }
body.dark .info-label { color: #6c6c76; }
body.dark .info-text { color: #d8d8de; }
body.dark .tag { color: #f5f5f7; background: #26262b; }

/* 卡片上的产品名浮层（替代文件名） */
.card-name {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
  padding: 26px 12px 10px; font-size: 13px; font-weight: 700; color: #fff;
  background: linear-gradient(transparent, rgba(0,0,0,.72));
  pointer-events: none; letter-spacing: .01em;
}

/* 仓库分区头部 */
body.dark .wh-section-head { border-bottom-color: #222226; }
body.dark .wh-section-title h2 { color: #fff; }
body.dark .wh-pin { background: #f5f5f7; color: #0a0a0c; }
body.dark .wh-count { background: #1d1d21; color: #9a9aa3; }
body.dark .footer { color: #55555e; }

/* 门禁页（口令）暗色 */
body.dark .gate { background: #141417; border-color: #26262b; box-shadow: 0 24px 60px rgba(0,0,0,.5); }
body.dark .gate h2 { color: #fff; }
body.dark .gate p { color: var(--muted); }
body.dark .gate .gate-icon { background: #f5f5f7; color: #0a0a0c; }
body.dark .field { background: #1d1d21; border-color: #2a2a30; color: #f5f5f7; }
body.dark .field::placeholder { color: #6c6c76; }
body.dark .field:focus { border-color: #f5f5f7; }
body.dark .hint-box { background: #1d1d21; color: #9a9aa3; }
body.dark .divider { border-color: #26262b; }
body.dark .form-error { background: #2a1517; color: #ff8a8a; }
body.dark .btn-primary { background: #f5f5f7; color: #0a0a0c; box-shadow: 0 8px 20px rgba(0,0,0,.4); }
body.dark .btn { border-color: #34343a; color: #d8d8de; background: #1d1d21; }
body.dark .btn:hover { border-color: #55555e; }

/* 大图弹窗 */
body.dark .modal { background: #0f0f12; border-color: #26262b; }
body.dark .modal-head { border-bottom-color: #222226; }
body.dark .modal-head h3 { color: #fff; }
body.dark .lightbox-info { color: #d8d8de; }

/* 空状态 / 加载 */
body.dark .empty h3 { color: #fff; }
body.dark .spinner { border-color: #2a2a30; border-top-color: #f5f5f7; }

/* 回到顶部按钮 */
.back-top {
  position: fixed; right: 22px; bottom: 26px; z-index: 60;
  width: 46px; height: 46px; border-radius: 50%;
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--line); box-shadow: var(--shadow);
  font-size: 20px; font-weight: 800; cursor: pointer;
  opacity: 0; pointer-events: none; transform: translateY(12px);
  transition: opacity .25s ease, transform .25s ease;
}
.back-top.show { opacity: 1; pointer-events: auto; transform: translateY(0); }
body.dark .back-top { background: #1d1d21; color: #f5f5f7; border-color: #34343a; box-shadow: 0 10px 28px rgba(0,0,0,.5); }

/* ============================================================
   移动端体验优化
   ============================================================ */
@media (max-width: 620px) {
  .topbar-inner { min-height: 58px; gap: 10px; }
  .brand { font-size: 15px; }
  .brand-sub { font-size: 11px; }
  .brand-mark { width: 30px; height: 30px; border-radius: 9px; font-size: 15px; }

  .hero { padding: 30px 0 16px; }
  .hero h1 { font-size: 24px; margin-top: 10px; letter-spacing: -.02em; }
  .hero p { font-size: 13.5px; margin-top: 8px; }
  .date-pill { font-size: 12px; padding: 8px 12px; }
  .eyebrow { font-size: 10px; padding: 5px 9px; }

  .toolbar { gap: 8px; }
  .toolbar .search { flex: 1 1 100%; }
  .toolbar select.field { flex: 1; }

  .wh-section { margin-bottom: 28px; }
  .wh-section-title h2 { font-size: 18px; }
  .wh-pin { width: 28px; height: 28px; border-radius: 8px; font-size: 14px; }
  .wh-count { font-size: 11px; padding: 3px 8px; }

  /* 卡片紧凑 */
  body.dark .grid { gap: 14px; }
  .card-body { padding: 12px 12px 14px; }
  .info-text { font-size: 12.5px; line-height: 1.55; }
  .card-name { font-size: 12px; padding: 22px 9px 8px; }

  /* 大图弹窗铺满 */
  .modal-overlay { padding: 0; }
  .modal { border-radius: 0; width: 100%; height: 100dvh; max-height: 100dvh; }
  .modal-head { padding: 16px; }
  .modal-body { padding: 14px; }
  .modal-foot { padding: 14px 16px; position: sticky; bottom: 0; }
  .lightbox { width: 100%; }
  .lightbox .modal-body { display: flex; flex-direction: column; }
  .lightbox img { max-height: 52vh; }
  .lightbox-info { max-height: 32vh; overflow: auto; padding: 12px 6px 4px; }
  .modal-foot .btn { flex: 1; }

  /* 回到顶部按钮位置适配 */
  .back-top { right: 14px; bottom: 16px; width: 42px; height: 42px; font-size: 18px; }
}

/* ---------- 仓库管理：规则编辑卡片 ---------- */
.wh-card {
  border: 1px solid var(--line); border-radius: var(--r);
  padding: 8px 14px 14px; margin-bottom: 12px; background: var(--surface);
}
.wh-card .wh-row { border-bottom: 0; }
.wh-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding-top: 4px; }
.wh-fields .form-row { margin-bottom: 0; }
.wh-fields .lbl { font-size: 11px; color: var(--muted); }
@media (max-width: 620px) { .wh-fields { grid-template-columns: 1fr; } }

/* ---------- 客户端：仓库规则展示 ---------- */
.wh-rules {
  display: flex; flex-direction: column; gap: 10px;
  margin: 0 0 18px; padding: 14px 16px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
}
.wh-rule { display: flex; align-items: flex-start; gap: 12px; }
.wh-rule-label {
  flex: 0 0 auto; font-size: 11px; font-weight: 800; letter-spacing: .08em;
  color: var(--muted-2); background: var(--surface-2);
  padding: 4px 10px; border-radius: 999px; margin-top: 1px; white-space: nowrap;
}
.wh-rule-text { font-size: 13.5px; color: var(--ink-2); line-height: 1.65; white-space: pre-wrap; word-break: break-word; }

/* 暗色主题 */
body.dark .wh-rules { background: #141417; border-color: #222226; }
body.dark .wh-rule-label { background: #1d1d21; color: #9a9aa3; }
body.dark .wh-rule-text { color: #d8d8de; }
