﻿/* 咱家点菜 · 全部样式，无外部字体与资源依赖 */

:root {
  --cream: #f7f3ec;
  --cream-deep: #efe8dc;
  --surface: #fffdf8;
  --surface-soft: #f8f3ea;
  --ink: #23322d;
  --ink-soft: #46564f;
  --muted: #65726b;
  --line: #e9e1d5;
  --line-strong: #dbd1c2;
  --brand: #2e5b4d;
  --brand-deep: #23473c;
  --brand-soft: #e6efe9;
  --accent: #d98a55;
  --accent-deep: #b96734;
  --accent-soft: #fae8d9;
  --gold: #f0d2a8;
  --danger: #a84436;
  --danger-soft: #f9e7e3;
  --success: #2e6b54;
  --shadow-sm: 0 2px 8px rgba(46, 54, 43, 0.04);
  --shadow: 0 12px 36px rgba(54, 62, 48, 0.08);
  --shadow-lg: 0 24px 70px rgba(32, 46, 39, 0.2);
  --radius-sm: 12px;
  --radius: 20px;
  --radius-lg: 26px;
  --tabbar-height: 68px;
  --font: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", "Noto Sans CJK SC", "Segoe UI", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  padding: 0;
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  background-color: var(--cream);
  background-image:
    radial-gradient(80% 48% at 102% -4%, rgba(223, 172, 123, 0.18) 0%, transparent 62%),
    radial-gradient(64% 40% at -16% 20%, rgba(122, 158, 139, 0.12) 0%, transparent 70%),
    linear-gradient(180deg, #faf7f1 0%, var(--cream) 46%, #f4eee4 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.modal-open {
  overflow: hidden;
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  border: 0;
  background: none;
  cursor: pointer;
}

a {
  color: var(--brand);
}

svg {
  display: block;
}

[hidden] {
  display: none !important;
}

::selection {
  color: #fff;
  background: var(--brand);
}

:focus-visible {
  outline: 3px solid rgba(202, 124, 67, 0.7);
  outline-offset: 2px;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 999;
  padding: 10px 16px;
  color: #fff;
  background: var(--brand-deep);
  border-radius: 10px;
  transform: translateY(-160%);
  transition: transform 0.15s ease;
}

.skip-link:focus {
  transform: translateY(0);
}

/* ---------------- 顶栏 ---------------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  padding-top: env(safe-area-inset-top);
  background: rgba(250, 247, 241, 0.86);
  border-bottom: 1px solid rgba(222, 213, 200, 0.58);
  -webkit-backdrop-filter: blur(18px) saturate(130%);
  backdrop-filter: blur(18px) saturate(130%);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: min(100%, 960px);
  height: 66px;
  margin: 0 auto;
  padding: 0 18px;
}

.brand {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 11px;
}

.brand-mark {
  display: grid;
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  place-items: center;
  color: #f6ead8;
  background: var(--brand);
  border-radius: 14px;
  box-shadow: 0 6px 16px rgba(35, 71, 60, 0.2);
  transform: rotate(-2deg);
}

.brand-mark svg {
  width: 27px;
  height: 27px;
}

.brand-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.15;
}

.brand-text strong {
  overflow: hidden;
  font-size: 18px;
  font-weight: 750;
  letter-spacing: 0.015em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-text span {
  margin-top: 4px;
  overflow: hidden;
  color: var(--muted);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sync-pill {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 11px;
  gap: 7px;
  color: var(--ink-soft);
  font-size: 11.5px;
  font-weight: 600;
  background: rgba(255, 253, 248, 0.78);
  border: 1px solid var(--line);
  border-radius: 999px;
  white-space: nowrap;
}

.sync-dot {
  position: relative;
  width: 7px;
  height: 7px;
  background: #b79763;
  border-radius: 50%;
}

.sync-pill.is-online {
  color: #386550;
}

.sync-pill.is-online .sync-dot {
  background: #52a17c;
  box-shadow: 0 0 0 3px rgba(82, 161, 124, 0.13);
}

.sync-pill.is-connecting .sync-dot {
  animation: soft-pulse 1.5s ease-in-out infinite;
}

.sync-pill.is-offline {
  color: #97483d;
  background: #fcf1ee;
  border-color: #f0d4ce;
}

.sync-pill.is-offline .sync-dot {
  background: #bd6658;
}

.join-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0 13px;
  gap: 6px;
  color: var(--brand);
  font-size: 13px;
  font-weight: 650;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  transition: background 0.18s ease, border-color 0.18s ease;
}

.join-button svg {
  width: 18px;
  height: 18px;
}

.join-button:hover {
  background: var(--surface);
  border-color: var(--line-strong);
}

/* ---------------- 主区域 ---------------- */

.main {
  width: 100%;
  padding: 20px 16px calc(var(--tabbar-height) + 38px + env(safe-area-inset-bottom));
}

body.has-action .main {
  padding-bottom: calc(var(--tabbar-height) + 116px + env(safe-area-inset-bottom));
}

.view {
  width: min(100%, 960px);
  margin: 0 auto;
}

.page {
  animation: page-in 0.32s cubic-bezier(0.22, 0.8, 0.32, 1) both;
}

.page.no-anim {
  animation: none;
}

.page-order {
  max-width: 900px;
  margin: 0 auto;
}

.page-settings {
  max-width: 780px;
  margin: 0 auto;
}

.dayline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 1px 3px 14px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 550;
}

.dayline-left {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.dayline svg {
  width: 16px;
  height: 16px;
}

.dayline-note {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--ink-soft);
}

.live-dot {
  width: 6px;
  height: 6px;
  background: #65a989;
  border-radius: 50%;
}

/* ---------------- 通用卡片与按钮 ---------------- */

.card {
  background: rgba(255, 253, 248, 0.94);
  border: 1px solid rgba(230, 221, 208, 0.92);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.stack {
  display: grid;
  gap: 14px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.115em;
}

.eyebrow .step {
  display: inline-grid;
  width: 19px;
  height: 19px;
  margin-right: 4px;
  place-items: center;
  color: var(--brand);
  font-size: 10px;
  letter-spacing: 0;
  background: var(--brand-soft);
  border-radius: 50%;
  vertical-align: -3px;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  margin: 0 3px 12px;
}

.section-heading h2,
.section-heading h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 750;
  letter-spacing: -0.015em;
}

.section-heading p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12.5px;
}

.section-heading .inline-link {
  flex: 0 0 auto;
  min-height: 40px;
  padding: 0 2px;
  color: var(--brand);
  font-size: 13px;
  font-weight: 650;
}

