/* ============ 司麦采购 · redesign（2026-08-20 统一为司麦工作台深色规范） ============ */
:root {
  --bg: #0a0c10;
  --card: #14171c;
  --ink: #e4e4e7;
  --sub: #a1a1aa;
  --faint: #6b7280;
  --line: rgba(255,255,255,.08);
  --border: rgba(255,255,255,.08);
  --green: #34d399;
  --green-d: #6ee7b7;
  --green-t: rgba(52,211,153,.12);
  --ok: #34d399;
  --red: #f87171;
  --red-t: rgba(248,113,113,.12);
  --amber: #fbbf24;
  --amber-t: rgba(251,191,36,.12);
  --blue: #60a5fa;
  --blue-t: rgba(96,165,250,.14);
  --radius: 16px;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 4px 16px rgba(0,0,0,.35);
  --tabbar-h: 60px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", sans-serif;
  font-size: 15px;
  line-height: 1.45;
  overscroll-behavior-y: none;
}
button { font-family: inherit; border: none; background: none; padding: 0; cursor: pointer; color: inherit; }
input, select, textarea { font-family: inherit; font-size: 16px; color: var(--ink); outline: none; }

#app { max-width: 480px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; background: var(--bg); }
#view { flex: 1; padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 16px); }

/* ---------- 顶部 ---------- */
.page-head {
  position: sticky; top: 0; z-index: 20;
  background: rgba(244,246,243,.92);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  padding: calc(env(safe-area-inset-top) + 14px) 16px 10px;
  border-bottom: 1px solid transparent;
}
.page-head .title-row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.page-head h1 { font-size: 22px; font-weight: 700; margin: 0; letter-spacing: .02em; }
.page-head .date { font-size: 13px; color: var(--sub); white-space: nowrap; }
.demo-badge {
  display: inline-block; font-size: 11px; color: var(--amber); background: var(--amber-t);
  padding: 2px 8px; border-radius: 99px; margin-left: 8px; vertical-align: middle; font-weight: 500;
}

/* ---------- 底部 Tab ---------- */
#tabbar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px; z-index: 40;
  display: flex; height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
}
#tabbar .tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--faint); font-size: 11px; font-weight: 500;
  transition: color .15s;
}
#tabbar .tab svg { width: 23px; height: 23px; }
#tabbar .tab.active { color: var(--green-d); }
#tabbar .tab:active { opacity: .6; }

/* ---------- 通用控件 ---------- */
.seg {
  display: flex; background: #EAEDE8; border-radius: 12px; padding: 3px; gap: 3px;
}
.seg button {
  flex: 1; padding: 8px 0; border-radius: 9px; font-size: 14px; font-weight: 500; color: var(--sub);
  transition: all .15s;
}
.seg button.active { background: #fff; color: var(--ink); font-weight: 600; box-shadow: 0 1px 4px rgba(0,0,0,.08); }

.search-box {
  display: flex; align-items: center; gap: 8px;
  background: #EAEDE8; border-radius: 12px; padding: 9px 12px;
}
.search-box svg { width: 16px; height: 16px; color: var(--faint); flex: none; }
.search-box input { flex: 1; border: none; background: none; font-size: 15px; padding: 0; }
.search-box input::placeholder { color: var(--faint); }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 10px 16px 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; padding: 6px 13px; border-radius: 99px; font-size: 13px; font-weight: 500;
  background: #EAEDE8; color: var(--sub); transition: all .15s;
}
.chip .n { opacity: .65; font-size: 12px; margin-left: 3px; }
.chip.active { background: var(--ink); color: #fff; }

.btn-primary {
  background: var(--green); color: #fff; font-weight: 600; font-size: 16px;
  border-radius: 14px; padding: 13px 20px; transition: opacity .15s, transform .1s;
}
.btn-primary:active { transform: scale(.97); }
.btn-primary:disabled { background: #C7CEC6; }
.btn-ghost {
  background: #EFF2EE; color: var(--ink); font-weight: 500; font-size: 14px;
  border-radius: 12px; padding: 10px 16px;
}
.btn-danger { background: var(--red-t); color: var(--red); font-weight: 500; border-radius: 12px; padding: 10px 16px; font-size: 14px; }
.btn-icon { display: inline-flex; align-items: center; gap: 4px; }
.btn-icon svg { width: 14px; height: 14px; }

.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--line); }

.section { padding: 0 16px; margin-top: 14px; }
.hint-line { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--sub); padding: 8px 16px 0; }
.hint-line svg { width: 13px; height: 13px; }

/* ---------- 下单页 ---------- */
.store-seg { margin: 12px 16px 4px; }
.order-tools { position: sticky; top: calc(env(safe-area-inset-top) + 58px); z-index: 15; background: var(--bg); padding-top: 6px; }
.order-tools .search-box { margin: 0 16px; }
/* 搜索建议下拉 */
.search-suggest {
  position: absolute; left: 16px; right: 16px; top: calc(100% + 4px); z-index: 40;
  background: #14171c; border: 1px solid var(--line); border-radius: 12px;
  overflow: hidden; box-shadow: 0 16px 40px rgba(0,0,0,.55);
}
.suggest-item { display: block; width: 100%; padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--line); }
.suggest-item:last-child { border-bottom: 0; }
.suggest-item:active { background: rgba(255,255,255,.07); }
.suggest-item .nm { font-size: 14px; font-weight: 600; color: var(--ink); display: flex; align-items: center; gap: 6px; }
.suggest-item .mt { display: block; margin-top: 2px; font-size: 11px; color: var(--sub); }
.suggest-create .nm { color: var(--amber); font-weight: 500; }
.dish-row.hl { background: rgba(52,211,153,.22); transition: background .6s; }

