/* 家宴点单系统 — Anthropic / Claude 风格
   暖象牙底 + 珊瑚橙点缀 + 衬线标题，移动端优先，克制留白。 */

:root {
  --bg: #FAF9F5;
  --bg-soft: #F5F4EF;
  --surface: #FFFFFF;
  --text: #1F1E1D;
  --muted: #6E6B63;
  --border: #E8E6DF;
  --accent: #D97757;
  --accent-hover: #C15F3C;
  --accent-soft: #F6E8E1;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(31, 30, 29, 0.04);
  --shadow-lg: 0 8px 24px rgba(31, 30, 29, 0.08);
  --font-serif: Georgia, "Times New Roman", "Songti SC", "Noto Serif SC", serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

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

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .serif { font-family: var(--font-serif); font-weight: 600; letter-spacing: -0.01em; }

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

/* ── 布局 ── */
.container { max-width: 680px; margin: 0 auto; padding: 16px 16px 120px; }
.admin-container { max-width: 960px; margin: 0 auto; padding: 20px 16px 120px; }

.topbar {
  position: sticky; top: 0; z-index: 40;
  background: rgba(250, 249, 245, 0.9); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  padding: 14px 16px;
}
.topbar-inner { max-width: 680px; margin: 0 auto; display: flex; align-items: center; gap: 10px; }
.topbar h1 { font-size: 18px; flex: 1; }
.topbar .sub { font-size: 13px; color: var(--muted); }

/* ── 按钮 ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--accent); color: #fff; border: none;
  padding: 10px 20px; border-radius: 999px;
  font-size: 15px; font-weight: 600; font-family: var(--font-sans);
  cursor: pointer; transition: background 0.15s, transform 0.05s; white-space: nowrap;
}
.btn:hover { background: var(--accent-hover); }
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--accent); border: 1px solid var(--border); }
.btn.ghost:hover { background: var(--accent-soft); border-color: var(--accent); }
.btn.danger { background: transparent; color: #B4452E; border: 1px solid #E5C8BF; }
.btn.danger:hover { background: #F9ECE8; }
.btn.sm { padding: 6px 14px; font-size: 13px; }

/* ── 卡片 ── */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow);
}

/* ── 输入 ── */
.input, textarea.input, select.input {
  width: 100%; border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 10px 12px; font-size: 15px; font-family: var(--font-sans);
  background: var(--surface); color: var(--text); outline: none; transition: border-color 0.15s;
}
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea.input { resize: vertical; min-height: 80px; }
label.field { display: block; font-size: 13px; color: var(--muted); margin: 12px 0 6px; font-weight: 500; }

