/* ==========================================================================
   安安妈厨房 · 设计系统
   01 Tokens  02 Reset  03 Typography  04 Components  05 Screens  06 Responsive
   ========================================================================== */

/* --------------------------------------------------------------------------
   01 · TOKENS
   -------------------------------------------------------------------------- */
:root {
  /* --- 色彩：暖厨房（Warm Kitchen）--- */
  --paper: #fbf6ee;          /* 页面底色 · 米纸 */
  --paper-2: #f3eadc;        /* 次级底色 */
  --surface: #ffffff;        /* 卡片 */
  --surface-2: #fdfaf5;      /* 卡片次级 */

  --ink: #2b211b;            /* 主文字 */
  --ink-2: #6e5f55;          /* 次文字 */
  --ink-3: #9e8f86;          /* 辅助文字 */
  --ink-inv: #fffaf4;

  --line: #efe5d8;           /* 常规描边 */
  --line-2: #dfd2c1;         /* 强描边 */

  --brand: #d6452a;          /* 主色 · 柿子红 */
  --brand-2: #b9361d;        /* 主色按压 */
  --brand-soft: #fbe9e3;     /* 主色浅底 */
  --brand-ink: #8f2a14;      /* 主色文字 */

  --herb: #3e7a56;           /* 辅色 · 香葱绿 */
  --herb-soft: #e9f2eb;
  --herb-ink: #2c5a3e;

  --honey: #c98a20;          /* 点缀 · 蜜黄 */
  --honey-soft: #faf0dc;

  --danger: #c0392b;
  --danger-soft: #fbeae7;

  /* --- 字体 --- */
  --font-sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "HarmonyOS Sans SC",
    "Microsoft YaHei", "Segoe UI", Roboto, system-ui, sans-serif;
  --font-num: "SF Mono", "DIN Alternate", ui-monospace, "Menlo", monospace;

  --fs-11: 11px;  --fs-12: 12px;  --fs-13: 13px;  --fs-14: 14px;
  --fs-15: 15px;  --fs-16: 16px;  --fs-18: 18px;  --fs-20: 20px;
  --fs-24: 24px;  --fs-28: 28px;  --fs-34: 34px;

  /* --- 间距：4pt 栅格 --- */
  --s1: 4px;   --s2: 8px;   --s3: 12px;  --s4: 16px;
  --s5: 20px;  --s6: 24px;  --s7: 32px;  --s8: 40px;  --s9: 56px;

  /* --- 圆角 --- */
  --r-xs: 8px;  --r-sm: 11px;  --r-md: 15px;
  --r-lg: 20px; --r-xl: 26px;  --r-full: 999px;

  /* --- 阴影：暖调 --- */
  --sh-xs: 0 1px 2px rgba(78, 50, 30, .05);
  --sh-sm: 0 2px 6px -1px rgba(78, 50, 30, .08);
  --sh-md: 0 10px 24px -10px rgba(78, 50, 30, .22);
  --sh-lg: 0 26px 56px -22px rgba(78, 50, 30, .30);

  /* --- 动效 --- */
  --ease: cubic-bezier(.22, .68, .34, 1);
  --t-fast: 130ms var(--ease);
  --t-base: 220ms var(--ease);
  --t-slow: 380ms var(--ease);

  /* --- 布局 --- */
  --shell: 430px;
  --gutter: 20px;
  --tabbar-h: 66px;

  color: var(--ink);
  background: var(--paper);
  font-family: var(--font-sans);
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  text-size-adjust: 100%;
}

/* --------------------------------------------------------------------------
   02 · RESET
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
html { background: var(--paper); }
body { min-width: 320px; background: var(--paper); color: var(--ink); }

h1, h2, h3, h4, p, figure { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
img, svg { display: block; max-width: 100%; }

button, input, select, textarea { font: inherit; color: inherit; }
button { border: 0; background: none; cursor: pointer; -webkit-tap-highlight-color: transparent; }
input, select, textarea { appearance: none; }

:focus-visible {
  outline: 3px solid rgba(214, 69, 42, .38);
  outline-offset: 2px;
  border-radius: var(--r-xs);
}

::selection { background: var(--brand-soft); color: var(--brand-ink); }

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

/* --------------------------------------------------------------------------
   03 · TYPOGRAPHY
   -------------------------------------------------------------------------- */