.dish-row {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 16px; background: var(--card);
  border-bottom: 1px solid var(--line);
  transition: background .15s;
}
.dish-row:first-child { border-radius: var(--radius) var(--radius) 0 0; }
.dish-row:last-child { border-bottom: none; border-radius: 0 0 var(--radius) var(--radius); }
.dish-row:only-child { border-radius: var(--radius); }
.dish-row.picked { background: var(--green-t); }
.dish-row .info { flex: 1; min-width: 0; }
.dish-row .name { font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.spec-chip {
  font-size: 11px; font-weight: 500; color: var(--sub); background: #F0F2EE;
  padding: 1px 7px; border-radius: 6px;
}
.dish-row .prices { margin-top: 3px; font-size: 12px; color: var(--sub); display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.dish-row .prices b { color: var(--ink); font-weight: 600; }
.dish-row .prices .kl { color: var(--amber); }
.dish-row .prices .sep { color: var(--line); }

.qty-ctrl { display: flex; align-items: center; gap: 6px; flex: none; }
.qty-input {
  width: 58px; text-align: center; font-size: 16px; font-weight: 600;
  border: 1.5px solid var(--line); border-radius: 10px; padding: 7px 4px; background: #FAFBF9;
  transition: border-color .15s;
}
.qty-input:focus { border-color: var(--green); background: #fff; }
.qty-input.filled { border-color: var(--green); background: #fff; color: var(--green-d); }
.unit-btn {
  min-width: 44px; padding: 7px 8px; border-radius: 10px; font-size: 13px; font-weight: 500;
  background: #EFF2EE; color: var(--sub); text-align: center;
}
.unit-btn.filled { background: var(--green); color: #fff; }

.quick-add {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  margin: 12px 16px 0; padding: 12px; border-radius: var(--radius);
  border: 1.5px dashed #CDD4CB; color: var(--sub); font-size: 14px; font-weight: 500;
}
.quick-add svg { width: 16px; height: 16px; }
.quick-add:active { background: #EFF2EE; }

.order-bar {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  width: 100%; max-width: 480px; z-index: 30;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px;
  background: rgba(255,255,255,.97);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
}
.order-bar .sum { flex: 1; cursor: pointer; border-radius: 10px; padding: 6px 8px 6px 2px; margin: -6px 0 -6px -2px; transition: background .15s; }
.order-bar .sum:active { background: rgba(127,127,127,.14); }
.order-bar .sum .cnt { font-size: 13px; color: var(--sub); }
.order-bar .sum .total { font-size: 17px; font-weight: 700; }
.order-bar .sum .total small { font-size: 12px; font-weight: 500; color: var(--faint); margin-left: 4px; }
.order-bar .btn-primary { padding: 11px 28px; }

/* ---------- 价格页 ---------- */
.price-tabs { margin: 10px 16px 0; }
.price-row { padding: 13px 16px; background: var(--card); border-bottom: 1px solid var(--line); }
.price-row:first-child { border-radius: var(--radius) var(--radius) 0 0; }
.price-row:last-child { border-bottom: none; border-radius: 0 0 var(--radius) var(--radius); }
.price-row:only-child { border-radius: var(--radius); }
.price-row .top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.price-row .name { font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.price-row .meta { font-size: 11px; color: var(--faint); margin-top: 6px; }
.price-cells { display: flex; margin-top: 9px; border-radius: 10px; background: #F7F9F6; overflow: hidden; }
.price-cell { flex: 1; padding: 8px 10px; }
.price-cell + .price-cell { border-left: 1px solid var(--line); }
.price-cell .lab { font-size: 11px; color: var(--faint); margin-bottom: 2px; display: flex; align-items: center; gap: 4px; }
.price-cell .val { font-size: 15px; font-weight: 700; }
.price-cell .val .spec { font-size: 11px; font-weight: 400; color: var(--sub); margin-left: 3px; }
.price-cell .empty { color: var(--faint); font-weight: 400; font-size: 13px; }
.price-cell.editable .val { color: var(--green-d); }
.price-cell.editable:active { background: var(--green-t); }
.price-cell .lab svg { width: 11px; height: 11px; }

/* ---------- 菜品页 ---------- */
.dish-item { display: flex; align-items: center; gap: 11px; padding: 13px 16px; background: var(--card); border-bottom: 1px solid var(--line); }
.dish-item:first-child { border-radius: var(--radius) var(--radius) 0 0; }
.dish-item:last-child { border-bottom: none; border-radius: 0 0 var(--radius) var(--radius); }
.dish-item:only-child { border-radius: var(--radius); }
.dish-item:active { background: #F6F8F5; }
.cat-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.dish-item .nm { font-size: 15px; font-weight: 600; }
.dish-item .mt { font-size: 12px; color: var(--sub); margin-top: 1px; }
.dish-item .tag { margin-left: auto; font-size: 11px; color: var(--sub); background: #F0F2EE; padding: 3px 9px; border-radius: 99px; flex: none; }
.head-actions { display: flex; align-items: center; gap: 6px; }
.head-actions .btn-ghost { min-height: 36px; padding: 8px 10px; font-size: 12px; white-space: nowrap; }
.dish-catalog .dish-item { align-items: flex-start; }
.dish-catalog .cat-dot { margin-top: 7px; }
.dish-main { flex: 1; min-width: 0; }
.dish-title-line { display: flex; align-items: center; gap: 8px; min-width: 0; }
.dish-title-line .nm { flex: 1; min-width: 0; }
.dish-title-line .tag { margin-left: 0; }
.dish-market {
  display: grid; gap: 4px; margin-top: 9px; padding: 9px 10px;
  border-radius: 10px; background: #F5F8F4; color: var(--sub);
  font-size: 12px; line-height: 1.45;
}
.dish-market > span { display: flex; align-items: baseline; gap: 6px; min-width: 0; overflow-wrap: anywhere; }
.dish-market b { width: 42px; flex: none; color: var(--ink); font-size: 11px; font-weight: 650; }

/* ---------- 历史订单 ---------- */
.date-group { font-size: 13px; font-weight: 600; color: var(--sub); padding: 16px 16px 8px; }
.order-card { margin: 0 16px 10px; padding: 14px 16px; }
.order-card:active { opacity: .75; }
.order-card .r1 { display: flex; align-items: center; justify-content: space-between; }
.store-badge { font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 99px; }
.store-badge.jinsha { background: var(--green-t); color: var(--green-d); }
.store-badge.yuanzhu { background: #E8F0FB; color: #2B62B0; }
.store-badge.warehouse { background: rgba(251,191,36,.14); color: #d99a12; }
.supplier-sms-status { margin: 0 0 10px; padding: 8px 10px; border-radius: 9px; background: rgba(251,191,36,.1); color: var(--amber); font-size: 12px; line-height: 1.5; }
.supplier-sms-status.sent { background: var(--green-t); color: var(--green-d); }
.supplier-sms-status.failed { background: var(--red-t); color: var(--red); }
.order-card .amt { font-size: 17px; font-weight: 700; }
.order-card .r2 { margin-top: 5px; font-size: 12px; color: var(--sub); }

/* ---------- 订单卡片左滑操作 ---------- */
.swipe-wrap { --swipe-width: 76px; position: relative; margin: 0 16px 10px; overflow: hidden; border-radius: var(--radius); }
.swipe-wrap.has-edit { --swipe-width: 152px; }
.section > .swipe-wrap { margin-left: 0; margin-right: 0; }
.swipe-wrap .order-card { margin: 0; position: relative; z-index: 1; transition: transform .18s ease; user-select: none; -webkit-user-select: none; }
.swipe-wrap.open .order-card { transform: translateX(calc(-1 * var(--swipe-width))); }
.swipe-actions { position: absolute; top: 0; right: 0; bottom: 0; width: var(--swipe-width); display: flex; transform: translateX(100%); transition: transform .18s ease; }
.swipe-wrap.open .swipe-actions { transform: translateX(0); }
.swipe-edit, .swipe-del { width: 76px; min-height: 44px; display: flex; flex-direction: column; gap: 3px; align-items: center; justify-content: center; border: 0; font: inherit; font-size: 14px; font-weight: 650; cursor: pointer; }
.swipe-edit { color: #fff; background: var(--green-d); }
.swipe-edit svg, .swipe-del svg { width: 17px; height: 17px; }
.swipe-del { color: #fff; background: var(--red); }
.swipe-edit:active, .swipe-del:active { filter: brightness(.92); }
.swipe-del.disabled { background: #E3E6E2; color: #A0A7A1; }

.order-detail-items { margin-top: 4px; }
.od-row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.od-row:last-child { border-bottom: none; }
.od-row .q { color: var(--sub); white-space: nowrap; }
.od-row .s { color: var(--sub); font-size: 12px; white-space: nowrap; }
.copy-box {
  margin-top: 12px; background: #F6F8F5; border: 1px solid var(--line); border-radius: 12px;
  padding: 12px; font-size: 13px; white-space: pre-wrap; word-break: break-all; color: var(--sub);
  max-height: 180px; overflow-y: auto;
}

/* ---------- 表单 ---------- */
.form-row { margin-bottom: 14px; }
.form-row label { display: block; font-size: 13px; font-weight: 500; color: var(--sub); margin-bottom: 6px; }
.form-row input[type=text], .form-row input[type=number], .form-row input:not([type]), .form-row textarea, .form-row select {
  width: 100%; border: 1.5px solid var(--line); border-radius: 12px; padding: 11px 13px; background: #FAFBF9;
  transition: border-color .15s;
}
.form-row input:focus, .form-row textarea:focus, .form-row select:focus { border-color: var(--green); background: #fff; }
.form-row textarea { resize: none; min-height: 110px; font-size: 14px; line-height: 1.6; }
.form-2col { display: flex; gap: 10px; }
.form-2col .form-row { flex: 1; }
select.seg-select { width: 100%; }

.cat-picker { display: flex; gap: 8px; flex-wrap: wrap; }
.cat-picker button { padding: 8px 16px; border-radius: 99px; font-size: 14px; background: #EFF2EE; color: var(--sub); font-weight: 500; }
.cat-picker button.active { background: var(--ink); color: #fff; }

/* ---------- 底部弹层 Sheet ---------- */
.sheet-overlay {
  position: fixed; inset: 0; z-index: 60; background: rgba(20,24,20,.4);
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
.sheet-overlay.open { opacity: 1; pointer-events: auto; }
.sheet {
  position: fixed; left: 50%; transform: translate(-50%, 100%);
  bottom: 0; width: 100%; max-width: 480px; z-index: 61;
  background: #fff; border-radius: 20px 20px 0 0;
  padding: 10px 20px calc(env(safe-area-inset-bottom) + 20px);
  transition: transform .25s cubic-bezier(.32,.72,.35,1);
  max-height: 86vh; overflow-y: auto;
}
.sheet.open { transform: translate(-50%, 0); }
.sheet .grab { width: 38px; height: 4px; border-radius: 99px; background: #DDE2DB; margin: 2px auto 14px; }
.sheet h3 { margin: 0 0 14px; font-size: 17px; font-weight: 700; }
.sheet .actions { display: flex; gap: 10px; margin-top: 18px; }
.sheet .actions button { flex: 1; padding: 13px; font-size: 15px; }

.unit-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; }
.unit-grid button { padding: 12px 0; border-radius: 12px; background: #EFF2EE; font-size: 15px; font-weight: 500; }
.unit-grid button.active { background: var(--green); color: #fff; }

/* ---------- Toast ---------- */
#toast-root { position: fixed; top: calc(env(safe-area-inset-top) + 14px); left: 0; right: 0; z-index: 99; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.toast {
  background: rgba(25,29,25,.92); color: #fff; font-size: 14px; font-weight: 500;
  padding: 10px 20px; border-radius: 99px; box-shadow: 0 6px 20px rgba(0,0,0,.18);
  animation: toast-in .25s ease; max-width: 80%;
}
.toast.err { background: rgba(222,82,70,.95); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* ---------- 空态 & 加载 ---------- */
.empty { text-align: center; color: var(--faint); font-size: 13px; padding: 48px 0; }
.empty svg { width: 40px; height: 40px; margin-bottom: 10px; opacity: .5; }
.skel { border-radius: var(--radius); background: linear-gradient(90deg,#EEF1EC 25%,#E4E8E2 50%,#EEF1EC 75%); background-size: 200% 100%; animation: sk 1.2s infinite; }
@keyframes sk { from { background-position: 200% 0; } to { background-position: -200% 0; } }

.upload-area {
  border: 1.5px dashed #CDD4CB; border-radius: var(--radius); padding: 34px 20px;
  display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--sub);
  font-size: 14px; background: #FAFBF9;
}
.upload-area svg { width: 30px; height: 30px; color: var(--faint); }
.upload-area:active { background: #EFF2EE; }
.upload-area input { display: none; }

.ocr-item { padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 10px; background: #fff; }
.ocr-item .r1 { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; }
.ocr-item .r1 input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--green); }
.ocr-item .r2 { display: flex; gap: 8px; margin-top: 9px; }
.ocr-item .r2 input { flex: 1; border: 1.5px solid var(--line); border-radius: 10px; padding: 8px 10px; font-size: 14px; background: #FAFBF9; }

.review-row { display: flex; justify-content: space-between; align-items: baseline; padding: 10px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.review-row:last-of-type { border-bottom: none; }
.review-row .q { color: var(--sub); }
.review-total { display: flex; justify-content: space-between; align-items: baseline; margin-top: 12px; font-size: 16px; font-weight: 700; }
.review-row-refs { display: block; }
.review-row-main { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.review-reference { display: grid; gap: 3px; margin-top: 7px; padding: 8px 10px; border-radius: 9px; background: #F5F8F4; color: var(--sub); font-size: 11px; }
.review-reference span:last-child { color: var(--green-d); }
.review-totals { margin-top: 12px; padding: 11px 13px; border-radius: 11px; background: #F5F8F4; }
.review-totals > div { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 3px 0; color: var(--sub); font-size: 13px; }
.review-totals b { color: var(--ink); font-size: 16px; }
.review-totals .supplier { margin-top: 5px; padding-top: 8px; border-top: 1px dashed var(--line); color: var(--ink); font-weight: 600; }
.review-totals .supplier b { color: var(--green-d); font-size: 18px; }

.check-line { display: flex; align-items: center; gap: 8px; padding: 10px 16px; font-size: 12px; color: var(--sub); }
.check-line svg { width: 14px; height: 14px; color: var(--green); flex: none; }

/* ---------- 入口页 ---------- */
.portal {
  min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column; justify-content: center;
  padding: calc(env(safe-area-inset-top) + 28px) 24px calc(env(safe-area-inset-bottom) + 28px);
}
.portal-home {
  position: relative; isolation: isolate; overflow: hidden;
  justify-content: flex-start;
  background:
    radial-gradient(circle at 90% 3%, rgba(21,151,91,.11), transparent 34%),
    linear-gradient(180deg, #F8FAF7 0%, #F1F5F0 100%);
}
.portal-home::before {
  content: ""; position: absolute; z-index: -1;
  width: 230px; height: 230px; left: -155px; bottom: 2%;
  border: 54px solid rgba(21,151,91,.045); border-radius: 50%;
}
.portal .brand { text-align: center; margin-bottom: 34px; }
.portal .brand .logo {
  width: 62px; height: 62px; margin: 0 auto 14px; border-radius: 18px;
  background: linear-gradient(135deg, #1FA662, #0E7A48);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 24px rgba(21,151,91,.22);
}
.portal .brand .logo svg { width: 32px; height: 32px; color: #fff; }
.portal .brand .logo img { width: 34px; height: 34px; object-fit: contain; display: block; }
.portal h1 { font-size: 23px; font-weight: 700; margin: 0 0 6px; }
.portal .sub { font-size: 13px; color: var(--sub); }

.portal-home .portal-brand {
  display: flex; align-items: center; gap: 15px;
  width: 100%; text-align: left;
  margin: clamp(22px, 8vh, 68px) 0 clamp(42px, 9vh, 76px);
}
.portal-embedded {
  min-height: calc(100dvh - var(--tabbar-h) - env(safe-area-inset-bottom) - 16px);
}
.portal-home .portal-brand .logo {
  width: 54px; height: 54px; margin: 0; flex: none; border-radius: 17px;
  box-shadow: 0 10px 28px rgba(14,122,72,.20);
}
.portal-home .portal-brand .logo svg { width: 28px; height: 28px; }
.portal-home .portal-brand .logo img { width: 32px; height: 32px; }
.portal-home .brand-copy { min-width: 0; }
.portal-home h1 {
  margin: 0 0 3px; font-size: clamp(24px, 7vw, 30px);
  line-height: 1.12; letter-spacing: -.035em; font-weight: 760;
}
.portal-home .sub { font-size: 13px; letter-spacing: .02em; }
.portal-actions {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px; width: 100%;
}
.portal-card {
  display: flex; align-items: center; gap: 14px; width: 100%; min-width: 0;
  text-align: left; padding: 18px;
  background: var(--card); border-radius: 18px; border: 1px solid var(--line);
  box-shadow: 0 1px 2px rgba(20,39,26,.03), 0 12px 34px rgba(20,39,26,.055);
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.portal-actions .portal-card {
  opacity: 0; transform: translateY(10px);
  animation: portal-card-in .44s cubic-bezier(.22,.8,.28,1) forwards;
}
.portal-actions .portal-card:nth-child(2) { animation-delay: .06s; }
.portal-actions .portal-card:nth-child(3) { animation-delay: .12s; }
.portal-card-primary {
  grid-column: 1 / -1; min-height: 104px; padding: 21px 20px;
  background: #123C29; color: #fff; border-color: #123C29;
  box-shadow: 0 16px 34px rgba(18,60,41,.18);
}
.portal-card-secondary {
  min-height: 150px; align-items: flex-start; flex-direction: column;
  gap: 14px; padding: 17px;
}
.portal-card-copy { flex: 1; min-width: 0; display: block; }
.portal-card .ic {
  width: 46px; height: 46px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center; flex: none;
}
.portal-card .ic svg { width: 23px; height: 23px; }
.portal-card .ic.staff { background: rgba(255,255,255,.13); color: #fff; }
.portal-home .portal-card .ic.supplier,
.portal-home .portal-card .ic.admin { background: var(--green-t); color: var(--green-d); }
.portal-card .t { display: block; font-size: 16px; line-height: 1.25; font-weight: 720; letter-spacing: -.01em; }
.portal-card .d { display: block; font-size: 12px; line-height: 1.5; color: var(--sub); margin-top: 5px; }
.portal-card-primary .d {
  color: rgba(255,255,255,.68); margin-top: 4px;
  font-size: 11px; white-space: nowrap;
}
.portal-card .arr { color: var(--faint); flex: none; }
.portal-card-primary .arr { margin-left: auto; color: rgba(255,255,255,.7); }
.portal-card-secondary .arr { position: absolute; align-self: flex-end; color: #94A299; }
.portal-card .arr svg { width: 18px; height: 18px; }
.portal-card-secondary { position: relative; }
.portal-session {
  display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 5px;
  margin-top: 18px; padding: 10px 12px; color: var(--faint); font-size: 12px; line-height: 1.5;
}
.portal-session button {
  min-height: 32px; padding: 0 5px; color: var(--green-d);
  font-size: 12px; font-weight: 650; text-decoration: underline;
  text-underline-offset: 3px;
}
.portal-card:active { transform: translateY(1px) scale(.985); }
.portal-card:focus-visible,
.portal-session button:focus-visible,
.back-line:focus-visible {
  outline: 3px solid rgba(21,151,91,.28); outline-offset: 3px;
}
@keyframes portal-card-in {
  to { opacity: 1; transform: translateY(0); }
}
@media (hover: hover) {
  .portal-card:hover {
    transform: translateY(-2px); border-color: #D7E1D8;
    box-shadow: 0 4px 10px rgba(20,39,26,.05), 0 18px 42px rgba(20,39,26,.08);
  }
  .portal-card-primary:hover { border-color: #123C29; box-shadow: 0 20px 42px rgba(18,60,41,.22); }
}
@media (max-width: 350px) {
  .portal { padding-left: 18px; padding-right: 18px; }
  .portal-card-secondary { min-height: 142px; padding: 15px; }
  .portal-card .d { font-size: 11px; }
  .portal-card-primary .d { font-size: 10.5px; white-space: normal; line-height: 1.4; }
}
@media (max-height: 670px) {
  .portal-home .portal-brand { margin-top: 8px; margin-bottom: 28px; }
  .portal-card-primary { min-height: 92px; padding-top: 17px; padding-bottom: 17px; }
  .portal-card-secondary { min-height: 132px; }
}
@media (prefers-reduced-motion: reduce) {
  .portal-actions .portal-card { opacity: 1; transform: none; animation: none; }
  .portal-card { transition: none; }
}

/* ---------- 数量步进器 ---------- */
.stepper { display: flex; align-items: center; gap: 2px; background: #EFF2EE; border-radius: 10px; padding: 2px; flex: none; }
.stepper button {
  width: 30px; height: 30px; border-radius: 8px; font-size: 17px; font-weight: 600; color: var(--green-d);
  display: flex; align-items: center; justify-content: center; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.09);
  line-height: 1;
}
.stepper button:active { background: var(--green-t); }
.stepper input { width: 46px; text-align: center; border: none; background: none; font-size: 15px; font-weight: 700; padding: 4px 0; }
.stepper .u { font-size: 12px; color: var(--sub); padding-right: 8px; font-weight: 500; }

/* ---------- 订单详情（可编辑） ---------- */
.od-item { padding: 12px 0; border-bottom: 1px dashed var(--line); }
.od-item:last-child { border-bottom: none; }
.od-item.removed { opacity: .35; }
.od-item .l1 { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.od-item .nm { font-size: 15px; font-weight: 600; }
.od-item .nm { min-width: 0; }
.supplier-inline {
  display: block; margin-top: 4px; color: var(--green-d);
  font-size: 11px; line-height: 1.4; font-weight: 550;
}
.od-item .sup { font-size: 13px; font-weight: 700; white-space: nowrap; }
.od-item .sup.none { color: var(--amber); font-weight: 500; font-size: 12px; }
.od-item .l2 { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; }
.od-item .ref { font-size: 12px; color: var(--sub); }
.ref-stack { display: grid; gap: 3px; min-width: 0; }
.ref-stack .supplier-ref { color: var(--green-d); font-size: 12px; }
.od-totals { margin-top: 12px; background: #F6F8F5; border-radius: 12px; padding: 12px 14px; }
.od-totals .tr { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; color: var(--sub); padding: 3px 0; }
.od-totals .tr b { font-size: 16px; color: var(--ink); }
.od-totals .tr.main { border-top: 1px dashed var(--line); margin-top: 6px; padding-top: 8px; color: var(--ink); font-weight: 600; }
.od-totals .tr.main b { color: var(--green-d); font-size: 18px; }

/* ---------- 供应商端 ---------- */
.back-line { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--sub); padding: 4px 0; }
.back-line svg { width: 16px; height: 16px; }
.status-chip { font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 99px; }
.status-chip.wait { background: var(--amber-t); color: var(--amber); }
.status-chip.done { background: var(--green-t); color: var(--green-d); }
.q-item { padding: 13px 0; border-bottom: 1px dashed var(--line); }
.q-item:last-child { border-bottom: none; }
.q-item .l1 { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.q-item .nm { font-size: 15px; font-weight: 600; }
.q-item .qty { font-size: 13px; color: var(--sub); white-space: nowrap; }
.q-item .ref { font-size: 12px; color: var(--faint); margin-top: 2px; }
.q-item .l2 { display: flex; align-items: center; gap: 8px; margin-top: 9px; }
.q-item .l2 .plab { font-size: 12px; color: var(--sub); flex: none; }
.q-item .price-in {
  flex: 1; display: flex; align-items: center; border: 1.5px solid var(--line); border-radius: 10px;
  background: #FAFBF9; padding: 0 10px; transition: border-color .15s;
}
.q-item .price-in:focus-within { border-color: var(--green); background: #fff; }
.q-item .price-in .cur { color: var(--faint); font-size: 14px; margin-right: 2px; }
.q-item .price-in input { flex: 1; min-width: 0; border: none; background: none; padding: 9px 0; font-size: 16px; font-weight: 600; }
.q-item .price-in .per { font-size: 12px; color: var(--sub); flex: none; }
.q-item .subt { font-size: 14px; font-weight: 700; min-width: 64px; text-align: right; flex: none; }
.quote-readonly-row { padding: 8px 10px; border-radius: 9px; background: #F5F8F4; }
.quote-readonly-price { flex: 1; color: var(--green-d); font-size: 13px; font-weight: 650; }
.historical-quote-total { margin: 12px 0 0; }
.quote-bar {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  width: 100%; max-width: 480px; z-index: 30;
  padding: 10px 16px;
  background: rgba(255,255,255,.97); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
}
.quote-bar .tt { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 9px; }
.quote-bar .tt .lab { font-size: 13px; color: var(--sub); }
.quote-bar .tt .val { font-size: 19px; font-weight: 800; color: var(--green-d); }
.quote-bar .bts { display: flex; gap: 10px; }
.quote-bar .bts button { flex: 1; padding: 12px; font-size: 15px; }

/* ---------- 登录 / 人员管理 / 审批（v3） ---------- */
.portal-card .ic.admin { background: var(--amber-t); color: var(--amber); }
.status-chip.rej { background: var(--red-t); color: var(--red); }

.user-row { display: flex; align-items: center; gap: 12px; padding: 13px 16px; border-bottom: 1px solid var(--line); }
.user-row:last-child { border-bottom: none; }
.user-row .ic { width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex: none; }
.user-row .ic svg { width: 20px; height: 20px; }
.user-row .ic.staff { background: var(--green-t); color: var(--green-d); }
.user-row .ic.supplier { background: #E8F0FB; color: #2B62B0; }
.user-row .ic.admin { background: var(--amber-t); color: var(--amber); }
.user-row .info { flex: 1; min-width: 0; }
.user-row .nm { font-size: 15px; font-weight: 600; display: block; }
.user-row .mt { font-size: 12px; color: var(--sub); }
.user-row .tag { font-size: 10px; background: var(--green-t); color: var(--green-d); border-radius: 99px; padding: 1px 7px; font-weight: 600; }
.mini-btn {
  flex: none; font-size: 12px; font-weight: 600; color: var(--sub);
  border: 1px solid var(--line); border-radius: 9px; padding: 6px 10px; background: #fff;
}
.mini-btn:active { transform: scale(.96); }
.mini-btn.danger { color: var(--red); border-color: #F2D4D0; }

.ap-add { margin-top: 12px; }
/* 订单详情：返回下单页加菜提示 */
.add-more-hint {
  display: flex; align-items: center; gap: 8px; width: 100%;
  margin-top: 12px; padding: 13px 14px;
  background: rgba(52,211,153,.08); border: 1px dashed rgba(52,211,153,.35); border-radius: 12px;
  color: var(--green); font-size: 14px; text-align: left;
  transition: background .15s;
}
.add-more-hint:active { background: rgba(52,211,153,.16); }
.add-more-hint svg { width: 17px; height: 17px; flex: none; }
.add-more-hint span { flex: 1; }
.add-more-hint svg:last-child { width: 15px; height: 15px; opacity: .7; }
/* 订单详情：纠错备注 */
.correction-note {
  display: flex; align-items: flex-start; gap: 6px;
  margin: 4px 0 8px; padding: 9px 11px;
  background: rgba(251,191,36,.08); border: 1px solid rgba(251,191,36,.25); border-radius: 10px;
  font-size: 12.5px; color: var(--amber); line-height: 1.55;
}
.correction-note svg { width: 14px; height: 14px; flex: none; margin-top: 1px; }
.correction-mode {
  display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: center; gap: 9px;
  margin: 8px 0 10px; padding: 10px 11px;
  background: var(--amber-t); border: 1px solid color-mix(in srgb, var(--amber) 32%, transparent); border-radius: 12px;
  color: var(--amber);
}
.correction-mode-icon {
  width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center;
  background: color-mix(in srgb, var(--amber) 14%, transparent);
}
.correction-mode-icon svg { width: 15px; height: 15px; }
.correction-mode b { display: block; font-size: 13px; line-height: 1.25; }
.correction-mode small { display: block; margin-top: 2px; color: var(--sub); font-size: 11px; line-height: 1.35; }
.correction-mode button {
  min-height: 32px; padding: 0 10px; border: 1px solid color-mix(in srgb, var(--amber) 34%, transparent);
  border-radius: 9px; color: var(--amber); font-size: 12px; font-weight: 650;
}
.correction-mode button:active { transform: scale(.97); }
.correction-dialog-note {
  display: flex; align-items: flex-start; gap: 8px; margin: 0 0 15px; padding: 11px 12px;
  border: 1px solid color-mix(in srgb, var(--amber) 28%, transparent); border-radius: 12px;
  background: var(--amber-t); color: var(--sub); font-size: 13px; line-height: 1.55;
}
.correction-dialog-note svg { width: 16px; height: 16px; margin-top: 2px; color: var(--amber); flex: none; }
.correction-reason-field label { display: flex; align-items: center; justify-content: space-between; }
.correction-reason-field label span { color: var(--red); font-size: 11px; font-weight: 650; }
.correction-reason-field textarea { min-height: 108px; resize: none; }
.correction-counter { display: flex; justify-content: space-between; min-height: 18px; padding: 5px 2px 0; font-size: 11px; color: var(--faint); }
.correction-counter #cn-error { color: var(--red); }
#cn-ok.btn-danger { background: var(--red); color: #fff; font-weight: 650; }
#cn-ok:disabled { opacity: .42; cursor: default; }
.ap-sug-item {
  display: flex; align-items: center; gap: 8px; width: 100%; text-align: left;
  padding: 10px 12px; margin-top: 6px; border: 1px dashed var(--line); border-radius: 10px;
  font-size: 14px; font-weight: 600; color: var(--green-d); background: #fff;
}
.ap-sug-item svg { width: 15px; height: 15px; flex: none; }
.ap-sug-item:active { transform: scale(.98); }

/* ---------- 操作日志（v4） ---------- */
.log-row { display: flex; gap: 10px; padding: 11px 16px; border-bottom: 1px solid var(--line); }
.log-row:last-child { border-bottom: none; }
.log-row .lt { flex: none; font-size: 11px; color: var(--faint); padding-top: 2px; width: 68px; }
.log-row .li { flex: 1; min-width: 0; }
.log-row .nm { font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.log-row .act { font-size: 10px; font-weight: 600; background: var(--green-t); color: var(--green-d); border-radius: 99px; padding: 1px 8px; flex: none; }
.log-row .dt { font-size: 12px; color: var(--sub); display: block; margin-top: 2px; word-break: break-all; }

/* ---------- 审批页历史订单 ---------- */
.approval-history { margin-top: 24px; padding-top: 4px; border-top: 1px solid var(--line); }
.approval-today { margin-top: 18px; padding-top: 4px; border-top: 1px solid var(--line); }
.order-time-section.history { margin-top: 24px; padding-top: 4px; border-top: 1px solid var(--line); }
.section-block-title { padding: 18px 16px 2px; font-size: 17px; line-height: 1.3; font-weight: 750; letter-spacing: -.015em; }

/* ---------- 管理端数据与设置 ---------- */
.btn-ghost:disabled { opacity: .45; cursor: default; }
.data-filter { padding: 10px 16px 2px; }
.data-store-seg { margin-bottom: 12px; }
.date-range {
  display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: end; gap: 8px;
}
.date-range label { min-width: 0; }
.date-range label span { display: block; margin: 0 0 5px 2px; color: var(--sub); font-size: 11px; }
.date-range input {
  width: 100%; min-width: 0; height: 42px; padding: 0 9px;
  border: 1.5px solid var(--line); border-radius: 11px; background: var(--card);
  font-size: 13px; color: var(--ink);
}
.date-range input:focus { border-color: var(--green); }
.date-range-sep { padding-bottom: 12px; color: var(--faint); font-size: 12px; }
.data-query-btn { width: 100%; margin-top: 12px; padding: 11px 16px; font-size: 15px; }

.data-summary {
  margin: 14px 16px 0; padding: 18px;
  border-radius: var(--radius); background: #123D2A; color: #fff;
  box-shadow: 0 12px 28px rgba(18,61,42,.16);
}
.summary-label { color: rgba(255,255,255,.7); font-size: 12px; }
.summary-amount { margin-top: 3px; font-size: 31px; line-height: 1.15; font-weight: 780; letter-spacing: -.025em; }
.summary-meta { display: flex; gap: 18px; margin-top: 12px; color: rgba(255,255,255,.7); font-size: 12px; }
.summary-meta b { color: #fff; font-size: 14px; }
.store-total-list { display: grid; gap: 7px; margin-top: 14px; padding-top: 12px; border-top: 1px solid rgba(255,255,255,.16); }
.store-total-list span { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 12px; }
.store-total-list i { color: rgba(255,255,255,.68); font-style: normal; }
.store-total-list b { font-size: 13px; }
.data-list-title { display: flex; align-items: baseline; justify-content: space-between; padding: 22px 16px 8px; }
.data-list-title span { font-size: 16px; font-weight: 720; }
.data-list-title small { color: var(--faint); font-size: 11px; }
.data-list { margin: 0 16px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow); }
.data-row { padding: 14px 15px; border-bottom: 1px solid var(--line); }
.data-row:last-child { border-bottom: none; }
.data-row-main { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.data-row-main > div { display: flex; align-items: center; gap: 8px; min-width: 0; }
.data-row-main time { font-size: 14px; font-weight: 680; white-space: nowrap; }
.data-row-main strong { color: var(--green-d); font-size: 17px; white-space: nowrap; }
.data-row-meta { display: flex; flex-wrap: wrap; gap: 5px 14px; margin-top: 8px; color: var(--sub); font-size: 12px; }
.data-row-orders { margin-top: 3px; color: var(--faint); font-size: 11px; overflow-wrap: anywhere; }

.settings-menu { margin: 10px 16px 0; }
.settings-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 16px 2px; }
.settings-panel-head h2 { margin: 0; font-size: 17px; line-height: 1.3; }
.settings-panel-head p { margin: 3px 0 0; color: var(--sub); font-size: 11px; }
.settings-panel-head .btn-ghost { flex: none; padding: 8px 12px; font-size: 12px; }

.data-query-btn:focus-visible,
.date-range input:focus-visible,
.settings-menu button:focus-visible,
.data-store-seg button:focus-visible {
  outline: 3px solid rgba(21,151,91,.24); outline-offset: 2px;
}

@media (max-width: 360px) {
  .head-actions { gap: 4px; }
  .head-actions .btn-ghost { padding: 7px 8px; font-size: 11px; }
  .date-range { gap: 5px; }
  .date-range input { padding: 0 6px; font-size: 12px; }
  .data-row-main { align-items: flex-start; }
  .data-row-main > div { align-items: flex-start; flex-direction: column; gap: 5px; }
}

.admin-alert-panel { margin:0 16px 8px; padding:12px; border:1px solid rgba(251,191,36,.28); border-radius:14px; background:rgba(251,191,36,.08); }
.admin-alert-head { display:flex; justify-content:space-between; gap:12px; color:#fbbf24; font-size:13px; }
.admin-alert-head span { color:var(--sub); font-size:12px; }
.admin-alert-row { display:flex; align-items:center; justify-content:space-between; gap:10px; padding-top:10px; margin-top:10px; border-top:1px solid rgba(251,191,36,.16); }
.admin-alert-row span { min-width:0; display:grid; gap:3px; }
.admin-alert-row b { color:var(--ink); font-size:13px; }
.admin-alert-row small { color:var(--sub); font-size:11px; }
.admin-alert-row button { flex:0 0 auto; padding:6px 10px; border-radius:8px; border:1px solid rgba(255,255,255,.12); color:var(--sub); background:rgba(255,255,255,.05); }

/* ---------- 下单页参考价规格（v5） ---------- */
.dish-row .prices .spec-lite { color: var(--faint); font-size: 11px; font-weight: 400; }

/* ============ 工作台同款视觉基线（2026-08-20） ============
   采购系统保留原有业务结构，只统一工作台的颜色、层级、圆角、间距和交互状态。 */
:root {
  --bg: #0a0c10;
  --card: #14171c;
  --surface-2: #1c2027;
  --surface-3: #0b0f14;
  --ink: #f4f4f5;
  --sub: #a1a1aa;
  --faint: #71717a;
  --line: rgba(255,255,255,.08);
  --border: rgba(255,255,255,.1);
  --green: #34d399;
  --green-d: #6ee7b7;
  --green-t: rgba(52,211,153,.14);
  --shadow: 0 1px 2px rgba(0,0,0,.35), 0 12px 34px rgba(0,0,0,.22);
  --radius: 16px;
}

html { background: var(--bg); }
body { background: var(--bg); color: var(--ink); color-scheme: dark; }
#app { background: var(--bg); }

/* 页面容器 / 顶部栏 */
.page-head {
  background: rgba(10,12,16,.9);
  border-bottom-color: rgba(255,255,255,.06);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
}
.page-head h1 { color: var(--ink); font-weight: 650; letter-spacing: -.01em; }
.page-head .date { color: var(--faint); }
.back-line { color: var(--sub); }

/* 工作台同款底部菜单：深色底、单一翡翠激活色 */
#tabbar {
  background: rgba(10,12,16,.94);
  border-top-color: rgba(255,255,255,.08);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
}
#tabbar .tab { color: var(--faint); font-weight: 500; }
#tabbar .tab.active { color: var(--green); }
#tabbar .tab.active svg { filter: drop-shadow(0 0 10px rgba(52,211,153,.42)); }

/* 控件统一为工作台的深灰底 + 细描边 */
.seg, .search-box, .chip, .unit-btn, .cat-picker button, .stepper, .btn-ghost {
  background: var(--surface-2); border-color: rgba(255,255,255,.1); color: var(--sub);
}
.seg { border: 1px solid rgba(255,255,255,.1); padding: 4px; gap: 4px; }
.seg button { color: var(--sub); }
.seg button.active {
  background: var(--green); color: #052e1b; border-color: transparent;
  box-shadow: 0 2px 10px rgba(52,211,153,.25);
}
.search-box { border: 1px solid rgba(255,255,255,.08); }
.search-box input { color: var(--ink); }
.search-box input::placeholder { color: var(--faint); }
.chip { border: 1px solid transparent; }
.chip.active, .cat-picker button.active {
  background: var(--green-t); color: var(--green-d); border-color: rgba(52,211,153,.35);
}
.chip.active .n { color: var(--green); opacity: 1; }
.btn-primary { background: var(--green); color: #052e1b; border-radius: 12px; }
.btn-primary:hover { background: var(--green-d); }
.btn-primary:disabled { background: #2a2f38; color: #6b7280; }
.btn-ghost { color: var(--ink); border: 1px solid rgba(255,255,255,.12); border-radius: 12px; }
.btn-ghost:hover { background: rgba(255,255,255,.09); }
.btn-danger { background: rgba(248,113,113,.12); color: #fca5a5; border: 1px solid rgba(248,113,113,.22); }

/* 卡片、列表与嵌套信息块 */
.card, .data-list {
  background: var(--card); border-color: rgba(255,255,255,.08); box-shadow: var(--shadow);
}
.dish-row, .price-row, .dish-item, .user-row, .log-row { background: var(--card); }
.dish-row.picked, .price-cell.editable:active, .dish-item:active { background: rgba(52,211,153,.1); }
.spec-chip, .dish-item .tag, .store-badge-plain, .price-cells, .dish-market,
.copy-box, .review-reference, .review-totals, .od-totals, .quote-readonly-row {
  background: var(--surface-3); color: var(--sub); border-color: rgba(255,255,255,.08);
}
.price-cells { border: 1px solid rgba(255,255,255,.08); }
.price-cell + .price-cell { border-left-color: rgba(255,255,255,.08); }
.price-cell .val, .dish-row .prices b, .od-totals .tr b { color: var(--ink); }
.dish-row .prices .kl { color: #fbbf24; }
.dish-item .tag, .spec-chip { color: var(--sub); }
.order-card { background: var(--card); }
.store-badge.yuanzhu, .user-row .ic.supplier { background: rgba(96,165,250,.14); color: #93c5fd; }
.mini-btn { background: var(--surface-2); color: var(--sub); border-color: rgba(255,255,255,.1); }
.mini-btn.danger { border-color: rgba(248,113,113,.35); color: #fca5a5; }
.ap-sug-item, .ocr-item { background: var(--card); color: var(--ink); }

/* 表单与供应商报价 */
.qty-input, .form-row input[type=text], .form-row input[type=number], .form-row input:not([type]),
.form-row textarea, .form-row select, .ocr-item .r2 input, .q-item .price-in, .date-range input,
.upload-area {
  background: var(--surface-3); color: var(--ink); border-color: rgba(255,255,255,.12);
}
.qty-input:focus, .qty-input.filled, .form-row input:focus, .form-row textarea:focus,
.form-row select:focus, .q-item .price-in:focus-within, .date-range input:focus {
  background: var(--surface-3); border-color: rgba(52,211,153,.65); box-shadow: 0 0 0 3px rgba(52,211,153,.1);
}
.q-item .price-in input { color: var(--ink); }
select option { background: var(--card); color: var(--ink); }
.unit-grid button, .stepper button { background: var(--surface-2); color: var(--green-d); box-shadow: none; }
.unit-grid button.active { background: var(--green); color: #052e1b; }
.quick-add, .upload-area { background: transparent; border-color: rgba(255,255,255,.2); }
.quick-add:active, .upload-area:active { background: rgba(255,255,255,.06); }

/* 固定操作栏与弹层 */
.order-bar, .quote-bar { background: rgba(10,12,16,.94); border-top-color: rgba(255,255,255,.08); }
.sheet {
  background: var(--card); color: var(--ink); border: 1px solid rgba(255,255,255,.1); border-bottom: none;
  box-shadow: 0 -18px 50px rgba(0,0,0,.45);
}
.sheet .grab { background: #3f4652; }
.sheet-overlay { background: rgba(0,0,0,.62); }
.toast { background: rgba(30,34,42,.96); color: var(--ink); box-shadow: 0 6px 20px rgba(0,0,0,.5); }
.skel { background: linear-gradient(90deg,#161a20 25%,#1f242c 50%,#161a20 75%); background-size: 200% 100%; }

/* 入口页：和工作台首页一致的均匀应用卡片网格 */
.portal-home {
  background: radial-gradient(circle at 90% 3%, rgba(52,211,153,.1), transparent 34%), var(--bg);
}
.portal-home::before { border-color: rgba(52,211,153,.06); }
.portal-home .portal-brand { margin-bottom: clamp(30px, 7vh, 56px); }
.portal .brand .logo { background: linear-gradient(135deg, #34d399, #10b981); box-shadow: 0 8px 24px rgba(52,211,153,.25); }
.portal .brand .logo svg { color: #052e1b; }
.portal-actions { gap: 14px; }
.portal-card, .portal-card-primary, .portal-card-secondary {
  grid-column: auto; min-height: 154px; align-items: flex-start; flex-direction: column; gap: 12px;
  padding: 18px; background: rgba(255,255,255,.03); border-color: rgba(255,255,255,.08);
  box-shadow: var(--shadow);
}
.portal-card-primary { color: var(--ink); }
.portal-card .ic { border: 1px solid rgba(255,255,255,.1); }
.portal-card-primary .d { color: var(--sub); white-space: normal; font-size: 12px; }
.portal-card .t { color: var(--ink); font-weight: 650; }
.portal-card .d { color: var(--faint); }
.portal-card .arr { position: absolute; top: 18px; right: 16px; color: #52525b; }
.portal-card:hover { border-color: rgba(255,255,255,.16); }

/* 无障碍焦点和动效收束 */
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid rgba(52,211,153,.7); outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ============ 司麦工作台深色主题组件适配（原 2026-08-07 覆盖层，变量已并入根节点） ============ */

/* 顶部 / 底栏 */
.page-head { background: rgba(10,12,16,.92); }
#tabbar { background: rgba(14,17,22,.96); }
.order-bar, .quote-bar { background: rgba(14,17,22,.97); }

/* 通用控件 */
.seg, .search-box, .chip, .unit-btn, .cat-picker button, .stepper, .btn-ghost { background: #1c2027; }
.seg button.active { background: #2a2f38; color: var(--ink); box-shadow: 0 1px 4px rgba(0,0,0,.4); }
.chip.active, .cat-picker button.active { background: var(--ink); color: #14171c; }
.btn-primary { color: #052e1b; }
.btn-primary:disabled { background: #2a2f38; color: #6b7280; }
.unit-btn.filled, .unit-grid button.active { color: #052e1b; }
.btn-ghost { color: var(--ink); }
.btn-ghost:disabled { opacity: .4; }

/* 输入控件 */
.qty-input, .form-row input[type=text], .form-row input[type=number], .form-row input:not([type]),
.form-row textarea, .form-row select, .ocr-item .r2 input, .q-item .price-in,
.date-range input, .upload-area {
  background: #101318; color: var(--ink);
}
.qty-input:focus, .qty-input.filled,
.form-row input:focus, .form-row textarea:focus, .form-row select:focus,
.q-item .price-in:focus-within { background: #101318; }
.qty-input.filled { color: var(--green-d); }
select option { background: #14171c; color: #e4e4e7; }
input, select, textarea { color-scheme: dark; }

/* 次表面（嵌套信息块） */
.price-cells, .dish-market, .copy-box, .review-reference, .review-totals,
.od-totals, .quote-readonly-row, .spec-chip, .dish-item .tag, .store-badge-plain { background: #101318; }

/* 列表与卡片交互 */
.dish-item:active { background: #1a1e25; }
.card { border: 1px solid var(--line); }
.data-list { box-shadow: var(--shadow); }

/* 快速添加 / 上传 */
.quick-add, .upload-area { border-color: #3f4652; }
.quick-add:active, .upload-area:active { background: #1c2027; }

/* 门店徽章 / 图标 */
.store-badge.yuanzhu, .user-row .ic.supplier { background: rgba(96,165,250,.14); color: #60a5fa; }

/* 左滑操作 */
.swipe-del { color: #fff; }
.swipe-edit { color: #fff; }
.swipe-del.disabled { background: #2a2f38; color: #6b7280; }

/* 底部弹层 */
.sheet { background: #14171c; }
.sheet .grab { background: #3f4652; }
.sheet-overlay { background: rgba(0,0,0,.55); }

/* Toast / 骨架屏 / 空态 */
.toast { background: rgba(30,34,42,.96); color: #e4e4e7; box-shadow: 0 6px 20px rgba(0,0,0,.5); }
.skel { background: linear-gradient(90deg,#161a20 25%,#1f242c 50%,#161a20 75%); background-size: 200% 100%; }
.ocr-item { background: #14171c; }

/* 入口页（portal） */
.portal-home {
  background:
    radial-gradient(circle at 90% 3%, rgba(52,211,153,.10), transparent 34%),
    linear-gradient(180deg, #0a0c10 0%, #0d120f 100%);
}
.portal-home::before { border-color: rgba(52,211,153,.06); }
.portal .brand .logo { background: linear-gradient(135deg, #34d399, #10b981); box-shadow: 0 8px 24px rgba(52,211,153,.25); }
.portal .brand .logo svg { color: #052e1b; }
.portal-card { box-shadow: 0 1px 2px rgba(0,0,0,.4), 0 12px 34px rgba(0,0,0,.35); }
.portal-card-primary {
  background: linear-gradient(135deg, rgba(52,211,153,.16), rgba(16,185,129,.08));
  border-color: rgba(52,211,153,.25); color: #e4e4e7;
  box-shadow: 0 16px 34px rgba(52,211,153,.10);
}
.portal-card .ic.staff { background: rgba(52,211,153,.18); color: #6ee7b7; }
.portal-card-secondary .arr { color: #6b7280; }
@media (hover: hover) {
  .portal-card:hover { border-color: rgba(255,255,255,.16); box-shadow: 0 4px 10px rgba(0,0,0,.4), 0 18px 42px rgba(0,0,0,.4); }
  .portal-card-primary:hover { border-color: rgba(52,211,153,.4); }
}

/* 数据汇总卡（深绿改翡翠玻璃卡） */
.data-summary {
  background: linear-gradient(135deg, rgba(52,211,153,.16), rgba(16,185,129,.06));
  border: 1px solid rgba(52,211,153,.22); color: #e4e4e7;
  box-shadow: 0 12px 28px rgba(0,0,0,.35);
}
.summary-label, .summary-meta { color: rgba(228,228,231,.65); }
.summary-meta b { color: #e4e4e7; }
.store-total-list { border-top-color: rgba(255,255,255,.12); }
.store-total-list i { color: rgba(228,228,231,.6); }

/* 小按钮 */
.mini-btn { background: #1c2027; }
.mini-btn.danger { border-color: rgba(248,113,113,.35); }
.ap-sug-item { background: #14171c; }
.stepper button { background: #2a2f38; box-shadow: none; }
.stepper button:active { background: var(--green-t); }

/* 焦点环 */
.portal-card:focus-visible, .portal-session button:focus-visible, .back-line:focus-visible,
.data-query-btn:focus-visible, .date-range input:focus-visible,
.settings-menu button:focus-visible, .data-store-seg button:focus-visible {
  outline-color: rgba(52,211,153,.35);
}

/* ============ 司麦工作台视觉统一（2026-08-20，全站对齐工作台设计规范） ============ */

/* 页面氛围：顶部翡翠辉光，与工作台各页面一致 */
body::before {
  content: ""; position: fixed; z-index: -1; left: 50%; top: -160px;
  width: 720px; height: 420px; transform: translateX(-50%);
  border-radius: 50%; background: rgba(52,211,153,.08); filter: blur(120px);
  pointer-events: none;
}

/* 顶部标题栏：紧凑高度 + 发丝线 + 毛玻璃（对齐工作台 h-14 头部） */
.page-head {
  border-bottom: 1px solid rgba(255,255,255,.08);
  padding-top: calc(env(safe-area-inset-top) + 10px);
  padding-bottom: 10px;
}
.page-head h1 { font-size: 17px; font-weight: 600; letter-spacing: .01em; color: #f4f4f5; }
.page-head .date { font-size: 12px; color: #71717a; }

/* 底部 Tab：翡翠绿高亮（原 green-d 文字色），激活图标带微光 */
#tabbar { border-top: 1px solid rgba(255,255,255,.08); }
#tabbar .tab.active { color: var(--green); }
#tabbar .tab.active svg { filter: drop-shadow(0 0 10px rgba(52,211,153,.45)); }

/* 分段选择器：深底细描边 + 翡翠激活（对齐工作台待办筛选器） */
.seg { background: #0b0f14; border: 1px solid rgba(255,255,255,.1); padding: 4px; gap: 4px; }
.seg button { color: var(--sub); border-radius: 9px; }
.seg button.active { background: var(--green); color: #052e1b; font-weight: 600; box-shadow: 0 2px 10px rgba(52,211,153,.28); }

/* 分类/筛选 chips：激活态翡翠描边（原为反转白底） */
.chip { background: #1c2027; color: var(--sub); border: 1px solid transparent; }
.chip.active { background: rgba(52,211,153,.14); color: var(--green-d); border-color: rgba(52,211,153,.35); }
.chip.active .n { color: var(--green); opacity: 1; }
.cat-picker button { background: #1c2027; border: 1px solid transparent; }
.cat-picker button.active { background: rgba(52,211,153,.14); color: var(--green-d); border-color: rgba(52,211,153,.35); }

/* 按钮：主按钮翡翠绿 + 深底文字，幽灵按钮描边式（对齐工作台） */
.btn-primary { background: var(--green); color: #052e1b; border-radius: 12px; }
@media (hover: hover) { .btn-primary:hover { background: #6ee7b7; } }
.btn-primary:disabled { background: #2a2f38; color: #6b7280; }
.btn-ghost { background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.12); color: var(--ink); border-radius: 12px; }
@media (hover: hover) { .btn-ghost:hover { background: rgba(255,255,255,.09); } }
.btn-danger { border-radius: 12px; }
.mini-btn { background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.1); color: var(--sub); }

/* 卡片：发丝线 + 深投影（对齐工作台 border-white/8 + bg-white/[0.03] 语言） */
.card { border: 1px solid rgba(255,255,255,.08); box-shadow: 0 1px 2px rgba(0,0,0,.35), 0 12px 34px rgba(0,0,0,.22); }

/* 分区/日期标题：字号字重对齐工作台 */
.section-block-title { color: var(--ink); font-weight: 650; }
.date-group { color: #71717a; font-weight: 600; letter-spacing: .02em; }

/* 表单输入：更深底色 + 翡翠聚焦（对齐工作台 #080c10 / border-emerald-400/70） */
.qty-input, .form-row input[type=text], .form-row input[type=number], .form-row input:not([type]),
.form-row textarea, .form-row select, .ocr-item .r2 input, .q-item .price-in,
.date-range input, .upload-area { background: #0b0f14; }
.qty-input:focus, .form-row input:focus, .form-row textarea:focus, .form-row select:focus,
.q-item .price-in:focus-within, .date-range input:focus { border-color: rgba(52,211,153,.55); background: #0b0f14; }

/* 通用小标签（2b 详情页等使用的 .tag） */
.tag { display: inline-block; font-size: 11px; color: var(--sub); background: #1c2027; border: 1px solid rgba(255,255,255,.08); padding: 2px 8px; border-radius: 99px; vertical-align: middle; }

/* 底部弹层：描边与工作台一致 */
.sheet { border: 1px solid rgba(255,255,255,.1); border-bottom: none; }
.sheet h3 { color: #f4f4f5; }

/* ---------- 入口页：三入口统一为工作台风格竖版卡片（图标在上、文案在下） ---------- */
.portal-actions { gap: 12px; }
.portal-card { position: relative; }
.portal-card-primary, .portal-card-secondary {
  min-height: 138px; align-items: flex-start; flex-direction: column; gap: 12px; padding: 17px;
  background: rgba(255,255,255,.03); border: 1px solid rgba(255,255,255,.08); color: var(--ink);
  box-shadow: 0 1px 2px rgba(0,0,0,.4), 0 12px 34px rgba(0,0,0,.35);
}
.portal-card-primary { grid-column: auto; }
.portal-card .ic { border: 1px solid rgba(255,255,255,.1); box-shadow: 0 0 24px -8px rgba(52,211,153,.4); }
.portal-card .ic.staff { background: rgba(52,211,153,.14); color: var(--green-d); }
.portal-home .portal-card .ic.supplier { background: var(--blue-t); color: var(--blue); }
.portal-home .portal-card .ic.admin { background: var(--amber-t); color: var(--amber); }
.portal-card .t { color: #f4f4f5; font-weight: 650; }
.portal-card .d { color: #71717a; }
.portal-card-primary .d { color: #71717a; white-space: normal; font-size: 12px; line-height: 1.5; }
.portal-card .arr { position: absolute; top: 16px; right: 16px; margin: 0; align-self: auto; color: #52525b; }
@media (hover: hover) {
  .portal-card:hover { transform: translateY(-2px); border-color: rgba(255,255,255,.16); box-shadow: 0 4px 10px rgba(0,0,0,.4), 0 18px 42px rgba(0,0,0,.4); }
  .portal-card:hover .arr { color: #a1a1aa; }
}
.portal .brand .logo { box-shadow: 0 8px 24px rgba(52,211,153,.25); }
.portal h1 { font-weight: 650; letter-spacing: -.02em; }

/* 左滑操作按钮：深色主题下改用实色深翡翠/红，保证文字对比度 */
.swipe-edit { background: #047857; color: #fff; }
.swipe-del { background: #ef4444; color: #fff; }
.swipe-del.disabled { background: #2a2f38; color: #6b7280; }

/* 采购类型选择与无底部导航布局 */
#tabbar { display: none !important; }
#view { padding-bottom: calc(env(safe-area-inset-bottom) + 18px); }
.order-bar, .quote-bar { bottom: env(safe-area-inset-bottom); }
.page-head { position: sticky; }
.page-head .title-row { padding-right: 4px; }
.order-head .title-row { padding-right: 190px; }
.head-actions { display: flex; align-items: center; gap: 8px; position: absolute; right: 16px; bottom: 10px; }
.icon-btn { display: inline-flex; align-items: center; gap: 5px; padding: 7px 9px; border-radius: 10px; color: var(--green-d); background: rgba(52,211,153,.09); border: 1px solid rgba(52,211,153,.18); font-size: 12px; white-space: nowrap; }
.icon-btn svg { width: 15px; height: 15px; }
.icon-btn:active { transform: scale(.98); background: rgba(52,211,153,.16); }
.staff-menu { min-height: 100dvh; }
.menu-intro { padding: 24px 18px 14px; }
.menu-intro .eyebrow { display: block; color: var(--green); font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.menu-intro h2 { margin: 8px 0 4px; font-size: 24px; letter-spacing: -.03em; color: #f4f4f5; }
.menu-intro p { margin: 0; color: var(--sub); font-size: 13px; line-height: 1.65; }
.purchase-menu-grid { display: grid; gap: 10px; padding: 10px 16px 24px; }
.purchase-option { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 74px; padding: 13px 14px; text-align: left; border-radius: 16px; border: 1px solid rgba(255,255,255,.09); background: rgba(255,255,255,.035); color: var(--ink); box-shadow: 0 8px 22px rgba(0,0,0,.16); transition: transform .16s, border-color .16s, background .16s; }
.purchase-option:active { transform: scale(.985); }
.purchase-option:not(.coming):hover { border-color: rgba(52,211,153,.42); background: rgba(52,211,153,.08); }
.purchase-option.coming { opacity: .68; }
.purchase-option-icon { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; flex: 0 0 40px; border-radius: 12px; background: rgba(52,211,153,.13); color: var(--green); }
.purchase-option.coming .purchase-option-icon { background: rgba(255,255,255,.06); color: var(--sub); }
.purchase-option-icon svg { width: 20px; height: 20px; }
.purchase-option-copy { display: grid; gap: 4px; min-width: 0; flex: 1; }
.purchase-option-copy strong { font-size: 15px; font-weight: 650; color: #f4f4f5; }
.purchase-option-copy small { color: var(--sub); font-size: 12px; line-height: 1.35; }
.purchase-option-arrow { color: var(--green-d); display: flex; align-items: center; justify-content: flex-end; min-width: 20px; }
.purchase-option-arrow svg { width: 17px; height: 17px; }
.soon-dot { font-size: 11px; color: #a1a1aa; white-space: nowrap; }
.portal-home .portal-brand {
  display: block;
  width: 100%;
  text-align: left;
  margin: clamp(22px, 8vh, 68px) 0 clamp(30px, 7vh, 56px);
}
.portal-home .portal-brand .brand-copy { width: 100%; }
@media (max-width: 360px) {
  .order-head .title-row { padding-right: 78px; }
  .head-actions { right: 10px; gap: 4px; }
  .icon-btn { padding: 7px 6px; }
  .icon-btn span { display: none; }
}
