/* 海口晚餐调研系统 · 样式表（移动端优先，适配地推现场手机操作） */
[hidden] { display: none !important; }
button.menu-card { font: inherit; text-align: left; color: inherit; width: 100%; cursor: pointer; }
.connection-note { padding: 8px 12px; border-radius: 8px; background: #e8f2ec; font-size: 12px; color: #245a3e; margin: 12px 0; }
.connection-note.offline { background: #fff1df; color: #88480b; }
.work-status { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; margin: 12px 0; }
.dashboard-filters { display:flex; flex-wrap:wrap; gap:12px; align-items:end; padding:16px; margin-bottom:16px; background:white; border-radius:12px; }
.dashboard-filters label { display:flex; flex-direction:column; gap:4px; font-size:13px; flex:1; min-width:140px; }
.dashboard-filters .input { padding:8px; }
:root {
  --primary: #2f6f4e;
  --primary-dark: #245a3e;
  --primary-light: #e8f2ec;
  --accent: #e8853d;
  --bg: #f4f6f5;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --border: #e3e7e5;
  --danger: #c0392b;
  --ok: #2f6f4e;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(16, 24, 40, .06), 0 6px 20px rgba(16, 24, 40, .05);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  background: var(--bg); color: var(--text);
  font-size: 15px; line-height: 1.65;
  -webkit-text-size-adjust: 100%;
}
a { color: var(--primary); }
button { font-family: inherit; }

.wrap { max-width: 860px; margin: 0 auto; padding: 16px; }
.wrap-wide { max-width: 1180px; margin: 0 auto; padding: 16px; }

/* ---------- 登录页 ---------- */
.login-page {
  min-height: 100dvh; display: flex; align-items: center; justify-content: center;
  padding: 20px;
  background: linear-gradient(160deg, #1d4d36 0%, #2f6f4e 45%, #3d8a5f 100%);
}
.login-card {
  width: 100%; max-width: 400px; background: var(--card);
  border-radius: 18px; padding: 32px 26px; box-shadow: 0 20px 60px rgba(0,0,0,.28);
}
.login-brand { text-align: center; margin-bottom: 22px; }
.login-logo {
  width: 56px; height: 56px; margin: 0 auto 12px; border-radius: 16px;
  background: var(--primary-light); display: flex; align-items: center; justify-content: center;
  font-size: 26px;
}
.login-brand h1 { font-size: 20px; margin: 0 0 6px; letter-spacing: .5px; }
.login-brand p { font-size: 13px; color: var(--muted); margin: 0; }

.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; font-weight: 500; }
.input {
  width: 100%; padding: 12px 14px; font-size: 16px;
  border: 1.5px solid var(--border); border-radius: 10px; background: #fff;
  color: var(--text); transition: border-color .15s, box-shadow .15s;
  -webkit-appearance: none; appearance: none;
}
.input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(47,111,78,.12); }
textarea.input { resize: vertical; min-height: 90px; font-size: 15px; line-height: 1.6; }
select.input { padding-right: 34px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 12px 20px; font-size: 15px; font-weight: 600;
  border: none; border-radius: 10px; cursor: pointer;
  background: var(--primary); color: #fff;
  transition: background .15s, transform .05s;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover:not(:disabled) { background: var(--primary-dark); }
.btn:active:not(:disabled) { transform: scale(.985); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-block { width: 100%; }
.btn-ghost { background: #fff; color: var(--primary); border: 1.5px solid var(--border); }
.btn-ghost:hover:not(:disabled) { background: var(--primary-light); border-color: var(--primary); }
.btn-danger { background: #fff; color: var(--danger); border: 1.5px solid #f0d3ce; }
.btn-danger:hover:not(:disabled) { background: #fdf1ef; }
.btn-sm { padding: 7px 13px; font-size: 13px; border-radius: 8px; }
.btn-accent { background: var(--accent); }
.btn-accent:hover:not(:disabled) { background: #d1752f; }

.msg { padding: 10px 13px; border-radius: 9px; font-size: 14px; margin-bottom: 14px; display: none; }
.msg.show { display: block; }
.msg-error { background: #fdf1ef; color: var(--danger); border: 1px solid #f2d6d1; }
.msg-ok { background: var(--primary-light); color: var(--primary-dark); border: 1px solid #cbe0d4; }
.hint { font-size: 12.5px; color: var(--muted); }

/* ---------- 顶部栏 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  background: rgba(255,255,255,.94); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  max-width: 860px; margin: 0 auto; padding: 10px 16px;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.topbar-title { font-weight: 700; font-size: 15px; flex: 1 1 auto; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-meta { font-size: 12.5px; color: var(--muted); }
.who-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--primary-light); color: var(--primary-dark);
  padding: 5px 11px; border-radius: 999px; font-size: 13px; font-weight: 600;
}
.who-chip select {
  border: none; background: transparent; color: inherit; font-weight: 600; font-size: 13px;
  padding: 0; font-family: inherit; max-width: 130px;
}
.who-chip select:focus { outline: none; }

/* ---------- 进度条 ---------- */
.progress-track { height: 4px; background: var(--border); }
.progress-bar { height: 100%; width: 0; background: var(--primary); transition: width .25s ease; }

/* ---------- 问卷 ---------- */
.section-card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 20px 18px; margin-bottom: 16px;
}
.section-head { border-bottom: 1px solid var(--border); padding-bottom: 12px; margin-bottom: 18px; }
.section-head h2 { font-size: 17px; margin: 0 0 4px; color: var(--primary-dark); }
.section-head p { margin: 0; font-size: 13px; color: var(--muted); }

.q { margin-bottom: 24px; }
.q:last-child { margin-bottom: 0; }
.q-title { font-size: 15.5px; font-weight: 600; margin-bottom: 4px; line-height: 1.5; }
.q-no { color: var(--primary); font-weight: 700; margin-right: 6px; }
.q-req { color: var(--danger); margin-left: 4px; }
.q-note { font-size: 12.5px; color: var(--muted); margin-bottom: 10px; }
.q.invalid .q-title { color: var(--danger); }
.q.invalid { animation: shake .3s; }
@keyframes shake {
  0%,100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

.opts { display: flex; flex-direction: column; gap: 8px; }
.opt {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 11px 13px; border: 1.5px solid var(--border); border-radius: 10px;
  cursor: pointer; background: #fff; transition: all .12s;
  -webkit-tap-highlight-color: transparent;
}
.opt:hover { border-color: #c3d6cb; background: #fbfdfc; }
.opt input { margin: 3px 0 0; flex: 0 0 auto; width: 17px; height: 17px; accent-color: var(--primary); }
.opt-text { flex: 1; font-size: 14.5px; line-height: 1.5; }
.opt.sel { border-color: var(--primary); background: var(--primary-light); }
.opt-count { font-size: 12px; color: var(--muted); flex: 0 0 auto; margin-top: 2px; }

.scale-row { display: flex; gap: 8px; flex-wrap: wrap; }
.scale-btn {
  flex: 1 1 52px; min-width: 46px; padding: 13px 4px; text-align: center;
  border: 1.5px solid var(--border); border-radius: 10px; background: #fff;
  font-size: 16px; font-weight: 600; cursor: pointer; transition: all .12s;
}
.scale-btn:hover { border-color: #c3d6cb; }
.scale-btn.sel { background: var(--primary); border-color: var(--primary); color: #fff; }
.scale-labels { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: 6px; }

.submit-bar {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 18px; margin-bottom: 40px; text-align: center;
}
.submit-bar .btn { padding: 14px 32px; font-size: 16px; }

/* ---------- 成功页 ---------- */
.done-card {
  background: var(--card); border-radius: 18px; box-shadow: var(--shadow);
  padding: 40px 24px; text-align: center; max-width: 460px; margin: 60px auto;
}
.done-icon {
  width: 64px; height: 64px; margin: 0 auto 16px; border-radius: 50%;
  background: var(--primary-light); color: var(--primary);
  display: flex; align-items: center; justify-content: center; font-size: 32px;
}
.done-card h2 { margin: 0 0 8px; font-size: 20px; }
.done-label {
  display: inline-block; margin: 12px 0; padding: 8px 16px;
  background: #f7f9f8; border: 1px dashed var(--border); border-radius: 8px;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 15px; letter-spacing: .5px;
}
.done-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 18px; }

/* ---------- 后台 ---------- */
.admin-top {
  background: #1d4d36; color: #fff; padding: 12px 0;
}
.admin-top .wrap-wide { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding-top: 10px; padding-bottom: 10px; }
.admin-top h1 { font-size: 16px; margin: 0; flex: 1 1 auto; }
.admin-top .btn-ghost { background: rgba(255,255,255,.12); color: #fff; border-color: rgba(255,255,255,.25); }
.admin-top .btn-ghost:hover:not(:disabled) { background: rgba(255,255,255,.22); }

.grid-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }
.stat-card .k { font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }
.stat-card .v { font-size: 26px; font-weight: 700; line-height: 1.2; color: var(--primary-dark); }
.stat-card .s { font-size: 12px; color: var(--muted); margin-top: 4px; }

.panel { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; margin-bottom: 16px; }
.panel-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.panel-head h2 { font-size: 16px; margin: 0; flex: 1 1 auto; }

.bar-row { display: grid; grid-template-columns: minmax(90px, 34%) 1fr auto; gap: 10px; align-items: center; margin-bottom: 8px; }
.bar-label { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { height: 20px; background: #f1f4f2; border-radius: 5px; overflow: hidden; }
.bar-fill { height: 100%; background: linear-gradient(90deg, #3d8a5f, #2f6f4e); border-radius: 5px; transition: width .4s ease; min-width: 2px; }
.bar-fill.accent { background: linear-gradient(90deg, #f0a05f, #e8853d); }
.bar-val { font-size: 12.5px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }

.qstat { border-top: 1px solid var(--border); padding-top: 14px; margin-top: 14px; }
.qstat:first-of-type { border-top: none; padding-top: 0; margin-top: 0; }
.qstat-title { font-size: 14.5px; font-weight: 600; margin-bottom: 4px; }
.qstat-meta { font-size: 12.5px; color: var(--muted); margin-bottom: 10px; }
.tag { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600;
  background: var(--primary-light); color: var(--primary-dark); margin-right: 6px; vertical-align: 1px; }
.tag-muted { background: #f1f4f2; color: var(--muted); }
.tag-warn { background: #fdf3e8; color: #b06a20; }

.tbl-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.tbl th, table.tbl td { padding: 9px 10px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
table.tbl th { background: #f7f9f8; font-weight: 600; color: var(--muted); font-size: 12.5px; white-space: nowrap; position: sticky; top: 0; }
table.tbl tr:hover td { background: #fbfdfc; }
table.tbl td.num { font-variant-numeric: tabular-nums; }
.mono { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12.5px; }

.rec { border: 1px solid var(--border); border-radius: 10px; margin-bottom: 10px; overflow: hidden; }
.rec-head { display: flex; align-items: center; gap: 10px; padding: 11px 13px; cursor: pointer; background: #fbfdfc; flex-wrap: wrap; }
.rec-head:hover { background: var(--primary-light); }
.rec-title { font-weight: 600; font-size: 14px; }
.rec-sub { font-size: 12.5px; color: var(--muted); }
.rec-body { display: none; padding: 4px 13px 13px; border-top: 1px solid var(--border); }
.rec.open .rec-body { display: block; }
.rec-qa { padding: 8px 0; border-bottom: 1px dashed var(--border); }
.rec-qa:last-child { border-bottom: none; }
.rec-qa .qq { font-size: 12.5px; color: var(--muted); margin-bottom: 2px; }
.rec-qa .aa { font-size: 14px; white-space: pre-wrap; word-break: break-word; }
.rec-qa .aa.empty { color: #b6bcb9; font-style: italic; }
.spacer { flex: 1 1 auto; }

.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.chip {
  padding: 6px 13px; border-radius: 999px; border: 1.5px solid var(--border);
  background: #fff; font-size: 13px; cursor: pointer; transition: all .12s;
}
.chip:hover { border-color: #c3d6cb; }
.chip.on { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }
.chip .n { opacity: .7; font-size: 12px; margin-left: 4px; }

/* ---------- 弹窗 ---------- */
.mask { position: fixed; inset: 0; background: rgba(15,23,20,.5); z-index: 100;
  display: none; align-items: center; justify-content: center; padding: 18px; }
.mask.show { display: flex; }
.modal { background: #fff; border-radius: 14px; padding: 22px; width: 100%; max-width: 440px;
  max-height: 86dvh; overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.modal h3 { margin: 0 0 12px; font-size: 17px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; flex-wrap: wrap; }

/* ---------- 解锁页 ---------- */
.unlock-box { max-width: 420px; margin: 12vh auto; }

/* ---------- 菜单投票卡片 ---------- */
.menu-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 620px) { .menu-grid { grid-template-columns: repeat(3, 1fr); } }
.menu-card {
  padding: 0;
  border: 2px solid var(--border); border-radius: 12px; overflow: hidden;
  background: #fff; cursor: pointer; transition: all .15s;
  -webkit-tap-highlight-color: transparent;
}
.menu-card:hover { border-color: #c3d6cb; transform: translateY(-1px); }
.menu-card.sel { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(47,111,78,.15); }
.menu-card.sel::after {
  content: '✓ 已选'; display: block; background: var(--primary); color: #fff;
  text-align: center; font-size: 12.5px; font-weight: 600; padding: 5px 0;
}
.menu-img { width: 100%; height: auto; aspect-ratio: 1450 / 1086; object-fit: contain; display: block; background: #f6eee1; }
.menu-image-caption { padding: 5px 12px; font-size: 11px; line-height: 1.5; color: #6b7280; background: #faf8f3; }
.interview-guide summary { cursor: pointer; color: var(--primary-dark); font-size: 14px; font-weight: 600; }
.guide-body { padding-top: 16px; }
.menu-ph {
  width: 100%; aspect-ratio: 1 / 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 6px;
  background: repeating-linear-gradient(45deg, #f4f6f5, #f4f6f5 12px, #eef2f0 12px, #eef2f0 24px);
  color: var(--muted); text-align: center; padding: 10px;
}
.menu-ph-title { font-size: 15px; font-weight: 700; color: var(--text); }
.menu-ph-hint { font-size: 11.5px; }
.menu-name { font-size: 15px; font-weight: 700; padding: 10px 12px 2px; }
.menu-tag { font-size: 12.5px; color: var(--accent); font-weight: 600; padding: 0 12px; }
.menu-dishes { font-size: 12.5px; color: var(--muted); padding: 6px 12px 12px; line-height: 1.6; }
.menu-note {
  grid-column: 1 / -1; font-size: 12.5px; color: var(--muted);
  background: #f7f9f8; border: 1px dashed var(--border); border-radius: 8px;
  padding: 7px 11px; margin-top: 2px;
}

/* ---------- 后台：菜单图片上传 ---------- */
.upl-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.upl-card { border: 1.5px solid var(--border); border-radius: 12px; overflow: hidden; background: #fff; }
.upl-prev { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; display: block; background: #f1f4f2; }
.upl-prev-empty {
  width: 100%; aspect-ratio: 1 / 1; display: flex; align-items: center; justify-content: center;
  background: repeating-linear-gradient(45deg, #f4f6f5, #f4f6f5 12px, #eef2f0 12px, #eef2f0 24px);
  color: var(--muted); font-size: 13px; text-align: center; padding: 12px;
}
.upl-body { padding: 10px 12px 12px; }
.upl-body .menu-name { padding: 0 0 2px; }
.upl-body .menu-tag { padding: 0; }
.upl-actions { display: flex; gap: 8px; margin-top: 9px; flex-wrap: wrap; }
.upl-hint { font-size: 12px; color: var(--muted); margin: 10px 0 0; line-height: 1.6; }

/* ---------- 后台：今日看板 ---------- */
.today-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.today-cell { background: #f7f9f8; border-radius: 10px; padding: 12px; text-align: center; }
.today-cell .v { font-size: 24px; font-weight: 700; color: var(--primary-dark); }
.today-cell .k { font-size: 12px; color: var(--muted); margin-top: 3px; }

/* ---------- 加载 / 空态 ---------- */
.loading { text-align: center; padding: 50px 20px; color: var(--muted); }
.spinner { width: 28px; height: 28px; margin: 0 auto 12px; border: 3px solid var(--border);
  border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.empty { text-align: center; padding: 40px 20px; color: var(--muted); font-size: 14px; }

/* ---------- 草稿提示 ---------- */
.draft-bar {
  background: #fdf3e8; border: 1px solid #f2dcbd; color: #8a5a1c;
  padding: 10px 14px; border-radius: 10px; margin-bottom: 14px;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13.5px;
}
.draft-bar .spacer { min-width: 0; }

.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(20px);
  background: #1f2937; color: #fff; padding: 11px 20px; border-radius: 999px;
  font-size: 14px; opacity: 0; pointer-events: none; transition: all .25s; z-index: 200;
  max-width: 86vw; text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.err { background: var(--danger); }

.foot { text-align: center; font-size: 12px; color: var(--muted); padding: 20px 16px 34px; }

@media (max-width: 600px) {
  body { font-size: 14.5px; }
  .wrap, .wrap-wide { padding: 12px; }
  .section-card { padding: 16px 14px; }
  .bar-row { grid-template-columns: minmax(70px, 40%) 1fr auto; gap: 8px; }
  .stat-card .v { font-size: 22px; }
  .topbar-inner { padding: 9px 12px; }
}

.wizard-stage { padding: 8px 2px 14px; color: #245a3e; font-size:14px; font-weight:600; }
.wizard-nav { display:flex; justify-content:space-between; gap:12px; margin-bottom:14px; }
.wizard-nav .btn { min-height:44px; }
.validation-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; margin-bottom:12px; }
@media(min-width:800px) { .validation-grid {grid-template-columns:repeat(4,minmax(0,1fr));} }