.hint {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.6;
}

.hint-warm {
  color: #8a663b;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  gap: 7px;
  color: var(--ink);
  font-size: 14.5px;
  font-weight: 650;
  background: var(--surface-soft);
  border: 1px solid transparent;
  border-radius: 14px;
  white-space: nowrap;
  transition: transform 0.15s ease, background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.btn:active {
  transform: scale(0.985);
}

.btn:disabled {
  cursor: wait;
  opacity: 0.65;
  transform: none;
}

.btn svg {
  width: 19px;
  height: 19px;
}

.btn-primary {
  color: #fffdf8;
  background: var(--brand);
  border-color: var(--brand);
  box-shadow: 0 7px 16px rgba(46, 91, 77, 0.18);
}

.btn-primary:hover {
  background: var(--brand-deep);
  border-color: var(--brand-deep);
}

.btn-accent {
  color: #fff;
  background: var(--accent-deep);
  border-color: var(--accent-deep);
}

.btn-secondary {
  color: var(--brand);
  background: var(--surface);
  border-color: var(--line-strong);
}

.btn-secondary:hover {
  background: var(--surface-soft);
}

.btn-soft {
  color: var(--brand);
  background: var(--brand-soft);
  border-color: transparent;
}

.btn-ghost {
  color: var(--ink-soft);
  background: transparent;
}

.btn-danger {
  color: #fff;
  background: var(--danger);
  border-color: var(--danger);
}

.btn-danger-outline {
  color: var(--danger);
  background: transparent;
  border-color: #e7c8c1;
}

.btn-danger-outline:hover {
  background: var(--danger-soft);
}

.btn-block {
  width: 100%;
}

.btn-small {
  min-height: 40px;
  padding: 0 13px;
  font-size: 13px;
  border-radius: 11px;
}

.text-button {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 3px;
  gap: 4px;
  color: var(--brand);
  font-size: 13px;
  font-weight: 650;
}

.text-button svg {
  width: 17px;
  height: 17px;
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

/* ---------------- 厨师卡 ---------------- */

.chef-card {
  position: relative;
  overflow: hidden;
  padding: 21px 20px 19px;
  color: #fffdf8;
  background:
    radial-gradient(120% 100% at 100% 0%, rgba(218, 174, 118, 0.24) 0%, transparent 56%),
    linear-gradient(150deg, #356657 0%, #2a5446 44%, #24473d 100%);
  border: 0;
  border-radius: var(--radius-lg);
  box-shadow: 0 16px 40px rgba(38, 70, 59, 0.17);
}

.chef-card::before {
  content: "";
  position: absolute;
  top: -72px;
  right: -42px;
  width: 220px;
  height: 220px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  pointer-events: none;
}

.chef-card::after {
  content: "";
  position: absolute;
  top: -10px;
  right: 27px;
  width: 98px;
  height: 98px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 50%;
  pointer-events: none;
}

.chef-head {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.chef-card .eyebrow {
  color: #e9c99f;
}

.chef-card .eyebrow .step {
  color: #26473c;
  background: #e9c99f;
}

.chef-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  margin: 0;
  gap: 8px;
  color: #fffdf8;
  font-size: clamp(27px, 7.4vw, 34px);
  font-weight: 760;
  line-height: 1.15;
  letter-spacing: -0.025em;
}

.chef-title small {
  color: rgba(255, 253, 248, 0.8);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0;
}

.chef-sub {
  margin: 7px 0 0;
  color: rgba(255, 253, 248, 0.76);
  font-size: 13px;
}

.chef-medallion {
  display: grid;
  flex: 0 0 auto;
  width: 57px;
  height: 57px;
  place-items: center;
  color: #f0d2a8;
  background: rgba(255, 255, 255, 0.075);
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 18px;
  -webkit-backdrop-filter: blur(7px);
  backdrop-filter: blur(7px);
}

.chef-medallion svg {
  width: 30px;
  height: 30px;
}

.chef-chips {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  margin-top: 18px;
  gap: 8px;
}

.chef-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  min-height: 43px;
  padding: 0 15px;
  gap: 6px;
  color: rgba(255, 253, 248, 0.88);
  font-size: 14px;
  font-weight: 580;
  background: rgba(255, 255, 255, 0.075);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.chef-chip svg {
  width: 15px;
  height: 15px;
}

.chef-chip:hover {
  background: rgba(255, 255, 255, 0.13);
}

.chef-chip[aria-pressed="true"] {
  color: #29483d;
  font-weight: 700;
  background: var(--gold);
  border-color: var(--gold);
  box-shadow: 0 5px 16px rgba(17, 40, 31, 0.17);
}

.chef-chip.chip-add {
  min-width: 43px;
  padding: 0 12px;
  color: rgba(255, 253, 248, 0.56);
  background: transparent;
  border-style: dashed;
  border-color: rgba(255, 255, 255, 0.23);
}

.chef-empty-note {
  position: relative;
  z-index: 1;
  margin: 9px 1px 0;
  color: rgba(255, 253, 248, 0.72);
  font-size: 11.5px;
}

.chef-empty-note button {
  color: #f0d2a8;
  font-size: inherit;
  font-weight: 650;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------------- 点菜人 ---------------- */

.name-card {
  padding: 19px 20px 17px;
}

.name-card .section-heading {
  margin: 0 0 11px;
}

.name-card h2 {
  font-size: 19px;
}

.name-input-wrap {
  position: relative;
}

.name-input-wrap > svg {
  position: absolute;
  top: 50%;
  left: 16px;
  width: 20px;
  height: 20px;
  color: #9a958b;
  transform: translateY(-50%);
  pointer-events: none;
}

.name-input {
  width: 100%;
  height: 54px;
  padding: 0 16px 0 47px;
  color: var(--ink);
  font-size: 17px;
  font-weight: 600;
  background: var(--surface-soft);
  border: 1.5px solid transparent;
  border-radius: 15px;
  outline: none;
  transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.name-input::placeholder {
  color: #8f877c;
  font-weight: 400;
}

.name-input:focus {
  background: #fff;
  border-color: #93b2a3;
  box-shadow: 0 0 0 4px rgba(83, 129, 108, 0.1);
}

.name-input.is-invalid {
  background: #fff8f6;
  border-color: #d59d91;
}

.quick-names {
  display: flex;
  flex-wrap: wrap;
  margin-top: 10px;
  gap: 7px;
}

.name-chip {
  min-height: 40px;
  padding: 0 13px;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 570;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.name-chip[aria-pressed="true"] {
  color: var(--brand);
  background: var(--brand-soft);
  border-color: #c7dbcf;
}

/* ---------------- 选菜 ---------------- */

.dishes-section {
  margin-top: 21px;
}

.category-tabs {
  display: flex;
  flex-wrap: wrap;
  margin: 0 0 13px;
  padding: 0;
  gap: 6px;
}

.category-tab {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  min-height: 43px;
  padding: 0 12px;
  gap: 5px;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 600;
  background: rgba(255, 253, 248, 0.74);
  border: 1px solid var(--line);
  border-radius: 999px;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.category-tab span {
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 550;
}

.category-tab[aria-pressed="true"] {
  color: #fffdf8;
  background: var(--brand);
  border-color: var(--brand);
}

.category-tab[aria-pressed="true"] span {
  color: rgba(255, 253, 248, 0.6);
}

.dish-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 9px;
}

.dish-card {
  display: flex;
  align-items: center;
  min-height: 78px;
  padding: 13px 13px 13px 15px;
  gap: 12px;
  background: rgba(255, 253, 248, 0.9);
  border: 1px solid rgba(231, 222, 209, 0.95);
  border-radius: 17px;
  transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.dish-card.is-picked {
  background: #fffdf9;
  border-color: #a9c5b5;
  box-shadow: 0 3px 14px rgba(58, 99, 79, 0.07);
}

.dish-info {
  min-width: 0;
  flex: 1;
}

.dish-cat {
  display: block;
  margin-bottom: 3px;
  color: #847b6d;
  font-size: 10.5px;
  font-weight: 650;
  letter-spacing: 0.08em;
}

.dish-name {
  overflow-wrap: anywhere;
  margin: 0;
  font-size: 16.5px;
  font-weight: 680;
  line-height: 1.35;
  letter-spacing: -0.01em;
}

.dish-tags {
  display: flex;
  flex-wrap: wrap;
  margin-top: 5px;
  gap: 4px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 0 7px;
  color: #766f63;
  font-size: 10.5px;
  font-weight: 550;
  line-height: 1;
  background: #f2ece2;
  border-radius: 6px;
}

.tag-spicy {
  color: #a24f30;
  background: #fbe7dc;
}

.tag-herb {
  color: #4e6d4b;
  background: #e8f0e4;
}

.tag-allergen {
  color: #8b6728;
  background: #f8efd9;
}

.tag-light {
  color: #4a6c5d;
  background: #e8f1ec;
}

.tag-more {
  color: var(--muted);
  background: transparent;
}

.qty-control {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  padding: 2px;
  background: #f1ebe1;
  border-radius: 999px;
}

.qty-btn {
  display: grid;
  width: 39px;
  height: 39px;
  padding: 0;
  place-items: center;
  color: var(--brand);
  background: transparent;
  border-radius: 999px;
  transition: background 0.15s ease;
}

.qty-btn:hover {
  background: rgba(255, 255, 255, 0.8);
}

.qty-btn svg {
  width: 18px;
  height: 18px;
}

.qty-number {
  min-width: 24px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 750;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.dish-add {
  display: grid;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  padding: 0;
  place-items: center;
  color: #fffdf8;
  background: var(--brand);
  border-radius: 50%;
  box-shadow: 0 5px 13px rgba(46, 91, 77, 0.18);
  transition: transform 0.15s ease, background 0.15s ease;
}

.dish-add:hover {
  background: var(--brand-deep);
  transform: scale(1.04);
}

.dish-add:active {
  transform: scale(0.96);
}

.dish-add svg {
  width: 21px;
  height: 21px;
}

.empty-block {
  padding: 34px 22px;
  text-align: center;
  background: rgba(255, 253, 248, 0.5);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
}

.empty-block svg {
  width: 42px;
  height: 42px;
  margin: 0 auto 11px;
  color: #b5aa98;
}

.empty-block h3 {
  margin: 0;
  font-size: 17px;
}

.empty-block p {
  margin: 5px 0 14px;
  color: var(--muted);
  font-size: 12.5px;
}

/* ---------------- 已选菜 ---------------- */

.selected-card {
  margin-top: 17px;
  padding: 18px 19px 17px;
}

.selected-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 5px;
}

.selected-head h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 720;
}

.selected-head span {
  color: var(--muted);
  font-size: 11.5px;
}

.selected-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.selected-item {
  display: flex;
  align-items: center;
  padding: 10px 0;
  gap: 12px;
  border-bottom: 1px dashed #ece4d8;
}

.selected-item:last-child {
  border-bottom: 0;
}

.selected-item-name {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 14px;
  font-weight: 620;
}

.selected-item-qty {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.selected-remove {
  display: inline-flex;
  align-items: center;
  min-width: 44px;
  min-height: 40px;
  justify-content: center;
  margin-left: 5px;
  color: #8f8174;
  font-size: 11.5px;
  border-radius: 8px;
}

.selected-remove:hover {
  color: var(--danger);
  background: var(--danger-soft);
}

.note-label {
  display: block;
  margin: 12px 0 6px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 650;
}

.note-label span {
  color: var(--muted);
  font-weight: 400;
}

.note-input {
  display: block;
  width: 100%;
  min-height: 58px;
  padding: 11px 13px;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.5;
  resize: vertical;
  background: var(--surface-soft);
  border: 1.5px solid transparent;
  border-radius: 12px;
  outline: none;
}

.note-input::placeholder {
  color: #8f877c;
}

.note-input:focus {
  background: #fff;
  border-color: #a6beaf;
  box-shadow: 0 0 0 3px rgba(83, 129, 108, 0.08);
}

.edit-tip {
  display: flex;
  align-items: flex-start;
  margin-top: 12px;
  padding: 12px 13px;
  gap: 9px;
  color: #775d3b;
  font-size: 12px;
  line-height: 1.55;
  background: #fbf3e5;
  border: 1px solid #f0e1c8;
  border-radius: 12px;
}

.edit-tip svg {
  flex: 0 0 auto;
  width: 17px;
  height: 17px;
  margin-top: 1px;
}

.edit-tip button {
  min-height: 0;
  margin-left: auto;
  padding: 0;
  color: #8b6233;
  font-size: 12px;
  font-weight: 650;
  text-decoration: underline;
  text-underline-offset: 3px;
  white-space: nowrap;
}

/* ---------------- 已提交卡片 ---------------- */

.submitted-card {
  position: relative;
  overflow: hidden;
  padding: 22px 20px 19px;
}

.submitted-card::after {
  content: "";
  position: absolute;
  top: -55px;
  right: -55px;
  width: 150px;
  height: 150px;
  background: radial-gradient(circle, rgba(104, 157, 127, 0.14), transparent 70%);
  pointer-events: none;
}

.submitted-top {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  gap: 13px;
}

.success-mark {
  display: grid;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  margin-top: 2px;
  place-items: center;
  color: var(--success);
  background: #e9f3ec;
  border-radius: 50%;
}

.success-mark svg {
  width: 23px;
  height: 23px;
}

.submitted-card h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 760;
  letter-spacing: -0.02em;
}

.submitted-card .submitted-sub {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12.5px;
}

.submitted-items {
  display: flex;
  flex-wrap: wrap;
  margin: 16px 0 0;
  gap: 6px;
}

.submitted-pill {
  display: inline-flex;
  align-items: baseline;
  min-height: 31px;
  padding: 6px 10px;
  gap: 5px;
  color: var(--ink-soft);
  font-size: 12.5px;
  background: var(--surface-soft);
  border-radius: 9px;
}

.submitted-pill strong {
  color: var(--ink);
  font-weight: 650;
}

.submitted-pill em {
  color: var(--muted);
  font-size: 10.5px;
  font-style: normal;
}

.submitted-note {
  margin: 13px 0 0;
  padding: 9px 12px;
  color: #715b3d;
  font-size: 12px;
  background: #fbf4e8;
  border-radius: 10px;
}

.submitted-actions {
  display: flex;
  flex-wrap: wrap;
  margin-top: 17px;
  gap: 8px;
}

.submitted-actions .btn {
  min-height: 43px;
  padding: 0 15px;
  font-size: 13px;
  border-radius: 12px;
}

.summary-teaser {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 48px;
  margin-top: 14px;
  padding: 0 14px;
  gap: 10px;
  color: var(--brand);
  font-size: 15px;
  font-weight: 650;
  text-align: left;
  background: rgba(255, 253, 248, 0.6);
  border: 1px dashed #cfd8d0;
  border-radius: 15px;
}

.summary-teaser:hover {
  background: rgba(255, 253, 248, 0.92);
}

.summary-teaser svg {
  width: 19px;
  height: 19px;
}

.summary-teaser-count {
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 500;
}

/* ---------------- 提示条 ---------------- */

.notice {
  display: flex;
  align-items: flex-start;
  margin: 0 0 12px;
  padding: 11px 13px;
  gap: 9px;
  color: #795d36;
  font-size: 12.5px;
  line-height: 1.55;
  background: #fbf3e5;
  border: 1px solid #f0e0c6;
  border-radius: 13px;
}

.notice svg {
  flex: 0 0 auto;
  width: 17px;
  height: 17px;
  margin-top: 1px;
}

.notice strong {
  font-weight: 700;
}

.notice.is-neutral {
  color: var(--ink-soft);
  background: rgba(255, 253, 248, 0.7);
  border-color: var(--line);
}

.notice .notice-action {
  flex: 0 0 auto;
  margin-left: auto;
  color: inherit;
  font-size: inherit;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
  white-space: nowrap;
}

/* ---------------- 汇总 ---------------- */

.summary-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 15px;
  margin: 2px 3px 17px;
}

.summary-header h1 {
  margin: 0;
  font-size: clamp(27px, 7.2vw, 34px);
  font-weight: 770;
  line-height: 1.2;
  letter-spacing: -0.035em;
}

.summary-header p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12.5px;
}

.summary-date-mark {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

.summary-chef {
  display: flex;
  align-items: center;
  padding: 16px 18px;
  gap: 13px;
}

.chef-summary-icon {
  display: grid;
  flex: 0 0 auto;
  width: 49px;
  height: 49px;
  place-items: center;
  color: var(--brand);
  background: var(--brand-soft);
  border-radius: 15px;
}

.chef-summary-icon svg {
  width: 27px;
  height: 27px;
}

.chef-summary-text {
  flex: 1;
  min-width: 0;
}

.chef-summary-text span {
  display: block;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 650;
  letter-spacing: 0.08em;
}

.chef-summary-text strong {
  display: block;
  overflow: hidden;
  margin-top: 2px;
  font-size: 19px;
  font-weight: 730;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chef-summary-text em {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
}

.chef-summary-action {
  flex: 0 0 auto;
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.stat-card {
  padding: 15px 16px 13px;
}

.stat-card span {
  display: block;
  color: var(--muted);
  font-size: 11.5px;
}

.stat-number {
  display: flex;
  align-items: baseline;
  margin-top: 2px;
  gap: 4px;
}

.stat-number strong {
  font-size: 28px;
  font-weight: 760;
  line-height: 1.1;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.stat-number em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
}

.summary-body {
  margin-top: 21px;
}

.segmented {
  display: flex;
  padding: 4px;
  background: #eee7dc;
  border-radius: 999px;
}

.segmented button {
  flex: 1;
  min-height: 40px;
  padding: 0 13px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  border-radius: 999px;
  transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.segmented button[aria-pressed="true"] {
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 2px 7px rgba(51, 52, 44, 0.08);
}

.orders-grid {
  display: grid;
  grid-template-columns: 1fr;
  margin-top: 12px;
  gap: 10px;
}

.order-card {
  padding: 17px 18px 15px;
}

.order-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar {
  display: grid;
  flex: 0 0 auto;
  width: 39px;
  height: 39px;
  place-items: center;
  color: #725c38;
  font-size: 15px;
  font-weight: 700;
  background: #e9dfcb;
  border-radius: 50%;
}

.avatar.tone-1 { color: #3f6756; background: #dce8e1; }
.avatar.tone-2 { color: #9a5d40; background: #f4dfd3; }
.avatar.tone-3 { color: #5f5c82; background: #e4e2ef; }
.avatar.tone-4 { color: #7b6829; background: #f0e7c9; }
.avatar.tone-5 { color: #456672; background: #dfe8ec; }

.order-person {
  flex: 1;
  min-width: 0;
}

.order-person h3 {
  display: flex;
  align-items: center;
  margin: 0;
  gap: 6px;
  font-size: 16px;
  font-weight: 700;
}

.order-person p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.my-tag {
  display: inline-flex;
  align-items: center;
  min-height: 19px;
  padding: 0 6px;
  color: var(--brand);
  font-size: 9px;
  font-weight: 650;
  background: var(--brand-soft);
  border-radius: 5px;
}

.order-item-count {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 11.5px;
}

.order-items {
  margin: 11px 0 0;
  padding: 0;
  list-style: none;
}

.order-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 7px 0;
  gap: 12px;
  border-top: 1px dashed #eee6da;
}

.order-item:first-child {
  border-top: 0;
}

.order-item-name {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--ink-soft);
  font-size: 14px;
}

.order-item-qty {
  flex: 0 0 auto;
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.order-note {
  margin: 10px 0 0;
  padding: 8px 10px;
  color: #715a3b;
  font-size: 12px;
  line-height: 1.5;
  background: #fbf4e8;
  border-radius: 9px;
}

.order-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
}

.order-foot button {
  min-height: 36px;
  margin-left: auto;
  color: var(--brand);
  font-size: 11.5px;
  font-weight: 650;
}

.prep-section {
  display: grid;
  margin-top: 12px;
  gap: 10px;
}

.prep-group {
  overflow: hidden;
}

.prep-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 17px;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  background: #f8f2e9;
  border-bottom: 1px solid #eee4d7;
}

.prep-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.prep-row {
  display: flex;
  align-items: flex-start;
  padding: 12px 17px;
  gap: 14px;
  border-bottom: 1px dashed #eee6da;
}

.prep-row:last-child {
  border-bottom: 0;
}

.prep-main {
  flex: 1;
  min-width: 0;
}

.prep-name {
  overflow-wrap: anywhere;
  font-size: 14.5px;
  font-weight: 660;
}

.prep-people {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}

.prep-qty {
  flex: 0 0 auto;
  padding: 3px 8px;
  color: var(--brand);
  font-size: 12px;
  font-weight: 700;
  background: var(--brand-soft);
  border-radius: 7px;
  font-variant-numeric: tabular-nums;
}

.empty-summary {
  padding: 40px 22px;
  text-align: center;
}

.empty-summary .empty-illustration {
  display: grid;
  width: 78px;
  height: 78px;
  margin: 0 auto 15px;
  place-items: center;
  color: #9f917c;
  background: #f4ede1;
  border-radius: 28px;
  transform: rotate(-3deg);
}

.empty-summary svg {
  width: 42px;
  height: 42px;
}

.empty-summary h2 {
  margin: 0;
  font-size: 21px;
  font-weight: 740;
}

.empty-summary p {
  margin: 7px auto 17px;
  max-width: 320px;
  color: var(--muted);
  font-size: 12.5px;
}

.manage-card {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: space-between;
  margin-top: 18px;
  padding: 16px 18px;
  gap: 13px;
  border-style: dashed;
}

.manage-text {
  flex: 1;
  min-width: 180px;
}

.manage-text h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 680;
}

.manage-text p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}

.manage-card .btn {
  min-height: 42px;
  padding: 0 14px;
  font-size: 12.5px;
}

/* ---------------- 菜品库 ---------------- */

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin: 2px 3px 19px;
  gap: 15px;
}

.page-head h1 {
  margin: 0;
  font-size: clamp(27px, 7.2vw, 34px);
  font-weight: 770;
  line-height: 1.2;
  letter-spacing: -0.035em;
}

.page-head p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12.5px;
}

.page-head .btn {
  min-height: 44px;
  padding: 0 14px;
  font-size: 13px;
  border-radius: 13px;
}

.library-grid {
  display: grid;
  grid-template-columns: 1fr;
  margin-top: 12px;
  gap: 9px;
}

.library-card {
  padding: 15px 16px;
}

.library-main {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.library-cat {
  display: inline-flex;
  min-height: 20px;
  margin-bottom: 4px;
  padding: 0 6px;
  align-items: center;
  color: #84796a;
  font-size: 9.5px;
  font-weight: 650;
  background: #f2ece2;
  border-radius: 5px;
}

.library-name {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 16px;
  font-weight: 680;
  line-height: 1.35;
}

.library-tags {
  display: flex;
  flex-wrap: wrap;
  margin-top: 5px;
  gap: 4px;
}

.library-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 2px;
}

.library-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 42px;
  padding: 0 8px;
  gap: 4px;
  color: var(--ink-soft);
  font-size: 12px;
  border-radius: 8px;
}

.library-action svg {
  width: 15px;
  height: 15px;
}

.library-action:hover {
  color: var(--brand);
  background: var(--brand-soft);
}

.library-action.is-delete:hover {
  color: var(--danger);
  background: var(--danger-soft);
}

.example-tip {
  display: flex;
  align-items: flex-start;
  margin-bottom: 15px;
  padding: 11px 13px;
  gap: 9px;
  color: #6f634f;
  font-size: 12px;
  line-height: 1.55;
  background: #f8f1e5;
  border: 1px solid #eee0c8;
  border-radius: 12px;
}

.example-tip svg {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  margin-top: 1px;
}

.example-tip button {
  flex: 0 0 auto;
  margin-left: auto;
  min-width: 48px;
  min-height: 28px;
  color: #99866c;
  font-size: 11px;
  white-space: nowrap;
}

/* ---------------- 设置 ---------------- */

.settings-section {
  margin-top: 15px;
  padding: 19px 19px 17px;
}

.settings-section:first-of-type {
  margin-top: 0;
}

.settings-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 13px;
  gap: 12px;
}

.settings-head h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 730;
}

.settings-head p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.55;
}

.settings-head .text-button {
  flex: 0 0 auto;
  min-height: 38px;
}

.family-list {
  display: grid;
  gap: 6px;
}

.family-row {
  display: flex;
  align-items: center;
  padding: 8px 6px 8px 8px;
  gap: 10px;
  border-radius: 12px;
}

.family-row + .family-row {
  border-top: 1px solid #f2ece2;
}

.family-row .avatar {
  width: 34px;
  height: 34px;
  font-size: 13px;
}

.family-name {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 14px;
  font-weight: 600;
}

.chef-now-tag {
  color: var(--brand);
  font-size: 9.5px;
  font-weight: 650;
  background: var(--brand-soft);
  border-radius: 5px;
  padding: 2px 6px;
  white-space: nowrap;
}

.row-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 1px;
}

.row-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  min-height: 40px;
  color: var(--muted);
  border-radius: 8px;
}

