:root {
  --paper: #eeeae4;
  --paper-soft: #f5f2ed;
  --ink: #715646;
  --ink-strong: #5f4334;
  --muted: #9c8678;
  --rule: #b8a79a;
  --accent: #8d42ff;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
}

body {
  background: #e7e8eb;
  color: var(--ink);
  font-family: "Microsoft JhengHei", "PingFang TC", "Noto Sans CJK TC", Arial, sans-serif;
  letter-spacing: 0;
}

.menu-root {
  align-items: center;
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 36px 0;
}

.single-page {
  background: var(--paper);
}

.single-page .menu-root {
  display: block;
  padding: 0;
}

.page {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0) 38%),
    var(--paper);
  box-shadow: 0 18px 50px rgba(45, 35, 28, 0.16);
  height: 297mm;
  overflow: hidden;
  padding: 24mm 19mm 18mm;
  page-break-after: always;
  position: relative;
  width: 210mm;
}

.single-page .page {
  box-shadow: none;
}

.page:last-child {
  page-break-after: auto;
}

.page::after {
  border: 0.35mm solid rgba(113, 86, 70, 0.05);
  content: "";
  inset: 8mm;
  pointer-events: none;
  position: absolute;
}

.header {
  align-items: flex-start;
  display: flex;
  justify-content: space-between;
  min-height: 25mm;
}

.title {
  color: var(--ink);
  font-size: 22mm;
  font-weight: 300;
  line-height: 0.92;
  margin: 0;
}

.continuation .header {
  justify-content: flex-end;
}

.logo {
  align-items: flex-start;
  display: flex;
  justify-content: flex-end;
  padding-top: 0;
  position: absolute;
  right: 19mm;
  top: 26mm;
}

.logo img {
  display: block;
  height: auto;
  width: 43mm;
}

.top-rule {
  background: linear-gradient(90deg, var(--accent) 0 52%, var(--rule) 52% 100%);
  height: 0.9mm;
  margin: 10mm 0 9mm;
  width: 100%;
}

.continuation .top-rule {
  background: var(--rule);
  height: 0.35mm;
  margin: 10mm 0 9mm;
}

.section {
  display: grid;
  grid-template-columns: 48mm 1fr;
  min-height: var(--section-height, 74mm);
}

.section + .section {
  margin-top: 18mm;
}

.category {
  align-items: center;
  border-right: 0.35mm solid var(--rule);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-right: 9mm;
  text-align: center;
}

.category-icon {
  color: var(--ink);
  height: 17mm;
  margin-bottom: 6mm;
  width: 17mm;
}

.category-label {
  color: var(--ink);
  font-size: 5.7mm;
  font-weight: 500;
  line-height: 1.16;
}

.category-label span {
  display: block;
}

.items {
  align-self: center;
  padding-left: 10mm;
}

.item {
  align-items: baseline;
  display: grid;
  gap: 8mm;
  grid-template-columns: minmax(0, 1fr) 18mm;
  margin-bottom: 5.1mm;
}

.item:last-child {
  margin-bottom: 0;
}

.name {
  color: var(--ink-strong);
  font-size: 4.65mm;
  font-weight: 500;
  line-height: 1.25;
  min-width: 0;
}

.price {
  color: var(--ink-strong);
  font-size: 4.75mm;
  font-weight: 650;
  line-height: 1;
  text-align: right;
  white-space: nowrap;
}

.footer {
  align-items: center;
  bottom: 10mm;
  color: var(--muted);
  display: flex;
  font-size: 3.2mm;
  justify-content: space-between;
  left: 19mm;
  line-height: 1;
  position: absolute;
  right: 19mm;
}

.footer-line {
  background: rgba(184, 167, 154, 0.42);
  height: 0.25mm;
  left: 19mm;
  position: absolute;
  right: 19mm;
  top: -4mm;
}

svg {
  overflow: visible;
}