.t-eyebrow {
  font-size: var(--fs-11);
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--brand);
}
.t-display {
  font-size: var(--fs-34);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -.035em;
}
.t-h1 { font-size: var(--fs-24); font-weight: 800; line-height: 1.2; letter-spacing: -.03em; }
.t-h2 { font-size: var(--fs-18); font-weight: 800; line-height: 1.3; letter-spacing: -.02em; }
.t-h3 { font-size: var(--fs-15); font-weight: 700; line-height: 1.35; }
.t-body { font-size: var(--fs-14); line-height: 1.65; }
.t-mini { font-size: var(--fs-12); line-height: 1.5; }
.t-num { font-family: var(--font-num); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }

.muted { color: var(--ink-2); }
.dim { color: var(--ink-3); }
.brand-text { color: var(--brand); }

/* --------------------------------------------------------------------------
   04 · COMPONENTS
   -------------------------------------------------------------------------- */

/* --- 图标 --- */
.ico { flex: 0 0 auto; }

/* --- 按钮 --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s2);
  min-height: 46px;
  padding: 0 var(--s5);
  border-radius: var(--r-sm);
  font-size: var(--fs-15);
  font-weight: 700;
  letter-spacing: -.01em;
  white-space: nowrap;
  transition: background var(--t-fast), color var(--t-fast),
              box-shadow var(--t-fast), transform var(--t-fast);
}
.btn:active:not(:disabled) { transform: scale(.97); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.btn--primary { background: var(--brand); color: var(--ink-inv); box-shadow: var(--sh-sm); }
.btn--soft { background: var(--brand-soft); color: var(--brand-ink); }
.btn--ghost { background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-2); }
.btn--quiet { background: var(--paper-2); color: var(--ink-2); }
.btn--danger { background: var(--danger-soft); color: var(--danger); }
.btn--block { width: 100%; }

.btn--sm { min-height: 38px; padding: 0 var(--s3); font-size: var(--fs-13); border-radius: var(--r-xs); }
.btn--icon {
  min-height: 42px; width: 42px; padding: 0;
  border-radius: var(--r-xs); color: var(--ink-2); background: transparent;
}
.btn--icon:hover { background: var(--paper-2); color: var(--ink); }

.btn--circle {
  width: 38px; min-height: 38px; padding: 0;
  border-radius: var(--r-full);
  background: var(--brand); color: var(--ink-inv);
  box-shadow: 0 4px 12px -4px rgba(214, 69, 42, .55);
}

@media (hover: hover) {
  .btn--primary:hover { background: var(--brand-2); box-shadow: var(--sh-md); }
  .btn--soft:hover { background: #f7dbd2; }
  .btn--ghost:hover { background: var(--surface-2); }
  .btn--quiet:hover { background: #ece1d1; }
  .btn--danger:hover { background: #f6d9d4; }
  .btn--circle:hover { background: var(--brand-2); transform: scale(1.06); }
}

/* --- 表单 --- */
.field { display: grid; gap: var(--s2); }
.field > label {
  font-size: var(--fs-12);
  font-weight: 800;
  letter-spacing: .03em;
  color: var(--ink-2);
}
.input, .field input, .field select, .field textarea {
  width: 100%;
  min-height: 48px;
  padding: var(--s3) var(--s4);
  border: 1.5px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  font-size: var(--fs-15);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.field textarea { min-height: 104px; resize: vertical; line-height: 1.7; }
.input::placeholder, .field input::placeholder, .field textarea::placeholder { color: var(--ink-3); }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(214, 69, 42, .12);
}
.field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%236e5f55' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 9.5l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 42px;
}
.field input[type="file"] {
  padding: var(--s2) var(--s3);
  font-size: var(--fs-13);
  background: var(--surface-2);
}
.field input[type="file"]::file-selector-button {
  margin-right: var(--s3);
  padding: 8px 14px;
  border: 0;
  border-radius: var(--r-xs);
  background: var(--brand-soft);
  color: var(--brand-ink);
  font-size: var(--fs-13);
  font-weight: 700;
  cursor: pointer;
}
.form { display: grid; gap: var(--s4); }
.form-note {
  padding: var(--s3);
  border-radius: var(--r-xs);
  background: var(--paper-2);
  color: var(--ink-2);
  font-size: var(--fs-12);
  line-height: 1.6;
}
.check {
  display: flex; align-items: center; gap: var(--s3);
  padding: var(--s3) var(--s4);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--line);
  font-size: var(--fs-14); font-weight: 600;
  cursor: pointer;
}
.check input { width: 20px; height: 20px; accent-color: var(--brand); }

