:root {
  --blue: #3369ff;
  --blue-2: #48a0f9;
  --bg: #f4f6fa;
  --card: #ffffff;
  --text: #1f2430;
  --sub: #5b6172;
  --muted: #9aa0b0;
  --line: #eef0f5;
  --danger: #ff4d4f;
  --ok: #12a150;
  --warn: #f59e0b;
  --radius: 12px;
  --shadow: 0 4px 16px rgba(31, 36, 48, 0.06);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body { margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
input, button, select, textarea { font-family: inherit; font-size: 14px; }

.app { max-width: 640px; margin: 0 auto; background: var(--bg); min-height: 100vh; padding-bottom: 40px; }

/* ---------- 顶部 ---------- */
.hd {
  background: linear-gradient(135deg, #3d7aff 0%, #48a0f9 100%);
  color: #fff;
  padding: 14px 14px 16px;
  border-radius: 0 0 18px 18px;
}
.hd-inner { display: flex; align-items: center; gap: 10px; }
.hd-logo {
  width: 46px; height: 46px; border-radius: 12px;
  background: rgba(255, 255, 255, 0.18);
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; flex: 0 0 auto;
}
.hd-info { flex: 1; min-width: 0; }
.hd-name { font-size: 17px; font-weight: 700; letter-spacing: .3px; }
.hd-sub { font-size: 12px; opacity: .92; }
.hd-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.hd-badges span {
  background: rgba(255, 255, 255, .16);
  border-radius: 20px; padding: 1px 8px; font-size: 11px;
}
.hd-link {
  flex: 0 0 auto; font-size: 12px; padding: 6px 10px;
  border: 1px solid rgba(255, 255, 255, .6); border-radius: 20px;
  background: rgba(255, 255, 255, .12);
}

/* ---------- 搜索 ---------- */
.search { padding: 12px 14px 0; }
.search-form { display: flex; gap: 8px; }
.search-input { flex: 1; }
.search-input input {
  width: 100%; height: 38px; border: none; border-radius: 10px;
  padding: 0 14px; background: #fff; box-shadow: var(--shadow); outline: none;
}
.search-btn {
  flex: 0 0 auto; width: 74px; height: 38px; border: none; cursor: pointer;
  border-radius: 10px; color: #fff; font-weight: 600;
  background: linear-gradient(0deg, #48a0f9, #3d7aff);
  box-shadow: 0 2px 6px rgba(73, 105, 230, .28);
}

/* ---------- 区块 ---------- */
.main { padding: 0 14px; }
.sec { margin-top: 16px; }
.sec-title {
  display: flex; align-items: center; justify-content: space-between;
  padding: 4px 0 10px;
}
.sec-title span {
  position: relative; padding-left: 12px; font-size: 16px; font-weight: 700;
}
.sec-title span::before {
  content: ""; position: absolute; left: 0; top: 3px; bottom: 3px;
  width: 3px; border-radius: 3px; background: var(--blue);
}
.sec-title em { font-style: normal; font-size: 12px; color: var(--muted); }

/* ---------- 公告 ---------- */
.notice-text {
  background: #fff; border-radius: var(--radius); padding: 12px 14px;
  color: var(--sub); font-size: 13px; box-shadow: var(--shadow);
  word-break: break-word;
}
.notice-text.small { font-size: 12.5px; line-height: 1.8; }
.notice-text p { margin: 0 0 10px; }
.notice-text p:last-child { margin-bottom: 0; }

/* ---------- 分类 ---------- */
.cate-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.cate-box {
  background: #fff; border-radius: var(--radius); padding: 12px;
  box-shadow: var(--shadow); border: 1px solid transparent;
  transition: transform .12s ease;
}
.cate-box:active { transform: scale(.98); }
.cate-box.active { border-color: var(--blue); box-shadow: 0 4px 16px rgba(51, 105, 255, .18); }
.cate-icon { font-size: 22px; line-height: 1; margin-bottom: 6px; }
.cate-name { font-size: 14px; font-weight: 600; }
.cate-desc { font-size: 11.5px; color: var(--muted); margin-top: 2px; }

/* ---------- 商品列表 ---------- */
.goods-list { display: flex; flex-direction: column; gap: 10px; }
.goods-box {
  display: flex; align-items: center; gap: 12px;
  background: #fff; border-radius: var(--radius); padding: 12px;
  box-shadow: var(--shadow);
}
.goods-box:active { background: #fafbff; }
.goods-icon {
  width: 48px; height: 48px; border-radius: 12px; flex: 0 0 auto;
  background: linear-gradient(135deg, #eef3ff, #e3edff);
  display: flex; align-items: center; justify-content: center; font-size: 26px;
}
.goods-main { flex: 1; min-width: 0; }
.goods-name {
  font-size: 15px; font-weight: 600; line-height: 1.4;
  overflow: hidden; text-overflow: ellipsis; display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.goods-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 5px; }
.tag {
  font-size: 11px; color: var(--blue); background: #eef3ff;
  border-radius: 4px; padding: 1px 6px;
}
.goods-remark { font-size: 11.5px; color: var(--muted); margin-top: 4px; }
.goods-right { flex: 0 0 auto; text-align: right; }
.goods-price { color: #ff3b3b; font-weight: 700; font-size: 17px; white-space: nowrap; }
.goods-price i { font-style: normal; font-size: 12px; margin-right: 1px; }
.goods-buy {
  margin-top: 6px; font-size: 12px; color: #fff; padding: 3px 10px;
  border-radius: 20px; background: linear-gradient(90deg, #48a0f9, #3d7aff);
  display: inline-block;
}
.goods-box.soldout { opacity: .55; }
.goods-box.soldout .goods-buy { background: #c6cad4; }
.soldout .goods-price { color: #9aa0b0; }

/* ---------- 商品详情 ---------- */
.goods-head {
  display: flex; gap: 12px; margin-top: 14px; background: #fff;
  border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow);
}
.gh-icon {
  width: 64px; height: 64px; border-radius: 14px; flex: 0 0 auto;
  background: linear-gradient(135deg, #eef3ff, #dde9ff);
  display: flex; align-items: center; justify-content: center; font-size: 34px;
}
.gh-main { min-width: 0; }
.gh-title { font-size: 16px; margin: 0 0 6px; line-height: 1.45; }
.gh-price { color: #ff3b3b; font-size: 22px; font-weight: 800; margin-top: 6px; }
.gh-price i { font-style: normal; font-size: 14px; }
.gh-highlight { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.gh-stock { font-size: 12px; color: var(--muted); font-weight: 400; margin-left: 10px; }
.goods-detail {
  background: #fff; border-radius: var(--radius); padding: 14px;
  box-shadow: var(--shadow); font-size: 13px; color: var(--sub); line-height: 1.85;
}

/* ---------- 表单 ---------- */
.form-card {
  background: #fff; border-radius: var(--radius); padding: 4px 14px;
  box-shadow: var(--shadow);
}
.frow {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 0; border-bottom: 1px solid var(--line);
}
.frow:last-of-type { border-bottom: none; }
.frow > label { flex: 0 0 84px; color: var(--sub); font-size: 13.5px; }
.frow > label i { color: var(--danger); font-style: normal; margin-right: 2px; }
.frow input[type="text"], .frow input[type="password"], .frow input:not([type]),
.frow input[type="search"] {
  flex: 1; min-width: 0; border: none; outline: none; background: transparent;
  height: 30px; color: var(--text);
}
.row-inline { display: flex; flex: 1; gap: 8px; align-items: center; min-width: 0; }
.btn-mini {
  flex: 0 0 auto; border: 1px solid var(--blue); color: var(--blue);
  background: #fff; border-radius: 6px; padding: 4px 9px; font-size: 12px;
}
.frow-tip { font-size: 12px; color: var(--muted); padding: 10px 0 12px; margin: 0; }

.stepper { display: flex; align-items: center; gap: 0; }
.step {
  width: 32px; height: 30px; border: 1px solid var(--line); background: #f7f8fc;
  color: var(--sub); font-size: 18px; line-height: 1; cursor: pointer;
}
.step:first-of-type { border-radius: 8px 0 0 8px; }
.stepper .step:last-of-type { border-radius: 0 8px 8px 0; }
.stepper input {
  width: 46px; height: 30px; text-align: center; border: 1px solid var(--line);
  border-left: none; border-right: none; background: #fff; color: var(--text);
}
.step-tip { font-size: 11.5px; color: var(--muted); margin-left: 10px; }

.pay-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.pay-box {
  display: flex; align-items: center; gap: 8px; background: #fff;
  border-radius: var(--radius); padding: 14px 12px; box-shadow: var(--shadow);
  border: 1.5px solid transparent; cursor: pointer;
}
.pay-box.active { border-color: var(--blue); background: #f6f9ff; }
.pay-box input { display: none; }
.pay-ico { font-size: 20px; }

/* ---------- 底部购买栏 ---------- */
.bar-space { height: 76px; }
.barbox {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  max-width: 640px; margin: 0 auto;
  display: flex; align-items: center; gap: 12px;
  background: rgba(255, 255, 255, .97);
  backdrop-filter: blur(8px);
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
  box-shadow: 0 -4px 20px rgba(31, 36, 48, .08);
}
.bar-total { flex: 1; font-size: 13px; color: var(--sub); }
.bar-total b { color: #ff3b3b; font-size: 20px; font-weight: 800; }
.bar-btn {
  flex: 0 0 auto; min-width: 140px; height: 46px; border: none; cursor: pointer;
  border-radius: 23px; color: #fff; font-size: 16px; font-weight: 700;
  background: linear-gradient(90deg, #48a0f9, #3d7aff);
  box-shadow: 0 6px 14px rgba(61, 122, 255, .32);
}
.bar-btn:disabled { background: #c6cad4; box-shadow: none; }
.bar-btn.full { width: 100%; margin-top: 14px; }

/* ---------- 收银台 ---------- */
.cashier {
  margin-top: 16px; background: #fff; border-radius: var(--radius);
  padding: 22px 16px; text-align: center; box-shadow: var(--shadow);
}
.cash-amount { font-size: 34px; font-weight: 800; color: #ff3b3b; }
.cash-amount i { font-style: normal; font-size: 18px; }
.cash-sub { color: var(--sub); font-size: 13px; margin-top: 4px; }
.cash-no { font-size: 12.5px; color: var(--sub); margin-top: 10px; word-break: break-all; }
.cash-timer { font-size: 12.5px; color: var(--muted); margin-top: 8px; }
.cash-timer b { color: var(--danger); }
.pay-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.pay-big {
  width: 100%; height: 48px; border: none; border-radius: 12px; cursor: pointer;
  color: #fff; font-size: 16px; font-weight: 700;
  background: linear-gradient(90deg, #48a0f9, #3d7aff);
}
.pay-big.alipay { background: linear-gradient(90deg, #1677ff, #4096ff); }
.pay-big.wxpay { background: linear-gradient(90deg, #07c160, #1fdd75); }

/* ---------- 订单 ---------- */
.order-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 16px; background: #fff; border-radius: var(--radius);
  padding: 14px; box-shadow: var(--shadow);
}
.order-no { font-size: 12.5px; color: var(--sub); word-break: break-all; }
.badge {
  display: inline-block; font-size: 12px; padding: 3px 10px; border-radius: 20px;
  font-weight: 600;
}
.badge.ok { background: #e8f8ee; color: var(--ok); }
.badge.warn { background: #fff5e6; color: #c77700; }
.badge.muted { background: #f1f2f6; color: var(--muted); }

.card-list { display: flex; flex-direction: column; gap: 10px; }
.card-item {
  background: #fff; border-radius: var(--radius); padding: 12px 14px;
  box-shadow: var(--shadow); border: 1px dashed #cfe0ff;
}
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 13px; font-weight: 700; color: var(--blue); margin-bottom: 8px;
}
.card-row { display: flex; gap: 10px; padding: 5px 0; border-bottom: 1px dashed var(--line); }
.card-row:last-child { border-bottom: none; }
.card-row span { flex: 0 0 58px; color: var(--muted); font-size: 13px; }
.card-row b { flex: 1; font-weight: 600; word-break: break-all; font-family: ui-monospace, Consolas, monospace; }

.info-list { background: #fff; border-radius: var(--radius); padding: 4px 14px; box-shadow: var(--shadow); }
.info-row {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 13px;
}
.info-row:last-child { border-bottom: none; }
.info-row span { color: var(--muted); flex: 0 0 auto; }
.info-row b { font-weight: 500; text-align: right; word-break: break-all; }
.price-text { color: #ff3b3b; font-weight: 700 !important; }

.copy-btn {
  border: 1px solid var(--blue); background: #fff; color: var(--blue);
  border-radius: 6px; padding: 1px 8px; font-size: 11.5px; cursor: pointer;
  margin-left: 8px;
}

/* ---------- 提示 ---------- */
.alert {
  border-radius: 10px; padding: 10px 12px; font-size: 12.5px;
  line-height: 1.7; margin-top: 12px;
}
.alert-error { background: #fff1f0; color: #cf1322; }
.alert-warn { background: #fff7e6; color: #ad6800; }
.alert-ok { background: #e8f8ee; color: var(--ok); }
.alert-info { background: #eef4ff; color: #2b4acb; }

.empty { text-align: center; color: var(--muted); font-size: 13px; padding: 34px 0; }

/* ---------- 浮动按钮 ---------- */
.float-box {
  position: fixed; right: 0; top: 42%; z-index: 40;
  display: flex; flex-direction: column; gap: 10px;
}
.float-item {
  writing-mode: vertical-rl; font-size: 11px; color: #fff;
  padding: 10px 5px; border-radius: 8px 0 0 8px;
  letter-spacing: 1px;
  box-shadow: 0 3px 8px rgba(0, 0, 0, .12);
}
.float-qq { background: linear-gradient(45deg, #fd0b27, #ff4a4a); }
.float-order { background: linear-gradient(45deg, #3798f7, #3369ff); }

/* ---------- 页脚 ---------- */
.ft { text-align: center; padding: 26px 14px 30px; color: var(--muted); font-size: 12px; }
.ft p { margin: 4px 0; }
.ft-muted { color: #b3b8c5; }

/* ---------- 错误页 ---------- */
.error-page { text-align: center; padding-top: 40px; }
.error-emoji { font-size: 52px; }
.error-page h1 { font-size: 18px; margin: 12px 0 6px; }
.error-page p { color: var(--muted); font-size: 13px; margin-bottom: 22px; }

/* ================= 后台 ================= */
.admin-body { background: #f5f7fb; }
.adm-warn {
  background: #fff7e6; color: #ad6800; padding: 10px 16px;
  font-size: 12.5px;
}
.adm-head {
  display: flex; align-items: center; justify-content: space-between;
  background: #111827; color: #fff; padding: 12px 16px;
  position: sticky; top: 0; z-index: 30;
}
.adm-brand { font-size: 15px; font-weight: 700; }
.adm-head-actions { display: flex; align-items: center; gap: 12px; font-size: 13px; }
.adm-head-actions a { opacity: .85; }
.adm-head-actions button {
  background: rgba(255, 255, 255, .14); border: none; color: #fff;
  padding: 5px 12px; border-radius: 6px; cursor: pointer;
}
.adm-tabs {
  display: flex; gap: 6px; padding: 10px 12px; overflow-x: auto;
  background: #fff; border-bottom: 1px solid var(--line);
  position: sticky; top: 46px; z-index: 20;
}
.adm-tabs button {
  flex: 0 0 auto; border: none; background: #f1f3f9; color: var(--sub);
  padding: 7px 16px; border-radius: 20px; font-size: 13px; cursor: pointer;
}
.adm-tabs button.active { background: var(--blue); color: #fff; }
.adm-main { max-width: 1080px; margin: 0 auto; padding: 14px; }

.adm-card {
  background: #fff; border-radius: 12px; padding: 14px;
  box-shadow: 0 2px 10px rgba(31, 36, 48, .05); margin-bottom: 14px;
}
.adm-card h2 { font-size: 15px; margin: 0 0 12px; }
.adm-toolbar {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px;
}
.adm-toolbar input, .adm-toolbar select {
  height: 34px; border: 1px solid var(--line); border-radius: 8px;
  padding: 0 10px; background: #fff; min-width: 0;
}
.adm-btn {
  height: 34px; border: 1px solid var(--line); background: #fff; color: var(--text);
  border-radius: 8px; padding: 0 14px; cursor: pointer; font-size: 13px;
}
.adm-btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.adm-btn.danger { color: var(--danger); border-color: #ffd2d2; background: #fff5f5; }
.adm-btn.sm { height: 26px; padding: 0 9px; font-size: 12px; border-radius: 6px; }

.adm-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.stat { background: #fff; border-radius: 12px; padding: 14px; box-shadow: 0 2px 10px rgba(31, 36, 48, .05); }
.stat-num { font-size: 22px; font-weight: 800; color: var(--blue); }
.stat-num.profit { color: var(--ok); }
.stat-num.loss { color: var(--danger); }
.stat-label { font-size: 12px; color: var(--muted); margin-top: 2px; }

.adm-item { border-bottom: 1px solid var(--line); padding: 10px 0; }
.adm-item:last-child { border-bottom: none; }
.adm-item-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.adm-item-title { font-size: 13.5px; font-weight: 600; }
.adm-item-sub { font-size: 12px; color: var(--muted); margin-top: 2px; word-break: break-all; }
.adm-item-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }

.adm-form { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.adm-field { display: flex; flex-direction: column; gap: 4px; }
.adm-field.full { grid-column: 1 / -1; }
.adm-field label { font-size: 12px; color: var(--sub); }
.adm-field input, .adm-field select, .adm-field textarea {
  border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px;
  background: #fff; width: 100%; outline: none;
}
.adm-field textarea { min-height: 90px; resize: vertical; }

.adm-modal {
  position: fixed; inset: 0; background: rgba(17, 24, 39, .45);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 30px 12px; z-index: 100; overflow: auto;
}
.adm-modal-card {
  background: #fff; border-radius: 14px; width: 100%; max-width: 560px; padding: 16px;
}
.adm-modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.adm-modal-head h3 { margin: 0; font-size: 15px; }
.adm-close { border: none; background: #f1f3f9; width: 28px; height: 28px; border-radius: 50%; cursor: pointer; }

.adm-login {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #1f2937, #111827); padding: 20px;
}
.adm-login-card {
  background: #fff; border-radius: 16px; padding: 26px 22px; width: 100%; max-width: 360px;
}
.adm-login-logo { font-size: 30px; }
.adm-login-card h1 { font-size: 17px; margin: 8px 0 16px; }
.adm-login-card input {
  width: 100%; height: 42px; border: 1px solid var(--line); border-radius: 10px;
  padding: 0 12px; margin-bottom: 12px; outline: none;
}
.adm-login-tip { font-size: 11.5px; color: var(--muted); margin-top: 14px; }
.adm-login-tip code { background: #f1f3f9; padding: 1px 5px; border-radius: 4px; }

@media (min-width: 720px) {
  .cate-list { grid-template-columns: repeat(4, 1fr); }
  .adm-grid { grid-template-columns: repeat(4, 1fr); }
}

/* ================= 桌面端 ================= */

.hnav { display: none; }

.gd-left .sec { margin-top: 16px; }

@media (min-width: 900px) {
  body { background: #eef1f7; }
  .app { max-width: 1180px; box-shadow: 0 0 40px rgba(31, 36, 48, .06); }

  .hd { padding: 16px 26px 18px; }
  .hd-logo { width: 52px; height: 52px; font-size: 26px; }
  .hd-name { font-size: 19px; }
  .hnav {
    display: flex; align-items: center; gap: 22px;
    margin-left: auto; margin-right: 10px; font-size: 14px;
  }
  .hnav a { color: rgba(255, 255, 255, .92); }
  .hnav a:hover { color: #fff; text-decoration: underline; }
  .hnav-support {
    font-size: 12px; background: rgba(255, 255, 255, .16);
    padding: 3px 10px; border-radius: 20px;
  }
  .hd-link { display: none; }

  .search { padding: 18px 26px 0; }
  .search-form { max-width: 560px; }
  .main { padding: 0 26px; }

  .cate-list { grid-template-columns: repeat(6, 1fr); gap: 12px; }
  .goods-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
  .goods-box { flex-direction: column; align-items: stretch; padding: 16px; }
  .goods-box .goods-main { margin-top: 10px; }
  .goods-icon { width: 54px; height: 54px; font-size: 28px; }
  .goods-name { font-size: 14.5px; min-height: 42px; }
  .goods-right { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; }
  .goods-buy { margin-top: 0; }

  .goods-head { margin-top: 18px; padding: 18px; }
  .gh-icon { width: 76px; height: 76px; font-size: 40px; }
  .gh-title { font-size: 18px; }

  .gd-body { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 18px; align-items: start; }
  .gd-right { position: sticky; top: 18px; }

  .barbox {
    position: static; max-width: none; margin: 0; padding: 14px;
    border-radius: 12px; background: #fff; box-shadow: var(--shadow);
  }
  .bar-space { display: none; }
  .bar-btn { min-width: 120px; height: 42px; border-radius: 10px; font-size: 15px; }

  .narrow-page .main { max-width: 760px; margin: 0 auto; }

  .float-box { display: none; }
}

/* ================= 后台 · 窄屏（按容器宽度，而不是屏幕宽度） ================= */

.adm-wrap { container-type: inline-size; }

@container (max-width: 640px) {
  .adm-head { position: static; padding: 10px 12px; }
  .adm-brand { font-size: 14px; }
  .adm-head-actions { gap: 8px; font-size: 12px; }
  .adm-head-actions a { display: none; }
  .adm-head-actions button { padding: 5px 10px; font-size: 12px; }

  .adm-tabs { position: sticky; top: 0; padding: 8px 10px; gap: 6px; }
  .adm-tabs button { padding: 6px 12px; font-size: 12.5px; }

  .adm-main { padding: 10px; }
  .adm-card { padding: 12px; border-radius: 10px; }
  .adm-card h2 { font-size: 14px; margin-bottom: 8px; }

  .adm-grid, .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .stat { padding: 10px; border-radius: 10px; }
  .stat-num { font-size: 18px; }
  .stat-label { font-size: 11.5px; }

  .adm-item { padding: 9px 0; }
  .adm-item-head { flex-direction: column; align-items: stretch; gap: 8px; }
  .adm-item-actions { justify-content: flex-start; }
  .adm-item-actions .adm-btn { flex: 1 1 auto; text-align: center; }
  .adm-item-title { font-size: 13px; line-height: 1.5; }

  .adm-form { grid-template-columns: 1fr; }
  .adm-toolbar input, .adm-toolbar select { flex: 1 1 100%; width: 100%; }
  .adm-toolbar .adm-btn { flex: 1 1 auto; }

  .adm-modal { padding: 14px 8px; }
  .adm-modal-card { padding: 12px; border-radius: 12px; }
  .adm-login { padding: 16px; }
  .adm-login-card { padding: 20px 16px; }
}

/* ================= 商户面板 v2：左侧菜单 + 表格 + 仪表盘 ================= */

.adm-shell {
  display: flex;
  min-height: 100vh;
  background: #f5f7fb;
  container-type: inline-size;
}

/* 侧边栏 */
.adm-side {
  width: 216px;
  flex: 0 0 216px;
  background: #fff;
  border-right: 1px solid var(--line);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.adm-side-head { display: flex; gap: 10px; align-items: center; padding: 18px 16px; border-bottom: 1px solid var(--line); }
.adm-side-logo {
  width: 36px; height: 36px; border-radius: 10px; flex: 0 0 auto;
  background: linear-gradient(135deg, #3d7aff, #48a0f9);
  display: flex; align-items: center; justify-content: center; font-size: 18px;
}
.adm-side-name { font-size: 14px; font-weight: 700; }
.adm-side-sub { font-size: 11px; color: var(--muted); }
.adm-menu { padding: 8px 0 24px; }
.adm-menu-group { font-size: 11px; color: #b3b9c9; padding: 14px 16px 6px; letter-spacing: .5px; }
.adm-menu-item {
  display: flex; align-items: center; gap: 9px; width: 100%;
  padding: 10px 16px; border: none; background: none; color: var(--sub);
  font-size: 13.5px; cursor: pointer; text-align: left;
  border-right: 3px solid transparent;
}
.adm-menu-item i { font-style: normal; font-size: 15px; width: 18px; text-align: center; }
.adm-menu-item:hover { background: #f7f9ff; color: var(--blue); }
.adm-menu-item.active { background: #eef3ff; color: var(--blue); font-weight: 600; border-right-color: var(--blue); }
.adm-side-mask { display: none; }

/* 主区 */
.adm-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.adm-top {
  height: 58px; background: #fff; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 14px; padding: 0 20px;
  position: sticky; top: 0; z-index: 30;
}
.adm-burger { display: none; border: none; background: none; font-size: 20px; cursor: pointer; color: var(--sub); padding: 0 4px; }
.adm-top-search { flex: 1; max-width: 360px; }
.adm-top-search input {
  width: 100%; height: 34px; border: 1px solid var(--line); background: #f7f8fc;
  border-radius: 18px; padding: 0 14px; outline: none;
}
.adm-top-right { margin-left: auto; display: flex; align-items: center; gap: 14px; font-size: 13px; color: var(--sub); }
.adm-top-right button { border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 5px 12px; cursor: pointer; color: var(--sub); }
.adm-top-user { background: #eef3ff; color: var(--blue); border-radius: 16px; padding: 4px 10px; font-size: 12px; }
.adm-content { padding: 16px 20px 40px; }
.adm-crumb { font-size: 12.5px; color: var(--muted); margin-bottom: 12px; }

/* 面板 */
.adm-panel { background: #fff; border-radius: 12px; padding: 16px; box-shadow: 0 2px 10px rgba(31, 36, 48, .05); margin-bottom: 14px; }
.adm-panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; gap: 10px; }
.adm-panel-head h3 { margin: 0; font-size: 15px; }
.adm-panel-head span { font-size: 12px; color: var(--muted); }

/* 欢迎条 */
.adm-hero {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  background: linear-gradient(120deg, #e8f0ff, #f5f8ff);
  border-radius: 12px; padding: 20px; margin-bottom: 14px;
}
.adm-hero h2 { margin: 0 0 6px; font-size: 18px; }
.adm-hero p { margin: 0; color: var(--sub); font-size: 13px; line-height: 1.7; }
.adm-hero-stats { display: flex; gap: 30px; margin-top: 16px; }
.adm-hero-stats b { display: block; font-size: 20px; color: var(--blue); }
.adm-hero-stats span { font-size: 12px; color: var(--muted); }

/* 指标卡 */
.kpi-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.kpi {
  background: #fff; border-radius: 12px; padding: 14px;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  box-shadow: 0 2px 10px rgba(31, 36, 48, .05);
}
.kpi-label { font-size: 12px; color: var(--muted); }
.kpi-num { font-size: 19px; font-weight: 800; margin-top: 4px; }
.kpi-num.profit { color: var(--ok); }
.kpi-num.warn { color: var(--warn); }
.kpi-icon {
  width: 38px; height: 38px; border-radius: 50%; flex: 0 0 auto;
  background: var(--blue); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 17px;
}

/* 柱状图 */
.chart { display: flex; align-items: flex-end; gap: 10px; padding: 10px 4px 0; }
.chart-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.chart-bars { display: flex; align-items: flex-end; justify-content: center; gap: 5px; height: 150px; width: 100%; }
.chart-bar { width: 12px; border-radius: 3px 3px 0 0; background: #c9d7ff; min-height: 2px; }
.chart-bar.main { background: #4f6ef7; }
.chart-bar.profit { background: #2fc98e; }
.chart-label { font-size: 11.5px; color: var(--muted); }
.chart-legend { display: flex; gap: 16px; justify-content: flex-end; font-size: 12px; color: var(--muted); margin-top: 10px; }
.chart-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; }

/* 表格 */
.tbl-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 620px; }
.tbl th {
  text-align: left; font-weight: 500; color: var(--muted); background: #fafbfd;
  padding: 10px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.tbl td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:hover td { background: #fafbff; }
.tbl th.c, .tbl td.c { text-align: center; }
.cell-title { font-weight: 600; }
.cell-sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.cell-actions { white-space: nowrap; }
.cell-actions .adm-btn { margin-right: 4px; }
.cell-profit { color: var(--ok); font-weight: 600; }
.tbl-empty { text-align: center; color: var(--muted); padding: 26px 0; }
.link-btn { border: none; background: none; color: var(--blue); cursor: pointer; padding: 0 4px; font-size: 12.5px; }
.link-btn.danger { color: var(--danger); }
.tbl .cb { width: 14px; height: 14px; }

@container (max-width: 980px) {
  .kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@container (max-width: 760px) {
  .adm-side {
    position: fixed; left: 0; top: 0; z-index: 100;
    transform: translateX(-100%); transition: transform .22s ease;
    box-shadow: 0 0 30px rgba(0, 0, 0, .16);
  }
  .adm-side.open { transform: translateX(0); }
  .adm-side-mask.show { display: block; position: fixed; inset: 0; background: rgba(17, 24, 39, .45); z-index: 90; }
  .adm-burger { display: block; }
  .adm-top { padding: 0 12px; gap: 8px; }
  .adm-top-search { max-width: none; }
  .adm-top-user { display: none; }
  .adm-content { padding: 12px; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .adm-hero { flex-direction: column; align-items: flex-start; }
  .adm-hero-stats { gap: 22px; }
  .adm-panel { padding: 12px; }
}

/* ================= 店铺界面（PC 宽屏） ================= */

.float-report { background: linear-gradient(45deg, #fd0b27, #ff4a4a); }
.float-service { background: linear-gradient(45deg, #7b61ff, #3d7aff); }

.bar-fee { font-size: 11.5px; color: var(--muted); margin-left: 8px; }

@media (min-width: 900px) {
  body { background: #f2f4f9; }
  .app { background: transparent; box-shadow: none; }

  /* 顶部：白底横条 */
  .hd {
    background: #fff; color: var(--text); border-radius: 0;
    box-shadow: 0 1px 0 var(--line), 0 4px 14px rgba(31, 36, 48, .05);
    padding: 14px 24px; margin-bottom: 14px;
  }
  .hd-name { color: var(--text); font-size: 17px; }
  .hd-sub { color: var(--muted); }
  .hd-badges { display: none; }
  .hnav a, .hnav-support { color: var(--sub); }
  .hnav-support { background: #f1f4fb; }
  .hd-link {
    display: inline-block; color: #fff; background: var(--blue);
    border: none; padding: 8px 18px; border-radius: 20px; font-size: 13px;
  }

  /* 区块：白卡片 + 标题下划线 */
  .main { padding: 0 24px 96px; }
  .sec {
    background: #fff; border-radius: 8px; padding: 18px 20px;
    box-shadow: 0 2px 10px rgba(31, 36, 48, .05); margin-top: 14px;
  }
  .sec-title { padding: 0 0 14px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
  .sec-title span { font-size: 15px; }
  .notice-text, .goods-detail, .info-list, .form-card { background: transparent; box-shadow: none; padding: 0; }
  .goods-head {
    background: #fff; border-radius: 8px; padding: 20px; margin-top: 0;
    box-shadow: 0 2px 10px rgba(31, 36, 48, .05);
  }
  .card-list .card-item { background: #fafbff; box-shadow: none; }
  .pay-box { box-shadow: none; border: 1px solid var(--line); }
  .pay-box.active { border-color: var(--blue); background: #f6f9ff; }

  /* 底部：整条支付栏 */
  .bar-space { display: block; height: 84px; }
  .barbox {
    position: fixed; left: 0; right: 0; bottom: 0; top: auto;
    max-width: none; margin: 0; border-radius: 0;
    background: #fff; box-shadow: 0 -2px 14px rgba(31, 36, 48, .08);
    padding: 12px max(24px, calc((100vw - 1180px) / 2 + 24px));
    justify-content: flex-end;
  }
  .bar-total { flex: 0 0 auto; font-size: 13px; }
  .bar-total b { font-size: 22px; margin: 0 6px; }
  .bar-btn { min-width: 180px; height: 44px; border-radius: 8px; }

  /* 左侧悬浮按钮 */
  .float-box { left: 0; right: auto; top: 190px; }
  .float-item {
    writing-mode: horizontal-tb; padding: 9px 14px;
    border-radius: 0 8px 8px 0; font-size: 13px; letter-spacing: 0;
  }
  .float-report { background: linear-gradient(45deg, #ff5a5f, #ff7a45); }
  .float-service { background: linear-gradient(45deg, #7b61ff, #3d7aff); }
}



