/* ==========================================================================
   欢乐浔®DIY手工坊 —— 拼豆店管理系统 样式
   移动端优先，全部自适应
   ========================================================================== */

:root {
  --teal: #0aa5a5;
  --teal-dark: #078a8a;
  --teal-soft: #e6f7f7;
  --orange: #f08a24;
  --orange-dark: #d9741a;
  --orange-soft: #fff3e4;

  --free: #16a34a;
  --free-soft: #e7f8ed;
  --reserved: #2563eb;
  --reserved-soft: #e8f0fe;
  --inuse: #f08a24;
  --inuse-soft: #fff3e4;
  --over: #e11d48;
  --over-soft: #ffe9ee;

  --enough: #16a34a;
  --low: #f08a24;
  --out: #e11d48;

  --text: #1f2937;
  --text-soft: #6b7280;
  --line: #e5e7eb;
  --line-strong: #d1d5db;
  --bg: #f5f6f8;
  --card: #ffffff;

  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 3px rgba(16, 24, 40, .06), 0 6px 18px rgba(16, 24, 40, .05);
  --shadow-lg: 0 8px 30px rgba(16, 24, 40, .14);
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
}

a { color: var(--teal-dark); text-decoration: none; }
h1, h2, h3, h4 { margin: 0 0 .4em; line-height: 1.3; }
p { margin: 0 0 .6em; }
img { max-width: 100%; }

/* ---------------------------------------------------------------- 公共组件 */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  margin-bottom: 16px;
}
.card-title {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-bottom: 12px;
}
.card-title h3 { margin: 0; font-size: 16px; }
.card-title .hint { color: var(--text-soft); font-size: 12.5px; }

