/* ===================================================================
 * 拾货 SHIHUO · 设计令牌与外壳
 * =================================================================== */

:root {
  --font: "Inter", "PingFang SC", "HarmonyOS Sans SC", "Hiragino Sans GB",
          "Microsoft YaHei", system-ui, -apple-system, sans-serif;

  --bg: #F6F4F1;
  --bg-soft: #EDE9E2;
  --surface: #FFFFFF;
  --surface-2: #FAF8F5;

  --ink: #151318;
  --ink-2: #4B4852;
  --ink-3: #8C8794;

  --line: rgba(21, 19, 24, .075);
  --line-strong: rgba(21, 19, 24, .14);

  --brand: #5B4CFF;
  --brand-ink: #3B2EDB;
  --brand-soft: #EDEBFF;
  --accent: #FF6B3D;
  --accent-soft: #FFEEE7;
  --ok: #0B9E72;
  --ok-soft: #E2F6EF;
  --warn: #D9821F;
  --warn-soft: #FCEFDC;
  --danger: #DC3D43;
  --danger-soft: #FCEAEA;

  --r-xl: 26px;
  --r-lg: 20px;
  --r-md: 14px;
  --r-sm: 10px;

  --shadow-sm: 0 1px 2px rgba(21, 19, 24, .04);
  --shadow-md: 0 10px 30px -18px rgba(21, 19, 24, .28);
  --shadow-lg: 0 30px 70px -30px rgba(21, 19, 24, .38);

  --tab-h: 62px;
}

[data-theme="dark"] {
  --bg: #121116;
  --bg-soft: #1E1C24;
  --surface: #1A1920;
  --surface-2: #211F28;

  --ink: #F4F2F7;
  --ink-2: #B6B1C0;
  --ink-3: #7E7989;

  --line: rgba(255, 255, 255, .085);
  --line-strong: rgba(255, 255, 255, .17);

  --brand: #8B7DFF;
  --brand-ink: #B3A9FF;
  --brand-soft: #282352;
  --accent: #FF8154;
  --accent-soft: #3A241C;
  --ok: #2ED3A0;
  --ok-soft: #12302A;
  --warn: #F2B45C;
  --warn-soft: #33261A;
  --danger: #FF6E6E;
  --danger-soft: #3A1E20;

  --shadow-md: 0 10px 30px -18px rgba(0, 0, 0, .7);
  --shadow-lg: 0 30px 70px -30px rgba(0, 0, 0, .85);
}

/* ---------------- reset ---------------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  font-size: 14.5px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
body.lock { overflow: hidden; }
h1, h2, h3, h4, p { margin: 0; }
h1, h2, h3, h4 { font-weight: 600; letter-spacing: -.018em; line-height: 1.3; }
button, input, textarea, select { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
pre { margin: 0; }
img { max-width: 100%; display: block; }
::selection { background: var(--brand); color: #fff; }
.ico { width: 18px; height: 18px; flex: none; display: block; }

.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; letter-spacing: .01em; }
.muted { color: var(--ink-3); }
.sub { display: block; font-size: 11.5px; color: var(--ink-3); font-style: normal; margin-top: 2px; }
.brand-t { color: var(--brand-ink); }
.warn-t { color: var(--warn); }
.danger-t { color: var(--danger); }
.ok-t { color: var(--ok); }
.ta-r { text-align: right; }
.bad { color: var(--danger); }
.warn { color: var(--warn); }
.ok { color: var(--ok); }

/* ---------------- 骨架 ---------------- */
.app {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  min-height: 100vh;
}

/* ---------------- 侧栏 ---------------- */
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 18px 14px 14px;
  border-right: 1px solid var(--line);
  background: var(--surface);
  z-index: 40;
}
.sb-brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 20px; }
.sb-mark {
  width: 38px; height: 38px; border-radius: 12px;
  background: var(--brand); color: #fff;
  display: grid; place-items: center; flex: none;
  box-shadow: 0 8px 18px -10px rgba(91, 76, 255, .9);
}
.sb-mark svg { width: 22px; height: 22px; }
.sb-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.sb-text strong, .sb-text span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-text strong { font-size: 13.5px; letter-spacing: .01em; }
.sb-text span { font-size: 10.5px; color: var(--ink-3); letter-spacing: .04em; margin-top: 1px; }

