:root {
  --ink: #102033;
  --muted: #63748b;
  --line: rgba(77, 139, 201, 0.18);
  --panel: rgba(255, 255, 255, 0.82);
  --panel-strong: rgba(255, 255, 255, 0.96);
  --blue: #1687ff;
  --blue-deep: #0a5ed7;
  --cyan: #32d5ff;
  --mint: #26c98b;
  --sun: #ffb334;
  --danger: #ef5d6a;
  --shadow: 0 24px 70px rgba(33, 92, 154, 0.18);
  --radius: 8px;
  --poster-bg: linear-gradient(135deg, rgba(222, 243, 255, 0.92), rgba(249, 253, 255, 0.96));
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  overflow-x: hidden;
}

body {
  margin: 0;
  color: var(--ink);
  min-height: 100vh;
  overflow-x: hidden;
  font-family: "HarmonyOS Sans SC", "Microsoft YaHei UI", "PingFang SC", sans-serif;
  background: #edf7ff;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -3;
  background-image:
    linear-gradient(180deg, rgba(238, 248, 255, 0.12), rgba(244, 250, 255, 0.24)),
    var(--poster-bg);
  background-position: center;
  background-size: cover;
}

.site-bg {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.10), rgba(255,255,255,0.18) 58%, rgba(238,248,255,0.34)),
    repeating-linear-gradient(135deg, rgba(22,135,255,0.025) 0 1px, transparent 1px 18px);
}

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

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

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(20px, 5vw, 108px);
  background: rgba(255, 255, 255, 0.78);
  border-bottom: 1px solid rgba(139, 196, 235, 0.35);
  backdrop-filter: blur(20px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  font-weight: 900;
  font-size: 20px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: white;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  box-shadow: 0 10px 24px rgba(22, 135, 255, 0.28);
}

.nav {
  display: flex;
  gap: 8px;
  align-items: center;
}

.nav a,
.nav-form button {
  padding: 10px 14px;
  color: #435a72;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
}

.nav a.active,
.nav a:hover,
.nav-form button:hover {
  color: var(--blue-deep);
  border-color: rgba(22, 135, 255, 0.28);
  background: rgba(232, 247, 255, 0.92);
}

.nav-form {
  display: inline;
  margin: 0;
}

.page {
  width: min(1504px, calc(100% - 40px));
  margin: 0 auto;
  padding: 40px 0 80px;
}

.market-hero {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  min-height: 198px;
  margin-bottom: 20px;
  padding: clamp(28px, 5vw, 52px);
  color: #0b2744;
  border: 1px solid rgba(125, 193, 239, 0.36);
  border-radius: 8px;
  background:
    linear-gradient(120deg, rgba(255,255,255,0.92), rgba(230,248,255,0.82)),
    linear-gradient(135deg, rgba(22,135,255,0.14), transparent);
  box-shadow: var(--shadow);
}

.market-hero h1,
.section-title h1,
.detail-card h1,
.checkout-card h1,
.order-card h1,
.auth-card h1,
.admin-head h1,
.empty-state h1 {
  margin: 0;
  letter-spacing: 0;
  line-height: 1.12;
}

.market-hero h1 {
  max-width: 820px;
  font-size: clamp(34px, 5vw, 68px);
  font-family: "YouSheBiaoTiHei", "Microsoft YaHei UI", sans-serif;
}

.hero-copy {
  max-width: 720px;
  margin: 18px 0 0;
  color: #4f6984;
  font-size: 17px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--blue-deep);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 800;
  line-height: 1;
}

.button.primary {
  color: white;
  background: linear-gradient(135deg, var(--blue), #36c8ff);
  box-shadow: 0 14px 28px rgba(22, 135, 255, 0.24);
}

.button.ghost {
  color: var(--blue-deep);
  border-color: rgba(22, 135, 255, 0.22);
  background: rgba(255, 255, 255, 0.76);
}

.button.wide {
  width: 100%;
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.filter-panel {
  display: grid;
  grid-template-columns: auto minmax(260px, 360px);
  grid-template-areas: "title search" "chips chips";
  gap: 18px;
  align-items: center;
  margin-bottom: 22px;
  padding: 22px;
  border: 1px solid rgba(125, 193, 239, 0.42);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.76);
  backdrop-filter: blur(20px);
  box-shadow: 0 14px 36px rgba(53, 111, 170, 0.12);
}

.filter-title {
  grid-area: title;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 18px;
}

.round-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  color: white;
  border-radius: 50%;
  background: var(--blue);
}