/* --- 标签 / 徽标 --- */
.pill {
  display: inline-flex; align-items: center; gap: 5px;
  max-width: 100%;
  height: 24px; padding: 0 10px;
  border-radius: var(--r-full);
  font-size: var(--fs-11); font-weight: 800;
  letter-spacing: .02em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  background: var(--paper-2); color: var(--ink-2);
}
.pill--brand { background: var(--brand-soft); color: var(--brand-ink); }
.pill--herb { background: var(--herb-soft); color: var(--herb-ink); }
.pill--honey { background: var(--honey-soft); color: var(--honey); }
.pill--mute { background: var(--paper-2); color: var(--ink-3); }

/* --- 头像 --- */
.avatar {
  width: 40px; height: 40px; flex: 0 0 auto;
  display: grid; place-items: center;
  border-radius: var(--r-full);
  background: var(--brand-soft);
  color: var(--brand-ink);
  font-size: var(--fs-15); font-weight: 800;
}
.avatar--herb { background: var(--herb-soft); color: var(--herb-ink); }

/* --- 步进器 --- */
.stepper {
  display: inline-flex; align-items: center; gap: 2px;
  padding: 3px;
  border-radius: var(--r-full);
  background: var(--brand-soft);
}
.stepper button {
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border-radius: var(--r-full);
  color: var(--brand-ink);
  transition: background var(--t-fast);
}
.stepper button:hover { background: rgba(214, 69, 42, .14); }
.stepper .qty {
  min-width: 26px; text-align: center;
  font-family: var(--font-num); font-size: var(--fs-15); font-weight: 700;
  color: var(--brand-ink);
}

/* --- 分段控件 --- */
.seg {
  display: flex; gap: 4px; padding: 4px;
  border-radius: var(--r-sm);
  background: var(--paper-2);
}
.seg button {
  flex: 1; min-height: 36px;
  border-radius: var(--r-xs);
  font-size: var(--fs-13); font-weight: 700;
  color: var(--ink-2);
  transition: background var(--t-fast), color var(--t-fast);
}
.seg button.is-active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--sh-xs);
}

/* --- 分类条形选择 --- */
.chipbar {
  display: flex; gap: var(--s2);
  overflow-x: auto; scrollbar-width: none;
  padding: 2px 0 6px;
}
.chipbar::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto;
  min-height: 36px; padding: 0 15px;
  border-radius: var(--r-full);
  font-size: var(--fs-13); font-weight: 700;
  color: var(--ink-2);
  background: rgba(255, 255, 255, .72);
  box-shadow: inset 0 0 0 1px var(--line);
  transition: all var(--t-fast);
}
.chip.is-active {
  color: var(--ink-inv);
  background: var(--ink);
  box-shadow: 0 6px 16px -7px rgba(43, 33, 27, .7);
}

/* --- 卡片基类 --- */
.card {
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-sm);
}

