/* ============ 恋恋食堂 · 全局样式 ============ */
:root {
  --bg1: #FFF7EF;
  --bg2: #FFEDE1;
  --card: #FFFFFF;
  --accent: #FF6F61;          /* 只做大面积底色/描边，不再直接写小字 */
  --accent-deep: #C8402C;     /* 文字与主按钮：白字对比 4.97（原 #F05A4C 只有 3.35） */
  --accent-soft: #FFE7E3;
  --gold: #8F5905;            /* 标签文字，原 #C77E0A 对比 2.98 */
  --gold-bg: #FFF3DC;
  --pink: #B0226A;            /* 彩蛋标签文字，原 #D63384 对比 3.70 */
  --pink-bg: #FFE1F0;
  --text: #4A3B32;
  --muted: #7E6455;           /* 原 #A5917F 只有 2.85 */
  --faint: #7A6152;           /* 提示/步骤文字，原 #C9B6A5 只有 1.72 */
  --note: #6B5344;            /* 主厨推荐语，原 #8A6F5F 只有 4.38 */
  --line: #F3E4D7;
  --radius: 22px;
  --shadow: 0 10px 30px rgba(255, 111, 97, 0.12);
  --font-hand: "Kaiti SC", STKaiti, Kaiti, "楷体", "TW-Kai", "Songti SC", serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  color: var(--text);
  background: linear-gradient(180deg, var(--bg1) 0%, var(--bg2) 100%) fixed;
  min-height: 100vh;
  /* 底部留出购物条 + 刘海屏安全区 */
  padding-bottom: calc(96px + env(safe-area-inset-bottom));
}
.hidden { display: none !important; }
.container { max-width: 520px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.empty { text-align: center; color: var(--muted); padding: 30px 0; }

/* ---- 顶部 ---- */
.hero {
  text-align: center;
  padding: calc(34px + env(safe-area-inset-top)) 20px 6px;
  position: relative;
}
.hero-logo {
  width: 76px; height: 76px; margin: 0 auto 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 40px; border-radius: 28px;
  background: linear-gradient(145deg, #FFE9E0, #FFD9CC);
  box-shadow: var(--shadow);
  cursor: pointer; user-select: none;
}
.hero h1 { margin: 0; font-size: 26px; letter-spacing: 2px; cursor: pointer; }
.slogan { margin: 6px 0 0; color: var(--muted); font-size: 14px; letter-spacing: 1px; }
.wiggle { animation: wiggle .45s ease; }
@keyframes wiggle {
  0%, 100% { transform: rotate(0); }
  25% { transform: rotate(-8deg) scale(1.06); }
  75% { transform: rotate(8deg) scale(1.06); }
}
.float-heart { position: absolute; color: #FFB3A7; opacity: .5; animation: floatUp 6s ease-in-out infinite; font-size: 14px; }
.fh1 { left: 12%; top: 30px; }
.fh2 { right: 14%; top: 22px; font-size: 18px; animation-delay: 1.5s; }
.fh3 { left: 46%; top: 8px; font-size: 12px; animation-delay: 3s; }
@keyframes floatUp {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-14px); }
}

/* ---- 区块 ---- */
.section { margin-top: 22px; }
.section-title { font-size: 17px; margin: 0 0 4px; }
.section-sub { margin: 0 0 12px; color: var(--muted); font-size: 13.5px; }
.foot-tip { text-align: center; color: var(--faint); font-size: 13px; margin: 26px 0 10px; }

/* ---- 菜品卡片 ---- */
.dish {
  display: flex; align-items: center; gap: 12px;
  background: var(--card); border-radius: var(--radius);
  padding: 14px; margin-bottom: 12px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 111, 97, .06);
}
.dish-secret {
  background: linear-gradient(135deg, #FFF0F5, #FFE4EC);
  border: 1px dashed #F8A8C2;
}
.dish-emoji {
  flex: none; width: 56px; height: 56px; border-radius: 18px;
  display: flex; align-items: center; justify-content: center;
  font-size: 30px; background: #FFF3EA;
}
.dish-emoji.small { width: 40px; height: 40px; font-size: 22px; border-radius: 14px; }
.dish-secret .dish-emoji { background: #fff; }
.dish-main { flex: 1; min-width: 0; }
.dish-name { font-weight: 700; font-size: 16px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.dish-desc { margin: 4px 0 0; font-size: 13.5px; color: var(--muted); line-height: 1.5; }
.chef-note {
  margin-top: 8px; font-size: 13.5px; color: var(--note);
  font-family: var(--font-hand);
  background: #FFF7EF; border-left: 3px solid var(--accent);
  padding: 7px 10px; border-radius: 4px 12px 12px 4px; line-height: 1.6;
}
.chef-note span { margin-right: 4px; }
.tag { font-size: 11.5px; padding: 3px 9px; border-radius: 999px; font-weight: 600; flex: none; }
.tag-rec { background: var(--gold-bg); color: var(--gold); }
.tag-secret { background: var(--pink-bg); color: var(--pink); }
.tag-off { background: #EFEAE5; color: var(--muted); }
.tag-new { background: #E3EEFF; color: #2F679E; }
.tag-cook { background: var(--gold-bg); color: var(--gold); }
.tag-done { background: #E2F3EA; color: #2E7554; }

/* ---- 数量步进 ---- */
.stepper { display: flex; align-items: center; gap: 6px; flex: none; }
.stepper button {
  position: relative;                    /* 可见 34px，::before 外扩 6px → 热区 46×46 */
  width: 34px; height: 34px; border-radius: 50%;
  border: none; font-size: 17px; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: transform .12s ease;
}
.stepper button::before { content: ""; position: absolute; inset: -6px; }
.stepper button:active { transform: scale(.88); }
.stepper .plus { background: var(--accent-deep); color: #fff; box-shadow: 0 4px 10px rgba(200, 64, 44, .35); }
.stepper .minus { background: var(--accent-soft); color: var(--accent-deep); }
.stepper .qty { min-width: 18px; text-align: center; font-size: 15px; }

/* ---- 其他：菜单上没有的 ---- */
.dish-other {
  align-items: flex-start;
  background: linear-gradient(135deg, #FFFDF7, #FFF6E9);
  border: 1px dashed #E7C79A;
  cursor: pointer;
}
.dish-other .dish-emoji { background: #FFF0D8; }
.dish-other .dish-name { color: var(--note); }
.other-preview {
  margin-top: 8px; font-size: 14px; color: var(--text); line-height: 1.6;
  background: #fff; border-left: 3px solid var(--gold);
  padding: 7px 10px; border-radius: 4px 12px 12px 4px;
  font-family: var(--font-hand);
}
#otherCard .btn-mini { flex: none; align-self: center; }
.other-editor {
  margin: -4px 0 14px; padding: 12px 14px;
  background: var(--card); border: 1px solid var(--line); border-radius: 18px;
  box-shadow: var(--shadow);
}
.other-editor textarea {
  width: 100%; border: 1.5px solid var(--line); border-radius: 12px;
  padding: 10px 12px; font-size: 14px; color: var(--text);
  background: #FFF9F4; outline: none; resize: none; font-family: inherit;
}
.other-editor textarea:focus { border-color: var(--accent); }
.other-editor-btns { display: flex; gap: 10px; margin-top: 10px; }
.other-editor-btns .btn { flex: 1; padding: 10px; }
.cart-row-other .cart-name b { color: var(--note); }
.cart-row-other .btn-mini { flex: none; }

/* ---- 底部购物条 ---- */
.cart-bar {
  position: fixed; left: 16px; right: 16px; bottom: calc(18px + env(safe-area-inset-bottom));
  max-width: 488px; margin: 0 auto;
  background: linear-gradient(135deg, #E8564A, var(--accent-deep));
  color: #fff; border-radius: 999px;
  padding: 14px 20px; display: flex; align-items: center; justify-content: space-between;
  box-shadow: 0 12px 28px rgba(200, 64, 44, .38);
  z-index: 30; font-size: 14.5px; cursor: pointer;
}
.cart-bar button {
  border: none; background: rgba(255, 255, 255, .24); color: #fff;
  font-size: 14.5px; font-weight: 700; padding: 8px 16px; border-radius: 999px; cursor: pointer;
}

/* ---- 底部弹层（购物车） ---- */
.sheet-mask {
  position: fixed; inset: 0; background: rgba(60, 40, 30, .38);
  z-index: 40; display: flex; align-items: flex-end; justify-content: center;
}
.sheet {
  width: 100%; max-width: 520px; background: #FFFDFB;
  border-radius: 26px 26px 0 0; padding: 18px 18px calc(18px + env(safe-area-inset-bottom));
  transform: translateY(100%); transition: transform .24s ease;
  max-height: 82vh; overflow-y: auto;
}
.sheet.open { transform: translateY(0); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.sheet-head b { font-size: 16px; }
.sheet-close {
  position: relative;
  border: none; background: #F3E9E0; width: 36px; height: 36px; border-radius: 50%;
  cursor: pointer; color: var(--muted); font-size: 15px;
}
.sheet-close::before { content: ""; position: absolute; inset: -4px; }
.cart-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.cart-emoji { font-size: 24px; }
.cart-name { flex: 1; }
.cart-name small { display: block; color: var(--muted); font-size: 13px; }
#orderNoteInput, .input {
  width: 100%; border: 1.5px solid var(--line); border-radius: 14px;
  padding: 11px 13px; font-size: 14px; color: var(--text);
  background: #FFF9F4; outline: none; margin-top: 12px; resize: none;
  font-family: inherit;
}
#orderNoteInput:focus, .input:focus { border-color: var(--accent); }

/* ---- 按钮 ---- */
.btn {
  border: none; cursor: pointer; font-size: 15px; font-weight: 700;
  padding: 12px 18px; border-radius: 14px;
  transition: transform .12s ease, opacity .2s;
  font-family: inherit;
}
.btn:active { transform: scale(.96); }
.btn:disabled { opacity: .6; cursor: default; }
.btn-primary { background: linear-gradient(135deg, #E8564A, var(--accent-deep)); color: #fff; box-shadow: 0 8px 18px rgba(200, 64, 44, .32); }
.btn-ghost { background: var(--accent-soft); color: var(--accent-deep); }
.btn-danger { background: #FDECEC; color: #B32C2C; }
.btn-block { width: 100%; margin-top: 14px; }
.btn-mini { padding: 8px 12px; font-size: 13.5px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-deep); }

/* ---- 订单状态页 ---- */
.card {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px; margin-bottom: 14px;
}
.order-card { margin-top: 22px; text-align: center; }
.order-emoji { font-size: 52px; animation: bounce 1.6s ease-in-out infinite; }
@keyframes bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.order-card h2 { margin: 10px 0 4px; font-size: 19px; }
.order-card .muted { font-size: 14px; margin: 0; }
.steps { display: flex; justify-content: space-between; margin: 22px 4px 6px; }
.step { flex: 1; text-align: center; position: relative; color: var(--faint); }
.step:not(:last-child)::after {
  content: ""; position: absolute; top: 21px; left: calc(50% + 26px); width: calc(100% - 52px);
  height: 3px; border-radius: 2px; background: var(--line);
}
.step.done:not(:last-child)::after, .step.active:not(:last-child)::after { background: var(--accent-deep); }
.step i {
  font-style: normal; display: inline-flex; width: 44px; height: 44px;
  align-items: center; justify-content: center; font-size: 21px;
  background: #F7EFE7; border-radius: 50%; margin-bottom: 5px;
}
.step.active i { background: var(--accent-deep); color: #fff; box-shadow: 0 6px 14px rgba(200, 64, 44, .35); }
.step.active, .step.done { color: var(--text); }
.step b { display: block; font-size: 13px; }
.order-items { margin-top: 16px; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.order-chip { background: #FFF3EA; color: var(--note); font-size: 13.5px; padding: 6px 12px; border-radius: 999px; }
.order-note {
  background: #FFF7EF; border-left: 3px solid var(--accent);
  padding: 8px 10px; border-radius: 4px 12px 12px 4px;
  font-size: 13.5px; color: var(--note); text-align: left;
  margin-bottom: 0;
}

/* ---- 通知 & 撒花 ---- */
.toast {
  position: fixed; top: calc(22px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%);
  background: rgba(74, 59, 50, .92); color: #fff; font-size: 14px;
  padding: 10px 20px; border-radius: 999px; z-index: 60; white-space: nowrap;
  max-width: calc(100vw - 32px); overflow: hidden; text-overflow: ellipsis;
}
#confetti { position: fixed; inset: 0; pointer-events: none; z-index: 50; }

/* ---- 主厨后台 ---- */
.admin-body { padding-bottom: calc(40px + env(safe-area-inset-bottom)); }
.login-wrap { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-card { width: 100%; text-align: center; padding: 30px 24px; }
.login-card .hero-logo { width: 64px; height: 64px; font-size: 32px; border-radius: 22px; }
.login-card h2 { margin: 10px 0 2px; }
.login-card p { margin: 0 0 8px; }
.admin-head { display: flex; align-items: center; justify-content: space-between; margin-top: 26px; }
.admin-head h2 { margin: 0; }
.admin-head p { margin: 2px 0 0; font-size: 13px; }
.notice {
  margin-top: 14px; background: #FFF6EA; border: 1px solid #FFE3BC;
  color: #6E5222; font-size: 13.5px; padding: 11px 14px; border-radius: 14px;
  display: flex; align-items: center; gap: 10px; justify-content: space-between; flex-wrap: wrap;
}
.tabs { display: flex; gap: 8px; margin: 16px 0 14px; }
.tab {
  flex: 1; border: none; padding: 11px; border-radius: 14px; cursor: pointer;
  background: #F3E9E0; color: var(--muted); font-size: 15px; font-weight: 700; font-family: inherit;
}
.tab.active { background: var(--accent-deep); color: #fff; box-shadow: 0 8px 18px rgba(200, 64, 44, .3); }
.order-admin-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.order-admin-head b { font-size: 16px; }
.order-admin-head .muted { font-size: 13px; margin-left: auto; }
.order-admin-items { margin: 10px 0 0; font-size: 14px; line-height: 1.6; }
.order-admin-note {
  margin: 10px 0 0; background: #FFF7EF; border-left: 3px solid var(--gold);
  padding: 8px 10px; border-radius: 4px 12px 12px 4px; font-size: 13.5px; color: var(--note);
}
.row-btns { display: flex; gap: 10px; margin-top: 12px; }
.row-btns .btn { flex: 1; padding: 10px; }
.dish-admin-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; flex-wrap: wrap; }
.dish-form > b { display: block; margin-bottom: 4px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 10px; margin-top: 8px; }
.form-grid label { font-size: 13px; color: var(--muted); display: block; }
.form-grid .input { margin-top: 4px; padding: 9px 11px; font-size: 14px; }
.input-emoji { width: 70px !important; text-align: center; }
.form-grid .checks { grid-column: 1 / -1; display: flex; gap: 14px; flex-wrap: wrap; padding: 2px 0; }
.check { display: flex; align-items: center; gap: 5px; font-size: 13.5px; color: var(--text) !important; }
.check input { accent-color: var(--accent); width: 18px; height: 18px; }
#newDishCard .btn { margin-top: 12px; width: 100%; }
@media (max-width: 420px) {
  .form-grid { grid-template-columns: 1fr; }
}

/* ---- 恋爱计时 & 每日情话 ---- */
.love-days {
  display: inline-block; margin: 12px auto 0; padding: 6px 16px;
  background: rgba(255, 255, 255, .75); border: 1px solid #FFD9CC;
  color: var(--accent-deep); font-size: 13.5px; font-weight: 600;
  border-radius: 999px;
}
.love-days.anniv {
  background: var(--accent-deep); border-color: var(--accent-deep); color: #fff;
  box-shadow: 0 6px 16px rgba(200, 64, 44, .4);
  animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}
.love-note {
  background: #FFF9F4; border: 1px dashed #F3C9B8;
  border-radius: var(--radius); padding: 16px 18px 14px; text-align: center;
}
.love-note-quote {
  font-size: 28px; color: var(--accent); opacity: .5; font-family: Georgia, serif;
  line-height: 1; height: 14px;
}
.love-note p { margin: 6px 0 10px; font-size: 15.5px; line-height: 1.8; color: var(--note); font-family: var(--font-hand); }
.love-note-sign { font-size: 13px; color: var(--muted); }
.romance-tip { font-size: 13px; margin: 4px 0 0; }
.romance-date { display: block; margin-top: 8px; }
.romance-date .input { margin-top: 6px; }
#notesInput { margin-top: 8px; font-size: 14px; line-height: 1.8; }