.search-form {
  grid-area: search;
  display: flex;
  gap: 8px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid rgba(70, 145, 205, 0.22);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  outline: none;
}

input {
  height: 44px;
  padding: 0 14px;
}

select {
  height: 44px;
  padding: 0 14px;
}

textarea {
  resize: vertical;
  padding: 12px 14px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(22, 135, 255, 0.68);
  box-shadow: 0 0 0 4px rgba(22, 135, 255, 0.12);
}

.chips {
  grid-area: chips;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chips.compact {
  grid-area: auto;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 15px;
  border: 1px solid rgba(22, 135, 255, 0.18);
  border-radius: var(--radius);
  color: #31506c;
  background: rgba(255, 255, 255, 0.82);
  font-weight: 800;
}

.chip.active {
  color: white;
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  box-shadow: 0 10px 24px rgba(22, 135, 255, 0.2);
}

.chip span {
  opacity: 0.72;
}

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

.product-card {
  min-width: 0;
  border: 1px solid rgba(22, 135, 255, 0.34);
  border-radius: 8px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 16px 34px rgba(37, 102, 166, 0.16);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.product-card:hover {
  transform: translateY(-4px);
  border-color: rgba(22, 135, 255, 0.72);
  box-shadow: 0 24px 52px rgba(37, 102, 166, 0.22);
}

.product-card-link {
  display: block;
}

.product-poster {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1.48 / 1;
  min-height: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 25% 20%, rgba(50, 213, 255, 0.42), transparent 35%),
    radial-gradient(circle at 70% 30%, rgba(255, 255, 255, 0.92), transparent 36%),
    linear-gradient(135deg, rgba(215, 240, 255, 0.96), rgba(255, 255, 255, 0.74));
}

.product-poster::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 38%;
  background: linear-gradient(0deg, rgba(12, 67, 116, 0.58), rgba(12, 67, 116, 0));
}

.product-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.poster-fallback {
  display: grid;
  place-items: center;
  width: 108px;
  height: 108px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 18px 40px rgba(23, 101, 170, 0.18);
}

.poster-fallback span {
  color: var(--blue-deep);
  font-size: 48px;
  font-weight: 1000;
}

.poster-fallback.large {
  width: 100%;
  height: 100%;
}

.poster-fallback.large span {
  font-size: 88px;
}

.product-poster h2 {
  position: absolute;
  left: 20px;
  right: 20px;
  bottom: 16px;
  z-index: 2;
  margin: 0;
  color: white;
  text-align: center;
  font-size: 18px;
  line-height: 1.3;
  text-shadow: 0 2px 10px rgba(13, 45, 79, 0.42);
}

.stock-badge,
.price-badge,
.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 12px;
  border-radius: var(--radius);
  color: white;
  font-weight: 900;
  box-shadow: 0 10px 24px rgba(25, 146, 101, 0.2);
}

.stock-badge {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 3;
  font-size: 13px;
}

.stock-badge.ready {
  background: linear-gradient(135deg, var(--mint), #75dfa9);
}

.stock-badge.low {
  background: linear-gradient(135deg, var(--sun), #ffce66);
}

.stock-badge.empty {
  background: linear-gradient(135deg, #8996a3, #b3bfca);
}

.price-badge {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 3;
  min-height: 44px;
  padding: 0 16px;
  background: linear-gradient(135deg, #24b785, #48d8a0);
  font-size: 18px;
}

.product-foot {
  display: flex;
  justify-content: space-between;
  padding: 12px 16px;
  color: #4e6680;
  font-weight: 800;
  background: linear-gradient(90deg, rgba(216, 240, 255, 0.94), rgba(255, 255, 255, 0.95));
}

.detail-layout,
.checkout-layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.88fr) minmax(360px, 1fr);
  gap: 24px;
  align-items: stretch;
}

.detail-poster,
.detail-card,
.checkout-card,
.qr-card,
.order-card,
.auth-card,
.lookup-shell,
.admin-shell,
.admin-form-shell,
.empty-state {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}

.detail-poster {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 520px;
  overflow: hidden;
}

.detail-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-card,
.checkout-card,
.qr-card,
.order-card,
.auth-card,
.lookup-shell,
.admin-shell,
.admin-form-shell,
.empty-state {
  padding: clamp(24px, 4vw, 42px);
}

.detail-card h1,
.checkout-card h1,
.order-card h1,
.auth-card h1,
.section-title h1,
.admin-head h1,
.empty-state h1 {
  font-size: clamp(28px, 4vw, 48px);
}

.detail-desc,
.muted,
.hint {
  color: var(--muted);
}

small.hint {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  font-weight: 800;
}

.metrics,
.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 24px 0;
}

.metrics div,
.stat-grid div {
  padding: 16px;
  border: 1px solid rgba(22, 135, 255, 0.14);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.72);
}