/* --- 媒体 --- */
.media {
  position: relative;
  overflow: hidden;
  background: linear-gradient(150deg, #f4ece0, #ece0d0);
  border-radius: var(--r-md);
}
.media img { width: 100%; height: 100%; object-fit: cover; }
.media--fallback { display: grid; place-items: center; color: #c2ae99; }

/* --- 空状态 --- */
.empty {
  display: grid; justify-items: center; gap: var(--s3);
  padding: var(--s8) var(--s5);
  text-align: center;
  border-radius: var(--r-lg);
  background: rgba(255, 255, 255, .55);
  box-shadow: inset 0 0 0 1px var(--line);
}
.empty-ico {
  width: 60px; height: 60px;
  display: grid; place-items: center;
  border-radius: var(--r-full);
  background: var(--paper-2);
  color: #b8a595;
}
.empty h3 { font-size: var(--fs-15); font-weight: 800; }
.empty p { font-size: var(--fs-13); color: var(--ink-3); max-width: 30ch; line-height: 1.6; }

/* --- 骨架 --- */
@keyframes shimmer { to { background-position: -200% 0; } }
.skeleton {
  background: linear-gradient(90deg, #f1e9de 25%, #faf5ee 50%, #f1e9de 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
  border-radius: var(--r-sm);
}

/* --- 底部导航 --- */
.tabbar {
  position: fixed; z-index: 20; bottom: 0; left: 50%;
  transform: translateX(-50%);
  width: min(var(--shell), 100%);
  display: grid; grid-template-columns: 1fr 1fr;
  gap: var(--s2);
  padding: var(--s2) var(--gutter) calc(var(--s2) + env(safe-area-inset-bottom));
  background: rgba(253, 250, 245, .9);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  box-shadow: 0 -1px 0 var(--line), 0 -18px 30px -24px rgba(78, 50, 30, .5);
}
.tabbar button {
  position: relative;
  min-height: 52px;
  display: grid; place-items: center; gap: 3px;
  border-radius: var(--r-sm);
  font-size: var(--fs-11); font-weight: 800;
  color: var(--ink-3);
  transition: color var(--t-fast), background var(--t-fast);
}
.tabbar button.is-active { color: var(--brand); background: var(--brand-soft); }
.tabbar .badge {
  position: absolute; top: 4px; left: 50%; margin-left: 6px;
  min-width: 19px; height: 19px; padding: 0 5px;
  display: grid; place-items: center;
  border-radius: var(--r-full);
  background: var(--brand); color: var(--ink-inv);
  font-family: var(--font-num); font-size: 10px; font-weight: 700;
  box-shadow: 0 0 0 2px rgba(253, 250, 245, .95);
}

/* --- Toast --- */
.toast-root {
  position: fixed; z-index: 60; left: 0; right: 0;
  bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 12px);
  display: grid; justify-items: center; gap: var(--s2);
  padding: 0 var(--s5);
  pointer-events: none;
}
.toast {
  max-width: 460px;
  display: flex; align-items: center; gap: var(--s3);
  padding: 13px var(--s4);
  border-radius: var(--r-md);
  background: var(--ink);
  color: var(--ink-inv);
  font-size: var(--fs-13); font-weight: 600;
  box-shadow: var(--sh-lg);
  animation: toast-in var(--t-base) both;
}
.toast--error { background: #8f2018; }
.toast--success { background: var(--herb-ink); }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(14px) scale(.96); }
  to   { opacity: 1; transform: none; }
}

/* --- 抽屉 / 弹层 --- */
.sheet-backdrop {
  position: fixed; z-index: 40; inset: 0;
  display: grid; align-items: end;
  background: rgba(43, 33, 27, .44);
  backdrop-filter: blur(3px);
  animation: fade-in var(--t-fast) both;
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

.sheet {
  position: relative;
  max-height: 90vh; overflow-y: auto;
  overscroll-behavior: contain;
  padding: var(--s2) var(--gutter) calc(var(--s6) + env(safe-area-inset-bottom));
  background: var(--paper);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  box-shadow: var(--sh-lg);
  animation: sheet-up var(--t-base) both;
}
@keyframes sheet-up {
  from { transform: translateY(26px); opacity: .6; }
  to   { transform: none; opacity: 1; }
}
.sheet-grip {
  width: 40px; height: 4px; margin: 0 auto var(--s4);
  border-radius: var(--r-full);
  background: var(--line-2);
}
.sheet-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: var(--s3); margin-bottom: var(--s5);
}
.sheet-head h2 { font-size: var(--fs-20); font-weight: 800; letter-spacing: -.025em; }
.sheet-head p { margin-top: 4px; font-size: var(--fs-13); color: var(--ink-2); }

/* --- 全屏页（制作方法）--- */
.page-backdrop { align-items: stretch; }
.page {
  max-height: 100dvh; min-height: 100dvh;
  border-radius: 0;
  padding-top: calc(var(--s5) + env(safe-area-inset-top));
}

/* --------------------------------------------------------------------------
   05 · SCREENS
   -------------------------------------------------------------------------- */

/* ===== 登录 ===== */
.auth {
  min-height: 100dvh;
  display: grid;
  align-content: center;
  gap: var(--s6);
  padding: var(--s8) var(--gutter) calc(var(--s8) + env(safe-area-inset-bottom));
  background:
    radial-gradient(120% 60% at 12% -8%, rgba(214, 69, 42, .16), transparent 62%),
    radial-gradient(90% 50% at 96% 6%, rgba(201, 138, 32, .16), transparent 60%),
    var(--paper);
}
.auth-inner { width: min(var(--shell), 100%); max-width: var(--shell); margin: 0 auto; display: grid; gap: var(--s6); }

.brandline { display: flex; align-items: center; gap: var(--s3); }
.brand-mark {
  width: 42px; height: 42px; flex: 0 0 auto;
  display: grid; place-items: center;
  border-radius: 13px;
  background: linear-gradient(150deg, #e2542f, #b9361d);
  color: #fff; font-size: var(--fs-20); font-weight: 800;
  box-shadow: 0 8px 18px -8px rgba(185, 54, 29, .85);
}
.brand-name { font-size: var(--fs-15); font-weight: 800; letter-spacing: -.01em; }
.brand-sub { font-size: var(--fs-12); color: var(--ink-3); margin-top: 1px; }

.auth-hero { display: grid; gap: var(--s3); }
.auth-hero p { max-width: 26ch; }

.auth-card {
  padding: var(--s6) var(--s5) var(--s5);
  background: var(--surface);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-lg);
}
.auth-card .form { margin-top: var(--s5); }
.form-error {
  min-height: 20px;
  font-size: var(--fs-13);
  font-weight: 600;
  color: var(--danger);
}

/* ===== 应用外壳 ===== */
.shell {
  width: min(var(--shell), 100%); max-width: var(--shell);
  min-height: 100dvh; margin: 0 auto;
  padding-bottom: calc(var(--tabbar-h) + var(--s8) + env(safe-area-inset-bottom));
}
.appbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--s3);
  padding: var(--s5) var(--gutter) var(--s4);
}
.content { padding: 0 var(--gutter); }
.shell--checkout { padding-bottom: calc(var(--tabbar-h) + 124px + env(safe-area-inset-bottom)); }

