:root {
  color-scheme: light;
  --ink: #17191f;
  --muted: #68707b;
  --line: #d9dce0;
  --paper: #fbfaf6;
  --surface: #ffffff;
  --soft: #f0f2f4;
  --blue: #274f63;
  --red: #a33a2f;
  --green: #526f62;
  --gold: #c6a15b;
  --shadow: 0 18px 50px rgb(23 25 31 / 10%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", Arial, sans-serif;
}

/* 新项目沿用原卖书页的竖向首图结构，并聚焦画面中央的书名标签。 */
.cover-visual.cover-focus {
  background: #efede8;
}

.cover-visual.cover-focus .product-image {
  object-fit: cover;
  object-position: center;
}

.cover-visual.cover-focus .cover-caption {
  bottom: 40px;
  border-radius: 6px;
  background: rgb(10 20 29 / 68%);
  padding: 10px 12px;
}

.source-note {
  margin-top: 20px;
  border: 1px solid color-mix(in srgb, var(--blue) 30%, transparent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--blue) 8%, transparent);
  padding: 16px;
}

.source-note strong {
  display: block;
  color: var(--ink);
  font-size: 16px;
}

.source-note p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

.creator-panel {
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  box-shadow: var(--shadow);
  padding: 22px;
}

.creator-panel p {
  margin: 0;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.8;
}

.page-disclaimer {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
}

.privacy-note {
  margin: 4px 0 2px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgb(39 79 99 / 8%) 0, transparent 260px),
    var(--paper);
  color: var(--ink);
  letter-spacing: 0;
  -webkit-text-size-adjust: 100%;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --ink: #eef1f5;
  --muted: #c4cad3;
  --line: #343b44;
  --paper: #0f1217;
  --surface: #181d24;
  --soft: #242b34;
  --blue: #7fa6b8;
  --red: #e07b70;
  --green: #8fb3a1;
  --gold: #d6b56e;
  --shadow: 0 18px 50px rgb(0 0 0 / 34%);
  background:
    linear-gradient(180deg, rgb(127 166 184 / 9%) 0, transparent 260px),
    var(--paper);
}

body[data-theme="dark"] {
  color-scheme: dark;
}

body[data-theme="dark"] label > span,
body[data-theme="dark"] legend {
  color: var(--ink);
}

body[data-theme="dark"] .section-heading p,
body[data-theme="dark"] .prelaunch-panel p,
body[data-theme="dark"] .payment-status-card p,
body[data-theme="dark"] .payment-guidance,
body[data-theme="dark"] .payment-feedback p,
body[data-theme="dark"] .memo-line,
body[data-theme="dark"] .service-line,
body[data-theme="dark"] .lookup-result span,
body[data-theme="dark"] .lookup-result p {
  color: var(--muted);
}

button,
input,
select,
textarea {
  font: inherit;
  letter-spacing: 0;
}

button {
  cursor: pointer;
}

.page-shell {
  width: min(1160px, calc(100vw - 32px));
  margin: 0 auto;
  padding: max(28px, env(safe-area-inset-top)) 0 max(42px, env(safe-area-inset-bottom));
}

.platform-notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0 0 18px;
  border: 1px solid color-mix(in srgb, var(--gold) 46%, transparent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--gold) 13%, var(--surface));
  padding: 12px 16px;
  color: var(--ink);
}

.platform-notice strong {
  flex: 0 0 auto;
  color: var(--red);
  font-size: 14px;
  line-height: 1.65;
}

.platform-notice p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

.product-panel,
.book-gallery,
.order-form,
.summary-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  box-shadow: var(--shadow);
}

.product-panel {
  padding: 22px;
}

.book-gallery {
  margin-top: 18px;
  padding: 22px;
}

.topline {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 14px;
}

.product-grid {
  display: grid;
  grid-template-columns: minmax(280px, 460px) 1fr;
  gap: 28px;
  align-items: start;
  margin-top: 18px;
}

.cover-visual {
  position: relative;
  min-height: 260px;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  border-radius: 6px;
  background: #111;
  color: #fff;
}

.product-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cover-caption {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 14px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  text-shadow: 0 2px 12px rgb(0 0 0 / 72%);
}

.cover-caption strong {
  font-size: 28px;
  line-height: 1;
  font-weight: 800;
  white-space: nowrap;
}