.metrics span,
.stat-grid span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.metrics strong,
.stat-grid strong {
  display: block;
  margin-top: 6px;
  font-size: 24px;
}

.purchase-form,
.auth-card form,
.lookup-form,
.admin-form {
  display: grid;
  gap: 16px;
}

.quantity-stepper {
  display: grid;
  grid-template-columns: 74px minmax(96px, 1fr) 74px;
  height: 58px;
  overflow: hidden;
  border: 1px solid rgba(70, 145, 205, 0.22);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.92);
}

.quantity-stepper:focus-within {
  border-color: rgba(22, 135, 255, 0.68);
  box-shadow: 0 0 0 4px rgba(22, 135, 255, 0.12);
}

.quantity-stepper input {
  height: 100%;
  padding: 0;
  border: 0;
  border-left: 1px solid rgba(22, 135, 255, 0.16);
  border-right: 1px solid rgba(22, 135, 255, 0.16);
  border-radius: 0;
  background: transparent;
  text-align: center;
  font-size: 22px;
  font-weight: 900;
  font-family: "Cascadia Mono", Consolas, monospace;
}

.quantity-stepper input:focus {
  box-shadow: none;
}

.quantity-button {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  border: 0;
  color: var(--blue-deep);
  background: rgba(232, 247, 255, 0.72);
  cursor: pointer;
  font-size: 30px;
  font-weight: 1000;
  line-height: 1;
}

.quantity-button:hover {
  background: rgba(210, 239, 255, 0.96);
}

.quantity-button:active {
  color: white;
  background: linear-gradient(135deg, var(--blue), var(--cyan));
}

.quantity-button:disabled {
  cursor: not-allowed;
  color: #9aabbf;
  background: rgba(238, 244, 250, 0.8);
}

label span,
.form-field > span {
  display: block;
  margin-bottom: 8px;
  color: #38536d;
  font-weight: 900;
}

.pay-methods {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}

.pay-choice {
  cursor: pointer;
}

.pay-choice input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.pay-choice span {
  display: grid;
  place-items: center;
  min-height: 46px;
  margin: 0;
  border: 1px solid rgba(22, 135, 255, 0.2);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.74);
}

.pay-choice input:checked + span {
  color: white;
  border-color: transparent;
  background: linear-gradient(135deg, var(--blue), var(--cyan));
}

.amount-line {
  margin: 20px 0 12px;
  color: var(--blue-deep);
  font-size: clamp(42px, 8vw, 76px);
  font-weight: 1000;
  letter-spacing: 0;
}

.payment-expiry {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px 14px;
  align-items: center;
  margin: 16px 0;
  padding: 14px;
  border: 1px solid rgba(22, 135, 255, 0.18);
  border-radius: var(--radius);
  background: rgba(241, 250, 255, 0.86);
}

.payment-expiry span,
.payment-expiry small,
.payment-expiry em {
  color: var(--muted);
  font-style: normal;
  font-weight: 800;
}

.payment-expiry strong {
  color: var(--blue-deep);
  font-size: 22px;
}

.payment-expiry small,
.payment-expiry em {
  grid-column: 1 / -1;
  font-size: 13px;
}

.qr-card {
  display: grid;
  gap: 18px;
  align-content: center;
}

.qr-card img,
.qr-placeholder,
.mini-qr,
.payment-setting img {
  width: min(320px, 100%);
  aspect-ratio: 1;
  margin: 0 auto;
  border: 1px solid rgba(22, 135, 255, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
}

.qr-placeholder,
.mini-qr {
  display: grid;
  place-items: center;
  color: var(--muted);
  text-align: center;
}

.qr-placeholder strong {
  color: var(--ink);
  font-size: 24px;
}

.order-head,
.admin-head,
.panel-head,
.form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.error-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.order-number-label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 900;
}

