:root {
  color-scheme: light;
  --ink: #1f2621;
  --muted: #677067;
  --line: #dfe7dc;
  --paper: #fffaf0;
  --surface: #fffffb;
  --surface-soft: #f3f8f1;
  --peach: #d96b4d;
  --green: #2f6f55;
  --blue: #426f86;
  --rose: #ad4f64;
  --gold: #b8853f;
  --shadow: 0 18px 44px rgba(31, 38, 33, 0.12);
  --soft-shadow: 0 8px 24px rgba(31, 38, 33, 0.07);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: #f2f6f1;
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--ink);
  font-family:
    Inter, "HarmonyOS Sans SC", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", Arial, sans-serif;
  background:
    linear-gradient(180deg, #f2f7f0 0%, #fffaf1 42%, #eef6f4 100%),
    #f2f6f1;
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.app-shell {
  width: min(1160px, calc(100% - 36px));
  margin: 0 auto;
  padding: 28px 0 44px;
}

.topbar,
.section-head,
.quick-row,
.workspace,
.dish-form,
.total-row,
.cart-item,
.history-head,
.item-actions,
.person-tab {
  display: flex;
  align-items: center;
}

.topbar {
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--green);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  max-width: 760px;
  font-size: clamp(2rem, 5vw, 4.25rem);
  line-height: 1;
  letter-spacing: 0;
}

.brand-block {
  flex: 1 1 auto;
  min-width: 0;
}

.brand-title {
  display: inline-flex;
  align-items: center;
  min-height: 92px;
  max-width: min(760px, 100%);
  margin-top: -4px;
  padding: 18px 34px 20px;
  color: #203428;
  background-image:
    linear-gradient(90deg, rgba(255, 250, 240, 0.3), rgba(255, 250, 240, 0.06)),
    url("assets/title-plaque.png");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 100% 100%;
  font-family: "KaiTi", "STKaiti", "FangSong", "PingFang SC", serif;
  font-size: clamp(2rem, 4.8vw, 4rem);
  font-weight: 900;
  line-height: 1.02;
  text-shadow:
    0 2px 0 rgba(255, 255, 255, 0.72),
    0 8px 20px rgba(33, 52, 40, 0.16);
}

h2 {
  margin-bottom: 0;
  font-size: 1.45rem;
  line-height: 1.12;
  letter-spacing: 0;
}

.name-switcher,
.category-tabs {
  display: inline-flex;
  gap: 6px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 251, 0.76);
  box-shadow: var(--soft-shadow);
}

.person-tab,
.category-tabs button {
  min-height: 40px;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
  white-space: nowrap;
}

.person-tab {
  gap: 8px;
  padding: 0 13px;
}

.person-tab.active,
.category-tabs button.active {
  background: var(--ink);
  color: #fff;
}

.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--peach);
}

.dot.lover {
  background: var(--blue);
}

.hero-panel {
  position: relative;
  min-height: 340px;
  overflow: hidden;
  border-radius: 8px;
  background: #2b2119;
  box-shadow: var(--shadow);
}

.hero-panel img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  padding: 30px;
  color: #fff;
  background:
    linear-gradient(90deg, rgba(19, 24, 20, 0.72), rgba(19, 24, 20, 0.16) 54%, rgba(19, 24, 20, 0.52)),
    linear-gradient(180deg, rgba(0, 0, 0, 0.06), rgba(0, 0, 0, 0.56));
}

.hero-overlay .eyebrow,
.hero-overlay p {
  color: rgba(255, 255, 255, 0.82);
}

.hero-overlay h2 {
  max-width: 680px;
  margin-bottom: 10px;
  font-size: clamp(2.2rem, 5vw, 4.2rem);
  line-height: 1;
}

.hero-overlay p {
  max-width: 560px;
  font-size: 1.02rem;
  line-height: 1.55;
  margin-bottom: 0;
}

.round-command,
.icon-btn {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
}

.round-command {
  width: 84px;
  height: 54px;
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-size: 1.06rem;
  font-weight: 900;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.2);
  transition:
    transform 180ms ease,
    box-shadow 180ms ease;
}

.round-command.spinning {
  transform: scale(1.06);
  box-shadow: 0 0 0 10px rgba(255, 255, 255, 0.22);
}

.quick-row {
  gap: 12px;
  padding: 20px 0 18px;
  flex-wrap: wrap;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

label input,
.dish-form input,
.dish-form select {
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  background: rgba(255, 255, 251, 0.92);
  color: var(--ink);
  outline: 0;
}

label input:focus,
.dish-form input:focus,
.dish-form select:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 4px rgba(52, 133, 90, 0.12);
}

.wide-input {
  flex: 1 1 100%;
  gap: 10px;
}

