:root {
  --bg-paper: #FAF7F2;
  --bg-surface: #FFFFFF;
  --bg-subtle: #F3EEE6;
  --bg-hover: #ECE5DA;

  --ink-primary: #1F1C18;
  --ink-secondary: #5C544B;
  --ink-muted: #8A8176;

  --accent: #B84A27;
  --accent-hover: #99391A;
  --accent-soft: #FBF0EC;
  --accent-border: rgba(184, 74, 39, 0.28);

  --jade: #38664E;
  --jade-soft: #ECF4EF;
  --danger: #B3342C;
  --danger-soft: #FDF0EF;

  --border: rgba(31, 28, 24, 0.09);
  --border-strong: rgba(31, 28, 24, 0.16);

  --shadow-sm: 0 2px 8px rgba(31, 28, 24, 0.04);
  --shadow-md: 0 10px 30px rgba(31, 28, 24, 0.07);
  --shadow-lg: 0 20px 50px rgba(31, 28, 24, 0.14);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-pill: 999px;

  --font-serif: "Songti SC", "STSong", "Noto Serif SC", "Source Han Serif SC", "SimSun", Georgia, serif;
  --font-sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --header-h: 68px;
  --container-max: 1380px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink-primary);
  background-color: var(--bg-paper);
  -webkit-font-smoothing: antialiased;
}

body.modal-open {
  overflow: hidden;
}

img {
  display: block;
  max-width: 100%;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.56;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.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;
}

.hidden {
  display: none !important;
}

/* ---------- 顶部栏 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(250, 247, 242, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: var(--container-max);
  margin: 0 auto;
  min-height: var(--header-h);
  padding: 10px 24px;
  display: flex;
  align-items: center;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  color: var(--ink-primary);
  flex-shrink: 0;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--accent);
  color: #FFFFFF;
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 700;
  display: grid;
  place-items: center;
  letter-spacing: 0;
  box-shadow: 0 3px 10px rgba(184, 74, 39, 0.22);
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-name {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.025em;
  white-space: nowrap;
}

.brand-sub {
  font-size: 11px;
  color: var(--ink-muted);
  letter-spacing: 0.08em;
  margin-top: 2px;
}

.search-box {
  position: relative;
  flex: 1;
  max-width: 460px;
  margin-right: auto;
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--ink-muted);
  pointer-events: none;
}

.search-box input {
  width: 100%;
  height: 40px;
  padding: 0 36px 0 40px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  background: var(--bg-surface);
  font-size: 14px;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.search-box input::placeholder {
  color: var(--ink-muted);
}

.search-box input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(184, 74, 39, 0.12);
}

.search-clear {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 50%;
  background: var(--bg-subtle);
  color: var(--ink-secondary);
  font-size: 15px;
  line-height: 1;
  display: grid;
  place-items: center;
}

.search-clear:hover {
  background: var(--bg-hover);
  color: var(--ink-primary);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* ---------- 通用按钮 ---------- */
.btn-primary {
  border: none;
  border-radius: var(--radius-pill);
  background: var(--accent);
  color: #FFFFFF;
  font-size: 14px;
  font-weight: 600;
  padding: 11px 22px;
  transition: background-color 0.18s ease, transform 0.12s ease;
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
}

.btn-primary:active:not(:disabled) {
  transform: scale(0.985);
}

.btn-secondary {
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  background: var(--bg-surface);
  color: var(--ink-primary);
  font-size: 13px;
  font-weight: 500;
  padding: 8px 15px;
  transition: background-color 0.18s ease, border-color 0.18s ease;
}

.btn-secondary:hover:not(:disabled) {
  background: var(--bg-subtle);
  border-color: rgba(31, 28, 24, 0.25);
}

.btn-ghost {
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--ink-secondary);
  font-size: 13px;
  font-weight: 500;
  padding: 8px 13px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background-color 0.16s ease, color 0.16s ease;
}

.btn-ghost:hover:not(:disabled) {
  background: var(--bg-subtle);
  color: var(--ink-primary);
}

.btn-text {
  border: none;
  background: none;
  color: var(--ink-muted);
  font-size: 13px;
  padding: 4px 6px;
  border-radius: 6px;
}

.btn-text:hover:not(:disabled) {
  color: var(--accent);
  background: var(--accent-soft);
}