/* ── 分类 Tab ── */
.tabs { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 12px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex-shrink: 0; padding: 7px 15px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border); color: var(--muted);
  font-size: 13px; font-weight: 500; cursor: pointer; transition: all 0.15s; white-space: nowrap;
}
.tab.active { background: var(--text); color: #fff; border-color: var(--text); }

/* ── 菜品网格 ── */
.dish-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 560px) { .dish-grid { grid-template-columns: repeat(3, 1fr); } }
.dish {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; cursor: pointer; transition: border-color 0.15s, box-shadow 0.15s;
  user-select: none;
}
.dish:active { transform: scale(0.99); }
.dish.selected { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.dish .thumb {
  aspect-ratio: 4/3; background: var(--bg-soft); display: flex; align-items: center;
  justify-content: center; overflow: hidden; position: relative;
}
.dish .thumb img { width: 100%; height: 100%; object-fit: cover; }
.dish .thumb .keyword { font-family: var(--font-serif); font-size: 26px; color: var(--muted); opacity: 0.7; }
.dish .body { padding: 10px 12px; }
.dish .name { font-size: 14px; font-weight: 600; line-height: 1.35; }
.dish .meta { font-size: 12px; color: var(--muted); margin-top: 3px; }
.dish .tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.tag { font-size: 11px; padding: 1px 7px; border-radius: 4px; background: var(--bg-soft); color: var(--muted); }
.dish .check {
  position: absolute; top: 8px; right: 8px; width: 22px; height: 22px; border-radius: 50%;
  background: var(--accent); color: #fff; display: none; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700;
}
.dish.selected .check { display: flex; }
.dish.offline { opacity: 0.45; }

/* ── 视图切换（大图 / 列表）── */
.view-toggle { display: flex; border: 1px solid var(--border); border-radius: 999px; overflow: hidden; flex-shrink: 0; }
.vt-btn {
  background: var(--surface); border: none; padding: 6px 12px; font-size: 15px;
  color: var(--muted); cursor: pointer; transition: all 0.15s; line-height: 1;
}
.vt-btn.active { background: var(--text); color: #fff; }

/* ── 列表模式（仿外卖/购物，小图 + 信息密集）── */
.dish-grid.list-mode { display: flex; flex-direction: column; gap: 10px; }
.dish-grid.list-mode .list-item-dish {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 10px; cursor: pointer; user-select: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  overflow: hidden;
}
.dish-grid.list-mode .list-item-dish:active { transform: scale(0.99); }
.dish-grid.list-mode .list-item-dish.selected { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.dish-grid.list-mode .list-item-dish .thumb {
  width: 64px; height: 64px; flex-shrink: 0; aspect-ratio: auto;
  background: var(--bg-soft); border-radius: var(--radius-sm); overflow: hidden;
  display: flex; align-items: center; justify-content: center; position: static;
}
.dish-grid.list-mode .list-item-dish .thumb img { width: 100%; height: 100%; object-fit: cover; }
.dish-grid.list-mode .list-item-dish .thumb .keyword { font-family: var(--font-serif); font-size: 22px; color: var(--muted); opacity: 0.7; }
.dish-grid.list-mode .list-item-dish .body { flex: 1; min-width: 0; padding: 0; }
.dish-grid.list-mode .list-item-dish .name { font-size: 15px; font-weight: 600; line-height: 1.4; }
.dish-grid.list-mode .list-item-dish .meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.dish-grid.list-mode .list-item-dish .tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.list-side { flex-shrink: 0; display: flex; align-items: center; }
.qty-badge {
  min-width: 24px; height: 24px; border-radius: 999px; background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; padding: 0 7px;
}
.add-badge {
  width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 16px; font-weight: 600;
}

/* ── 底部操作栏 ── */
.bottombar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 50;
  background: rgba(255, 255, 255, 0.94); backdrop-filter: blur(8px);
  border-top: 1px solid var(--border); padding: 12px 16px;
  padding-bottom: calc(12px + env(safe-area-inset-bottom, 0));
}
.bottombar-inner { max-width: 680px; margin: 0 auto; display: flex; align-items: center; gap: 12px; }
.bottombar .summary { flex: 1; font-size: 14px; color: var(--muted); }
.bottombar .summary strong { color: var(--text); font-size: 16px; }

/* ── 弹窗 ── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(31, 30, 29, 0.45); z-index: 100;
  display: none; align-items: flex-end; justify-content: center;
}
.modal-overlay.active { display: flex; }
.modal {
  background: var(--surface); border-radius: var(--radius) var(--radius) 0 0;
  width: 100%; max-width: 560px; max-height: 88vh; display: flex; flex-direction: column;
  padding-bottom: env(safe-area-inset-bottom, 0);
}
@media (min-width: 560px) {
  .modal-overlay { align-items: center; padding: 20px; }
  .modal { border-radius: var(--radius); }
}
.modal-header { padding: 16px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.modal-header h3 { font-size: 16px; }
.modal-body { padding: 16px; overflow-y: auto; }
.modal-footer { padding: 12px 16px; border-top: 1px solid var(--border); display: flex; gap: 10px; }
.modal-footer .btn { flex: 1; }
.close-btn { background: none; border: none; font-size: 24px; color: var(--muted); cursor: pointer; line-height: 1; padding: 0 4px; }

/* ── 规格选择 ── */
.spec-group { margin-bottom: 16px; }
.spec-group .spec-label { font-size: 13px; color: var(--muted); margin-bottom: 8px; font-weight: 500; }
.spec-options { display: flex; flex-wrap: wrap; gap: 8px; }
.spec-opt {
  padding: 7px 15px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface); font-size: 14px; cursor: pointer; transition: all 0.15s;
}
.spec-opt.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ── Toast ── */
.toast {
  position: fixed; top: 16px; left: 50%; transform: translateX(-50%);
  background: var(--text); color: #fff; padding: 10px 18px; border-radius: 999px;
  font-size: 14px; z-index: 200; opacity: 0; transition: opacity 0.25s; pointer-events: none;
}
.toast.show { opacity: 1; }

/* ── 列表 ── */
.list-item {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 16px; margin-bottom: 10px;
}
.list-item .row { display: flex; align-items: center; gap: 10px; }
.list-item .grow { flex: 1; min-width: 0; }
.list-item .title { font-weight: 600; font-size: 15px; }
.list-item .desc { font-size: 13px; color: var(--muted); }

/* ── 杂项 ── */
.muted { color: var(--muted); }
.center { text-align: center; }
.mt { margin-top: 16px; }
.mb { margin-bottom: 16px; }
.divider { height: 1px; background: var(--border); margin: 16px 0; }
.empty { text-align: center; color: var(--muted); padding: 48px 16px; font-size: 14px; }
.empty .big { font-size: 40px; display: block; margin-bottom: 12px; }
.hidden { display: none !important; }
.seen { opacity: 0.55; }

/* 登录页 */
.login-wrap { max-width: 360px; margin: 8vh auto; padding: 24px; text-align: center; }
.login-wrap .logo { font-family: var(--font-serif); font-size: 28px; margin-bottom: 6px; }
.login-wrap .hint { font-size: 13px; color: var(--muted); margin-bottom: 20px; }
