/* ============================================================
   樱花食堂 · 店员后台 /staff
   仅店员端使用；共享令牌见 tokens.css。
   ============================================================ */

:root {
  --staff-maxw: 1200px;
}

body {
  background:
    radial-gradient(circle at 8% 0%, rgba(196, 154, 74, 0.13), transparent 32%),
    radial-gradient(circle at 96% 4%, rgba(178, 58, 43, 0.08), transparent 30%),
    var(--bg);
}

/* ---------------- 基础零件 ---------------- */
.seal {
  display: grid;
  place-items: center;
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: var(--brand);
  color: #fff6ee;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0;
  box-shadow: 0 4px 12px rgba(138, 42, 30, 0.24);
}

.seal-lg {
  width: 52px;
  height: 52px;
  border-radius: 15px;
  font-size: 27px;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid transparent;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font-size: 17px;
  line-height: 1;
}

.icon-btn:hover {
  background: var(--surface-2);
  border-color: var(--line);
  color: var(--ink);
}

.form-error {
  margin: 10px 0 0;
  padding: 9px 12px;
  border: 1px solid #ecc6c0;
  border-radius: var(--radius-sm);
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 13.5px;
  line-height: 1.5;
}

.btn-success {
  background: var(--success-soft);
  color: var(--success);
}

.btn-success:hover {
  background: #d5e8da;
}

/* ---------------- 开关 ---------------- */
.switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  user-select: none;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-soft);
}

.switch input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  margin: 0;
}

.switch-track {
  position: relative;
  flex: none;
  width: 42px;
  height: 24px;
  border-radius: var(--radius-pill);
  background: #d8cbba;
  transition: background-color 0.18s ease;
}

.switch-track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(43, 34, 28, 0.28);
  transition: transform 0.18s ease;
}

.switch input:checked + .switch-track {
  background: var(--success);
}

.switch input:checked + .switch-track::after {
  transform: translateX(18px);
}

.switch input:focus-visible + .switch-track {
  outline: 3px solid rgba(178, 58, 43, 0.35);
  outline-offset: 2px;
}

.switch-sm {
  gap: 7px;
  font-size: 12.5px;
}

.switch-sm .switch-track {
  width: 36px;
  height: 21px;
}

.switch-sm .switch-track::after {
  width: 15px;
  height: 15px;
}

.switch-sm input:checked + .switch-track::after {
  transform: translateX(15px);
}

/* ---------------- 登录 ---------------- */
.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 18px;
}

.login-card {
  width: min(460px, 100%);
  padding: clamp(26px, 5vw, 42px);
  border-radius: 26px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.login-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 5px;
  background: linear-gradient(90deg, var(--brand), var(--gold), var(--brand));
  opacity: 0.85;
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 26px;
}

.login-brand-text {
  display: grid;
  line-height: 1.35;
}

.login-brand-text strong {
  font-family: var(--font-display);
  font-size: 17px;
  letter-spacing: 0.06em;
}

.login-brand-text span {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--muted);
}

.login-card h1 {
  font-family: var(--font-display);
  font-size: clamp(28px, 5vw, 34px);
  letter-spacing: 0.08em;
}

.login-lead {
  margin-top: 10px;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.7;
}

.login-card form {
  margin-top: 22px;
  display: grid;
  gap: 14px;
}

.pin-input {
  height: 58px;
  padding: 0 14px;
  font-family: var(--font-mono);
  font-size: 26px;
  letter-spacing: 0.45em;
  text-align: center;
  text-indent: 0.45em;
}

.pin-input::placeholder {
  letter-spacing: 0.1em;
}

.login-submit {
  width: 100%;
  min-height: 48px;
  margin-top: 2px;
  font-size: 16px;
}

.login-hint {
  margin-top: 20px;
  padding: 11px 13px;
  border: 1px dashed var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.login-hint code {
  padding: 1px 5px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fff;
  color: var(--brand-dark);
  font-family: var(--font-mono);
  font-size: 11.5px;
}

.login-foot {
  margin-top: 18px;
  font-size: 12.5px;
}

/* ---------------- 顶栏 / 页签 ---------------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 253, 247, 0.94);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.topbar-inner {
  width: min(100% - 32px, var(--staff-maxw));
  margin-inline: auto;
  min-height: 68px;
  display: flex;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
  padding-block: 10px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
}

.brand-text {
  display: grid;
  line-height: 1.3;
}

.brand-text strong {
  font-family: var(--font-display);
  font-size: 17px;
  letter-spacing: 0.05em;
}

.brand-text span {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--muted);
}

.tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
  display: none;
}

.tab {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  flex: none;
  min-height: 42px;
  padding: 9px 15px;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--muted);
  font-size: 14.5px;
  font-weight: 600;
  white-space: nowrap;
  transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.tab small {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.08em;
  opacity: 0.72;
}

.tab:hover {
  background: var(--surface-2);
  color: var(--ink);
}

.tab.is-active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff8f2;
  box-shadow: 0 5px 14px rgba(138, 42, 30, 0.18);
}

.tab.is-active small {
  opacity: 0.85;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar-clock {
  color: var(--muted);
  font-size: 12.5px;
  letter-spacing: 0.06em;
}

/* ---------------- 主区域 ---------------- */
.staff-main {
  width: min(100% - 32px, var(--staff-maxw));
  margin-inline: auto;
  padding: 26px 0 72px;
}

.panel {
  display: grid;
  gap: 16px;
  animation: panel-in 0.22s ease;
}

@keyframes panel-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.panel-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}