.btn-icon {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: var(--bg-subtle);
  color: var(--ink-secondary);
  font-size: 20px;
  line-height: 1;
  display: grid;
  place-items: center;
}

.btn-icon:hover {
  background: var(--bg-hover);
  color: var(--ink-primary);
}

.count-pill {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: var(--radius-pill);
  background: var(--bg-subtle);
  color: var(--ink-secondary);
  font-size: 11px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-full {
  width: 100%;
}

/* ---------- 主体双栏 ---------- */
.app-shell {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 24px 24px 72px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 28px;
  align-items: start;
}

.main-canvas {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

/* ---------- 首屏精选图文封面 ---------- */
.editorial-hero {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.hero-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

@media (max-width: 380px) {
  .header-inner .brand { gap: 6px; }
  .header-inner .brand-mark { width: 30px; height: 30px; }
  .header-inner .header-actions { gap: 2px; }
  .header-actions .btn-ghost, .header-actions .btn-secondary { padding-inline: 7px; }
}

.hero-intro { display: flex; align-items: center; gap: 12px; }
.sichuan-shortcut {
  padding: 4px 11px; border-radius: 999px; border: 1px solid #ecc5af;
  background: #fff1e5; color: #813919; font-size: 13px; font-weight: 650;
}
.sichuan-shortcut:hover { background: #f8ddc6; }

.hero-kicker {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--accent);
  text-transform: uppercase;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.48fr) minmax(240px, 0.72fr);
  gap: 16px;
}

.hero-lead {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  min-height: 300px;
}

.hero-lead.is-selected {
  border-color: var(--accent-border);
}

.hero-lead-media {
  position: relative;
  background: var(--bg-subtle);
  overflow: hidden;
  min-height: 240px;
}

.hero-lead-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.55s ease;
}

.hero-lead:hover .hero-lead-media img {
  transform: scale(1.03);
}

.hero-lead-body {
  padding: 24px 24px 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
}

.hero-lead-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.cuisine-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
}

.hero-lead-title {
  margin: 8px 0 8px;
  font-family: var(--font-serif);
  font-size: 27px;
  line-height: 1.25;
  font-weight: 700;
  color: var(--ink-primary);
}

.hero-lead-desc {
  margin: 0;
  font-size: 14px;
  line-height: 1.65;
  color: var(--ink-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hero-side-stack {
  display: grid;
  grid-template-rows: 1fr 1fr;
  gap: 14px;
}

.hero-side-card {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.hero-side-card:hover {
  box-shadow: var(--shadow-md);
}

.hero-side-card.is-selected {
  border-color: var(--accent-border);
}

.hero-side-media {
  position: relative;
  background: var(--bg-subtle);
  overflow: hidden;
  min-height: 112px;
}

.hero-side-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-side-body {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.hero-side-cuisine {
  font-size: 11px;
  color: var(--accent);
  font-weight: 600;
}

.hero-side-title {
  margin: 2px 0 0;
  font-family: var(--font-serif);
  font-size: 16px;
  line-height: 1.3;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hero-side-desc {
  margin: 3px 0 0;
  font-size: 12px;
  color: var(--ink-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- 筛选与全菜系导航 ---------- */
.filter-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cuisine-bar-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cuisine-quick-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 2px 0;
  flex: 1;
  min-width: 0;
}

.cuisine-quick-bar::-webkit-scrollbar {
  display: none;
}

.cuisine-pill {
  flex-shrink: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--bg-surface);
  color: var(--ink-secondary);
  font-size: 13.5px;
  font-weight: 500;
  padding: 7px 15px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background-color 0.16s ease, color 0.16s ease, border-color 0.16s ease;
}

.cuisine-pill:hover {
  background: var(--bg-subtle);
  color: var(--ink-primary);
}

.cuisine-pill.is-active {
  background: var(--ink-primary);
  border-color: var(--ink-primary);
  color: #FFFFFF;
}

.cuisine-pill.is-pinned {
  border-color: var(--accent-border);
  background: var(--accent-soft);
  color: var(--accent);
}

.cuisine-pill.is-pinned.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #FFFFFF;
}

.pill-count {
  font-size: 11px;
  opacity: 0.72;
}

.directory-toggle {
  flex-shrink: 0;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  background: var(--bg-surface);
  color: var(--ink-primary);
  font-size: 13px;
  font-weight: 600;
  padding: 7px 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background-color 0.16s ease, border-color 0.16s ease;
}

.directory-toggle:hover,
.directory-toggle[aria-expanded="true"] {
  background: var(--accent-soft);
  border-color: var(--accent-border);
  color: var(--accent);
}

.directory-toggle .chevron {
  width: 14px;
  height: 14px;
  transition: transform 0.2s ease;
}

.directory-toggle[aria-expanded="true"] .chevron {
  transform: rotate(180deg);
}

/* 全菜系展开面板 */
.directory-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(31, 28, 24, 0.36);
  z-index: 48;
  display: none;
}

.cuisine-directory {
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 18px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  z-index: 50;
}

.directory-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.directory-title {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 17px;
  font-weight: 700;
}

.directory-search-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.directory-search-row input {
  width: 100%;
  height: 36px;
  padding: 0 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  background: var(--bg-paper);
  font-size: 13px;
}

.directory-search-row input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--bg-surface);
}

.directory-groups {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: 380px;
  overflow-y: auto;
  padding-right: 4px;
}

.directory-group-title {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-muted);
  letter-spacing: 0.08em;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.directory-chip-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
  gap: 8px;
}