/* ===== 菜单页 ===== */
.hero {
  position: relative; overflow: hidden;
  padding: var(--s5);
  border-radius: var(--r-xl);
  background: linear-gradient(135deg, #fbe9e3 0%, #faf1e0 52%, #f4f7ee 100%);
  box-shadow: var(--sh-sm);
}
.hero::after {
  content: "";
  position: absolute; right: -46px; top: -58px;
  width: 168px; height: 168px; border-radius: 50%;
  background: rgba(255, 255, 255, .55);
}
.hero::before {
  content: "";
  position: absolute; right: 34px; bottom: -66px;
  width: 122px; height: 122px; border-radius: 50%;
  background: rgba(214, 69, 42, .10);
}
.hero > * { position: relative; z-index: 1; }
.hero h1 { margin: var(--s3) 0 var(--s2); }
.hero-stats { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: var(--s4); }

.catbar {
  position: sticky; top: 0; z-index: 10;
  margin: 0 calc(var(--gutter) * -1) var(--s4);
  padding: var(--s4) var(--gutter) var(--s2);
  background: linear-gradient(var(--paper) 62%, rgba(251, 246, 238, .82) 88%, transparent);
}

.sec-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: var(--s3); margin-bottom: var(--s3);
}
.sec-head p { font-size: var(--fs-13); color: var(--ink-3); }

