:root {
  --bg: #f3f1ed;
  --bg-accent: linear-gradient(165deg, #faf8f5 0%, #ebe6df 45%, #e8e4dc 100%);
  --card: #ffffff;
  --text: #1c1917;
  --muted: #78716c;
  --muted-light: #a8a29e;
  --primary: #c2410c;
  --primary-hover: #9a3412;
  --primary-soft: rgba(194, 65, 12, 0.1);
  --border: rgba(28, 25, 23, 0.08);
  --border-strong: rgba(28, 25, 23, 0.12);
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(28, 25, 23, 0.05);
  --shadow-md: 0 4px 14px rgba(28, 25, 23, 0.07), 0 2px 4px rgba(28, 25, 23, 0.04);
  --shadow-lg: 0 12px 40px rgba(28, 25, 23, 0.1);
  --header-h: 3.25rem;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --font: system-ui, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font);
  background: var(--bg);
  background-image: var(--bg-accent);
  background-attachment: fixed;
  color: var(--text);
  line-height: 1.55;
  -webkit-tap-highlight-color: transparent;
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

button {
  font: inherit;
  cursor: pointer;
}

.app-root {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  width: 100%;
  max-width: 100%;
}

/* 主内容区铺满横向空间（顶栏下第一块） */
.app-root > :not(.app-header) {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
}

/* —— 顶栏 —— */
.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  min-height: var(--header-h);
  padding: 0.45rem 1rem 0.5rem;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-strong);
  box-shadow: var(--shadow-sm);
}

.app-header__row--main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  min-height: calc(var(--header-h) - 0.35rem);
}

.app-header__admin-menu {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  width: 100%;
  padding-top: 0.4rem;
  margin-top: 0.35rem;
  border-top: 1px solid var(--border);
}

.app-header__admin-tab {
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.34rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: rgba(255, 255, 255, 0.75);
  color: var(--muted);
  cursor: pointer;
  transition:
    border-color 0.12s ease,
    color 0.12s ease,
    background 0.12s ease;
}

.app-header__admin-tab:hover {
  border-color: rgba(194, 65, 12, 0.35);
  color: var(--text);
}

.app-header__admin-tab.active {
  background: var(--primary-soft);
  border-color: rgba(194, 65, 12, 0.42);
  color: #9a3412;
}

.app-header__brand {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}


.app-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  justify-content: flex-end;
}

.app-nav .user-chip {
  font-size: 0.8rem;
  color: var(--muted);
  max-width: 6.5rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 0.25rem 0.5rem;
  background: var(--primary-soft);
  border-radius: 999px;
  font-weight: 500;
}

/* —— 按钮 —— */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.62rem 1.1rem;
  border-radius: var(--radius-sm);
  border: none;
  background: linear-gradient(180deg, #ea580c 0%, var(--primary) 100%);
  color: #fff;
  font-weight: 600;
  font-size: 0.95rem;
  box-shadow: 0 1px 2px rgba(194, 65, 12, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.15);
  transition:
    transform 0.12s ease,
    box-shadow 0.12s ease,
    background 0.12s ease;
}

.btn:hover:not(:disabled) {
  background: linear-gradient(180deg, #f97316 0%, #ea580c 100%);
  box-shadow: 0 2px 8px rgba(194, 65, 12, 0.3);
}

.btn:active:not(:disabled) {
  transform: scale(0.98);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

.btn.secondary {
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-sm);
}

.btn.secondary:hover:not(:disabled) {
  background: #fafaf9;
  border-color: var(--muted-light);
}

.btn.btn--sm {
  padding: 0.4rem 0.75rem;
  font-size: 0.82rem;
  font-weight: 600;
}

.btn-block {
  width: 100%;
}

/* —— 卡片 —— */
.card {
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 1rem 1.1rem;
  margin-bottom: 0.85rem;
  box-shadow: var(--shadow-md);
}

.card--muted {
  background: rgba(255, 255, 255, 0.65);
  box-shadow: var(--shadow-sm);
}

.card--interactive {
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    border-color 0.18s ease;
}

.card--interactive:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(194, 65, 12, 0.2);
}

.card--interactive:active {
  transform: translateY(0);
}

/* —— 表单 —— */
input,
select,
textarea {
  font: inherit;
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: #fafaf9;
  color: var(--text);
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    background 0.15s ease;
}

