/* ==========================================================================
   奶绿家今天的饭 —— 设计系统
   暖奶油底 + 奶绿主色，卡片化、圆角、留白克制
   ========================================================================== */

:root {
  --bg: #FBF8F3;
  --bg-soft: #F6F0E7;
  --surface: #FFFFFF;
  --surface-soft: #FDFBF7;
  --line: #EFE8DC;
  --line-strong: #E2D8C8;

  --text: #2E3A33;
  --text-2: #5D6A61;
  --muted: #96A29A;

  --brand: #7FB077;
  --brand-deep: #5A8A53;
  --brand-soft: #EDF5E8;
  --brand-line: #D6E7CE;

  --accent: #DE9A62;
  --accent-soft: #FBEFE1;

  --danger: #C96A5D;
  --danger-soft: #FBEBE7;

  --warn: #C9973F;
  --warn-soft: #FBF2E0;

  --radius: 18px;
  --radius-sm: 12px;
  --radius-lg: 26px;
  --radius-full: 999px;

  --shadow-1: 0 1px 2px rgba(46, 58, 51, .04), 0 6px 20px rgba(46, 58, 51, .05);
  --shadow-2: 0 12px 34px rgba(46, 58, 51, .12);

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --bar-h: 52px;
  --tab-h: 56px;

  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
          "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

/* 自定义 display 不应压过 hidden 属性 */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

body { overflow: hidden; }

button, input, textarea, select { font-family: inherit; font-size: inherit; color: inherit; }
button { border: 0; background: none; cursor: pointer; padding: 0; }
input, textarea { -webkit-appearance: none; appearance: none; }
a { color: inherit; text-decoration: none; }

.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------------------------------------------------------------- 启动页 */

.boot {
  position: fixed; inset: 0; z-index: 90;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; background: var(--bg);
}
.boot-logo { opacity: .95; }
.boot-name { margin: 12px 0 0; font-size: 17px; font-weight: 700; letter-spacing: .5px; }
.boot-msg { margin: 0; font-size: 13px; color: var(--muted); }

/* ---------------------------------------------------------------- 骨架 */

#app { height: 100%; display: flex; flex-direction: column; }

.app-bar {
  flex: 0 0 auto;
  padding-top: var(--safe-top);
  background: rgba(251, 248, 243, .92);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .18s;
}
.app-bar.is-scrolled { border-bottom-color: var(--line); }
.app-bar-inner {
  height: var(--bar-h);
  display: flex; align-items: center; gap: 8px;
  padding: 0 8px 0 12px;
}
.app-bar-title {
  font-size: 17px; font-weight: 700; letter-spacing: .2px;
  flex: 1 1 auto; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.app-bar-sub { font-size: 12px; color: var(--muted); font-weight: 500; margin-left: 2px; }
.app-bar-actions { display: flex; align-items: center; gap: 2px; flex: 0 0 auto; }

.icon-btn {
  width: 38px; height: 38px; border-radius: var(--radius-full);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-2);
  transition: background .15s, color .15s;
}
.icon-btn:active { background: var(--bg-soft); }
.icon-btn.is-brand { color: var(--brand-deep); }

.view {
  flex: 1 1 auto; min-height: 0;
  overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: 4px 16px calc(var(--tab-h) + var(--safe-bottom) + 26px);
}
.view.is-plain { padding-bottom: calc(var(--safe-bottom) + 24px); }
/* 悬浮点菜单出现时，给内容留出不被遮挡的空间 */
#app.has-cart .view { padding-bottom: calc(var(--tab-h) + var(--safe-bottom) + 88px); }

/* ---------------------------------------------------------------- 底部 Tab */

.tab-bar {
  flex: 0 0 auto; position: relative; z-index: 20;
  display: flex; align-items: stretch;
  height: calc(var(--tab-h) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: rgba(255, 255, 255, .94);
  backdrop-filter: saturate(180%) blur(14px);
  border-top: 1px solid var(--line);
}
.tab {
  flex: 1 1 0; position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; color: var(--muted); font-size: 10.5px; font-weight: 500;
  transition: color .15s;
}
.tab.is-active { color: var(--brand-deep); font-weight: 600; }
.tab svg { display: block; }
.tab-dot {
  position: absolute; top: 4px; left: 50%; margin-left: 6px;
  min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: var(--radius-full);
  background: var(--accent); color: #fff;
  font-size: 10px; font-weight: 700; line-height: 16px; text-align: center;
}

/* ---------------------------------------------------------------- 通用块 */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
}
.card + .card { margin-top: 12px; }
.card-pad { padding: 16px; }

.section { margin-top: 22px; }
.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin: 0 2px 10px;
}
.section-title { font-size: 15.5px; font-weight: 700; letter-spacing: .2px; }
.section-sub { font-size: 12px; color: var(--muted); }
.section-link {
  font-size: 12.5px; color: var(--brand-deep); font-weight: 600;
  display: inline-flex; align-items: center; gap: 2px;
}