.dish-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s4) var(--s3);
}
.dish {
  display: flex; flex-direction: column;
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: var(--s2);
  box-shadow: var(--sh-xs);
  transition: box-shadow var(--t-base), transform var(--t-base), box-shadow var(--t-base);
}
@media (hover: hover) {
  .dish:hover { transform: translateY(-3px); box-shadow: var(--sh-md); }
}
.dish.is-picked { box-shadow: inset 0 0 0 2px var(--brand), var(--sh-sm); }
.dish-media { position: relative; }
.dish .media { aspect-ratio: 1 / 1; }
.dish-tag {
  position: absolute; left: var(--s2); bottom: var(--s2);
  max-width: calc(100% - var(--s4));
  padding: 4px 9px;
  border-radius: var(--r-full);
  background: rgba(43, 33, 27, .62);
  backdrop-filter: blur(6px);
  color: #fff; font-size: var(--fs-11); font-weight: 700;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dish-info {
  flex: 1 1 auto;
  display: grid;
  grid-template-rows: 1fr auto;
  gap: var(--s3);
  padding: var(--s3) var(--s2) var(--s2);
}
.dish-name {
  font-size: var(--fs-15); font-weight: 800; line-height: 1.35;
  letter-spacing: -.015em;
  overflow-wrap: anywhere;
}
.dish-foot {
  display: flex; align-items: center; justify-content: flex-end;
  min-height: 36px;
}
.dish .stepper button { width: 26px; height: 26px; }
.dish .stepper .qty { min-width: 22px; font-size: var(--fs-14); }
.dish-off { opacity: .55; }

/* ===== 购物车 ===== */
.list { display: grid; gap: var(--s2); }
.list-row {
  display: flex; align-items: center; gap: var(--s3);
  padding: var(--s3);
  background: var(--surface);
  border-radius: var(--r-md);
  box-shadow: var(--sh-xs);
}
.list-row .media { width: 58px; height: 58px; flex: 0 0 auto; border-radius: var(--r-sm); }
.list-main { min-width: 0; flex: 1; display: grid; gap: 3px; }
.list-title {
  font-size: var(--fs-15); font-weight: 800; letter-spacing: -.01em; line-height: 1.35;
  overflow-wrap: anywhere;
}
.list-meta { font-size: var(--fs-12); color: var(--ink-3); }

.checkout {
  position: fixed; z-index: 30; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  left: 50%; transform: translateX(-50%);
  width: min(var(--shell), 100%);
  padding: var(--s3) var(--gutter) var(--s3);
  background: linear-gradient(rgba(251, 246, 238, 0), var(--paper) 34%);
}
.checkout-inner {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s4);
  padding: var(--s3) var(--s3) var(--s3) var(--s4);
  border-radius: var(--r-lg);
  background: var(--ink);
  color: var(--ink-inv);
  box-shadow: var(--sh-lg);
}
.checkout-inner .sum { display: grid; gap: 2px; }
.checkout-inner .sum-num { font-family: var(--font-num); font-size: var(--fs-20); font-weight: 700; }
.checkout-inner .sum-label { font-size: var(--fs-11); color: rgba(255, 250, 244, .62); letter-spacing: .04em; }
.checkout .btn--primary { background: var(--brand); box-shadow: none; }

.note-field { margin-top: var(--s5); }