input:hover,
select:hover,
textarea:hover {
  border-color: var(--muted-light);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 3px var(--primary-soft);
}

input::placeholder,
textarea::placeholder {
  color: var(--muted-light);
}

label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 0.35rem;
  letter-spacing: 0.02em;
}

.field-grid {
  display: grid;
  gap: 1rem;
}

.form-actions {
  margin-top: 1rem;
}

/* —— 页面 —— */
.page {
  max-width: 46rem;
  margin: 0 auto;
  padding: 1.25rem 1rem calc(1.5rem + var(--safe-bottom));
}

.page-hero {
  margin-bottom: 1.35rem;
}

.page-title {
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 0 0 0.35rem;
  line-height: 1.2;
  color: var(--text);
}

.page-lead {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  max-width: 36rem;
}

.portal-tiles {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.portal-tiles--staff {
  gap: 0.85rem;
}

.portal-section {
  margin-bottom: 2rem;
}

.portal-section:last-child {
  margin-bottom: 0;
}

.portal-section__head {
  margin-bottom: 0.65rem;
}

.portal-section__title {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0 0 0.25rem;
  color: var(--text);
  letter-spacing: -0.01em;
}

.portal-section__lead {
  margin: 0;
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.45;
}

.portal-section--staff {
  padding-top: 0.25rem;
  border-top: 1px solid var(--border-strong);
  margin-top: 0.25rem;
}

.portal-tile__tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0.02em;
  color: var(--muted);
  background: rgba(28, 25, 23, 0.06);
  padding: 0.2rem 0.45rem;
  border-radius: 6px;
  margin-bottom: 0.45rem;
}

.portal-resume__role {
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}

.portal-resume__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.portal-resume[data-role="admin"] {
  border-left: 4px solid #4338ca;
}

.portal-resume[data-role="merchant"] {
  border-left: 4px solid #0f766e;
}

.portal-resume[data-role="employee"] {
  border-left: 4px solid var(--primary);
}

.login-context {
  margin: 0 0 0.35rem;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--muted);
}

.app-header__left {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.workspace-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.22rem 0.55rem;
  border-radius: 999px;
  white-space: nowrap;
  border: 1px solid var(--border-strong);
  background: rgba(255, 255, 255, 0.65);
  color: var(--muted);
}

.workspace-badge[data-ws="user"] {
  color: #9a3412;
  background: var(--primary-soft);
  border-color: rgba(194, 65, 12, 0.22);
}

.workspace-badge[data-ws="merchant"] {
  color: #0f766e;
  background: rgba(15, 118, 110, 0.1);
  border-color: rgba(15, 118, 110, 0.2);
}

.workspace-badge[data-ws="admin"] {
  color: #4338ca;
  background: rgba(67, 56, 202, 0.1);
  border-color: rgba(67, 56, 202, 0.22);
}

.portal-tile {
  position: relative;
  overflow: hidden;
}

.portal-tile--user {
  border-left: 4px solid var(--primary);
}

.portal-tile--merchant {
  border-left: 4px solid #0f766e;
}

.portal-tile--admin {
  border-left: 4px solid #4338ca;
}

.portal-tile:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.portal-tile__title {
  font-size: 1.08rem;
  font-weight: 700;
  margin: 0 0 0.4rem;
  letter-spacing: -0.02em;
}

.portal-tile__desc {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

h1 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 0.65rem;
  line-height: 1.25;
}

h2 {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 1.25rem 0 0.6rem;
  color: var(--text);
  letter-spacing: -0.01em;
}

.err {
  color: #b91c1c;
  font-size: 0.9rem;
  margin: 0.65rem 0 0;
  padding: 0.65rem 0.85rem;
  background: rgba(185, 28, 28, 0.08);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(185, 28, 28, 0.15);
}

/* —— Tabs —— */
.tabs {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
  padding: 0.35rem;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 999px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.tabs button {
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.82rem;
  transition:
    background 0.15s ease,
    color 0.15s ease;
}

.tabs button:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.9);
}

