:root {
  --ink: #1f2924;
  --muted: #66736b;
  --line: #dce6df;
  --paper: #fbfcf8;
  --panel: #ffffff;
  --mint: #2fbf7a;
  --mint-deep: #167a50;
  --leaf: #8cc63f;
  --tomato: #e95d4f;
  --citrus: #f2b84b;
  --sky: #dff5f0;
  --shadow: 0 18px 45px rgba(37, 58, 46, 0.12);
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(223, 245, 240, 0.7), rgba(251, 252, 248, 0) 360px),
    var(--paper);
}

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

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

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

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 74px;
  padding: 12px clamp(18px, 4vw, 56px);
  border-bottom: 1px solid rgba(220, 230, 223, 0.8);
  background: rgba(251, 252, 248, 0.92);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 178px;
}

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(135deg, var(--mint), var(--leaf));
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0;
  box-shadow: 0 10px 22px rgba(47, 191, 122, 0.25);
}

.brand strong,
.brand small {
  display: block;
  line-height: 1.2;
}

.brand strong {
  font-size: 18px;
}

.brand small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.school-brand {
  display: inline-flex;
  flex: 1 1 auto;
  align-items: center;
  gap: 16px;
  min-width: 0;
  max-width: min(690px, 58vw);
}

.school-brand img {
  flex: 0 1 auto;
  width: auto;
  height: 52px;
  max-width: min(270px, 28vw);
  object-fit: contain;
}

.college-name {
  flex: 0 0 auto;
  padding-left: 16px;
  border-left: 1px solid rgba(31, 41, 36, 0.22);
  color: #101713;
  font-family: "STKaiti", "KaiTi", "Microsoft YaHei", serif;
  font-size: clamp(20px, 2.1vw, 30px);
  font-weight: 700;
  line-height: 1.05;
  white-space: nowrap;
}

.top-nav {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 5px;
  border: 1px solid rgba(220, 230, 223, 0.9);
  border-radius: 999px;
  background: #fff;
}

.top-nav a {
  padding: 8px 15px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 14px;
}

.top-nav a:hover {
  color: var(--mint-deep);
  background: var(--sky);
}

.cart-toggle,
.button,
.text-button,
.tab,
.quantity-button,
.modal-close {
  border: 0;
  cursor: pointer;
}

.cart-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 999px;
  color: #fff;
  background: var(--ink);
}

.cart-toggle strong {
  display: grid;
  min-width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 50%;
  background: var(--mint);
  font-size: 13px;
}

main {
  padding-bottom: 64px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(360px, 1.05fr);
  gap: clamp(24px, 5vw, 72px);
  align-items: center;
  min-height: calc(100vh - 74px);
  padding: clamp(36px, 6vw, 76px) clamp(18px, 6vw, 84px) 36px;
}

.hero-copy {
  max-width: 670px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--mint-deep);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 20px;
  font-size: clamp(36px, 6vw, 72px);
  line-height: 1.05;
  letter-spacing: 0;
}

.hero-text {
  max-width: 590px;
  margin-bottom: 26px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.8;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 20px;
  border-radius: 999px;
  font-weight: 800;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button.primary {
  color: #fff;
  background: var(--mint-deep);
  box-shadow: 0 12px 22px rgba(22, 122, 80, 0.2);
}

.button.primary:hover {
  background: #0f6843;
}

.button.ghost {
  border: 1px solid var(--line);
  background: #fff;
}

.button.full {
  width: 100%;
}

.hero-visual {
  position: relative;
  min-height: 490px;
  overflow: hidden;
  border-radius: 0;
  background:
    linear-gradient(135deg, rgba(47, 191, 122, 0.22), rgba(242, 184, 75, 0.18)),
    #eef7ef;
}

.hero-visual img {
  width: 100%;
  height: 100%;
  min-height: 490px;
  object-fit: cover;
}

.fresh-card {
  position: absolute;
  right: 22px;
  bottom: 22px;
  width: min(300px, calc(100% - 44px));
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
}

.fresh-card span,
.fresh-card small {
  display: block;
  color: var(--muted);
}

.fresh-card strong {
  display: block;
  margin: 6px 0;
  font-size: 20px;
}

.menu-section {
  padding: 76px clamp(18px, 6vw, 84px) 0;
}

.section-heading {
  max-width: 720px;
  margin-bottom: 26px;
}

.section-heading h2 {
  margin-bottom: 10px;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.15;
}

.section-heading p:not(.eyebrow) {
  color: var(--muted);
  line-height: 1.8;
}

.category-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 22px;
  overflow-x: auto;
  padding-bottom: 6px;
}

.tab {
  flex: 0 0 auto;
  min-height: 38px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: #fff;
}

.tab.active {
  color: #fff;
  border-color: var(--mint-deep);
  background: var(--mint-deep);
}

.menu-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 390px);
  gap: 24px;
  align-items: start;
}

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

.menu-card {
  display: grid;
  grid-template-columns: 154px minmax(0, 1fr);
  min-height: 178px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 32px rgba(37, 58, 46, 0.07);
}

.menu-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.menu-card-body {
  display: flex;
  min-width: 0;
  flex-direction: column;
  padding: 16px;
}

.card-topline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.menu-card h3 {
  margin-bottom: 8px;
  font-size: 19px;
  line-height: 1.25;
}

.tag {
  flex: 0 0 auto;
  padding: 4px 8px;
  border-radius: 999px;
  color: var(--mint-deep);
  background: var(--sky);
  font-size: 12px;
  font-weight: 800;
}