/* ===== 管理端 ===== */
.stats {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s3); margin-bottom: var(--s5);
}
.stat {
  padding: var(--s4);
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: var(--sh-xs);
}
.stat-num { font-family: var(--font-num); font-size: var(--fs-24); font-weight: 700; letter-spacing: -.03em; }
.stat-label { margin-top: 3px; font-size: var(--fs-12); color: var(--ink-3); font-weight: 600; }
.stat--brand { background: linear-gradient(140deg, #fbe9e3, #fdf5f2); }
.stat--brand .stat-num { color: var(--brand-ink); }
.stat--herb { background: linear-gradient(140deg, #e9f2eb, #f6faf7); }
.stat--herb .stat-num { color: var(--herb-ink); }

.admin-tabs {
  position: sticky; top: 0; z-index: 10;
  margin: 0 calc(var(--gutter) * -1) var(--s5);
  padding: var(--s3) var(--gutter);
  background: linear-gradient(var(--paper) 68%, rgba(251, 246, 238, .8) 90%, transparent);
}

.board {
  padding: var(--s4);
  border-radius: var(--r-lg);
  background: linear-gradient(140deg, #fdfaf5, #f7f0e5);
  box-shadow: inset 0 0 0 1px var(--line);
}
.board-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--s3); margin-bottom: var(--s3);
}
.board-row {
  width: 100%;
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--s3);
  padding: 11px 0;
  border-bottom: 1px dashed var(--line-2);
  text-align: left;
  font-size: var(--fs-14);
}
.board-row:last-child { border-bottom: 0; padding-bottom: 0; }
.board-row .name { font-weight: 700; flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.board-qty {
  flex: 0 0 auto;
  min-width: 34px; text-align: center;
  font-family: var(--font-num); font-weight: 700;
  color: var(--brand-ink);
}
.board-row:hover .name { color: var(--brand); }

.order {
  padding: var(--s4);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--sh-xs);
}
.order-head { display: flex; align-items: center; gap: var(--s3); }
.order-head .who { min-width: 0; flex: 1; }
.order-name { font-size: var(--fs-15); font-weight: 800; }
.order-time { display: flex; align-items: center; gap: 5px; margin-top: 3px; font-size: var(--fs-12); color: var(--ink-3); }
.order-items {
  margin-top: var(--s4); padding-top: var(--s3);
  border-top: 1px dashed var(--line-2);
  display: grid; gap: var(--s2);
}
.order-item {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s3);
  font-size: var(--fs-14);
}
.order-item .n { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; color: var(--ink); }
.order-item .q { flex: 0 0 auto; font-family: var(--font-num); font-weight: 700; color: var(--ink-2); }
.order-note {
  display: flex; gap: var(--s2);
  margin-top: var(--s3); padding: var(--s3);
  border-radius: var(--r-xs);
  background: var(--honey-soft);
  color: #7a5310;
  font-size: var(--fs-13); line-height: 1.55;
}
.order-foot { display: flex; justify-content: space-between; align-items: center; gap: var(--s3); margin-top: var(--s4); }

.panel {
  padding: 0 var(--s4);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--sh-xs);
}
.row {
  display: flex; align-items: center; gap: var(--s3);
  padding: var(--s4) 0;
  border-bottom: 1px solid var(--line);
}
.row:last-child { border-bottom: 0; }
.row-main { min-width: 0; flex: 1; display: grid; gap: 3px; }
.row-title { font-size: var(--fs-15); font-weight: 800; letter-spacing: -.01em; overflow-wrap: anywhere; }
.row-meta { font-size: var(--fs-12); color: var(--ink-3); }
.row-actions { display: flex; gap: var(--s2); flex: 0 0 auto; }
.row .media { width: 48px; height: 48px; flex: 0 0 auto; border-radius: var(--r-xs); }

.recipe-body {
  margin-top: var(--s5); padding: var(--s4);
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: var(--sh-xs);
}
.recipe-body p {
  margin-top: var(--s3);
  font-size: var(--fs-15); line-height: 1.9;
  white-space: pre-line;
}
.ingredient-list, .purchase-list { display: grid; gap: 8px; margin-top: 12px; }
.ingredient-row, .purchase-row { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px dashed var(--line-2); font-size: var(--fs-14); }
.ingredient-row:last-child, .purchase-row:last-child { border-bottom: 0; }
.ingredient-row strong, .purchase-row strong { color: var(--brand-ink); font-family: var(--font-num); }
.recipe-hero { aspect-ratio: 4 / 3; }

.recipe-cta {
  width: 100%;
  display: flex; align-items: center; justify-content: space-between; gap: var(--s3);
  padding: var(--s4);
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: var(--sh-xs);
  text-align: left;
  transition: box-shadow var(--t-fast);
}
.recipe-cta:hover { box-shadow: var(--sh-md); }

/* --------------------------------------------------------------------------
   06 · RESPONSIVE
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
