/* 家常菜单 · 样式（点菜端和管理端共用） */

:root {
  --bg: #f6f5f2;
  --surface: #ffffff;
  --surface-2: #faf9f7;
  --border: #e6e3dd;
  --text: #1a1815;
  --muted: #756f66;
  --accent: #c2410c;      /* 灶火色 */
  --accent-soft: #fff1e8;
  --ok: #15803d;
  --danger: #c0392b;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(26, 24, 21, .06), 0 6px 20px rgba(26, 24, 21, .05);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14120f;
    --surface: #1d1a16;
    --surface-2: #24201b;
    --border: #332e27;
    --text: #ece8e1;
    --muted: #9a9288;
    --accent: #fb923c;
    --accent-soft: #3a2415;
    --ok: #4ade80;
    --danger: #f87171;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { margin: 0; font-weight: 650; }
h1 { font-size: 20px; }
h2 { font-size: 16px; }
a { color: var(--accent); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.num { font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }

.wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 16px 16px 24px;
}
.wrap.wide { max-width: 980px; }

/* ------------------------------------------------------------- 顶栏 */

header.top {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
header.top .wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 12px;
  padding-bottom: 12px;
}
header.top .grow { flex: 1; min-width: 0; }
header.top .sub { font-size: 12px; color: var(--muted); }

/* ------------------------------------------------------------- 卡片 */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px;
  margin-bottom: 12px;
}
.card > h2 { margin-bottom: 10px; }

/* ------------------------------------------------------------- 按钮 */

button {
  font: inherit;
  cursor: pointer;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  padding: 8px 14px;
  transition: filter .12s, background .12s;
}
button:hover { filter: brightness(.97); }
button:active { transform: translateY(1px); }
button:disabled { opacity: .45; cursor: not-allowed; }

button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
}
button.ghost { background: transparent; }
button.danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, var(--border)); }
button.tiny { padding: 4px 9px; font-size: 13px; border-radius: 8px; }

.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.spacer { flex: 1; }

/* ------------------------------------------------------------- 表单 */

label.field { display: block; margin-bottom: 10px; }
label.field > span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }

input, select, textarea {
  font: inherit;
  width: 100%;
  padding: 9px 11px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid color-mix(in srgb, var(--accent) 45%, transparent);
  outline-offset: -1px;
}
textarea { resize: vertical; min-height: 60px; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
@media (max-width: 520px) { .grid2 { grid-template-columns: 1fr; } }

/* ------------------------------------------------------------- 分类 */

.cat-title {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 20px 2px 8px;
  font-weight: 650;
}
.cat-title .n { font-size: 12px; color: var(--muted); font-weight: 400; }

/* ------------------------------------------------------------- 菜品行 */

.dish {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  margin-bottom: 8px;
}
.dish.picked {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.dish .emoji { font-size: 26px; line-height: 1; width: 30px; text-align: center; flex: none; }
.dish .body { flex: 1; min-width: 0; }
.dish .nm { font-weight: 600; }
.dish .meta { font-size: 12px; color: var(--muted); }

/* 份数步进器 */
.stepper { display: flex; align-items: center; gap: 6px; flex: none; }
.stepper .qty { min-width: 22px; text-align: center; font-variant-numeric: tabular-nums; font-weight: 600; }
.stepper button {
  width: 32px; height: 32px; padding: 0;
  display: grid; place-items: center;
  border-radius: 50%; font-size: 17px; line-height: 1;
}

/* ------------------------------------------------------------- 结算条 */

.bar {
  position: sticky;
  bottom: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom);
}
.bar .wrap { display: flex; align-items: center; gap: 12px; padding-top: 12px; padding-bottom: 12px; }
.bar .count { font-weight: 650; }

/* ------------------------------------------------------------- 订单 */

.order {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  padding: 12px;
  margin-bottom: 10px;
}
.order.pending { border-left: 4px solid var(--accent); }
.order.done { opacity: .72; }
.order .hd { display: flex; align-items: baseline; gap: 8px; margin-bottom: 6px; flex-wrap: wrap; }
.order .who { font-weight: 650; }
.order .when { font-size: 12px; color: var(--muted); }
.order ul { margin: 6px 0 0; padding-left: 18px; }
.order li { margin: 2px 0; }
.order .note {
  margin-top: 8px;
  padding: 7px 10px;
  background: var(--surface-2);
  border-radius: 8px;
  font-size: 13px;
}

.tag {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid var(--border);
  color: var(--muted);
}
.tag.hot { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.tag.ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 40%, var(--border)); }

/* ------------------------------------------------------------- 今天要做 */

.cook-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px dashed var(--border);
}
.cook-item:last-child { border-bottom: none; }
.cook-item .qty { font-weight: 700; color: var(--accent); min-width: 34px; }

/* ------------------------------------------------------------- 表格 */

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 8px 6px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { font-size: 12px; color: var(--muted); font-weight: 500; }
td.right, th.right { text-align: right; }
.table-scroll { overflow-x: auto; }

/* ------------------------------------------------------------- 标签页 */

.tabs { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.tabs button {
  border-radius: 999px;
  padding: 6px 14px;
  background: transparent;
}
.tabs button[aria-selected="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
}

/* ------------------------------------------------------------- 提示 */

.toast {
  position: fixed;
  left: 50%;
  bottom: 84px;
  transform: translateX(-50%);
  z-index: 50;
  max-width: min(92vw, 460px);
  padding: 10px 16px;
  border-radius: 12px;
  background: var(--text);
  color: var(--bg);
  box-shadow: var(--shadow);
  font-size: 14px;
}
.toast.bad { background: var(--danger); color: #fff; }

.empty { text-align: center; color: var(--muted); padding: 28px 10px; }

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  word-break: break-all;
}