.directory-chip {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-paper);
  padding: 8px 10px;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-size: 13px;
  transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

.directory-chip:hover {
  border-color: var(--accent-border);
  background: var(--accent-soft);
  color: var(--accent);
}

.directory-chip.is-active {
  background: var(--ink-primary);
  border-color: var(--ink-primary);
  color: #FFFFFF;
}

.directory-chip-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
}

.directory-chip-count {
  font-size: 11px;
  opacity: 0.65;
  flex-shrink: 0;
}

/* 口味标签条 */
.tag-filter-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.tag-label {
  font-size: 12px;
  color: var(--ink-muted);
  margin-right: 2px;
}

.tag-chip {
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  background: var(--bg-subtle);
  color: var(--ink-secondary);
  font-size: 12.5px;
  padding: 4px 12px;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.tag-chip:hover {
  background: var(--bg-hover);
  color: var(--ink-primary);
}

.tag-chip.is-active {
  background: var(--accent-soft);
  border-color: var(--accent-border);
  color: var(--accent);
  font-weight: 600;
}

.active-filters-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  font-size: 13px;
  color: var(--ink-secondary);
}

/* ---------- 菜单区块与杂志卡片 ---------- */
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.section-title {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.section-meta {
  font-size: 13px;
  color: var(--ink-muted);
}

.menu-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.dish-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.dish-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.dish-card.is-selected {
  border-color: var(--accent);
  box-shadow: 0 6px 20px rgba(184, 74, 39, 0.1);
}

.dish-media {
  position: relative;
  aspect-ratio: 4 / 3;
  background: var(--bg-subtle);
  overflow: hidden;
}

.dish-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s ease;
}

.dish-card:hover .dish-media img {
  transform: scale(1.04);
}

.dish-cuisine-tag {
  position: absolute;
  left: 10px;
  top: 10px;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  background: rgba(250, 247, 242, 0.9);
  backdrop-filter: blur(6px);
  color: var(--ink-primary);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.dish-selected-mark {
  position: absolute;
  right: 10px;
  top: 10px;
  min-width: 24px;
  height: 24px;
  padding: 0 7px;
  border-radius: var(--radius-pill);
  background: var(--accent);
  color: #FFFFFF;
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(184, 74, 39, 0.35);
}

.img-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: linear-gradient(145deg, #F4EFE7 0%, #EAE2D6 100%);
  color: var(--ink-muted);
  padding: 12px;
  text-align: center;
}

.img-fallback-char {
  font-family: var(--font-serif);
  font-size: 32px;
  font-weight: 700;
  color: rgba(184, 74, 39, 0.45);
  line-height: 1;
}

.img-fallback-label {
  font-size: 11px;
  letter-spacing: 0.06em;
}

.dish-body {
  padding: 14px 15px 15px;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 8px;
}

.dish-title {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 17.5px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--ink-primary);
}

.dish-desc {
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.dish-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.dish-tag {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--bg-subtle);
  color: var(--ink-secondary);
}

.dish-footer {
  margin-top: auto;
  padding-top: 8px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

/* ---------- 份数步进器 ---------- */
.qty-control {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-add-dish {
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-pill);
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  padding: 6px 14px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: background-color 0.16s ease, color 0.16s ease, border-color 0.16s ease;
}

.btn-add-dish:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #FFFFFF;
}

