:root {
  --brand: #91411d;
  --brand-deep: #783416;
  --brand-darker: #502b19;
  --gold: #dca857;
  --gold-light: #edc780;
  --cream: #e8d9c8;
  --paper: #f3ece2;
  --bg: #e8d9c8;
  --ink: #2a1c12;
  --muted: #93815f;
  --line: #e7dac2;
  --line-soft: #efe5d2;
  --sidebar: #3e2417;
  --sidebar-2: #502b19;
  --ok: #2f9e6e;
  --warn: #e08a1e;
  --danger: #d7482e;
  --shadow: 0 12px 34px rgba(123, 61, 22, 0.10);
  --shadow-sm: 0 6px 18px rgba(123, 61, 22, 0.08);
  --serif: "Noto Serif SC", "Songti SC", "STSong", "SimSun", Georgia, serif;
  --sans: -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  letter-spacing: 0.2px;
}
.hidden { display: none !important; }
.icp-footer { margin-top:32px; text-align:center; font-size:12px; }
.icp-footer a { color:var(--muted); text-decoration:none; }
.icp-footer a:hover { color:var(--brand); text-decoration:underline; }
.mobile-menu-toggle,.mobile-bottom-nav,.mobile-nav-mask,.mobile-menu-layout { display: none; }

/* =================================================================
   登录页 · 分屏
================================================================= */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: stretch;
  background: var(--paper);
}
.login { display: flex; width: 100%; min-height: 100vh; }

.login-visual {
  position: relative;
  flex: 1.08;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px;
  color: #ffe9bc;
  background:
    radial-gradient(120% 90% at 18% 12%, rgba(245, 166, 35, 0.55), transparent 55%),
    radial-gradient(130% 110% at 85% 105%, rgba(199, 68, 25, 0.5), transparent 60%),
    linear-gradient(158deg, #502b19 0%, #783416 42%, #91411d 78%, #e2702a 100%);
}
.login-visual::after {
  content: "";
  position: absolute; inset: 0;
  background:
    repeating-linear-gradient(105deg, rgba(255, 233, 188, 0.04) 0 2px, transparent 2px 26px),
    radial-gradient(90% 70% at 50% 50%, transparent 55%, rgba(60, 16, 8, 0.35) 100%);
  mix-blend-mode: overlay;
  pointer-events: none;
}
.visual-glow {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(42% 38% at 50% 30%, rgba(255, 220, 150, 0.28), transparent 70%);
}

.visual-tree {
  position: relative; z-index: 1;
  width: 54px; height: 54px;
  color: var(--gold-light);
  filter: drop-shadow(0 6px 14px rgba(50, 10, 4, 0.35));
  margin-bottom: 26px;
}
.visual-tree svg { width: 100%; height: 100%; }

.visual-brand {
  position: relative; z-index: 1;
  font-family: var(--serif);
  font-size: clamp(48px, 6vw, 68px);
  font-weight: 700;
  letter-spacing: 8px;
  line-height: 1.06;
  color: #ffe9bc;
  writing-mode: vertical-rl;
  text-orientation: upright;
  text-shadow: 0 8px 26px rgba(50, 10, 4, 0.4);
}
.visual-roman {
  position: relative; z-index: 1;
  margin-top: 22px;
  font-size: 12px;
  letter-spacing: 4px;
  color: rgba(255, 233, 188, 0.85);
  text-transform: uppercase;
}
.visual-tag {
  position: relative; z-index: 1;
  margin-top: 14px;
  padding: 5px 16px;
  border: 1px solid rgba(255, 233, 188, 0.45);
  border-radius: 999px;
  font-size: 13px;
  letter-spacing: 3px;
  color: #ffe9bc;
  background: rgba(80, 22, 10, 0.18);
  backdrop-filter: blur(4px);
}
.visual-quote {
  position: absolute; z-index: 1; bottom: 40px; left: 0; right: 0;
  text-align: center;
  font-family: var(--serif);
  font-size: 15px;
  letter-spacing: 6px;
  color: rgba(255, 233, 188, 0.78);
}

/* 登录表单侧 */
.login-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 56px 72px;
  background: var(--paper);
  max-width: 560px;
}
.panel-brand {
  font-size: 12px;
  letter-spacing: 5px;
  color: var(--brand);
  font-weight: 700;
  text-transform: uppercase;
}
.panel-title {
  font-family: var(--serif);
  font-size: 40px;
  font-weight: 700;
  letter-spacing: 2px;
  margin-top: 12px;
  color: var(--ink);
}
.panel-sub { color: var(--muted); font-size: 15px; margin-top: 10px; }

