/* 小鱼手作 · 软萌治愈手绘卡通风 */
:root {
  --main: #FFA96B;
  --main-deep: #f28f45;
  --bg: #FFFCF7;
  --card: #FFF8ED;
  --bar: #FFE9D2;
  --text-deep: #3A2618;
  --text: #59473A;
  --radius: 16px;
  --shadow: 0 4px 14px rgba(255, 169, 107, 0.18);
}
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  background: var(--bg);
  color: var(--text);
  max-width: 560px;
  margin: 0 auto;
  min-height: 100vh;
  position: relative;
  padding-bottom: 76px; /* 底部导航空间 */
}
img { display: block; max-width: 100%; }

/* 角落装饰 */
.decor {
  position: fixed;
  z-index: 1;
  pointer-events: none;
  opacity: 0.35;
}
.decor-tl { top: 90px; left: -14px; width: 90px; transform: rotate(-10deg); }
.decor-br { bottom: 90px; right: -12px; width: 100px; transform: rotate(12deg); }

/* 顶部品牌区 */
.brand {
  padding: 26px 20px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.brand img { width: 58px; height: 58px; border-radius: 50%; object-fit: cover; box-shadow: var(--shadow); }
.brand .bt { flex: 1; }
.brand h1 { font-size: 26px; color: var(--text-deep); letter-spacing: 2px; }
.brand p { font-size: 13px; color: #a08a78; margin-top: 6px; letter-spacing: 1px; }

/* 卡片 */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin: 14px 16px;
  padding: 18px 18px 16px;
  position: relative;
  z-index: 2;
}
.card .card-illus { width: 110px; height: auto; margin: 0 auto 6px; border-radius: 12px; }
.card-title {
  display: block;
  background: var(--bar);
  color: var(--text-deep);
  font-size: 17px;
  font-weight: 700;
  text-align: center;
  padding: 7px 0;
  border-radius: 999px;
  letter-spacing: 2px;
}
.card-sub { font-size: 13px; color: #8a7462; text-align: center; margin: 12px 0 6px; line-height: 1.6; }
.rule-list { margin-top: 14px; }
.rule-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 9px 0;
}
.rule-num {
  flex: none;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--main);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  margin-top: 1px;
}
.rule-item b { color: var(--text-deep); display: block; font-size: 15px; }
.rule-item span { font-size: 14px; line-height: 1.65; display: block; }

/* 保存方式 / 食用方法 */
.save-grid { display: flex; flex-direction: column; gap: 14px; margin-top: 6px; }
.save-item { display: flex; gap: 12px; }
.save-item .tag {
  flex: none;
  width: 58px; height: 58px;
  border-radius: 50%;
  background: var(--bar);
  color: var(--main-deep);
  font-size: 12px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  text-align: center;
  line-height: 1.3;
}
.save-item h4 { color: var(--text-deep); font-size: 15px; margin-bottom: 4px; }
.save-item p { font-size: 13.5px; line-height: 1.75; }