.cover-caption span {
  color: rgb(255 255 255 / 72%);
  font-size: 12px;
}

.product-copy h1 {
  max-width: 680px;
  margin: 0 0 24px;
  font-size: 46px;
  line-height: 1.04;
}

.product-copy h1 .product-creator-line,
.product-copy h1 .product-title-line {
  display: block;
  white-space: nowrap;
}

.product-copy h1 .product-title-line {
  font-size: .88em;
}

.summary-list {
  margin: 0;
}

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

.key-offer div {
  min-width: 0;
  border: 1px solid color-mix(in srgb, var(--blue) 24%, transparent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--blue) 8%, transparent);
  padding: 12px;
}

.key-offer span,
.book-facts span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.key-offer strong {
  display: block;
  margin-top: 6px;
  color: var(--ink);
  font-size: 17px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.key-offer .offer-price {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px;
  margin: 6px 0 0;
}

.key-offer .offer-price strong {
  display: inline;
  margin-top: 0;
}

.key-offer .original-price {
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
  line-height: 1.3;
}

.key-offer .price-badge {
  align-self: center;
  border: 1px solid color-mix(in srgb, var(--red) 42%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--red) 12%, transparent);
  padding: 3px 7px;
  color: var(--red);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.book-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 18px;
  margin-top: 14px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.book-facts p {
  min-width: 0;
  margin: 0;
}

.book-facts strong {
  display: block;
  margin-top: 4px;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.sales-signal {
  margin-top: 20px;
  border: 1px solid color-mix(in srgb, var(--red) 38%, transparent);
  border-radius: 8px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--red) 12%, transparent), color-mix(in srgb, var(--gold) 18%, transparent));
  padding: 16px;
}

.product-intro {
  margin: 18px 0 0;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.7;
}

.product-intro p {
  margin: 0;
}

.product-intro p + p {
  margin-top: 12px;
}

/* 书籍内页：横幅通栏一列，看得清细节；竖幅照片并排两列，避免单张过高。 */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.gallery-grid .gallery-wide {
  grid-column: 1 / -1;
}

.gallery-grid figure {
  min-width: 0;
  margin: 0;
}

.gallery-grid img {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 2;
  border-radius: 6px;
  object-fit: cover;
  background: var(--soft);
}

.gallery-grid figure.gallery-portrait img {
  aspect-ratio: 3 / 4;
}

.gallery-grid .gallery-spine {
  object-fit: contain;
  object-position: center;
  background: #fff;
}

.gallery-grid figcaption {
  margin-top: 7px;
  color: var(--muted);
  font-size: 13px;
}

.sales-main {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}

.sales-main > span {
  color: var(--red);
  font-size: 15px;
  font-weight: 800;
}

.sales-main strong {
  display: inline-flex;
  align-items: baseline;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  color: var(--red);
  font-size: 56px;
  line-height: .88;
  font-weight: 900;
}

.sales-main small {
  color: var(--gold);
  font-size: 14px;
  font-weight: 900;
}

.sales-bar {
  height: 10px;
  margin-top: 14px;
  overflow: hidden;
  border-radius: 999px;
  background: color-mix(in srgb, var(--red) 20%, transparent);
}

.sales-bar span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--red), var(--gold));
  transition: width .3s ease;
}

.sales-signal p {
  margin: 10px 0 0;
  color: var(--red);
  font-size: 15px;
  font-weight: 800;
}

.summary-list div,
.memo-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

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

dd {
  margin: 0;
  font-weight: 700;
}

.checkout-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, .75fr);
  gap: 18px;
  align-items: start;
  margin-top: 18px;
}

.order-form,
.summary-panel {
  padding: 22px;
}

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

.section-heading h2 {
  margin: 0;
  font-size: 20px;
}

.section-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.form-row {
  display: grid;
  gap: 14px;
  margin-bottom: 14px;
}

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

.buyer-memory-panel {
  margin: 12px 0 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.buyer-memory-choice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
}

.buyer-memory-choice input {
  flex: 0 0 auto;
  width: 18px;
  min-height: 18px;
  margin: 2px 0 0;
  padding: 0;
  accent-color: var(--blue);
}

.buyer-memory-choice > span {
  margin: 0;
  color: var(--ink);
  line-height: 1.45;
}