.nav { flex: 1; overflow-y: auto; margin: 0 -4px; padding: 0 4px; }
.nav::-webkit-scrollbar { width: 0; }
.nav-g {
  font-size: 10.5px; color: var(--ink-3); letter-spacing: .08em;
  padding: 14px 10px 6px; font-weight: 500;
}
.nav-g.gap { height: 8px; padding: 0; }
.nav-a {
  display: flex; align-items: center; gap: 10px;
  height: 40px; padding: 0 10px; margin-bottom: 2px;
  border-radius: 12px; font-size: 13.5px; color: var(--ink-2);
  transition: background .16s, color .16s;
  position: relative;
}
.nav-a:hover { background: var(--surface-2); color: var(--ink); }
.nav-a.on { background: var(--brand-soft); color: var(--brand-ink); font-weight: 500; }
.nav-a.on::before {
  content: ""; position: absolute; left: -14px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 18px; border-radius: 0 3px 3px 0; background: var(--brand);
}
.nav-ico { display: grid; place-items: center; color: var(--ink-3); }
.nav-a.on .nav-ico { color: var(--brand); }
.nav-badge {
  margin-left: auto; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: var(--danger); color: #fff;
  font-size: 10.5px; font-style: normal; display: grid; place-items: center;
}

.side-foot { display: flex; flex-direction: column; gap: 10px; padding-top: 10px; }
.side-scan {
  display: flex; align-items: center; gap: 10px; text-align: left;
  padding: 12px; border-radius: 16px;
  background: linear-gradient(135deg, var(--brand), #7B5CFF 60%, #A05CFF);
  color: #fff;
  box-shadow: 0 14px 28px -18px rgba(91, 76, 255, .95);
  transition: transform .18s, box-shadow .18s;
}
.side-scan:hover { transform: translateY(-1px); box-shadow: 0 18px 32px -18px rgba(91, 76, 255, 1); }
.side-scan-ico { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 10px; background: rgba(255, 255, 255, .18); }
.side-scan b { display: block; font-size: 13px; font-weight: 500; }
.side-scan i { font-size: 10.5px; opacity: .8; font-style: normal; }

.side-user { display: flex; align-items: center; gap: 9px; padding: 6px 6px 0; border-top: 1px solid var(--line); margin-top: 2px; }
.side-user-t { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.side-user-t b { font-size: 12.5px; font-weight: 500; }
.side-user-t i { font-size: 10.5px; color: var(--ink-3); font-style: normal; }

.avatar {
  width: 34px; height: 34px; border-radius: 11px; flex: none;
  display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent);
  font-size: 13px; font-weight: 600;
}
.avatar.sm { width: 30px; height: 30px; border-radius: 10px; font-size: 12px; }

.only-m { display: none !important; }

/* ---------------- 顶栏 ---------------- */
.shell { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 14px;
  height: 64px; padding: 0 24px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
@supports (backdrop-filter: blur(1px)) {
  .topbar { background: color-mix(in srgb, var(--bg) 84%, transparent); backdrop-filter: blur(16px); }
}
.top-title { min-width: 0; flex: 1; }
.top-title h1 { font-size: 17px; }
.top-sub { font-size: 11.5px; color: var(--ink-3); margin-top: 1px; }
.top-actions { display: flex; align-items: center; gap: 6px; }

.search {
  display: flex; align-items: center; gap: 8px;
  height: 38px; width: 268px; padding: 0 10px;
  border-radius: 12px; background: var(--surface);
  border: 1px solid var(--line); color: var(--ink-3);
  transition: border-color .16s, box-shadow .16s;
}
.search:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 13px; color: var(--ink); }
.search input::placeholder { color: var(--ink-3); }
.search kbd {
  border: 1px solid var(--line); border-radius: 6px; padding: 0 5px;
  font-size: 10.5px; color: var(--ink-3); font-family: var(--font);
}
.search.inline { width: 100%; max-width: 300px; }

.icon-btn {
  width: 38px; height: 38px; border-radius: 12px;
  display: grid; place-items: center; color: var(--ink-2);
  border: 1px solid transparent; transition: background .16s, border-color .16s, color .16s;
  position: relative;
}
.icon-btn:hover { background: var(--surface); border-color: var(--line); color: var(--ink); }
.icon-btn.xs { width: 26px; height: 26px; border-radius: 8px; }
.icon-btn.xs .ico { width: 14px; height: 14px; }
.dot {
  position: absolute; top: 8px; right: 9px;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--danger); border: 2px solid var(--bg);
}