.wide-input > span {
  color: var(--ink);
  font-size: 1.45rem;
  line-height: 1.15;
  font-weight: 900;
}

.workspace {
  align-items: flex-start;
  gap: 22px;
}

.menu-area {
  flex: 1 1 auto;
  min-width: 0;
}

.order-area {
  display: grid;
  flex: 0 0 372px;
  gap: 16px;
  position: sticky;
  top: 18px;
}

.section-head {
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.section-head.compact {
  margin-bottom: 12px;
}

.category-tabs {
  max-width: 100%;
  overflow-x: auto;
}

.category-tabs button {
  padding: 0 12px;
}

.dish-form {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 120px 110px auto;
  gap: 10px;
  margin-bottom: 16px;
}

.menu-demand {
  margin: -2px 0 16px;
  border: 1px solid rgba(173, 79, 100, 0.22);
  border-radius: 8px;
  padding: 13px 15px;
  background: linear-gradient(135deg, rgba(173, 79, 100, 0.1), rgba(47, 111, 85, 0.06));
  color: var(--rose);
  font-weight: 900;
  line-height: 1.45;
}

.dish-form input:first-child {
  min-width: 0;
}

.dish-form button,
.primary-btn {
  min-height: 48px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--green), #245f49);
  color: #fff;
  font-weight: 900;
  box-shadow: 0 10px 22px rgba(47, 111, 85, 0.2);
}

.dish-form button {
  padding: 0 15px;
}

.menu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

.dish-card,
.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 251, 0.88);
  box-shadow: var(--soft-shadow);
}

.dish-card {
  overflow: hidden;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    border-color 160ms ease;
}

.dish-card:hover {
  border-color: rgba(47, 111, 85, 0.3);
  box-shadow: 0 14px 32px rgba(31, 38, 33, 0.12);
  transform: translateY(-2px);
}

.dish-visual {
  display: block;
  width: 100%;
  height: 104px;
  object-fit: cover;
  background:
    radial-gradient(circle at 24% 28%, rgba(255, 255, 255, 0.92) 0 16%, transparent 17%),
    radial-gradient(circle at 70% 62%, rgba(255, 255, 255, 0.64) 0 13%, transparent 14%),
    linear-gradient(135deg, var(--dish-a), var(--dish-b));
}

.dish-body {
  padding: 14px;
}

.dish-title {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 8px;
}

.dish-title strong {
  font-size: 1.06rem;
  line-height: 1.25;
}

.dish-price {
  color: var(--rose);
  font-weight: 900;
  white-space: nowrap;
}

.dish-meta {
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 0.88rem;
}

.item-actions {
  gap: 7px;
  flex-wrap: wrap;
}

.item-actions button,
.mini-btn {
  min-width: 38px;
  min-height: 38px;
  border-radius: 8px;
  padding: 0 10px;
  background: #edf3ea;
  color: var(--ink);
  font-weight: 900;
}

.item-actions button.active-me {
  background: rgba(247, 120, 82, 0.17);
  color: #a33d25;
}

.item-actions button.active-lover {
  background: rgba(65, 106, 138, 0.16);
  color: #254f6d;
}

.panel {
  padding: 18px;
}

.icon-btn {
  width: 36px;
  height: 36px;
  background: #f5eee5;
  color: var(--muted);
  font-weight: 900;
}

.cart-list,
.history-list {
  display: grid;
  gap: 11px;
}

.cart-item {
  justify-content: space-between;
  gap: 10px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}

.cart-item:last-child {
  border-bottom: 0;
}

.cart-item strong,
.history-item strong {
  display: block;
  margin-bottom: 4px;
}

.cart-item span,
.history-item span {
  color: var(--muted);
  font-size: 0.86rem;
}

.quantity {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.quantity output {
  min-width: 22px;
  text-align: center;
  font-weight: 900;
}

.total-row {
  justify-content: space-between;
  margin: 16px 0;
  font-size: 1.12rem;
}

.primary-btn {
  width: 100%;
}

.history-item {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(255, 250, 240, 0.9), rgba(243, 248, 241, 0.9));
}

.history-head {
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.history-head time {
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 900;
  white-space: nowrap;
}

.empty-state {
  display: grid;
  gap: 4px;
  padding: 18px 16px;
  border: 1px dashed #d9cbbc;
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 251, 0.72);
}

.empty-state strong {
  color: var(--ink);
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(34, 32, 29, 0.38);
}

.modal-overlay[hidden] {
  display: none;
}