.tabs button.active {
  background: linear-gradient(180deg, #ea580c 0%, var(--primary) 100%);
  color: #fff;
  box-shadow: 0 1px 3px rgba(194, 65, 12, 0.3);
}

/* —— 表格 —— */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.data-table th,
.data-table td {
  padding: 0.45rem 0.35rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

.data-table th {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: none;
}

.data-table tr:last-child td {
  border-bottom: none;
}

/* —— 轻提示（下单成功等） —— */
.toast-snackbar {
  position: fixed;
  left: 50%;
  bottom: calc(2rem + var(--safe-bottom));
  transform: translateX(-50%);
  z-index: 1100;
  margin: 0;
  padding: 0.65rem 1.35rem;
  max-width: calc(100vw - 2rem);
  background: var(--text);
  color: var(--card);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  pointer-events: none;
  text-align: center;
}

/* —— 支付弹层 —— */
.pay-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(28, 25, 23, 0.48);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  overflow-y: auto;
}

.pay-modal {
  max-width: 22rem;
  width: 100%;
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
  animation: pay-pop 0.22s ease-out;
}

@keyframes pay-pop {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(6px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.pay-qr-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
  margin-top: 0.85rem;
}

@media (max-width: 380px) {
  .pay-qr-grid {
    grid-template-columns: 1fr;
  }
}

.pay-qr-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.pay-qr-img {
  width: 100%;
  max-width: 10rem;
  height: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  display: block;
  margin: 0 auto;
}

.muted {
  color: var(--muted);
  font-size: 0.9rem;
}

.merchant-pick {
  cursor: pointer;
}

.menu-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.menu-row .menu-row__meta {
  flex: 1;
}

.menu-row .price {
  color: var(--primary);
  font-weight: 600;
  font-size: 0.95rem;
}

.page-toolbar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
  flex-wrap: wrap;
}

.page-toolbar h1,
.page-toolbar .page-title {
  margin: 0;
  flex: 1;
  min-width: 8rem;
  font-size: 1.35rem;
}

.qty-btn {
  min-width: 2.25rem;
  padding: 0.35rem 0.5rem !important;
  font-weight: 700;
}

.cart-highlight {
  background: linear-gradient(135deg, rgba(194, 65, 12, 0.06) 0%, rgba(15, 118, 110, 0.06) 100%);
  border-color: rgba(194, 65, 12, 0.15);
}

.flex-between {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
  flex-wrap: wrap;
}

@media (min-width: 480px) {
  .page {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }
}

@media (min-width: 640px) {
  .portal-tiles--staff {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem;
  }
}

@media (min-width: 900px) {
  .app-header {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }

  .app-nav .user-chip {
    max-width: 12rem;
  }

  .page {
    max-width: 72rem;
    padding-top: 2rem;
    padding-bottom: calc(2.25rem + var(--safe-bottom));
  }

  .portal-tiles--staff {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
  }

  .portal-tiles--single {
    max-width: 32rem;
  }

  .field-grid {
    grid-template-columns: 1fr 1fr;
    align-items: end;
  }

  .pay-modal {
    max-width: 34rem;
  }
}

@media (min-width: 1200px) {
  .page {
    max-width: 84rem;
  }
}

/* —— 列表卡片行（左文右操作） —— */
.list-card-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.status-dot {
  display: inline-block;
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.06);
}

.status-dot--on {
  background: #22c55e;
}

.status-dot--off {
  background: #ef4444;
}

.stats-list-card__meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.35rem;
  flex-shrink: 0;
}

.stats-list-card__count {
  font-size: 0.95rem;
  white-space: nowrap;
}

.admin-stats-toolbar .admin-catalog-toolbar__row,
.admin-orders-toolbar .admin-catalog-toolbar__row {
  flex-wrap: wrap;
}

.admin-stats-toolbar .admin-catalog-toolbar__row label,
.admin-orders-toolbar .admin-catalog-toolbar__row label {
  flex: 1 1 auto;
  min-width: min(100%, 9rem);
}

.admin-stats-toolbar .admin-catalog-toolbar__row label input[type="date"],
.admin-orders-toolbar .admin-catalog-toolbar__row label input[type="date"] {
  flex: 1 1 6rem;
  min-width: 0;
  max-width: 100%;
  width: auto;
}

.admin-stats-toolbar .admin-catalog-toolbar__btns,
.admin-orders-toolbar .admin-catalog-toolbar__btns {
  flex: 1 1 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.page--detail {
  padding-bottom: 2rem;
}

/* 详情类页：占满主区域宽度，避免右侧大块留白（覆盖各断点 .page 的 max-width） */
.page.page--detail-left {
  margin: 0;
  max-width: none;
  width: 100%;
  padding-top: 0.65rem;
  box-sizing: border-box;
}

.detail-page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.75rem;
  margin-bottom: 0.5rem;
}