@media screen and (max-width: 900px) {
  body:not(.export-page) {
    min-width: 0;
    overflow-x: hidden;
  }

  body:not(.export-page) {
    background: var(--paper);
  }

  body:not(.export-page) .menu-root,
  body:not(.export-page).single-page .menu-root {
    display: flex;
    gap: 0;
    padding: 0;
    width: 100%;
  }

  body:not(.export-page) .page {
    box-shadow: none;
    height: auto;
    min-height: 100svh;
    overflow: visible;
    padding: clamp(24px, 5.2vw, 46px) clamp(18px, 5vw, 42px) clamp(38px, 7vw, 58px);
    width: 100%;
  }

  body:not(.export-page) .page::after {
    border-width: 1px;
    inset: 10px;
  }

  body:not(.export-page) .header,
  body:not(.export-page) .continuation .header {
    align-items: flex-start;
    justify-content: space-between;
    min-height: clamp(74px, 16vw, 118px);
  }

  body:not(.export-page) .title {
    font-size: clamp(48px, 12vw, 82px);
    line-height: 0.95;
  }

  body:not(.export-page) .logo {
    margin-left: auto;
    padding-top: 0;
    position: static;
    right: auto;
    top: auto;
  }

  body:not(.export-page) .logo img {
    width: clamp(104px, 27vw, 168px);
  }

  body:not(.export-page) .top-rule,
  body:not(.export-page) .continuation .top-rule {
    height: 2px;
    margin: clamp(16px, 4vw, 30px) 0 clamp(18px, 4.4vw, 34px);
  }

  body:not(.export-page) .section {
    display: block;
    min-height: 0;
    padding: clamp(20px, 4.8vw, 34px) 0 clamp(24px, 5vw, 38px);
  }

  body:not(.export-page) .section + .section {
    margin-top: clamp(8px, 2.5vw, 18px);
  }

  body:not(.export-page) .category {
    align-items: center;
    border-bottom: 1px solid rgba(184, 167, 154, 0.78);
    border-right: 0;
    flex-direction: row;
    gap: clamp(10px, 2.4vw, 16px);
    justify-content: flex-start;
    padding: 0 0 clamp(11px, 2.8vw, 18px);
    text-align: left;
  }

  body:not(.export-page) .category-icon {
    flex: 0 0 auto;
    height: clamp(32px, 7vw, 48px);
    margin: 0;
    width: clamp(32px, 7vw, 48px);
  }

  body:not(.export-page) .category-label {
    font-size: clamp(22px, 5.4vw, 34px);
    line-height: 1.2;
  }

  body:not(.export-page) .category-label span {
    display: inline;
  }

  body:not(.export-page) .category-label span + span::before {
    content: " ";
  }

  body:not(.export-page) .items {
    align-self: stretch;
    padding-left: 0;
    padding-top: clamp(16px, 4vw, 26px);
  }

  body:not(.export-page) .item {
    gap: clamp(12px, 3.2vw, 24px);
    grid-template-columns: minmax(0, 1fr) auto;
    margin-bottom: clamp(12px, 3vw, 20px);
  }

  body:not(.export-page) .name {
    font-size: clamp(15px, 3.8vw, 22px);
    line-height: 1.35;
  }

  body:not(.export-page) .price {
    font-size: clamp(15px, 3.8vw, 22px);
    line-height: 1.35;
  }

  body:not(.export-page) .footer {
    bottom: auto;
    font-size: clamp(11px, 2.7vw, 14px);
    left: auto;
    margin-top: clamp(30px, 7vw, 48px);
    position: relative;
    right: auto;
  }

  body:not(.export-page) .footer-line {
    left: 0;
    right: 0;
    top: -14px;
  }
}

@media screen and (max-width: 420px) {
  body:not(.export-page) .page {
    padding-left: 18px;
    padding-right: 18px;
  }

  body:not(.export-page) .item {
    gap: 10px;
  }

  body:not(.export-page) .name,
  body:not(.export-page) .price {
    font-size: 15px;
  }
}

@media print {
  body {
    background: #fff;
  }

  .menu-root {
    display: block;
    padding: 0;
  }

  .page {
    box-shadow: none;
  }
}

@page {
  margin: 0;
  size: A4;
}
