:root {
  color-scheme: light;
  --outside: #f3eade;
  --page: #fbf5eb;
  --surface: #fffbf5;
  --ink: #312219;
  --muted: #6f5749;
  --accent: #9d4129;
  --accent-dark: #803320;
  --soft-accent: #f9e7d9;
  --line: #e8d9ca;
  --strong-line: #d2ac95;
  --radius: 1rem;
  --member-width: 43.5rem;
  --member-gutter: clamp(1rem, 4vw, 1.75rem);
  --serif: "Noto Serif CJK SC", "Songti SC", "SimSun", serif;
  font-family: system-ui, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--outside);
}

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

body {
  margin: 0;
  font-size: 1rem;
  line-height: 1.5;
}

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

img {
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

button, input, select {
  font: inherit;
}

[hidden] {
  display: none !important;
}

button:disabled,
.button[aria-disabled="true"] {
  opacity: .55;
  cursor: not-allowed;
}

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

.muted {
  color: var(--muted);
}

.price {
  color: var(--accent);
  font-size: 1.125rem;
  font-weight: 740;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.member-shell {
  width: min(100%, var(--member-width));
  min-height: 100vh;
  min-height: 100svh;
  margin-inline: auto;
  background: var(--page);
  border-inline: 1px solid var(--line);
}

.site-header {
  min-height: 4.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .875rem;
  padding: .625rem var(--member-gutter);
  background: var(--page);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  min-height: 2.75rem;
  font: 800 1.65rem/1 var(--serif);
  letter-spacing: .07em;
  white-space: nowrap;
}

.brand-mark {
  position: relative;
  display: block;
  width: 1.9rem;
  height: 1.85rem;
  color: var(--accent);
}

.brand-mark::after {
  position: absolute;
  inset: .9rem 0 .14rem;
  border: .14rem solid currentColor;
  border-radius: .08rem .08rem 1rem 1rem;
  content: "";
}

.brand-mark i,
.brand-mark i::before,
.brand-mark i::after {
  position: absolute;
  width: .27rem;
  height: .64rem;
  border-left: .125rem solid currentColor;
  border-radius: 50%;
  content: "";
}

.brand-mark i {
  top: .06rem;
  left: .84rem;
}

.brand-mark i::before {
  top: .04rem;
  left: -.59rem;
}

.brand-mark i::after {
  top: .04rem;
  left: .36rem;
}

.header-actions,
.admin-identity {
  display: flex;
  align-items: center;
  gap: .875rem;
}

.header-link {
  display: inline-flex;
  min-height: 2.75rem;
  align-items: center;
  gap: .5rem;
  font-size: .9375rem;
  font-weight: 650;
  white-space: nowrap;
}

.header-link:hover {
  color: var(--accent);
}

.logout-link {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.member-content > .logout-link {
  margin-top: 1rem;
}

.receipt-mark {
  position: relative;
  width: .97rem;
  height: 1.15rem;
  border: 1.5px solid currentColor;
  border-radius: .17rem;
}

.receipt-mark::before {
  position: absolute;
  top: .24rem;
  right: .17rem;
  left: .17rem;
  height: 1.5px;
  background: currentColor;
  box-shadow: 0 .24rem currentColor;
  content: "";
}

.account-name,
.admin-label {
  padding-left: .875rem;
  border-left: 1px solid var(--strong-line);
  color: var(--muted);
  font-size: .875rem;
  white-space: nowrap;
}

.member-content {
  padding: 1.25rem var(--member-gutter) 2.5rem;
}

.menu-content {
  padding-bottom: calc(6.75rem + env(safe-area-inset-bottom, 0px));
}

.welcome {
  position: relative;
  display: flex;
  align-items: center;
  min-height: clamp(9rem, 36vw, 11.75rem);
  isolation: isolate;
  overflow: hidden;
  padding: clamp(1.125rem, 4.4vw, 2rem);
  border-radius: var(--radius);
  background: #f8dec3;
}

.welcome img,
.welcome::after {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.welcome img {
  z-index: -2;
  object-fit: cover;
  object-position: 63% 49%;
}

.welcome::after {
  z-index: -1;
  background: linear-gradient(90deg, #f8dec3, #f8dec3 33%, #f8dec3df 47%, #f8dec300 70%);
  content: "";
}

.welcome h1 {
  color: #3e2719;
  font: 800 clamp(1.5rem, 5.9vw, 2.53rem)/1.43 var(--serif);
  letter-spacing: .035em;
}

.category-section {
  margin-top: 1.375rem;
}

.category-section h2 {
  margin-bottom: .7rem;
  font-size: 1.375rem;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(.5rem, 2.3vw, .875rem);
  margin: 0;
  padding: 0;
  list-style: none;
}

.category-card {
  display: block;
  overflow: hidden;
  height: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.category-card:hover {
  border-color: var(--strong-line);
  color: var(--accent);
}

.category-card img {
  width: 100%;
  aspect-ratio: 1.55;
  object-fit: cover;
  background: var(--soft-accent);
}

.category-card-label {
  display: grid;
  gap: .15rem;
  padding: .6rem clamp(.42rem, 2vw, .9rem) .65rem;
}

.category-card-label strong {
  font-size: clamp(1rem, 4vw, 1.1875rem);
}

.category-card-label span {
  color: var(--muted);
  font-size: .875rem;
}

.category-content {
  display: grid;
  align-content: start;
  gap: .875rem;
}

.category-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
}

.category-heading h1 {
  font-size: 1.55rem;
}

.tab-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .5rem;
}

.tab-strip :is(a, button) {
  display: flex;
  min-height: 2.75rem;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: .625rem;
  background: var(--surface);
  color: var(--muted);
  font-weight: 650;
}

.tab-strip button {
  padding: .35rem .2rem;
  cursor: pointer;
}

.tab-strip :is(a, button):hover {
  border-color: var(--strong-line);
  color: var(--accent);
}

.tab-strip :is(a[aria-current="page"], button[aria-selected="true"]) {
  border-color: var(--accent);
  background: var(--accent);
  color: #fffaf5;
}

.dish-list,
.order-list,
.checkout-items,
.admin-dish-list {
  display: grid;
  gap: .65rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.dish-card {
  display: grid;
  grid-template-columns: clamp(4.25rem, 20vw, 6.75rem) minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(.6rem, 2.5vw, 1rem);
  padding: .6rem .75rem .6rem .6rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.food-photo {
  width: 100%;
  aspect-ratio: 1.18;
  border-radius: .65rem;
  background: var(--soft-accent);
  object-fit: cover;
}

.photo-placeholder {
  display: block;
}

.soup-photo {
  object-position: 72% center;
}

.dish-card h2,
.checkout-item h2,
.order-card h2,
.admin-dish-name h2 {
  font-size: 1rem;
  line-height: 1.35;
}

.dish-card .price,
.admin-dish-name .price {
  margin-top: .25rem;
}

.quantity-button,
.stepper {
  border: 1px solid var(--strong-line);
  border-radius: .625rem;
  background: var(--page);
}

.stepper {
  display: inline-flex;
  align-items: center;
}

.stepper button,
.quantity-button {
  display: grid;
  width: 2.625rem;
  height: 2.625rem;
  place-items: center;
  padding: 0;
  color: var(--accent);
  font-size: 1.4rem;
  line-height: 1;
}

.stepper button {
  border: 0;
  background: transparent;
}

.stepper span {
  display: grid;
  width: 1.75rem;
  height: 2.625rem;
  place-items: center;
  border-inline: 1px solid var(--line);
  background: var(--surface);
  font-weight: 650;
}

.order-bar {
  position: fixed;
  z-index: 1;
  inset: auto 0 0;
  display: flex;
  width: min(100%, var(--member-width));
  margin-inline: auto;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .75rem var(--member-gutter) calc(.75rem + env(safe-area-inset-bottom, 0px));
  border: 1px solid var(--line);
  border-bottom: 0;
  background: var(--page);
}

.order-bar-total {
  display: grid;
  gap: .03rem;
  white-space: nowrap;
}

.order-bar-total span {
  color: var(--muted);
  font-size: .875rem;
}

.order-bar-total strong {
  color: var(--accent);
  font-size: 1.55rem;
  line-height: 1.2;
}

.button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 2.85rem;
  padding: .6rem 1rem;
  border: 1px solid transparent;
  border-radius: .65rem;
  font-weight: 700;
  line-height: 1.3;
  white-space: nowrap;
}

.button-primary {
  background: var(--accent);
  color: #fffaf5;
}

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

.order-bar .button {
  width: min(57%, 17rem);
}

.button-full {
  width: 100%;
}

.button-outline {
  border-color: var(--strong-line);
  background: var(--surface);
  color: var(--accent-dark);
}

.button-small {
  min-height: 2rem;
  padding: .35rem .63rem;
  border-radius: .5rem;
  font-size: .875rem;
}

.detail-content {
  display: grid;
  gap: 1rem;
}

.detail-content h1,
.login-panel h1 {
  font-size: 1.55rem;
}

.panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.checkout-panel,
.order-card {
  display: grid;
  gap: .9rem;
  padding: 1rem;
}

.checkout-item {
  display: grid;
  grid-template-columns: 4.6rem minmax(0, 1fr) auto;
  align-items: center;
  gap: .8rem;
}

.checkout-item + .checkout-item {
  padding-top: .65rem;
  border-top: 1px solid var(--line);
}

.checkout-item .muted {
  margin-top: .25rem;
}

.key-values {
  display: grid;
  gap: .6rem;
  padding-top: .85rem;
  border-top: 1px solid var(--line);
}

.key-values div,
.order-card-head,
.order-card-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
}

.key-values dt,
.order-card time {
  color: var(--muted);
}

.order-card time {
  font-size: .875rem;
}

.order-line-names {
  display: grid;
  gap: .25rem;
  font-weight: 650;
}

.order-card-actions {
  display: flex;
  justify-content: flex-end;
  padding-top: .8rem;
  border-top: 1px solid var(--line);
}

.status {
  display: inline-block;
  padding: .2rem .55rem;
  border-radius: .45rem;
  font-size: .875rem;
  font-weight: 650;
  white-space: nowrap;
}

.status-open {
  color: #87351e;
  background: #f8e1d2;
}

.status-complete {
  color: #3d5837;
  background: #e8efe0;
}

.login-content {
  padding-top: clamp(2rem, 10vw, 5.5rem);
}

.login-panel {
  width: min(100%, 26rem);
  margin-inline: auto;
  padding: clamp(1.25rem, 5vw, 2rem);
}

.login-panel h1,
.editor-panel h2 {
  margin-bottom: 1rem;
}

.login-panel .header-link {
  margin-top: .5rem;
}

.login-hint {
  margin-bottom: 1rem;
  color: var(--muted);
}

.feedback {
  padding: .65rem .8rem;
  border-radius: .6rem;
  background: #e8efe0;
  color: #3d5837;
  font-size: .9375rem;
}

.feedback-error {
  background: #fbe6dc;
  color: #87351e;
}

.empty-state {
  padding: 1rem;
  color: var(--muted);
}

.fields {
  display: grid;
  gap: .85rem;
}

.field {
  display: grid;
  gap: .35rem;
  font-size: .875rem;
  font-weight: 650;
}

.field :is(input, select),
.date-field input {
  min-width: 0;
  padding: .6rem .75rem;
  border: 1px solid var(--line);
  border-radius: .55rem;
  background: var(--page);
  color: var(--ink);
  font-weight: 400;
}

.field :is(input, select) {
  width: 100%;
  min-height: 2.75rem;
  font-size: 1rem;
}

.field input::placeholder {
  color: var(--muted);
  opacity: 1;
}

.admin-header {
  padding-inline: max(var(--member-gutter), calc((100vw - 74rem) / 2));
}

.admin-shell {
  width: min(100%, 77.5rem);
  margin-inline: auto;
  padding: 1.75rem var(--member-gutter) 3rem;
}

.admin-home,
.admin-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: .875rem;
}

.admin-entry {
  display: grid;
  align-content: start;
  gap: .9rem;
  padding: 1.15rem;
}

.admin-entry .category-card-label {
  padding: 0;
}

.admin-entry-icon {
  display: grid;
  width: 2.75rem;
  height: 2.75rem;
  place-items: center;
  border-radius: .7rem;
  background: var(--soft-accent);
  color: var(--accent);
}

.admin-entry-icon .brand-mark {
  transform: scale(.82);
}

.account-mark {
  position: relative;
  width: 1.35rem;
  height: 1.35rem;
}

.account-mark::before,
.account-mark::after {
  position: absolute;
  left: 50%;
  border: 1.5px solid currentColor;
  transform: translateX(-50%);
  content: "";
}

.account-mark::before {
  top: .06rem;
  width: .56rem;
  height: .56rem;
  border-radius: 50%;
}

.account-mark::after {
  bottom: .06rem;
  width: 1.1rem;
  height: .53rem;
  border-radius: .55rem .55rem .15rem .15rem;
}

.admin-section .tab-strip {
  width: min(100%, 38rem);
}

.admin-filters {
  justify-self: end;
}

.section-heading {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: .6rem 1rem;
}

.admin-home h1,
.section-heading h1 {
  font-size: clamp(1.35rem, 3.4vw, 1.8rem);
}

.date-field {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  color: var(--muted);
  font-size: .875rem;
}

.date-field input {
  padding: .35rem .5rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .75rem;
}

.metric {
  display: grid;
  gap: .3rem;
  padding: .85rem clamp(.65rem, 2.2vw, 1.25rem);
}

.metric dt {
  color: var(--muted);
  font-size: .875rem;
  font-weight: 600;
}

.metric dd {
  color: var(--accent);
  font-size: clamp(1.25rem, 4vw, 1.8rem);
  line-height: 1.2;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}

.metric dd span {
  color: var(--muted);
  font-size: .875rem;
  font-weight: 500;
}

.dish-summary,
.table-panel,
.editor-panel {
  padding: 1rem;
}

.dish-summary h2,
.table-panel h2,
.editor-panel h2 {
  font-size: 1.0625rem;
}

.dish-summary dl {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem 1.5rem;
  margin-top: .55rem;
}

.dish-summary dl div {
  display: flex;
  gap: .55rem;
}

.dish-summary dd,
.table-price {
  color: var(--accent-dark);
  font-weight: 650;
  white-space: nowrap;
}

.table-scroll {
  overflow-x: auto;
}

table {
  width: 100%;
  margin-top: .6rem;
  border-collapse: collapse;
  text-align: left;
  font-size: .9375rem;
}

.order-table {
  min-width: 33rem;
}

th,
td {
  padding: .65rem .7rem;
  border-bottom: 1px solid var(--line);
}

thead th {
  background: var(--page);
  color: var(--muted);
  font-size: .875rem;
  font-weight: 600;
  white-space: nowrap;
}

tbody th {
  font-weight: 650;
}

.row-meta {
  display: block;
  color: var(--muted);
  font-size: .8125rem;
  font-weight: 400;
}

.panel-note,
.import-description {
  margin-top: .75rem;
  color: var(--muted);
  font-size: .875rem;
}

.admin-split {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(15rem, 1fr);
  align-items: start;
  gap: .875rem;
}

.admin-dish-list {
  gap: 0;
  padding: .2rem .85rem;
}

.admin-dish-list li {
  display: grid;
  grid-template-columns: 3.6rem minmax(0, 1fr) auto;
  align-items: center;
  gap: .65rem;
  padding: .7rem 0;
}

.admin-dish-list li + li {
  border-top: 1px solid var(--line);
}

.admin-dish-name .price {
  font-size: 1rem;
}

.dish-meta {
  font-size: .875rem;
}

.admin-row-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: .3rem;
}

.order-actions {
  justify-content: flex-start;
}

.import-description {
  margin-bottom: .875rem;
}

@media (max-width: 54rem) {
  .admin-shell {
    padding-top: 1rem;
  }
}

@media (max-width: 41rem) {
  .admin-split,
  .admin-entry-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .admin-entry {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
  }
}

@media (max-width: 23rem) {
  .header-actions {
    gap: .55rem;
  }

  .account-name {
    padding-left: .55rem;
  }

  .stepper button,
  .quantity-button {
    width: 2.15rem;
  }

  .stepper span {
    width: 1.35rem;
  }
}