.buyer-memory-panel > p {
  margin: 8px 0 0 28px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.buyer-memory-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 24px;
  margin: 8px 0 0 28px;
}

#buyerProfileStatus {
  color: var(--blue);
  font-size: 12px;
}

.memory-clear-button {
  flex: 0 0 auto;
  border: 0;
  background: transparent;
  color: var(--blue);
  padding: 2px 0;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

label,
fieldset {
  min-width: 0;
}

label > span,
legend {
  display: block;
  margin-bottom: 8px;
  color: #2f343c;
  font-size: 14px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 12px 13px;
  outline: none;
}

body[data-theme="dark"] input,
body[data-theme="dark"] select,
body[data-theme="dark"] textarea {
  background: #151a21;
  color: var(--ink);
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgb(39 79 99 / 16%);
}

fieldset {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 75px;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 13px 8px;
}

legend {
  padding: 0 4px;
}

.radio-line {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.radio-line input {
  width: 16px;
  height: 16px;
}

small {
  display: block;
  min-height: 18px;
  margin-top: 5px;
  color: var(--red);
  font-size: 12px;
}

.field-error {
  border-color: var(--red);
}

.prelaunch-panel {
  margin-bottom: 16px;
  border: 1px solid rgb(198 161 91 / 42%);
  border-radius: 8px;
  background: rgb(198 161 91 / 14%);
  padding: 13px;
}

.prelaunch-panel strong {
  display: block;
  color: var(--red);
  font-size: 15px;
}

.prelaunch-panel p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.order-form.is-prelaunch input,
.order-form.is-prelaunch textarea {
  background: var(--soft);
  color: var(--muted);
}

.primary-button,
.secondary-button,
.ghost-button {
  min-height: 42px;
  border-radius: 6px;
  border: 1px solid transparent;
  font-weight: 800;
}

.primary-button {
  width: 100%;
  margin-top: 8px;
  background: var(--ink);
  color: #fff;
}

body[data-theme="dark"] .primary-button {
  background: var(--blue);
  color: #071017;
}

.primary-button:disabled {
  cursor: wait;
  opacity: .64;
}

.secondary-button {
  flex: 1;
  background: var(--blue);
  color: #fff;
}

.ghost-button {
  min-height: 36px;
  padding: 0 12px;
  background: var(--soft);
  color: var(--ink);
}

.summary-list {
  display: grid;
  gap: 12px;
}

.summary-list div {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.summary-list .total-row {
  border-bottom: 0;
  color: var(--red);
  font-size: 24px;
}

.checkout-block {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.payment-status-card {
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 12px;
  align-items: start;
  margin-bottom: 14px;
  border: 1px solid rgb(82 111 98 / 26%);
  border-radius: 8px;
  background: rgb(82 111 98 / 10%);
  padding: 12px;
}

.status-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: var(--green);
  color: #fff;
  font-weight: 900;
}

.payment-status-card h3,
.payment-feedback h3 {
  margin: 0 0 4px;
  font-size: 16px;
}

.payment-status-card p,
.payment-guidance,
.payment-feedback p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.memo-line {
  margin-bottom: 10px;
  color: var(--muted);
}

.memo-line strong {
  color: var(--ink);
  text-align: right;
  overflow-wrap: anywhere;
}

.memo-line.highlight {
  border-radius: 6px;
  background: rgb(198 161 91 / 18%);
  padding: 10px;
}

.pay-focus {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.pay-focus-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 12px;
}

.pay-focus-item span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 13px;
}

.pay-focus-item strong {
  display: block;
  color: var(--ink);
  font-size: 22px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.pay-focus-item.amount strong {
  color: var(--red);
  font-size: 30px;
}

.pay-focus-item.memo {
  background: rgb(198 161 91 / 18%);
}

.payment-methods {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 14px;
}

.wechat-jsapi-panel {
  display: none;
  gap: 10px;
  margin-top: 14px;
}

.is-wechat .wechat-jsapi-panel {
  display: grid;
}

.wechat-direct-pay {
  margin-top: 0;
  background: #0b7a43;
}

.wechat-pay-status {
  margin: 0;
  border: 1px solid rgb(11 122 67 / 22%);
  border-radius: 6px;
  background: rgb(11 122 67 / 8%);
  color: var(--green);
  padding: 10px 12px;
  font-size: 14px;
  line-height: 1.5;
}

.wechat-pay-status.error {
  border-color: rgb(163 58 47 / 28%);
  background: rgb(163 58 47 / 8%);
  color: var(--red);
}

.payment-method {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--surface);
}

.payment-method h3 {
  margin: 0 0 10px;
  font-size: 15px;
}

.qr-box {
  display: grid;
  place-items: center;
  border: 1px solid #dfe3e7;
  border-radius: 6px;
  background: #fff;
  color: #68707b;
  padding: 10px;
  text-align: center;
  font-size: 13px;
}

.qr-box img {
  display: block;
  width: min(100%, 360px);
  height: auto;
  object-fit: contain;
}

.payment-guidance {
  margin-top: 10px;
}

.payment-proof-panel {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  border: 1px solid color-mix(in srgb, var(--green) 25%, transparent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--green) 8%, transparent);
  padding: 12px;
}

.payment-proof-panel .primary-button {
  margin-top: 0;
}

.payment-proof-trigger {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  text-align: center;
}

.payment-proof-trigger.is-disabled {
  cursor: wait;
  opacity: 0.68;
  pointer-events: none;
}

.visually-hidden-file {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
  padding: 0;
  margin: -1px;
}

.payment-proof-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.payment-proof-panel p.success {
  color: var(--green);
  font-weight: 700;
}

.payment-proof-panel p.error {
  color: var(--red);
  font-weight: 700;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.pay-done-button {
  margin-top: 12px;
}

.subtle-action {
  opacity: 0.86;
}

.payment-feedback {
  margin-top: 14px;
  border: 1px solid color-mix(in srgb, var(--gold) 42%, transparent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--gold) 14%, transparent);
  padding: 13px;
}

.service-copy-button {
  margin-top: 12px;
  width: 100%;
}

.restore-notice {
  margin: 0 0 12px;
  border: 1px solid color-mix(in srgb, var(--green) 28%, transparent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--green) 12%, transparent);
  color: var(--green);
  padding: 10px 12px;
  font-size: 14px;
  line-height: 1.5;
}