.row-action svg {
  width: 16px;
  height: 16px;
}

.row-action:hover {
  color: var(--brand);
  background: var(--brand-soft);
}

.row-action.is-delete:hover {
  color: var(--danger);
  background: var(--danger-soft);
}

.empty-inline {
  padding: 12px 4px;
  color: var(--muted);
  font-size: 12px;
}

.join-layout {
  display: flex;
  align-items: center;
  gap: 17px;
}

.qr-frame {
  display: grid;
  flex: 0 0 auto;
  width: 158px;
  height: 158px;
  padding: 9px;
  place-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
}

.qr-frame img,
.qr-frame canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

.qr-fallback {
  padding: 10px;
  color: var(--muted);
  font-size: 10px;
  text-align: center;
}

.join-info {
  min-width: 0;
  flex: 1;
}

.join-info h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
}

.join-info p {
  margin: 5px 0 11px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.6;
}

.url-box {
  display: flex;
  align-items: center;
  padding: 8px 8px 8px 11px;
  gap: 7px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.url-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  color: var(--ink-soft);
  font-family: "Cascadia Mono", "Consolas", monospace;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
  user-select: all;
}

.copy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-width: 40px;
  min-height: 38px;
  color: var(--brand);
  font-size: 11.5px;
  font-weight: 650;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.copy-btn:hover {
  border-color: #b8cabe;
}