.muted { color: var(--text-soft); }
.small { font-size: 12.5px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.nowrap { white-space: nowrap; }
.center { text-align: center; }
.right { text-align: right; }
.mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mt16 { margin-top: 16px; }
.mb0 { margin-bottom: 0; } .mb8 { margin-bottom: 8px; } .mb12 { margin-bottom: 12px; }
.w100 { width: 100%; }

.row { display: flex; flex-wrap: wrap; gap: 12px; }
.row > * { flex: 1 1 220px; min-width: 0; }

.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 9px; border-radius: 999px;
  font-size: 12px; font-weight: 600; line-height: 1.7;
  border: 1px solid transparent;
}
.badge-free     { color: var(--free);     background: var(--free-soft);     border-color: #bfe8cd; }
.badge-reserved { color: var(--reserved); background: var(--reserved-soft); border-color: #c3d8fb; }
.badge-inuse    { color: var(--inuse);    background: var(--inuse-soft);    border-color: #fbd8ae; }
.badge-over     { color: var(--over);     background: var(--over-soft);     border-color: #fbc3cf; }
.badge-enough   { color: var(--enough);   background: var(--free-soft);     border-color: #bfe8cd; }
.badge-low      { color: var(--low);      background: var(--inuse-soft);    border-color: #fbd8ae; }
.badge-out      { color: var(--out);      background: var(--over-soft);     border-color: #fbc3cf; }
.badge-gray     { color: var(--text-soft);background: #f3f4f6;              border-color: var(--line); }

/* 按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 15px; border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong); background: #fff; color: var(--text);
  font-size: 14px; font-weight: 600; font-family: inherit;
  cursor: pointer; transition: .15s; white-space: nowrap;
}
.btn:hover { background: #f9fafb; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--teal); border-color: var(--teal); color: #fff; }
.btn-primary:hover { background: var(--teal-dark); }
.btn-orange { background: var(--orange); border-color: var(--orange); color: #fff; }
.btn-orange:hover { background: var(--orange-dark); }
.btn-danger { background: var(--over); border-color: var(--over); color: #fff; }
.btn-danger:hover { filter: brightness(.94); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--teal-dark); }
.btn-sm { padding: 5px 10px; font-size: 12.5px; border-radius: 8px; }
.btn-lg { padding: 12px 22px; font-size: 15.5px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

.icon-btn {
  width: 38px; height: 38px; padding: 0; border-radius: 10px;
  border: 1px solid var(--line); background: #fff; font-size: 17px;
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
}

/* 表单 */
label.field { display: block; margin-bottom: 12px; }
label.field > span.lbl {
  display: block; margin-bottom: 5px; font-size: 13px; font-weight: 600; color: #374151;
}
input[type=text], input[type=password], input[type=number], input[type=time],
input[type=datetime-local], input[type=date], input[type=month],
input[type=search], select, textarea {
  width: 100%; padding: 10px 11px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  font-size: 15px; font-family: inherit; color: var(--text); background: #fff;
}
textarea { min-height: 92px; resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(10, 165, 165, .14);
}
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, #9ca3af 50%), linear-gradient(135deg, #9ca3af 50%, transparent 50%); background-position: calc(100% - 17px) 50%, calc(100% - 12px) 50%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 34px; }
.field-help { font-size: 12.5px; color: var(--text-soft); margin-top: 4px; }
.inline-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
/* 带按钮的一行：控件与按钮放进同一个 flex 行，用 align-items:center 居中，
   结构上保证两者中线对齐（比"靠隐藏标签撑高度"更稳，不受字体/行高影响） */
.control-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.control-row > input, .control-row > select, .control-row > textarea { flex: 1 1 130px; width: auto; }
.control-row > .qty-input { flex: 0 0 auto; }
/* 按钮保持自身高度，既不拉伸也不压缩（否则会比输入框高/矮） */
.control-row > .btn {
  flex: 0 0 auto; width: auto;
  align-self: center;
  height: 42px;            /* 与同排输入框实测高度一致（42px） */
  padding-top: 0; padding-bottom: 0;
  margin-top: 13px;        /* 配合 align-self:center，实际下移约 6.5px，使中线与输入框对齐 */
}
.control-row.v-center { min-height: 42px; }
.inline-form > * { flex: 1 1 160px; }
.inline-form .btn { flex: 0 0 auto; }
/* 表单里与输入框同一行的纯文字说明：与输入框底部对齐 */
.inline-form > .inline-note { align-self: flex-end; padding-bottom: 11px; }
.checkbox { display: inline-flex; align-items: center; gap: 7px; font-size: 14px; cursor: pointer; }
.checkbox input { width: 17px; height: 17px; margin: 0; accent-color: var(--teal); }

/* 提示条 */
.alert {
  display: flex; align-items: flex-start; gap: 9px;
  padding: 11px 13px; border-radius: var(--radius-sm); margin-bottom: 12px;
  font-size: 14px; border: 1px solid transparent;
}
.alert-icon {
  flex: 0 0 19px; width: 19px; height: 19px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: #fff; margin-top: 1px;
}
.alert-success { background: var(--free-soft); border-color: #bfe8cd; color: #166534; }
.alert-success .alert-icon { background: var(--free); }
.alert-error { background: var(--over-soft); border-color: #fbc3cf; color: #9f1239; }
.alert-error .alert-icon { background: var(--over); }
.alert-warning { background: var(--orange-soft); border-color: #fbd8ae; color: #9a5b12; }
.alert-warning .alert-icon { background: var(--orange); }
.alert-info { background: var(--teal-soft); border-color: #b7e6e6; color: #0f5f5f; }
.alert-info .alert-icon { background: var(--teal); }

/* 统计卡 */
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 16px; }
.stat-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 14px; box-shadow: var(--shadow);
}
.stat-value { font-size: 24px; font-weight: 700; line-height: 1.15; }
.stat-label { font-size: 12.5px; color: var(--text-soft); margin-top: 2px; }
.stat-card.free .stat-value { color: var(--free); }
.stat-card.reserved .stat-value { color: var(--reserved); }
.stat-card.inuse .stat-value { color: var(--inuse); }
.stat-card.over .stat-value { color: var(--over); }
.stat-card.enough .stat-value { color: var(--enough); }
.stat-card.low .stat-value { color: var(--low); }
.stat-card.out .stat-value { color: var(--out); }

/* 表格 */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -16px; padding: 0 16px; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 560px; }
table.data th, table.data td { padding: 9px 10px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.data th { background: #fafafa; font-size: 12.5px; color: #4b5563; font-weight: 600; position: sticky; top: 0; }
table.data tbody tr:hover { background: #fafcff; }
table.data td.num { text-align: right; font-variant-numeric: tabular-nums; }

/* 空态 */
.empty { text-align: center; padding: 30px 12px; color: var(--text-soft); }
.empty .big { font-size: 30px; display: block; margin-bottom: 6px; }

/* ================================================================== 前台看板 */
.public-wrap { max-width: 1040px; margin: 0 auto; padding: 16px 14px 40px; }

.board-title { text-align: center; padding: 10px 0 4px; }
.board-title h1 {
  font-size: 25px; color: var(--orange); font-weight: 800;
  letter-spacing: 1px; margin: 0;
}
.board-title h2 {
  font-size: 19px; color: var(--orange); font-weight: 600;
  letter-spacing: 5px; margin: 6px 0 0; padding-left: 5px;
}
.board-meta {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: 8px 14px; margin: 12px 0 16px; font-size: 13px; color: var(--text-soft);
}
.board-clock { font-variant-numeric: tabular-nums; font-weight: 600; color: #374151; }
.live-dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--free); margin-right: 5px; animation: pulse 2s infinite;
}
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .25; } }

.legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 12px; margin-bottom: 16px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: #374151; }
.legend i { width: 15px; height: 15px; border-radius: 4px; display: inline-block; border: 1px solid rgba(0,0,0,.08); }
.legend .lg-free { background: var(--free); }
.legend .lg-reserved { background: var(--reserved); }
.legend .lg-inuse { background: var(--inuse); }
.legend .lg-over { background: var(--over); }

.room {
  border: 2px solid #b9bec6; background: #fff; border-radius: 6px;
  display: flex; margin-bottom: 18px; overflow: hidden;
}
.room-label {
  flex: 0 0 76px; background: #f4f4f5; border-right: 1px solid #d6d9de;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; font-weight: 700; color: #374151; letter-spacing: 1px;
}
.room-body {
  flex: 1 1 auto; min-width: 0; background: #f7f8f9;
  padding: 16px; display: flex; flex-direction: column;
}
/* ============================ 自由画布（所见即所得，前台与编辑器共用坐标）
   高度用「宽度 × 比例」的方式实现（padding 撑高 + 绝对定位铺满），
   不依赖 aspect-ratio，兼容所有浏览器与内嵌外壳。
   画布比例由 --ratio 控制：画布高度 = 宽度 × (--ratio / 100)。 */
.canvas-wrap {
  position: relative;
  width: 100%;
  min-height: 80px;
  height: 0;
  padding-bottom: calc(var(--ratio, 60) * 1%);
}
.canvas {
  position: absolute; left: 0; top: 0;
  width: 100%; height: 100%;
  background:
    linear-gradient(#eef1f4 1px, transparent 1px) 0 0 / 100% 12.5%,
    linear-gradient(90deg, #eef1f4 1px, transparent 1px) 0 0 / 10% 100%,
    #f7f8f9;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.canvas .seat {
  position: absolute; margin: 0;
  /* 不要在这里写 height/width：会让内联的百分比尺寸失效（保持留空即可） */
  flex: none;                   /* 覆盖默认的弹性布局 */
  min-height: 0; min-width: 0;
}
.canvas .seat-tag { font-size: clamp(11px, 1.15vw, 19px); }
.canvas .seat-mini { font-size: clamp(8px, .75vw, 12px); }

/* 编辑器画布（同样用 padding 撑高，保证任何环境下色块都有高度） */
.ed-canvas-wrap {
  position: relative;
  width: 100%;
  min-height: 120px;
  height: 0;
  padding-bottom: calc(var(--ratio, 60) * 1%);
}
.ed-canvas {
  position: absolute; left: 0; top: 0;
  width: 100%; height: 100%;
  background:
    linear-gradient(#e4e8ec 1px, transparent 1px) 0 0 / 100% 6.25%,
    linear-gradient(90deg, #e4e8ec 1px, transparent 1px) 0 0 / 5% 100%,
    #fbfcfd;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  overflow: hidden; touch-action: none; user-select: none;
}
.ed-seat {
  position: absolute; box-sizing: border-box;
  display: flex; align-items: center; justify-content: center;
  background: #cdeeee; border: 2px solid var(--teal); border-radius: 6px;
  color: #0f6f6f; font-weight: 700; font-size: clamp(11px, 1.1vw, 16px);
  cursor: move; overflow: hidden; text-align: center; padding: 0 2px;
  touch-action: none; z-index: 2;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .12);
}
.ed-debug {
  margin-top: 8px; font-size: 12px; color: var(--text-soft);
  background: #f6f8fa; border: 1px dashed var(--line-strong); border-radius: 8px; padding: 8px 10px;
  white-space: pre-wrap; font-family: ui-monospace, Menlo, Consolas, monospace;
}
.ed-seat.dragging { opacity: .85; cursor: grabbing; z-index: 5; }
/* 编辑器里按座位真实状态着色，便于对照前台看板 */
.ed-seat.st-free     { background: var(--free-soft);     border-color: var(--free);     color: #166534; }
.ed-seat.st-reserved { background: var(--reserved-soft); border-color: var(--reserved); color: #1e40af; }
.ed-seat.st-inuse    { background: var(--inuse-soft);    border-color: var(--inuse);    color: #9a5b12; }
.ed-seat.st-over     { background: var(--over-soft);     border-color: var(--over);     color: #9f1239; }
.ed-seat.st-new      { background: #e6f7f7;              border-color: var(--teal);     color: #0f6f6f; border-style: dashed; }
/* 选中样式放在最后，保证优先级高于状态配色 */
.ed-seat.sel { outline: 2px solid #7c3aed; outline-offset: 1px; background: #f0e8ff; border-color: #7c3aed; border-style: solid; color: #5b21b6; z-index: 3; }
.ed-seat .ed-label {
  display: block; width: 100%; text-align: center;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  pointer-events: none;
}
.ed-seat .ed-grip {
  position: absolute; right: -1px; bottom: -1px;
  width: 15px; height: 15px; cursor: nwse-resize;
  background: #7c3aed; border-radius: 4px 0 4px 0;
  display: none;
}
.ed-seat .ed-grip::after {
  content: ""; position: absolute; right: 2px; bottom: 2px;
  width: 6px; height: 6px; border-right: 2px solid #fff; border-bottom: 2px solid #fff;
}
.ed-seat.sel .ed-grip { display: block; }
.ed-hint {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  margin-bottom: 10px; font-size: 12.5px; color: var(--text-soft);
}
.ed-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 10px; }

/* ---------------- 账号管理：角色权限标签 ---------------- */
.perm-chip {
  display: inline-block; padding: 2px 8px; margin: 0 4px 4px 0;
  border-radius: 999px; font-size: 11.5px; line-height: 1.7;
  border: 1px solid var(--line);
}
.perm-chip.on  { background: #e6f7f7; color: #0f6f6f; border-color: #b9e4e4; font-weight: 700; }
.perm-chip.off { background: #f6f7f9; color: #b0b8c0; text-decoration: line-through; }

.acc-perm-preview {
  margin: 2px 0 12px; padding: 9px 11px; border-radius: 9px;
  background: var(--bg-soft, #f6f9fb); border: 1px solid var(--line);
  min-height: 34px;
}
.acc-perm-preview::before {
  content: "该角色可访问：";
  display: block; font-size: 11.5px; color: var(--text-soft);
  margin-bottom: 5px;
}
.acc-who {
  padding: 9px 11px; margin-bottom: 12px; border-radius: 9px;
  background: var(--bg-soft, #f6f9fb); border: 1px solid var(--line); font-size: 13.5px;
}

/* 角色权限一览表里的说明列窄一些时更好读 */
.acc-json { display: none; }

/* ---------------- 虚拟标注（门 / 窗 / 桌 / 柜）---------------- */
/* 前台看板与后台预览里的标注 */
.canvas .canvas-mark,
.canvas-wrap .canvas-mark {
  pointer-events: none;                 /* 标注不可点击，避免挡住座位 */
  z-index: 1;
}
.canvas .canvas-mark .mk-txt,
.canvas-wrap .canvas-mark .mk-txt {
  font-size: clamp(9px, .9vw, 15px);
  font-weight: 700;
  line-height: 1.1;
  padding: 0 3px;
  white-space: nowrap;
}

/* 编辑器里的标注：可拖动、可缩放 */
.ed-mark {
  cursor: move;
  z-index: 1;
  font-weight: 700;
  font-size: 12.5px;
  touch-action: none;
  user-select: none;
}
.ed-mark .mk-txt { padding: 0 3px; white-space: nowrap; overflow: hidden; }
.ed-mark .ed-grip {
  display: none; position: absolute; right: -5px; bottom: -5px;
  width: 14px; height: 14px; border-radius: 3px;
  background: #7c3aed; border: 2px solid #fff; cursor: nwse-resize;
  box-shadow: 0 1px 3px rgba(0,0,0,.25);
}
.ed-mark.sel .ed-grip { display: block; }
.ed-mark.sel {
  outline: 2px solid #7c3aed; outline-offset: 1px;
  box-shadow: 0 0 0 3px rgba(124, 58, 237, .15);
  z-index: 4;
}
.ed-mark.dragging { opacity: .85; cursor: grabbing; z-index: 6; }

/* 各类型标注的配色（与 PHP 里的定义一致，作为兜底） */
.ed-mark.mk-door,    .canvas-mark.mk-door    { background: #fef3c7; border: 1px dashed #b45309; color: #b45309; }
.ed-mark.mk-window,  .canvas-mark.mk-window  { background: #e0f2fe; border: 1px dashed #0369a1; color: #0369a1; }
.ed-mark.mk-table,   .canvas-mark.mk-table   { background: #ecfccb; border: 1px dashed #4d7c0f; color: #4d7c0f; }
.ed-mark.mk-cabinet, .canvas-mark.mk-cabinet { background: #f3e8ff; border: 1px dashed #7c3aed; color: #7c3aed; }
.ed-mark.mk-pillar,  .canvas-mark.mk-pillar  { background: #e5e7eb; border: 1px solid #4b5563; color: #374151; }
.ed-mark.mk-stairs,  .canvas-mark.mk-stairs  { background: #fde68a; border: 1px dashed #92400e; color: #92400e; }

/* 标注工具条 */
.ed-toolbar-mark {
  background: #f8fafc; border: 1px solid var(--line); border-radius: 10px;
  padding: 8px 10px; margin-bottom: 8px;
}
.ed-toolbar-mark .mk-title {
  font-size: 13px; font-weight: 700; color: var(--text-soft); margin-right: 2px;
}
.ed-toolbar-mark .mk-sep {
  display: inline-block; width: 1px; height: 18px; background: var(--line); margin: 0 4px;
}
.mk-help { margin-bottom: 12px; line-height: 1.7; }
.mk-help b { color: var(--text); }

@media (max-width: 560px) {
  .ed-toolbar-mark { padding: 8px; gap: 6px; }
  .ed-toolbar-mark .mk-title { width: 100%; }
}
.ed-status { position: absolute; left: 6px; bottom: 6px; font-size: 11px; color: #6b7280; background: rgba(255,255,255,.75); padding: 1px 5px; border-radius: 4px; }

.seat {
  display: flex; align-items: center; justify-content: center;
  min-height: 42px;
  border: 1px solid #b9bec6; margin: 0;
  color: #fff; font-weight: 700; cursor: pointer;
  transition: filter .15s, transform .1s;
  position: relative; padding: 0 2px;
}
.seat:hover { filter: brightness(1.06); }
.seat:active { transform: scale(.98); }
.seat.st-free { background: var(--free); }
.seat.st-reserved { background: var(--reserved); }
.seat.st-inuse { background: var(--inuse); }
.seat.st-over { background: var(--over); animation: flash 1.1s infinite; }
.seat.st-unknown { background: #9ca3af; }
@keyframes flash { 0%,100% { background: var(--over); } 50% { background: #ff8fa6; } }
.seat .seat-tag {
  font-size: 17px; font-weight: 800; letter-spacing: .5px;
  text-shadow: 0 1px 1px rgba(0, 0, 0, .12);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 3px;
}
.seat .seat-mini {
  position: absolute; right: 3px; bottom: 2px;
  font-size: 10px; font-weight: 600; opacity: .92;
}

.board-foot { text-align: center; font-size: 12.5px; color: var(--text-soft); padding: 6px 0 20px; }

/* 座位弹层 */
.modal {
  position: fixed; inset: 0; background: rgba(17, 24, 39, .5);
  display: none; align-items: center; justify-content: center; padding: 18px; z-index: 60;
}
.modal.show { display: flex; }
.modal-box {
  background: #fff; border-radius: 16px; width: 100%; max-width: 400px;
  box-shadow: var(--shadow-lg); overflow: hidden; animation: pop .16s ease-out;
}
@keyframes pop { from { transform: scale(.96); opacity: .6; } to { transform: scale(1); opacity: 1; } }
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-bottom: 1px solid var(--line); font-weight: 700;
}
.modal-body { padding: 16px; }
.modal-foot { padding: 12px 16px; border-top: 1px solid var(--line); display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; align-items: center; background: #fafafa; }
.foot-main { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; width: 100%; }
.foot-sub { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; width: 100%; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.kv:last-child { border-bottom: none; }
.kv .k { color: var(--text-soft); }
.kv .v { font-weight: 600; text-align: right; }
.countdown { font-size: 26px; font-weight: 800; text-align: center; padding: 10px 0 4px; font-variant-numeric: tabular-nums; }
.countdown.warn { color: var(--orange); }
.countdown.over { color: var(--over); }

/* ============================================================= 后台框架 */
.layout { min-height: 100vh; }

.sidebar {
  position: fixed; top: 0; left: 0; bottom: 0; width: 236px; z-index: 50;
  background: #10232b; color: #cbd8dd;
  display: flex; flex-direction: column; overflow-y: auto;
  transform: translateX(-100%); transition: transform .22s ease;
}
.sidebar.open { transform: translateX(0); }
.sidebar-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 16px 14px; border-bottom: 1px solid rgba(255,255,255,.08);
}
.sidebar-brand strong { display: block; color: #fff; font-size: 15px; }
.sidebar-brand small { color: #8fa6ae; font-size: 12px; }
.brand-dot {
  width: 30px; height: 30px; border-radius: 9px; flex: 0 0 30px;
  background: linear-gradient(135deg, var(--teal), var(--orange));
}
.sidebar-nav { padding: 10px 8px; flex: 1 1 auto; }
.nav-link {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 10px; margin-bottom: 3px;
  color: #cbd8dd; font-size: 14px; font-weight: 500;
}
.nav-link:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav-link.active { background: var(--teal); color: #fff; font-weight: 600; }
.nav-icon { width: 20px; text-align: center; font-size: 15px; }
.sidebar-foot { padding: 12px 8px 16px; border-top: 1px solid rgba(255,255,255,.08); }
.sidebar-ver { text-align: center; font-size: 11.5px; color: rgba(255,255,255,.42); padding: 8px 0 2px; letter-spacing: .3px; }
.user-line { display: flex; align-items: center; gap: 10px; padding: 6px 12px 10px; }
.user-line strong { display: block; color: #fff; font-size: 14px; }
.user-line small { color: #8fa6ae; font-size: 12px; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; flex: 0 0 32px;
  background: var(--orange); color: #fff; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
}
.sidebar-mask {
  position: fixed; inset: 0; background: rgba(17,24,39,.45); z-index: 45; display: none;
}
.sidebar-mask.show { display: block; }

.content { min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 10px;
  background: #fff; border-bottom: 1px solid var(--line);
  padding: 10px 14px; padding-top: max(10px, env(safe-area-inset-top));
}
.topbar-title { font-size: 16px; font-weight: 700; flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-right { display: flex; align-items: center; gap: 8px; }
.content-body { padding: 14px; flex: 1 1 auto; }

.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.page-head h2 { margin: 0; font-size: 18px; }
.page-head .sub { color: var(--text-soft); font-size: 13px; margin-top: 2px; }

/* 座位管理网格 */
.seat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(108px, 1fr)); gap: 10px; }
.seat-card {
  border: 1px solid var(--line); border-left-width: 4px; border-radius: var(--radius-sm);
  background: #fff; padding: 10px; cursor: pointer; transition: .15s;
}
.seat-card:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.seat-card.s-free { border-left-color: var(--free); }
.seat-card.s-reserved { border-left-color: var(--reserved); }
.seat-card.s-inuse { border-left-color: var(--inuse); }
.seat-card.s-over { border-left-color: var(--over); background: #fff7f9; }
.seat-card .sc-code { font-size: 19px; font-weight: 800; letter-spacing: .5px; }
.seat-card .sc-state { font-size: 12.5px; color: var(--text-soft); margin-top: 3px; min-height: 18px; }
.seat-card .sc-exp { font-size: 11.5px; color: var(--text-soft); margin-top: 2px; }

/* ---------------- 换座 / 对调弹层 ---------------- */
.mv-src {
  background: var(--bg-soft, #f6f9fb); border: 1px solid var(--line);
  border-radius: 10px; padding: 10px 12px; font-size: 13.5px; color: var(--text);
}
.mv-src b { font-size: 16px; color: var(--teal); }

.mv-legend {
  display: flex; flex-wrap: wrap; gap: 6px 12px; margin-bottom: 10px;
  font-size: 12px; color: var(--text-soft);
}
.mv-legend span { display: inline-flex; align-items: center; gap: 5px; }
.mv-legend i { width: 11px; height: 11px; border-radius: 3px; display: inline-block; border: 1px solid rgba(0,0,0,.08); }
.mv-legend .lg-free { background: var(--free); }
.mv-legend .lg-reserved { background: var(--reserved); }
.mv-legend .lg-inuse { background: var(--inuse); }
.mv-legend .lg-over { background: var(--over); }

.mv-list {
  max-height: 320px; overflow-y: auto; -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line); border-radius: 10px; padding: 10px; background: #fcfdfe;
}
.mv-room { margin-bottom: 12px; }
.mv-room:last-child { margin-bottom: 0; }
.mv-room-name {
  font-size: 12.5px; font-weight: 700; color: var(--text-soft);
  margin-bottom: 6px; padding-left: 2px;
}
.mv-seats { display: flex; flex-wrap: wrap; gap: 6px; }
.mv-seat {
  min-width: 58px; padding: 6px 9px; border-radius: 8px; cursor: pointer;
  border: 2px solid transparent; background: #fff;
  box-shadow: inset 0 0 0 1px var(--line);
  text-align: center; transition: .15s; user-select: none;
}
.mv-seat b { display: block; font-size: 13.5px; font-weight: 700; color: var(--text); line-height: 1.25; }
.mv-seat small { display: block; font-size: 10.5px; color: var(--text-soft); margin-top: 1px; }
.mv-seat:hover { border-color: var(--teal); }
.mv-seat.v-free     { background: #f2fbf3; }
.mv-seat.v-reserved { background: #f2f7ff; }
.mv-seat.v-inuse    { background: #fff8ef; }
.mv-seat.v-over     { background: #fff2f5; }
.mv-seat.v-over small { color: var(--over); font-weight: 700; }
.mv-seat.sel {
  border-color: var(--teal); background: #e8f6f6;
  box-shadow: 0 0 0 3px rgba(10,165,165,.16);
}
.mv-seat.is-self { opacity: .38; cursor: not-allowed; background: #f3f4f6; }
.mv-seat.is-self:hover { border-color: transparent; }

.mv-preview {
  margin-top: 14px; padding: 12px 14px; border-radius: 10px;
  font-size: 13.5px; line-height: 1.6;
  background: var(--bg-soft, #f6f9fb); border: 1px solid var(--line); color: var(--text-soft);
}
.mv-preview b { color: var(--text); }
.mv-preview.ok   { background: #eefaf0; border-color: #bfe6c6; color: #166534; }
.mv-preview.ok b { color: #14532d; }
.mv-preview.swap { background: #eef4ff; border-color: #c3d4f5; color: #1e3a8a; }
.mv-preview.swap b { color: #172554; }
.mv-preview.warn { background: #fff8ec; border-color: #f5d9a8; color: #92500e; }

@media (max-width: 560px) {
  .mv-list { max-height: 260px; }
  .mv-seat { min-width: 52px; padding: 5px 7px; }
  .mv-seat b { font-size: 12.5px; }
}

.room-section { margin-bottom: 18px; }
.room-section > .rs-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-bottom: 9px; padding-left: 2px;
}
.room-section > .rs-head h3 { margin: 0; font-size: 16px; }

/* 时长选择（弹层内） */
.dur-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.dur-grid.two { grid-template-columns: repeat(2, 1fr); }
.dur-opt {
  border: 1.5px solid var(--line-strong); border-radius: var(--radius-sm);
  background: #fff; padding: 11px 6px; text-align: center;
  font-size: 14px; font-weight: 600; cursor: pointer; transition: .14s;
}
.dur-opt small { display: block; font-size: 11px; font-weight: 500; color: var(--text-soft); margin-top: 2px; }
.dur-opt:hover { border-color: var(--teal); }
.dur-opt.sel { border-color: var(--teal); background: var(--teal-soft); color: var(--teal-dark); }
.dur-opt.sel small { color: var(--teal-dark); }
.status-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.status-opt {
  border: 1.5px solid var(--line-strong); border-radius: var(--radius-sm);
  background: #fff; padding: 10px 4px; text-align: center;
  font-weight: 700; font-size: 14px; cursor: pointer; transition: .14s;
}
.status-opt small { display: block; font-size: 11px; font-weight: 500; color: var(--text-soft); margin-top: 2px; }
.status-opt[data-status=free].sel { border-color: var(--free); background: var(--free-soft); color: var(--free); }
.status-opt[data-status=reserved].sel { border-color: var(--reserved); background: var(--reserved-soft); color: var(--reserved); }
.status-opt[data-status=inuse].sel { border-color: var(--inuse); background: var(--inuse-soft); color: var(--inuse); }
.form-section { margin-bottom: 14px; }
.form-section > .fs-label { font-size: 13px; font-weight: 700; color: #374151; margin-bottom: 7px; }

/* 开关式勾选项（如「前台看板需要登录」） */
.switch-row {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 14px; border: 1px solid var(--line-strong, #d1d5db);
  border-radius: 12px; background: #fbfcfd; cursor: pointer;
}
.switch-row:hover { border-color: var(--teal); background: #f6fdfd; }
.switch-row input[type="checkbox"] {
  flex: none; width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--teal); cursor: pointer;
}
.switch-row > span { font-size: 14px; line-height: 1.5; }
.switch-row b { font-size: 14.5px; }

/* ===== 房间排序 ===== */
.sort-bar-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.sort-handle {
  flex: none; cursor: grab; user-select: none; touch-action: none;
  font-size: 19px; line-height: 1; color: var(--muted, #94a3b8);
  padding: 4px 6px; margin-right: 2px; border-radius: 8px;
}
.sort-handle:hover { background: #eef2f7; color: var(--teal); }
.sort-handle:active { cursor: grabbing; }
.room-card.dragging { opacity: .55; box-shadow: 0 10px 28px rgba(16, 24, 40, .2); }
.room-placeholder {
  height: 74px; margin: 12px 0; border-radius: 14px;
  border: 2px dashed var(--teal); background: var(--teal-soft, #e6f6f6);
}
.sort-pos { flex: none; }
.sort-actions { flex: none; display: inline-flex; gap: 4px; margin-left: auto; }
.sort-actions form { display: inline; }
.sort-actions .icon-btn {
  width: 32px; height: 32px; border-radius: 9px; font-size: 15px; font-weight: 700;
  border: 1px solid var(--line-strong, #d1d5db); background: #fff; color: #334155; cursor: pointer;
}
.sort-actions .icon-btn:hover:not([disabled]) { border-color: var(--teal); color: var(--teal); }
.sort-actions .icon-btn[disabled] { opacity: .35; cursor: not-allowed; }

/* ===== 页脚：技术支持 ===== */
.site-foot {
  margin-top: auto;                       /* 内容不足时贴到内容区底部 */
  padding: 18px 16px calc(18px + env(safe-area-inset-bottom, 0px));
  text-align: center; font-size: 12.5px; line-height: 1.7;
  color: #94a3b8;
  border-top: 1px solid var(--line, #e5e7eb);
  background: transparent;
}
.site-foot a {
  color: var(--teal); text-decoration: none; font-weight: 600;
  border-bottom: 1px dashed rgba(10, 165, 165, .45);
}
.site-foot a:hover { color: #0b8f8f; border-bottom-style: solid; }
/* 公开页面（前台看板）页脚：与看板同宽居中，视觉上连成一体 */
.site-foot-public {
  max-width: 1040px; margin: 0 auto;
  padding: 16px 14px calc(26px + env(safe-area-inset-bottom, 0px));
  font-size: 13.5px;
  color: #64748b;
  border-top: 1px solid #eef2f6;
}
@media print {
  .site-foot { display: none; }
}

/* 豆仓 */
.family-block { margin-bottom: 16px; }
.family-head {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  padding: 9px 12px; background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius) var(--radius) 0 0; border-bottom: none;
}
.family-head .fam-name { font-weight: 700; font-size: 15px; }
.family-head .fam-dot { width: 13px; height: 13px; border-radius: 4px; background: var(--teal); }
.family-body { background: #fff; border: 1px solid var(--line); border-radius: 0 0 var(--radius) var(--radius); padding: 12px; }
.bean-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(154px, 1fr)); gap: 9px; }
.bean-card {
  border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 9px 10px; background: #fdfdfd;
}
.bean-card.lv-low { border-color: #fbd8ae; background: #fffbf6; }
.bean-card.lv-out { border-color: #fbc3cf; background: #fff7f9; }
.bean-card .bc-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.bean-card .bc-code {
  font-weight: 800; font-size: 14px; letter-spacing: .3px;
  display: inline-block; padding: 2px 8px; border-radius: 6px;
  border: 1px solid transparent; background: #F2F7F4; color: #16483F;
}
.bean-card .bc-num { display: flex; gap: 10px; margin-top: 6px; font-size: 12.5px; color: var(--text-soft); flex-wrap: wrap; }
.bean-card .bc-num b { color: var(--text); font-size: 13.5px; }
.bean-card .bc-actions { display: flex; gap: 6px; margin-top: 8px; }

.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  border: 1px solid var(--line-strong); background: #fff; border-radius: 999px;
  padding: 3px 10px; font-size: 12.5px; font-weight: 600; cursor: pointer;
}
.chip.sel { background: var(--teal); border-color: var(--teal); color: #fff; }

/* 库存状态筛选：色系标题上的「充足/告急/缺货」标签可点击 */
.lv-chip { cursor: pointer; user-select: none; transition: transform .08s ease, box-shadow .12s ease; }
.lv-chip:hover { box-shadow: 0 2px 6px rgba(16, 24, 40, .12); }
.lv-chip:active { transform: scale(.96); }
.lv-chip.sel { outline: 2px solid var(--teal); outline-offset: 1px; font-weight: 700; }

/* 筛选提示条：始终可一键「显示全部」 */
.filter-hint {
  display: none; align-items: center; gap: 10px; flex-wrap: wrap;
  margin: 0 0 10px; padding: 8px 12px; border-radius: 10px;
  background: var(--teal-soft, #e6f6f6); color: #0f6f6f; font-size: 13px; font-weight: 600;
}
.filter-hint.show { display: flex; }
.filter-hint .btn { flex: none; }

.fam-empty { padding: 10px 2px; }

/* ===== 座位到期提醒：面板 + 右下角弹窗 ===== */
.warn-panel .warn-row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
/* 需要用户点一下才能发声时，给按钮加个跳动的提示 */
.btn.attention {
  background: #fff7ed; border-color: #fdba74; color: #b45309;
  animation: attnPulse 1.4s ease-in-out infinite;
}
@keyframes attnPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(253, 186, 116, .7); }
  50%      { box-shadow: 0 0 0 6px rgba(253, 186, 116, 0); }
}
.warn-panel .warn-min {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; color: #475569;
}
.warn-panel .warn-min input {
  width: 68px; padding: 5px 8px; border: 1px solid var(--line-strong, #d1d5db);
  border-radius: 8px; text-align: center; font-size: 14px;
}
.warn-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.warn-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600;
  color: #b45309; background: #fef3c7; border: 1px solid #fbd8ae;
}
.warn-chip.over { color: #b91c1c; background: #fee2e2; border-color: #fecaca; }

.toast-wrap {
  position: fixed; right: 16px; bottom: 16px; z-index: 9999;
  display: flex; flex-direction: column; gap: 10px;
  max-width: min(340px, calc(100vw - 32px));
}
.toast {
  position: relative; padding: 12px 34px 12px 14px; border-radius: 12px;
  font-size: 14px; line-height: 1.45; color: #7c2d12;
  background: #fff7ed; border: 1px solid #fdba74;
  box-shadow: 0 8px 24px rgba(16, 24, 40, .16);
  animation: toastIn .22s ease-out;
}
.toast.toast-over { color: #7f1d1d; background: #fef2f2; border-color: #fca5a5; }
.toast b { font-size: 15px; }
.toast .toast-x {
  position: absolute; right: 6px; top: 6px; width: 22px; height: 22px;
  border: 0; background: transparent; color: inherit; opacity: .6;
  font-size: 14px; cursor: pointer; line-height: 1; border-radius: 6px;
}
.toast .toast-x:hover { opacity: 1; background: rgba(0, 0, 0, .06); }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

@media (max-width: 480px) {
  .toast-wrap { right: 8px; left: 8px; bottom: 8px; max-width: none; }
}

.qty-input { display: flex; align-items: center; gap: 6px; }
.qty-input button {
  width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--line-strong);
  background: #fff; font-size: 17px; font-weight: 700; cursor: pointer; line-height: 1;
}
.qty-input input { text-align: center; width: 74px; }

.log-list { display: flex; flex-direction: column; gap: 8px; }
.log-item {
  display: flex; align-items: flex-start; gap: 10px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px;
}
.log-item .li-icon {
  width: 32px; height: 32px; flex: 0 0 32px; border-radius: 9px;
  display: inline-flex; align-items: center; justify-content: center; font-size: 15px;
  background: #f3f4f6;
}
.log-item .li-icon.inbound { background: var(--free-soft); }
.log-item .li-icon.outbound { background: var(--over-soft); }
.log-item .li-icon.transfer { background: var(--reserved-soft); }
.log-item .li-main { flex: 1 1 auto; min-width: 0; }
.log-item .li-title { font-size: 14px; font-weight: 600; }
.log-item .li-sub { font-size: 12px; color: var(--text-soft); margin-top: 2px; }
.log-item .li-amount { font-weight: 700; font-variant-numeric: tabular-nums; }

/* 登录页 */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 24px;
  background:
    radial-gradient(900px 500px at 18% 12%, rgba(20,116,110,.45), transparent 62%),
    radial-gradient(760px 460px at 82% 84%, rgba(226,120,60,.36), transparent 60%),
    linear-gradient(155deg, #0b2f34 0%, #0d2129 46%, #1d1811 100%);
  background-attachment: fixed;
}
.login-box {
  width: 100%; max-width: 380px;
  background: rgba(255,255,255,.97);
  border: 1px solid rgba(255,255,255,.5);
  border-radius: 20px; padding: 30px 26px 24px;
  box-shadow: 0 24px 60px rgba(0,0,0,.34), 0 2px 0 rgba(255,255,255,.6) inset;
  backdrop-filter: blur(6px);
}
.login-logo-img {
  width: 64px; height: 64px; display: block;
  margin: 0 auto 12px; border-radius: 16px;
  background: #fff; padding: 6px;
  box-shadow: 0 6px 18px rgba(13,59,64,.18);
}
.login-brand h1 { font-size: 21px; letter-spacing: .2px; }
.login-brand p { color: #7B8C87; }
.login-brand { text-align: center; margin-bottom: 20px; }
.login-brand h1 { font-size: 21px; color: var(--orange); margin: 0 0 4px; }
.login-brand p { color: var(--text-soft); font-size: 13px; margin: 0; }
.login-logo {
  width: 54px; height: 54px; border-radius: 15px; margin: 0 auto 12px;
  background: linear-gradient(135deg, var(--teal), var(--orange));
  display: flex; align-items: center; justify-content: center; font-size: 25px;
}

/* 安装 / 自检页 */
.setup-wrap { max-width: 760px; margin: 0 auto; padding: 24px 14px 40px; }
.check-list { list-style: none; padding: 0; margin: 0; }
.check-list li { display: flex; gap: 9px; align-items: flex-start; padding: 7px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.check-list li:last-child { border-bottom: none; }
.check-list .ck { font-weight: 700; }
.check-list .ok { color: var(--free); }
.check-list .no { color: var(--over); }
pre.code {
  background: #10232b; color: #d7e6ea; padding: 13px; border-radius: var(--radius-sm);
  overflow-x: auto; font-size: 12.5px; line-height: 1.6;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* ------------------------------------------------- 房间布局（后台预览/编辑器） */
.mini-board { overflow-x: auto; }
.mini-board .canvas { background: #f7f8f9; }
.mini-board .seat { cursor: default; }
.mini-board .seat:hover { filter: none; }

.ed-mini {
  width: auto; padding: 5px 8px; font-size: 12.5px; border-radius: 8px;
}
select.ed-mini { padding-right: 26px; }

/* 色系配置表 */
#famTable input { max-width: 100%; }

/* 底部工具条（移动端） */
.mobile-actions { display: none; }

/* ============================================================== 响应式增强 */
@media (min-width: 640px) {
  .stat-grid { grid-template-columns: repeat(4, 1fr); }
  .content-body { padding: 18px; }
  .public-wrap { padding: 22px 20px 50px; }
  .board-title h1 { font-size: 33px; }
  .board-title h2 { font-size: 25px; letter-spacing: 8px; }
  .room-label { flex: 0 0 92px; font-size: 19px; }
  .room-body { padding: 20px 24px; }
  .seat { min-height: 54px; }
  .seat .seat-tag { font-size: 18px; }
}

@media (min-width: 900px) {
  .sidebar { position: sticky; top: 0; height: 100vh; transform: none; flex: 0 0 208px; }
  .layout { display: flex; }
  .sidebar-mask { display: none !important; }
  .menu-btn { display: none; }
  .content { flex: 1 1 auto; min-width: 0; }
  /* 内容区更宽：侧栏 236→208、左右内边距 26→16，为后续「全国店铺分布地图」留出横向空间 */
  .content-body { padding: 18px 16px; }
  .topbar { padding: 12px 26px; }
  .seat { min-height: 62px; }
  .bean-grid { grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); }
}

@media (max-width: 400px) {
  .room-label { flex: 0 0 62px; font-size: 15px; }
  .room-body { padding: 12px 10px; }
  .seat { min-height: 38px; }
  .seat .seat-tag { font-size: 13px; }
  .dur-grid { grid-template-columns: repeat(2, 1fr); }
  .status-grid { grid-template-columns: repeat(3, 1fr); gap: 6px; font-size: 13px; }
}

@media print {
  .board-meta .no-print, .legend .no-print { display: none; }
  body { background: #fff; }
  .room { break-inside: avoid; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* =============================================================================
 * 后台统一宽度与卡片风格
 *
 * 约定（所有控制台页面遵守）：
 *   1. 内容区铺满可用宽度，页面内不再各自写 max-width 把内容挤窄
 *   2. 顶层卡片一律 100% 宽、同一套圆角与阴影
 *   3. 需要窄栏的只有表单控件本身（.field 的 max-width），不是整个页面
 * ========================================================================== */
.is-admin .content-body > .card,
.is-admin .content-body > form > .card,
.is-admin .content-body > .saas-cards,
.is-admin .content-body > .table-wrap {
  width: 100%;
  max-width: none;
}
.is-admin .content-body > .card {
  border-radius: 14px;
  box-shadow: 0 2px 10px rgba(22, 72, 63, .05);
}
/* 表格页：让表格吃满卡片宽度，避免右侧留白像"页面变窄" */
.is-admin .content-body .table-wrap { overflow-x: auto; }
.is-admin .content-body .table-wrap table { width: 100%; }

/* =============================================================================
 * 总控后台：所有页面统一整宽（覆盖各页内容长度差异造成的"宽度不一样"）
 *
 * 之前的问题：不同页面的卡片宽度随内容变（订单页窄、短信页宽），
 * 看起来像"好几个规格"。这里统一为：内容区整宽，顶层块一律撑满。
 * ========================================================================== */
.is-admin .content { align-items: stretch; }
/* 关键：content-body 是 .layout(flex row) 的直接子项，
   必须 min-width:0 才能收缩到可用宽度，否则会被内容撑破（曾量到 2539 > 窗口 1570） */
.is-admin .content-body {
  flex: 1 1 0;
  min-width: 0;
  max-width: 100%;
  display: block;
  box-sizing: border-box;
}
/* 内容区第一层元素全部撑满（卡片、卡片组、表单、提示条、表格容器…） */
.is-admin .content-body > * {
  width: 100%;
  max-width: none;
  box-sizing: border-box;
}
/* 指标卡组仍是网格，但要撑满且列宽一致 */
.is-admin .content-body > .saas-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 12px;
}
/* 卡片内部不再二次限宽 */
.is-admin .content-body .card { max-width: none; }

/* =============================================================================
 * 总控后台：从根节点强制整宽
 *
 * 实测数据：.content-body 已经是 flex:1 1 0 + min-width:0，但宽度只有 491px，
 * 说明限制在它的父级 —— .layout 被当成了 flex 子项而收缩到内容宽度。
 * 这里从 body 开始逐层钉死宽度，不依赖外层是什么 display。
 * ========================================================================== */
html, body.is-admin { display: block; width: 100%; }
body.is-admin { min-width: 0; }
.is-admin .layout { display: flex; width: 100%; min-width: 0; }
.is-admin .content-body { flex: 1 1 0; min-width: 0; max-width: 100%; width: auto; }

/* =============================================================================
 * 总控后台宽度统一 —— 真正的修复点
 *
 * 实测祖先链（用浏览器量出来的）：
 *   DIV.content-body  491  block
 *   MAIN.main         491  block   ← 它才是问题所在
 *   DIV.layout       1955  flex
 *
 * .layout 是 flex 横向容器，<main class="main"> 作为 flex 子项，
 * 主轴方向默认不拉伸（flex-grow:0），于是按内容宽度排版：
 * 内容少的页面（总览）窄、内容多的页面（短信）宽，看起来就是"好几个规格"。
 *
 * 修法：让 main 撑满剩余空间（flex:1 1 0 + min-width:0）。
 * ========================================================================== */
.is-admin .layout > .main,
.is-admin main.main {
  flex: 1 1 0;
  min-width: 0;
  width: auto;
  max-width: 100%;
}
/* main 撑开后，内容区自然满宽；下面的兜底保持不动 */
.is-admin .main > .content-body {
  width: 100%;
  box-sizing: border-box;
}

/* =============================================================================
 * 总控后台：统一垂直节奏
 *
 * 问题：指标卡组（.saas-cards）没有下外边距，而 .card 只有 margin-bottom，
 * 两者之间几乎贴在一起（看起来像挤在一条线上）。
 * 做法：给内容区第一层元素统一"下间距 18px"，最后一项不留白。
 * ========================================================================== */
.is-admin .content-body > * { margin-bottom: 18px; }
.is-admin .content-body > *:last-child { margin-bottom: 0; }
/* 卡片内边距略微放大，标题不再贴边 */
.is-admin .content-body > .card { padding: 18px 20px; }
/* 卡片标题与正文之间也留足空间 */
.is-admin .content-body > .card > .card-title { margin-bottom: 14px; }

/* =============================================================================
 * 表单栅格：后台所有"一行多字段"的表单统一用它
 *
 * 解决的问题：以前用内联 flex + 固定 px 宽度拼，导致
 *   标签折行、带说明的字段把别的字段挤下去、按钮被拉成一整条。
 * ========================================================================== */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 14px 16px;
  /* 关键：顶部对齐。底部对齐时，带说明文字的字段会把同排输入框顶得高低不齐 */
  align-items: start;
}
.form-grid .field {
  margin: 0;
  max-width: none;
  min-width: 0;
}
/* 标签不折行，字段宽度不够时整列换行而不是把字挤成两行 */
.form-grid .lbl {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.form-grid input,
.form-grid select {
  width: 100%;
  box-sizing: border-box;
}
/* 按钮单独占一格，不拉伸 */
.form-grid .form-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 1px;
}
.form-grid .form-actions .btn { white-space: nowrap; }
/* 搜索类表单：输入框占满，按钮紧跟其后 */
.form-grid-search { grid-template-columns: minmax(180px, 1fr) auto auto; }

/* 同一张卡片里的多段表单：分隔线上下留白 */
.is-admin .card > hr.sep { margin: 20px 0 18px; border: none; border-top: 1px solid var(--line); }
.is-admin .card > .form-grid + .form-grid { margin-top: 4px; }

/* 表单行里的按钮不参与拉伸（.row > * 默认 flex:1 1 220px 会把按钮拉成整条） */
.row > .btn,
.row > button { flex: 0 0 auto; width: auto; }

/* 表单行里的按钮：与输入框同高、底边对齐（高度取 42px，与 .control-row 一致） */
.row > .btn,
.row > button {
  flex: 0 0 auto;
  width: auto;
  height: 42px;
  align-self: flex-end;
  padding-top: 0;
  padding-bottom: 0;
}

/* 表单里的按钮：与输入框同一水平线（标签高度 ≈ 23px，故下移 26px） */
.form-grid .form-actions {
  align-self: start;
  margin-top: 26px;
}
/* 普通表单行：改成垂直居中对齐，避免输入框与按钮底边差几像素 */
/* 全局：表单行一律顶部对齐（店铺后台与总控共用） */
.row { align-items: flex-start; }
/* 行内 style="align-items:flex-end" 的老代码用 !important 覆盖 */
.row[style*="flex-end"] { align-items: flex-start !important; }

/* =============================================================================
 * 表单对齐：统一顶对齐
 *
 * 说明文字行数不同时，底对齐/居中都会让输入框错位；
 * 顶对齐让所有标签从同一水平线开始，输入框自然齐平，
 * 说明文字完整显示在各自字段下方，不做截断。
 * ========================================================================== */
.form-grid { align-items: start; }
.form-grid .form-actions { align-self: start; margin-top: 26px; }
/* 普通表单行里的按钮：下移一个标签高度，与输入框同一水平线 */
.row > .btn,
.row > button {
  align-self: flex-start;
  margin-top: 26px;
  height: 42px;
}

/* 支付渠道等表单里的开关行：单独一行，文字不换行 */
.check-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin-bottom: 14px;
}
.check-row .checkbox {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}
.check-row .checkbox input { flex: none; }
/* 点选后不要出现浏览器默认的方形高亮框 */
.check-row .checkbox input:focus,
.check-row .checkbox input:focus-visible { outline: none; }

/* 续费套餐卡：整卡可点，原生圆点隐藏（选中态由 .sel 表现） */
.price-opt { position: relative; display: block; cursor: pointer; }
.price-opt > input[type=radio] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

/* 续费/平台页样式（原在 saas_layout 内联，现全局可用） */
/* SaaS 平台端的少量补充样式 */
.saas-hero { text-align: center; padding: 46px 20px 30px; }
.saas-hero h1 { font-size: 30px; margin: 0 0 10px; color: var(--text); }
.saas-hero p { color: var(--text-soft); font-size: 15.5px; margin: 0 auto; max-width: 640px; }
.saas-card {
  background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 18px;
}
.saas-card .n { font-size: 26px; font-weight: 800; color: var(--teal); line-height: 1.2; }
.saas-card .l { font-size: 13px; color: var(--text-soft); margin-top: 4px; }
.price-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.price-opt:hover { border-color: var(--teal); }
.price-opt.sel { border-color: var(--teal); background: #e8f6f6; box-shadow: 0 0 0 3px rgba(10,165,165,.15); }
.price-opt b { display: block; font-size: 19px; color: var(--text); }
.price-opt .m { font-size: 13px; color: var(--text-soft); margin-top: 2px; }
.price-opt .a { font-size: 15px; font-weight: 800; color: #e11d48; margin-top: 6px; }
.price-opt .s { font-size: 11.5px; color: var(--text-soft); margin-top: 3px; }
.pay-ch { display: flex; gap: 10px; flex-wrap: wrap; }
.pay-ch label {
  display: flex; align-items: center; gap: 8px; border: 2px solid var(--line);
  border-radius: 10px; padding: 10px 14px; cursor: pointer; background: #fff;
}
.pay-ch input { margin: 0; }
.pay-ch label.sel { border-color: var(--teal); background: #e8f6f6; }
.days-badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 700; }

/* 操作结果浮动提示：不占页面流，不会把内容顶下去 */
.flash-stack {
  position: fixed; top: 16px; right: 16px; z-index: 80;
  display: flex; flex-direction: column; gap: 8px;
  max-width: min(420px, calc(100vw - 32px));
  transition: opacity .3s ease;
}
.flash-stack .alert {
  margin: 0; box-shadow: 0 8px 24px rgba(15, 40, 34, .12);
  background: #fff; border: 1px solid var(--line);
}

/* 前台看板：营业状态徽标 */
.board-open-badge {
  display: inline-flex; align-items: center; gap: 8px;
  margin-top: 10px; padding: 6px 14px; border-radius: 999px;
  font-size: 14px; background: #EAF6F1; color: #0A7D56;
}
.board-open-badge .dob {
  width: 8px; height: 8px; border-radius: 50%; background: #0A7D56;
}
.board-open-badge.is-closed { background: #FDECEC; color: #C0392B; }
.board-open-badge.is-closed .dob { background: #C0392B; }
.board-open-badge .bh { color: #7B8C87; font-size: 13px; }

/* 收银台：划线原价 */
.price-opt .orig {
  margin-left: 6px; font-size: 12px; color: #9AA8A4;
  text-decoration: line-through; font-weight: 400;
}

/* 套餐赠送去标签：买5送1 / 买9送3 */
.pkg-tag {
  display: inline-block; margin-left: 6px; padding: 1px 6px;
  font-size: 11px; font-style: normal; line-height: 1.6;
  color: #B45309; background: #FEF3C7; border-radius: 4px;
  white-space: nowrap; vertical-align: 2px;
}

/* 默认头像/品牌图标：统一用拼豆客 logo */
.brand-img { object-fit: contain; background: #fff; padding: 3px; }
.avatar-img { object-fit: contain; background: #fff; padding: 3px; }

/* 色号色块（入库/出库/豆仓共用）：浅色由 color_hex_border() 自动加灰边 */
.code-swatch {
  display: inline-block; padding: 2px 8px; border-radius: 6px;
  font-weight: 800; font-size: 13px; letter-spacing: .3px;
  border: 1px solid transparent; background: #F2F7F4; color: #16483F;
}
.chip.code-chip { border: 1px solid transparent; }

/* 反馈统计 */
.stat-row { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.stat-box {
  flex: 1 1 120px; padding: 14px 16px; border-radius: 10px;
  background: #F6F8FA; text-align: center;
}
.stat-num { font-size: 24px; font-weight: 800; color: #16483F; line-height: 1.2; }
.stat-lbl { font-size: 12px; color: #6B7A85; margin-top: 4px; }
.stat-cats { display: flex; gap: 10px; flex-wrap: wrap; }
.cat-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: 999px;
  background: #EEF3F1; color: #3D5A52; font-size: 13px;
}
.cat-chip b { color: #16483F; }

/* 升级页：文件完整性与数据库版本同一行 */
.release-row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-top: 12px; padding-top: 12px;
  border-top: 1px dashed #E3E8EC;
  font-size: 13px; color: #4A5A64;
}

/* 登录页：让渐变铺满整个窗口，去掉两侧留白 */
body.login-body { background: #0b2f34; }
.login-body .public-wrap {
  max-width: none; margin: 0; padding: 0;
  background: transparent; min-height: 100vh;
  display: block;
}
.login-body .login-wrap { width: 100%; min-height: 100vh; }

/* 入口登录页底部链接 */
.login-links {
  margin-top: 16px; text-align: center;
  font-size: 13px; color: #4A5A64;
}
.login-links a { color: #0F766E; text-decoration: none; }
.login-links a:hover { text-decoration: underline; }
.login-links.sub {
  margin-top: 10px; font-size: 12px; color: #93A29B;
  display: flex; gap: 8px; justify-content: center; align-items: center;
}
.login-links.sub a { color: #7B8C87; }

.login-ver {
  margin-top: 14px; text-align: center;
  font-size: 11px; color: #A9B7B1; letter-spacing: .3px;
}

/* 注册页：与登录页/官网一致的深色品牌头 + 浅色表单区 */
body.reg-page {
  background:
    radial-gradient(900px 520px at 18% 6%, rgba(20,116,110,.42), transparent 62%),
    radial-gradient(760px 460px at 84% 88%, rgba(226,120,60,.30), transparent 60%),
    linear-gradient(160deg, #0b2f34 0%, #0d2129 52%, #1b1710 100%);
  background-attachment: fixed;
  min-height: 100vh;
}
.reg-page .public-wrap {
  max-width: 820px; margin: 0 auto; padding: 0 20px 40px;
  background: transparent; min-height: 100vh;
}
.reg-page .content-body { padding: 28px 10px 8px; }
.reg-page .card + .card { margin-top: 14px; }
.reg-page .card:first-child { margin-top: 0; }
.reg-page .card {
  padding: 18px 20px;
  background: rgba(255,255,255,.98);
  border: 1px solid rgba(255,255,255,.55);
  box-shadow: 0 14px 34px rgba(0,0,0,.20);
}
.reg-page .field input,
.reg-page .field select,
.reg-page .field textarea { max-width: 100%; }
.reg-hero {
  text-align: center; color: #fff; padding: 44px 20px 20px;
}
.reg-hero .reg-logo {
  width: 64px; height: 64px; display: block; margin: 0 auto 14px;
  background: #fff; border-radius: 16px; padding: 6px;
  box-shadow: 0 10px 26px rgba(0,0,0,.28);
}
.reg-hero h1 {
  font-size: 28px; font-weight: 800; color: #fff; letter-spacing: .5px; margin: 0 0 10px;
}
.reg-hero p {
  font-size: 14px; line-height: 1.8; color: rgba(255,255,255,.82);
  max-width: 620px; margin: 0 auto;
}
.reg-hero b { color: #FFD9A8; }
.reg-body-inner { padding-bottom: 8px; }
.reg-foot {
  margin-top: 18px; text-align: center; font-size: 13px; color: rgba(255,255,255,.62);
  display: flex; gap: 8px; justify-content: center; align-items: center;
}
.reg-foot a { color: #9FE3D6; text-decoration: none; }
.reg-foot a:hover { text-decoration: underline; }
.reg-ver { margin-top: 10px; text-align: center; font-size: 11px; color: rgba(255,255,255,.40); }
