/* ==========================================================================
   食堂菜品投票 · 用餐调查
   共享样式：投票页 + 管理后台
   ========================================================================== */

:root {
  --bg: #fbf6ef;
  --card: #ffffff;
  --ink: #241c16;
  --ink-2: #55483f;
  --muted: #8b7d72;
  --line: #ece0d3;
  --line-soft: #f4ebe1;
  --brand: #d9542b;
  --brand-dark: #b8441f;
  --brand-2: #f08a3c;
  --brand-soft: #fdf0e8;
  --green: #2f8a5f;
  --green-soft: #e8f5ee;
  --danger: #c0392b;
  --danger-soft: #fdecea;
  --radius: 20px;
  --radius-sm: 12px;
  --shadow: 0 14px 40px rgba(122, 81, 40, 0.09);
  --shadow-sm: 0 2px 10px rgba(122, 81, 40, 0.06);
  --font: "MiSans", "HarmonyOS Sans SC", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--ink);
  line-height: 1.65;
  background:
    radial-gradient(1100px 520px at 6% -8%, #ffe8d3 0%, rgba(255, 232, 211, 0) 62%),
    radial-gradient(900px 480px at 102% -4%, #e8f1ff 0%, rgba(232, 241, 255, 0) 58%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { margin: 0; line-height: 1.3; font-weight: 700; letter-spacing: -0.01em; }
p { margin: 0; }
a { color: inherit; }
button { font-family: inherit; }
img { max-width: 100%; }

:focus-visible {
  outline: 3px solid rgba(217, 84, 43, 0.45);
  outline-offset: 2px;
  border-radius: 8px;
}

/* --------------------------------------------------------------- 通用组件 */

.page {
  width: min(940px, 100% - 40px);
  margin: 0 auto;
  padding: 28px 0 48px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, border-color 0.15s ease;
  white-space: nowrap;
}
.btn:hover { border-color: #dcc9b7; box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; transform: none; box-shadow: none; }

.btn-primary {
  background: linear-gradient(135deg, var(--brand-2), var(--brand));
  border-color: transparent;
  color: #fff;
  box-shadow: 0 8px 20px rgba(217, 84, 43, 0.28);
}
.btn-primary:hover { box-shadow: 0 12px 26px rgba(217, 84, 43, 0.34); }

.btn-lg { padding: 14px 32px; font-size: 15.5px; }
.btn-sm { padding: 6px 13px; font-size: 12.5px; }
.btn-block { width: 100%; }
.btn-danger { color: var(--danger); border-color: #f3cdc7; background: var(--danger-soft); }
.btn-danger:hover { border-color: #e9b3aa; }
.btn-ghost { background: transparent; border-color: transparent; }

.text-btn {
  border: 0;
  background: none;
  color: var(--brand);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 8px;
}
.text-btn:hover { background: var(--brand-soft); }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px 30px;
}

.hint { color: var(--muted); font-size: 13.5px; }
.note {
  margin-top: 16px;
  padding: 12px 16px;
  border-radius: 12px;
  background: #fdf8f2;
  border: 1px dashed #e8d8c6;
  color: #8a7157;
  font-size: 13px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(217, 84, 43, 0.16);
  color: #a5482a;
  font-size: 12.5px;
  font-weight: 600;
  backdrop-filter: blur(6px);
}
.chip.warm { background: #fff3e6; border-color: #f5d2b1; }

[hidden] { display: none !important; }

/* ------------------------------------------------------------------ 投票页 */

.site-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 4px 2px 22px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 700;
  font-size: 15.5px;
  letter-spacing: 0.01em;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  font-size: 18px;
}
.ghost-link {
  color: var(--muted);
  font-size: 13px;
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: all 0.15s ease;
}
.ghost-link:hover { color: var(--ink); background: #fff; border-color: var(--line); }

.hero {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 44px 44px 42px;
  border-radius: 28px;
  border: 1px solid #f2dcc6;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(255, 244, 232, 0.86)),
    radial-gradient(600px 300px at 90% 10%, #ffd9b0 0%, transparent 70%);
  box-shadow: var(--shadow);
}
.hero::after {
  content: "";
  position: absolute;
  inset: auto -60px -120px auto;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(240, 138, 60, 0.22), transparent 68%);
  pointer-events: none;
}
.hero-copy { position: relative; z-index: 1; max-width: 620px; }
.kicker {
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--brand);
  text-transform: uppercase;
  margin-bottom: 12px;
}
.hero h1 {
  font-size: clamp(28px, 4.2vw, 40px);
  letter-spacing: -0.02em;
  margin-bottom: 14px;
}
.lede { color: var(--ink-2); font-size: 15px; margin-bottom: 22px; }
.meta { display: flex; flex-wrap: wrap; gap: 8px; }

.hero-art {
  position: relative;
  z-index: 1;
  flex: 0 0 190px;
  height: 160px;
  display: grid;
  place-items: center;
}
.hero-art::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(240, 138, 60, 0.22);
  transform: rotate(-4deg);
}
.hero-emoji {
  position: absolute;
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 8px 18px rgba(160, 100, 40, 0.16);
  font-size: 26px;
  animation: float 6s ease-in-out infinite;
}
.e1 { top: 6px; left: 18px; animation-delay: 0s; }
.e2 { top: 20px; right: 10px; animation-delay: 0.8s; }
.e3 { bottom: 14px; left: 34px; animation-delay: 1.6s; }
.e4 { bottom: 4px; right: 26px; animation-delay: 2.4s; }

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-7px); }
}

