:root {
  color-scheme: light;
  --ink: #292822;
  --muted: #6d6a60;
  --paper: #f5efe4;
  --paper-deep: #ebe0ce;
  --card: #fffdf8;
  --accent: #d75834;
  --accent-dark: #aa3920;
  --green: #536e5c;
  --line: rgba(41, 40, 34, 0.15);
  --shadow: 0 20px 50px rgba(67, 52, 33, 0.13);
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
}

[hidden] {
  display: none !important;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    radial-gradient(circle at 86% 8%, rgba(215, 88, 52, 0.08), transparent 25rem),
    var(--paper);
  font-family: "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif;
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(215, 88, 52, 0.35);
  outline-offset: 3px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 18px 0;
  background: rgba(245, 239, 228, 0.88);
  backdrop-filter: blur(15px);
  transition: width 220ms ease, margin 220ms ease;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-weight: 800;
  text-decoration: none;
  letter-spacing: 0.04em;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 35px;
  height: 35px;
  color: #fffaf0;
  background: var(--accent);
  border-radius: 50% 50% 48% 45%;
  transform: rotate(-5deg);
}

.list-button,
.filter-button,
.book-action,
.empty-state button,
.close-button {
  cursor: pointer;
}

.list-button {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 9px 9px 16px;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
}

.list-button span {
  display: grid;
  place-items: center;
  min-width: 28px;
  height: 28px;
  padding: 0 7px;
  color: white;
  background: var(--ink);
  border-radius: 999px;
  font-size: 0.82rem;
}

main,
footer {
  width: min(1180px, calc(100% - 40px));
  margin-inline: auto;
  transition: width 220ms ease, margin 220ms ease;
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: clamp(30px, 8vw, 110px);
  align-items: center;
  min-height: 520px;
  padding: 70px clamp(26px, 7vw, 90px);
  overflow: hidden;
  color: #f9f3e8;
  background: var(--green);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.hero::before {
  content: "READ AGAIN";
  position: absolute;
  right: -24px;
  bottom: -28px;
  color: rgba(255, 255, 255, 0.055);
  font-family: Georgia, serif;
  font-size: clamp(5rem, 12vw, 10rem);
  font-weight: 800;
  line-height: 0.8;
  white-space: nowrap;
}

.hero-copy,
.hero-ticket {
  position: relative;
  z-index: 1;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.hero .eyebrow {
  color: #f5b69f;
}

.hero h1 {
  max-width: 650px;
  margin: 0;
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: clamp(3.4rem, 7vw, 6.5rem);
  font-weight: 800;
  letter-spacing: -0.06em;
  line-height: 1.05;
}

.hero h1 em {
  color: #ffc9a3;
  font-style: normal;
  white-space: nowrap;
}

.hero-text {
  max-width: 560px;
  margin: 25px 0 30px;
  color: rgba(255, 250, 240, 0.74);
  font-size: 1.04rem;
  line-height: 1.9;
}

.primary-link {
  display: inline-flex;
  align-items: center;
  gap: 18px;
  padding: 13px 19px;
  color: var(--ink);
  background: #fff5e5;
  border-radius: 999px;
  font-weight: 800;
  text-decoration: none;
  transition: transform 180ms ease, background 180ms ease;
}

.primary-link:hover {
  background: white;
  transform: translateY(-2px);
}

.hero-ticket {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1;
  padding: 30px;
  color: var(--ink);
  background: #ffc9a3;
  border: 2px dashed rgba(41, 40, 34, 0.35);
  border-radius: 50%;
  transform: rotate(4deg);
  box-shadow: 0 0 0 12px rgba(255, 201, 163, 0.14);
}

.hero-ticket strong {
  margin: -8px 0 -2px;
  font-family: Georgia, serif;
  font-size: 7.2rem;
  line-height: 1;
}

.hero-ticket strong small {
  font-size: 2.4rem;
  vertical-align: top;
}

.hero-ticket span {
  font-size: 0.82rem;
  font-weight: 700;
}

.hero-ticket .ticket-label {
  padding: 6px 10px;
  color: #fff8ee;
  background: var(--ink);
  border-radius: 999px;
}

.catalog {
  padding: 100px 0 70px;
}

.catalog-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 30px;
  margin-bottom: 30px;
}

.catalog-heading h2,
.english-promo h2,
.notice h2,
.drawer h2 {
  margin: 0;
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: clamp(2.2rem, 5vw, 4.4rem);
  line-height: 1.15;
}

.english-promo {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: clamp(35px, 8vw, 100px);
  align-items: center;
  margin-top: 34px;
  padding: 48px clamp(26px, 6vw, 72px);
  color: #fff8eb;
  background: var(--accent);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.english-promo .eyebrow {
  color: #ffd7bf;
}

.english-promo h2 {
  font-size: clamp(2.1rem, 4.6vw, 4rem);
}

.english-promo h2 em {
  color: #ffd7bf;
  font-style: normal;
}

.promo-details {
  display: grid;
  gap: 12px;
}

.promo-details p {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 3px 12px;
  margin: 0;
  padding: 18px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 16px;
}

.promo-details p > span {
  grid-row: 1 / 3;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  color: var(--accent);
  background: #fff4e5;
  border-radius: 50%;
  font-weight: 900;
}

.promo-details strong {
  font-size: 1.02rem;
}

.promo-details small {
  color: rgba(255, 248, 235, 0.72);
  line-height: 1.55;
}

.result-count {
  color: var(--muted);
  font-weight: 700;
}

.catalog-tools {
  position: sticky;
  top: 76px;
  z-index: 10;
  display: grid;
  grid-template-columns: minmax(260px, 360px) minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  margin-bottom: 34px;
  padding: 13px;
  background: rgba(245, 239, 228, 0.93);
  border: 1px solid var(--line);
  border-radius: 20px;
  backdrop-filter: blur(14px);
}

.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 15px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.search-box > span:not(.sr-only) {
  color: var(--muted);
  font-size: 1.5rem;
}

.search-box input {
  width: 100%;
  color: var(--ink);
  background: transparent;
  border: 0;
  outline: 0;
}

.filters {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}

.filters::-webkit-scrollbar {
  display: none;
}

.filter-button {
  flex: 0 0 auto;
  padding: 10px 15px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 999px;
  font-weight: 700;
}

.filter-button:hover,
.filter-button.is-active {
  color: white;
  background: var(--ink);
}

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

.book-card {
  position: relative;
  min-width: 0;
}

.book-image-wrap {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 0.82;
  overflow: hidden;
  background: var(--paper-deep);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.book-image-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  box-shadow: inset 0 0 35px rgba(41, 40, 34, 0.08);
}

.book-card img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 260ms ease;
}

.book-card:hover img {
  transform: scale(1.025);
}

.price-tag {
  position: absolute;
  right: 12px;
  top: 12px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  color: #fffaf1;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 6px 18px rgba(114, 42, 24, 0.24);
  font-family: Georgia, serif;
  font-size: 1.45rem;
  font-weight: 800;
  transform: rotate(7deg);
}

.book-info {
  padding: 15px 4px 0;
}

.book-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 0.76rem;
}