.alt-urls {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.7;
}

.alt-urls code {
  color: var(--ink-soft);
  font-family: "Cascadia Mono", "Consolas", monospace;
  font-size: 10px;
  overflow-wrap: anywhere;
}

.data-list {
  display: grid;
  gap: 1px;
}

.data-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  gap: 16px;
  font-size: 12px;
  border-bottom: 1px solid #f2ece2;
}

.data-row:last-child {
  border-bottom: 0;
}

.data-row span {
  color: var(--muted);
}

.data-row strong {
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 600;
  text-align: right;
}

.data-actions {
  display: flex;
  flex-wrap: wrap;
  margin-top: 12px;
  gap: 8px;
}

.data-actions .btn {
  min-height: 42px;
  font-size: 12.5px;
}

.settings-help {
  padding-left: 20px;
  margin: 0;
  color: var(--ink-soft);
  font-size: 12.5px;
  line-height: 1.75;
}

.settings-help li + li {
  margin-top: 3px;
}

.privacy-note {
  display: flex;
  align-items: flex-start;
  margin-top: 13px;
  padding: 10px 12px;
  gap: 8px;
  color: #5f6e67;
  font-size: 11px;
  line-height: 1.6;
  background: var(--brand-soft);
  border-radius: 10px;
}

.privacy-note svg {
  flex: 0 0 auto;
  width: 15px;
  height: 15px;
  margin-top: 1px;
}

