:root {
  color-scheme: light;
  --bg: #f6f5ef;
  --ink: #1f2a24;
  --muted: #65706a;
  --line: #d9d4c7;
  --green: #2f6f4e;
  --green-dark: #214f38;
  --red: #a43d2f;
  --panel: #fffdf7;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.55;
  padding-bottom: calc(118px + env(safe-area-inset-bottom));
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 22px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 34px;
}

h2 {
  font-size: 28px;
}

h3 {
  font-size: 24px;
}

.eyebrow {
  color: var(--muted);
  font-size: 18px;
}

main {
  width: min(980px, 100%);
  margin: 0 auto;
  padding: 18px;
}

.panel {
  padding: 20px 0 28px;
  border-bottom: 1px solid var(--line);
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

button,
select,
input {
  min-height: 52px;
  border-radius: 8px;
  font: inherit;
}

button {
  border: 0;
  padding: 0 20px;
  cursor: pointer;
}

.primary-button {
  background: var(--green);
  color: #fff;
  font-weight: 700;
}

.primary-button:hover {
  background: var(--green-dark);
}

.secondary-button {
  background: #fff;
  color: var(--green-dark);
  border: 2px solid var(--green);
  font-weight: 700;
}

input,
select {
  border: 2px solid var(--line);
  background: #fff;
  color: var(--ink);
  padding: 0 14px;
}

.dish-list,
.today-menu-list,
.method-list {
  display: grid;
  gap: 14px;
}

.dish-index {
  position: sticky;
  top: 0;
  z-index: 8;
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  padding: 8px 0;
  overflow-x: auto;
  background: var(--bg);
  scrollbar-width: none;
}

.dish-index::-webkit-scrollbar {
  display: none;
}

.dish-index-button {
  flex: 0 0 auto;
  min-height: 40px;
  max-width: 168px;
  padding: 0 12px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--green-dark);
  font-size: 16px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dish-index-button.active {
  background: var(--green);
  color: #fff;
  border-color: var(--green);
}

.dish-index-button span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  margin-right: 6px;
  border-radius: 50%;
  background: #e8ece7;
  color: var(--green-dark);
  font-size: 13px;
}

.dish-index-button.active span {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
}

.recommendation-load-sentinel {
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 17px;
}

.dish-card,
.today-menu-item,
.method-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
}

.today-menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.menu-view-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 18px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.menu-view-tab {
  min-height: 46px;
  padding: 0 12px;
  background: transparent;
  color: var(--green-dark);
  font-size: 18px;
  font-weight: 800;
  white-space: nowrap;
}

.menu-view-tab.active {
  background: var(--green);
  color: #fff;
}

.menu-view-panel {
  display: none;
}

.menu-view-panel.active {
  display: block;
}

.history-section {
  margin-top: 0;
}

.history-filters {
  display: grid;
  grid-template-columns: minmax(150px, 0.45fr) minmax(0, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

.history-menu-list,
.history-dish-list {
  display: grid;
  gap: 12px;
}

.history-dish-section {
  display: grid;
  gap: 12px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

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

.history-menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

.history-thumbs {
  display: flex;
  flex: 0 0 auto;
  min-width: 84px;
}

.history-thumb {
  width: 52px;
  height: 52px;
  border: 2px solid #fff;
  border-radius: 8px;
  object-fit: cover;
  background: #e8ece7;
  box-shadow: 0 3px 10px rgba(31, 42, 36, 0.12);
}

.history-thumb + .history-thumb {
  margin-left: -20px;
}

.history-thumb-empty {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--green-dark);
  font-size: 15px;
  font-weight: 800;
}

.history-menu-item p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 17px;
}

.dish-cover {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 6px;
  margin-bottom: 14px;
  background: #e8ece7;
}

.dish-cover-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--green-dark);
  border: 1px solid var(--line);
}

.dish-cover-placeholder strong {
  font-size: 26px;
}

.dish-cover-placeholder span {
  color: var(--muted);
  font-size: 17px;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0;
}

.tag {
  padding: 4px 10px;
  background: #e9f0e8;
  color: var(--green-dark);
  border-radius: 999px;
  font-size: 17px;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 12px;
}

ul,
ol {
  margin: 8px 0 0;
  padding-left: 28px;
}