.muted { color: var(--muted); }
.text-2 { color: var(--text-2); }
.nowrap { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mt-0 { margin-top: 0; } .mt-6 { margin-top: 6px; } .mt-10 { margin-top: 10px; }
.mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }

/* ---------------------------------------------------------------- 按钮 */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 46px; padding: 0 20px;
  border-radius: var(--radius-full);
  font-size: 15px; font-weight: 600; letter-spacing: .2px;
  transition: transform .12s ease, opacity .15s, background .15s;
  white-space: nowrap;
}
.btn:active { transform: scale(.975); }
.btn[disabled], .btn.is-disabled { opacity: .45; pointer-events: none; }
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 6px 16px rgba(127, 176, 119, .32); }
.btn-accent { background: var(--accent); color: #fff; box-shadow: 0 6px 16px rgba(222, 154, 98, .3); }
.btn-soft { background: var(--brand-soft); color: var(--brand-deep); }
.btn-ghost { background: var(--surface); color: var(--text); border: 1px solid var(--line-strong); }
.btn-plain { background: var(--bg-soft); color: var(--text-2); }
.btn-danger { background: var(--danger-soft); color: var(--danger); }
.btn-block { width: 100%; }
.btn-sm { height: 36px; padding: 0 14px; font-size: 13.5px; }
.btn-xs { height: 30px; padding: 0 12px; font-size: 12.5px; border-radius: var(--radius-full); }

/* ---------------------------------------------------------------- 标签 */

.chip {
  display: inline-flex; align-items: center; gap: 4px;
  height: 26px; padding: 0 11px;
  border-radius: var(--radius-full);
  background: var(--bg-soft); color: var(--text-2);
  font-size: 12px; font-weight: 500;
}
.chip-brand { background: var(--brand-soft); color: var(--brand-deep); }
.chip-accent { background: var(--accent-soft); color: #B2743D; }
.chip-line { background: transparent; border: 1px solid var(--line-strong); }

.chip-row {
  display: flex; gap: 8px;
  overflow-x: auto; overflow-y: hidden;
  padding: 2px 0 4px;
  scrollbar-width: none;
}
.chip-row::-webkit-scrollbar { display: none; }
.chip-row.is-wrap { flex-wrap: wrap; overflow: visible; }
.chip-row .chip { flex: 0 0 auto; }
.chip-count { font-size: 11px; opacity: .6; margin-left: 3px; }

/* 冰箱 */
.fridge-row .row-title {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.fridge-amount {
  font-size: 12.5px; font-weight: 700; color: var(--brand-deep);
  font-variant-numeric: tabular-nums;
}
.fridge-row .qty-num { font-variant-numeric: tabular-nums; }

.pill {
  display: inline-flex; align-items: center; gap: 4px;
  height: 22px; padding: 0 9px; border-radius: var(--radius-full);
  font-size: 11.5px; font-weight: 600; letter-spacing: .2px;
}
.pill-warn { background: var(--warn-soft); color: var(--warn); }
.pill-brand { background: var(--brand-soft); color: var(--brand-deep); }
.pill-ok { background: #E9F3EA; color: #4C8C52; }
.pill-muted { background: var(--bg-soft); color: var(--muted); }
.pill-danger { background: var(--danger-soft); color: var(--danger); }

/* ---------------------------------------------------------------- 输入 */

.field { display: block; margin-top: 14px; }
.field-label {
  display: block; font-size: 13px; font-weight: 600;
  color: var(--text-2); margin-bottom: 7px;
}
.input, .textarea, .select {
  width: 100%; display: block;
  padding: 12px 14px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color .15s, background .15s;
  font-size: 15px;
}
.input:focus, .textarea:focus, .select:focus {
  border-color: var(--brand);
  background: #fff;
}
.input::placeholder, .textarea::placeholder { color: #B6BFB8; }
.textarea { min-height: 84px; resize: none; line-height: 1.55; }
.field-hint { font-size: 11.5px; color: var(--muted); margin-top: 6px; }
.field-error { font-size: 12px; color: var(--danger); margin-top: 6px; }

.seg {
  display: flex; gap: 4px; padding: 4px;
  background: var(--bg-soft); border-radius: var(--radius-full);
}
.seg-item {
  flex: 1 1 0; height: 34px; border-radius: var(--radius-full);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600; color: var(--text-2);
  transition: background .15s, color .15s, box-shadow .15s;
}
.seg-item.is-active { background: #fff; color: var(--brand-deep); box-shadow: var(--shadow-1); }

/* ---------------------------------------------------------------- 列表行 */

.rows { }
.row {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}
.row:last-child { border-bottom: 0; }
.row-main { flex: 1 1 auto; min-width: 0; }
.row-title { font-size: 14.5px; font-weight: 600; }
.row-desc { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.row-tail { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; color: var(--muted); }

/* ---------------------------------------------------------------- 头像 */

.avatar {
  flex: 0 0 auto;
  width: 40px; height: 40px; border-radius: var(--radius-full);
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--brand-soft); color: var(--brand-deep);
  font-size: 15px; font-weight: 700;
}
.avatar-lg { width: 54px; height: 54px; font-size: 19px; border-radius: 20px; }
.avatar-accent { background: var(--accent-soft); color: #B2743D; }

/* ---------------------------------------------------------------- 首页 */

.hero {
  margin-top: 6px;
  padding: 20px 18px;
  border-radius: var(--radius-lg);
  background: linear-gradient(150deg, #EFF6EA 0%, #FCF6EC 62%, #FBF8F3 100%);
  border: 1px solid var(--brand-line);
}
.hero-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.hero-hi { font-size: 20px; font-weight: 700; letter-spacing: .2px; }
.hero-sub { font-size: 13px; color: var(--text-2); margin-top: 5px; }
.hero-actions { display: flex; gap: 10px; margin-top: 16px; }

.board {
  margin-top: 12px;
  border-radius: var(--radius);
  border: 1px solid var(--brand-line);
  background: var(--surface);
  overflow: hidden;
  box-shadow: var(--shadow-1);
}
.board-head {
  display: flex; align-items: center; gap: 8px;
  padding: 14px 16px;
  background: linear-gradient(120deg, #EAF4E5, #F8F5EC);
}
.board-head-title { font-size: 15px; font-weight: 700; flex: 1 1 auto; }
.board-body { padding: 4px 16px 14px; }

.ticket {
  padding: 13px 0;
  border-bottom: 1px dashed var(--line-strong);
}
.ticket:last-child { border-bottom: 0; padding-bottom: 4px; }
.ticket-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.ticket-who { font-size: 13.5px; font-weight: 700; }
.ticket-time { font-size: 11.5px; color: var(--muted); margin-left: auto; }
.ticket-dishes { display: flex; flex-wrap: wrap; gap: 6px; }
.ticket-note {
  margin-top: 8px; padding: 8px 10px;
  background: var(--bg-soft); border-radius: 10px;
  font-size: 12.5px; color: var(--text-2);
}
.ticket-actions { display: flex; gap: 8px; margin-top: 11px; }

.quick-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.quick {
  display: flex; flex-direction: column; gap: 6px;
  padding: 15px 16px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-1);
  text-align: left;
  transition: transform .12s;
}
.quick:active { transform: scale(.98); }
.quick-ico {
  width: 34px; height: 34px; border-radius: 11px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--brand-soft); color: var(--brand-deep);
}
.quick-ico.accent { background: var(--accent-soft); color: #B2743D; }
.quick-title { font-size: 14px; font-weight: 700; margin-top: 2px; }
.quick-desc { font-size: 12px; color: var(--muted); }

.rail {
  display: flex; gap: 10px; overflow-x: auto;
  padding: 2px 16px 6px; margin: 0 -16px;
  scrollbar-width: none;
}
.rail::-webkit-scrollbar { display: none; }
.rail-item {
  flex: 0 0 auto;
  min-width: 112px; padding: 13px 14px;
  border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line);
  box-shadow: var(--shadow-1);
  display: flex; flex-direction: column; gap: 8px;
  text-align: left;
}
.rail-item:active { transform: scale(.97); }
.rail-name { font-size: 13.5px; font-weight: 600; }
.rail-meta { font-size: 11.5px; color: var(--muted); }

/* ---------------------------------------------------------------- 点菜页 */

.menu-wrap { display: flex; gap: 12px; align-items: flex-start; margin-top: 6px; }
.cat-col {
  flex: 0 0 96px; position: sticky; top: 0;
  display: flex; flex-direction: column; gap: 4px;
  max-height: calc(100dvh - 250px); overflow-y: auto;
  scrollbar-width: none;
}
.cat-col::-webkit-scrollbar { display: none; }
.cat-item {
  padding: 10px 8px;
  border-radius: var(--radius-sm);
  text-align: left;
  font-size: 12.5px; font-weight: 600; color: var(--text-2);
  background: transparent;
  transition: background .15s, color .15s;
  display: flex; align-items: center; gap: 5px;
}
.cat-item.is-active { background: var(--surface); color: var(--brand-deep); box-shadow: var(--shadow-1); }
.cat-count { font-size: 10px; color: var(--muted); font-weight: 500; }

.dish-col { flex: 1 1 auto; min-width: 0; }
.dish-group-title {
  font-size: 13px; font-weight: 700; color: var(--text-2);
  margin: 14px 2px 8px;
}
.dish-group-title:first-child { margin-top: 2px; }

.dish-card {
  display: flex; gap: 12px; align-items: stretch;
  padding: 12px; margin-bottom: 10px;
  border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line);
  box-shadow: var(--shadow-1);
}
.dish-thumb {
  flex: 0 0 auto; width: 74px; height: 74px; border-radius: var(--radius-sm);
  overflow: hidden; background: var(--brand-soft);
  display: flex; align-items: center; justify-content: center;
  color: var(--brand-deep);
  position: relative;
}
.dish-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dish-thumb-lg {
  width: 100%; height: 210px; border-radius: var(--radius); font-size: 15px;
}
.dish-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.dish-name { font-size: 15px; font-weight: 700; }
.dish-desc {
  font-size: 12.5px; color: var(--muted); margin-top: 3px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.dish-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.dish-foot { display: flex; align-items: flex-end; justify-content: space-between; margin-top: auto; padding-top: 8px; }
.price { font-size: 15px; font-weight: 700; color: var(--accent); }
.price-unit { font-size: 11px; font-weight: 500; margin-right: 1px; }
.price-sm { font-size: 13.5px; }

/* 数量步进器 */
.qty { display: inline-flex; align-items: center; gap: 2px; }
.qty-btn {
  width: 28px; height: 28px; border-radius: var(--radius-full);
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--brand-soft); color: var(--brand-deep);
  transition: transform .12s;
}
.qty-btn:active { transform: scale(.9); }
.qty-btn.is-plus { background: var(--brand); color: #fff; }
.qty-btn.is-off { background: var(--bg-soft); color: #C3CCC4; pointer-events: none; }
.qty-num { min-width: 24px; text-align: center; font-size: 14px; font-weight: 700; }

/* ---------------------------------------------------------------- 购物车 */

.cart-bar {
  position: fixed; left: 12px; right: 12px;
  bottom: calc(var(--tab-h) + var(--safe-bottom) + 10px);
  z-index: 30;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px 10px 16px;
  border-radius: var(--radius-full);
  background: rgba(46, 58, 51, .96);
  color: #fff;
  box-shadow: var(--shadow-2);
  backdrop-filter: blur(10px);
  transition: transform .22s ease, opacity .22s;
}
.cart-bar.is-hidden { transform: translateY(140%); opacity: 0; pointer-events: none; }
.cart-bar-badge {
  position: relative; width: 40px; height: 40px; flex: 0 0 auto;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, .14);
  display: flex; align-items: center; justify-content: center;
}
.cart-bar-badge span {
  position: absolute; top: -3px; right: -3px;
  min-width: 18px; height: 18px; padding: 0 4px;
  border-radius: var(--radius-full);
  background: var(--accent); color: #fff;
  font-size: 10.5px; font-weight: 700; line-height: 18px; text-align: center;
}
.cart-bar-info { flex: 1 1 auto; min-width: 0; }
.cart-bar-sum { font-size: 14px; font-weight: 700; }
.cart-bar-tip { font-size: 11.5px; color: rgba(255, 255, 255, .62); margin-top: 1px; }
.cart-bar .btn { height: 38px; font-size: 14px; }

.cart-item {
  display: flex; gap: 12px; align-items: center;
  padding: 13px 16px; border-bottom: 1px solid var(--line);
}
.cart-item:last-child { border-bottom: 0; }
.cart-note {
  margin-top: 6px;
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11.5px; color: var(--brand-deep); background: var(--brand-soft);
  padding: 3px 9px; border-radius: var(--radius-full);
}

/* ---------------------------------------------------------------- 订单 */

.order-card { padding: 15px 16px; }
.order-head { display: flex; align-items: center; gap: 8px; }
.order-who { font-size: 14.5px; font-weight: 700; }
.order-time { font-size: 11.5px; color: var(--muted); margin-left: auto; }
.order-meal { font-size: 12px; color: var(--text-2); margin-top: 4px; }
.order-dishes { margin-top: 11px; display: flex; flex-direction: column; gap: 7px; }
.order-dish { display: flex; align-items: center; gap: 8px; font-size: 13.5px; }
.order-dish-name { flex: 1 1 auto; min-width: 0; }
.order-dish-qty { color: var(--muted); font-size: 12.5px; }
.order-note {
  margin-top: 10px; padding: 9px 11px; border-radius: 10px;
  background: var(--bg-soft); font-size: 12.5px; color: var(--text-2);
}
.order-foot { display: flex; align-items: center; gap: 8px; margin-top: 13px; }
.order-total { font-size: 12.5px; color: var(--muted); flex: 1 1 auto; }

/* ---------------------------------------------------------------- 空态 */

.empty {
  padding: 54px 24px; text-align: center;
}
.empty-ico {
  width: 62px; height: 62px; margin: 0 auto 16px;
  border-radius: 22px; background: var(--brand-soft); color: var(--brand-deep);
  display: flex; align-items: center; justify-content: center;
}
.empty-title { font-size: 15.5px; font-weight: 700; }
.empty-desc { font-size: 13px; color: var(--muted); margin-top: 7px; line-height: 1.6; }
.empty .btn { margin-top: 20px; }

/* ---------------------------------------------------------------- 遮罩层 */

.sheet-mask {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(38, 46, 40, .38);
  backdrop-filter: blur(2px);
  opacity: 0; transition: opacity .22s;
}
.sheet-mask.is-open { opacity: 1; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 61;
  max-height: 92dvh;
  display: flex; flex-direction: column;
  background: var(--bg);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  box-shadow: 0 -12px 40px rgba(46, 58, 51, .2);
  transform: translateY(102%);
  transition: transform .28s cubic-bezier(.22, .8, .3, 1);
  padding-bottom: var(--safe-bottom);
}
.sheet.is-open { transform: translateY(0); }
.sheet-grip {
  width: 38px; height: 4px; border-radius: 2px;
  background: var(--line-strong); margin: 10px auto 0;
}
.sheet-head {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 10px 10px 18px;
}
.sheet-title { font-size: 16.5px; font-weight: 700; flex: 1 1 auto; }
.sheet-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 4px 18px 18px; }
.sheet-foot {
  padding: 12px 18px calc(14px + var(--safe-bottom));
  border-top: 1px solid var(--line);
  background: var(--bg);
  display: flex; gap: 10px;
}
.sheet-foot .btn { flex: 1 1 0; }

.dialog {
  position: fixed; z-index: 61; left: 50%; top: 44%;
  transform: translate(-50%, -50%) scale(.94);
  width: min(320px, calc(100vw - 64px));
  background: var(--surface); border-radius: 22px;
  padding: 22px 20px 18px; text-align: center;
  box-shadow: var(--shadow-2);
  opacity: 0; transition: opacity .2s, transform .2s;
}
.dialog.is-open { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.dialog-title { font-size: 16px; font-weight: 700; }
.dialog-desc { font-size: 13.5px; color: var(--text-2); margin-top: 8px; line-height: 1.6; }
.dialog-actions { display: flex; gap: 10px; margin-top: 20px; }
.dialog-actions .btn { flex: 1 1 0; height: 42px; font-size: 14.5px; }

/* ---------------------------------------------------------------- Toast */

.toast-root {
  position: fixed; left: 0; right: 0; z-index: 80;
  top: calc(var(--safe-top) + 12px);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  pointer-events: none;
}
.toast {
  max-width: min(88vw, 360px);
  padding: 11px 16px;
  border-radius: var(--radius-full);
  background: rgba(46, 58, 51, .95);
  color: #fff; font-size: 13.5px; font-weight: 500;
  box-shadow: var(--shadow-2);
  transform: translateY(-14px); opacity: 0;
  transition: transform .22s ease, opacity .22s;
  display: flex; align-items: center; gap: 7px;
}
.toast.is-open { transform: translateY(0); opacity: 1; }
.toast.is-error { background: rgba(180, 84, 72, .96); }
.toast.is-ok { background: rgba(74, 122, 74, .96); }

/* ---------------------------------------------------------------- 登录 */

.auth {
  min-height: 100dvh;
  display: flex; flex-direction: column; justify-content: center;
  padding: 32px 26px calc(32px + var(--safe-bottom));
  background: linear-gradient(168deg, #F2F7EC 0%, #FCF7EE 46%, #FBF8F3 100%);
}
.auth-brand { text-align: center; }
.auth-mark {
  width: 82px; height: 82px; margin: 0 auto 18px;
  border-radius: 28px; background: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 10px 30px rgba(127, 176, 119, .22);
}
.auth-title { font-size: 23px; font-weight: 800; letter-spacing: .5px; }
.auth-sub { font-size: 13.5px; color: var(--text-2); margin-top: 9px; line-height: 1.7; }
.auth-card {
  margin-top: 30px; padding: 20px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-1);
}
.auth-note {
  margin-top: 16px; font-size: 12px; color: var(--muted);
  text-align: center; line-height: 1.7;
}
.wechat-btn {
  width: 100%; height: 50px; border-radius: var(--radius-full);
  background: var(--surface); color: #1AAD19;
  border: 1.5px solid rgba(26, 173, 25, .3);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 15.5px; font-weight: 600;
}
.wechat-btn:active { transform: scale(.98); background: rgba(26, 173, 25, .07); }

.auth-or {
  display: flex; align-items: center; gap: 12px;
  margin: 20px 0 16px;
  font-size: 12px; color: var(--muted);
}
.auth-or::before,
.auth-or::after {
  content: ''; flex: 1 1 auto; height: 1px;
  background: var(--line);
}
.auth-or span { flex: 0 0 auto; }

.code-display {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 16px; border-radius: var(--radius);
  background: var(--brand-soft); border: 1px dashed var(--brand);
}
.code-value {
  font-size: 27px; font-weight: 800; letter-spacing: 7px;
  color: var(--brand-deep); font-variant-numeric: tabular-nums;
  padding-left: 7px;
}

.invite-input {
  text-transform: uppercase; letter-spacing: 6px;
  text-align: center; font-size: 21px; font-weight: 700;
  height: 58px;
}

/* ---------------------------------------------------------------- 杂项 */

.divider { height: 1px; background: var(--line); margin: 14px 0; }
.stack { display: flex; flex-direction: column; gap: 8px; }
.inline { display: flex; align-items: center; gap: 8px; }
.inline-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.grow { flex: 1 1 auto; min-width: 0; }

.spinner {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .35);
  border-top-color: #fff;
  animation: spin .7s linear infinite;
}
.spinner-dark { border-color: rgba(90, 138, 83, .25); border-top-color: var(--brand-deep); }
@keyframes spin { to { transform: rotate(360deg); } }

.upload-box {
  height: 158px; border-radius: var(--radius);
  border: 1.5px dashed var(--line-strong);
  background: var(--surface-soft);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; color: var(--muted); font-size: 13px;
  overflow: hidden; position: relative;
}
.upload-box img { width: 100%; height: 100%; object-fit: cover; }
.upload-box.is-uploading { opacity: .7; }

.switch {
  flex: 0 0 auto; width: 46px; height: 28px; border-radius: var(--radius-full);
  background: var(--line-strong); position: relative; transition: background .2s;
}
.switch.is-on { background: var(--brand); }
.switch::after {
  content: ''; position: absolute; top: 3px; left: 3px;
  width: 22px; height: 22px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .18);
  transition: transform .2s;
}
.switch.is-on::after { transform: translateX(18px); }

@media (min-width: 560px) {
  body { background: #F1EDE6; }
  #app {
    max-width: 480px; margin: 0 auto;
    background: var(--bg);
    box-shadow: 0 0 0 1px var(--line);
  }
  .cart-bar { left: 50%; right: auto; width: min(456px, calc(100vw - 24px)); transform: translateX(-50%); }
  .cart-bar.is-hidden { transform: translateX(-50%) translateY(140%); }
  .sheet { max-width: 480px; left: 50%; right: auto; transform: translateX(-50%) translateY(102%); }
  .sheet.is-open { transform: translateX(-50%) translateY(0); }
  .toast-root { position: fixed; }
}