.main-col { display: grid; gap: 20px; margin-top: 22px; }

.card-head {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 22px;
}
.step {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 0.02em;
}
.step.alt { background: var(--green-soft); color: var(--green); font-size: 12px; }
.card-head-text h2 { font-size: 20px; margin-bottom: 4px; }

/* 菜品选择 */
.dish-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(178px, 1fr));
  gap: 12px;
}
.dish {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 14px 14px 13px;
  text-align: left;
  border: 1.5px solid var(--line);
  border-radius: 16px;
  background: #fffdfb;
  cursor: pointer;
  transition: all 0.16s ease;
  color: inherit;
}
.dish:hover { border-color: #e2c9b2; background: #fffaf5; transform: translateY(-1px); }
.dish-emoji {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: #fbf1e6;
  font-size: 21px;
}
.dish-body { display: grid; gap: 2px; min-width: 0; }
.dish-name { font-weight: 700; font-size: 14.5px; }
.dish-desc {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.dish .tick {
  position: absolute;
  top: 9px;
  right: 9px;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1.5px solid #e3d2c1;
  background: #fff;
  color: transparent;
  font-size: 12px;
  font-weight: 800;
  transition: all 0.16s ease;
}
.dish[aria-pressed="true"] {
  border-color: var(--brand);
  background: linear-gradient(160deg, #fff6ef, #fdeadd);
  box-shadow: 0 8px 18px rgba(217, 84, 43, 0.14);
}
.dish[aria-pressed="true"] .tick {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}
.dish[aria-pressed="true"] .dish-emoji { background: #ffe9d8; }

.counter-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px dashed var(--line);
}
.counter { font-size: 13.5px; color: var(--ink-2); }
.counter b { color: var(--brand); font-size: 16px; }

/* 问卷 */
.question-list { display: grid; gap: 26px; }
.question { padding-top: 22px; border-top: 1px dashed var(--line); }
.question:first-child { padding-top: 0; border-top: 0; }
.q-title {
  display: flex;
  gap: 9px;
  font-size: 15.5px;
  font-weight: 700;
  margin-bottom: 4px;
}
.q-index { color: var(--brand); }
.q-required { color: var(--danger); margin-left: 2px; }
.q-hint { font-size: 12.5px; color: var(--muted); margin: 0 0 12px 28px; }
.q-options { display: grid; gap: 9px; margin-left: 28px; }
.q-options.cols { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }

.opt {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border: 1.5px solid var(--line);
  border-radius: 13px;
  background: #fffdfb;
  cursor: pointer;
  transition: all 0.15s ease;
  font-size: 14px;
  color: var(--ink-2);
}
.opt:hover { border-color: #e2c9b2; background: #fffaf5; }
.opt input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.opt-mark {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1.5px solid #d9c8b7;
  background: #fff;
  transition: all 0.15s ease;
  position: relative;
}
.opt input[type="checkbox"] + .opt-mark { border-radius: 5px; }
.opt input:checked + .opt-mark {
  border-color: var(--brand);
  background: var(--brand);
  box-shadow: inset 0 0 0 3px #fff;
}
.opt input[type="checkbox"]:checked + .opt-mark { box-shadow: none; }
.opt input[type="checkbox"]:checked + .opt-mark::after {
  content: "✓";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}
.opt:has(input:checked) {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--ink);
  font-weight: 600;
}
.opt:has(input:focus-visible) { outline: 3px solid rgba(217, 84, 43, 0.35); outline-offset: 2px; }

.q-text { margin-left: 28px; }
.q-text textarea {
  width: 100%;
  min-height: 96px;
  resize: vertical;
  padding: 13px 15px;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  background: #fffdfb;
  font-family: inherit;
  font-size: 14px;
  color: var(--ink);
  line-height: 1.6;
  transition: border-color 0.15s ease;
}
.q-text textarea:focus { outline: none; border-color: var(--brand); }
.text-meta {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
}

/* 提交区 */
.submit-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 24px;
  border-radius: 18px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.submit-hint { font-size: 13px; color: var(--muted); }
.submit-hint b { color: var(--danger); }
.submit-hint.error { color: var(--danger); font-weight: 600; }

/* 成功 / 结束状态 */
.done-card { text-align: center; padding: 52px 34px; }
.done-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 18px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--green-soft);
  color: var(--green);
  font-size: 30px;
  font-weight: 800;
}
.done-icon.closed { background: #f3ede7; color: #a58e79; font-size: 26px; }
.done-card h2 { font-size: 24px; margin-bottom: 10px; }
.done-card > p { color: var(--ink-2); max-width: 460px; margin: 0 auto; }
.done-summary {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 22px auto 0;
  max-width: 560px;
}
.done-summary .tag {
  padding: 6px 13px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: #a5482a;
  font-size: 13px;
  font-weight: 600;
}
.done-actions { display: flex; justify-content: center; gap: 10px; margin-top: 26px; flex-wrap: wrap; }

/* 小程序引导弹窗 */
.modal-card.miniapp-card {
  width: min(420px, 100%);
  padding: 32px 26px 22px;
  text-align: center;
}
.miniapp-art { font-size: 46px; line-height: 1; margin-bottom: 14px; }
.miniapp-card h2 { font-size: 20px; margin-bottom: 6px; }
.miniapp-card .hint { margin-bottom: 20px; }
.miniapp-card .btn { margin-bottom: 10px; }
.miniapp-launch { margin-bottom: 10px; }
.miniapp-launch wx-open-launch-weapp { display: block; width: 100%; }
.miniapp-qr { margin-bottom: 14px; }
.miniapp-qr img {
  width: 180px;
  height: 180px;
  padding: 8px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #fff;
}
.miniapp-qr-hint { font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.miniapp-link {
  margin: 6px 0 14px;
  padding: 11px 14px;
  border-radius: 12px;
  background: #fdf6ee;
  border: 1px dashed #e7d3bd;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 12.5px;
  color: #8a6a4a;
  word-break: break-all;
  user-select: all;
  cursor: text;
}
.miniapp-note {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.65;
  margin-bottom: 8px;
  text-align: left;
}

/* 结果 */
.result-card { margin-top: 22px; }
.result-sub {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.08em;
  margin: 26px 0 14px;
}
.result-sub:first-of-type { margin-top: 0; }
.bar-row { margin-bottom: 14px; }
.bar-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
  margin-bottom: 6px;
}
.bar-name { font-weight: 600; }
.bar-name .rank {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  margin-right: 7px;
  border-radius: 6px;
  background: #f6ece1;
  color: #9a7b5f;
  font-size: 11px;
  font-weight: 800;
}
.bar-name .rank.top { background: linear-gradient(135deg, #ffd76e, #f0a03c); color: #7a4408; }
.bar-val { color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.bar-track { height: 9px; border-radius: 999px; background: #f4ece3; overflow: hidden; }
.bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #f6b26b, var(--brand));
  transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
.bar-fill.alt { background: linear-gradient(90deg, #7cc7a2, var(--green)); }
.q-result { margin-bottom: 26px; }
.q-result-title { font-weight: 700; font-size: 14.5px; margin-bottom: 12px; }
.text-answers { display: grid; gap: 8px; }
.text-answer {
  padding: 11px 15px;
  border-radius: 12px;
  background: #fdf8f2;
  border: 1px solid var(--line-soft);
  font-size: 13.5px;
  color: var(--ink-2);
  white-space: pre-wrap;
  word-break: break-word;
}
.empty { padding: 26px; text-align: center; color: var(--muted); font-size: 13.5px; }

.site-foot {
  margin-top: 34px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 12.5px;
  color: var(--muted);
}
.foot-links a { color: var(--muted); text-decoration: none; }
.foot-links a:hover { color: var(--ink); }

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 32px;
  transform: translate(-50%, 20px);
  max-width: min(520px, calc(100vw - 40px));
  padding: 12px 20px;
  border-radius: 14px;
  background: #241c16;
  color: #fff;
  font-size: 13.5px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.24);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 90;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: #a53225; }

/* --------------------------------------------------------------- 管理后台 */

.page-admin { background: #f6f1ea; }

.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 20px;
  background:
    radial-gradient(800px 400px at 20% 0%, #ffe8d3 0%, transparent 60%),
    radial-gradient(700px 420px at 100% 10%, #e8f1ff 0%, transparent 55%),
    #f8f3ec;
}
.login-card {
  width: min(400px, 100%);
  padding: 36px 32px 30px;
  text-align: center;
}
.login-brand {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: #fff;
  border: 1px solid var(--line);
  font-size: 28px;
  box-shadow: var(--shadow-sm);
}
.login-card h1 { font-size: 22px; margin-bottom: 4px; }
.login-card .hint { margin-bottom: 24px; }
.login-card .field { text-align: left; }
.back-link {
  display: inline-block;
  margin-top: 18px;
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
}
.back-link:hover { color: var(--ink); }
.form-error {
  margin: 0 0 12px;
  padding: 9px 12px;
  border-radius: 10px;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 13px;
  text-align: left;
}

.admin-shell {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  min-height: 100vh;
}
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 24px 16px 20px;
  background: #fff;
  border-right: 1px solid var(--line);
  position: sticky;
  top: 0;
  height: 100vh;
}
.side-brand { display: flex; align-items: center; gap: 10px; padding: 0 8px; }
.side-brand > span {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: #fdf1e6;
  font-size: 19px;
}
.side-brand strong { display: block; font-size: 14.5px; line-height: 1.2; }
.side-brand small { color: var(--muted); font-size: 11.5px; }

.nav { display: grid; gap: 4px; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: var(--ink-2);
  font-size: 13.5px;
  font-weight: 600;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.nav-item:hover { background: #faf3ea; color: var(--ink); }
.nav-item.active { background: var(--brand-soft); color: var(--brand-dark); }
.nav-item.danger { color: var(--danger); }
.nav-item.danger:hover { background: var(--danger-soft); }
.nav-icon { width: 18px; text-align: center; font-size: 15px; }
.side-foot { margin-top: auto; display: grid; gap: 4px; padding-top: 14px; border-top: 1px solid var(--line-soft); }

.content { padding: 28px 34px 60px; max-width: 1180px; }
.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.topbar h1 { font-size: 24px; margin-bottom: 4px; }
.topbar-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.panel { animation: fade-in 0.22s ease; }
@keyframes fade-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 22px; }
.stat {
  padding: 20px 22px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}
.stat-label { font-size: 12.5px; color: var(--muted); margin-bottom: 8px; }
.stat-value { font-size: 28px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; }
.stat-value small { font-size: 13px; font-weight: 600; color: var(--muted); margin-left: 4px; }
.stat-foot { margin-top: 8px; font-size: 12px; color: var(--muted); }

.panel-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow-sm);
  padding: 22px 24px;
  margin-bottom: 18px;
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.panel-head h2 { font-size: 16.5px; }
.panel-head .hint { margin-top: 2px; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.table-wrap { overflow-x: auto; border-radius: 12px; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th {
  text-align: left;
  padding: 10px 12px;
  background: #faf5ee;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  white-space: nowrap;
  border-bottom: 1px solid var(--line);
}
.table td {
  padding: 12px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: middle;
  color: var(--ink-2);
}
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #fffaf4; }
.table .num { font-variant-numeric: tabular-nums; }
.cell-actions { display: flex; gap: 4px; flex-wrap: wrap; }
.cell-actions .btn { padding: 5px 10px; font-size: 12px; }
.cell-main { font-weight: 600; color: var(--ink); }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  background: #f3ede6;
  color: #8a7563;
  white-space: nowrap;
}
.badge.on { background: var(--green-soft); color: var(--green); }
.badge.off { background: #f3ede6; color: #97826e; }
.badge.warn { background: #fff3e2; color: #b16a18; }
.badge.brand { background: var(--brand-soft); color: var(--brand-dark); }

.empty-state {
  padding: 46px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 13.5px;
}
.empty-state strong { display: block; color: var(--ink-2); font-size: 15px; margin-bottom: 6px; }

/* 设置表单 */
.form-grid { display: grid; gap: 16px; }
.form-grid.two { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field > span { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field .sub { font-size: 12px; color: var(--muted); font-weight: 400; }
.input, .select, .textarea {
  width: 100%;
  padding: 10px 13px;
  border: 1.5px solid var(--line);
  border-radius: 11px;
  background: #fffdfb;
  font-family: inherit;
  font-size: 14px;
  color: var(--ink);
  transition: border-color 0.15s ease;
}
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--brand); }
.textarea { min-height: 82px; resize: vertical; line-height: 1.6; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.switch { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 13.5px; color: var(--ink-2); }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-track {
  width: 42px;
  height: 24px;
  border-radius: 999px;
  background: #e2d5c7;
  position: relative;
  transition: background 0.16s ease;
  flex: 0 0 auto;
}
.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(0, 0, 0, 0.18);
  transition: transform 0.16s ease;
}
.switch input:checked + .switch-track { background: var(--green); }
.switch input:checked + .switch-track::after { transform: translateX(18px); }

.settings-group { margin-bottom: 28px; }
.settings-group h3 {
  font-size: 12.5px;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line-soft);
}

/* 问卷编辑器 */
.q-item {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px 18px;
  margin-bottom: 12px;
  background: #fffdfb;
}
.q-item-head { display: flex; justify-content: space-between; gap: 14px; align-items: flex-start; }
.q-item-title { font-weight: 700; font-size: 14.5px; margin-bottom: 4px; }
.q-item-meta { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.q-item-opts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.q-item-opts .opt-chip {
  padding: 3px 10px;
  border-radius: 999px;
  background: #f7f0e7;
  font-size: 12px;
  color: #7d6a58;
}
.q-item-opts .opt-chip.off { opacity: 0.55; text-decoration: line-through; }

/* 模态框 */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(36, 28, 22, 0.42);
  backdrop-filter: blur(3px);
  animation: fade-in 0.16s ease;
}
.modal-card {
  width: min(560px, 100%);
  max-height: min(86vh, 760px);
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 30px 70px rgba(40, 24, 12, 0.32);
  overflow: hidden;
}
.modal-card.wide { width: min(680px, 100%); }
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 24px 14px;
  border-bottom: 1px solid var(--line-soft);
}
.modal-head h2 { font-size: 17px; }
.modal-close {
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
}
.modal-close:hover { background: #f7f0e8; color: var(--ink); }
.modal-body { padding: 20px 24px; overflow-y: auto; }
.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 24px 20px;
  border-top: 1px solid var(--line-soft);
  background: #fffdfb;
}
.opt-editor-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.opt-editor-row .input { flex: 1; }
.icon-btn {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--muted);
  cursor: pointer;
  font-size: 15px;
}
.icon-btn:hover { color: var(--danger); border-color: #eec7c0; background: var(--danger-soft); }

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  font-size: 13px;
  color: var(--muted);
  flex-wrap: wrap;
}
.pagination .pages { display: flex; gap: 6px; }

.skeleton { color: var(--muted); font-size: 13px; padding: 20px 0; text-align: center; }

/* 响应式 */
@media (max-width: 860px) {
  .hero { padding: 32px 26px; }
  .hero-art { display: none; }
  .card { padding: 22px 18px; }
  .admin-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: static;
    height: auto;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    overflow-x: auto;
  }
  .side-brand { display: none; }
  .nav { display: flex; gap: 4px; }
  .nav-item { white-space: nowrap; padding: 8px 12px; }
  .side-foot { margin: 0 0 0 auto; display: flex; padding: 0; border: 0; }
  .side-foot .nav-item { padding: 8px 10px; }
  .content { padding: 20px 16px 48px; }
  .topbar h1 { font-size: 20px; }
}

@media (max-width: 600px) {
  .page { width: calc(100% - 24px); padding-top: 18px; }
  .hero { padding: 28px 20px; border-radius: 22px; }
  .hero h1 { font-size: 26px; }
  .lede { font-size: 14px; }
  .dish-grid { grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 9px; }
  .dish { padding: 12px; gap: 9px; }
  .dish-emoji { width: 34px; height: 34px; font-size: 18px; }
  .dish-name { font-size: 13.5px; }
  .submit-bar {
    position: sticky;
    bottom: 10px;
    z-index: 20;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 14px 16px;
    backdrop-filter: blur(8px);
    background: rgba(255, 255, 255, 0.94);
  }
  .submit-bar .btn { width: 100%; }
  .q-options, .q-hint, .q-text { margin-left: 0; }
  .q-options.cols { grid-template-columns: 1fr; }
  .field-row { grid-template-columns: 1fr; }
  .modal-card { max-height: 92vh; }
  .table th, .table td { padding: 9px 10px; }
}
