:root {
  --accent: #ff6b35;
  --accent-d: #e85a28;
  --bg: #f5f6f8;
  --card: #ffffff;
  --line: #e8eaed;
  --text: #2b2f33;
  --muted: #9099a1;
  --ok: #2e9e5b;
  --warn: #e8833a;
  --danger: #e0533d;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; height: 100%; }
body { font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif; background: var(--bg); color: var(--text); font-size: 15px; }
#app { height: 100%; }

/* ---------- 按钮 / 输入 ---------- */
.input { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; font-size: 15px; background: #fff; outline: none; }
.input:focus { border-color: var(--accent); }
.input.sm { padding: 7px 10px; font-size: 14px; width: auto; }
.input.xs { width: 64px; }
textarea.input { min-height: 70px; resize: vertical; }
.btn { padding: 8px 16px; border: 1px solid var(--line); background: #fff; border-radius: 10px; cursor: pointer; font-size: 14px; transition: .15s; color: var(--text); }
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn.primary:hover { background: var(--accent-d); }
.btn.warn { color: var(--warn); border-color: #f0c9a8; }
.btn.danger { color: #fff; background: #e23b3b; border-color: #e23b3b; }
.btn.danger:hover { background: #c92f2f; }
.btn.block { width: 100%; padding: 12px; font-size: 16px; margin-top: 6px; }
.btn.sm { padding: 5px 12px; font-size: 13px; }

/* ---------- Toast ---------- */
.toast { position: fixed; left: 50%; bottom: 40px; transform: translateX(-50%) translateY(20px); background: #333; color: #fff; padding: 10px 18px; border-radius: 22px; font-size: 14px; opacity: 0; pointer-events: none; transition: .25s; z-index: 9999; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.ok { background: var(--ok); }
.toast.error { background: var(--danger); }
.toast.warn { background: var(--warn); }

/* ---------- Modal ---------- */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: flex; align-items: center; justify-content: center; z-index: 1000; padding: 16px; }
.modal-box { background: #fff; border-radius: 16px; width: 100%; max-width: 460px; max-height: 88vh; overflow: auto; }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 18px; border-bottom: 1px solid var(--line); font-weight: 600; }
.modal-x { border: none; background: none; font-size: 18px; cursor: pointer; color: var(--muted); }
.modal-body { padding: 18px; }
.modal-foot { padding: 14px 18px; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; }

/* ---------- 登录 / 注册 ---------- */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(160deg, #fff3ec, #f5f6f8); padding: 20px; }
.auth-card { background: #fff; border-radius: 20px; padding: 32px 26px; width: 100%; max-width: 360px; box-shadow: 0 12px 40px rgba(0,0,0,.08); }
.auth-logo { text-align: center; margin-bottom: 8px; }
.auth-logo h1 { font-size: 20px; margin: 10px 0 0; }
.auth-sub { text-align: center; color: var(--muted); margin: 4px 0 20px; }
.auth-card .input { margin-bottom: 12px; }
.auth-switch { text-align: center; margin-top: 14px; font-size: 13px; color: var(--muted); }

/* ---------- H5 布局 ---------- */
.h5-layout { display: flex; height: 100vh; }
.h5-nav { width: 92px; flex-shrink: 0; background: #fff; border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 10px 6px; overflow-y: auto; }
.h5-nav-item { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 4px; border-radius: 12px; text-decoration: none; color: var(--muted); font-size: 12px; margin-bottom: 4px; }
.h5-nav-item.active { background: #fff1ea; color: var(--accent); font-weight: 600; }
.h5-nav-ico { font-size: 22px; line-height: 1; }
.h5-main { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.h5-content { flex: 1; overflow-y: auto; padding: 12px; -webkit-overflow-scrolling: touch; }

/* 用户条 */
.userbar { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: #fff; border-bottom: 1px solid var(--line); font-size: 13px; }
.ub-user { color: var(--muted); }
.ub-link { color: var(--accent); text-decoration: none; font-weight: 600; }
.ub-logout { margin-left: auto; border: none; background: none; color: var(--muted); cursor: pointer; font-size: 13px; }

/* ---------- H5 内容组件 ---------- */
.filter-bar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; align-items: center; }
.filter-bar .input.sm { flex: 1; min-width: 120px; }
.card-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.dish-card { background: #fff; border-radius: 14px; overflow: hidden; position: relative; box-shadow: 0 2px 8px rgba(0,0,0,.05); cursor: pointer; }
.dish-cover { width: 100%; height: 130px; object-fit: cover; display: block; background: #eee; }
.dish-name { padding: 8px 10px 2px; font-weight: 600; font-size: 14px; }
.dish-tag { padding: 0 10px 10px; color: var(--accent); font-size: 12px; }
.mini-btn { position: absolute; right: 8px; bottom: 8px; background: var(--accent); color: #fff; border: none; border-radius: 14px; padding: 4px 10px; font-size: 12px; cursor: pointer; }
.mini-btn.done { background: #c8ccd1; }
.list { display: flex; flex-direction: column; gap: 10px; }
.row { background: #fff; border-radius: 12px; padding: 12px 14px; display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); box-shadow: 0 1px 4px rgba(0,0,0,.04); cursor: pointer; }
.row-title { font-weight: 600; flex: 1; }
.row-sub { color: var(--muted); font-size: 12px; }
.row-cover { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; background: #eee; }
.link-list { display: flex; flex-direction: column; gap: 8px; }
.link-item { background: #fff; border-radius: 10px; padding: 10px 12px; text-decoration: none; color: var(--text); font-size: 14px; }
.sec-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.sec-head h2 { margin: 0; font-size: 18px; }

/* 今日菜单批量操作 */
.menu-actions { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.menu-actions .sel-all { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); cursor: pointer; user-select: none; margin-right: auto; }
.chk { width: 18px; height: 18px; accent-color: var(--accent); cursor: pointer; }
.row-chk { display: flex; align-items: center; }
.row .mini-btn { position: static; right: auto; bottom: auto; }

/* 详情 */
.detail { background: #fff; border-radius: 16px; padding: 16px; box-shadow: 0 2px 8px rgba(0,0,0,.05); }
.detail-cover { width: 100%; height: 200px; object-fit: cover; border-radius: 12px; background: #eee; }
.detail h2 { margin: 12px 0 4px; }
.detail-sec { margin: 12px 0; line-height: 1.6; }
.detail-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.step { border-top: 1px solid var(--line); padding: 14px 0; }
.step-no { font-weight: 600; color: var(--accent); margin-bottom: 8px; }
.step-img { width: 100%; max-height: 260px; object-fit: cover; border-radius: 10px; background: #eee; }
.step-text { margin-top: 8px; line-height: 1.6; }
.gallery { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 12px 0; }
.gallery-img { width: 100%; height: 150px; object-fit: cover; border-radius: 10px; background: #eee; }

/* 评论 */
.comments { margin-top: 16px; background: #fff; border-radius: 16px; padding: 16px; box-shadow: 0 2px 8px rgba(0,0,0,.05); }
.comments h3 { margin: 0 0 12px; }
.comment-list { display: flex; flex-direction: column; gap: 12px; }
.comment { border-bottom: 1px dashed var(--line); padding-bottom: 10px; }
.c-head { display: flex; gap: 8px; align-items: baseline; font-size: 13px; }
.c-time { color: var(--muted); font-size: 11px; }
.c-body { margin: 4px 0; line-height: 1.5; }
.c-actions { font-size: 12px; }
.c-reply-btn { color: var(--accent); cursor: pointer; margin-right: 12px; }
.c-del-btn { color: var(--danger); cursor: pointer; }
.reply { margin: 8px 0 8px 16px; padding-left: 12px; border-left: 2px solid var(--line); font-size: 13px; }
.reply-box { display: flex; gap: 6px; margin-top: 6px; }

.empty { text-align: center; color: var(--muted); padding: 30px 10px; }
.empty.sm { padding: 14px; font-size: 13px; }
.loading { text-align: center; padding: 40px; }
.loading::after { content: ""; display: inline-block; width: 24px; height: 24px; border: 3px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.75s linear infinite; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }

.comment-input { display: flex; gap: 6px; margin-bottom: 12px; align-items: center; }
.comment-input input { flex: 1; }
.muted { color: var(--muted); font-size: 13px; }

/* 表单 */
.form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-size: 13px; color: var(--muted); }
.preview { width: 100%; max-height: 140px; object-fit: cover; border-radius: 10px; background: #eee; margin-top: 6px; }
.preview.sm { max-height: 90px; }
.steps-box { display: flex; flex-direction: column; gap: 10px; }
.step-edit { border: 1px solid var(--line); border-radius: 12px; padding: 10px; }
.step-edit-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.step-move { display: flex; gap: 6px; margin-top: 6px; }
.g-item { position: relative; }
.g-item .mini-btn { position: absolute; top: 4px; right: 4px; padding: 2px 8px; }

/* 带文字的上传按钮（替代无提示的灰色原生 file） */
.upload-btn { display: inline-flex; align-items: center; gap: 6px; background: var(--accent); color: #fff; border-radius: 10px; padding: 8px 14px; font-size: 14px; cursor: pointer; }
.upload-btn:hover { background: var(--accent-d); }
.upload-btn input { display: none; }

/* 状态徽标 */
.status-badge { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 12px; margin-left: 6px; white-space: nowrap; }
.badge-online { background: #e6f6ec; color: var(--ok); }
.badge-offline { background: #fdecea; color: var(--danger); }
.badge-pending { background: #fff4e0; color: var(--warn); }

/* ---------- PC 管理后台 ---------- */
.admin-layout { display: flex; flex-direction: column; height: 100vh; }
.admin-top { height: 56px; background: #fff; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; padding: 0 20px; flex-shrink: 0; }
.admin-brand { display: flex; align-items: center; gap: 10px; }
.admin-body { flex: 1; display: flex; overflow: hidden; }
.admin-side { width: 200px; background: #fff; border-right: 1px solid var(--line); padding: 12px; overflow-y: auto; flex-shrink: 0; }
.admin-menu { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: 10px; text-decoration: none; color: var(--text); margin-bottom: 4px; font-size: 14px; }
.admin-menu:hover { background: #f5f6f8; }
.admin-menu.active { background: #fff1ea; color: var(--accent); font-weight: 600; }
.admin-content { flex: 1; overflow-y: auto; padding: 24px 28px; }
.page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.page-head h1 { margin: 0; font-size: 22px; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat-card { background: #fff; border-radius: 14px; padding: 20px; text-align: center; box-shadow: 0 2px 8px rgba(0,0,0,.05); }
.stat-ico { font-size: 28px; }
.stat-num { font-size: 28px; font-weight: 700; margin: 6px 0; }
.stat-label { color: var(--muted); font-size: 13px; }
.tbl { width: 100%; border-collapse: collapse; background: #fff; border-radius: 12px; overflow: hidden; box-shadow: 0 2px 8px rgba(0,0,0,.05); }
.tbl th, .tbl td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); font-size: 14px; }
.tbl th { background: #fafbfc; color: var(--muted); font-weight: 600; font-size: 13px; }
.tbl td .btn { margin-right: 6px; }
.c-content { max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inline-form { display: flex; gap: 8px; margin-bottom: 16px; align-items: center; flex-wrap: wrap; }
.nav-edit { display: flex; flex-direction: column; gap: 8px; }
.nav-row { display: flex; align-items: center; gap: 10px; background: #fff; padding: 12px 14px; border-radius: 10px; box-shadow: 0 1px 4px rgba(0,0,0,.04); }
.nav-key { font-family: monospace; color: var(--muted); width: 100px; }
.nav-vis { display: flex; align-items: center; gap: 4px; color: var(--muted); font-size: 13px; }

/* 桌面端 H5 预览适配 */
@media (min-width: 768px) {
  .h5-layout { max-width: 900px; margin: 0 auto; background: #fff; box-shadow: 0 0 30px rgba(0,0,0,.06); }
  .card-grid { grid-template-columns: repeat(3, 1fr); }
}