.modal-panel {
  display: grid;
  gap: 16px;
  width: min(440px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.menu-modal {
  max-height: min(86vh, 760px);
  overflow: auto;
  border: 1px solid #d4b47c;
  padding: 22px;
  background:
    linear-gradient(90deg, rgba(122, 86, 42, 0.05) 1px, transparent 1px),
    linear-gradient(#fff8e8, #f8ead0);
  background-size: 18px 18px, auto;
  color: #3c2b1f;
  font-family: "KaiTi", "STKaiti", "FangSong", "Microsoft YaHei", serif;
}

.menu-modal #modalKicker {
  color: #9b6435;
  text-align: center;
}

.menu-modal #modalTitle {
  text-align: center;
  font-size: 2.2rem;
  line-height: 1.05;
  border-bottom: 2px double rgba(128, 78, 37, 0.42);
  padding-bottom: 12px;
}

.modal-body {
  color: var(--muted);
  line-height: 1.6;
}

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

.modal-btn {
  min-height: 42px;
  border-radius: 8px;
  padding: 0 16px;
  font-weight: 900;
}

.modal-btn.primary {
  background: var(--green);
  color: #fff;
}

.modal-btn.secondary {
  background: #f3eadf;
  color: var(--ink);
}

.modal-btn.danger {
  background: var(--rose);
  color: #fff;
}

.summary-list {
  display: grid;
  gap: 10px;
}

.summary-list div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 9px;
}

.summary-list span {
  white-space: nowrap;
}

.summary-total {
  border-bottom: 0 !important;
  padding-bottom: 0 !important;
  color: var(--ink);
}

.paper-menu {
  display: grid;
  gap: 14px;
  color: #4d3525;
}

.paper-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: #8b6041;
  font-size: 0.95rem;
  font-weight: 900;
}

.paper-demand {
  border: 1px dashed rgba(128, 78, 37, 0.44);
  border-radius: 8px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.34);
  color: #a24c49;
  font-size: 1.05rem;
  font-weight: 900;
}

.paper-list div {
  border-bottom: 1px dashed rgba(128, 78, 37, 0.3);
  font-size: 1.08rem;
}

.paper-list strong {
  font-size: 1.14rem;
}

@media (max-width: 900px) {
  .topbar,
  .workspace {
    align-items: stretch;
    flex-direction: column;
  }

  .order-area {
    position: static;
    flex-basis: auto;
    width: 100%;
  }

  .name-switcher {
    align-self: flex-start;
  }

  .menu-area,
  .order-area {
    width: 100%;
  }
}

@media (max-width: 620px) {
  .app-shell {
    width: min(100% - 22px, 1180px);
    padding-top: 16px;
  }

  .topbar {
    gap: 14px;
    margin-bottom: 16px;
  }

  h1 {
    font-size: clamp(2rem, 11vw, 3.15rem);
    line-height: 1.03;
  }

  .brand-title {
    min-height: 74px;
    padding: 13px 18px 16px;
    font-size: clamp(1.85rem, 9.2vw, 2.55rem);
  }

  .hero-panel {
    min-height: 360px;
  }

  .hero-overlay {
    align-items: flex-start;
    flex-direction: column;
    justify-content: flex-end;
    padding: 20px;
  }

  .hero-overlay h2 {
    font-size: clamp(2rem, 10vw, 3.15rem);
  }

  .hero-overlay p {
    font-size: 0.96rem;
  }

  .quick-row,
  .section-head {
    align-items: stretch;
    flex-direction: column;
  }

  .dish-form {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 8px;
  }

  .dish-form input:first-child,
  .dish-form select,
  .dish-form input,
  .dish-form button {
    width: 100%;
  }

  .category-tabs,
  .name-switcher {
    border-radius: 8px;
    overflow-x: auto;
  }

  .person-tab,
  .category-tabs button {
    flex: 1 1 auto;
    justify-content: center;
  }

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

  .wide-input {
    flex: 0 0 auto;
  }

  .dish-visual {
    height: 70px;
  }

  .dish-body {
    padding: 10px 9px;
  }

  .dish-title {
    display: grid;
    gap: 4px;
    margin-bottom: 6px;
  }

  .dish-title strong {
    font-size: 0.9rem;
    line-height: 1.25;
  }

  .dish-price {
    font-size: 0.9rem;
  }

  .dish-meta {
    margin-bottom: 9px;
    font-size: 0.78rem;
  }

  .item-actions {
    flex-wrap: wrap;
    gap: 6px;
  }

  .item-actions button,
  .mini-btn {
    min-width: 32px;
    min-height: 34px;
    padding: 0 8px;
    font-size: 0.8rem;
  }

  .panel {
    padding: 16px;
  }

  .summary-list div,
  .paper-meta {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }

  .summary-list span {
    white-space: normal;
  }

  .menu-modal {
    padding: 18px;
  }

  .menu-modal #modalTitle {
    font-size: 1.9rem;
  }
}