.detail-page-head__main {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.35rem 0.5rem;
  min-width: 0;
}

.detail-page-head__title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--text);
}

.detail-page-head__meta {
  font-size: 0.82rem;
}

.detail-page-loading {
  margin: 0.15rem 0 0.5rem;
}

/* —— 管理后台 · 用户 Tab工具条 —— */
.admin-users-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem 1rem;
  padding: 0.55rem 0.85rem !important;
  margin-bottom: 0.85rem;
}

.admin-access-inline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.65rem;
  font-size: 0.82rem;
  color: var(--muted);
}

.admin-access-inline__label {
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}

.admin-access-inline__select {
  font: inherit;
  padding: 0.28rem 0.45rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--card);
  min-width: 5.5rem;
}

.admin-access-inline__check {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
  cursor: pointer;
  white-space: nowrap;
  color: var(--text);
}

.admin-access-inline--block {
  flex-direction: column;
  align-items: flex-start;
  gap: 0.65rem;
  max-width: 22rem;
}

.admin-settings-panel {
  margin-bottom: 0.85rem;
}

.admin-settings-panel__section {
  border-top: 1px solid var(--border);
  padding-top: 1rem;
}

.admin-settings-panel__section-title {
  margin: 0 0 0.65rem;
  font-size: 0.95rem;
  font-weight: 600;
}

.admin-settings-time-input {
  font: inherit;
  padding: 0.28rem 0.5rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--card);
  color: var(--text);
  min-height: 2rem;
}

.admin-users-toolbar__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  flex: 1;
  justify-content: flex-end;
  min-width: min(100%, 12rem);
}

.admin-users-toolbar__search {
  flex: 1;
  min-width: 8rem;
  max-width: 16rem;
  font: inherit;
  padding: 0.4rem 0.55rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
}

.admin-add-emp-modal {
  max-width: 22rem;
}

.admin-add-emp-modal__btns {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 1rem;
}

.admin-catalog-toolbar .admin-catalog-toolbar__row {
  width: 100%;
  justify-content: space-between;
  max-width: none;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.admin-catalog-toolbar__search {
  flex: 1;
  min-width: 10rem;
  max-width: 20rem;
}

.admin-catalog-toolbar__btns {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}

.admin-user-edit {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  width: 100%;
  max-width: none;
  padding: 0.75rem 1rem 0.85rem;
  margin-bottom: 0.5rem;
  box-sizing: border-box;
}

.admin-user-edit__pairs {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.35rem 1rem;
  width: 100%;
}

@media (min-width: 640px) {
  .admin-user-edit__pairs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.admin-user-edit__row {
  display: grid;
  grid-template-columns: minmax(4.25rem, 5.5rem) minmax(0, 1fr);
  column-gap: 0.6rem;
  align-items: center;
  min-width: 0;
}

.admin-user-edit__row--full {
  grid-column: 1 / -1;
  width: 100%;
}

.admin-user-edit__label {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  text-align: right;
  line-height: 1.25;
}

.admin-user-edit__control {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.admin-user-edit__hint {
  margin: 0.15rem 0 0;
  font-size: 0.75rem;
  line-height: 1.45;
}

.admin-user-edit__actions {
  margin-top: 0.35rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-start;
}

.admin-add-merchant-modal {
  max-width: 26rem;
}

/* 新建/编辑餐厅：底部状态（与上方表单项一致的下拉） */
.merchant-modal-footer-fields {
  margin-top: 0.85rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}
.merchant-modal-footer-fields__select {
  width: 100%;
  box-sizing: border-box;
  font: inherit;
  padding: 0.45rem 0.55rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--card);
  color: var(--text);
}

.admin-proxy-modal {
  max-width: min(28rem, calc(100vw - 2rem));
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
}

.admin-proxy-modal__menu {
  max-height: 14rem;
  overflow-y: auto;
}

.admin-row-actions {
  white-space: nowrap;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}

.admin-row-actions--stack {
  flex-direction: column;
  align-items: stretch;
}

/* —— 响应式列表：PC 表格 / 移动卡片（默认只显示卡片；≥900px 只显示表格） —— */
/* 使用 .page 提高优先级并加 !important，避免旧缓存或其它规则把两处都显示成 block */
.page .responsive-list__table {
  display: none !important;
}
.page .responsive-list__cards {
  display: block !important;
}
@media (min-width: 900px) {
  .page .responsive-list__table {
    display: block !important;
  }
  .page .responsive-list__cards {
    display: none !important;
  }
}

.pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  margin: 0.75rem 0 0;
}

.table-scroll {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--card);
  box-shadow: var(--shadow-md);
}