.menu-card p {
  display: -webkit-box;
  margin-bottom: 14px;
  overflow: hidden;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
}

.price {
  color: var(--tomato);
  font-size: 22px;
  font-weight: 900;
}

.price-stack {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.original-price,
.cart-original-price {
  color: #8d9a91;
  text-decoration: line-through;
}

.original-price {
  font-size: 14px;
  font-weight: 700;
}

.cart-original-price {
  display: inline;
  margin-right: 4px;
}

.add-button {
  min-width: 90px;
  min-height: 38px;
  padding: 0 12px;
  border-radius: 999px;
  color: #fff;
  background: var(--ink);
  font-weight: 800;
}

.order-panel {
  position: sticky;
  top: 94px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.order-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 20px 12px;
  border-bottom: 1px solid var(--line);
}

.order-panel-header h2 {
  margin-bottom: 0;
  font-size: 24px;
}

.text-button {
  min-height: 32px;
  padding: 0 8px;
  border-radius: 999px;
  color: var(--muted);
  background: transparent;
}

.text-button:hover {
  color: var(--tomato);
  background: #fff0ee;
}

.cart-list {
  max-height: 290px;
  overflow-y: auto;
  padding: 8px 20px 0;
}

.empty-state {
  margin: 14px 0 20px;
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

.cart-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}

.cart-item strong,
.cart-item span {
  display: block;
}

.cart-item strong {
  margin-bottom: 4px;
  font-size: 15px;
}

.cart-item span {
  color: var(--muted);
  font-size: 13px;
}

.quantity-control {
  display: grid;
  grid-template-columns: 28px 30px 28px;
  align-items: center;
  overflow: hidden;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 999px;
}

.quantity-button {
  height: 100%;
  color: var(--mint-deep);
  background: #f4fbf6;
  font-weight: 900;
}

.quantity-control output {
  text-align: center;
  font-size: 13px;
  font-weight: 800;
}

.order-summary {
  margin: 0;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}

.order-summary div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 9px;
}

.order-summary div:last-child {
  margin-bottom: 0;
}

.order-summary dt {
  color: var(--muted);
}

.order-summary dd {
  margin: 0;
  font-weight: 800;
}

.order-summary .total-row {
  align-items: baseline;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.total-row dd {
  color: var(--tomato);
  font-size: 24px;
}

.checkout-form {
  display: grid;
  gap: 12px;
  padding: 18px 20px 20px;
}

.checkout-form label {
  display: grid;
  gap: 7px;
}

.checkout-form span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.checkout-form input,
.checkout-form select,
.checkout-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  outline: none;
}

.checkout-form input,
.checkout-form select {
  height: 42px;
  padding: 0 12px;
}

.checkout-form textarea {
  resize: vertical;
  min-height: 76px;
  padding: 10px 12px;
}

.checkout-form input:focus,
.checkout-form select:focus,
.checkout-form textarea:focus {
  border-color: var(--mint);
  box-shadow: 0 0 0 3px rgba(47, 191, 122, 0.16);
}

.success-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(31, 41, 36, 0.45);
}

.modal-body {
  position: relative;
  width: min(420px, calc(100% - 36px));
  margin: min(18vh, 120px) auto 0;
  padding: 30px;
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  background: #f1f5f0;
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
}

.modal-body h2 {
  margin-bottom: 8px;
  font-size: 32px;
}

.modal-body p:not(.eyebrow) {
  color: var(--muted);
  line-height: 1.7;
}

.order-code {
  margin: 18px 0;
  padding: 18px;
  border-radius: 8px;
  background: var(--sky);
  color: var(--mint-deep);
  font-size: 26px;
  font-weight: 900;
  text-align: center;
}

[hidden] {
  display: none !important;
}

@media (max-width: 1180px) {
  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
  }

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

  .hero-visual img {
    min-height: 360px;
  }

  .menu-layout {
    grid-template-columns: 1fr;
  }

  .order-panel {
    position: static;
  }
}

@media (max-width: 820px) {
  .app-header {
    gap: 12px;
  }

  .school-brand {
    gap: 10px;
    max-width: calc(100vw - 86px);
  }

  .school-brand img {
    height: 44px;
    max-width: 220px;
  }

  .college-name {
    display: none;
  }

  .top-nav {
    display: none;
  }

  .hero {
    padding-top: 32px;
  }

  .hero-text {
    font-size: 16px;
  }

  .stats-strip,
  .menu-grid {
    grid-template-columns: 1fr;
  }

  .menu-card {
    grid-template-columns: 132px minmax(0, 1fr);
  }
}

@media (max-width: 560px) {
  .app-header {
    min-height: 66px;
    padding-inline: 14px;
  }

  .brand {
    min-width: 0;
  }

  .brand small {
    display: none;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
  }

  .school-brand img {
    height: 38px;
    max-width: calc(100vw - 92px);
  }

  .cart-toggle span {
    display: none;
  }

  h1 {
    font-size: 34px;
  }

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

  .hero-visual,
  .hero-visual img {
    min-height: 300px;
  }

  .fresh-card {
    right: 14px;
    bottom: 14px;
    width: calc(100% - 28px);
  }

  .menu-section {
    padding-top: 54px;
  }

  .menu-card {
    grid-template-columns: 1fr;
  }

  .menu-card img {
    height: 190px;
  }

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

  .add-button {
    width: 100%;
  }
}