.panel-head h2 {
  font-family: var(--font-display);
  font-size: clamp(22px, 3vw, 27px);
  letter-spacing: 0.06em;
  line-height: 1.3;
}

.panel-sub {
  margin-top: 5px;
  max-width: 66ch;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.panel-head-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.empty-state {
  border-radius: var(--radius);
  background: var(--surface);
}

.empty-emoji {
  font-size: 34px;
  line-height: 1;
}

.empty-state strong {
  font-family: var(--font-display);
  font-size: 19px;
  letter-spacing: 0.05em;
  color: var(--ink);
}

.empty-state p {
  font-size: 13.5px;
}

/* ---------------- 订单 ---------------- */
.chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.chip-count {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: var(--radius-pill);
  background: rgba(124, 107, 94, 0.12);
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
}

.chip.is-active .chip-count {
  background: rgba(255, 248, 242, 0.24);
  color: #fff8f2;
}

.orders-meta {
  margin-top: -6px;
  font-size: 12.5px;
}

.orders-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  align-items: start;
}

.order-card {
  display: grid;
  gap: 12px;
  padding: 18px 18px 16px;
  border-left: 4px solid var(--line);
  overflow: hidden;
}

.order-card.status-new {
  border-left-color: var(--brand);
}

.order-card.status-preparing {
  border-left-color: var(--gold);
}

.order-card.status-done {
  border-left-color: var(--success);
}

.order-card.status-cancelled {
  border-left-color: #c9b8a5;
  opacity: 0.86;
}

.order-card.is-fresh {
  animation: order-arrive 0.5s cubic-bezier(0.2, 0.9, 0.3, 1);
  box-shadow: 0 0 0 2px rgba(178, 58, 43, 0.18), var(--shadow);
}

@keyframes order-arrive {
  0% {
    transform: translateY(-8px);
    opacity: 0.4;
  }
  100% {
    transform: none;
    opacity: 1;
  }
}

.order-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.order-table {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.table-pill {
  display: inline-grid;
  place-items: center;
  min-width: 52px;
  height: 34px;
  padding: 0 10px;
  border-radius: 10px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-size: 15px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
}

.order-table-name {
  display: grid;
  line-height: 1.35;
  min-width: 0;
}

.order-table-name strong {
  font-family: var(--font-display);
  font-size: 17px;
  letter-spacing: 0.04em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.order-table-name span {
  font-size: 11.5px;
}

.order-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 11.5px;
}

.order-meta .dot {
  opacity: 0.55;
}

.order-relative {
  color: var(--brand-dark);
  font-weight: 600;
}

.order-items {
  list-style: none;
  margin: 0;
  padding: 10px 0 0;
  border-top: 1px dashed var(--line);
  display: grid;
  gap: 9px;
}

.order-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
  gap: 10px;
}

.order-qty {
  min-width: 30px;
  padding: 2px 6px;
  border-radius: 7px;
  background: var(--surface-2);
  color: var(--brand-dark);
  font-size: 12.5px;
  font-weight: 700;
  text-align: center;
}

.order-item-main {
  display: grid;
  gap: 2px;
  line-height: 1.4;
  min-width: 0;
}

.order-item-name {
  font-weight: 600;
  font-size: 14px;
  overflow-wrap: anywhere;
}

.order-item-ja {
  color: var(--muted);
  font-size: 11.5px;
  overflow-wrap: anywhere;
}

.order-item-note {
  color: var(--warning);
  font-size: 11.5px;
  font-style: normal;
}

.order-item-price {
  color: var(--ink-soft);
  font-size: 12.5px;
  padding-top: 1px;
}

.order-note {
  padding: 9px 11px;
  border-radius: var(--radius-sm);
  background: var(--warning-soft);
  color: #7a5514;
  font-size: 12.5px;
  line-height: 1.55;
}

.order-note-label {
  display: inline-block;
  margin-right: 6px;
  font-weight: 700;
}

.order-no-items {
  color: var(--muted);
  font-size: 12.5px;
}

.order-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 11px;
  border-top: 1px solid var(--line);
}

.order-total strong {
  color: var(--brand-dark);
  font-size: 19px;
  font-weight: 700;
}

.order-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.order-closed {
  font-size: 12.5px;
  font-weight: 600;
}

/* ---------------- 桌码：域名与工具条 ---------------- */
.domain-card {
  display: grid;
  gap: 8px;
  padding: 16px 20px;
  background:
    linear-gradient(135deg, rgba(243, 221, 213, 0.55), rgba(255, 253, 247, 0) 55%),
    var(--surface);
}

