:root {
  --ink: #151715;
  --paper: #f7f0e6;
  --card: #fffaf1;
  --muted: #6d665e;
  --line: rgba(21, 23, 21, 0.16);
  --amber: #ffb04f;
  --teal: #67d7c4;
  --danger: #d84f4f;
  --shadow: 0 22px 64px rgba(20, 22, 20, 0.16);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background: var(--paper);
  font-family: "Microsoft YaHei UI", "PingFang SC", system-ui, sans-serif;
}

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

button {
  cursor: pointer;
}

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

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 18px;
  padding: 14px clamp(16px, 4vw, 56px);
  color: #fffaf1;
  background: rgba(17, 19, 18, 0.9);
  border-bottom: 1px solid rgba(255, 250, 241, 0.14);
  backdrop-filter: blur(14px);
}

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

.mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: var(--ink);
  background: var(--amber);
  border-radius: 8px;
  font-weight: 900;
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  color: rgba(255, 250, 241, 0.68);
  font-size: 12px;
}

.nav,
.userbar,
.actions,
.formActions,
.tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.nav {
  justify-content: center;
}

.nav a,
.nav button {
  padding: 8px 10px;
  color: rgba(255, 250, 241, 0.78);
  background: transparent;
  border: 0;
}

.userbar {
  justify-content: end;
}

.hello {
  color: rgba(255, 250, 241, 0.82);
}

.hero {
  position: relative;
  min-height: 78vh;
  overflow: hidden;
  color: #fffaf1;
  background: #111312;
}

.hero > img,
.heroShade {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hero > img {
  object-fit: cover;
}

.heroShade {
  background:
    linear-gradient(90deg, rgba(17, 19, 18, 0.94), rgba(17, 19, 18, 0.48) 54%, rgba(17, 19, 18, 0.1)),
    linear-gradient(0deg, rgba(17, 19, 18, 0.82), rgba(17, 19, 18, 0.02));
}

.heroText {
  position: relative;
  z-index: 1;
  width: min(760px, calc(100% - 32px));
  padding: clamp(80px, 12vw, 150px) 0 86px clamp(16px, 5vw, 76px);
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--amber);
  font-size: 13px;
  font-weight: 900;
}

.eyebrow.dark {
  color: #9b5f12;
}

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

h1 {
  margin-bottom: 16px;
  font-size: clamp(52px, 10vw, 116px);
  line-height: 0.95;
}

h2 {
  margin-bottom: 14px;
  font-size: clamp(28px, 4vw, 46px);
  line-height: 1.1;
}

.heroText p:not(.eyebrow) {
  max-width: 680px;
  color: rgba(255, 250, 241, 0.84);
  font-size: 20px;
  line-height: 1.7;
}

.btn,
.tab,
.iconBtn,
.linkBtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 14px;
  color: var(--ink);
  background: #eadccb;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-weight: 900;
}

.btn.primary,
.tab.active {
  background: var(--amber);
}

.btn.ghost {
  color: #fffaf1;
  background: rgba(255, 250, 241, 0.1);
  border-color: rgba(255, 250, 241, 0.22);
}

.btn.small {
  min-height: 34px;
  padding: 0 10px;
  font-size: 14px;
}

.btn.full {
  width: 100%;
}

.linkBtn {
  color: #8a5513;
  background: transparent;
  border: 0;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: #151715;
}

.stats article {
  padding: 22px clamp(16px, 4vw, 56px);
  color: #fffaf1;
  border-right: 1px solid rgba(255, 250, 241, 0.12);
}

.stats strong,
.stats span {
  display: block;
}

.stats strong {
  color: var(--teal);
  font-size: 22px;
}

.stats span {
  margin-top: 6px;
  color: rgba(255, 250, 241, 0.7);
}

.section {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 76px 0;
}

.sectionHead {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
}

.cartBtn span {
  display: grid;
  min-width: 24px;
  height: 24px;
  place-items: center;
  margin-left: 8px;
  background: var(--teal);
  border-radius: 6px;
}

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

.productCard,
.adminCard,
.adminItem,
.orderCard,
.modalCard {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 18px 52px rgba(40, 34, 26, 0.08);
}

.productCard {
  overflow: hidden;
}

.productCard img {
  width: 100%;
  aspect-ratio: 16 / 10.5;
  object-fit: cover;
  background: #252623;
}

.productBody {
  display: grid;
  gap: 12px;
  padding: 18px;
}