#login-form { margin-top: 36px; }
.field { display: block; text-align: left; margin-bottom: 20px; }
.field span {
  display: block; font-size: 14px; color: var(--muted); margin-bottom: 8px; font-weight: 500;
}
.field input {
  width: 100%;
  padding: 13px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  font-size: 15px;
  background: #fff;
  color: var(--ink);
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.field input::placeholder { color: #c8b79b; }
.field input:focus {
  outline: none;
  border-color: var(--gold);
  background: #f3ece2;
  box-shadow: 0 0 0 4px rgba(245, 166, 35, 0.18);
}

.login-error {
  display: flex; align-items: center; gap: 8px;
  margin: 4px 0 18px;
  padding: 11px 14px;
  border-radius: 12px;
  background: #fbe3df;
  border: 1px solid #f3c9c2;
  color: var(--danger);
  font-size: 14px;
}
.login-error::before {
  content: "⚠";
  font-size: 15px;
  line-height: 1;
}
.login-error:empty { display: none; }

.panel-hint {
  margin-top: 18px;
  text-align: center;
  font-size: 12.5px;
  color: var(--muted);
  letter-spacing: 1px;
}

/* =================================================================
   按钮
================================================================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: none; cursor: pointer; border-radius: 999px; padding: 11px 20px;
  font-size: 14px; font-weight: 600; transition: transform .1s, opacity .15s, background .15s, box-shadow .15s;
  font-family: inherit; white-space: nowrap;
}
.btn:active { transform: scale(.97); }
.btn svg { width: 16px; height: 16px; }
.btn-primary {
  background: linear-gradient(135deg, var(--brand-darker), var(--brand-deep));
  color: #ffe9bc;
  box-shadow: 0 10px 24px rgba(155, 44, 30, 0.28);
}
.btn-primary:hover { background: linear-gradient(135deg, var(--brand-deep), var(--brand)); box-shadow: 0 12px 28px rgba(155, 44, 30, 0.34); }
.btn-gold { background: linear-gradient(120deg, var(--gold-light), var(--gold)); color: #6a3b00; }
.btn-brand { background: var(--brand); color: #fff; }
.btn-ghost { background: transparent; border: 1px solid var(--line); color: var(--ink); }
.btn-ghost:hover { background: var(--cream); }
.btn-outline {
  background: #fff; border: 1px solid var(--line); color: var(--ink);
  font-size: 13px; font-weight: 600;
}
.btn-outline:hover { border-color: var(--gold); color: var(--brand); box-shadow: var(--shadow-sm); }
.btn-sm { padding: 7px 14px; font-size: 13px; }
.btn-xs { padding: 4px 9px; font-size: 12px; line-height: 1.2; }
.btn-block { width: 100%; }
.btn-danger { background: #fff; border: 1px solid #f3d2cb; color: var(--danger); }
.btn-danger:hover { background: #fbeeea; }

/* =================================================================
   主布局 · 深色侧栏 + 浅色工作台
================================================================= */
#app-screen { display: flex; min-height: 100vh; }

.sidebar {
  width: 236px; flex-shrink: 0; color: #f2e3cf;
  display: flex; flex-direction: column;
  background:
    radial-gradient(120% 60% at 20% 0%, rgba(245, 166, 35, 0.10), transparent 60%),
    linear-gradient(172deg, var(--sidebar) 0%, var(--sidebar-2) 100%);
  padding: 22px 16px 18px;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 6px 8px 20px; border-bottom: 1px solid rgba(242, 227, 207, 0.12); }
.brand-mark {
  width: 42px; height: 42px; flex-shrink: 0; border-radius: 13px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--gold), var(--brand));
  color: #502b19;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
}
.brand-mark svg { width: 24px; height: 24px; }
.brand-name { font-family: var(--serif); font-size: 20px; font-weight: 700; letter-spacing: 1px; color: #ffe9bc; }
.brand-sub { font-size: 10px; letter-spacing: 2px; color: rgba(242, 227, 207, 0.6); margin-top: 2px; }

.nav { flex: 1; padding: 20px 4px; display: flex; flex-direction: column; gap: 6px; }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  text-align: left; border: none; background: transparent; color: rgba(242, 227, 207, 0.78);
  padding: 12px 14px; border-radius: 13px; font-size: 15px; cursor: pointer; font-family: inherit;
  transition: background .15s, color .15s, transform .05s;
}
.nav-item svg { width: 19px; height: 19px; flex-shrink: 0; }
.nav-item:hover { background: rgba(242, 227, 207, 0.07); color: #ffe9bc; }
.nav-item.active {
  background: linear-gradient(135deg, rgba(245, 166, 35, 0.92), rgba(226, 112, 42, 0.92));
  color: #502b19; font-weight: 700;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.sidebar-foot { padding-top: 14px; border-top: 1px solid rgba(242, 227, 207, 0.12); }
.user-card { display: flex; align-items: center; gap: 11px; padding: 8px 6px; }
.user-avatar {
  width: 38px; height: 38px; border-radius: 12px; flex-shrink: 0;
  display: grid; place-items: center;
  background: rgba(242, 227, 207, 0.14);
  color: var(--gold-light); font-family: var(--serif); font-size: 18px; font-weight: 700;
}
.user-meta { flex: 1; min-width: 0; }
.admin-name { font-size: 14px; font-weight: 600; color: #ffe9bc; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-role { font-size: 11px; letter-spacing: 1px; color: rgba(242, 227, 207, 0.55); text-transform: uppercase; }
.logout {
  border: none; background: transparent; color: rgba(242, 227, 207, 0.7);
  cursor: pointer; padding: 8px; border-radius: 10px; display: grid; place-items: center;
}
.logout svg { width: 20px; height: 20px; }
.logout:hover { background: rgba(242, 227, 207, 0.1); color: #ffe9bc; }

/* 工作台主区 */
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; background: var(--bg); }
.topbar {
  padding: 26px 40px 20px;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(255, 253, 248, 0.7);
  backdrop-filter: blur(8px);
}
.topbar-left h1 { font-family: var(--serif); font-size: 27px; font-weight: 700; letter-spacing: 1px; }
.topbar-desc { color: var(--muted); font-size: 13px; margin-top: 6px; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.store-badge {
  background: var(--cream); border: 1px solid var(--line); color: var(--brand);
  padding: 8px 15px; border-radius: 999px; font-size: 12.5px; font-weight: 600;
  max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.content { padding: 30px 40px 60px; overflow-y: auto; flex: 1; }

/* =================================================================
   经营概览 · 分体数据卡 + 面板
================================================================= */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: var(--paper);
  border: 1px solid var(--line-soft);
  border-radius: 22px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  margin-bottom: 24px;
}
.stat-card { padding: 26px 24px 22px; }
.stat-card + .stat-card { border-left: 1px solid var(--line-soft); }
.stat-card .label { font-size: 13px; color: var(--muted); }
.stat-card .value {
  font-family: var(--serif);
  font-size: 42px;
  font-weight: 700;
  line-height: 1.1;
  margin-top: 12px;
  color: var(--ink);
  letter-spacing: 1px;
}
.stat-card .delta { font-size: 12px; color: var(--muted); margin-top: 8px; }
.stat-card.accent .value { color: var(--brand); }

.grid-2 { display: grid; grid-template-columns: 1.45fr 1fr; gap: 24px; }
.card {
  background: var(--paper);
  border: 1px solid var(--line-soft);
  border-radius: 22px;
  box-shadow: var(--shadow-sm);
  padding: 24px 26px;
  margin-bottom: 24px;
}
.card-head { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 6px; }
.card-head h2 { font-family: var(--serif); font-size: 18px; font-weight: 700; letter-spacing: 0.5px; }
.card-head .sub { font-size: 12.5px; color: var(--muted); margin-top: 5px; display: block; }
.card-head .link {
  color: var(--brand); font-size: 13px; font-weight: 600; cursor: pointer;
  background: none; border: none; text-decoration: none;
}
.card-head .link:hover { text-decoration: underline; }

/* =================================================================
   表格
================================================================= */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 14px 12px; font-size: 14px; border-bottom: 1px solid var(--line-soft); }
th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.6px; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: #fdf9f1; }
td img.thumb { width: 46px; height: 46px; border-radius: 12px; object-fit: cover; background: var(--cream); }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 4px 11px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.pill.gold { background: #fdeed0; color: #9a6a00; }
.pill.green { background: #dff4e8; color: var(--ok); }
.pill.red { background: #fbe0da; color: var(--danger); }
.pill.grey { background: #eee7db; color: #8a7a60; }
.pill.blue { background: #ddeefe; color: #2571b8; }
.price { font-weight: 700; color: var(--brand); }
.muted { color: var(--muted); font-size: 13px; }

/* =================================================================
   商品列表
================================================================= */
.menu-cat-list { margin-bottom: 8px; }
.menu-group-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-family: var(--serif); font-size: 15px; font-weight: 700; margin: 20px 0 12px; }
.menu-group-title::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--brand); display: inline-block; }
.menu-group-title .count { color: var(--muted); font-weight: 500; font-size: 12px; }
.product-list { display: grid; grid-template-columns: 1fr; gap: 10px; }
.product-row {
  display: flex; align-items: center; gap: 14px; background: var(--paper);
  border: 1px solid var(--line-soft); border-radius: 16px; padding: 12px 16px;
  transition: border-color .15s, box-shadow .15s;
}
.product-manage-row { gap:16px; }
.product-manage-row.is-paused { opacity:.68; background:#f6f1eb; }
.product-config-tags { display:flex; flex-wrap:wrap; gap:6px; margin-top:8px; }
.product-config-box { border:1px solid var(--line); border-radius:14px; padding:16px; background:#fbf7f1; }
.product-image-upload { display:flex; align-items:center; gap:12px; min-width:0; }
.product-image-upload-fields { display:flex; flex:1; flex-direction:column; gap:6px; min-width:0; }
.product-image-upload-fields input[type="file"] { display:block; width:100%; min-width:0; max-width:100%; }
.config-title { display:flex; align-items:center; justify-content:space-between; gap:18px; margin-bottom:14px; }
.config-title > div { display:flex; flex-direction:column; gap:4px; }
.config-title small { color:var(--muted); font-weight:400; }
.check-line { display:flex; align-items:center; gap:8px; white-space:nowrap; font-weight:700; color:var(--brand); }
.check-line input { width:18px; height:18px; accent-color:var(--brand); }
.compact-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
.option-editor-grid { display:grid; grid-template-columns:minmax(0,1fr); gap:12px; min-width:0; }
.option-editor-group { min-width:0; padding:13px; border:1px solid var(--line-soft); border-radius:12px; background:#fff; }
.option-editor-head { display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:9px; }
.option-editor-head > div { display:flex; flex-direction:column; gap:3px; min-width:0; }
.option-editor-head strong { font-size:14px; }
.option-editor-head small { color:var(--muted); font-size:11px; }
.option-editor-head button { flex:none; }
.option-editor-list { display:grid; gap:7px; }
.option-editor-row { display:grid; grid-template-columns:minmax(0,1fr) 130px 70px 34px; align-items:center; gap:8px; min-width:0; }
.option-editor-row > input,.option-price-field input { width:100%; min-width:0; height:40px; padding:8px 10px; border:1px solid var(--line); border-radius:9px; background:#fff; color:var(--ink); font:14px var(--sans); }
.option-price-field { display:flex; align-items:center; gap:4px; min-width:0; color:var(--muted); font-size:11px; white-space:nowrap; }
.option-price-field input { flex:1; }
.option-enabled-field { display:flex; align-items:center; gap:4px; color:var(--muted); font-size:12px; white-space:nowrap; }
.option-enabled-field input { width:16px; height:16px; accent-color:var(--brand); }
.option-remove { width:34px; height:34px; border:1px solid var(--line); border-radius:8px; background:#fff; color:var(--danger); font-size:20px; cursor:pointer; }
.staff-option-group { grid-column:1/-1; display:flex; align-items:center; flex-wrap:wrap; gap:7px; padding:7px 0 0; }
.staff-option-group em { font-style:normal; color:var(--muted); font-size:12px; min-width:38px; }
.staff-option-group label { display:flex; align-items:center; gap:4px; font-size:12px; color:var(--ink); }
.staff-option-group input[type="checkbox"] { width:14px; height:14px; }
.staff-option-group select { height:32px; min-width:130px; border:1px solid var(--line); border-radius:8px; background:#fff; }
@media (max-width:900px) { .option-editor-grid,.compact-grid { grid-template-columns:1fr; } }
.product-row:hover { border-color: var(--gold); box-shadow: var(--shadow-sm); }
.product-row .thumb { width: 54px; height: 54px; border-radius: 13px; object-fit: cover; background: var(--cream); flex-shrink: 0; }
.product-row .info { flex: 1; min-width: 0; }
.product-row .name { font-weight: 700; font-size: 15px; }
.product-row .desc { font-size: 12px; color: var(--muted); margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.product-row .rank {
  width: 32px; height: 32px; flex-shrink: 0; border-radius: 10px;
  display: grid; place-items: center;
  font-family: var(--serif); font-weight: 700; font-size: 15px;
  background: var(--cream); color: var(--brand); border: 1px solid var(--line);
}
.product-row .rank.top {
  background: linear-gradient(135deg, var(--gold), var(--brand));
  color: #fff; border: none; box-shadow: 0 5px 12px rgba(199, 68, 25, 0.3);
}
.badge { display: inline-block; padding: 2px 7px; border-radius: 6px; font-size: 11px; font-weight: 700; margin-left: 6px; background: #fdeed0; color: #9a6a00; }
.badge.off { background: #eee7db; color: #8a7a60; }
.toggle { position: relative; width: 42px; height: 24px; border-radius: 999px; background: #ddd2bf; cursor: pointer; transition: background .2s; flex-shrink: 0; }
.toggle.on { background: var(--ok); }
.toggle::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: left .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.toggle.on::after { left: 21px; }

/* =================================================================
   表单
================================================================= */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; min-width:0; }
.form-grid .full { grid-column: 1 / -1; }
.form-ctrl { display: flex; flex-direction: column; gap: 7px; min-width:0; }
.form-ctrl label { font-size: 13px; color: var(--muted); font-weight: 500; }
.form-ctrl input, .form-ctrl textarea, .form-ctrl select {
  width:100%; min-width:0; max-width:100%; padding: 11px 13px; border: 1px solid var(--line); border-radius: 13px; font-size: 14px;
  background: #fff; color: var(--ink); font-family: inherit; transition: border-color .15s, box-shadow .15s;
}
.form-ctrl input:focus, .form-ctrl textarea:focus, .form-ctrl select:focus {
  outline: none; border-color: var(--gold); box-shadow: 0 0 0 4px rgba(245, 166, 35, 0.16);
}
.form-ctrl textarea { resize: vertical; min-height: 84px; }

.input {
  padding: 10px 13px; border: 1px solid var(--line); border-radius: 12px; font-size: 13px;
  background: #fff; color: var(--ink); font-family: inherit; transition: border-color .15s, box-shadow .15s;
}
.input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 4px rgba(245, 166, 35, 0.16); }

.avatar {
  width: 38px; height: 38px; border-radius: 50%; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--brand-darker), var(--brand));
  color: #ffe2b0; font-weight: 800; font-size: 15px; letter-spacing: 1px;
}

.chip-row { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px;
  background: var(--cream); border: 1px solid var(--line); border-radius: 999px; font-size: 13px; cursor: pointer;
}
.chip button { border: none; background: none; cursor: pointer; color: var(--danger); font-size: 15px; line-height: 1; }

/* =================================================================
   空状态
================================================================= */
.empty { text-align: center; padding: 54px 20px; color: var(--muted); }
.empty .icon { font-size: 40px; margin-bottom: 12px; }
.empty .t1 { font-family: var(--serif); font-size: 17px; font-weight: 700; color: var(--ink); margin-bottom: 6px; }
.empty .t2 { font-size: 13px; color: var(--muted); }

/* =================================================================
   弹窗 / 提示
================================================================= */
.modal-mask { position: fixed; inset: 0; background: rgba(42, 22, 12, 0.5); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 20px; }
.modal {
  background: var(--paper); border-radius: 24px; width: 540px; max-width: 94vw; max-height: 90vh; overflow-y: auto;
  box-shadow: 0 40px 90px rgba(0, 0, 0, 0.35);
}
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px; border-bottom: 1px solid var(--line-soft); }
.modal-head h3 { font-family: var(--serif); font-size: 19px; }
.modal-close { border: none; background: none; font-size: 28px; color: var(--muted); cursor: pointer; line-height: 1; }
.modal-close:hover { color: var(--danger); }
.modal-body { padding: 24px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 0 24px 24px; }
.img-preview { width: 90px; height: 90px; border-radius: 15px; object-fit: cover; background: var(--cream); border: 1px solid var(--line); margin-bottom: 8px; }

.toast {
  position: fixed; top: 22px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: #ffe9bc; padding: 13px 22px; border-radius: 999px;
  font-size: 14px; z-index: 60; box-shadow: 0 14px 40px rgba(0, 0, 0, 0.3);
}

/* =================================================================
   响应式
================================================================= */
@media (max-width: 1080px) {
  .login-panel { padding: 48px 48px; }
  .content { padding: 24px 28px 50px; }
  .topbar { padding: 22px 28px 16px; }
}

@media (max-width: 900px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .stat-card:nth-child(3) { border-left: none; border-top: 1px solid var(--line-soft); }
  .stat-card:nth-child(4) { border-top: 1px solid var(--line-soft); }
  .grid-2 { grid-template-columns: 1fr; }
  .sidebar { width: 78px; padding: 18px 10px; }
  .brand-text, .nav-item span, .user-meta { display: none; }
  .nav-item { justify-content: center; padding: 12px; }
  .brand { justify-content: center; border-bottom: none; padding-bottom: 10px; }
  .user-card { justify-content: center; }
}

@media (max-width: 720px) {
  .login { flex-direction: column; }
  .login-visual { flex: none; min-height: 300px; padding: 40px 24px; }
  .visual-brand { writing-mode: horizontal-tb; font-size: 44px; letter-spacing: 6px; }
  .visual-tree { margin-bottom: 18px; }
  .visual-quote { position: static; margin-top: 20px; }
  .login-panel { padding: 40px 26px; max-width: none; }
}

/* 会员等级 */
.level-hero {
  display: flex; align-items: center; gap: 14px; margin-bottom: 8px;
  color: #fff; border-radius: 14px; padding: 16px 18px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.2);
}
.lv-ico { font-size: 34px; line-height: 1; }
.lv-main { flex: 1; min-width: 0; }
.lv-title { font-size: 17px; font-weight: 800; }
.lv-meta { font-size: 12px; color: rgba(255,255,255,.85); margin-top: 4px; }
.lv-pct { font-size: 18px; font-weight: 900; }
.lv-track { height: 8px; border-radius: 999px; background: rgba(255,255,255,.25); overflow: hidden; margin: 0 0 16px; }
.lv-fill { height: 100%; border-radius: 999px; background: #fff; }
.level-list { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.level-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.level-row .lv-badge { width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 22px; flex-shrink: 0; }
.level-row .lv-f { width: 130px; }
.level-row .lv-f[data-f="minSpend"] { width: 120px; }
.level-row .lv-f[data-f="discount"] { width: 120px; }
.table-qr { display:block; width:116px; height:116px; margin-bottom:8px; border-radius:8px; background:white; }
.recharge-offer-row { display:flex; gap:16px; align-items:center; flex-wrap:wrap; padding:12px 0; border-bottom:1px solid #e9ded1; }
.recharge-offer-row label { display:flex; align-items:center; gap:8px; }
.recharge-offer-row input { width:110px; padding:10px; border:1px solid #ddcbb8; border-radius:8px; }

/* 桌台状态卡片 */
.table-toolbar {
  display:flex; align-items:center; justify-content:space-between; gap:20px;
  margin-bottom:24px; padding:20px 22px; border:1px solid var(--line-soft);
  border-radius:18px; background:var(--paper); box-shadow:var(--shadow-sm);
}
.table-summary { display:flex; align-items:baseline; gap:8px; margin-bottom:5px; font-size:15px; color:var(--ink); }
.table-summary strong { font-family:var(--serif); font-size:27px; color:var(--brand); }
.table-summary span { margin-left:8px; color:var(--muted); font-size:13px; }
.table-zone { margin-bottom:28px; }
.table-zone-head { display:flex; align-items:center; justify-content:space-between; margin-bottom:12px; padding:0 2px; }
.table-zone-head h2 { font-family:var(--serif); font-size:18px; }
.table-zone-head span { color:var(--muted); font-size:12px; }
.table-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(190px,1fr)); gap:14px; }
.table-card {
  position:relative; min-height:190px; padding:18px; overflow:hidden;
  border:1px solid var(--line); border-radius:18px; background:var(--paper);
  color:var(--ink); text-align:left; font-family:inherit; cursor:pointer;
  box-shadow:var(--shadow-sm); transition:transform .15s,border-color .15s,box-shadow .15s;
}
.table-card::after { content:""; position:absolute; width:92px; height:92px; right:-31px; bottom:-38px; border-radius:50%; background:rgba(160,125,82,.08); }
.table-card:hover { transform:translateY(-2px); border-color:var(--gold); box-shadow:0 14px 30px rgba(86,50,22,.12); }
.table-card:focus-visible { outline:3px solid rgba(245,166,35,.36); outline-offset:2px; }
.table-card.occupied { border-color:#dcaa59; background:linear-gradient(145deg,#fffaf0,#f7ead5); }
.table-card-status,.table-detail-status { display:inline-flex; align-items:center; gap:7px; font-size:12px; font-weight:700; }
.table-card-status i,.table-detail-status i { width:8px; height:8px; border-radius:50%; background:var(--ok); box-shadow:0 0 0 4px rgba(47,158,110,.11); }
.table-card.occupied .table-card-status,.table-detail-status.occupied { color:#9a6105; }
.table-card.occupied .table-card-status i,.table-detail-status.occupied i { background:#d98618; box-shadow:0 0 0 4px rgba(217,134,24,.14); }
.table-card-no { display:block; margin-top:19px; font-family:var(--serif); font-size:36px; line-height:1; font-weight:800; letter-spacing:1px; }
.table-card-area { display:block; margin-top:8px; color:var(--muted); font-size:12px; }
.table-card-meta { display:block; margin-top:18px; font-size:14px; font-weight:700; }
.table-card-foot { display:block; margin-top:7px; color:var(--muted); font-size:12px; }

/* 桌台详情与代客下单 */
.modal.modal-wide { width:880px; }
.table-detail-hero { display:flex; align-items:flex-start; justify-content:space-between; gap:24px; padding:2px 2px 20px; }
.table-detail-area { color:var(--brand); font-size:12px; font-weight:700; }
.table-detail-hero h4 { margin-top:6px; font-family:var(--serif); font-size:38px; line-height:1; }
.table-detail-hero p { margin-top:10px; color:var(--muted); font-size:12px; }
.table-detail-status { padding:8px 13px; border-radius:999px; background:#e7f5ed; color:var(--ok); }
.table-detail-status.occupied { background:#fff0d5; }
.table-detail-layout { display:grid; grid-template-columns:280px 1fr; gap:18px; }
.qr-panel,.table-orders-panel { border:1px solid var(--line-soft); border-radius:18px; background:#fff; padding:18px; }
.detail-section-title { margin-bottom:12px; font-size:13px; font-weight:800; color:var(--ink); }
.table-detail-qr { display:block; width:210px; height:210px; margin:0 auto; border-radius:12px; background:#fff; }
.qr-panel p { margin:12px auto 14px; color:var(--muted); font-size:12px; line-height:1.6; text-align:center; }
.detail-button-row { display:flex; gap:8px; justify-content:center; flex-wrap:wrap; }
.table-order-row { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:12px 0; border-bottom:1px solid var(--line-soft); }
.table-order-row > div:first-child { min-width:0; }
.table-order-row strong,.table-order-row span { display:block; }
.table-order-row strong { font-size:13px; }
.table-order-row > div:first-child span { margin-top:4px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:var(--muted); font-size:12px; }
.table-order-side { display:flex; align-items:flex-end; gap:6px; flex-direction:column; flex-shrink:0; }
.table-order-side b { color:var(--brand); }
.history-title { margin-top:20px; }
.table-history-row { display:grid; grid-template-columns:1.3fr 1fr auto; gap:10px; align-items:center; padding:9px 0; color:var(--muted); font-size:12px; }
.table-history-row b { color:var(--ink); }
.detail-empty { padding:22px 12px; border-radius:12px; background:var(--cream); color:var(--muted); font-size:13px; text-align:center; }
.staff-order-top { display:grid; grid-template-columns:1fr 1fr; gap:14px; }
.staff-order-top .full { grid-column:1 / -1; }
.staff-menu-title { margin-top:22px; }
.staff-product-grid { display:grid; grid-template-columns:1fr 1fr; gap:9px; max-height:310px; overflow-y:auto; padding-right:4px; }
.staff-product { display:grid; grid-template-columns:1fr auto 64px; gap:10px; align-items:center; padding:12px; border:1px solid var(--line-soft); border-radius:13px; background:#fff; }
.staff-product span { min-width:0; }
.staff-product strong,.staff-product small { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.staff-product strong { font-size:13px; }
.staff-product small { margin-top:3px; color:var(--muted); font-size:11px; }
.staff-product > b { color:var(--brand); font-size:13px; }
.staff-product input { width:64px; padding:8px; border:1px solid var(--line); border-radius:9px; color:var(--ink); }
.staff-product input:focus { outline:none; border-color:var(--gold); box-shadow:0 0 0 3px rgba(245,166,35,.15); }
.staff-order-total { display:flex; align-items:center; justify-content:space-between; margin:16px 0; padding:13px 16px; border-radius:13px; background:var(--cream); }
.staff-order-total span { font-size:13px; color:var(--muted); }
.staff-order-total strong { font-family:var(--serif); font-size:24px; color:var(--brand); }

@media (max-width:720px) {
  .table-toolbar { align-items:flex-start; }
  .table-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .table-card { min-height:164px; padding:15px; }
  .table-card-no { font-size:30px; }
  .table-detail-layout,.staff-order-top,.staff-product-grid { grid-template-columns:1fr; }
  .table-detail-qr { width:190px; height:190px; }
  .staff-order-top .full { grid-column:auto; }
}

/* 手机浏览器：沿用桌面业务与接口，调整导航和触控布局 */
@media (max-width: 720px) {
  html,body { min-width:320px; overflow-x:hidden; }
  body { background:#f7f3ec; }
  #app-screen { display:block; min-height:100dvh; }
  .main { min-height:100dvh; padding-bottom:calc(66px + env(safe-area-inset-bottom)); }
  .sidebar { position:fixed; z-index:45; inset:0 auto 0 0; width:min(286px,82vw); padding:20px 14px; transform:translateX(-105%); transition:transform .22s ease; box-shadow:12px 0 36px rgba(38,19,9,.22); }
  .mobile-nav-open .sidebar { transform:translateX(0); }
  .mobile-nav-mask:not(.hidden) { display:block; position:fixed; inset:0; background:rgba(35,20,12,.5); z-index:44; }
  .sidebar .brand-text,.sidebar .nav-item span,.sidebar .user-meta { display:block; }
  .sidebar .brand { justify-content:flex-start; border-bottom:1px solid rgba(242,227,207,.12); padding:6px 8px 20px; }
  .sidebar .nav-item { justify-content:flex-start; min-height:50px; padding:12px 14px; }
  .sidebar .user-card { justify-content:flex-start; }
  .topbar { position:sticky; top:0; z-index:20; min-height:62px; padding:10px 12px; gap:8px; background:#fff; border-bottom:1px solid #e8e0d6; backdrop-filter:none; }
  .mobile-menu-toggle { display:grid; place-items:center; width:42px; height:42px; flex:none; border:0; background:transparent; color:var(--ink); font-size:24px; cursor:pointer; }
  .topbar-left { min-width:0; flex:1; }
  .topbar-left h1 { font-family:var(--sans); font-size:19px; letter-spacing:0; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
  .topbar-desc,.store-badge { display:none; }
  .topbar-right { flex:none; }
  #refresh-btn { width:40px; height:40px; padding:0; border:0; border-radius:10px; }
  #refresh-btn span { display:none; }
  .content { overflow:visible; padding:14px 12px 30px; }
  .mobile-bottom-nav { position:fixed; z-index:30; display:grid; grid-template-columns:repeat(5,1fr); left:0; right:0; bottom:0; height:calc(62px + env(safe-area-inset-bottom)); padding-bottom:env(safe-area-inset-bottom); background:#fff; border-top:1px solid #e7dfd5; box-shadow:0 -3px 18px rgba(44,23,11,.06); }
  .mobile-nav-item { border:0; background:none; color:#867b70; font:600 11px var(--sans); display:flex; flex-direction:column; align-items:center; justify-content:center; gap:3px; cursor:pointer; min-width:0; }
  .mobile-nav-item.active { color:var(--brand); }
  .mobile-nav-icon { height:24px; font-size:23px; line-height:1; font-weight:500; }
  .card { padding:16px; margin-bottom:14px; border-radius:16px; box-shadow:none; background:#fff; }
  .card-head { align-items:center; gap:12px; flex-wrap:wrap; }
  .card-head h2 { font-family:var(--sans); font-size:17px; }
  .card-head .chip-row { width:100%; overflow-x:auto; flex-wrap:nowrap; padding:4px 0; }
  .card-head .chip-row .chip { white-space:nowrap; }
  .stat-grid { grid-template-columns:repeat(2,minmax(0,1fr)) !important; border-radius:16px; margin-bottom:14px; background:#fff; }
  .stat-card { padding:17px 14px; }
  .stat-card:nth-child(odd) { border-left:0; }
  .stat-card:nth-child(n+3) { border-top:1px solid var(--line-soft); }
  .stat-card .value { font-family:var(--sans); font-size:27px; }
  .grid-2 { gap:0; }
  .grid-2 .product-row { flex-wrap:wrap; }
  .table-toolbar { padding:16px; flex-wrap:wrap; margin-bottom:18px; }
  .table-toolbar > .btn { min-height:42px; }
  .table-grid { gap:10px; }
  .table-card { min-height:150px; }
  .table-detail-layout { grid-template-columns:1fr; }
  .modal-mask { align-items:stretch; padding:0; max-width:100vw; overflow:hidden; }
  .modal,.modal.modal-wide { display:flex; flex-direction:column; width:100vw; min-width:0; max-width:100vw; height:100dvh; max-height:none; overflow:hidden; border-radius:0; box-shadow:none; }
  .modal-head { flex:none; padding:16px; background:#fff; }
  .modal-head h3 { font-family:var(--sans); font-size:19px; }
  .modal-close { min-width:44px; min-height:44px; }
  .modal-body { flex:1; min-width:0; min-height:0; overflow-x:hidden; overflow-y:auto; padding:16px 16px 28px; }
  .modal-foot { flex:none; position:sticky; bottom:0; display:flex; flex-wrap:wrap; justify-content:stretch; padding:12px 16px calc(12px + env(safe-area-inset-bottom)); background:#fff; border-top:1px solid var(--line-soft); }
  .modal-foot .btn { flex:1 1 auto; min-height:44px; }
  .form-grid,.option-editor-grid,.compact-grid { grid-template-columns:1fr !important; }
  .form-grid .full { grid-column:auto; }
  .product-config-box { min-width:0; padding:12px; }
  .product-image-upload { flex-wrap:wrap; }
  .product-image-upload-fields { flex-basis:180px; }
  .option-editor-group { padding:10px; }
  .option-editor-head { align-items:flex-start; flex-wrap:wrap; }
  .option-editor-head button { min-height:36px; }
  .option-editor-row { grid-template-columns:minmax(0,1fr) 94px 34px; gap:7px; padding:8px 0; border-top:1px solid var(--line-soft); }
  .option-editor-row > input { grid-column:1; font-size:16px; }
  .option-price-field { grid-column:2/4; }
  .option-price-field input { font-size:16px; }
  .option-enabled-field { grid-column:1/3; grid-row:2; min-height:30px; }
  .option-remove { grid-column:3; grid-row:2; }
  .form-ctrl input,.form-ctrl select,.form-ctrl textarea,.input { font-size:16px; min-height:44px; }
  .config-title { align-items:flex-start; flex-wrap:wrap; }
  .check-line { white-space:normal; }
  .staff-product-grid { max-height:none; }
  .staff-product { grid-template-columns:minmax(0,1fr) auto 64px; }
  .staff-option-group { grid-column:1/-1; }
  .table-wrap { overflow:visible; }
  .table-wrap table.mobile-data-table,.mobile-data-table tbody,.mobile-data-table tr,.mobile-data-table td { display:block; width:100%; }
  .mobile-data-table thead { display:none; }
  .mobile-data-table tr { margin:12px 0; padding:12px; border:1px solid var(--line-soft); border-radius:14px; background:#fff; }
  .mobile-data-table td { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; padding:7px 0; border:0; text-align:right; overflow-wrap:anywhere; }
  .mobile-data-table td::before { content:attr(data-label); flex:none; color:var(--muted); font-size:12px; text-align:left; }
  .mobile-data-table td.row-actions { display:flex; flex-wrap:wrap; justify-content:flex-end; }
  .mobile-data-table td.row-actions::before { display:block; width:100%; }
  .mobile-data-table td .row-actions { justify-content:flex-end; }
  .mobile-data-table td[colspan] { display:block; text-align:center; }
  .mobile-data-table td[colspan]::before { content:none; }
  #member-search { width:min(220px,65vw) !important; }
  .toast { top:72px; max-width:calc(100vw - 24px); border-radius:12px; text-align:center; }

  /* 菜品页：参考图的分类轨道与商品操作列表 */
  .desktop-menu-categories,.desktop-menu-products { display:none; }
  .mobile-menu-layout { display:block; margin:-14px -12px 0; background:#fff; min-height:calc(100dvh - 130px); }
  .mobile-menu-summary { min-height:48px; padding:12px 15px; display:flex; align-items:baseline; justify-content:space-between; gap:8px; border-bottom:1px solid #ece6dd; }
  .mobile-menu-summary strong { font-size:14px; }
  .mobile-menu-summary span { color:var(--muted); font-size:12px; }
  .mobile-menu-catalog { display:grid; grid-template-columns:clamp(86px,25vw,112px) minmax(0,1fr); min-height:calc(100dvh - 184px); }
  .mobile-category-rail { background:#f4f2ef; border-right:1px solid #ebe5dd; }
  .mobile-category { position:relative; display:flex; align-items:center; justify-content:space-between; gap:4px; width:100%; min-height:66px; padding:12px 8px 12px 11px; border:0; background:transparent; color:#6d6259; text-align:left; font:600 13px/1.35 var(--sans); cursor:pointer; overflow-wrap:anywhere; }
  .mobile-category small { color:#a69a8d; font-size:10px; }
  .mobile-category.active { background:#fff; color:var(--ink); font-weight:800; }
  .mobile-category.active::before { content:""; position:absolute; left:0; top:14px; bottom:14px; width:3px; border-radius:0 3px 3px 0; background:var(--brand); }
  .mobile-product-content { min-width:0; padding:0 10px 104px; background:#fff; }
  .mobile-product-heading { display:flex; justify-content:space-between; gap:8px; padding:15px 2px 11px; color:#8a7d70; font-size:12px; border-bottom:1px solid #eee8df; }
  .mobile-product-heading span { color:#b0a596; }
  .mobile-product-content .product-manage-row { display:grid; grid-template-columns:58px minmax(0,1fr); gap:5px 10px; margin:0; padding:16px 2px; border:0; border-bottom:1px solid #eee8df; border-radius:0; box-shadow:none; background:#fff; }
  .mobile-product-content .product-manage-row.is-paused { opacity:.62; }
  .mobile-product-content .product-row .thumb { grid-column:1; grid-row:1/3; width:58px; height:58px; border-radius:9px; }
  .mobile-product-content .product-row .info { grid-column:2; grid-row:1; }
  .mobile-product-content .product-row .name { font-size:14px; line-height:1.35; overflow-wrap:anywhere; }
  .mobile-product-content .product-row .desc { max-width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .mobile-product-content .product-config-tags { margin-top:5px; gap:3px; }
  .mobile-product-content .product-config-tags .pill { padding:2px 5px; font-size:10px; }
  .mobile-product-content .product-row > .price { grid-column:2; grid-row:2; font-size:17px; }
  .mobile-product-content .product-row > .pill.gold { display:none; }
  .mobile-product-content .product-row .row-actions { grid-column:1/-1; display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:5px; margin-top:7px; }
  .mobile-product-content .product-row .row-actions .btn { min-height:36px; padding:6px 1px; border-radius:8px; font-size:11px; white-space:normal; line-height:1.15; }
  .mobile-product-empty { padding:36px 12px; color:var(--muted); font-size:13px; text-align:center; }
  .mobile-menu-actions { position:fixed; z-index:25; left:0; right:0; bottom:calc(62px + env(safe-area-inset-bottom)); height:68px; display:grid; grid-template-columns:1fr 1fr; background:#fff; border-top:1px solid #e7dfd5; box-shadow:0 -4px 18px rgba(44,23,11,.05); }
  .mobile-menu-actions button { border:0; background:none; color:var(--brand); display:flex; flex-direction:column; align-items:center; justify-content:center; gap:2px; font:700 12px var(--sans); cursor:pointer; }
  .mobile-menu-actions button:first-child { border-right:1px solid #eee6da; font-size:21px; }
  .mobile-menu-actions button:first-child span { font-size:12px; }
  .mobile-menu-actions button b { display:grid; place-items:center; width:38px; height:38px; border-radius:50%; background:var(--gold); color:#4d2b15; font-size:28px; font-weight:400; line-height:1; }
  .mobile-category-manage:not(.hidden) { display:block; position:fixed; z-index:28; top:62px; bottom:calc(130px + env(safe-area-inset-bottom)); left:0; right:0; overflow-y:auto; padding:17px; background:#faf8f5; }
  .mobile-category-manage-head { display:flex; align-items:center; justify-content:space-between; font-size:18px; }
  .mobile-category-manage-head button { border:0; background:none; font-size:28px; color:var(--muted); min-width:42px; min-height:42px; }
  .mobile-category-manage p { margin:5px 0 17px; color:var(--muted); font-size:12px; }
  .mobile-category-manage-row { display:flex; align-items:center; justify-content:space-between; min-height:52px; margin:7px 0; padding:7px 13px; border-radius:12px; background:#fff; font-size:14px; font-weight:600; }
  .mobile-category-manage-row button { border:0; background:none; color:var(--danger); font-size:22px; min-width:38px; min-height:38px; }
  #mobile-add-cat { margin-top:17px; min-height:46px; }
}