.book-category {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.book-info h3 {
  min-height: 3em;
  margin: 0 0 12px;
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: 1.04rem;
  line-height: 1.5;
}

.book-note {
  min-height: 1.45em;
  margin: -5px 0 12px;
  color: var(--accent-dark);
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1.45;
}

.book-action {
  width: 100%;
  padding: 10px 14px;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 12px;
  font-weight: 700;
  transition: color 160ms ease, background 160ms ease, border 160ms ease;
}

.book-action:hover {
  border-color: var(--ink);
}

.book-action.is-added {
  color: white;
  background: var(--green);
  border-color: var(--green);
}

.book-action:disabled {
  cursor: default;
  opacity: 0.86;
}

.book-action.is-sold-out {
  color: var(--muted);
  background: var(--paper-deep);
  border-color: transparent;
}

.empty-state {
  padding: 100px 20px;
  text-align: center;
}

.empty-state > span {
  color: var(--paper-deep);
  font-family: Georgia, serif;
  font-size: 6rem;
}

.empty-state h3 {
  margin: 0;
  font-family: "Noto Serif SC", serif;
  font-size: 1.8rem;
}

.empty-state p {
  color: var(--muted);
}

.empty-state button {
  padding: 10px 18px;
  color: white;
  background: var(--ink);
  border: 0;
  border-radius: 999px;
}

.notice {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 60px;
  margin-bottom: 80px;
  padding: 65px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

.notice > .eyebrow {
  grid-column: 1 / -1;
  margin-bottom: -25px;
}

.notice h2 {
  font-size: clamp(2.2rem, 4vw, 3.7rem);
}

.notice-items {
  display: grid;
  align-content: center;
}

.notice-items p {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 12px;
  margin: 0;
  padding: 17px 0;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  line-height: 1.7;
}

.notice-items p:last-child {
  border-bottom: 0;
}

.notice-items strong {
  color: var(--accent);
  font-family: Georgia, serif;
}

footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 0 35px;
  color: var(--muted);
  font-size: 0.84rem;
}

.merchant-contact {
  margin-left: auto;
  color: rgba(41, 40, 34, 0.68);
  font-size: 0.76rem;
  white-space: nowrap;
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgba(27, 26, 22, 0.46);
  backdrop-filter: blur(2px);
}

.drawer {
  position: fixed;
  inset: 0 0 0 auto;
  z-index: 40;
  display: flex;
  flex-direction: column;
  width: min(480px, 100%);
  padding: 28px;
  background: var(--card);
  box-shadow: -20px 0 60px rgba(41, 40, 34, 0.2);
}

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

.drawer h2 {
  font-size: 2.3rem;
}

.close-button {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  color: var(--ink);
  background: var(--paper);
  border: 0;
  border-radius: 50%;
  font-size: 1.6rem;
}

.drawer-content {
  flex: 1;
  overflow-y: auto;
  padding: 12px 0;
}

.list-empty {
  display: grid;
  place-items: center;
  min-height: 55vh;
  color: var(--muted);
  text-align: center;
}

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

.list-item img {
  width: 72px;
  height: 82px;
  object-fit: contain;
  background: var(--paper-deep);
  border-radius: 9px;
}

.list-item h3 {
  margin: 0 0 6px;
  font-size: 0.9rem;
  line-height: 1.45;
}

.list-item .item-price {
  color: var(--accent);
  font-weight: 800;
}

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

.quantity-control button {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  color: var(--ink);
  background: var(--paper);
  border: 0;
  cursor: pointer;
}

.quantity-control button:disabled {
  color: #bbb4a8;
  cursor: default;
}

.quantity-control span {
  color: var(--ink);
  font-size: 0.85rem;
  font-weight: 800;
  text-align: center;
}

.drawer-promo {
  margin: 6px 0 14px;
}

.drawer-promo:empty {
  display: none;
}

.promo-progress,
.promo-unlocked {
  padding: 15px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.promo-progress span,
.promo-unlocked > span {
  display: block;
  margin-bottom: 5px;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.promo-progress strong,
.promo-unlocked strong {
  display: block;
  font-size: 0.9rem;
  line-height: 1.55;
}

.promo-progress small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
}

.earphone-option {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
}

.earphone-option input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.drawer-footer {
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.drawer-footer > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.confirm-order {
  width: 100%;
  margin-top: 14px;
  padding: 13px 18px;
  color: white;
  background: var(--accent);
  border: 0;
  border-radius: 13px;
  font-weight: 800;
  cursor: pointer;
}

.confirm-order:hover {
  background: var(--accent-dark);
}

.confirm-order:disabled {
  color: rgba(255, 255, 255, 0.72);
  background: #aca59a;
  cursor: default;
}

.drawer-footer strong {
  color: var(--accent);
  font-family: Georgia, serif;
  font-size: 2rem;
}

.drawer-footer p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.admin-link {
  position: fixed;
  left: 14px;
  bottom: 14px;
  z-index: 25;
  padding: 7px 11px;
  color: var(--muted);
  background: rgba(255, 253, 248, 0.9);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(41, 40, 34, 0.1);
  font-size: 0.72rem;
  text-decoration: none;
  backdrop-filter: blur(10px);
}

.admin-link:hover {
  color: var(--accent-dark);
  border-color: rgba(170, 57, 32, 0.35);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 60;
  padding: 11px 18px;
  color: white;
  background: var(--ink);
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 15px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

body.drawer-open {
  overflow: hidden;
}

@media (min-width: 1181px) {
  .drawer-backdrop {
    display: none !important;
  }

  body.drawer-open {
    overflow-y: auto;
  }

  body.drawer-open .site-header,
  body.drawer-open main,
  body.drawer-open footer {
    width: min(1180px, calc(100vw - 520px));
    margin-left: max(20px, calc((100vw - 1660px) / 2));
    margin-right: 500px;
  }

  body.drawer-open .hero {
    grid-template-columns: minmax(0, 1fr);
  }

  body.drawer-open .hero-ticket {
    display: none;
  }

  body.drawer-open .book-grid {
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  }
}

@media (max-width: 920px) {
  .hero {
    grid-template-columns: 1fr 220px;
    gap: 40px;
    min-height: 460px;
    padding: 55px 45px;
  }

  .hero-ticket strong {
    font-size: 5rem;
  }

  .catalog-tools {
    grid-template-columns: 1fr;
  }

  .book-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

  .english-promo {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1180px) {
  .drawer {
    inset: auto 0 0;
    width: 100%;
    height: min(82dvh, 760px);
    border-radius: 24px 24px 0 0;
  }
}

@media (max-width: 680px) {
  .site-header,
  main,
  footer {
    width: min(100% - 24px, 1180px);
  }

  .site-header {
    padding: 12px 0;
  }

  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
    padding: 46px 26px 35px;
    border-radius: 22px;
  }

  .hero h1 {
    font-size: clamp(3rem, 15vw, 4.8rem);
  }

  .hero-ticket {
    justify-self: end;
    width: 175px;
    margin-top: -15px;
  }

  .hero-ticket strong {
    font-size: 4.3rem;
  }

  .catalog {
    padding-top: 72px;
  }

  .english-promo {
    gap: 26px;
    padding: 38px 26px;
    border-radius: 22px;
  }

  .catalog-heading {
    align-items: start;
  }

  .catalog-tools {
    top: 64px;
    margin-inline: -2px;
    padding: 9px;
  }

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

  .book-info h3 {
    font-size: 0.93rem;
  }

  .price-tag {
    width: 48px;
    height: 48px;
    font-size: 1.15rem;
  }

  .notice {
    gap: 35px;
    padding: 42px 26px;
    border-radius: 22px;
  }

  .notice > .eyebrow {
    margin-bottom: -8px;
  }

  footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .merchant-contact {
    margin-left: 0;
    white-space: normal;
  }

  .list-item {
    grid-template-columns: 60px minmax(0, 1fr);
  }

  .list-item img {
    width: 60px;
    height: 72px;
  }

  .quantity-control {
    grid-column: 2;
    justify-self: start;
    margin-top: -5px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

.admin-body {
  min-height: 100vh;
}

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding: 22px 0;
}

.back-shop {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
  text-decoration: none;
}

.admin-shell {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding: 45px 0 80px;
}

.admin-login {
  width: min(560px, 100%);
  margin: 8vh auto 0;
  padding: clamp(30px, 6vw, 56px);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.admin-login h1,
.admin-title-row h1 {
  margin: 0;
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  line-height: 1.1;
}

.admin-login > p:not(.eyebrow) {
  margin: 18px 0 28px;
  color: var(--muted);
  line-height: 1.8;
}

.admin-login label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.84rem;
  font-weight: 800;
}

.password-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.password-row input,
.admin-search input,
.restock-form input {
  min-width: 0;
  padding: 12px 14px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.password-row button,
.restock-form button {
  padding: 11px 18px;
  color: white;
  background: var(--ink);
  border: 0;
  border-radius: 12px;
  font-weight: 800;
  cursor: pointer;
}

.password-row button:disabled,
.restock-form button:disabled {
  opacity: 0.55;
  cursor: default;
}

.form-message,
.admin-message {
  min-height: 1.5em;
  margin: 12px 0 0;
  color: var(--accent-dark);
  font-size: 0.84rem;
}

.admin-title-row {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 25px;
  margin-bottom: 30px;
}

.logout-button {
  padding: 9px 14px;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
}

.admin-summary {
  display: grid;
  grid-template-columns: 150px 150px 1fr;
  gap: 12px;
  margin-bottom: 24px;
}

.admin-summary > div,
.admin-search {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 92px;
  padding: 16px 18px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
}

.admin-summary span {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
}

.admin-summary strong {
  margin-top: 5px;
  color: var(--accent);
  font-family: Georgia, serif;
  font-size: 2rem;
}

.admin-search {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 12px;
}

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

.inventory-item {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr) 90px 150px;
  gap: 16px;
  align-items: center;
  padding: 12px 16px 12px 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 15px;
}

.inventory-item > img {
  width: 62px;
  height: 70px;
  object-fit: contain;
  background: var(--paper-deep);
  border-radius: 9px;
}

.inventory-copy > span {
  color: var(--muted);
  font-size: 0.72rem;
}

.inventory-copy h2 {
  margin: 4px 0 0;
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: 0.96rem;
  line-height: 1.45;
}

.stock-value {
  color: var(--green);
  font-size: 0.9rem;
  text-align: right;
}

.restock-form {
  display: grid;
  grid-template-columns: 58px 1fr;
  gap: 7px;
}

.restock-form input {
  width: 58px;
  padding-inline: 8px;
}

.restock-form button {
  padding-inline: 10px;
}

@media (max-width: 760px) {
  .admin-header,
  .admin-shell {
    width: min(100% - 24px, 1120px);
  }

  .admin-summary {
    grid-template-columns: 1fr 1fr;
  }

  .admin-search {
    grid-column: 1 / -1;
  }

  .inventory-item {
    grid-template-columns: 54px minmax(0, 1fr) auto;
    gap: 11px;
    padding: 10px;
  }

  .inventory-item > img {
    width: 54px;
    height: 62px;
  }

  .stock-value {
    text-align: right;
  }

  .restock-form {
    grid-column: 2 / -1;
    grid-template-columns: 68px 92px;
    justify-content: end;
  }

  .restock-form input {
    width: 68px;
  }
}

@media (max-width: 520px) {
  .admin-header .brand > span:last-child {
    font-size: 0.86rem;
  }

  .admin-login {
    margin-top: 4vh;
    padding: 32px 24px;
  }

  .password-row {
    grid-template-columns: 1fr;
  }

  .admin-title-row {
    align-items: start;
  }
}

/* 订单、支付与售罄状态 */
.book-card.is-sold-out img,
.inventory-item.is-sold-out > img {
  filter: grayscale(1);
  opacity: 0.52;
}

.book-card.is-sold-out .price-tag {
  color: #f3f1ec;
  background: #77736c;
}

.drawer-header-actions {
  display: flex;
  gap: 8px;
}

.minimize-button {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  color: var(--ink);
  background: var(--paper);
  border: 0;
  border-radius: 50%;
  font-size: 1.2rem;
  font-weight: 900;
  cursor: pointer;
}

.drawer.is-minimized {
  inset: auto 18px 18px auto;
  width: min(310px, calc(100% - 36px));
  height: auto;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 16px 45px rgba(41, 40, 34, 0.22);
}

.drawer.is-minimized .drawer-header {
  align-items: center;
  padding: 0;
  border: 0;
}

.drawer.is-minimized .drawer-header .eyebrow {
  display: none;
}

.drawer.is-minimized .drawer-header h2 {
  font-size: 1.1rem;
}

.drawer.is-minimized .drawer-content,
.drawer.is-minimized .drawer-promo,
.drawer.is-minimized .drawer-footer {
  display: none;
}

.payment-body {
  min-height: 100vh;
}

.payment-shell {
  width: min(920px, calc(100% - 40px));
  margin: 0 auto;
  padding: 34px 0 90px;
}

.payment-card,
.payment-summary {
  margin-bottom: 22px;
  padding: clamp(26px, 5vw, 48px);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: 0 18px 50px rgba(41, 40, 34, 0.08);
}

.payment-card h1,
.payment-summary h1,
.payment-success h1 {
  margin: 0;
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: clamp(2.1rem, 6vw, 4rem);
  line-height: 1.15;
}

.payment-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 35px;
  color: #fff8eb;
  background: var(--ink);
}

.payment-summary .eyebrow {
  color: #f7b38e;
}

.payment-summary p:last-child {
  margin-bottom: 0;
  color: rgba(255, 248, 235, 0.72);
}

.payment-summary h1 span {
  color: #ffb88f;
  font-family: Georgia, serif;
}

.payment-total {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 155px;
  height: 155px;
  color: var(--ink);
  background: #ffc9a3;
  border-radius: 50%;
  transform: rotate(3deg);
}

.payment-total span {
  align-self: end;
  font-size: 0.78rem;
  font-weight: 800;
}

.payment-total strong {
  align-self: start;
  font-family: Georgia, serif;
  font-size: 2.9rem;
}

.payment-section-heading {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 16px;
  align-items: start;
  margin-bottom: 26px;
}

.payment-section-heading > span {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  color: white;
  background: var(--accent);
  border-radius: 50%;
  font-family: Georgia, serif;
  font-weight: 800;
}

.payment-section-heading h2,
.orders-heading h2 {
  margin: 0;
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: clamp(1.7rem, 4vw, 2.5rem);
}

.payment-section-heading p,
.orders-heading p {
  margin: 6px 0 0;
  color: var(--muted);
}

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

.qr-grid figure {
  margin: 0;
  padding: 14px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 18px;
  text-align: center;
}

.qr-grid img {
  display: block;
  width: 100%;
  max-height: 520px;
  object-fit: contain;
  background: white;
  border-radius: 12px;
}

.qr-grid figcaption {
  padding: 12px 0 2px;
  font-weight: 900;
}

.order-mini-list {
  margin: 22px 0;
  padding: 14px 18px;
  background: var(--paper);
  border-radius: 14px;
}

.order-mini-list div {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 9px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 0.88rem;
}

.order-mini-list div:last-child {
  border-bottom: 0;
}

.order-mini-list strong {
  flex: 0 0 auto;
  color: var(--accent);
}

.payment-primary,
.payment-home {
  display: inline-flex;
  justify-content: center;
  width: 100%;
  padding: 14px 20px;
  color: white;
  background: var(--accent);
  border: 0;
  border-radius: 13px;
  font-weight: 900;
  text-decoration: none;
  cursor: pointer;
}

.payment-primary:hover,
.payment-home:hover {
  background: var(--accent-dark);
}

.payment-primary:disabled {
  cursor: default;
  opacity: 0.5;
}

.proof-upload {
  display: grid;
  place-items: center;
  min-height: 180px;
  margin-bottom: 15px;
  padding: 28px;
  background: var(--paper);
  border: 2px dashed #c9c0b2;
  border-radius: 18px;
  text-align: center;
  cursor: pointer;
}

.proof-upload input {
  width: min(100%, 360px);
  margin-bottom: 14px;
}

.proof-upload small {
  margin-top: 7px;
  color: var(--muted);
}

.details-form {
  display: grid;
  gap: 16px;
}

.details-form label {
  display: grid;
  gap: 7px;
  font-size: 0.84rem;
  font-weight: 900;
}

.details-form input {
  padding: 13px 14px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.privacy-note {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.cancel-order-link {
  display: block;
  margin: 16px auto 0;
  padding: 10px 14px;
  color: var(--muted);
  background: transparent;
  border: 0;
  text-decoration: underline;
  cursor: pointer;
}

.payment-success,
.payment-error {
  max-width: 720px;
  margin: 8vh auto 0;
  text-align: center;
}

.payment-success .payment-home,
.payment-error .payment-home {
  width: auto;
  margin-top: 18px;
}

.success-mark {
  display: grid;
  place-items: center;
  width: 74px;
  height: 74px;
  margin: 0 auto 22px;
  color: white;
  background: var(--green);
  border-radius: 50%;
  font-size: 2rem;
}

.admin-summary {
  grid-template-columns: repeat(3, 1fr);
}

.admin-tabs {
  display: inline-flex;
  gap: 7px;
  margin-bottom: 20px;
  padding: 6px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
}

.admin-tab {
  padding: 10px 18px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 999px;
  font-weight: 800;
  cursor: pointer;
}

.admin-tab.is-active {
  color: white;
  background: var(--ink);
}

.admin-panel .admin-search {
  min-height: auto;
  margin-bottom: 14px;
}

.orders-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.orders-heading button,
.order-actions button,
.order-actions a {
  padding: 9px 13px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 0.8rem;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.orders-list {
  display: grid;
  gap: 14px;
}

.order-card,
.orders-empty {
  padding: 20px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
}

.order-card-head,
.order-card-head > div,
.order-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.order-card-head small {
  color: var(--muted);
}

.order-card-head > strong {
  color: var(--accent);
  font-family: Georgia, serif;
  font-size: 1.8rem;
}

.order-status {
  padding: 5px 9px;
  color: #715c23;
  background: #fff0bf;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 900;
}

.status-completed {
  color: #215e47;
  background: #d9eee5;
}

.status-cancelled,
.status-expired {
  color: #625e58;
  background: #e9e5de;
}

.order-book-lines {
  margin: 15px 0;
  padding: 10px 14px;
  background: var(--paper);
  border-radius: 12px;
}

.order-book-lines p {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin: 0;
  padding: 7px 0;
  font-size: 0.84rem;
}

.order-customer {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 20px;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 0.82rem;
}

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

.order-actions > span {
  margin-right: auto;
  color: var(--muted);
  font-size: 0.78rem;
}

.order-actions button {
  color: var(--accent-dark);
}

@media (max-width: 680px) {
  .payment-shell {
    width: min(100% - 24px, 920px);
  }

  .payment-summary {
    align-items: flex-start;
    padding: 30px 24px;
  }

  .payment-total {
    width: 112px;
    height: 112px;
  }

  .payment-total strong {
    font-size: 2.1rem;
  }

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

  .admin-summary {
    grid-template-columns: repeat(3, 1fr);
  }

  .admin-summary > div {
    min-height: 78px;
    padding: 12px;
  }

  .admin-summary strong {
    font-size: 1.55rem;
  }

  .orders-heading,
  .order-card-head,
  .order-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .order-actions a,
  .order-actions button {
    text-align: center;
  }
}

@media (max-width: 460px) {
  .payment-summary {
    display: grid;
  }

  .payment-total {
    justify-self: end;
  }

  .payment-card {
    padding: 25px 20px;
  }

  .admin-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }
}

/* 手机、平板与宽屏电脑的最终响应式适配 */
img {
  max-width: 100%;
}

.hero-copy,
.english-promo > div,
.catalog-heading > div,
.book-info,
.payment-section-heading > div,
.inventory-copy,
.order-card-head > div {
  min-width: 0;
}

.hero-text,
.promo-details small,
.book-info h3,
.book-note,
.list-item h3,
.order-mini-list span,
.order-book-lines span,
.order-customer span {
  overflow-wrap: anywhere;
}

.list-button,
.primary-link,
.filter-button,
.book-action,
.confirm-order,
.payment-primary,
.payment-home,
.cancel-order-link,
.back-shop,
.logout-button,
.admin-tab,
.orders-heading button,
.order-actions button,
.order-actions a {
  min-height: 44px;
}

@media (min-width: 1181px) {
  .drawer {
    width: 480px;
    padding-bottom: max(28px, env(safe-area-inset-bottom));
  }

  .payment-shell {
    width: min(1040px, calc(100% - 64px));
  }

  .admin-shell,
  .admin-header {
    width: min(1180px, calc(100% - 64px));
  }
}

@media (min-width: 681px) and (max-width: 1180px) {
  .site-header,
  main,
  footer {
    width: min(100% - 48px, 1080px);
  }

  .hero {
    padding-inline: clamp(36px, 6vw, 64px);
  }

  .drawer {
    padding-inline: max(28px, calc((100vw - 720px) / 2));
    padding-bottom: max(24px, env(safe-area-inset-bottom));
  }

  .drawer-content {
    overscroll-behavior: contain;
  }
}

@media (min-width: 921px) and (max-width: 1180px) {
  .book-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .hero {
    grid-template-columns: minmax(0, 1fr) minmax(220px, 280px);
    gap: clamp(32px, 5vw, 64px);
    min-height: 480px;
  }

  .hero-ticket strong {
    font-size: 6rem;
  }
}

@media (min-width: 681px) and (max-width: 920px) {
  .book-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  html {
    scroll-padding-top: 124px;
  }

  body {
    padding-bottom: env(safe-area-inset-bottom);
  }

  .site-header {
    gap: 12px;
    padding-top: max(12px, env(safe-area-inset-top));
  }

  .brand {
    min-width: 0;
  }

  .brand > span:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .list-button {
    flex: 0 0 auto;
    padding-block: 7px;
  }

  .hero {
    gap: 22px;
  }

  .hero h1 {
    font-size: clamp(2.75rem, 14vw, 4.35rem);
    line-height: 1.08;
  }

  .hero-text {
    margin-block: 20px 24px;
    font-size: 0.96rem;
    line-height: 1.75;
  }

  .hero-ticket {
    width: min(165px, 48vw);
  }

  .catalog-heading h2,
  .english-promo h2,
  .notice h2 {
    font-size: clamp(2rem, 10vw, 3.2rem);
  }

  .english-promo .eyebrow {
    letter-spacing: 0.1em;
    line-height: 1.75;
  }

  .catalog-tools {
    max-width: 100%;
    overflow: hidden;
  }

  .filters {
    margin-inline: -2px;
    padding: 2px 2px 4px;
  }

  .search-box input,
  .details-form input,
  .password-row input,
  .admin-search input,
  .restock-form input {
    font-size: 16px;
  }

  .book-grid {
    align-items: start;
  }

  .book-info {
    padding-top: 12px;
  }

  .book-info h3 {
    min-height: 3em;
  }

  .book-action {
    padding-block: 11px;
  }

  .drawer {
    height: min(88dvh, 760px);
    max-height: calc(100dvh - env(safe-area-inset-top) - 8px);
    padding: 20px 18px max(18px, env(safe-area-inset-bottom));
    border-radius: 22px 22px 0 0;
  }

  .drawer-header {
    align-items: center;
    padding-bottom: 13px;
  }

  .drawer h2 {
    font-size: 1.85rem;
  }

  .drawer-content {
    min-height: 0;
    overscroll-behavior: contain;
  }

  .drawer-footer {
    padding-top: 13px;
  }

  .drawer.is-minimized {
    inset: auto 12px max(12px, env(safe-area-inset-bottom)) auto;
    width: min(300px, calc(100% - 24px));
    padding: 12px 14px;
    border-radius: 16px;
  }

  .admin-link {
    left: 10px;
    bottom: max(10px, env(safe-area-inset-bottom));
  }

  .toast {
    bottom: max(20px, calc(env(safe-area-inset-bottom) + 12px));
    width: max-content;
    max-width: calc(100% - 32px);
    text-align: center;
  }

  .admin-header {
    gap: 12px;
    padding-block: max(14px, env(safe-area-inset-top)) 14px;
  }

  .back-shop {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
  }

  .admin-shell,
  .payment-shell {
    padding-top: 24px;
  }

  .admin-title-row {
    align-items: center;
  }

  .admin-summary {
    gap: 8px;
  }

  .admin-summary span {
    line-height: 1.35;
  }

  .payment-summary {
    gap: 20px;
  }

  .payment-section-heading {
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 12px;
  }

  .payment-section-heading > span {
    width: 42px;
    height: 42px;
  }

  .qr-grid img {
    max-height: min(68dvh, 520px);
  }

  .order-mini-list div,
  .order-book-lines p {
    align-items: flex-start;
  }
}

@media (max-width: 420px) {
  .site-header,
  main,
  footer,
  .admin-header,
  .admin-shell,
  .payment-shell {
    width: calc(100% - 20px);
  }

  .brand {
    gap: 7px;
    font-size: 0.92rem;
  }

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

  .list-button {
    gap: 6px;
    padding-left: 12px;
    font-size: 0.86rem;
  }

  .hero {
    padding: 38px 21px 30px;
  }

  .hero h1 {
    font-size: clamp(2.55rem, 13.5vw, 3.45rem);
  }

  .english-promo,
  .notice {
    padding-inline: 21px;
  }

  .catalog {
    padding-top: 60px;
  }

  .catalog-heading {
    gap: 12px;
  }

  .result-count {
    flex: 0 0 auto;
    font-size: 0.8rem;
  }

  .book-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
  }

  .book-card {
    display: grid;
    grid-template-columns: minmax(116px, 38%) minmax(0, 1fr);
    gap: 14px;
    padding: 10px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 17px;
  }

  .book-image-wrap {
    align-self: stretch;
    min-height: 168px;
    aspect-ratio: auto;
    border-radius: 12px;
  }

  .book-info {
    display: flex;
    flex-direction: column;
    padding: 3px 0 0;
  }

  .book-info h3,
  .book-note {
    min-height: 0;
  }

  .book-info h3 {
    margin-bottom: 8px;
    font-size: 0.96rem;
  }

  .book-note {
    margin-block: 0 9px;
  }

  .book-action {
    margin-top: auto;
  }

  .price-tag {
    top: 8px;
    right: 8px;
    width: 45px;
    height: 45px;
    font-size: 1.05rem;
  }

  .drawer {
    padding-inline: 14px;
  }

  .list-item {
    grid-template-columns: 52px minmax(0, 1fr);
    gap: 10px;
  }

  .list-item img {
    width: 52px;
    height: 64px;
  }

  .quantity-control {
    grid-template-columns: 36px 32px 36px;
  }

  .quantity-control button {
    width: 36px;
    height: 36px;
  }

  .admin-login {
    padding-inline: 20px;
  }

  .admin-header .brand > span:last-child {
    max-width: 150px;
  }

  .admin-title-row h1,
  .admin-login h1 {
    font-size: 2.35rem;
  }

  .admin-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .admin-summary > div {
    min-width: 0;
    padding: 10px 8px;
    text-align: center;
  }

  .admin-summary strong {
    font-size: 1.45rem;
  }

  .inventory-item {
    grid-template-columns: 48px minmax(0, 1fr) auto;
  }

  .inventory-item > img {
    width: 48px;
    height: 58px;
  }

  .restock-form {
    grid-column: 1 / -1;
    grid-template-columns: minmax(72px, 0.45fr) minmax(100px, 0.55fr);
    width: 100%;
  }

  .restock-form input {
    width: 100%;
  }

  .payment-summary {
    padding: 26px 20px;
  }

  .payment-total {
    width: 104px;
    height: 104px;
  }

  .payment-card {
    padding: 23px 18px;
    border-radius: 20px;
  }

  .qr-grid figure {
    padding: 10px;
  }

  .order-mini-list {
    padding-inline: 12px;
  }

  .order-mini-list div,
  .order-book-lines p {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
  }
}

@media (max-height: 620px) and (max-width: 1180px) {
  .drawer {
    height: calc(100dvh - 6px);
  }

  .drawer-header {
    padding-bottom: 10px;
  }

  .drawer-content {
    padding-block: 7px;
  }

  .drawer-footer {
    padding-top: 10px;
  }
}