.domain-label {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--muted);
  text-transform: uppercase;
}

.domain-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.domain-row code {
  flex: 1;
  min-width: 200px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--brand-dark);
  font-size: 13.5px;
  overflow-wrap: anywhere;
}

.domain-notice {
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--muted);
}

.domain-notice.is-warning {
  padding: 8px 11px;
  border-radius: var(--radius-sm);
  background: var(--warning-soft);
  color: #7a5514;
  font-weight: 500;
}

.domain-notice.is-info {
  padding-left: 10px;
  border-left: 3px solid var(--gold);
}

.qr-toolbar {
  display: grid;
  gap: 12px;
  padding: 15px 18px;
}

.qr-toolbar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.select-all {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
}

.select-all input,
.qr-select input {
  width: 18px;
  height: 18px;
  accent-color: var(--brand);
  cursor: pointer;
}

.qr-filters {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  justify-content: flex-end;
  min-width: 0;
}

.qr-filters .input {
  width: min(280px, 100%);
  min-height: 40px;
}

.qr-filters .select {
  width: min(170px, 100%);
  min-height: 40px;
}

.qr-export-buttons {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}

.toolbar-hint {
  font-size: 12px;
}

.export-status {
  display: grid;
  gap: 7px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.export-track {
  height: 8px;
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  overflow: hidden;
}

.export-bar {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand), var(--gold));
  transition: width 0.2s ease;
}

.export-status p {
  font-size: 12.5px;
}

/* ---------------- 桌码：卡片网格 ---------------- */
.qr-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fill, minmax(248px, 1fr));
}

