:root {
  --green: #1f6b4a;
  --green-soft: #e7f4ec;
  --ink: #1c241e;
  --muted: #6b746e;
  --line: #e6eee8;
  --card: #ffffff;
  --danger: #b42318;
  --warn: #b54708;
  --ship: #175cd3;
  --ok: #1f6b4a;
  --shadow: 0 10px 28px rgba(31, 107, 74, 0.08);
  --radius: 18px;
  --tab-h: 68px;
}
* { box-sizing: border-box; }
html, body {
  margin: 0;
  min-height: 100%;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1200px 420px at 8% -8%, #e8f7ee 0%, transparent 55%),
    radial-gradient(900px 360px at 110% 0%, #fff8e4 0%, transparent 48%),
    #f4f7f5;
}
[hidden] { display: none !important; }
button, input { font: inherit; }
button { border: 0; background: none; }
.logo { display: block; object-fit: contain; }
.logo-lg { width: 168px; height: auto; margin: 0 auto 12px; }
.logo-top { width: 40px; height: 40px; }
.logo-md { width: 72px; height: 72px; }
.eyebrow { margin: 0 0 6px; letter-spacing: 0.14em; font-size: 11px; color: #8a6a32; }
h1 { margin: 0; font-size: 24px; }
h2 { margin: 0; font-size: 16px; }
.sec { margin: 16px 0 8px; font-size: 14px; color: var(--muted); }
.sub { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.msg { min-height: 20px; font-size: 13px; margin: 8px 0; }
.msg.err { color: var(--danger); }
.msg.ok { color: var(--green); }
.foot { color: #8a8379; font-size: 12px; text-align: center; }

.login-page { max-width: 420px; margin: 0 auto; padding: calc(28px + env(safe-area-inset-top)) 22px 32px; }
.login-hero { text-align: center; margin-bottom: 22px; }
.panel, .shop-card, .stat, .kpi, .tile, .list-card, .card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.panel { padding: 18px; }
label { display: block; margin: 0 0 14px; font-size: 14px; font-weight: 600; }
input[type="text"], input[type="password"], .search {
  display: block;
  width: 100%;
  margin-top: 8px;
  height: 48px;
  padding: 0 14px;
  border: 1px solid #d7e3d9;
  border-radius: 12px;
  background: #fff;
  font-size: 16px;
}
.search { margin: 0 0 10px; }
.agree { display: flex; align-items: center; gap: 10px; font-weight: 400; color: #4d463d; }
.agree input { width: 20px; height: 20px; }
#submit {
  width: 100%; height: 52px; border-radius: 14px;
  background: var(--green); color: #fff; font-size: 17px; font-weight: 700;
}
button[disabled] { opacity: 0.55; }

#appShell {
  max-width: 420px;
  margin: 0 auto;
  min-height: 100vh;
  padding-top: env(safe-area-inset-top);
  padding-bottom: calc(var(--tab-h) + env(safe-area-inset-bottom) + 10px);
}
.page { padding: 14px 16px 8px; }
.brandbar, .page-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}
.brandbar-txt { flex: 1; min-width: 0; }
.brandbar-txt strong { display: block; font-size: 18px; }
.brandbar-txt span { display: block; color: var(--muted); font-size: 12px; }
.page-head { justify-content: space-between; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 12px;
  background: #fff; display: grid; place-items: center; box-shadow: var(--shadow);
}
.icon-btn svg { width: 20px; height: 20px; fill: var(--green); }

.shop-card {
  display: flex; width: 100%; align-items: center; justify-content: space-between;
  padding: 16px; margin-bottom: 12px; text-align: left;
}
.shop-card strong { font-size: 18px; }
.go-shop, .chev { color: var(--green); font-size: 13px; font-weight: 600; white-space: nowrap; }
.chev { font-size: 22px; color: #98a39b; }

.stats, .kpis { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.stat, .kpi { padding: 14px 8px; text-align: center; }
.stat b, .kpi b { display: block; font-size: 22px; color: var(--green); word-break: break-all; }
.kpi b { font-size: 13px; color: var(--muted); font-weight: 600; }
.stat span, .kpi span { display: block; margin-top: 4px; font-size: 11px; color: var(--muted); }

.quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 16px 0; }
.quick-item {
  position: relative; background: #fff; border-radius: 16px;
  padding: 12px 4px 10px; box-shadow: var(--shadow);
}
.quick-item i, .tile i {
  display: grid; place-items: center; width: 36px; height: 36px; margin: 0 auto 6px;
  border-radius: 12px; font-style: normal; font-weight: 700; color: #fff;
}
.c-accept { background: #f79009; }
.c-pack { background: #dc6803; }
.c-ship { background: #175cd3; }
.c-done { background: var(--green); }
.quick-item span { font-size: 12px; }
.badge {
  position: absolute; top: 6px; right: 8px; min-width: 16px; height: 16px;
  padding: 0 4px; border-radius: 999px; background: #d92d20; color: #fff;
  font-size: 10px; line-height: 16px;
}
.block-head { display: flex; justify-content: space-between; align-items: center; margin: 8px 0 10px; }
.link, .text-btn { color: var(--green); font-size: 13px; font-weight: 600; }

.card {
  display: grid;
  grid-template-columns: 52px 1fr auto;
  gap: 4px 10px;
  padding: 12px;
  margin: 0 0 10px;
  align-items: center;
}
.card .thumb {
  grid-row: 1 / span 4;
  width: 52px; height: 52px; border-radius: 12px; object-fit: cover; background: var(--green-soft);
}
.card .no { font-size: 20px; font-weight: 800; }
.card .meta, .card .goods { color: var(--muted); font-size: 12px; }
.card .price { font-size: 16px; font-weight: 800; }
.st {
  justify-self: end; padding: 2px 8px; border-radius: 999px;
  background: #fff4e5; color: var(--warn); font-size: 12px;
}
.st.ship { background: #eff4ff; color: var(--ship); }
.st.done { background: var(--green-soft); color: var(--ok); }
.st.bad { background: #fee4e2; color: var(--danger); }
.card .go {
  grid-column: 3; grid-row: 3 / span 2;
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--green-soft); color: var(--green); font-size: 18px; justify-self: end;
}

.tabs { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 12px; -webkit-overflow-scrolling: touch; }
.tabs button {
  flex: 0 0 auto; padding: 8px 12px; border-radius: 999px;
  background: #fff; color: var(--muted); box-shadow: var(--shadow); font-size: 13px;
}
.tabs button.on { background: var(--green); color: #fff; }

.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.tile {
  min-height: 84px; padding: 10px 4px; font-size: 12px; font-weight: 700;
}
.list-card { overflow: hidden; }
.row-btn, .row-static {
  display: flex; width: 100%; justify-content: space-between; align-items: center;
  padding: 16px; border-top: 1px solid var(--line); text-align: left; background: #fff;
}
.row-btn:first-child { border-top: 0; }
.row-btn::after { content: "›"; color: #98a39b; font-size: 20px; }
.logout-btn {
  display: block; width: 100%; margin-top: 16px; height: 50px;
  border-radius: 14px; background: #fff; color: var(--danger);
  font-weight: 700; box-shadow: var(--shadow);
}
.me-hero { text-align: center; padding: 8px 0 18px; }
.me-hero .logo { margin: 0 auto 10px; }
.inbox { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.inbox-row {
  display: grid; grid-template-columns: 40px 1fr auto; gap: 10px;
  width: 100%; padding: 14px 16px; align-items: center; text-align: left;
  border-top: 1px solid var(--line); background: #fff;
}
.inbox-row:first-child { border-top: 0; }
.inbox-row i {
  width: 40px; height: 40px; border-radius: 12px;
  display: grid; place-items: center; color: #fff; font-style: normal; font-weight: 700;
}
.inbox-row strong { display: block; font-size: 15px; }
.inbox-row .sub { margin: 2px 0 0; }
.empty { color: var(--muted); line-height: 1.6; padding: 24px 8px; text-align: center; }
.no-xl { font-size: 36px; font-weight: 800; margin: 0 0 8px; color: var(--green); }
.detail p { margin: 0 0 10px; font-size: 15px; }
.detail .k { display: block; color: var(--muted); font-size: 12px; }
.goods-line { background: #fff; border-radius: 12px; padding: 10px 12px; margin: 0 0 8px; box-shadow: var(--shadow); }

.tabbar {
  position: fixed; left: 50%; bottom: 0; transform: translateX(-50%);
  width: 100%; max-width: 420px;
  height: calc(var(--tab-h) + env(safe-area-inset-bottom));
  padding: 6px 4px env(safe-area-inset-bottom);
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: rgba(255,255,255,.96);
  box-shadow: 0 -8px 24px rgba(20, 40, 20, 0.06);
}
.tabbar button {
  color: #6f776f; font-size: 11px;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.nav-ico {
  width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center;
}
.tabbar svg { width: 20px; height: 20px; fill: currentColor; }
.tabbar button.on { color: var(--green); font-weight: 700; }
.tabbar button.on .nav-ico { background: var(--green-soft); }
.search-row { display: flex; gap: 8px; align-items: center; }
.search-row .search { flex: 1; margin: 0; }
.sku-img { width: 64px; height: 64px; border-radius: 12px; object-fit: cover; background: var(--green-soft); margin-right: 10px; }
#instoreView { padding-bottom: 148px; }
.pay-ways { display: flex; flex-wrap: wrap; gap: 10px 14px; margin: 12px 0; }
.pay-way { display: flex; align-items: center; gap: 6px; font-size: 15px; }
.bcel-box {
  background: #fff;
  border: 1.5px solid var(--green);
  border-radius: var(--radius);
  padding: 14px 14px 8px;
  margin: 0 0 12px;
}
.bcel-box h2 { margin: 0 0 8px; font-size: 17px; }
.bcel-box p { margin: 6px 0; font-size: 15px; }
.bcel-hint { color: #4a5c52; font-size: 13px !important; line-height: 1.45; }
.evidence-box { margin-top: 14px; }
.evidence-img { display: block; width: 100%; max-height: 180px; object-fit: cover; border-radius: 12px; margin: 8px 0; background: #eef6f1; }
.secondary-btn {
  display: block; width: 100%; height: 48px; margin: 8px 0;
  border-radius: 14px; background: #fff; color: var(--green);
  border: 1.5px solid var(--green); font-size: 16px; font-weight: 700;
}
.cart-row {
  position: relative;
  display: grid; grid-template-columns: 56px 1fr auto; gap: 8px; align-items: center;
  background: var(--green-soft); border: 1.5px solid var(--green); border-radius: var(--radius);
  box-shadow: 0 8px 20px rgba(31, 107, 74, 0.16);
  padding: 12px; margin: 0 0 10px; width: 100%;
}
.cart-row img { width: 56px; height: 56px; border-radius: 12px; object-fit: cover; background: #fff; }
.cart-row .sku-check { position: absolute; top: 8px; right: 8px; min-height: 22px; padding: 0 8px; border-radius: 999px; background: var(--green); color: #fff; font-size: 12px; font-weight: 700; line-height: 22px; }
.cart-row .qty-row { margin: 8px 0 0; }
.cart-del { color: var(--danger); font-size: 13px; font-weight: 700; margin-top: 6px; }
.instore-action .primary-btn { margin: 8px 0 0; }
.instore-action {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  width: min(100%, 420px);
  bottom: calc(var(--tab-h) + env(safe-area-inset-bottom));
  z-index: 6;
  padding: 8px 16px 10px;
  background: rgba(244, 247, 245, 0.97);
  border-top: 1px solid var(--line);
  box-sizing: border-box;
}
.qty-row { display: flex; align-items: center; gap: 10px; margin: 4px 0 8px; }
.qty-row button { width: 40px; height: 40px; border-radius: 12px; background: #fff; box-shadow: var(--shadow); font-size: 22px; }
.qty-row input { width: 64px; height: 40px; text-align: center; border: 1px solid #d7e3d9; border-radius: 12px; font-size: 18px; }
.primary-btn {
  display: block; width: 100%; height: 52px; margin: 12px 0;
  border-radius: 14px; background: var(--green); color: #fff; font-size: 17px; font-weight: 700;
}
.primary-btn:disabled {
  background: #c5d4cb;
  color: #f3f7f4;
  box-shadow: none;
}
.selected-line { margin: 8px 0 0; font-size: 14px; color: var(--green); font-weight: 700; }
.recv { font-size: 22px; font-weight: 800; }
.recv b { color: var(--green); }
.okline { color: var(--green); font-weight: 700; }
.sku-card {
  position: relative;
  display: grid; grid-template-columns: 56px 1fr auto; gap: 8px; align-items: center;
  background: #fff; border: 1.5px solid #d7e3d9; border-radius: var(--radius);
  box-shadow: none; padding: 12px; margin: 0 0 10px; text-align: left; width: 100%;
}
.sku-card.selected {
  background: var(--green-soft);
  border-color: var(--green);
  box-shadow: 0 8px 20px rgba(31, 107, 74, 0.22);
}
.sku-card .sku-check {
  display: none;
  position: absolute; top: 8px; right: 8px;
  min-height: 22px; padding: 0 8px;
  border-radius: 999px; background: var(--green); color: #fff;
  font-size: 12px; font-weight: 700; line-height: 22px;
}
.sku-card.selected .sku-check { display: inline-block; }
.sku-card.selected .price { margin-top: 18px; }
.sku-card img { width: 56px; height: 56px; border-radius: 12px; object-fit: cover; background: var(--green-soft); }
.perm-row { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-top: 1px solid var(--line); }
.perm-row:first-child { border-top: 0; }
.toast {
  position: fixed; left: 50%; bottom: calc(var(--tab-h) + 24px);
  transform: translateX(-50%); background: #1c241e; color: #fff;
  padding: 10px 16px; border-radius: 999px; font-size: 13px; z-index: 20;
}