/* 轮播 */
/* 底部导航 */
.bottom-nav {
  position: fixed;
  left: 50%; transform: translateX(-50%);
  bottom: 0;
  width: 100%; max-width: 560px;
  background: #fffdf8;
  border-top: 2px solid var(--bar);
  display: flex;
  z-index: 100;
  padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
  gap: 8px;
}
.bottom-nav a {
  flex: 1;
  text-decoration: none;
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  text-align: center;
  padding: 9px 0;
  border-radius: 999px;
  transition: .2s;
}
.bottom-nav a.on { background: var(--main); color: #fff; }

/* 通用按钮 */
.btn {
  display: block;
  width: 100%;
  border: none;
  border-radius: 999px;
  padding: 13px 0;
  font-size: 16px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: .2s;
  letter-spacing: 2px;
}
.btn-main { background: var(--main); color: #fff; }
.btn-main:hover { background: var(--main-deep); }
.btn-line { background: #fff; color: var(--main-deep); border: 2px solid var(--main); }
.btn-line:hover { background: var(--bar); }
.btn:disabled { opacity: .5; }

/* 输入框 */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 14px; font-weight: 700; color: var(--text-deep); margin-bottom: 7px; }
.field input, .field select, .field textarea {
  width: 100%;
  border: 2px solid var(--bar);
  background: #fff;
  border-radius: 14px;
  padding: 11px 14px;
  font-size: 15px;
  font-family: inherit;
  color: var(--text-deep);
  outline: none;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--main); }
.field textarea { resize: vertical; min-height: 72px; }
.hint { font-size: 12.5px; color: #a08a78; margin-top: 6px; line-height: 1.6; }

/* 弹窗提示 toast */
#toast {
  position: fixed;
  left: 50%; bottom: 110px;
  transform: translateX(-50%) translateY(10px);
  background: rgba(58,38,24,.92);
  color: #fff;
  font-size: 14px;
  padding: 10px 20px;
  border-radius: 999px;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: .25s;
  max-width: 86%;
  text-align: center;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* 欢迎页 */
.welcome {  position: fixed;
  inset: 0;
  z-index: 999;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: opacity .6s;
}
.welcome img { width: 74%; max-width: 340px; border-radius: 24px; box-shadow: var(--shadow); }
.welcome h2 { margin-top: 24px; font-size: 24px; letter-spacing: 4px; color: var(--text-deep); }
.welcome p { margin-top: 8px; font-size: 13px; color: #a08a78; letter-spacing: 2px; }
.welcome-enter {
  margin-top: 28px;
  padding: 12px 46px;
  border: none;
  border-radius: 999px;
  background: var(--main);
  color: #fff;
  font-size: 15px;
  letter-spacing: 3px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform .2s, filter .2s;
}
.welcome-enter:active { transform: scale(.96); filter: brightness(1.06); }
.welcome.hide { opacity: 0; pointer-events: none; }

/* ===== 下单页 ===== */
.page-title { padding: 22px 20px 0; }
.page-title h2 { font-size: 22px; color: var(--text-deep); letter-spacing: 1px; }
.page-title p { font-size: 13px; color: #a08a78; margin-top: 5px; }
.cats {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--bg);
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 14px 16px 12px;
  scrollbar-width: none;
}
.cats::-webkit-scrollbar { display: none; }
.cats button {
  flex: none;
  border: none;
  background: var(--card);
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  padding: 8px 16px;
  border-radius: 999px;
  cursor: pointer;
  transition: .2s;
}
.cats button.on { background: var(--main); color: #fff; }
.prod-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  padding: 6px 16px 20px;
}
.prod {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.prod img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.prod .info { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 8px; }
.prod .nm { font-size: 15px; font-weight: 700; color: var(--text-deep); line-height: 1.4; min-height: 21px; }
.prod .row { display: flex; align-items: center; justify-content: space-between; }
.prod .pr { color: var(--main-deep); font-size: 17px; font-weight: 800; }
.stepper { display: flex; align-items: center; gap: 6px; }
.stepper button {
  width: 26px; height: 26px;
  border: none;
  border-radius: 50%;
  background: var(--main);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  line-height: 1;
}
.stepper button.minus { background: var(--bar); color: var(--text-deep); }
.stepper .qty { min-width: 22px; text-align: center; font-weight: 700; color: var(--text-deep); }
.stepper .qty.hide { visibility: hidden; }

/* 购物车浮条 */
.cart-bar {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 68px;
  width: calc(100% - 28px);
  max-width: 532px;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fff;
  border: 2px solid var(--bar);
  border-radius: 999px;
  padding: 8px 10px 8px 18px;
  box-shadow: 0 6px 18px rgba(255,169,107,.28);
}
.cart-bar .cb-info { flex: 1; }
.cart-bar .cb-num { font-size: 15px; font-weight: 800; color: var(--text-deep); }
.cart-bar .cb-total { font-size: 12.5px; color: #a08a78; margin-top: 2px; }
.cart-bar .cb-btn {
  border: none;
  background: var(--main);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  padding: 10px 22px;
  border-radius: 999px;
  cursor: pointer;
  transition: .2s;
}
.cart-bar .cb-btn:disabled { background: #f0d9bd; }
.cart-bar.hide { display: none; }

/* ===== 确认/付款页 ===== */
.money-row { display: flex; justify-content: space-between; padding: 9px 0; font-size: 15px; }
.money-row.total { font-size: 17px; font-weight: 800; color: var(--text-deep); border-top: 2px dashed var(--bar); margin-top: 6px; }
.money-row .free { color: #67a85a; font-size: 12.5px; }
.order-items { border-bottom: 2px dashed var(--bar); padding-bottom: 12px; margin-bottom: 6px; }
.order-line { display: flex; justify-content: space-between; font-size: 14.5px; padding: 5px 0; }
.order-line .nm { color: var(--text-deep); }
.order-line .x { color: #a08a78; font-size: 12.5px; }

/* 支付方式 */
.pay-tabs { display: flex; gap: 10px; margin-bottom: 14px; }
.pay-tabs button {
  flex: 1;
  border: 2px solid var(--bar);
  background: #fff;
  color: var(--text-deep);
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  padding: 11px 0;
  border-radius: 999px;
  cursor: pointer;
  transition: .2s;
}
.pay-tabs button.on { border-color: var(--main); background: var(--bar); color: var(--main-deep); }
.qr-box {
  background: #fff;
  border: 2px solid var(--bar);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
  margin-bottom: 14px;
}
.qr-box img { max-width: 220px; margin: 0 auto; border-radius: 12px; }
.qr-box .placeholder { color: #a08a78; font-size: 14px; padding: 30px 0; }

/* 历史订单 */
.his-order {
  background: #fff;
  border: 2px solid var(--bar);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 12px;
}
.his-order .ho-top { display: flex; justify-content: space-between; font-size: 13px; color: #a08a78; margin-bottom: 8px; }
.his-order .ho-top b { color: var(--text-deep); font-size: 14px; }
.his-order .ho-items { font-size: 14px; line-height: 1.7; color: var(--text-deep); }
.his-order .ho-total { font-size: 14px; font-weight: 700; color: var(--main-deep); margin-top: 6px; }

/* ===== 管理端 ===== */
.admin-body { padding-bottom: 20px; }
.admin-nav {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--bg);
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 12px 12px 10px;
  border-bottom: 2px solid var(--bar);
  scrollbar-width: none;
}
.admin-nav::-webkit-scrollbar { display: none; }
.admin-nav a {
  flex: none;
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text);
  padding: 7px 13px;
  border-radius: 999px;
  white-space: nowrap;
}
.admin-nav a.on { background: var(--main); color: #fff; }
.admin-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 18px 10px; }
.admin-head h2 { font-size: 20px; color: var(--text-deep); }
.admin-head .logout { font-size: 13px; color: #a08a78; cursor: pointer; }
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; padding: 8px 16px; }
.stat {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  text-align: center;
}
.stat b { display: block; font-size: 26px; color: var(--main-deep); }
.stat span { font-size: 13px; color: #8a7462; }
.list-card {
  background: #fff;
  border: 2px solid var(--bar);
  border-radius: var(--radius);
  padding: 14px;
  margin: 0 16px 14px;
}
.list-card .lc-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; gap: 8px; flex-wrap: wrap; }
.list-card .lc-top b { color: var(--text-deep); font-size: 15px; }
.list-card .lc-top .st { font-size: 12.5px; padding: 3px 10px; border-radius: 999px; background: var(--bar); color: var(--main-deep); }
.list-card .lc-top .st.done { background: #e3f0dc; color: #4c8f3d; }
.list-card .lc-body { font-size: 13.5px; line-height: 1.75; color: var(--text); }
.list-card .lc-actions { margin-top: 10px; display: flex; gap: 8px; }
.list-card .lc-actions button {
  flex: 1;
  border: none;
  background: var(--bar);
  color: var(--main-deep);
  font-size: 13.5px;
  font-weight: 700;
  font-family: inherit;
  padding: 9px 0;
  border-radius: 999px;
  cursor: pointer;
}
.list-card .lc-actions button.main { background: var(--main); color: #fff; }
.buns-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--bar);
}
.buns-row:last-child { border-bottom: none; }
.buns-row img { width: 46px; height: 46px; border-radius: 12px; object-fit: cover; }
.buns-row .nm { flex: 1; font-size: 14.5px; color: var(--text-deep); font-weight: 700; }
.buns-row .pr { color: var(--main-deep); font-weight: 800; font-size: 15px; width: 62px; }
.buns-row .on-off {
  border: none;
  font-size: 12.5px;
  font-weight: 700;
  font-family: inherit;
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
  background: var(--bar); color: var(--main-deep);
}
.buns-row .on-off.off { background: #f1ece4; color: #a08a78; }
.buns-row .pr input {
  width: 58px;
  border: 2px solid var(--bar);
  border-radius: 10px;
  padding: 5px 8px;
  font-size: 14px;
  text-align: right;
  font-family: inherit;
  color: var(--text-deep);
}
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { padding: 9px 6px; border-bottom: 1px dashed var(--bar); text-align: left; }
.table th { color: #8a7462; font-size: 12.5px; font-weight: 700; }
.table td { color: var(--text-deep); }
.add-btn {
  border: 2px dashed var(--main);
  background: #fff;
  color: var(--main-deep);
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  padding: 12px 0;
  width: 100%;
  border-radius: var(--radius);
  cursor: pointer;
  margin: 0 16px;
}
.modal-mask {
  position: fixed; inset: 0;
  background: rgba(58,38,24,.45);
  z-index: 120;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-mask.show { display: flex; }
.modal {
  background: #fff;
  border-radius: 20px;
  padding: 22px;
  width: 100%;
  max-width: 420px;
  max-height: 86vh;
  overflow-y: auto;
}
.modal h3 { color: var(--text-deep); margin-bottom: 16px; font-size: 18px; }
.chip { display: inline-block; padding: 6px 12px; border-radius: 999px; background: var(--bar); font-size: 13px; font-weight: 700; color: var(--main-deep); }
.print-btn { text-align: right; padding: 6px 16px; }
.print-btn button {
  border: none;
  background: var(--main);
  color: #fff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  padding: 9px 20px;
  border-radius: 999px;
  cursor: pointer;
}
@media print {
  .admin-nav, .bottom-nav, .print-btn, .admin-head { display: none !important; }
  body { padding: 0; background: #fff; }
}