.order-card .order-number {
  max-width: 100%;
  overflow-wrap: anywhere;
  font-size: clamp(22px, 2.7vw, 34px);
  line-height: 1.18;
}

.status-pill {
  position: static;
  min-height: 32px;
  color: #10634a;
  background: rgba(47, 213, 153, 0.18);
  box-shadow: none;
}

.status-pill.pending {
  color: #886014;
  background: rgba(255, 179, 52, 0.2);
}

.status-pill.paid {
  color: #135f95;
  background: rgba(22, 135, 255, 0.16);
}

.status-pill.delivered {
  color: #0e654b;
  background: rgba(38, 201, 139, 0.18);
}

.status-pill.closed {
  color: #596778;
  background: rgba(129, 145, 163, 0.18);
}

.payment-error,
.config-note {
  padding: 12px 14px;
  border: 1px solid rgba(239, 93, 106, 0.22);
  border-radius: var(--radius);
  color: #8b2630;
  background: rgba(255, 241, 243, 0.88);
  font-weight: 800;
}

.config-note.success {
  color: #10634a;
  border-color: rgba(38, 201, 139, 0.2);
  background: rgba(232, 255, 247, 0.86);
}

.order-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 26px 0;
}

.order-meta div {
  padding: 16px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.72);
}

.order-meta dt {
  color: var(--muted);
  font-weight: 900;
}

.order-meta dd {
  margin: 6px 0 0;
  font-weight: 900;
}

.delivery-box {
  padding: 18px;
  border: 1px solid rgba(22, 135, 255, 0.2);
  border-radius: var(--radius);
  background: rgba(244, 251, 255, 0.86);
}

.inline-form {
  margin: 14px 0;
}

.box-title {
  margin-bottom: 10px;
  font-weight: 1000;
}

pre {
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0 0 16px;
  color: #183652;
  font-family: "Cascadia Mono", Consolas, monospace;
}

.lookup-methods {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 16px;
  margin: 24px 0;
}

.lookup-card-form {
  align-content: end;
  padding: 18px;
  border: 1px solid rgba(22, 135, 255, 0.14);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.68);
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid rgba(22, 135, 255, 0.14);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.76);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

th,
td {
  padding: 15px 16px;
  text-align: left;
  border-bottom: 1px solid rgba(22, 135, 255, 0.12);
}

th {
  color: #496680;
  font-size: 13px;
  font-weight: 1000;
}

.table-link,
.link-button {
  border: 0;
  padding: 0;
  color: var(--blue-deep);
  background: transparent;
  cursor: pointer;
  font-weight: 900;
}

.table-link.danger,
.link-button.danger {
  color: var(--danger);
}

.compact-form {
  margin: 0;
}

.delete-confirm-actions {
  display: grid;
  gap: 6px;
}

.delete-confirm-actions span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.auth-card {
  width: min(460px, 100%);
  margin: 40px auto;
}

.redeem-card {
  width: min(520px, 100%);
}

.redeem-detail {
  width: min(980px, 100%);
  margin: 0 auto;
}

.credential-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 24px 0;
}

.credential-field {
  position: relative;
  min-width: 0;
  min-height: 104px;
  padding: 16px 58px 16px 16px;
  border: 1px solid rgba(22, 135, 255, 0.14);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.72);
}

.credential-field span,
.totp-panel span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.credential-field strong {
  display: block;
  margin-top: 10px;
  overflow-wrap: anywhere;
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 17px;
}

.secret-toggle {
  position: absolute;
  right: 14px;
  top: 50%;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid rgba(22, 135, 255, 0.22);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.86);
  cursor: pointer;
}

.secret-toggle::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 11px;
  width: 16px;
  height: 10px;
  border: 2px solid var(--blue-deep);
  border-radius: 50%;
}

.secret-toggle::after {
  content: "";
  position: absolute;
  left: 14px;
  top: 14px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--blue-deep);
}

.secret-toggle[data-visible="true"] {
  background: rgba(232, 247, 255, 0.96);
}

.totp-panel {
  display: grid;
  gap: 10px;
  margin: 20px 0;
  padding: 20px;
  border: 1px solid rgba(22, 135, 255, 0.2);
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(241, 250, 255, 0.94), rgba(255, 255, 255, 0.92));
}

.totp-panel strong {
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: clamp(44px, 9vw, 78px);
  line-height: 1;
  letter-spacing: 0;
}