.service-line {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
  color: var(--muted);
}

.service-line strong {
  color: var(--ink);
  font-size: 18px;
}

.order-lookup {
  margin-top: 18px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.compact-heading {
  margin-bottom: 12px;
}

.lookup-form {
  display: grid;
  gap: 10px;
}

.lookup-form .secondary-button {
  width: 100%;
}

.lookup-result {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  border: 1px solid rgb(39 79 99 / 22%);
  border-radius: 8px;
  background: rgb(39 79 99 / 7%);
  padding: 12px;
}

.lookup-result[hidden] {
  display: none;
}

.lookup-result div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.lookup-result span,
.lookup-result p {
  margin: 0;
  color: var(--muted);
}

.lookup-result strong {
  color: var(--ink);
  text-align: right;
  overflow-wrap: anywhere;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 10;
  max-width: min(360px, calc(100vw - 40px));
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  padding: 12px 14px;
  box-shadow: 0 12px 30px rgb(0 0 0 / 20%);
}

.admin-shell {
  width: min(1280px, calc(100vw - 32px));
}

.admin-toolbar,
.admin-stock-panel,
.admin-table-wrap {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgb(255 255 255 / 94%);
  box-shadow: var(--shadow);
}

.admin-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(0, 2fr);
  gap: 18px;
  align-items: center;
  padding: 18px;
}

.admin-stock-panel {
  display: grid;
  grid-template-columns: minmax(260px, .7fr) minmax(0, 1.3fr);
  gap: 18px;
  align-items: end;
  margin-top: 18px;
  padding: 18px;
}