li {
  margin: 6px 0;
}

.source-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.source-links a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--red);
  font-weight: 700;
}

.source-cover {
  width: 72px;
  height: 48px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--line);
}

.source-video-card {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.source-video-ready {
  position: relative;
  display: block;
  min-height: auto;
  padding: 0;
  color: inherit;
  text-align: left;
}

.source-video-ready:focus-visible {
  outline: 3px solid rgba(47, 111, 78, 0.4);
  outline-offset: 3px;
}

.source-video-poster {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: #111;
}

.source-video-poster-empty {
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.16), transparent 34%),
    linear-gradient(135deg, #1f2a24, #111);
}

.source-video-play-icon {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 58px;
  height: 58px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.22);
  transform: translate(-50%, -50%);
}

.source-video-play-icon::before {
  content: "";
  position: absolute;
  left: 23px;
  top: 17px;
  width: 0;
  height: 0;
  border-top: 12px solid transparent;
  border-bottom: 12px solid transparent;
  border-left: 18px solid var(--green-dark);
}

.source-video-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
}

.source-video-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.4;
}

.source-video-pending {
  min-height: 100%;
  padding: 10px;
}

.source-video-pending .source-cover {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  margin-bottom: 8px;
}

.source-video-status {
  margin-top: 6px;
  color: var(--muted);
  font-size: 15px;
}

.compact-button {
  min-height: 36px;
  width: auto;
  padding: 0 12px;
  font-size: 15px;
  flex: 0 0 auto;
}

.search-row,
.source-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  margin-bottom: 16px;
}

.source-form {
  grid-template-columns: 1fr 1fr auto;
}

.shopping-list {
  display: grid;
  gap: 8px;
}

.shopping-item {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 50px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 12px;
}

.shopping-item input {
  width: 28px;
  height: 28px;
  min-height: 28px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 92px;
  transform: translateX(-50%);
  background: var(--ink);
  color: #fff;
  padding: 12px 18px;
  border-radius: 8px;
  font-size: 18px;
}

.video-player-open {
  overflow: hidden;
}

.fullscreen-video-player {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: #000;
  overflow: hidden;
  touch-action: none;
}

.fullscreen-video-player[hidden] {
  display: none;
}

.fullscreen-video-track {
  width: 100%;
  height: 100%;
  transition: transform 240ms cubic-bezier(0.2, 0.8, 0.2, 1);
  will-change: transform;
}

.fullscreen-video-track.is-dragging {
  transition: none;
}

.fullscreen-video-slide {
  width: 100%;
  height: 100%;
  background: #000;
}

.fullscreen-video {
  display: block;
  width: 100%;
  height: 100%;
  background: #000;
  object-fit: contain;
  user-select: none;
}

.fullscreen-video-close {
  position: fixed;
  top: max(18px, env(safe-area-inset-top));
  right: max(18px, env(safe-area-inset-right));
  z-index: 101;
  width: 58px;
  min-height: 58px;
  padding: 0;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.68);
  border: 1px solid rgba(255, 255, 255, 0.34);
  color: #fff;
  font-size: 42px;
  line-height: 1;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.34);
}

.fullscreen-video-toggle {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 101;
  width: 78px;
  min-height: 78px;
  padding: 0;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.48);
  border: 1px solid rgba(255, 255, 255, 0.32);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.34);
  transform: translate(-50%, -50%);
}

.fullscreen-video-toggle.is-playing {
  display: none;
}

.fullscreen-video-toggle::before,
.fullscreen-video-toggle::after {
  content: "";
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
}

.fullscreen-video-toggle.is-paused::before {
  left: 31px;
  width: 0;
  height: 0;
  border-top: 15px solid transparent;
  border-bottom: 15px solid transparent;
  border-left: 23px solid #fff;
}

.fullscreen-video-toggle.is-paused::after {
  display: none;
}

.fullscreen-video-nav {
  position: fixed;
  left: max(16px, env(safe-area-inset-left));
  right: max(16px, env(safe-area-inset-right));
  bottom: max(22px, env(safe-area-inset-bottom));
  z-index: 101;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.fullscreen-video-nav-button {
  min-height: 52px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.34);
  color: #fff;
  font-size: 17px;
  font-weight: 800;
  backdrop-filter: blur(10px);
}