/* ---------------- 内容区 ---------------- */
.view {
  flex: 1;
  width: 100%;
  max-width: 1500px;
  margin: 0 auto;
  padding: 20px 24px 48px;
  outline: none;
}
.view.in > * { animation: rise .34s cubic-bezier(.2, .9, .3, 1) both; }
.view.in > *:nth-child(2) { animation-delay: .04s; }
.view.in > *:nth-child(3) { animation-delay: .07s; }
.view.in > *:nth-child(4) { animation-delay: .1s; }
@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .view.in > * { animation: none; }
}

/* ---------------- 通用组件 ---------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 18px;
  box-shadow: var(--shadow-sm);
}
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-head h3 { font-size: 14.5px; }
.card-head p { font-size: 11.5px; color: var(--ink-3); margin-top: 2px; }
.link {
  display: inline-flex; align-items: center; gap: 2px;
  font-size: 12px; color: var(--ink-3);
}
.link:hover { color: var(--brand); }
.link .ico { width: 13px; height: 13px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 40px; padding: 0 15px; border-radius: 13px;
  font-size: 13.5px; font-weight: 500; color: var(--ink-2);
  border: 1px solid transparent; white-space: nowrap;
  transition: transform .16s, background .16s, box-shadow .16s, border-color .16s;
}
.btn:active { transform: scale(.98); }
.btn .ico { width: 16px; height: 16px; }
.btn.primary { background: var(--brand); color: #fff; box-shadow: 0 10px 22px -14px rgba(91, 76, 255, .95); }
.btn.primary:hover { background: var(--brand-ink); transform: translateY(-1px); }
.btn.soft { background: var(--brand-soft); color: var(--brand-ink); }
.btn.soft:hover { background: color-mix(in srgb, var(--brand) 18%, var(--brand-soft)); }
.btn.ghost { border-color: var(--line-strong); color: var(--ink-2); }
.btn.ghost:hover { background: var(--surface-2); border-color: var(--ink-3); }
.btn.danger { background: var(--danger); color: #fff; }
.btn.sm { height: 34px; padding: 0 12px; font-size: 12.5px; border-radius: 11px; }
.btn.sm .ico { width: 14px; height: 14px; }
.btn.wide { width: 100%; }

.pill {
  display: inline-flex; align-items: center; gap: 5px;
  height: 24px; padding: 0 9px; border-radius: 8px;
  font-size: 11.5px; font-weight: 500; white-space: nowrap;
}
.pill i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.danger { background: var(--danger-soft); color: var(--danger); }
.pill.brand { background: var(--brand-soft); color: var(--brand-ink); }
.pill.muted { background: var(--bg-soft); color: var(--ink-3); }

.chips { display: flex; gap: 7px; flex-wrap: wrap; }
.chip {
  height: 32px; padding: 0 13px; border-radius: 11px;
  font-size: 12.5px; color: var(--ink-2);
  border: 1px solid var(--line); background: var(--surface);
  transition: .16s;
}
.chip:hover { border-color: var(--line-strong); }
.chip.on { background: var(--ink); color: var(--bg); border-color: var(--ink); font-weight: 500; }

/* 表格 */
.tbl-wrap { overflow-x: auto; margin: 0 -4px; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th {
  text-align: left; font-weight: 500; font-size: 11.5px; color: var(--ink-3);
  padding: 0 10px 10px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.tbl td { padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .row-click { cursor: pointer; }
.tbl .row-click:hover td { background: var(--surface-2); }

.cell-prod { display: flex; align-items: center; gap: 10px; }
.cell-prod b { font-size: 13px; font-weight: 500; display: block; }
.cell-prod i { font-size: 11px; color: var(--ink-3); font-style: normal; }
.loc {
  display: inline-block; padding: 2px 7px; border-radius: 7px;
  background: var(--bg-soft); font-size: 11.5px; color: var(--ink-2);
  font-family: ui-monospace, Menlo, monospace;
}

/* 品类色块 */
.ptile {
  --h: 210;
  width: 40px; height: 40px; border-radius: 12px; flex: none;
  display: grid; place-items: center;
  background: hsl(var(--h) 88% 96%);
  color: hsl(var(--h) 58% 44%);
  border: 1px solid hsl(var(--h) 60% 91%);
}
.ptile svg { width: 56%; height: 56%; }
.ptile.xs { width: 30px; height: 30px; border-radius: 9px; }
.ptile.md { width: 46px; height: 46px; border-radius: 14px; }
.ptile.lg { width: 64px; height: 64px; border-radius: 18px; }
[data-theme="dark"] .ptile {
  background: hsl(var(--h) 34% 20%);
  color: hsl(var(--h) 78% 76%);
  border-color: hsl(var(--h) 30% 28%);
}

.barcode { display: block; width: 100%; height: 100%; color: var(--ink); opacity: .82; }

/* 空状态 */
.empty {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 34px 16px; text-align: center; color: var(--ink-3);
}
.empty .ico { width: 30px; height: 30px; opacity: .5; }
.empty b { font-size: 13.5px; color: var(--ink-2); font-weight: 500; margin-top: 4px; }
.empty p { font-size: 12px; max-width: 260px; }
.empty .btn { margin-top: 10px; }

/* Toast */
.toasts {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%);
  display: flex; flex-direction: column; gap: 8px; z-index: 200;
  pointer-events: none; width: max-content; max-width: calc(100% - 32px);
}
.toast {
  display: flex; align-items: center; gap: 9px;
  padding: 11px 15px; border-radius: 14px;
  background: var(--ink); color: var(--bg);
  font-size: 13px; box-shadow: var(--shadow-lg);
  opacity: 0; transform: translateY(14px) scale(.95);
  transition: opacity .28s, transform .28s cubic-bezier(.2, .9, .3, 1);
}
.toast.in { opacity: 1; transform: none; }
.toast .ico { width: 17px; height: 17px; }
.toast.ok .ico { color: #5BE3B0; }
.toast.warn .ico { color: #FFC46B; }
.toast.err .ico { color: #FF8A8A; }

/* 弹层 */
.scrim {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(14, 12, 18, .44);
  opacity: 0; pointer-events: none; transition: opacity .26s;
}
.scrim.open { opacity: 1; pointer-events: auto; }
.layer {
  position: fixed; z-index: 90;
  background: var(--surface);
  display: flex; flex-direction: column;
  opacity: 0; pointer-events: none;
  transition: transform .34s cubic-bezier(.2, .9, .3, 1), opacity .22s;
}
.layer.sheet {
  right: 0; top: 0; height: 100%;
  width: min(470px, 100%);
  border-left: 1px solid var(--line);
  transform: translateX(30px);
}
.layer.sheet.open { transform: none; opacity: 1; pointer-events: auto; }
.layer.modal {
  left: 50%; top: 50%; width: min(430px, calc(100% - 32px));
  max-height: 84vh; border-radius: 22px; box-shadow: var(--shadow-lg);
  transform: translate(-50%, -50%) scale(.95);
}
.layer.modal.open { transform: translate(-50%, -50%) scale(1); opacity: 1; pointer-events: auto; }

.layer-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 18px 18px 14px; border-bottom: 1px solid var(--line);
}
.layer-head h3 { font-size: 15.5px; }
.layer-head p { font-size: 11.5px; color: var(--ink-3); margin-top: 2px; }
.layer-body { padding: 16px 18px; overflow-y: auto; flex: 1; overscroll-behavior: contain; }
.layer-body::-webkit-scrollbar { width: 8px; }
.layer-body::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 8px; }
.layer-foot {
  display: flex; gap: 10px; justify-content: flex-end;
  padding: 13px 18px; border-top: 1px solid var(--line);
  background: var(--surface-2);
}
.confirm-msg { font-size: 13.5px; color: var(--ink-2); line-height: 1.7; }
.hint-line { font-size: 11.5px; color: var(--ink-3); margin-top: 10px; }
.input {
  width: 100%; height: 44px; padding: 0 14px;
  border-radius: 13px; border: 1px solid var(--line-strong);
  background: var(--surface-2); outline: none; font-size: 14px;
}
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.input.big { height: 52px; font-size: 17px; letter-spacing: .06em; }

/* 移动端导航抽屉 */
.nav-sheet { display: flex; flex-direction: column; gap: 2px; }
.ns-item {
  display: flex; align-items: center; gap: 12px;
  height: 50px; padding: 0 12px; border-radius: 14px;
  font-size: 14.5px; color: var(--ink-2);
}
.ns-item .ico:last-child { margin-left: auto; width: 15px; height: 15px; color: var(--ink-3); }
.ns-item.on { background: var(--brand-soft); color: var(--brand-ink); font-weight: 500; }
.ns-foot {
  display: flex; align-items: center; gap: 7px;
  font-size: 11.5px; color: var(--ink-3);
  padding: 16px 12px 4px; border-top: 1px solid var(--line); margin-top: 10px;
}
.ns-foot .ico { width: 14px; height: 14px; }

/* ---------------- 底部标签栏 ---------------- */
.tabbar { display: none; }

/* ---------------- 响应式 ---------------- */
@media (max-width: 1023px) and (min-width: 768px) {
  .app { grid-template-columns: 78px minmax(0, 1fr); }
  .sidebar { padding: 16px 10px 12px; align-items: center; }
  .sb-brand { padding: 2px 0 16px; justify-content: center; }
  .sb-text { display: none; }
  .nav { width: 100%; }
  .nav-g { padding: 10px 0 4px; text-align: center; font-size: 9px; letter-spacing: 0; }
  .nav-a { justify-content: center; padding: 0; height: 44px; border-radius: 13px; }
  .nav-a > span:last-child { display: none; }
  .nav-a.on::before { display: none; }
  .nav-ico .ico { width: 20px; height: 20px; }
  .nav-badge { position: absolute; top: 6px; right: 8px; }
  .side-scan { justify-content: center; padding: 10px 0; border-radius: 14px; }
  .side-scan > span:last-child { display: none; }
  .side-user { flex-direction: column; gap: 6px; border: 0; }
  .side-user-t { display: none; }
  .search { width: 200px; }
}

@media (max-width: 767px) {
  body { font-size: 14px; }
  .app { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .topbar { height: 56px; padding: 0 14px; gap: 8px; }
  .top-title h1 { font-size: 16px; }
  .top-sub { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 58vw; }
  .search { display: none; }
  .only-d { display: none !important; }
  .only-m { display: grid !important; }
  .view { padding: 14px 14px calc(var(--tab-h) + 28px + env(safe-area-inset-bottom)); }

  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr);
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    height: calc(var(--tab-h) + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    background: var(--surface);
    border-top: 1px solid var(--line);
    box-shadow: 0 -8px 24px -20px rgba(21, 19, 24, .5);
  }
  .tabbar > a, .tabbar > button {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 3px; font-size: 10.5px; color: var(--ink-3); position: relative;
  }
  .tabbar .ico { width: 21px; height: 21px; }
  .tabbar i { font-style: normal; }
  .tabbar [data-tab].on { color: var(--brand); }
  .tab-scan { overflow: visible; }
  .tab-scan-btn {
    position: absolute; top: -18px;
    width: 52px; height: 52px; border-radius: 18px;
    display: grid; place-items: center;
    background: linear-gradient(140deg, var(--brand), #8A6BFF 70%, var(--accent));
    color: #fff;
    box-shadow: 0 14px 26px -12px rgba(91, 76, 255, .95);
    border: 4px solid var(--surface);
  }
  .tab-scan-btn .ico { width: 24px; height: 24px; }
  .tabbar .tab-scan i { margin-top: 26px; }

  /* 弹层 → 底部抽屉 */
  .layer.sheet {
    top: auto; bottom: 0; left: 0; right: 0; height: auto;
    max-height: 90vh; width: 100%;
    border-left: 0; border-top: 1px solid var(--line);
    border-radius: 24px 24px 0 0;
    transform: translateY(100%);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .layer.sheet.open { transform: translateY(0); }
  .layer.sheet::before {
    content: ""; position: absolute; top: 7px; left: 50%; transform: translateX(-50%);
    width: 38px; height: 4px; border-radius: 4px; background: var(--line-strong);
  }
  .layer-head { padding: 20px 16px 12px; }
  .layer-body { padding: 14px 16px; }
  .layer-foot { padding: 12px 16px; }
  .layer-foot .btn { flex: 1; }

  .toasts { bottom: calc(var(--tab-h) + 18px + env(safe-area-inset-bottom)); }
  .btn { height: 42px; }
  .card { padding: 15px; border-radius: 18px; }
}

/* ===================================================================
 * 工作空间选择页（launcher）
 * =================================================================== */
.sb-brand {
  width: 100%;
  padding: 8px;
  border-radius: 14px;
  text-align: left;
  transition: background .16s;
}
.sb-brand:hover { background: var(--surface-2); }
.sb-caret { margin-left: auto; color: var(--ink-3); display: grid; place-items: center; }
.sb-caret .ico { width: 14px; height: 14px; }

body.launcher .sidebar,
body.launcher .topbar,
body.launcher .tabbar { display: none !important; }
body.launcher .app { grid-template-columns: 1fr; }
body.launcher .view { max-width: 1080px; padding: 0 24px 60px; }

.launch { padding-top: 6px; }
.launch-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 0 0; }
.launch-brand { display: flex; align-items: center; gap: 10px; }
.lb-t b { display: block; font-size: 15px; font-weight: 600; letter-spacing: .01em; }
.lb-t i { font-size: 10.5px; color: var(--ink-3); font-style: normal; letter-spacing: .04em; }

.launch-hero { padding: 44px 0 26px; }
.launch-hero h1 { font-size: 34px; letter-spacing: -.04em; margin: 10px 0 10px; }
.launch-sub { font-size: 13.5px; color: var(--ink-2); max-width: 640px; line-height: 1.85; }

.ws-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(252px, 1fr)); gap: 14px; }
.ws-card {
  position: relative; text-align: left;
  padding: 18px; border-radius: 20px;
  background: var(--surface); border: 1px solid var(--line);
  cursor: pointer; outline: none;
  transition: transform .18s, box-shadow .18s, border-color .18s;
}
.ws-card:hover, .ws-card:focus-visible {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--line-strong);
}
.ws-top { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.ws-badge {
  width: 38px; height: 38px; border-radius: 12px; flex: none;
  display: grid; place-items: center;
  background: hsl(var(--h) 88% 96%); color: hsl(var(--h) 58% 44%);
  border: 1px solid hsl(var(--h) 60% 91%);
}
.ws-badge svg { width: 20px; height: 20px; }
.ws-type {
  font-size: 11px; padding: 3px 8px; border-radius: 7px;
  background: var(--bg-soft); color: var(--ink-2);
}
.ws-del {
  margin-left: auto; width: 26px; height: 26px; border-radius: 8px;
  display: grid; place-items: center; color: var(--ink-3);
  opacity: 0; transition: opacity .16s, background .16s, color .16s;
}
.ws-card:hover .ws-del { opacity: 1; }
.ws-del:hover { background: var(--danger-soft); color: var(--danger); }
.ws-del .ico { width: 14px; height: 14px; }
.ws-name { display: block; font-size: 15px; font-weight: 600; letter-spacing: -.01em; }
.ws-desc { font-size: 11.5px; color: var(--ink-3); margin-top: 4px; line-height: 1.6; }
.ws-stats {
  display: flex; gap: 14px; margin-top: 14px; padding-top: 12px;
  border-top: 1px dashed var(--line); font-size: 11.5px; color: var(--ink-3);
}
.ws-stats i { font-style: normal; font-weight: 600; color: var(--ink); margin-right: 3px; }
.ws-stats i.warn { color: var(--warn); }
.ws-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; }
.ws-val { font-size: 17px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.ws-go { display: inline-flex; align-items: center; gap: 2px; font-size: 12px; color: var(--brand-ink); }
.ws-go .ico { width: 13px; height: 13px; }

.ws-new {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; min-height: 200px; border-radius: 20px;
  border: 1.5px dashed var(--line-strong); color: var(--ink-2);
  transition: border-color .18s, background .18s, color .18s;
}
.ws-new:hover { border-color: var(--brand); background: var(--surface); color: var(--brand-ink); }
.ws-new-ico {
  width: 38px; height: 38px; border-radius: 12px;
  display: grid; place-items: center;
  background: var(--brand-soft); color: var(--brand); margin-bottom: 2px;
}
.ws-new b { font-size: 13.5px; font-weight: 500; }
.ws-new i { font-size: 11.5px; color: var(--ink-3); font-style: normal; }

.launch-foot {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  font-size: 11.5px; color: var(--ink-3); margin-top: 32px;
}
.launch-foot .ico { width: 13px; height: 13px; }

/* 模板选择 */
.tpl-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.tpl {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  padding: 12px; border-radius: 14px; text-align: left;
  border: 1px solid var(--line); background: var(--surface-2);
  transition: border-color .16s, background .16s, box-shadow .16s;
}
.tpl:hover { border-color: var(--line-strong); }
.tpl.on { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 3px var(--brand-soft); }
.tpl-ico {
  width: 30px; height: 30px; border-radius: 10px; margin-bottom: 4px;
  display: grid; place-items: center;
  background: hsl(var(--h) 88% 96%); color: hsl(var(--h) 58% 44%);
}
.tpl-ico svg { width: 16px; height: 16px; }
.tpl b { font-size: 12.5px; font-weight: 500; }
.tpl i { font-size: 10.5px; color: var(--ink-3); font-style: normal; line-height: 1.4; }

/* 无条码占位 */
.bc-none {
  display: flex; align-items: center; justify-content: center;
  height: 100%; font-size: 10.5px; color: var(--ink-3); line-height: 1.3;
}

[data-theme="dark"] .ws-badge,
[data-theme="dark"] .tpl-ico {
  background: hsl(var(--h) 30% 20%);
  color: hsl(var(--h) 78% 76%);
  border-color: hsl(var(--h) 26% 28%);
}

@media (max-width: 1023px) and (min-width: 768px) {
  .sb-caret { display: none; }
}

@media (max-width: 767px) {
  body.launcher .view { padding: 0 16px 40px; }
  .launch-head { padding-top: 14px; }
  .launch-hero { padding: 26px 0 18px; }
  .launch-hero h1 { font-size: 25px; }
  .launch-sub { font-size: 12.5px; line-height: 1.75; }
  .ws-grid { grid-template-columns: 1fr; gap: 10px; }
  .ws-card { padding: 15px; border-radius: 18px; }
  .ws-new { min-height: 108px; border-radius: 18px; }
  .ws-stats { margin-top: 11px; padding-top: 10px; }
  .ws-del { opacity: 1; }
  .tpl-grid { grid-template-columns: 1fr; }
  .tpl { flex-direction: row; align-items: center; gap: 9px; }
  .tpl-ico { margin-bottom: 0; }
}