.totp-panel small {
  color: var(--muted);
  font-weight: 900;
}

.totp-meter {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(22, 135, 255, 0.13);
}

.totp-meter i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--mint), var(--cyan));
  transition: width 220ms linear;
}

.redeem-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.redeem-actions .inline-form {
  margin: 0;
}

.admin-actions,
.row-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

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

.stock-overview {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 22px 0;
}

.stock-overview div {
  padding: 16px;
  border: 1px solid rgba(22, 135, 255, 0.14);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.72);
}

.stock-overview span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.stock-overview strong {
  display: block;
  margin-top: 6px;
  font-size: 26px;
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(320px, 0.8fr);
  gap: 18px;
  margin-top: 18px;
}

.panel {
  padding: 22px;
  border: 1px solid rgba(22, 135, 255, 0.14);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.62);
}

.panel h2,
.payment-setting h2 {
  margin: 0;
}

.product-admin-list,
.mini-orders {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.category-create-panel {
  margin: 18px 0;
}

.category-create-form {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 140px auto;
  gap: 14px;
  align-items: end;
}

.admin-product,
.mini-orders a {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
  border: 1px solid rgba(22, 135, 255, 0.12);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.78);
}

.admin-product span,
.mini-orders em {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-style: normal;
  font-size: 13px;
}

.form-grid,
.payment-settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.switch-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding-top: 24px;
}

.switch-row input {
  width: 18px;
  height: 18px;
}

.switch-row span {
  margin: 0;
}

.switch-row.inline-switch {
  min-height: auto;
  padding-top: 0;
}

.mail-setting {
  margin-top: 18px;
}

.current-media {
  display: flex;
  gap: 14px;
  align-items: center;
  color: var(--muted);
  font-weight: 900;
}

.current-media img {
  width: 120px;
  height: 80px;
  object-fit: cover;
  border-radius: var(--radius);
}

.inventory-history {
  margin-top: 26px;
}

.inventory-table {
  min-width: 960px;
}

.inventory-content {
  max-width: 460px;
  max-height: 132px;
  margin: 0;
  overflow: auto;
}

.payment-setting {
  display: grid;
  gap: 12px;
  padding: 18px;
  border: 1px solid rgba(22, 135, 255, 0.14);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.68);
}

.mini-qr {
  width: 148px;
  font-weight: 900;
}

.flash-stack {
  position: fixed;
  top: 88px;
  right: 24px;
  z-index: 40;
  display: grid;
  gap: 10px;
}

.flash {
  max-width: 360px;
  padding: 12px 14px;
  border-radius: var(--radius);
  color: #0b513c;
  background: rgba(226, 255, 243, 0.96);
  border: 1px solid rgba(38, 201, 139, 0.2);
  box-shadow: 0 16px 40px rgba(27, 92, 77, 0.14);
}

.flash.error {
  color: #8d2030;
  background: rgba(255, 239, 242, 0.96);
  border-color: rgba(239, 93, 106, 0.22);
}

.empty-state {
  display: grid;
  justify-items: start;
  gap: 12px;
  min-height: 300px;
  align-content: center;
}

@media (max-width: 1180px) {
  .product-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

@media (max-width: 860px) {
  .topbar {
    height: auto;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding-block: 14px;
  }

  .nav {
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .page {
    width: min(100% - 24px, 1504px);
    padding-top: 24px;
  }

  .market-hero,
  .filter-panel,
  .detail-layout,
  .checkout-layout,
  .admin-grid {
    grid-template-columns: 1fr;
  }

  .market-hero {
    align-items: start;
  }

  .filter-panel {
    grid-template-areas: "title" "search" "chips";
  }

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

  .metrics,
  .stat-grid,
  .stock-overview,
  .order-meta,
  .credential-grid,
  .form-grid,
  .category-create-form,
  .payment-settings-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .product-grid {
    grid-template-columns: 1fr;
  }

  .market-hero h1 {
    font-size: 34px;
  }

  .search-form,
  .lookup-form,
  .lookup-methods,
  .pay-methods,
  .order-head,
  .admin-head,
  .panel-head,
  .form-actions,
  .redeem-actions {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: stretch;
  }

  .admin-product,
  .mini-orders a {
    flex-direction: column;
  }

  .flash-stack {
    left: 12px;
    right: 12px;
  }
}