.titleRow {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.titleRow h3 {
  margin: 0;
  font-size: 20px;
}

.titleRow strong + span,
.titleRow strong ~ span,
.titleRow strong:last-child {
  color: #b85d1b;
}

.productBody p,
.muted {
  color: var(--muted);
  line-height: 1.7;
}

.tagRow {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tagRow span {
  padding: 5px 8px;
  background: #eee2d2;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 900;
}

.drawer {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  justify-items: end;
  pointer-events: none;
  background: rgba(17, 19, 18, 0);
  transition: background 0.2s ease;
}

.drawer.open {
  pointer-events: auto;
  background: rgba(17, 19, 18, 0.48);
}

.drawerPanel {
  width: min(500px, 100%);
  height: 100%;
  overflow-y: auto;
  padding: 24px;
  background: var(--card);
  transform: translateX(100%);
  transition: transform 0.2s ease;
}

.drawer.open .drawerPanel {
  transform: translateX(0);
}

.drawerHead {
  display: flex;
  justify-content: space-between;
  gap: 18px;
}

.iconBtn {
  width: 42px;
  height: 42px;
  padding: 0;
  font-size: 26px;
}

.cartLines,
.orderList,
.adminList {
  display: grid;
  gap: 12px;
}

.cartLine {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 12px;
  padding: 10px;
  background: #f1e5d5;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.cartLine img {
  width: 72px;
  height: 58px;
  object-fit: cover;
  border-radius: 6px;
}

.cartLine strong,
.cartLine span {
  display: block;
}

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

.qty {
  display: inline-grid;
  grid-template-columns: 30px 34px 30px;
  align-items: center;
  margin-top: 8px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.qty button {
  min-height: 30px;
  border: 0;
  background: transparent;
}

.qty b {
  text-align: center;
}

.formStack {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.formStack.narrow {
  max-width: 420px;
}

.formStack label {
  display: grid;
  gap: 7px;
  color: #4d463d;
  font-weight: 900;
}

input,
textarea,
select {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  color: var(--ink);
  background: #fffaf1;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
}

textarea {
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
  border-color: #0b8f7a;
  box-shadow: 0 0 0 3px rgba(103, 215, 196, 0.22);
}

.payMethods {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 0;
  padding: 0;
  border: 0;
}

.payMethods legend {
  grid-column: 1 / -1;
  margin-bottom: 4px;
  font-weight: 900;
}

.payChoice {
  display: grid;
  min-height: 48px;
  place-items: center;
  background: #f1e5d5;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-weight: 900;
}

.payChoice.active {
  border-color: #0b8f7a;
  box-shadow: 0 0 0 3px rgba(103, 215, 196, 0.18);
}

.payChoice input {
  position: absolute;
  width: 1px;
  opacity: 0;
}

.totalBox {
  display: grid;
  gap: 10px;
  padding: 14px;
  background: #f1e5d5;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.totalBox div {
  display: flex;
  justify-content: space-between;
}

.totalBox .grand {
  padding-top: 10px;
  border-top: 1px solid var(--line);
  font-size: 20px;
}

.modal {
  width: min(720px, calc(100% - 28px));
  max-height: calc(100dvh - 28px);
  padding: 0;
  overflow-y: auto;
  background: transparent;
  border: 0;
}

.modal::backdrop {
  background: rgba(17, 19, 18, 0.58);
}

.modalCard {
  position: relative;
  padding: 30px;
}

.modalCard.wide {
  width: min(760px, 100%);
}

.modalCard .closeDialog {
  position: absolute;
  top: 14px;
  right: 14px;
}

.authRegister #accountLabel,
.authRegister input[name="account"] {
  display: none;
}

body:not(.authRegister) .registerOnly {
  display: none;
}

.paymentLayout {
  display: grid;
  grid-template-columns: minmax(220px, 0.85fr) minmax(220px, 1fr);
  gap: 18px;
  margin: 18px 0;
}

.qrImage {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  background: #f1e5d5;
  border: 12px solid #f1e5d5;
  border-radius: 8px;
}

.payInfo {
  display: grid;
  gap: 8px;
}

.payInfo > span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.payInfo > strong {
  font-size: 21px;
  word-break: break-all;
}

.payInfo .amount {
  color: #b85d1b;
  font-size: 38px;
}

.copyBox,
.orderCard pre {
  white-space: pre-wrap;
  word-break: break-word;
  padding: 12px;
  color: #2f2a22;
  background: #f1e5d5;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.empty {
  padding: 24px;
  color: var(--muted);
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: 8px;
}

.status {
  color: #0b8f7a;
  font-weight: 900;
}

.footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  padding: 28px clamp(16px, 4vw, 56px);
  color: rgba(255, 250, 241, 0.72);
  background: var(--ink);
}

.footer strong {
  color: #fffaf1;
}

.adminPage {
  background: #f4eadc;
}

.adminShell {
  padding-top: 42px;
}

.adminGrid {
  display: grid;
  grid-template-columns: minmax(280px, 380px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.adminCard {
  padding: 24px;
}

.adminItem {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 14px;
  padding: 14px;
}

.adminItem.orderAdmin {
  grid-template-columns: minmax(260px, 1fr) minmax(260px, 0.9fr);
}

.adminItem.disabled {
  opacity: 0.55;
}

.adminItem img {
  width: 120px;
  height: 94px;
  object-fit: cover;
  border-radius: 8px;
}

.hidden {
  display: none !important;
}

@media (max-width: 1020px) {
  .productGrid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .adminGrid,
  .adminItem.orderAdmin {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .topbar {
    grid-template-columns: 1fr auto;
    gap: 10px;
    padding: 12px 14px;
  }

  .nav {
    grid-column: 1 / -1;
    justify-content: start;
    order: 3;
  }

  .brand small {
    display: none;
  }

  .hero {
    min-height: 76vh;
  }

  .heroText {
    padding: 72px 0 66px 16px;
  }

  .heroText p:not(.eyebrow) {
    font-size: 17px;
  }

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

  .section {
    width: calc(100% - 28px);
    padding: 58px 0;
  }

  .sectionHead {
    align-items: start;
    flex-direction: column;
  }

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

  .adminItem {
    grid-template-columns: 84px 1fr;
  }

  .adminItem img {
    width: 84px;
    height: 72px;
  }
}