.table-scroll .data-table {
  margin: 0;
  font-size: 0.86rem;
}

.table-scroll .data-table th,
.table-scroll .data-table td {
  padding: 0.5rem 0.55rem;
  white-space: nowrap;
}

.table-scroll .data-table td.wrap {
  white-space: normal;
  max-width: 22rem;
}

.menu-grid-pc {
  display: block;
  margin-bottom: 0.75rem;
}

@media (min-width: 900px) {
  .menu-grid-pc {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
  }

  .menu-grid-pc > .card.menu-row {
    margin-bottom: 0;
  }
}

.menu-row {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.menu-row--selected {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-soft);
}

.menu-row__pick {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--primary);
  white-space: nowrap;
}

.order-calendar-panel {
  padding: 1rem 1.1rem 1.15rem;
  box-shadow: var(--shadow-md);
}

.admin-calendar-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--border);
}

.admin-calendar-toolbar__nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.admin-calendar-toolbar__title {
  min-width: 7.5rem;
  margin: 0;
  text-align: center;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.admin-calendar-toolbar__nav .btn--sm {
  min-width: 2.1rem;
  padding-left: 0.55rem;
  padding-right: 0.55rem;
  font-size: 1.1rem;
  line-height: 1;
}

.admin-calendar-toolbar__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.order-calendar-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1rem;
  margin-bottom: 0.65rem;
}

.order-calendar-legend__item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.order-calendar-legend__dot {
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 999px;
  display: inline-block;
  border: 1px solid transparent;
}

.order-calendar-legend__dot--on {
  background: #d1fae5;
  border-color: #34d399;
}

.order-calendar-legend__dot--off {
  background: #f5f5f4;
  border-color: #d6d3d1;
}

.order-calendar-legend__dot--manual {
  background: var(--primary-soft);
  border: 1px dashed var(--primary);
}

.order-calendar-legend__dot--today {
  background: #fff7ed;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-soft);
}

.order-calendar-hint {
  margin: 0 0 0.75rem;
  font-size: 0.82rem;
}

.order-calendar-wrap {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.65) 0%, rgba(255, 255, 255, 0.35) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.65rem;
}

.order-calendar {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.4rem;
}

.order-calendar__weekhead {
  text-align: center;
  font-size: 0.75rem;
  color: var(--muted);
  padding: 0.35rem 0 0.2rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.order-calendar__weekhead--weekend {
  color: #b45309;
}

.order-calendar__day {
  position: relative;
  aspect-ratio: 1;
  min-height: 2.75rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.15rem;
  transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}

.order-calendar__day--blank {
  visibility: hidden;
  pointer-events: none;
  border-color: transparent;
  background: transparent;
}

.order-calendar__day--on {
  background: linear-gradient(165deg, #ecfdf5 0%, #d1fae5 100%);
  border-color: #6ee7b7;
  color: #047857;
}

.order-calendar__day--off {
  background: #fafaf9;
  color: var(--muted-light);
  border-color: #e7e5e4;
}

.order-calendar__day--weekend:not(.order-calendar__day--on) {
  background: #fafaf9;
}

.order-calendar__day--manual {
  box-shadow: inset 0 0 0 2px rgba(194, 65, 12, 0.35);
}

.order-calendar__day--today {
  box-shadow: 0 0 0 2px var(--primary-soft), var(--shadow-sm);
}

.order-calendar__day--today.order-calendar__day--on {
  border-color: var(--primary);
}

.order-calendar__day:not(:disabled):hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
  z-index: 1;
}

.order-calendar__day:not(:disabled):active {
  transform: translateY(0);
}

.order-calendar__num {
  font-weight: 700;
  font-size: 0.92rem;
  line-height: 1.1;
}

.order-calendar__badge {
  position: absolute;
  top: 0.2rem;
  right: 0.28rem;
  font-size: 1.1rem;
  line-height: 1;
  color: var(--primary);
  font-weight: 800;
}

@media (min-width: 640px) {
  .order-calendar__day {
    min-height: 3.1rem;
  }

  .order-calendar__num {
    font-size: 1rem;
  }
}