.fullscreen-video-nav-button:disabled {
  opacity: 0.38;
  cursor: default;
}

.bottom-tabs {
  position: fixed;
  left: max(12px, env(safe-area-inset-left));
  right: max(12px, env(safe-area-inset-right));
  bottom: calc(12px + env(safe-area-inset-bottom));
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  padding: 6px;
  background: rgba(255, 255, 255, 0.96);
  border-top: 1px solid var(--line);
  border: 1px solid rgba(217, 212, 199, 0.9);
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(31, 42, 36, 0.16);
  backdrop-filter: blur(10px);
}

.bottom-tab {
  position: relative;
  min-height: 48px;
  padding: 0 4px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 15px;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
  word-break: keep-all;
  overflow: hidden;
  transition: background 160ms ease, color 160ms ease;
}

.bottom-tab.active {
  background: #eef5ed;
  color: var(--green-dark);
}

.bottom-tab.active::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 7px;
  width: 18px;
  height: 3px;
  border-radius: 999px;
  background: var(--green);
  transform: translateX(-50%);
}

@media (max-width: 720px) {
  body {
    font-size: 19px;
  }

  .topbar,
  .section-title,
  .today-menu-item,
  .history-menu-item,
  .two-col,
  .search-row,
  .source-form {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: stretch;
  }

  .topbar {
    position: static;
  }

  .two-col {
    display: block;
  }

  button,
  input,
  select {
    width: 100%;
  }

  .source-video-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .compact-button {
    width: 100%;
  }

  .history-menu-item {
    display: grid;
    grid-template-columns: auto 1fr;
  }

  .history-menu-item .compact-button {
    grid-column: 1 / -1;
  }

  .history-filters {
    grid-template-columns: 1fr;
  }

  .bottom-tabs {
    left: max(10px, env(safe-area-inset-left));
    right: max(10px, env(safe-area-inset-right));
    bottom: calc(10px + env(safe-area-inset-bottom));
  }

  .bottom-tab {
    min-width: 0;
    min-height: 46px;
    font-size: 14px;
  }

  .fullscreen-video-close {
    width: 58px;
  }

  .fullscreen-video-toggle {
    width: 78px;
  }

  .fullscreen-video-nav-button {
    width: 100%;
  }
}

/* Workbench redesign: compact family kitchen utility UI */
:root {
  --bg: #f4f6ef;
  --bg-soft: #edf4ea;
  --ink: #203027;
  --muted: #66746b;
  --line: #d8dfd2;
  --green: #277354;
  --green-dark: #184d37;
  --green-soft: #e4f0e7;
  --orange: #d97742;
  --orange-soft: #fff0e7;
  --panel: #fffefa;
  --white: #fff;
  --shadow: 0 14px 36px rgba(31, 55, 43, 0.1);
}

body {
  background:
    linear-gradient(180deg, rgba(228, 240, 231, 0.72), transparent 320px),
    var(--bg);
  font-size: 17px;
  font-weight: 500;
  line-height: 1.5;
  padding-bottom: calc(98px + env(safe-area-inset-bottom));
}

main {
  width: min(1180px, 100%);
  padding: 18px clamp(12px, 3vw, 26px);
}

h1 {
  font-size: clamp(30px, 6vw, 46px);
  line-height: 1.08;
  letter-spacing: 0;
}

h2 {
  font-size: clamp(22px, 4vw, 30px);
  line-height: 1.18;
}

h3 {
  font-size: clamp(20px, 3.2vw, 26px);
  line-height: 1.2;
}

button,
select,
input {
  min-height: 46px;
  border-radius: 8px;
  font-size: 16px;
}

button {
  transition: transform 140ms ease, background 160ms ease, border-color 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

button:active {
  transform: translateY(1px);
}

input,
select {
  border: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(24, 77, 55, 0.04);
}

.panel {
  padding: 0 0 28px;
  border-bottom: 0;
}

.home-workbench {
  display: grid;
  gap: 14px;
  margin-bottom: 18px;
  padding: clamp(18px, 4vw, 28px);
  border: 1px solid rgba(39, 115, 84, 0.16);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(228, 240, 231, 0.92), rgba(255, 254, 250, 0.98) 56%),
    var(--panel);
  box-shadow: var(--shadow);
}

