:root {
  --primary: #F25C36;
  --primary-d: #D8471F;
  --accent: #E8912E;
  --bg: #F7F4F1;
  --card: #FFFFFF;
  --text: #2B2622;
  --sub: #9A8F87;
  --green: #3DA76B;
  --line: #ECE6E1;
  --shadow: 0 4px 14px rgba(60, 40, 30, 0.06);
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
#app { position: relative; display: flex; flex-direction: column; height: 100%; max-width: 480px; margin: 0 auto; background: var(--bg); }

/* 顶栏 */
#topbar {
  height: 52px; flex-shrink: 0; display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px; background: var(--bg); padding-top: env(safe-area-inset-top);
}
.tb-title { font-size: 19px; font-weight: 800; letter-spacing: 1px; }
.tb-role { font-size: 12px; font-weight: 700; color: var(--primary); background: #FBE7DF; padding: 5px 11px; border-radius: 999px; }

/* 主视图 */
#view { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 8px 16px 24px; }
.view-head { font-size: 18px; font-weight: 800; margin: 8px 4px 4px; }
.sub-tip { font-size: 12px; color: var(--sub); margin: 2px 4px 14px; }

/* 卡片行 */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 12px; display: flex; align-items: center; gap: 12px; margin-bottom: 10px; box-shadow: var(--shadow);
}
.thumb { width: 52px; height: 52px; border-radius: 10px; object-fit: cover; flex-shrink: 0; background: #EFEAE6; }
.thumb.ph { display: flex; align-items: center; justify-content: center; font-size: 22px; color: #C9BFB8; }
.info { flex: 1; min-width: 0; }
.name { font-size: 15px; font-weight: 700; }
.meta { font-size: 12px; color: var(--sub); margin-top: 3px; }
.price { font-size: 13px; color: var(--primary); font-weight: 700; margin-top: 2px; }
.ing { font-size: 11px; color: var(--sub); margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 分类标签 */
.tag { font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 6px; margin-left: 6px; vertical-align: middle; }
.tag-荤 { background: #FBE0D6; color: #C8431F; }
.tag-素 { background: #E3F0DF; color: #3E7B36; }
.tag-汤 { background: #DDEAF7; color: #2F6FB0; }
.tag-主食 { background: #F0E6D6; color: #8A6A3A; }
.tag-other { background: #EEE8F5; color: #7B5EA7; }

/* 状态徽章 */
.badge { font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.b-todo { background: #FBF0D8; color: #B0821C; }
.b-cooking { background: #FBE0D6; color: var(--primary); }
.b-done { background: #DCF2E7; color: var(--green); }
.status-btn { font-size: 12px; font-weight: 700; padding: 8px 11px; border-radius: 999px; border: none; white-space: nowrap; }
.s-todo { background: #FBF0D8; color: #B0821C; }
.s-cooking { background: #FBE0D6; color: var(--primary); }
.s-done { background: #DCF2E7; color: var(--green); }

/* 按钮 */
.btn-primary { width: 100%; background: var(--primary); color: #fff; border: none; border-radius: 999px; padding: 13px; font-size: 16px; font-weight: 700; box-shadow: 0 8px 18px rgba(242, 92, 54, 0.3); }
.btn-primary:active { background: var(--primary-d); }
.btn-ghost { width: 100%; background: #fff; color: var(--primary); border: 1px solid var(--primary); border-radius: 999px; padding: 11px; font-size: 15px; font-weight: 700; }
.btn-mini { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 9px; font-size: 13px; font-weight: 600; color: var(--text); box-shadow: var(--shadow); }
.btn-mini.alt { color: var(--primary); border-color: #FBE0D6; }
.add { width: 30px; height: 30px; border-radius: 50%; background: var(--primary); color: #fff; border: none; font-size: 20px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.add:active { background: var(--primary-d); }
.mini { width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--line); background: #fff; font-size: 16px; color: var(--sub); }
.fab { position: absolute; right: 18px; bottom: calc(72px + env(safe-area-inset-bottom)); width: 54px; height: 54px; border-radius: 50%; background: var(--primary); color: #fff; border: none; font-size: 26px; font-weight: 700; box-shadow: 0 10px 22px rgba(242, 92, 54, 0.4); z-index: 30; }

/* chips */
.chips { display: flex; gap: 8px; margin-bottom: 12px; overflow-x: auto; padding-bottom: 2px; -webkit-overflow-scrolling: touch; }
.chip { font-size: 13px; padding: 6px 14px; border-radius: 999px; background: #fff; color: var(--sub); font-weight: 600; border: 1px solid var(--line); white-space: nowrap; }
.chip.on { background: var(--primary); color: #fff; border-color: var(--primary); }

/* 搜索 */
.search { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; color: var(--sub); font-size: 13px; margin-bottom: 12px; box-shadow: var(--shadow); width: 100%; border: none; }
.search:focus { outline: none; }

/* hero */
.hero { background: linear-gradient(135deg, #F25C36, #E8912E); border-radius: 16px; padding: 16px; color: #fff; margin-bottom: 16px; box-shadow: var(--shadow); }
.hero .t { font-size: 12px; opacity: 0.92; }
.hero .d { font-size: 20px; font-weight: 800; margin-top: 4px; }
.hero .n { font-size: 12px; opacity: 0.9; margin-top: 6px; }

/* 底栏 */
#tabbar { flex-shrink: 0; height: 56px; background: #fff; border-top: 1px solid var(--line); display: flex; padding-bottom: env(safe-area-inset-bottom); }
.tab { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11px; color: var(--sub); font-weight: 600; background: none; border: none; }
.tab .ic { font-size: 20px; line-height: 1; filter: grayscale(1); opacity: 0.6; }
.tab.on { color: var(--primary); }
.tab.on .ic { filter: none; opacity: 1; }

/* 弹层 */
.overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.42); z-index: 40; display: flex; flex-direction: column; justify-content: flex-end; }
.overlay.hidden { display: none; }
.sheet { background: #fff; border-radius: 24px 24px 0 0; padding: 20px 18px calc(20px + env(safe-area-inset-bottom)); max-height: 88%; overflow-y: auto; width: 100%; max-width: 480px; margin: 0 auto; }
.sheet-title { font-size: 17px; font-weight: 800; margin-bottom: 6px; }
.sheet-close { position: absolute; top: 16px; right: 18px; font-size: 22px; color: var(--sub); background: none; border: none; }

/* 表单 */
.lab { font-size: 13px; color: var(--sub); margin: 14px 0 8px; }
.fld { width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 11px 12px; font-size: 14px; font-family: inherit; color: var(--text); background: #fff; }
.fld:focus { outline: none; border-color: var(--primary); }
.fld-area { min-height: 80px; resize: vertical; }
.specs { display: flex; gap: 12px; }
.spec { flex: 1; text-align: center; padding: 10px; border-radius: 12px; border: 1px solid var(--line); font-size: 14px; font-weight: 600; color: var(--sub); background: #fff; }
.spec.on { background: #FBE7DF; color: var(--primary); border-color: var(--primary); }
.stepper { display: flex; align-items: center; gap: 18px; }
.step-btn { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: #fff; font-size: 22px; font-weight: 700; color: var(--text); display: flex; align-items: center; justify-content: center; }
.step-val { font-size: 18px; font-weight: 800; min-width: 28px; text-align: center; }
.row { display: flex; align-items: center; gap: 10px; }
.row.between { justify-content: space-between; }
.confirm-btn { margin-top: 18px; }

/* 图片上传 */
.imgpick { width: 88px; height: 88px; border-radius: 12px; border: 1px dashed var(--line); display: flex; align-items: center; justify-content: center; color: var(--sub); font-size: 12px; background: #FAF8F6; overflow: hidden; position: relative; }
.imgpick img { width: 100%; height: 100%; object-fit: cover; }
.imgpick .x { position: absolute; top: 2px; right: 2px; background: rgba(0,0,0,.5); color: #fff; border-radius: 50%; width: 18px; height: 18px; font-size: 12px; display: flex; align-items: center; justify-content: center; }

/* 空态 */
.empty { text-align: center; color: var(--sub); font-size: 13px; padding: 60px 30px; }
.empty .big { font-size: 40px; margin-bottom: 10px; }

/* toast */
.toast { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); background: rgba(0, 0, 0, 0.8); color: #fff; font-size: 13px; padding: 10px 18px; border-radius: 10px; opacity: 0; transition: opacity 0.25s; pointer-events: none; z-index: 60; max-width: 80%; text-align: center; }
.toast.show { opacity: 1; }

/* 画廊 */
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cell { border-radius: 12px; overflow: hidden; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); }
.cell img { width: 100%; height: 130px; object-fit: cover; display: block; }
.cell .cap { padding: 8px 10px; font-size: 12px; font-weight: 600; }
.cell .cap .sub { font-size: 11px; color: var(--sub); font-weight: 400; margin-top: 2px; }

/* 大图预览 */
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.9); z-index: 50; display: flex; align-items: center; justify-content: center; padding: 20px; }
.lightbox img { max-width: 100%; max-height: 80%; border-radius: 8px; }
.lightbox .lb-cap { position: absolute; bottom: 30px; left: 0; right: 0; text-align: center; color: #fff; font-size: 13px; }

/* 登录失效屏 */
.lock { position: fixed; inset: 0; background: var(--bg); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 30px; text-align: center; z-index: 70; }
.lock .big { font-size: 48px; margin-bottom: 14px; }
.lock .t { font-size: 17px; font-weight: 800; margin-bottom: 8px; }
.lock .s { font-size: 13px; color: var(--sub); line-height: 1.7; }

.loading { text-align: center; color: var(--sub); padding: 40px; font-size: 13px; }