.stepper {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-subtle);
  border-radius: var(--radius-pill);
  padding: 2px;
}

.stepper-btn {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 50%;
  background: var(--bg-surface);
  color: var(--ink-primary);
  font-size: 16px;
  font-weight: 600;
  line-height: 1;
  display: grid;
  place-items: center;
  box-shadow: 0 1px 2px rgba(31, 28, 24, 0.08);
  transition: background-color 0.15s ease, color 0.15s ease;
}

.stepper-btn:hover {
  background: var(--accent);
  color: #FFFFFF;
}

.stepper-btn.is-plus {
  background: var(--accent);
  color: #FFFFFF;
}

.stepper-btn.is-plus:hover {
  background: var(--accent-hover);
}

.stepper-val {
  min-width: 24px;
  text-align: center;
  font-size: 13.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* ---------- 右侧点餐单（桌面粘性 / 移动抽屉） ---------- */
.order-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(31, 28, 24, 0.44);
  z-index: 58;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}

.order-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.order-sheet {
  position: sticky;
  top: calc(var(--header-h) + 20px);
  max-height: calc(100vh - var(--header-h) - 40px);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sheet-header {
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.sheet-title-wrap {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.sheet-title {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 19px;
  font-weight: 700;
}

.sheet-subtitle {
  font-size: 12.5px;
  color: var(--ink-muted);
}

.sheet-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.mobile-only-close {
  display: none;
}

.meal-selector {
  padding: 14px 20px 12px;
  border-bottom: 1px dashed var(--border-strong);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-muted);
  letter-spacing: 0.04em;
}

.meal-pills {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.meal-pill {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-paper);
  color: var(--ink-secondary);
  font-size: 13px;
  font-weight: 500;
  padding: 7px 4px;
  transition: background-color 0.16s ease, color 0.16s ease, border-color 0.16s ease;
}

.meal-pill:hover {
  background: var(--bg-subtle);
  color: var(--ink-primary);
}

.meal-pill.is-active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
}

.cart-items {
  flex: 1;
  min-height: 150px;
  overflow-y: auto;
  padding: 12px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cart-empty {
  margin: auto 0;
  padding: 28px 12px;
  text-align: center;
  color: var(--ink-muted);
}

.cart-empty-title {
  margin: 0 0 4px;
  font-family: var(--font-serif);
  font-size: 16px;
  color: var(--ink-secondary);
}

.cart-empty-desc {
  margin: 0;
  font-size: 13px;
}

.cart-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.cart-row:last-child {
  border-bottom: none;
  padding-bottom: 2px;
}

.cart-thumb {
  width: 46px;
  height: 46px;
  border-radius: 10px;
  background: var(--bg-subtle);
  overflow: hidden;
  flex-shrink: 0;
  position: relative;
}

.cart-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cart-info {
  flex: 1;
  min-width: 0;
}

.cart-name {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cart-cuisine {
  font-size: 11.5px;
  color: var(--ink-muted);
}

.sheet-footer {
  padding: 14px 20px 18px;
  border-top: 1px solid var(--border);
  background: #FCFBF9;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.note-box {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.note-box textarea {
  width: 100%;
  resize: none;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: var(--bg-surface);
  padding: 9px 11px;
  font-size: 13px;
  line-height: 1.45;
}

.note-box textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.inline-feedback {
  padding: 9px 12px;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.45;
}

.inline-feedback.is-error {
  background: var(--danger-soft);
  color: var(--danger);
}

.inline-feedback.is-success {
  background: var(--jade-soft);
  color: var(--jade);
}

.draft-hint {
  margin: 0;
  font-size: 11.5px;
  color: var(--ink-muted);
  text-align: center;
}

/* ---------- 家庭近期点单 ---------- */
.orders-section {
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.orders-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.order-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: var(--shadow-sm);
}

.order-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.order-meal-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: var(--radius-pill);
  background: var(--jade-soft);
  color: var(--jade);
  font-size: 12px;
  font-weight: 600;
}

.order-time {
  font-size: 12px;
  color: var(--ink-muted);
}

.order-items-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.order-dish-pill {
  font-size: 13px;
  padding: 4px 10px;
  border-radius: 8px;
  background: var(--bg-paper);
  border: 1px solid var(--border);
  color: var(--ink-primary);
}

.order-dish-qty {
  color: var(--accent);
  font-weight: 600;
  margin-left: 4px;
}

.order-note {
  margin: 0;
  font-size: 12.5px;
  color: var(--ink-secondary);
  background: var(--bg-subtle);
  padding: 6px 10px;
  border-radius: 8px;
}

.order-card-foot {
  margin-top: auto;
  padding-top: 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--ink-muted);
}

/* ---------- 空态 / 错误态 / 骨架屏 ---------- */
.state-card {
  grid-column: 1 / -1;
  background: var(--bg-surface);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 42px 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.state-title {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 18px;
  color: var(--ink-primary);
}

.state-desc {
  margin: 0;
  font-size: 13.5px;
  color: var(--ink-muted);
  max-width: 360px;
}

.state-actions {
  margin-top: 6px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.skeleton-box {
  background: linear-gradient(90deg, #EFE9DF 25%, #F8F4ED 50%, #EFE9DF 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite linear;
  border-radius: 8px;
}

.skeleton-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  padding-bottom: 14px;
}

.skeleton-img {
  aspect-ratio: 4 / 3;
  border-radius: 0;
}

.skeleton-line {
  height: 14px;
  margin: 12px 14px 0;
}

.skeleton-line.short {
  width: 55%;
}

/* ---------- 手机底部菜篮浮条 ---------- */
.mobile-cart-bar {
  display: none;
}

/* ---------- 自定义菜品弹窗 ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(31, 28, 24, 0.48);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-card {
  width: 100%;
  max-width: 500px;
  max-height: calc(100vh - 40px);
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-header {
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 700;
}

.modal-form {
  padding: 18px 22px 22px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-field label {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-primary);
}

.required-mark {
  color: var(--accent);
  margin-left: 2px;
}

.form-field input[type="text"],
.form-field select,
.form-field textarea {
  width: 100%;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: var(--bg-paper);
  padding: 10px 12px;
  font-size: 14px;
}

.form-field input[type="text"]:focus,
.form-field select:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--bg-surface);
}

.segmented-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 4px;
  border-radius: 10px;
  background: var(--bg-subtle);
}

.segmented-btn {
  border: none;
  border-radius: 8px;
  background: transparent;
  padding: 7px 10px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-secondary);
}

.segmented-btn.is-active {
  background: var(--bg-surface);
  color: var(--ink-primary);
  font-weight: 600;
  box-shadow: 0 1px 4px rgba(31, 28, 24, 0.08);
}

.upload-zone {
  position: relative;
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--bg-paper);
  padding: 18px;
  text-align: center;
  transition: border-color 0.16s ease, background-color 0.16s ease;
}

.upload-zone.is-dragover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.upload-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.upload-prompt-title {
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-primary);
}

.upload-prompt-sub {
  margin: 0;
  font-size: 12px;
  color: var(--ink-muted);
}

.upload-preview {
  display: flex;
  align-items: center;
  gap: 14px;
  text-align: left;
}

.upload-preview img {
  width: 96px;
  height: 72px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--border);
}

.upload-preview-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.upload-meta-main {
  font-size: 13px;
  font-weight: 600;
  color: var(--jade);
}

.upload-meta-sub {
  font-size: 12px;
  color: var(--ink-muted);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 6px;
}

/* ---------- Toast ---------- */
.toast-region {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  width: min(92vw, 380px);
}

.toast {
  background: var(--ink-primary);
  color: #FFFFFF;
  padding: 11px 18px;
  border-radius: var(--radius-pill);
  font-size: 13.5px;
  font-weight: 500;
  text-align: center;
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.22s ease;
}

.toast.is-success {
  background: var(--jade);
}

.toast.is-error {
  background: var(--danger);
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- 响应式适配 ---------- */
@media (max-width: 1220px) {
  .menu-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero-grid {
    grid-template-columns: 1fr;
  }

  .hero-side-stack {
    grid-template-rows: auto;
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 1023px) {
  .app-shell {
    grid-template-columns: 1fr;
    padding: 18px 16px 104px;
    gap: 22px;
  }

  .header-inner {
    padding: 10px 16px;
    flex-wrap: wrap;
    gap: 10px 12px;
  }

  .search-box {
    order: 3;
    flex-basis: 100%;
    max-width: none;
    margin-right: 0;
  }

  .header-actions {
    margin-left: auto;
  }

  /* 移动端抽屉点餐单 */
  .order-sheet {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    top: auto;
    z-index: 60;
    max-height: 86vh;
    border-radius: 22px 22px 0 0;
    border-bottom: none;
    transform: translateY(105%);
    transition: transform 0.26s cubic-bezier(0.22, 1, 0.36, 1);
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }

  .order-sheet.is-open {
    transform: translateY(0);
  }

  .mobile-only-close {
    display: grid;
  }

  /* 移动端底部悬浮菜篮 */
  .mobile-cart-bar {
    position: fixed;
    left: 14px;
    right: 14px;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    z-index: 45;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px 10px 16px;
    border-radius: var(--radius-pill);
    background: var(--ink-primary);
    color: #FFFFFF;
    box-shadow: 0 12px 30px rgba(31, 28, 24, 0.26);
  }

  .mobile-cart-summary {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    border: none;
    background: transparent;
    color: inherit;
    padding: 0;
    text-align: left;
    flex: 1;
  }

  .mobile-cart-badge {
    min-width: 28px;
    height: 28px;
    padding: 0 8px;
    border-radius: var(--radius-pill);
    background: var(--accent);
    color: #FFFFFF;
    font-size: 13px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
  }

  .mobile-cart-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
  }

  .mobile-cart-main {
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .mobile-cart-sub {
    font-size: 11.5px;
    color: rgba(255, 255, 255, 0.72);
  }

  .mobile-cart-cta {
    flex-shrink: 0;
    border: none;
    border-radius: var(--radius-pill);
    background: var(--accent);
    color: #FFFFFF;
    font-size: 13.5px;
    font-weight: 600;
    padding: 9px 18px;
  }

  /* 全菜系面板在移动端改为底部抽屉 */
  .directory-backdrop.is-open {
    display: block;
  }

  .cuisine-directory {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 22px 22px 0 0;
    max-height: 82vh;
    padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  }

  .directory-groups {
    max-height: calc(82vh - 130px);
  }
}

@media (max-width: 680px) {
  .brand-sub {
    display: none;
  }

  .hero-lead {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .hero-lead-media {
    aspect-ratio: 16 / 10;
    min-height: 0;
  }

  .hero-lead-body {
    padding: 16px 16px 18px;
    gap: 10px;
  }

  .hero-lead-title {
    font-size: 22px;
    margin: 4px 0 6px;
  }

  .hero-side-stack {
    grid-template-columns: 1fr;
  }

  .hero-side-card {
    grid-template-columns: 96px minmax(0, 1fr);
  }

  /* 手机端采用精致横版杂志卡，一屏展示更多真实菜图 */
  .menu-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .dish-card {
    flex-direction: row;
    align-items: stretch;
  }

  .dish-media {
    width: 124px;
    aspect-ratio: auto;
    min-height: 124px;
    flex-shrink: 0;
  }

  .dish-cuisine-tag {
    left: 6px;
    top: 6px;
    font-size: 10.5px;
    padding: 2px 7px;
  }

  .dish-selected-mark {
    right: 6px;
    top: 6px;
  }

  .dish-body {
    padding: 11px 12px;
    min-width: 0;
    gap: 5px;
  }

  .dish-title {
    font-size: 16px;
  }

  .dish-desc {
    font-size: 12.5px;
    -webkit-line-clamp: 2;
  }

  .dish-footer {
    padding-top: 4px;
  }

  .orders-list {
    grid-template-columns: 1fr;
  }

  .modal-overlay {
    padding: 0;
    align-items: flex-end;
  }

  .modal-card {
    border-radius: 22px 22px 0 0;
    max-height: 92vh;
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
}


.menu-footer {
  padding: 16px 0;
  border-top: 1px solid var(--border);
  font-size: 14px;
}
.menu-footer a { color: var(--ink-secondary); text-underline-offset: 3px; }
.mobile-cuisine-toggle { display: none; }
.menu-section, .orders-section { scroll-margin-top: 84px; }
@media (max-width: 900px) {
  .search-box { padding-right: 71px; }
  .search-box .search-clear { right: 79px; }
  .mobile-cuisine-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    position: absolute;
    right: 0;
    top: 0;
    height: 40px;
    padding: 0 12px;
    border: 1px solid var(--accent-border);
    border-radius: var(--radius-pill);
    background: var(--accent-soft);
    color: var(--accent-hover);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
  }
  .menu-section, .orders-section { scroll-margin-top: 122px; }
}

.family-trigger {
  padding: 9px 15px;
  min-height: 38px;
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-pill);
  background: var(--accent-soft);
  color: var(--accent-hover);
  font: 600 14px var(--font-sans);
  white-space: nowrap;
  cursor: pointer;
}
.family-trigger:hover { border-color: var(--accent); }
.family-trigger[hidden], .mobile-family-trigger, .family-invite-dialog [hidden] { display: none !important; }
.family-invite-dialog {
  width: min(440px, calc(100vw - 28px));
  max-height: calc(100vh - 28px);
  max-height: calc(100dvh - 28px);
  padding: 0;
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-paper);
  color: var(--ink-primary);
  box-shadow: var(--shadow-lg);
}
.family-invite-dialog:not([open]) { display: none; }
.family-invite-dialog::backdrop { background: rgba(31,28,24,.54); }
body.family-dialog-open { overflow: hidden; }
.family-invite-body { padding: 20px 22px 22px; }
.family-invite-heading { display:flex; align-items:center; justify-content:space-between; gap:16px; }
.family-invite-heading h2 { margin:0; font:700 24px var(--font-serif); }
.family-invite-dialog p { margin:10px 0; color:var(--ink-secondary); font-size:14px; line-height:1.55; }
#family-invite-card-slot img {
  display:block; width:auto; height:auto; max-width:100%; max-height: min(45vh, 480px);
  margin:14px auto; border-radius:10px; -webkit-touch-callout:default; user-select:auto;
}
#family-invite-actions { display:flex; flex-wrap:wrap; gap:8px; }
#family-invite-save { display:inline-flex; align-items:center; justify-content:center; text-decoration:none; }
#family-invite-status:empty { display:none; }
#family-invite-manual { margin-top:10px; font-size:14px; color:var(--ink-secondary); }
#family-invite-url { margin-top:5px; width:100%; padding:8px; border:1px solid var(--border); border-radius:8px; }
@media (max-width: 900px) {
  .desktop-family-trigger { display:none; }
  .family-can-invite .mobile-family-trigger:not([hidden]) {
    display:block !important; position:absolute; right:0; top:0; height:40px; padding:0 11px;
  }
  .family-can-invite .search-box { padding-right:148px; }
  .family-can-invite .mobile-cuisine-toggle { right:78px; }
  .family-can-invite .search-box .search-clear { right:155px; }
}
@media (max-width: 480px) {
  .family-invite-body { padding:16px; }
}

#family-entry-gate {
  max-width: 29rem;
  margin: clamp(36px, 13vh, 150px) auto 36px;
  padding: 0 24px;
  color: var(--ink-primary, #382d28);
  font: 16px/1.65 var(--font-sans, system-ui);
}
#family-entry-gate .entry-mark { color: var(--accent, #a23c22); font-weight: 700; }
#family-entry-gate h1 { margin: 14px 0; font: 600 28px/1.35 var(--font-serif, serif); }
#family-entry-gate p { margin: 12px 0; }
#family-entry-gate button {
  margin-top: 6px;
  border: 0;
  border-radius: var(--radius-pill, 999px);
  background: var(--accent, #a23c22);
  color: white;
  padding: 10px 18px;
  font: inherit;
}

#family-entry-gate .entry-pair { margin:22px 0; }
.entry-pair label { display:block; margin-bottom:6px; font-weight:600; }
.entry-pair > div { display:flex; align-items:stretch; gap:8px; }
#family-entry-gate .entry-pair button { margin:0; white-space:nowrap; }
.entry-pair input {
  width:100%; min-width:0; border:1px solid var(--border-strong,#c9beb3); border-radius:10px;
  background:white; padding:10px; color:var(--ink-primary,#382d28); font:inherit;
}
#family-entry-gate .entry-pair-status { font-size:14px; }
.entry-pair-status:empty { display:none; }
.entry-alternative, #family-lan-help { margin:14px 0; font-size:14px; }
.entry-alternative summary, #family-lan-help summary {cursor:pointer; color:var(--accent-hover,#914028);}
#family-lan-address {word-break:break-all;}
#family-lan-code { font-variant-numeric: tabular-nums; letter-spacing: .12em; }