.version-footer {
  padding: 25px 0 9px;
  color: #9b9387;
  font-size: 10px;
  text-align: center;
  line-height: 1.8;
}

.install-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 13px;
  padding-top: 13px;
  gap: 15px;
  border-top: 1px solid #f2ece2;
}

.install-row p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}

/* ---------------- 底部操作条 ---------------- */

.action-bar {
  position: fixed;
  right: 0;
  bottom: calc(var(--tabbar-height) + env(safe-area-inset-bottom));
  left: 0;
  z-index: 40;
  padding: 9px 14px 8px;
  background: linear-gradient(180deg, rgba(247, 243, 236, 0) 0%, rgba(247, 243, 236, 0.94) 24%);
  pointer-events: none;
}

.action-bar-inner {
  display: flex;
  align-items: center;
  width: min(100%, 680px);
  margin: 0 auto;
  padding: 8px 9px 8px 15px;
  gap: 12px;
  background: rgba(255, 253, 248, 0.96);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 10px 35px rgba(46, 55, 44, 0.13);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  pointer-events: auto;
}

.action-summary {
  flex: 1;
  min-width: 0;
}

.action-count {
  display: block;
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.action-count strong {
  color: var(--brand);
  font-size: 17px;
  font-variant-numeric: tabular-nums;
}

.action-hint {
  display: block;
  overflow: hidden;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.action-hint.is-warning {
  color: #a26737;
  font-weight: 600;
}

.action-bar .btn {
  flex: 0 0 auto;
  min-width: 120px;
  min-height: 48px;
  padding: 0 17px;
  font-size: 14px;
  border-radius: 13px;
}

/* ---------------- 底部导航 ---------------- */

.tabbar {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 45;
  padding-bottom: env(safe-area-inset-bottom);
  background: rgba(255, 253, 248, 0.9);
  border-top: 1px solid rgba(224, 214, 200, 0.78);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  backdrop-filter: blur(20px) saturate(140%);
}

.tabbar-inner {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  width: min(100%, 620px);
  height: var(--tabbar-height);
  margin: 0 auto;
}

.tab {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  min-width: 0;
  min-height: 44px;
  padding: 6px 2px 7px;
  gap: 2px;
  color: #8b8d85;
  text-decoration: none;
  transition: color 0.18s ease;
}

.tab-icon {
  position: relative;
  display: grid;
  width: 41px;
  height: 27px;
  place-items: center;
  border-radius: 999px;
  transition: background 0.18s ease, color 0.18s ease;
}

.tab-icon svg {
  width: 23px;
  height: 23px;
}

.tab-label {
  font-size: 11.5px;
  font-weight: 570;
  letter-spacing: 0.02em;
}

.tab.is-active {
  color: var(--brand);
}

.tab.is-active .tab-icon {
  background: var(--brand-soft);
}

.tab.is-active .tab-label {
  font-weight: 700;
}

.tab-badge {
  position: absolute;
  top: -4px;
  left: 27px;
  display: grid;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  place-items: center;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
  background: var(--accent-deep);
  border: 1.5px solid #fffdf8;
  border-radius: 999px;
}

/* ---------------- 弹层 ---------------- */

.modal-layer {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(25, 38, 31, 0.46);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  animation: fade-in 0.2s ease both;
}

.modal-panel {
  position: relative;
  overflow: auto;
  width: min(100%, 520px);
  max-height: min(88vh, 790px);
  max-height: min(88dvh, 790px);
  background: var(--surface);
  border-radius: 24px;
  box-shadow: var(--shadow-lg);
  animation: modal-in 0.28s cubic-bezier(0.2, 0.8, 0.28, 1) both;
  overscroll-behavior: contain;
}

.modal-panel:focus {
  outline: none;
}

.modal-panel.modal-small {
  width: min(100%, 420px);
}

.modal-panel.modal-join {
  width: min(100%, 490px);
}

.modal-inner {
  padding: 23px 22px 21px;
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 18px;
  gap: 14px;
}

.modal-head h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 760;
  line-height: 1.3;
  letter-spacing: -0.025em;
}

.modal-head p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.icon-close {
  display: grid;
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  margin: -5px -8px 0 0;
  place-items: center;
  color: var(--muted);
  background: transparent;
  border-radius: 999px;
}

.icon-close:hover {
  color: var(--ink);
  background: var(--surface-soft);
}

.icon-close svg {
  width: 22px;
  height: 22px;
}

.sheet-form {
  display: grid;
  gap: 17px;
}

.field {
  display: grid;
  min-width: 0;
  margin: 0;
  padding: 0;
  gap: 7px;
  border: 0;
}

.field > label,
.field-label,
.field legend {
  padding: 0;
  color: var(--ink-soft);
  font-size: 12.5px;
  font-weight: 650;
}

.field-label .optional {
  margin-left: 3px;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 400;
}

.text-input {
  width: 100%;
  height: 48px;
  padding: 0 13px;
  color: var(--ink);
  font-size: 16px;
  background: var(--surface-soft);
  border: 1.5px solid transparent;
  border-radius: 12px;
  outline: none;
  transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.text-input::placeholder {
  color: #8f877c;
}

.text-input:focus {
  background: #fff;
  border-color: #9fb9a9;
  box-shadow: 0 0 0 3px rgba(83, 129, 108, 0.09);
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
}

.choice {
  position: relative;
  display: block;
  min-width: 0;
  cursor: pointer;
}

.choice > span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 7px;
  color: var(--ink-soft);
  font-size: 12.5px;
  font-weight: 600;
  background: var(--surface-soft);
  border: 1.5px solid transparent;
  border-radius: 10px;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.choice input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.choice input:checked + span {
  color: var(--brand);
  background: var(--brand-soft);
  border-color: #a8c5b5;
}

.choice input:focus-visible + span {
  outline: 3px solid rgba(202, 124, 67, 0.7);
  outline-offset: 2px;
}

.tag-choice-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.tag-choice {
  position: relative;
  display: inline-flex;
  cursor: pointer;
}

.tag-choice > span {
  display: inline-flex;
  align-items: center;
  min-height: 37px;
  padding: 0 12px;
  color: #796f62;
  font-size: 12px;
  font-weight: 550;
  background: var(--surface-soft);
  border: 1.5px solid transparent;
  border-radius: 999px;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.tag-choice input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.tag-choice input:checked + span {
  color: var(--brand);
  background: var(--brand-soft);
  border-color: #b3cbbc;
  font-weight: 650;
}

.tag-choice input:focus-visible + span {
  outline: 3px solid rgba(202, 124, 67, 0.7);
  outline-offset: 2px;
}

.form-note {
  margin: -1px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}

.form-error {
  display: none;
  padding: 9px 11px;
  color: #8f342a;
  font-size: 12px;
  line-height: 1.5;
  background: var(--danger-soft);
  border-radius: 9px;
}

.form-error.is-visible {
  display: block;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 2px;
  gap: 8px;
}

.modal-actions .btn {
  min-width: 104px;
}

.modal-actions .btn:first-child {
  min-width: 80px;
}

.confirm-icon {
  display: grid;
  width: 48px;
  height: 48px;
  margin-bottom: 12px;
  place-items: center;
  color: var(--accent-deep);
  background: var(--accent-soft);
  border-radius: 15px;
}

.confirm-icon svg {
  width: 24px;
  height: 24px;
}

.confirm-body {
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.7;
}

.confirm-body strong {
  color: var(--ink);
}

.confirm-detail {
  margin: 9px 0 0;
  padding: 10px 12px;
  color: #806747;
  font-size: 11.5px;
  line-height: 1.6;
  background: #fbf3e6;
  border-radius: 9px;
}

.modal-join-body {
  display: grid;
  gap: 16px;
}

.qr-large {
  display: grid;
  width: 226px;
  max-width: 100%;
  aspect-ratio: 1;
  margin: 0 auto;
  padding: 12px;
  place-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow-sm);
}

.qr-large img,
.qr-large canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

.join-copy {
  text-align: center;
}

.join-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.join-url {
  margin-top: 10px;
  padding: 10px;
  color: var(--brand-deep);
  font-family: "Cascadia Mono", "Consolas", monospace;
  font-size: 13px;
  font-weight: 650;
  background: var(--brand-soft);
  border-radius: 10px;
  overflow-wrap: anywhere;
}

.join-steps {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 6px;
}

.join-steps li {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.55;
}

.join-steps .num {
  display: grid;
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  margin-top: 1px;
  place-items: center;
  color: var(--brand);
  font-size: 10px;
  font-weight: 700;
  background: var(--brand-soft);
  border-radius: 50%;
}

.join-alt {
  margin-top: 8px;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.7;
  text-align: center;
}

.join-alt code {
  font-family: "Cascadia Mono", "Consolas", monospace;
  font-size: 10px;
  overflow-wrap: anywhere;
}

/* ---------------- 吐司 / 加载 / 出错 ---------------- */

.toast {
  position: fixed;
  bottom: calc(var(--tabbar-height) + 22px + env(safe-area-inset-bottom));
  left: 50%;
  z-index: 200;
  width: fit-content;
  max-width: min(calc(100vw - 32px), 420px);
  padding: 11px 17px;
  color: #fffdf8;
  font-size: 13px;
  font-weight: 550;
  line-height: 1.45;
  text-align: center;
  background: rgba(35, 55, 46, 0.96);
  border-radius: 999px;
  box-shadow: 0 10px 30px rgba(30, 42, 35, 0.22);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

body.has-action .toast {
  bottom: calc(var(--tabbar-height) + 96px + env(safe-area-inset-bottom));
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.toast.is-error {
  background: rgba(142, 50, 41, 0.97);
}

.toast.is-success {
  background: rgba(40, 91, 70, 0.97);
}

.loading-card,
.error-card {
  max-width: 480px;
  margin: 10vh auto 0;
  padding: 37px 26px;
  text-align: center;
  background: rgba(255, 253, 248, 0.82);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.loading-mark {
  display: grid;
  width: 76px;
  height: 76px;
  margin: 0 auto 18px;
  place-items: center;
  color: var(--brand);
  background: var(--brand-soft);
  border-radius: 26px;
  animation: gentle-float 2.4s ease-in-out infinite;
}

.loading-mark svg {
  width: 44px;
  height: 44px;
}

.loading-card h1,
.error-card h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 750;
  letter-spacing: -0.02em;
}

.loading-card p,
.error-card p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.65;
}

.loading-dots {
  display: inline-flex;
  margin-top: 14px;
  gap: 5px;
}

.loading-dots i {
  width: 5px;
  height: 5px;
  background: #a8b9ae;
  border-radius: 50%;
  animation: dot-bounce 1.1s ease-in-out infinite;
}

.loading-dots i:nth-child(2) { animation-delay: 0.14s; }
.loading-dots i:nth-child(3) { animation-delay: 0.28s; }

.error-card .error-mark {
  display: grid;
  width: 60px;
  height: 60px;
  margin: 0 auto 16px;
  place-items: center;
  color: var(--danger);
  background: var(--danger-soft);
  border-radius: 20px;
}

.error-card .error-mark svg {
  width: 30px;
  height: 30px;
}

.error-card .btn {
  margin-top: 18px;
}

.noscript {
  position: fixed;
  right: 16px;
  bottom: 16px;
  left: 16px;
  z-index: 300;
  padding: 14px;
  color: #fff;
  font-size: 14px;
  text-align: center;
  background: var(--danger);
  border-radius: 12px;
}

/* ---------------- 动画 ---------------- */

@keyframes page-in {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(14px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes soft-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(183, 151, 99, 0.28); }
  50% { box-shadow: 0 0 0 4px rgba(183, 151, 99, 0); }
}

@keyframes gentle-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

@keyframes dot-bounce {
  0%, 70%, 100% { transform: translateY(0); opacity: 0.45; }
  35% { transform: translateY(-4px); opacity: 1; }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ---------------- 响应式 ---------------- */

@media (min-width: 720px) {
  .main {
    padding: 28px 26px calc(var(--tabbar-height) + 40px + env(safe-area-inset-bottom));
  }

  body.has-action .main {
    padding-bottom: calc(var(--tabbar-height) + 118px + env(safe-area-inset-bottom));
  }

  .topbar-inner {
    height: 72px;
  }

  .brand-mark {
    width: 43px;
    height: 43px;
  }

  .brand-text strong {
    font-size: 19px;
  }

  .chef-card {
    padding: 25px 27px 23px;
  }

  .chef-sub {
    font-size: 13.5px;
  }

  .chef-chip {
    min-height: 44px;
    padding: 0 18px;
    font-size: 14.5px;
  }

  .name-card {
    padding: 22px 23px 20px;
  }

  .dish-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .orders-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    gap: 12px;
  }

  .library-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .settings-section {
    padding: 22px 23px 20px;
  }

  .join-layout {
    gap: 24px;
  }

  .qr-frame {
    width: 175px;
    height: 175px;
  }

  .modal-inner {
    padding: 27px 27px 24px;
  }

  .modal-head h2 {
    font-size: 24px;
  }

  .modal-layer {
    padding: 36px;
  }
}

@media (min-width: 1080px) {
  .main {
    padding-top: 34px;
  }

  .tabbar {
    right: 22px;
    bottom: 20px;
    left: 22px;
    width: 620px;
    margin: 0 auto;
    padding: 0;
    background: rgba(255, 253, 248, 0.9);
    border: 1px solid rgba(224, 214, 200, 0.9);
    border-radius: 22px;
    box-shadow: 0 10px 35px rgba(52, 59, 48, 0.11);
  }

  .tabbar-inner {
    height: 64px;
  }

  .action-bar {
    bottom: 94px;
  }

  .main {
    padding-bottom: 120px;
  }

  body.has-action .main {
    padding-bottom: 190px;
  }

  .tab-icon {
    height: 25px;
  }
}

@media (max-width: 640px) {
  .main {
    padding-right: 14px;
    padding-left: 14px;
  }

  .topbar-inner {
    padding: 0 14px;
  }

  .brand-text span {
    display: none;
  }

  .join-button {
    padding: 0;
    border-color: transparent;
  }

  .join-button span {
    display: none;
  }

  .sync-pill {
    padding: 0 9px;
  }

  .chef-card {
    border-radius: 23px;
  }

  .chef-medallion {
    width: 50px;
    height: 50px;
    border-radius: 16px;
  }

  .chef-medallion svg {
    width: 27px;
    height: 27px;
  }

  .action-bar {
    padding-right: 10px;
    padding-left: 10px;
  }

  .action-bar-inner {
    padding-left: 13px;
    border-radius: 17px;
  }

  .action-bar .btn {
    min-width: 106px;
    min-height: 47px;
    padding: 0 12px;
    font-size: 13.5px;
  }

  .modal-layer {
    align-items: flex-end;
    padding: 0;
  }

  .modal-panel {
    width: 100%;
    max-height: 92dvh;
    border-radius: 25px 25px 0 0;
    animation-name: sheet-in;
  }

  .modal-panel.modal-small,
  .modal-panel.modal-join {
    width: 100%;
  }

  .modal-inner {
    padding: 21px 18px calc(19px + env(safe-area-inset-bottom));
  }

  .modal-actions .btn {
    flex: 1;
  }

  .modal-actions .btn:first-child {
    flex: 0 0 35%;
  }

  .summary-header {
    align-items: flex-start;
  }

  .summary-date-mark {
    padding-top: 5px;
  }

  .page-head {
    align-items: flex-start;
  }

  .join-layout {
    display: grid;
    gap: 15px;
  }

  .qr-frame {
    width: 158px;
    height: 158px;
    margin: 0 auto;
  }

  .join-info {
    text-align: center;
  }

  .join-info p {
    margin-bottom: 10px;
  }
}

@media (max-width: 380px) {
  .brand-mark {
    width: 37px;
    height: 37px;
    border-radius: 12px;
  }

  .brand-text strong {
    font-size: 16.5px;
  }

  .sync-pill {
    min-height: 30px;
    padding: 0 8px;
    font-size: 10.5px;
  }

  .join-button {
    min-width: 38px;
    min-height: 38px;
  }

  .chef-card {
    padding-right: 16px;
    padding-left: 16px;
  }

  .chef-medallion {
    display: none;
  }

  .chef-chip {
    min-width: 58px;
    min-height: 42px;
    padding: 0 12px;
    font-size: 13px;
  }

  .name-card {
    padding-right: 16px;
    padding-left: 16px;
  }

  .dish-card {
    padding-left: 12px;
  }

  .dish-name {
    font-size: 15.5px;
  }

  .qty-btn {
    width: 36px;
    height: 36px;
  }

  .dish-add {
    width: 42px;
    height: 42px;
  }

  .action-bar .btn {
    min-width: 96px;
    font-size: 12.5px;
  }

  .action-hint {
    font-size: 10.5px;
  }

  .summary-header h1,
  .page-head h1 {
    font-size: 26px;
  }
}

@keyframes sheet-in {
  from { opacity: 0.5; transform: translateY(35px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