.workbench-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 16px;
}

.workbench-main p {
  margin-top: 8px;
  color: var(--muted);
}

.workbench-main strong {
  color: var(--orange);
  font-size: 1.35em;
}

.workbench-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.primary-button {
  background: var(--green);
  box-shadow: 0 8px 20px rgba(39, 115, 84, 0.16);
}

.secondary-button {
  background: var(--white);
  border: 1px solid rgba(39, 115, 84, 0.28);
}

.compact-button {
  min-height: 42px;
  padding: 0 14px;
}

.selected-dish-rail {
  display: flex;
  gap: 8px;
  min-height: 42px;
  overflow-x: auto;
  scrollbar-width: none;
}

.selected-dish-rail::-webkit-scrollbar {
  display: none;
}

.selected-dish-rail p {
  align-self: center;
  color: var(--muted);
  font-size: 15px;
}

.selected-dish-chip {
  flex: 0 0 auto;
  display: grid;
  align-content: center;
  min-height: 42px;
  max-width: 172px;
  padding: 6px 12px;
  border: 1px solid rgba(39, 115, 84, 0.16);
  background: var(--white);
  color: var(--green-dark);
  text-align: left;
}

.selected-dish-chip span {
  overflow: hidden;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.selected-dish-chip small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.recommend-title {
  margin: 8px 0 10px;
}

.menu-view-tabs {
  display: inline-grid;
  width: auto;
  grid-auto-flow: column;
  grid-auto-columns: minmax(118px, auto);
  grid-template-columns: none;
  gap: 4px;
  margin-bottom: 12px;
  padding: 4px;
  border-color: rgba(39, 115, 84, 0.14);
  box-shadow: 0 8px 24px rgba(31, 55, 43, 0.06);
}

.menu-view-tab {
  min-height: 40px;
  border-radius: 6px;
  font-size: 16px;
}

.dish-index {
  top: 0;
  z-index: 12;
  margin: 0 -4px 12px;
  padding: 8px 4px;
  background: linear-gradient(180deg, var(--bg) 74%, rgba(244, 246, 239, 0));
}

.dish-index-button {
  min-height: 36px;
  max-width: 150px;
  border-color: rgba(39, 115, 84, 0.16);
  box-shadow: 0 6px 18px rgba(31, 55, 43, 0.06);
  font-size: 14px;
}

.dish-index-button.active {
  box-shadow: 0 8px 20px rgba(39, 115, 84, 0.18);
}

.dish-list,
.today-menu-list,
.history-dish-list,
.method-list {
  gap: 12px;
}

.dish-card {
  display: grid;
  grid-template-columns: minmax(132px, 190px) minmax(0, 1fr) auto;
  grid-template-areas:
    "media title action"
    "media tags action"
    "media viral action"
    "media body body"
    "media sources sources";
  gap: 8px 14px;
  align-items: start;
  padding: 14px;
  border-color: rgba(39, 115, 84, 0.12);
  background: var(--panel);
  box-shadow: 0 8px 24px rgba(31, 55, 43, 0.06);
}

.dish-card > .dish-cover,
.dish-card > .dish-cover-placeholder {
  grid-area: media;
  height: 100%;
  min-height: 132px;
  margin: 0;
}

.dish-card > h3 {
  grid-area: title;
  align-self: end;
}

.dish-card > .tags {
  grid-area: tags;
}

.dish-card > .viral-meta {
  grid-area: viral;
}

.dish-card > .two-col {
  grid-area: body;
}

.dish-card > .source-links {
  grid-area: sources;
}

.dish-card > button {
  grid-area: action;
  min-width: 132px;
  min-height: 44px;
  white-space: nowrap;
}

.tags {
  margin: 0;
  gap: 6px;
}

.tag {
  padding: 3px 8px;
  background: var(--green-soft);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 800;
}

.tag:nth-child(2) {
  background: var(--orange-soft);
  color: #a55025;
}

.two-col {
  grid-template-columns: minmax(150px, 0.8fr) minmax(0, 1.2fr);
  gap: 12px;
  margin-top: 2px;
  color: #2d3a32;
  font-size: 15px;
}

.two-col strong {
  color: var(--green-dark);
  font-size: 14px;
}

ul,
ol {
  margin-top: 4px;
  padding-left: 20px;
}

li {
  margin: 3px 0;
}

.source-links {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 8px;
  margin-top: 2px;
}

.source-video-card {
  border-color: rgba(39, 115, 84, 0.14);
}

.source-video-title,
.source-video-status {
  font-size: 13px;
}

.source-video-play-icon {
  width: 48px;
  height: 48px;
}

.source-video-play-icon::before {
  left: 19px;
  top: 14px;
}

.history-filters,
.search-row {
  margin-bottom: 12px;
}

.shopping-list {
  gap: 10px;
}

.shopping-item {
  min-height: 46px;
  border-color: rgba(39, 115, 84, 0.14);
  box-shadow: 0 5px 16px rgba(31, 55, 43, 0.04);
}

.toast {
  bottom: calc(86px + env(safe-area-inset-bottom));
  border-radius: 999px;
  font-size: 15px;
  box-shadow: 0 12px 30px rgba(31, 42, 36, 0.24);
}

.bottom-tabs {
  border-color: rgba(39, 115, 84, 0.16);
  border-radius: 8px;
  box-shadow: 0 16px 40px rgba(31, 55, 43, 0.16);
}

.bottom-tab {
  min-height: 46px;
  border-radius: 6px;
}

@media (max-width: 860px) {
  body {
    font-size: 16px;
  }

  .workbench-main {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .workbench-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .workbench-actions .compact-button,
  .selected-dish-chip,
  .dish-index-button {
    width: auto;
  }

  .menu-view-tabs {
    width: 100%;
    grid-auto-columns: 1fr;
  }

  .dish-card {
    grid-template-columns: minmax(96px, 34%) minmax(0, 1fr);
    grid-template-areas:
      "media title"
      "media tags"
      "viral viral"
      "body body"
      "sources sources"
      "action action";
    padding: 12px;
  }

  .dish-card > .dish-cover,
  .dish-card > .dish-cover-placeholder {
    min-height: 112px;
  }

  .dish-card > button {
    width: 100%;
    min-width: 0;
  }

  .two-col {
    display: grid;
    grid-template-columns: 1fr;
    font-size: 14px;
  }

  .source-links {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  main {
    padding: 12px;
  }

  .home-workbench {
    padding: 16px;
  }

  .dish-card {
    grid-template-columns: 1fr;
    grid-template-areas:
      "media"
      "title"
      "tags"
      "viral"
      "body"
      "sources"
      "action";
  }

  .dish-card > .dish-cover,
  .dish-card > .dish-cover-placeholder {
    min-height: 0;
  }

  .dish-index-button {
    max-width: 132px;
  }
}

/* Senior clarity pass: flat background, large readable controls, clear menu workflow */
:root {
  --bg: #f7f5ee;
  --bg-soft: #eef5ec;
  --ink: #14261d;
  --muted: #526258;
  --line: #cfd9cd;
  --green: #23734f;
  --green-dark: #123f2d;
  --green-soft: #e4f1e6;
  --orange: #c95f2b;
  --orange-soft: #fff0e5;
  --panel: #fffdfa;
  --white: #fff;
  --shadow: 0 10px 26px rgba(20, 38, 29, 0.08);
}

body {
  background: var(--bg);
  color: var(--ink);
  font-size: 20px;
  font-weight: 600;
  line-height: 1.65;
}

main {
  width: min(1040px, 100%);
  padding: 16px;
}

h1 {
  font-size: clamp(38px, 8vw, 58px);
  line-height: 1.05;
}

h2 {
  font-size: clamp(30px, 6vw, 40px);
}

h3 {
  font-size: clamp(27px, 5vw, 36px);
}

button,
select,
input {
  min-height: 58px;
  border-radius: 8px;
  font-size: 20px;
  font-weight: 800;
}

button {
  padding: 0 22px;
}

input,
select {
  border: 2px solid var(--line);
  padding: 0 16px;
  background: var(--white);
}

.primary-button,
.secondary-button {
  min-height: 60px;
}

.primary-button {
  background: var(--green);
  color: #fff;
  box-shadow: 0 8px 18px rgba(35, 115, 79, 0.18);
}

.secondary-button {
  background: var(--white);
  color: var(--green-dark);
  border: 2px solid var(--green);
}

.home-workbench {
  gap: 18px;
  margin-bottom: 22px;
  padding: clamp(20px, 5vw, 34px);
  border: 3px solid #d5e5d3;
  border-left: 10px solid var(--green);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.workbench-main {
  align-items: center;
}

.workbench-main p {
  margin-top: 10px;
  color: var(--muted);
  font-size: clamp(20px, 4vw, 26px);
}

.workbench-main strong {
  display: inline-block;
  min-width: 42px;
  color: var(--orange);
  font-size: 1.55em;
  text-align: center;
}

.workbench-actions {
  gap: 12px;
}

.workbench-actions .compact-button {
  min-height: 64px;
  padding: 0 24px;
  font-size: 21px;
}

.selected-dish-rail {
  gap: 10px;
  min-height: 58px;
}

.selected-dish-rail p {
  font-size: 20px;
  color: var(--muted);
}

.selected-dish-chip {
  min-height: 58px;
  max-width: 220px;
  padding: 8px 14px;
  border: 2px solid #d5e5d3;
  background: var(--green-soft);
}

.selected-dish-chip span {
  font-size: 20px;
}

.selected-dish-chip small {
  font-size: 15px;
}

.recommend-title {
  margin-top: 20px;
}

.menu-view-tabs {
  width: 100%;
  grid-auto-columns: 1fr;
  margin-bottom: 16px;
  border: 2px solid var(--line);
  background: var(--white);
}

.menu-view-tab {
  min-height: 58px;
  font-size: 21px;
}

.dish-index {
  top: 0;
  margin: 0 -6px 16px;
  padding: 10px 6px;
  background: var(--bg);
  border-bottom: 2px solid rgba(207, 217, 205, 0.78);
}

.dish-index-button {
  min-height: 48px;
  max-width: 190px;
  padding: 0 16px;
  border: 2px solid #d5e5d3;
  background: var(--white);
  color: var(--green-dark);
  font-size: 18px;
  box-shadow: none;
}

.dish-index-button span {
  width: 28px;
  height: 28px;
  font-size: 16px;
}

.dish-index-button.active {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}

.dish-list,
.today-menu-list,
.history-dish-list,
.method-list {
  gap: 18px;
}

.dish-card {
  grid-template-columns: minmax(210px, 30%) minmax(0, 1fr);
  grid-template-areas:
    "media title"
    "media tags"
    "media viral"
    "media action"
    "body body"
    "sources sources";
  gap: 14px 20px;
  padding: clamp(16px, 4vw, 24px);
  border: 2px solid #dfe7da;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.dish-card > .dish-cover,
.dish-card > .dish-cover-placeholder {
  min-height: 190px;
  border-radius: 8px;
}

.dish-card > h3 {
  align-self: start;
  color: var(--green-dark);
}

.dish-card > button {
  justify-self: start;
  min-width: min(280px, 100%);
  min-height: 64px;
  font-size: 22px;
}

.tags {
  gap: 8px;
}

.tag {
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 18px;
}

.two-col {
  grid-template-columns: 0.8fr 1.2fr;
  gap: 18px;
  margin-top: 4px;
  font-size: 20px;
  line-height: 1.75;
}

.two-col > div {
  padding: 14px;
  border: 2px solid #e2e8dc;
  border-radius: 8px;
  background: #fff;
}

.two-col strong {
  display: block;
  margin-bottom: 4px;
  color: var(--green-dark);
  font-size: 22px;
}

ul,
ol {
  padding-left: 26px;
}

li {
  margin: 8px 0;
}

.source-links {
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
}

.source-video-title {
  font-size: 17px;
}

.source-video-status {
  font-size: 17px;
}

.history-filters,
.search-row {
  gap: 12px;
}

.method-card {
  padding: 20px;
  border: 2px solid #dfe7da;
  box-shadow: var(--shadow);
}

.shopping-item {
  min-height: 62px;
  padding: 12px 16px;
  border: 2px solid #dfe7da;
  font-size: 21px;
}

.shopping-item input {
  width: 34px;
  height: 34px;
  min-height: 34px;
}

.bottom-tabs {
  left: max(10px, env(safe-area-inset-left));
  right: max(10px, env(safe-area-inset-right));
  bottom: calc(10px + env(safe-area-inset-bottom));
  gap: 6px;
  padding: 8px;
  border: 2px solid #d5e5d3;
  background: rgba(255, 255, 255, 0.98);
}

.bottom-tab {
  min-height: 60px;
  font-size: 18px;
}

.bottom-tab.active {
  background: var(--green-soft);
  color: var(--green-dark);
}

.toast {
  font-size: 20px;
  padding: 14px 22px;
}

@media (max-width: 860px) {
  body {
    font-size: 19px;
  }

  .workbench-actions {
    grid-template-columns: 1fr;
  }

  .workbench-actions .compact-button {
    width: 100%;
  }

  .dish-card {
    grid-template-columns: 1fr;
    grid-template-areas:
      "media"
      "title"
      "tags"
      "viral"
      "action"
      "body"
      "sources";
  }

  .dish-card > button {
    width: 100%;
  }

  .two-col {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  main {
    padding: 10px;
  }

  h1 {
    font-size: 40px;
  }

  h2 {
    font-size: 30px;
  }

  h3 {
    font-size: 28px;
  }

  .home-workbench {
    padding: 18px;
  }

  .menu-view-tab,
  .bottom-tab {
    font-size: 17px;
  }

  .dish-index-button {
    max-width: 166px;
    font-size: 17px;
  }

  .dish-card {
    padding: 16px;
  }

  .dish-card > .dish-cover,
  .dish-card > .dish-cover-placeholder {
    min-height: 0;
  }

  .two-col {
    font-size: 19px;
  }

  .tag {
    font-size: 16px;
  }
}

/* Dish separation pass: make every dish read as one independent section */
.dish-list,
.today-menu-list,
.history-dish-section .dish-list {
  counter-reset: dish-section;
}

.dish-card {
  position: relative;
  counter-increment: dish-section;
  overflow: hidden;
  border: 3px solid #c9dcc7;
  border-left: 12px solid var(--green);
  background:
    linear-gradient(90deg, rgba(228, 241, 230, 0.62), transparent 210px),
    var(--panel);
}

.dish-card::before {
  content: "第 " counter(dish-section) " 道";
  position: absolute;
  right: 16px;
  top: 14px;
  z-index: 2;
  min-width: 78px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--green-dark);
  color: #fff;
  font-size: 18px;
  font-weight: 900;
  line-height: 1.2;
  text-align: center;
  box-shadow: 0 8px 18px rgba(20, 38, 29, 0.18);
}

.dish-card > h3 {
  padding-right: 112px;
}

.dish-card > .dish-cover,
.dish-card > .dish-cover-placeholder {
  border: 4px solid #d9e9d8;
  background-color: #eef5ec;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.76);
}

.dish-card > .dish-cover {
  filter: saturate(1.05) contrast(1.03);
}

.source-links {
  position: relative;
  padding: 50px 12px 12px;
  border: 2px dashed #e1b18f;
  border-radius: 8px;
  background: var(--orange-soft);
}

.source-links::before {
  content: "做法视频";
  position: absolute;
  left: 12px;
  top: 10px;
  padding: 4px 12px;
  border-radius: 999px;
  background: #fff;
  color: #a55025;
  border: 1px solid #efc3a8;
  font-size: 18px;
  font-weight: 900;
}

.source-video-card {
  border: 2px solid #e6b894;
  background: #fffaf6;
  box-shadow: none;
}

.source-video-ready {
  outline: 0;
}

.source-video-poster,
.source-video-pending .source-cover {
  border-bottom: 2px solid #f0d2bd;
}

.source-video-play-icon {
  background: rgba(201, 95, 43, 0.94);
  border: 3px solid #fff;
}

.source-video-play-icon::before {
  left: 50%;
  top: 50%;
  transform: translate(-38%, -50%);
  border-left-color: #fff;
}

.viral-status {
  margin: 0 0 18px;
  padding: 14px 18px;
  border: 2px solid #f1c8a8;
  border-radius: 8px;
  background: #fff7ef;
  color: #9a4d22;
  font-size: 20px;
  font-weight: 800;
}

.viral-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: -2px 0 10px;
  color: #496356;
  font-size: 17px;
  font-weight: 800;
}

.viral-meta span {
  padding: 5px 10px;
  border: 1px solid #cfe0cc;
  border-radius: 999px;
  background: #f7fbf5;
}

.viral-meta .viral-platform {
  border-color: #c95f2b;
  background: #fff2e8;
  color: #a94c1d;
}

.viral-meta small {
  flex-basis: 100%;
  color: #6b766f;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.45;
}

.dish-card + .dish-card,
.history-dish-section + .history-dish-section {
  margin-top: 8px;
}

@media (max-width: 520px) {
  .dish-card {
    border-left-width: 8px;
  }

  .dish-card::before {
    left: 18px;
    right: auto;
    top: 18px;
  }

  .dish-card > h3 {
    padding-right: 0;
    padding-top: 4px;
  }

  .source-links {
    padding: 48px 10px 10px;
  }
}

/* Clearer date and search controls */
.history-filters,
.search-row {
  display: grid;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border: 3px solid #d7e5d3;
  border-radius: 8px;
  background: #fffdfa;
  box-shadow: 0 8px 20px rgba(20, 38, 29, 0.06);
}

.history-filters {
  grid-template-columns: minmax(230px, 0.42fr) minmax(0, 1fr);
}

.search-row {
  grid-template-columns: minmax(0, 1fr) minmax(150px, auto);
}

.history-filters select,
.history-filters input,
.search-row input {
  width: 100%;
  min-height: 66px;
  border: 3px solid #c9dcc7;
  border-radius: 8px;
  background-color: #fff;
  color: var(--ink);
  font-size: 22px;
  font-weight: 800;
  box-shadow: inset 0 2px 0 rgba(20, 38, 29, 0.04);
}

.history-filters select {
  appearance: none;
  padding: 0 54px 0 52px;
  background-image:
    url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Crect x='4' y='5' width='16' height='15' rx='2' stroke='%2323734F' stroke-width='2'/%3E%3Cpath d='M8 3v4M16 3v4M4 10h16' stroke='%2323734F' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E"),
    url("data:image/svg+xml,%3Csvg width='18' height='18' viewBox='0 0 18 18' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M4 7l5 5 5-5' stroke='%23123F2D' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-position: 18px 50%, calc(100% - 18px) 50%;
  background-repeat: no-repeat;
  background-size: 24px 24px, 18px 18px;
}

.history-filters input,
.search-row input {
  padding: 0 18px 0 56px;
  background-image: url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='11' cy='11' r='7' stroke='%2323734F' stroke-width='2.4'/%3E%3Cpath d='M16.5 16.5L21 21' stroke='%2323734F' stroke-width='2.4' stroke-linecap='round'/%3E%3C/svg%3E");
  background-position: 18px 50%;
  background-repeat: no-repeat;
  background-size: 24px 24px;
}

.history-filters input::placeholder,
.search-row input::placeholder {
  color: #7b8a81;
  font-weight: 700;
}

.history-filters select:focus,
.history-filters input:focus,
.search-row input:focus {
  border-color: var(--green);
  outline: 4px solid rgba(35, 115, 79, 0.18);
  outline-offset: 2px;
}

.search-row .primary-button {
  min-height: 66px;
  min-width: 150px;
  font-size: 22px;
}

@media (max-width: 720px) {
  .history-filters,
  .search-row {
    grid-template-columns: 1fr;
    padding: 12px;
  }

  .history-filters select,
  .history-filters input,
  .search-row input,
  .search-row .primary-button {
    min-height: 64px;
    font-size: 21px;
  }
}

/* Mobile dish cover: keep main dish photos short and clearly cropped */
@media (max-width: 720px) {
  .dish-card > .dish-cover,
  .dish-card > .dish-cover-placeholder {
    width: 100%;
    height: auto;
    min-height: 0;
    max-height: none;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    object-position: center;
  }
}

@media (max-width: 420px) {
  .dish-card > .dish-cover,
  .dish-card > .dish-cover-placeholder {
    aspect-ratio: 16 / 10;
  }
}