.qr-card {
  display: grid;
  gap: 11px;
  padding: 13px;
  align-content: start;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.qr-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.qr-card.is-highlight {
  animation: qr-highlight 2.4s ease;
}

@keyframes qr-highlight {
  0%,
  100% {
    box-shadow: var(--shadow-sm);
  }
  20%,
  70% {
    box-shadow: 0 0 0 3px rgba(178, 58, 43, 0.35), var(--shadow);
  }
}

.qr-card-top {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.qr-zone {
  margin-left: auto;
  font-size: 11.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 55%;
}

.qr-preview {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.6);
}

.qr-preview canvas {
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 4;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
}

.qr-preview-error {
  display: grid;
  place-items: center;
  gap: 6px;
  min-height: 220px;
  padding: 18px;
  text-align: center;
  color: var(--danger);
  background: var(--danger-soft);
  font-size: 13px;
}

.qr-preview-error small {
  color: var(--muted);
  font-size: 11.5px;
}

.qr-card-body {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.qr-names {
  display: flex;
  align-items: baseline;
  gap: 7px;
  min-width: 0;
}

.qr-names strong {
  font-family: var(--font-display);
  font-size: 17px;
  letter-spacing: 0.04em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.qr-names span {
  font-size: 11.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.qr-url {
  display: block;
  color: var(--muted);
  font-size: 11px;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

a.qr-url:hover {
  color: var(--brand-dark);
  text-decoration: underline;
}

.qr-card-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.qr-card-actions .btn {
  flex: 1;
  min-width: 0;
  padding-inline: 8px;
  font-size: 12.5px;
}

/* ---------------- 桌台管理 ---------------- */
.table-form {
  display: grid;
  gap: 14px;
  padding: 20px;
}

.table-form h3 {
  font-family: var(--font-display);
  font-size: 18px;
  letter-spacing: 0.05em;
}

.table-form-grid {
  display: grid;
  gap: 13px;
  grid-template-columns: repeat(5, minmax(0, 1fr)) auto;
  align-items: end;
}

.table-form-grid .form-actions {
  display: flex;
  align-items: end;
}

.table-form-grid .btn {
  min-height: 44px;
}

.req {
  color: var(--brand);
}

.tables-list {
  display: grid;
  gap: 10px;
}

.table-row {
  padding: 12px 16px;
}

.table-row-main {
  display: grid;
  grid-template-columns: minmax(170px, 1.1fr) auto minmax(0, 1.5fr) auto;
  align-items: center;
  gap: 14px;
}

.table-row-ident {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.table-row-names {
  display: grid;
  line-height: 1.35;
  min-width: 0;
}

.table-row-names strong {
  font-family: var(--font-display);
  font-size: 16px;
  letter-spacing: 0.04em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table-row-names span {
  font-size: 11.5px;
}

.table-row-zone {
  font-size: 12px;
  white-space: nowrap;
}

.table-row-url {
  color: var(--muted);
  font-size: 11.5px;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.table-row-url:hover {
  color: var(--brand-dark);
  text-decoration: underline;
}

.table-row-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* ---------------- 菜单 ---------------- */
.menu-groups {
  display: grid;
  gap: 18px;
}

.menu-group {
  overflow: hidden;
}

.menu-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(90deg, rgba(243, 221, 213, 0.4), transparent 60%);
}

.menu-group-head h3 {
  display: flex;
  align-items: baseline;
  gap: 9px;
  font-family: var(--font-display);
  font-size: 18px;
  letter-spacing: 0.05em;
}

.menu-group-head small {
  font-family: var(--font-body);
  font-size: 11.5px;
  font-weight: 400;
  letter-spacing: 0.06em;
}

.menu-items {
  list-style: none;
  margin: 0;
  padding: 0;
}

.menu-item {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 14px;
  padding: 13px 18px;
  border-bottom: 1px solid var(--line);
}

.menu-item:last-child {
  border-bottom: 0;
}

.menu-item.is-soldout {
  background: rgba(247, 234, 208, 0.35);
}

.menu-item.is-soldout .menu-names strong,
.menu-item.is-soldout .menu-price {
  color: var(--muted);
}

.menu-emoji {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--surface-2);
  font-size: 22px;
  line-height: 1;
}

.menu-main {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.menu-names {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.menu-names strong {
  font-size: 15px;
  font-weight: 600;
}

.menu-name-ja {
  font-size: 11.5px;
}

.menu-desc {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.5;
}

.menu-desc-ja {
  opacity: 0.82;
}

.menu-meta {
  display: flex;
  align-items: center;
  gap: 14px;
}

.menu-price {
  font-size: 16px;
  font-weight: 700;
  color: var(--brand-dark);
  white-space: nowrap;
}

.menu-item-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.menu-group-empty {
  padding: 18px;
  font-size: 12.5px;
}

.menu-item.is-editing {
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: start;
  background: var(--surface-2);
}

.menu-edit-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  min-width: 0;
}

.menu-edit-field {
  display: grid;
  gap: 4px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
}

.menu-edit-field .input {
  min-height: 40px;
  font-size: 14px;
  font-weight: 400;
}

.menu-edit-actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

/* ---------------- 对话框 ---------------- */
.dialog {
  width: min(600px, calc(100% - 28px));
  max-width: none;
  max-height: min(88vh, 860px);
  padding: 22px 24px 20px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 30px 80px rgba(43, 34, 28, 0.32);
  overflow: auto;
}

.dialog::backdrop {
  background: rgba(43, 34, 28, 0.46);
  backdrop-filter: blur(2px);
}

.dialog-sm {
  width: min(430px, calc(100% - 28px));
}

.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.dialog-head h2 {
  font-family: var(--font-display);
  font-size: 21px;
  letter-spacing: 0.05em;
}

.dialog-sub {
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.65;
}

.dialog-sub strong {
  color: var(--ink);
}

.dialog-grid {
  display: grid;
  gap: 13px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 16px;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 20px;
}

.print-dialog {
  width: min(640px, calc(100% - 28px));
}

.print-preview-wrap {
  display: grid;
  place-items: center;
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background:
    repeating-linear-gradient(45deg, rgba(229, 215, 197, 0.18) 0 10px, transparent 10px 20px),
    var(--surface-2);
}

.print-preview-wrap img {
  width: min(360px, 100%);
  height: auto;
  border-radius: 4px;
  box-shadow: 0 14px 34px rgba(43, 34, 28, 0.22);
}

.print-note {
  margin-top: 14px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.7;
}

/* ---------------- Toast ---------------- */
.toasts {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 60;
  display: grid;
  gap: 9px;
  max-width: min(360px, calc(100% - 36px));
  pointer-events: none;
}

.toast {
  padding: 11px 15px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--muted);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: 0 12px 30px rgba(43, 34, 28, 0.18);
  font-size: 13px;
  line-height: 1.55;
  animation: toast-in 0.22s ease;
  pointer-events: auto;
}

.toast.is-leaving {
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.toast-success {
  border-left-color: var(--success);
}

.toast-warn {
  border-left-color: var(--warning);
}

.toast-error {
  border-left-color: var(--danger);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}


/* ============================================================
   V2：桌台结账 / 账单 / 套餐规则 / 订单与菜单新增字段
   ============================================================ */
.phase-badge {
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 12px;
}

.phase-badge.is-lunch {
  background: var(--warning-soft);
  border-color: #e6cf9f;
  color: #7a5514;
}

.phase-badge.is-dinner {
  background: #e9e1f2;
  border-color: #d6c9e6;
  color: #57406f;
}

.mode-badge {
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.mode-badge.mode-alacarte {
  background: #e2edf1;
  color: #2f5d68;
}

/* ---------- 会话统计 ---------- */
.session-stats {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.stat-card {
  display: grid;
  gap: 4px;
  padding: 14px 18px;
  background:
    linear-gradient(135deg, rgba(243, 221, 213, 0.45), rgba(255, 253, 247, 0) 60%),
    var(--surface);
}

.stat-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.stat-value {
  font-family: var(--font-display);
  font-size: 28px;
  line-height: 1.2;
  letter-spacing: 0.03em;
  color: var(--brand-dark);
}

.stat-value.stat-phase {
  font-family: var(--font-body);
  font-size: 20px;
  font-weight: 700;
  color: var(--ink-soft);
}

.session-updated {
  margin-top: -4px;
  font-size: 12.5px;
}

.sessions-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  align-items: start;
}

.session-card {
  display: grid;
  gap: 12px;
  padding: 17px 18px;
  border-left: 4px solid var(--gold);
}

.session-card.is-urgent {
  border-left-color: var(--danger);
  box-shadow: 0 0 0 2px rgba(168, 50, 42, 0.12), var(--shadow-sm);
}

.session-top {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}

.session-table {
  display: grid;
  line-height: 1.32;
  min-width: 0;
  margin-right: auto;
}

.session-table strong {
  font-family: var(--font-display);
  font-size: 17px;
  letter-spacing: 0.04em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.session-table span {
  font-size: 11.5px;
}

.session-meta {
  display: flex;
  gap: 6px 16px;
  flex-wrap: wrap;
  font-size: 12.5px;
  line-height: 1.6;
}

.session-meta-item strong {
  font-weight: 600;
  color: var(--ink-soft);
}

.session-time {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr 1fr;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.session-timer,
.session-lo {
  display: grid;
  gap: 2px;
  font-size: 11.5px;
}

.session-remaining {
  font-size: 23px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--ink);
  letter-spacing: 0.03em;
}

.session-card.is-urgent .session-remaining {
  color: var(--danger);
}

.session-lo-text {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-soft);
}

.session-lo-text.is-over {
  color: var(--danger);
}

.session-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 11px;
  border-top: 1px solid var(--line);
}

.session-total-block {
  display: grid;
  gap: 1px;
  font-size: 11.5px;
}

.session-total {
  font-size: 21px;
  font-weight: 700;
  color: var(--brand-dark);
}

.session-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

/* ---------- 账单 ---------- */
.bill-dialog {
  width: min(780px, calc(100% - 28px));
}

.bill-body {
  display: grid;
  gap: 14px;
  min-height: 160px;
}

.bill-loading,
.bill-error {
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 40px 20px;
  text-align: center;
}

.bill-head {
  display: grid;
  gap: 6px;
  padding-bottom: 12px;
  border-bottom: 1px dashed var(--line);
}

.bill-head-main {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.bill-head-table {
  display: grid;
  line-height: 1.32;
  margin-right: auto;
}

.bill-head-table strong {
  font-family: var(--font-display);
  font-size: 18px;
  letter-spacing: 0.04em;
}

.bill-head-table span {
  font-size: 11.5px;
}

.bill-head-meta {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 12px;
}

.bill-head-meta .dot {
  opacity: 0.6;
}

.bill-groups {
  display: grid;
  gap: 12px;
}

.bill-group {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.bill-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  background: var(--surface-2);
}

.bill-group-head h3 {
  font-family: var(--font-display);
  font-size: 15px;
  letter-spacing: 0.05em;
}

.bill-group-head strong {
  font-size: 14px;
  color: var(--brand-dark);
}

.bill-lines {
  display: grid;
}

.bill-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px 78px 52px 88px;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-top: 1px solid rgba(229, 215, 197, 0.55);
  font-size: 12.5px;
}

.bill-line-name {
  display: grid;
  line-height: 1.35;
  min-width: 0;
}

.bill-line-name small {
  font-size: 11px;
}

.bill-line-qty {
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

.bill-line-unit {
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

.bill-line-tax {
  justify-self: center;
  padding: 1px 6px;
  font-size: 10.5px;
}

.bill-line-amount {
  text-align: right;
  font-weight: 700;
  font-size: 13px;
}

.bill-included {
  border: 1px dashed var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  background: var(--surface-2);
}

.bill-included-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.bill-included-head h3 {
  font-family: var(--font-display);
  font-size: 14px;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
}

.bill-included-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.bill-included-item {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  background: #fff;
  border: 1px solid var(--line);
  font-size: 11.5px;
}

.bill-included-item small {
  font-size: 10.5px;
}

.bill-included-item strong {
  color: var(--muted);
  font-size: 11px;
}

.bill-summary {
  display: grid;
  gap: 4px;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background:
    linear-gradient(135deg, rgba(240, 226, 196, 0.35), rgba(255, 253, 247, 0) 65%),
    var(--surface);
}

.bill-summary-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
  color: var(--ink-soft);
}

.bill-summary-row strong {
  font-weight: 600;
}

.bill-summary-total {
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
}

.bill-summary-total strong {
  font-size: 24px;
  color: var(--brand-dark);
}

.bill-note {
  font-size: 11.5px;
  line-height: 1.5;
  margin-top: 4px;
}

.bill-actions {
  position: sticky;
  bottom: -1px;
  padding-top: 12px;
  background: var(--surface);
}

/* ---------- 套餐规则 ---------- */
.rules-card {
  display: grid;
  gap: 14px;
  padding: 18px 20px;
}

.rules-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.rules-card-head h3 {
  font-family: var(--font-display);
  font-size: 18px;
  letter-spacing: 0.05em;
}

.rules-card-head span {
  font-size: 11.5px;
}

.rules-form {
  display: grid;
  gap: 14px;
}

.rules-form-row {
  display: grid;
  gap: 12px;
  grid-template-columns: auto repeat(3, minmax(0, 1fr));
  align-items: end;
}

.rules-form-row > .switch {
  min-height: 44px;
}

.rules-form-row-wide {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.rules-form-row-wide .textarea {
  min-height: 72px;
}

.rules-tax {
  font-size: 12px;
}

.rules-form-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.rules-form-foot .form-error {
  flex: 1;
  margin: 0;
}

.rules-list {
  display: grid;
  gap: 12px;
}

.rule-row {
  display: grid;
  gap: 11px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.rule-row-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.rule-row-move {
  display: inline-flex;
  gap: 4px;
  margin-left: auto;
}

.rule-move-btn {
  width: 30px;
  height: 30px;
  min-height: 30px;
  font-size: 15px;
  line-height: 1;
}

.rule-move-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.rule-row-head strong {
  font-family: var(--font-display);
  font-size: 16px;
  letter-spacing: 0.04em;
  margin-right: auto;
}

.rule-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.rule-field {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.rule-field-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.rule-field .input,
.rule-field .select {
  min-height: 38px;
  padding: 7px 9px;
  font-size: 13px;
}

.rule-row-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.rule-row-foot > span {
  margin-right: auto;
  font-size: 11.5px;
}

.rules-empty {
  padding: 24px;
}

/* ---------- 订单 V2 徽标 ---------- */
.order-tags {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.order-tags .badge {
  font-size: 11px;
}

.order-line-badges {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  margin-top: 2px;
}

.mini-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
}

.mini-badge-included {
  background: var(--success-soft);
  border-color: #c8ddce;
  color: var(--success);
}

.mini-badge-upgrade {
  background: var(--warning-soft);
  border-color: #e6cf9f;
  color: #7a5514;
}

.mini-badge-alcohol {
  background: var(--brand-soft);
  border-color: #ecc6c0;
  color: var(--brand-dark);
}

.order-item-sub {
  font-size: 11px;
  line-height: 1.4;
}

.order-totals {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 12px;
}

.order-totals .order-total {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
}

/* ---------- 菜单 V2 徽标 ---------- */
.menu-badges {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.menu-price-block {
  display: grid;
  justify-items: end;
  gap: 1px;
  white-space: nowrap;
}

.menu-lunch-price {
  color: var(--warning);
  font-size: 11px;
  font-weight: 600;
}

.menu-tax {
  font-size: 10px;
}

.menu-edit-lunch {
  min-width: 0;
}

/* ---------- 桌台进行中会话 ---------- */
.table-session-bar {
  display: flex;
  align-items: center;
  gap: 8px 12px;
  flex-wrap: wrap;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
  font-size: 12px;
}

.table-row.has-session {
  border-left: 4px solid var(--gold);
}

.table-session-text {
  font-size: 12px;
}

.table-session-remaining {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-soft);
}

.table-session-remaining.is-urgent-text {
  color: var(--danger);
}

.table-session-total {
  margin-left: auto;
  font-size: 14px;
  font-weight: 700;
  color: var(--brand-dark);
}

/* ---------- 账单打印 ---------- */
.bill-print-area {
  display: none;
}

.bill-sheet {
  width: 180mm;
  margin: 0 auto;
  color: #1f1c19;
  font-family: "Hiragino Sans", "PingFang SC", "Noto Sans CJK JP", sans-serif;
  font-size: 10.5pt;
  line-height: 1.6;
}

.bill-sheet-head {
  display: grid;
  gap: 4px;
  padding-bottom: 4mm;
  border-bottom: 1.2pt solid #333;
}

.bill-sheet-brand {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.bill-sheet-brand strong {
  font-family: "Songti SC", "Hiragino Mincho ProN", serif;
  font-size: 16pt;
  letter-spacing: 0.08em;
}

.bill-sheet-brand span {
  font-size: 9pt;
  color: #555;
}

.bill-sheet-head h1 {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-family: "Songti SC", "Hiragino Mincho ProN", serif;
  font-size: 20pt;
  letter-spacing: 0.12em;
  margin: 2mm 0 1mm;
}

.bill-sheet-head h1 small {
  font-family: sans-serif;
  font-size: 9pt;
  font-weight: 400;
  letter-spacing: 0.1em;
  color: #555;
}

.bill-sheet-meta {
  display: flex;
  gap: 10mm;
  flex-wrap: wrap;
  font-size: 9pt;
  color: #333;
}

.bill-sheet-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 5mm;
}

.bill-sheet-table th {
  padding: 2mm 1.5mm;
  border-bottom: 1pt solid #333;
  font-size: 8.5pt;
  text-align: left;
  letter-spacing: 0.04em;
}

.bill-sheet-table td {
  padding: 1.8mm 1.5mm;
  border-bottom: 0.4pt solid #bbb;
  font-size: 9.5pt;
  vertical-align: top;
}

.bill-sheet-table td small {
  color: #666;
}

.bill-sheet-group-row td {
  background: #f0ebe2;
  font-weight: 700;
  letter-spacing: 0.08em;
  border-bottom: 0.6pt solid #999;
}

.bill-sheet-qty {
  text-align: right;
}

.bill-sheet-num {
  text-align: right;
  white-space: nowrap;
}

.bill-sheet-included {
  margin-top: 4mm;
  font-size: 8.5pt;
  color: #444;
}

.bill-sheet-included h3 {
  font-size: 9pt;
  margin-bottom: 1mm;
}

.bill-sheet-summary {
  display: grid;
  gap: 1mm;
  width: 75mm;
  margin-left: auto;
  margin-top: 5mm;
}

.bill-sheet-summary > div {
  display: flex;
  justify-content: space-between;
  gap: 6mm;
  font-size: 10pt;
}

.bill-sheet-summary .bill-sheet-total {
  margin-top: 1mm;
  padding-top: 1.5mm;
  border-top: 1.2pt solid #333;
  font-size: 12pt;
}

.bill-sheet-summary .bill-sheet-total strong {
  font-size: 15pt;
}

.bill-sheet-foot {
  margin-top: 12mm;
  padding-top: 4mm;
  border-top: 0.6pt solid #999;
  text-align: center;
  font-size: 8.5pt;
  color: #555;
}

@media (max-width: 1100px) {
  .rules-form-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .rules-form-row > .switch {
    grid-column: 1 / -1;
  }

  .rule-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .session-stats {
    grid-template-columns: 1fr;
  }

  .sessions-grid {
    grid-template-columns: 1fr;
  }

  .session-time {
    grid-template-columns: 1fr;
  }

  .bill-line {
    grid-template-columns: minmax(0, 1fr) 34px 64px 68px;
    grid-template-areas:
      "name name name amount"
      "qty unit tax amount";
    row-gap: 2px;
    column-gap: 6px;
    padding: 9px 11px;
  }

  .bill-line-name { grid-area: name; }
  .bill-line-qty { grid-area: qty; text-align: left; }
  .bill-line-unit { grid-area: unit; text-align: left; }
  .bill-line-tax { grid-area: tax; justify-self: start; }
  .bill-line-amount { grid-area: amount; align-self: start; }

  .bill-dialog {
    padding: 18px 14px 14px;
  }

  .rules-form-row,
  .rules-form-row-wide {
    grid-template-columns: 1fr;
  }

  .rule-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .menu-price-block {
    grid-column: 2;
    justify-items: start;
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
  }

  .menu-meta {
    grid-column: 2;
  }
}

@media (max-width: 560px) {
  .session-stats {
    grid-template-columns: 1fr;
  }

  .session-foot {
    align-items: flex-start;
  }

  .session-actions {
    width: 100%;
  }

  .session-actions .btn {
    flex: 1;
  }

  .rule-grid {
    grid-template-columns: 1fr;
  }

  .rules-card {
    padding: 14px;
  }

  .order-totals {
    width: 100%;
    justify-content: space-between;
  }
}


/* ============================================================
   V3：服务请求 / 午市定食 / 服务项 / 放题限购
   ============================================================ */
.order-card.is-service {
  border-left-color: #3b7d8c;
  background:
    linear-gradient(135deg, rgba(214, 235, 240, 0.55), rgba(255, 253, 247, 0) 62%),
    var(--surface);
}

.order-card.is-service.is-fresh {
  box-shadow: 0 0 0 2px rgba(59, 125, 140, 0.28), var(--shadow);
}

.order-service-badge {
  background: #dceef2;
  border: 1px solid #bfdfe6;
  color: #245b67;
  font-weight: 700;
}

.order-priority-badge {
  background: var(--warning-soft);
  border: 1px solid #e6cf9f;
  color: #7a5514;
}

.order-card.is-service .order-qty {
  background: #dceef2;
  color: #245b67;
}

.order-item-free {
  font-size: 11.5px;
  font-weight: 600;
  padding-top: 1px;
  white-space: nowrap;
}

.order-service-free {
  font-size: 12.5px;
  font-weight: 600;
  color: #245b67;
}

.mini-badge-service {
  background: #dceef2;
  border-color: #bfdfe6;
  color: #245b67;
}

.mini-badge-station {
  background: #e9e1f2;
  border-color: #d6c9e6;
  color: #57406f;
}

.mini-badge-limit {
  background: var(--warning-soft);
  border-color: #e6cf9f;
  color: #7a5514;
}

.mode-badge.mode-lunchset {
  background: #e2efdf;
  border: 1px solid #c9dfc4;
  color: #39623c;
}

.menu-item.is-service-item {
  background:
    linear-gradient(90deg, rgba(220, 238, 242, 0.35), rgba(255, 253, 247, 0) 55%),
    var(--surface);
}

.menu-price-free {
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 700;
  color: var(--success);
}

.menu-price-free-block {
  justify-items: end;
}

.menu-option-summary {
  font-size: 11.5px;
  line-height: 1.55;
  margin-top: 1px;
}

.menu-edit-note {
  grid-column: 1 / -1;
  padding: 8px 10px;
  border: 1px dashed var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  font-size: 11.5px;
  line-height: 1.5;
}

.rules-form-row-limits {
  grid-template-columns: repeat(2, minmax(0, 1fr)) minmax(220px, 1.4fr);
  align-items: end;
}

.rules-limit-note {
  padding: 8px 11px;
  border-left: 3px solid var(--gold);
  background: var(--surface-2);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 11.5px;
  line-height: 1.6;
}

@media (max-width: 1100px) {
  .rules-form-row-limits {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .rules-limit-note {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  .rules-form-row-limits {
    grid-template-columns: 1fr;
  }

  .rules-limit-note {
    grid-column: auto;
  }
}

/* ---------------- 打印 ---------------- */
.print-area {
  display: none;
}

@media print {
  @page {
    size: A4;
    margin: 12mm;
  }

  html,
  body {
    background: #fff !important;
  }

  body > *:not(.print-area):not(.bill-print-area) {
    display: none !important;
  }

  .print-area,
  .bill-print-area {
    display: none !important;
  }

  body.print-card .print-area {
    display: flex !important;
    justify-content: center;
    align-items: flex-start;
    padding: 0;
  }

  body.print-card .print-area img {
    width: 120mm;
    height: 160mm;
    object-fit: contain;
  }

  body.print-bill .bill-print-area {
    display: block !important;
    padding: 0;
  }

  body.print-bill .bill-sheet {
    width: 180mm;
  }
}

/* ---------------- 响应式 ---------------- */
@media (max-width: 1100px) {
  .table-form-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1100px) {
  .topbar-inner {
    gap: 12px;
  }

  .tabs {
    order: 3;
    width: 100%;
    flex: 1 0 100%;
    padding-bottom: 2px;
  }

  .topbar-actions {
    margin-left: auto;
  }

  .table-row-main {
    grid-template-columns: minmax(150px, 1fr) auto minmax(0, 1.2fr);
  }

  .table-row-main .table-row-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
}

@media (max-width: 760px) {
  .staff-main,
  .topbar-inner {
    width: min(100% - 24px, var(--staff-maxw));
  }

  .staff-main {
    padding-top: 18px;
  }

  .orders-grid {
    grid-template-columns: 1fr;
  }

  .qr-toolbar-row {
    flex-direction: column;
    align-items: stretch;
  }

  .qr-filters {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .qr-filters .input,
  .qr-filters .select {
    width: 100%;
  }

  .qr-toolbar-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .qr-export-buttons .btn {
    flex: 1;
  }

  .table-form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .menu-item {
    grid-template-columns: 40px minmax(0, 1fr);
    align-items: start;
    padding: 12px 14px;
  }

  .menu-emoji {
    width: 40px;
    height: 40px;
    font-size: 20px;
  }

  .menu-meta {
    grid-column: 2;
    justify-content: space-between;
    margin-top: 2px;
  }

  .menu-edit-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .menu-edit-price {
    grid-column: 1 / -1;
  }

  .dialog-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .topbar-clock {
    display: none;
  }

  .panel-head {
    align-items: flex-start;
  }

  .panel-head-actions {
    width: 100%;
    justify-content: space-between;
  }

  .chips {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
  }

  .chips::-webkit-scrollbar {
    display: none;
  }

  .chip {
    flex: none;
  }

  .table-form-grid {
    grid-template-columns: 1fr;
  }

  .table-row {
    padding: 14px;
  }

  .table-row-main {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .table-row-main .table-row-actions {
    grid-column: auto;
  }

  .qr-grid {
    grid-template-columns: 1fr;
  }

  .qr-preview canvas {
    max-height: 520px;
  }

  .login-card {
    padding: 26px 20px;
  }

  .toasts {
    right: 12px;
    left: 12px;
    bottom: 12px;
    max-width: none;
  }

  .dialog {
    padding: 18px 16px 16px;
  }
}

/* ---------------- 菜品图片 / 新增菜品 / 店铺图片 ---------------- */
.menu-thumb {
  display: block;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  object-fit: cover;
  background: var(--surface-2);
}

.shop-image-card {
  margin-bottom: 16px;
  padding: 16px;
}

.shop-image-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 10px;
}

.shop-image-field {
  display: grid;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.shop-image-field input[type="file"] {
  font-size: 12px;
}

.shop-image-field img {
  width: 100%;
  max-height: 150px;
  border-radius: 10px;
  object-fit: cover;
  background: var(--surface-2);
}

.menu-item-dialog {
  width: min(720px, calc(100vw - 32px));
}

.menu-item-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin: 12px 0;
}

.check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--ink);
}

.menu-item-image-preview {
  display: block;
  width: 120px;
  height: 120px;
  margin-top: 8px;
  border-radius: 12px;
  object-fit: cover;
  background: var(--surface-2);
}

@media (max-width: 640px) {
  .shop-image-grid {
    grid-template-columns: 1fr;
  }
}

/* ---------- 套餐背景图 ---------- */
.course-rule-thumb {
  display: block;
  width: 100%;
  max-height: 150px;
  margin: 8px 0;
  border-radius: 12px;
  object-fit: cover;
  background: var(--surface-2);
}