.stock-editor {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.stock-editor .secondary-button {
  width: auto;
  padding: 0 14px;
}

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

.inventory-stats div {
  border: 1px solid rgb(39 79 99 / 18%);
  border-radius: 8px;
  background: rgb(39 79 99 / 6%);
  padding: 12px;
}

.inventory-stats span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.inventory-stats strong {
  display: block;
  margin-top: 4px;
  color: var(--ink);
  font-size: 22px;
}

.admin-toolbar h1 {
  margin: 0;
  font-size: 28px;
}

.admin-toolbar p {
  margin: 6px 0 0;
  color: var(--muted);
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.admin-actions input {
  width: min(240px, 100%);
  min-height: 42px;
}

.admin-actions .primary-button,
.admin-actions .secondary-button,
.admin-actions .ghost-button {
  width: auto;
  margin: 0;
  padding: 0 14px;
}

.link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border-radius: 6px;
  background: var(--green);
  color: #fff;
  padding: 0 14px;
  font-weight: 800;
  text-decoration: none;
}

.disabled-link {
  pointer-events: none;
  opacity: .52;
}

.admin-table-wrap {
  margin-top: 18px;
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  min-width: 1320px;
  border-collapse: collapse;
}

.admin-table th,
.admin-table td {
  border-bottom: 1px solid var(--line);
  padding: 12px;
  text-align: left;
  vertical-align: top;
  font-size: 14px;
}

.admin-table th {
  position: sticky;
  top: 0;
  background: #f8f9fa;
  color: #2f343c;
  font-weight: 800;
}

.admin-table td {
  overflow-wrap: anywhere;
}

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

.row-actions .ghost-button {
  min-height: 34px;
  white-space: nowrap;
}

.tracking-input,
.refund-input,
.return-reason-input {
  min-width: 150px;
}

.refund-input {
  min-width: 110px;
}

.return-reason-input {
  min-width: 170px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 0 10px;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.status-ok {
  background: rgb(82 111 98 / 16%);
  color: var(--green);
}

.status-wait {
  background: rgb(198 161 91 / 20%);
  color: #80612d;
}

.status-danger {
  background: rgb(163 58 47 / 14%);
  color: var(--red);
}

@media (max-width: 860px) {
  .page-shell {
    width: min(100vw - 22px, 680px);
    padding-top: 12px;
  }

  .product-grid,
  .checkout-grid,
  .two-columns,
  .key-offer,
  .book-facts {
    grid-template-columns: 1fr;
  }

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

  .product-grid {
    gap: 18px;
  }

  .cover-visual {
    min-height: auto;
    width: min(100%, 280px);
  }

  .product-copy h1 {
    font-size: 34px;
  }

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

  .summary-panel {
    position: static;
  }

  .admin-toolbar,
  .admin-stock-panel {
    grid-template-columns: 1fr;
  }

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

  .inventory-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  body {
    background: var(--paper);
  }

  .product-panel,
  .book-gallery,
  .order-form,
  .summary-panel {
    padding: 16px;
  }

  .topline,
  .button-row,
  .payment-methods {
    grid-template-columns: 1fr;
  }

  .topline,
  .button-row {
    display: grid;
  }

  .cover-caption {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .cover-caption strong {
    font-size: 22px;
  }

  .cover-caption span {
    line-height: 1.25;
  }

  fieldset {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .page-shell {
    width: 100%;
    padding: 0 0 max(24px, env(safe-area-inset-bottom));
  }

  .product-panel,
  .book-gallery,
  .order-form,
  .summary-panel {
    border-right: 0;
    border-left: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .checkout-grid {
    gap: 10px;
    margin-top: 10px;
  }

  .cover-visual {
    width: 100%;
  }

  .product-copy h1 {
    font-size: 30px;
  }

  .book-gallery {
    margin-top: 10px;
  }

  .key-offer,
  .book-facts,
  .gallery-grid {
    gap: 8px;
  }

  .sales-main {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .sales-main strong {
    font-size: 48px;
  }

  .summary-list div,
  .memo-line {
    align-items: flex-start;
  }

  .memo-line strong {
    max-width: 58%;
  }

  .qr-box {
    padding: 8px;
  }

  .qr-box img {
    width: min(100%, 330px);
  }

  .primary-button,
  .secondary-button,
  .ghost-button {
    min-height: 48px;
  }

  .toast {
    right: 12px;
    bottom: max(12px, env(safe-area-inset-bottom));
    max-width: calc(100vw - 24px);
  }
}

.is-wechat .qr-box {
  border-color: rgb(82 111 98 / 34%);
  background: rgb(82 111 98 / 6%);
}

@media (min-width: 861px) {
  .summary-panel {
    position: sticky;
    top: 18px;
  }

  .is-desktop .summary-panel {
    max-height: calc(100vh - 36px);
    overflow: auto;
  }
}
