:root {
  color-scheme: light;
  --bg: #f4f8fc;
  --bg-2: #eaf2f9;
  --panel: #ffffff;
  --panel-strong: #ffffff;
  --glass: rgba(54, 163, 255, 0.06);
  --line: rgba(71, 132, 180, 0.18);
  --line-strong: rgba(54, 163, 255, 0.34);
  --ink: #13283b;
  --text-on-dark: #1e3447;
  --muted: #6e8294;
  --muted-dark: #9db8cc;
  --blue: #36a3ff;
  --blue-2: #6fd8ff;
  --cyan: #4ee7ff;
  --green: #45d98f;
  --gold: #ffc45c;
  --red: #ff6d7e;
  --radius: 18px;
  --radius-sm: 13px;
  --shadow: 0 22px 52px rgba(34, 76, 116, 0.12);
  --glow: 0 0 26px rgba(54, 163, 255, 0.12);
}

/* Premium storefront refresh */
.section-kicker {
  display: inline-flex;
  width: max-content;
  margin-bottom: 6px;
  border: 1px solid rgba(54, 163, 255, 0.2);
  border-radius: 999px;
  padding: 4px 8px;
  background: rgba(54, 163, 255, 0.07);
  color: #197ad3;
  font-size: 11px;
  font-weight: 950;
}

.premium-hero {
  grid-template-columns: minmax(0, 1.02fr) minmax(360px, 0.78fr);
  min-height: 360px;
  padding: clamp(26px, 4vw, 42px);
  background:
    radial-gradient(circle at 10% 0%, rgba(78, 231, 255, 0.22), transparent 310px),
    radial-gradient(circle at 82% 24%, rgba(54, 163, 255, 0.18), transparent 260px),
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(237, 248, 255, 0.92) 58%, rgba(248, 252, 255, 0.96));
}

.premium-hero::after {
  content: "";
  position: absolute;
  right: -80px;
  bottom: -120px;
  width: 420px;
  height: 420px;
  pointer-events: none;
  border: 1px solid rgba(54, 163, 255, 0.14);
  border-radius: 50%;
  background:
    repeating-radial-gradient(circle, rgba(54, 163, 255, 0.08) 0 1px, transparent 1px 26px),
    radial-gradient(circle, rgba(78, 231, 255, 0.1), transparent 60%);
  animation: slowSpin 18s linear infinite;
}

.store-hero-copy {
  max-width: 640px;
}

.premium-hero .hero-kicker {
  background:
    linear-gradient(90deg, rgba(54, 163, 255, 0.12), rgba(78, 231, 255, 0.12)),
    #fff;
}

.premium-hero h1 {
  max-width: 600px;
  color: #0e2c46;
  font-size: clamp(34px, 5vw, 62px);
  letter-spacing: 0;
}

.premium-hero p {
  max-width: 560px;
  color: #4d6c83;
  font-size: 16px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.hero-command {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 14px;
  align-content: center;
  overflow: hidden;
  border: 1px solid rgba(54, 163, 255, 0.26);
  border-radius: 22px;
  padding: 16px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.72), rgba(233, 248, 255, 0.6)),
    rgba(255, 255, 255, 0.68);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.8),
    0 24px 54px rgba(22, 103, 172, 0.13);
  backdrop-filter: blur(12px);
}

.hero-command::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(54, 163, 255, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(54, 163, 255, 0.045) 1px, transparent 1px);
  background-size: 22px 22px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.85), transparent);
}

.terminal-head {
  position: relative;
  display: flex;
  gap: 7px;
  align-items: center;
  color: #5c7d94;
  font-size: 12px;
  font-weight: 950;
}

.terminal-head span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #36a3ff;
  box-shadow: 0 0 14px rgba(54, 163, 255, 0.36);
}

.terminal-head span:nth-child(2) {
  background: #4ee7ff;
}

.terminal-head span:nth-child(3) {
  background: #45d98f;
}

.terminal-head strong {
  margin-left: auto;
  color: #28698f;
}

.hero-command .store-metrics {
  grid-template-columns: 1fr;
}

.hero-command .store-metrics div {
  position: relative;
  border-radius: 16px;
  background:
    linear-gradient(90deg, rgba(54, 163, 255, 0.08), rgba(255, 255, 255, 0.76)),
    #fff;
}

.terminal-flow {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  align-items: center;
  min-height: 58px;
  border: 1px solid rgba(54, 163, 255, 0.16);
  border-radius: 16px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.58);
}

.terminal-flow i {
  position: absolute;
  left: 18px;
  right: 18px;
  top: 50%;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(54, 163, 255, 0.1), rgba(54, 163, 255, 0.8), rgba(78, 231, 255, 0.1));
  transform: translateY(-50%);
}

.terminal-flow span {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 34px;
  border: 1px solid rgba(54, 163, 255, 0.22);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  color: #1d6ea7;
  font-size: 11px;
  font-weight: 950;
  box-shadow: 0 8px 18px rgba(54, 163, 255, 0.1);
}

.trading-desk {
  border-color: rgba(54, 163, 255, 0.18);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(246, 251, 255, 0.98)),
    #fff;
}

.desk-toolbar {
  padding: 18px 20px;
}

.desk-toolbar h2 {
  font-size: 22px;
}

.shop-layout {
  grid-template-columns: 210px minmax(0, 1fr);
  background:
    linear-gradient(180deg, #f6fbff, #eef7ff);
}

.category-rail,
.catalog-panel {
  border-color: rgba(54, 163, 255, 0.16);
  box-shadow: 0 18px 38px rgba(22, 86, 140, 0.1);
}

.catalog-head,
.product-card {
  grid-template-columns: minmax(260px, 1fr) 120px 120px 120px;
}

.product-card {
  border-color: rgba(100, 190, 255, 0.2);
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(246, 252, 255, 0.94)),
    #fff;
}

.product-card::after {
  content: "";
  position: absolute;
  left: 14px;
  top: 12px;
  bottom: 12px;
  width: 3px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--cyan), var(--blue));
  opacity: 0.55;
  box-shadow: 0 0 14px rgba(78, 231, 255, 0.3);
}

.product-title,
.product-body p {
  padding-left: 12px;
}

.product-title h3 {
  font-size: 17px;
}

.price {
  color: #1266d6;
  font-size: 19px;
  font-weight: 950;
}

.stock {
  color: #57758a;
  font-weight: 900;
}

.trade-button {
  border-radius: 12px;
  background: linear-gradient(135deg, #1588ff, #4ee7ff);
}

.status-badge {
  border-color: rgba(69, 217, 143, 0.28);
  background: rgba(69, 217, 143, 0.1);
}

.notice-band {
  border-color: rgba(54, 163, 255, 0.18);
}

.notice-band strong {
  background: linear-gradient(180deg, #1596ff, #1266d6);
}

@keyframes slowSpin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 860px) {
  .premium-hero {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .hero-command .store-metrics {
    grid-template-columns: repeat(3, 1fr);
  }

  .terminal-flow {
    grid-template-columns: repeat(2, 1fr);
  }

  .catalog-head,
  .product-card {
    grid-template-columns: 1fr;
  }

  .product-title,
  .product-body p {
    padding-left: 0;
  }

  .product-card::after {
    left: 12px;
    right: 12px;
    top: 0;
    bottom: auto;
    width: auto;
    height: 3px;
  }
}

@media (max-width: 560px) {
  .hero-actions,
  .hero-command .store-metrics,
  .filters {
    display: grid;
    grid-template-columns: 1fr;
  }

  .premium-hero h1 {
    font-size: 32px;
  }
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 16% -12%, rgba(54, 163, 255, 0.18), transparent 340px),
    radial-gradient(circle at 88% 0%, rgba(78, 231, 255, 0.12), transparent 320px),
    linear-gradient(180deg, #ffffff 0, #f4f8fc 280px),
    var(--bg);
  color: var(--text-on-dark);
  font-family: "Segoe UI", "Microsoft YaHei UI", Arial, sans-serif;
  font-size: 14px;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(54, 163, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(54, 163, 255, 0.035) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.72), transparent 70%);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(110deg, transparent 0 38%, rgba(54, 163, 255, 0.1) 48%, transparent 58% 100%),
    radial-gradient(circle at 72% 18%, rgba(78, 231, 255, 0.16), transparent 220px);
  transform: translateX(-18%);
  animation: ambientSweep 9s ease-in-out infinite;
}

body.modal-open {
  overflow: hidden;
}

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

button {
  cursor: pointer;
}

.shell {
  position: relative;
  width: min(1180px, calc(100% - 24px));
  margin: 0 auto;
  padding: 18px 0 38px;
}

body.admin-locked .shell {
  display: none;
}

body.admin-unlocked .admin-login-screen {
  display: none;
}

.admin-login-screen {
  position: relative;
  z-index: 2;
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
}

.admin-login-card {
  position: relative;
  display: grid;
  gap: 14px;
  width: min(430px, 100%);
  overflow: hidden;
  border: 1px solid rgba(126, 204, 255, 0.42);
  border-radius: 24px;
  padding: 28px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(239, 249, 255, 0.95)),
    #fff;
  box-shadow:
    0 30px 80px rgba(25, 76, 118, 0.16),
    0 0 34px rgba(78, 231, 255, 0.18);
  animation: fadeUp 360ms ease both;
}

.admin-login-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(110deg, transparent 0 38%, rgba(78, 231, 255, 0.18), transparent 58% 100%),
    linear-gradient(rgba(54, 163, 255, 0.045) 1px, transparent 1px);
  background-size: auto, 100% 15px;
  transform: translateX(-100%);
  animation: scanSheen 5.8s ease-in-out infinite;
}

.admin-login-card > * {
  position: relative;
}

.admin-login-card h1 {
  margin: 0 0 4px;
  color: #102f49;
  font-size: 30px;
}

.admin-login-card label {
  display: grid;
  gap: 7px;
}

.admin-login-card label span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.admin-top-actions {
  display: flex;
  justify-content: end;
  gap: 10px;
  align-items: center;
}

.topbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 14px;
  min-height: 68px;
  border: 1px solid rgba(208, 224, 237, 0.9);
  border-radius: var(--radius);
  padding: 0 18px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow), var(--glow);
  animation: liftIn 420ms ease both;
}

.topbar::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(78, 231, 255, 0.45), transparent);
  opacity: 0.45;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  padding: 1px;
  animation: borderOrbit 5.5s linear infinite;
}

.brand,
.ghost-link {
  color: inherit;
  text-decoration: none;
}

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

.brand-mark {
  position: relative;
  width: 40px;
  height: 40px;
  overflow: hidden;
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.52), transparent 42%),
    linear-gradient(135deg, #1266d6, #63d8ff);
  box-shadow: inset 0 -10px 18px rgba(0, 0, 0, 0.18), 0 0 26px rgba(78, 231, 255, 0.34);
}

.brand-mark::after {
  content: "";
  position: absolute;
  inset: -30%;
  background: linear-gradient(110deg, transparent 35%, rgba(255, 255, 255, 0.72), transparent 65%);
  transform: translateX(-80%);
  animation: glint 4.2s ease-in-out infinite;
}

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

.brand strong {
  color: #14334d;
  font-size: 18px;
  letter-spacing: 0.4px;
}

.brand small {
  color: #6d8396;
}

.nav-tabs {
  display: flex;
  gap: 6px;
  overflow: hidden;
  border: 1px solid rgba(205, 224, 238, 0.95);
  border-radius: 999px;
  padding: 5px;
  background: #f1f7fc;
}

.nav-tab {
  min-width: 88px;
  border: 0;
  padding: 9px 15px;
  background: transparent;
  color: #49677f;
  text-align: center;
  text-decoration: none;
  border-radius: 999px;
  font-weight: 850;
  transition: transform 160ms ease, background 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.nav-tab.is-active,
.nav-tab:hover {
  background: linear-gradient(180deg, #45b6ff, #1678df);
  color: #fff;
  box-shadow: 0 0 22px rgba(54, 163, 255, 0.34);
  transform: translateY(-1px);
}

.nav-tab.is-active {
  animation: activeBreath 2.8s ease-in-out infinite;
}

.market-pulse,
.ghost-link {
  justify-self: end;
  color: var(--green);
  font-weight: 850;
}

.market-pulse span {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 5px rgba(69, 217, 143, 0.12);
  animation: pulseDot 1.9s ease-in-out infinite;
}

.view {
  display: none;
}

.view.is-active {
  display: block;
  animation: fadeUp 280ms ease both;
}

.store-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  gap: 18px;
  align-items: stretch;
  margin-top: 16px;
  overflow: hidden;
  border: 1px solid rgba(54, 163, 255, 0.24);
  border-radius: 24px;
  padding: clamp(22px, 4vw, 34px);
  background:
    radial-gradient(circle at 15% 18%, rgba(54, 163, 255, 0.18), transparent 260px),
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(237, 248, 255, 0.9));
  box-shadow: 0 28px 70px rgba(28, 90, 150, 0.14);
  animation: fadeUp 360ms ease both;
}

.store-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(100deg, transparent 0 45%, rgba(78, 231, 255, 0.24), transparent 58% 100%),
    linear-gradient(rgba(54, 163, 255, 0.04) 1px, transparent 1px);
  background-size: auto, 100% 14px;
  transform: translateX(-100%);
  animation: scanSheen 5.8s ease-in-out infinite;
}

.store-hero-copy {
  position: relative;
  z-index: 1;
  display: grid;
  align-content: center;
  gap: 10px;
}

.hero-kicker {
  width: max-content;
  border: 1px solid rgba(54, 163, 255, 0.24);
  border-radius: 999px;
  padding: 6px 10px;
  background: rgba(54, 163, 255, 0.08);
  color: #1266d6;
  font-size: 12px;
  font-weight: 900;
}

.store-hero h1 {
  margin: 0;
  color: #102f49;
  font-size: clamp(28px, 4vw, 48px);
  line-height: 1.08;
}

.store-hero p {
  max-width: 620px;
  margin: 0;
  color: #526f84;
  font-size: 15px;
  line-height: 1.75;
}

.store-metrics {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  align-content: center;
}

.store-metrics div {
  overflow: hidden;
  border: 1px solid rgba(54, 163, 255, 0.2);
  border-radius: 18px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 12px 24px rgba(28, 90, 150, 0.08);
}

.store-metrics strong {
  display: block;
  color: #1266d6;
  font-size: 28px;
  line-height: 1;
}

.store-metrics span {
  display: block;
  margin-top: 7px;
  color: #668094;
  font-weight: 800;
}

.notice-band,
.trading-desk,
.orders-panel,
.admin-panel,
.admin-list {
  position: relative;
  margin-top: 16px;
  overflow: hidden;
  border: 1px solid rgba(208, 224, 237, 0.92);
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: var(--shadow);
}

.notice-band::before,
.trading-desk::before,
.orders-panel::before,
.admin-panel::before,
.admin-list::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(115deg, transparent 0 35%, rgba(78, 231, 255, 0.14), transparent 65% 100%);
  transform: translateX(-100%);
  animation: scanSheen 6s ease-in-out infinite;
}

.notice-band::after,
.trading-desk::after,
.orders-panel::after,
.admin-panel::after,
.admin-list::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  border: 1px solid rgba(78, 231, 255, 0.16);
  filter: drop-shadow(0 0 10px rgba(54, 163, 255, 0.16));
}

.notice-band {
  display: grid;
  grid-template-columns: 94px 1fr;
  animation: fadeUp 420ms 80ms ease both;
}

.notice-band strong {
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, #28a8ff, #1266d6);
  color: #fff;
  font-size: 16px;
  letter-spacing: 0.4px;
}

.notice-band div {
  padding: 15px 19px;
  background: linear-gradient(180deg, #ffffff, #f7fbff);
}

.notice-band p {
  margin: 0 0 6px;
  color: #516b80;
  line-height: 1.55;
}

.notice-band p:last-child {
  margin-bottom: 0;
}

.announcement-modal {
  position: fixed;
  z-index: 1000;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 22px;
  background:
    radial-gradient(circle at 50% 18%, rgba(78, 231, 255, 0.22), transparent 300px),
    rgba(10, 30, 50, 0.34);
  backdrop-filter: blur(12px);
  animation: modalFade 180ms ease both;
}

.announcement-modal.is-closing {
  animation: modalFadeOut 180ms ease both;
}

.announcement-modal-panel {
  position: relative;
  width: min(560px, 100%);
  overflow: hidden;
  border: 1px solid rgba(126, 204, 255, 0.42);
  border-radius: 22px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(239, 249, 255, 0.96)),
    #fff;
  box-shadow:
    0 30px 80px rgba(11, 46, 80, 0.28),
    0 0 36px rgba(78, 231, 255, 0.2);
  animation: modalLift 220ms ease both;
}

.announcement-modal-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(110deg, transparent 0 38%, rgba(78, 231, 255, 0.2), transparent 58% 100%),
    linear-gradient(rgba(54, 163, 255, 0.045) 1px, transparent 1px);
  background-size: auto, 100% 15px;
  transform: translateX(-100%);
  animation: scanSheen 5.6s ease-in-out infinite;
}

.announcement-modal-head {
  position: relative;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: start;
  padding: 20px 20px 14px;
  border-bottom: 1px solid rgba(208, 224, 237, 0.9);
}

.announcement-modal-head span {
  color: #1684d8;
  font-size: 12px;
  font-weight: 900;
}

.announcement-modal-head h2 {
  margin: 4px 0 0;
  color: #102f49;
  font-size: 24px;
}

.modal-close {
  width: 36px;
  height: 36px;
  border: 1px solid rgba(54, 163, 255, 0.24);
  border-radius: 50%;
  background: #fff;
  color: #24617f;
  font-size: 24px;
  line-height: 1;
  box-shadow: 0 10px 22px rgba(54, 163, 255, 0.12);
}

.announcement-modal-list {
  position: relative;
  display: grid;
  gap: 10px;
  max-height: min(46vh, 360px);
  overflow: auto;
  padding: 16px 20px 4px;
}

.announcement-modal-list p {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  margin: 0;
  border: 1px solid rgba(54, 163, 255, 0.16);
  border-radius: 14px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.72);
  color: #415f76;
  line-height: 1.65;
}

.announcement-modal-list p span {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(54, 163, 255, 0.14), rgba(78, 231, 255, 0.18));
  color: #1684d8;
  font-size: 12px;
  font-weight: 900;
}

.announcement-confirm {
  position: relative;
  width: calc(100% - 40px);
  margin: 16px 20px 20px;
}

.announcement-dock {
  margin: -4px 0 16px;
  transform-origin: top center;
}

.announcement-dock[hidden] {
  display: none !important;
}

.announcement-dock-card {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(54, 163, 255, 0.26);
  border-radius: 18px;
  padding: 12px;
  background:
    radial-gradient(circle at 16% 0%, rgba(78, 231, 255, 0.18), transparent 54%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(240, 249, 255, 0.84));
  box-shadow:
    0 18px 36px rgba(38, 101, 148, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.announcement-dock-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(110deg, transparent 0 42%, rgba(78, 231, 255, 0.24), transparent 62% 100%),
    linear-gradient(rgba(54, 163, 255, 0.04) 1px, transparent 1px);
  background-size: auto, 100% 13px;
  transform: translateX(-100%);
  animation: scanSheen 5.2s ease-in-out infinite;
}

.announcement-dock.is-revealed .announcement-dock-card {
  animation: dockReveal 560ms cubic-bezier(0.2, 0.9, 0.2, 1) both;
}

.announcement-dock-head {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.announcement-dock-head span {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(54, 163, 255, 0.22);
  border-radius: 999px;
  padding: 4px 9px;
  background: rgba(224, 244, 255, 0.8);
  color: #0877d6;
  font-size: 11px;
  font-weight: 950;
}

.announcement-dock-head strong {
  color: #102f49;
  font-size: 15px;
  font-weight: 950;
}

.announcement-dock-body {
  position: relative;
  display: grid;
  gap: 7px;
}

.announcement-dock-body p {
  margin: 0;
  border: 1px solid rgba(54, 163, 255, 0.14);
  border-radius: 12px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.72);
  color: #49677f;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.55;
}

.announcement-flight {
  position: fixed;
  z-index: 1100;
  pointer-events: none;
  margin: 0;
  transform-origin: top left;
  transition:
    transform 560ms cubic-bezier(0.16, 1, 0.3, 1),
    opacity 520ms ease,
    filter 520ms ease;
  box-shadow:
    0 0 44px rgba(78, 231, 255, 0.42),
    0 28px 74px rgba(11, 46, 80, 0.25);
}

.desk-toolbar,
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 19px;
  border-bottom: 1px solid rgba(208, 224, 237, 0.9);
  border-radius: var(--radius) var(--radius) 0 0;
  background: linear-gradient(180deg, #ffffff, #f3f8fc);
}

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

h1 {
  margin-bottom: 0;
  color: #14334d;
  font-size: 21px;
}

h2 {
  margin-bottom: 0;
  color: #14334d;
  font-size: 18px;
}

h3 {
  margin-bottom: 4px;
  font-size: 15px;
}

.filters,
.form-row,
.form-actions,
.admin-actions {
  display: flex;
  gap: 10px;
}

label,
.search-field,
.select-field {
  display: grid;
  gap: 5px;
  color: #5d7488;
  font-size: 13px;
  font-weight: 850;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid rgba(100, 190, 255, 0.24);
  border-radius: 10px;
  padding: 9px 11px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(78, 231, 255, 0.18);
}

.shop-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 14px;
  padding: 14px;
  border-radius: 0 0 var(--radius) var(--radius);
  background: #f4f9fd;
}

.category-rail {
  overflow: hidden;
  border: 1px solid #d9e8f3;
  border-radius: var(--radius-sm);
  background: #ffffff;
  box-shadow: 0 12px 30px rgba(0, 20, 40, 0.12);
}

.category-rail h3 {
  margin: 0;
  padding: 13px 15px;
  border-bottom: 1px solid #dbe8f2;
  background: linear-gradient(180deg, #f8fcff, #eaf5ff);
  color: #255274;
}

#categoryRail {
  display: grid;
  gap: 8px;
  padding: 12px;
}

.category-button {
  min-height: 39px;
  border: 1px solid #cfe0ee;
  border-radius: 999px;
  padding: 0 13px;
  background: linear-gradient(180deg, #ffffff, #f2f8fd);
  color: #335b78;
  text-align: left;
  font-weight: 850;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.category-button.is-active,
.category-button:hover {
  border-color: var(--blue);
  background: #eaf6ff;
  color: #1266d6;
  box-shadow: 0 10px 20px rgba(54, 163, 255, 0.18);
  transform: translateX(3px);
}

.category-button.is-active {
  background:
    linear-gradient(90deg, rgba(78, 231, 255, 0.18), transparent 60%),
    #eaf6ff;
}

.catalog-panel {
  min-width: 0;
  overflow: hidden;
  border: 1px solid #d9e8f3;
  border-radius: var(--radius-sm);
  background: #ffffff;
  box-shadow: 0 12px 30px rgba(0, 20, 40, 0.12);
}

.catalog-head,
.product-card {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) 110px 110px 108px;
  gap: 12px;
  align-items: center;
}

.catalog-head {
  padding: 12px 16px;
  border-bottom: 1px solid #dbe8f2;
  background: linear-gradient(180deg, #f9fdff, #eaf5ff);
  color: #5a7790;
  font-weight: 850;
}

.product-grid {
  display: grid;
  gap: 10px;
  padding: 12px;
  background: #f2f8fd;
}

.product-card {
  position: relative;
  min-height: 84px;
  border: 1px solid #d9e8f3;
  border-radius: 14px;
  padding: 13px 14px;
  background: #fff;
  box-shadow: 0 8px 18px rgba(0, 20, 40, 0.06);
  animation: fadeUp 320ms ease both;
  cursor: pointer;
  isolation: isolate;
  transition: transform 190ms ease, box-shadow 190ms ease, border-color 190ms ease, background 190ms ease;
}

.product-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background:
    radial-gradient(circle at var(--mx, 50%) var(--my, 50%), rgba(54, 163, 255, 0.16), transparent 150px),
    linear-gradient(120deg, transparent, rgba(78, 231, 255, 0.08), transparent);
  opacity: 0;
  transition: opacity 190ms ease;
}

.product-card:nth-child(even) {
  background: #fbfdff;
}

.product-card:hover {
  border-color: rgba(54, 163, 255, 0.5);
  background: #ffffff;
  box-shadow: 0 16px 32px rgba(16, 96, 170, 0.15);
  transform: translateY(-4px);
}

.product-card:hover::before,
.product-card.is-expanded::before {
  opacity: 1;
}

.product-body {
  display: contents;
}

.product-detail {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 172px minmax(0, 1fr);
  gap: 14px;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transform: translateY(-4px);
  transition: max-height 260ms ease, opacity 220ms ease, transform 220ms ease, padding-top 220ms ease;
}

.product-card.is-expanded .product-detail {
  max-height: 260px;
  opacity: 1;
  transform: translateY(0);
  padding-top: 14px;
}

.product-card.is-expanded {
  border-color: rgba(54, 163, 255, 0.58);
  box-shadow: 0 18px 36px rgba(16, 96, 170, 0.18);
}

.detail-image {
  position: relative;
  overflow: hidden;
  border: 1px solid #d9e8f3;
  border-radius: 12px;
  background: linear-gradient(135deg, #eaf6ff, #ffffff);
  aspect-ratio: 16 / 10;
  box-shadow: inset 0 0 0 1px rgba(54, 163, 255, 0.12);
}

.detail-image::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 10%, rgba(255, 255, 255, 0.42), transparent 52%);
  transform: translateX(-100%);
  animation: imageScan 3.8s ease-in-out infinite;
}

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

.detail-copy {
  display: grid;
  align-content: start;
  gap: 8px;
  min-width: 0;
}

.detail-copy h4 {
  margin: 0;
  color: var(--ink);
  font-size: 15px;
}

.detail-description {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.detail-tags span {
  border: 1px solid rgba(54, 163, 255, 0.24);
  border-radius: 999px;
  padding: 4px 9px;
  background: #eaf6ff;
  color: #1266d6;
  font-size: 12px;
  font-weight: 800;
}

.product-title {
  min-width: 0;
  grid-column: 1;
  grid-row: 1;
}

.product-title h3,
.product-body p,
.tag-row span,
.admin-item h3,
.admin-item p {
  overflow-wrap: anywhere;
}

.product-title h3 {
  color: var(--ink);
  font-size: 16px;
  font-weight: 850;
}

.status-badge {
  display: inline-flex;
  width: max-content;
  margin-top: 3px;
  border: 1px solid #bfe9d2;
  border-radius: 999px;
  padding: 2px 7px;
  background: #effbf5;
  color: #259b62;
  font-size: 12px;
}

.product-body p {
  grid-column: 1;
  grid-row: 2;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.tag-row,
.change {
  display: none;
}

.product-meta {
  display: contents;
}

.price {
  grid-column: 2;
  grid-row: 1 / span 2;
  color: #d88b12;
  font-size: 17px;
  font-weight: 900;
}

.stock {
  grid-column: 3;
  grid-row: 1 / span 2;
  color: #526777;
  font-weight: 850;
}

.trade-button {
  position: relative;
  grid-column: 4;
  grid-row: 1 / span 2;
  min-width: 92px;
  overflow: hidden;
}

.trade-button::after,
.primary-button::after {
  content: "";
  position: absolute;
  inset: -80% auto -80% -45%;
  width: 36px;
  background: rgba(255, 255, 255, 0.48);
  transform: rotate(18deg);
  transition: left 420ms ease;
}

.trade-button::before,
.primary-button::before {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.16), transparent, rgba(78, 231, 255, 0.2));
  opacity: 0.55;
  animation: buttonFlow 2.8s linear infinite;
}

.trade-button:hover::after,
.primary-button:hover::after {
  left: 118%;
}

.primary-button,
.trade-button,
.ghost-button,
.icon-button {
  position: relative;
  min-height: 35px;
  border-radius: 999px;
  padding: 0 14px;
  font-weight: 850;
}

.primary-button,
.trade-button {
  border: 1px solid #1266d6;
  background: linear-gradient(180deg, #45b6ff, #1678df);
  color: #fff;
  box-shadow: 0 10px 20px rgba(54, 163, 255, 0.24);
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.primary-button:hover,
.trade-button:hover {
  background: linear-gradient(180deg, #37a8f4, #1266d6);
  box-shadow: 0 14px 28px rgba(54, 163, 255, 0.3);
  transform: translateY(-1px);
}

.trade-button:disabled {
  cursor: not-allowed;
  border-color: #b9c8d6;
  background: #d7e0e8;
  color: #71879b;
  box-shadow: none;
}

.ghost-button,
.icon-button {
  border: 1px solid #cfe0ee;
  background: linear-gradient(180deg, #ffffff, #f2f8fd);
  color: var(--ink);
}

.orders-panel {
  display: grid;
  gap: 16px;
  padding: 18px;
}

.admin-tools {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin-top: 14px;
}

.admin-nav {
  flex-wrap: wrap;
}

.admin-single-page {
  grid-template-columns: minmax(0, 1fr);
}

.database-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.database-metrics div {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(100, 190, 255, 0.26);
  border-radius: 16px;
  padding: 14px;
  background:
    radial-gradient(circle at 80% 0%, rgba(78, 231, 255, 0.14), transparent 60%),
    rgba(255, 255, 255, 0.1);
}

.database-metrics strong {
  display: block;
  color: var(--cyan);
  font-size: 26px;
  line-height: 1;
}

.database-metrics span {
  display: block;
  margin-top: 8px;
  color: var(--muted-dark);
  font-weight: 800;
}

.lookup-form {
  display: grid;
  grid-template-columns: minmax(360px, 1.25fr) minmax(260px, 0.55fr) 128px;
  gap: 12px;
  align-items: end;
  max-width: 1180px;
  margin-left: auto;
}

.order-card,
.admin-item,
.trade-ticket-panel {
  border: 1px solid #d9e8f3;
  border-radius: var(--radius-sm);
  background: #fff;
}

.order-card {
  padding: 14px;
}

.order-access {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(150px, 0.75fr);
  gap: 10px;
  margin-top: 12px;
}

.order-access-card {
  display: grid;
  gap: 7px;
  border: 1px solid rgba(54, 163, 255, 0.24);
  border-radius: 14px;
  padding: 12px;
  background:
    linear-gradient(135deg, rgba(54, 163, 255, 0.11), rgba(78, 231, 255, 0.04)),
    #ffffff;
  box-shadow: 0 12px 30px rgba(27, 125, 220, 0.08);
}

.order-access-card span {
  color: #64849b;
  font-size: 12px;
  font-weight: 900;
}

.order-access-card code {
  color: #102f48;
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: 15px;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.order-access-card.is-password code {
  color: #0a7bdc;
  font-size: 19px;
  letter-spacing: 0;
}

.delivered-keys {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  border: 1px solid rgba(54, 163, 255, 0.28);
  border-radius: 18px;
  padding: 16px;
  background:
    radial-gradient(circle at 8% 0%, rgba(78, 231, 255, 0.16), transparent 38%),
    linear-gradient(135deg, rgba(54, 163, 255, 0.12), transparent 62%),
    #f7fbff;
  box-shadow: 0 18px 42px rgba(27, 125, 220, 0.1);
}

.delivered-keys strong {
  color: #1266d6;
  font-size: 18px;
}

.delivery-note {
  margin: 0;
  border: 1px solid rgba(255, 184, 77, 0.26);
  border-radius: 14px;
  padding: 10px 12px;
  background: rgba(255, 249, 235, 0.82);
  color: #7b5b18;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.65;
}

.delivery-key-code {
  width: 100%;
  border: 1px solid rgba(14, 118, 214, 0.3);
  border-radius: 15px;
  padding: 15px 16px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(233, 247, 255, 0.9)),
    #fff;
  color: #072a44;
  cursor: pointer;
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: 18px;
  font-weight: 950;
  letter-spacing: 0.2px;
  line-height: 1.45;
  overflow-wrap: anywhere;
  text-align: left;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.8),
    0 12px 28px rgba(54, 163, 255, 0.12);
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.delivery-key-code::after {
  content: "点击复制";
  float: right;
  margin-left: 12px;
  border-radius: 999px;
  padding: 4px 9px;
  background: rgba(10, 123, 220, 0.1);
  color: #0a7bdc;
  font-family: inherit;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
}

.delivery-key-code:hover {
  transform: translateY(-1px);
  border-color: rgba(14, 118, 214, 0.55);
  box-shadow: 0 18px 34px rgba(54, 163, 255, 0.18);
}

.delivery-key-code[data-copied="true"] {
  border-color: rgba(45, 201, 124, 0.46);
  background:
    linear-gradient(135deg, rgba(238, 255, 246, 0.98), rgba(222, 250, 255, 0.9)),
    #fff;
  color: #087044;
}

.delivery-key-code[data-copied="true"]::after {
  content: "已复制";
  background: rgba(45, 201, 124, 0.14);
  color: #07945b;
}

.delivered-keys code {
  display: block;
  border: 1px solid rgba(54, 163, 255, 0.22);
  border-radius: 10px;
  padding: 8px 10px;
  background: #ffffff;
  color: #12344f;
  font-family: Consolas, "SFMono-Regular", monospace;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.payment-box {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  border: 1px solid rgba(54, 163, 255, 0.22);
  border-radius: 14px;
  padding: 13px;
  background:
    linear-gradient(100deg, rgba(54, 163, 255, 0.1), rgba(78, 231, 255, 0.06)),
    #f8fcff;
}

.payment-box strong {
  color: #1266d6;
}

.payment-box p {
  margin: 0;
  color: #516b80;
  line-height: 1.55;
}

.admin-layout {
  display: grid;
  grid-template-columns: minmax(340px, 0.9fr) minmax(0, 1.1fr);
  gap: 14px;
  margin-top: 14px;
}

body.admin-page .standalone-admin {
  grid-template-columns: minmax(240px, 0.55fr) minmax(420px, 0.95fr) minmax(0, 1.05fr);
}

.category-icon-panel {
  align-self: start;
}

.product-form,
#adminProducts {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.field-hint {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.product-form input[readonly] {
  color: #43657f;
  background:
    linear-gradient(90deg, rgba(54, 163, 255, 0.08), rgba(255, 255, 255, 0.82)),
    #f4f9fd;
  cursor: not-allowed;
}

.form-row > label {
  flex: 1;
}

.upload-box {
  min-height: 104px;
  place-items: center;
  border: 1px dashed rgba(100, 190, 255, 0.38);
  border-radius: var(--radius-sm);
  background: #f4f9fd;
  text-align: center;
}

.upload-box input {
  display: none;
}

.upload-box strong {
  color: var(--ink);
}

.admin-status {
  min-height: 34px;
  border: 1px solid #d9e8f3;
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  color: var(--muted);
  background: #f4f9fd;
}

.admin-status:empty {
  display: none;
}

.admin-status[data-tone="success"] {
  color: var(--green);
}

.admin-status[data-tone="error"] {
  color: var(--red);
}

.card-summary {
  display: grid;
  gap: 8px;
}

.card-summary-row {
  display: grid;
  gap: 9px;
  border: 1px solid rgba(100, 190, 255, 0.22);
  border-radius: 12px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-on-dark);
}

.summary-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.card-summary-row span {
  color: var(--muted-dark);
}

.summary-track {
  overflow: hidden;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
}

.summary-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--cyan), var(--blue));
  box-shadow: 0 0 14px rgba(78, 231, 255, 0.32);
  transition: width 260ms ease;
}

.card-ledger {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.card-ledger h3 {
  margin: 2px 0 0;
  color: var(--text-on-dark);
}

.ledger-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  color: var(--text-on-dark);
}

.ledger-head div {
  display: grid;
  gap: 2px;
}

.ledger-head span,
.ledger-page-info {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.card-db-tools {
  display: grid;
  grid-template-columns: minmax(180px, 1.3fr) minmax(150px, 1fr) repeat(2, minmax(118px, 0.7fr)) auto;
  gap: 10px;
  align-items: end;
  border: 1px solid rgba(54, 163, 255, 0.2);
  border-radius: 16px;
  padding: 12px;
  background:
    linear-gradient(135deg, rgba(54, 163, 255, 0.1), rgba(255, 255, 255, 0.58)),
    rgba(255, 255, 255, 0.52);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.card-db-tools label {
  display: grid;
  gap: 6px;
}

.card-db-tools span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.ledger-row {
  display: grid;
  gap: 0;
  border: 1px solid rgba(100, 190, 255, 0.22);
  border-radius: 16px;
  padding: 0;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.82), rgba(235, 247, 255, 0.64)),
    rgba(255, 255, 255, 0.8);
  overflow: hidden;
  box-shadow: 0 12px 24px rgba(39, 96, 144, 0.08);
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.ledger-row:hover {
  transform: translateY(-1px);
  border-color: rgba(54, 163, 255, 0.42);
  box-shadow: 0 18px 32px rgba(39, 96, 144, 0.12), 0 0 20px rgba(78, 231, 255, 0.12);
}

.ledger-row code {
  overflow: hidden;
  color: var(--text-on-dark);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ledger-row small {
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ledger-summary {
  display: grid;
  grid-template-columns: 22px minmax(0, 1.3fr) minmax(130px, 0.9fr) auto auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  min-width: 0;
  border: 0;
  padding: 12px;
  background: transparent;
  color: inherit;
  cursor: pointer;
  text-align: left;
}

.ledger-row.is-selected {
  border-color: rgba(26, 137, 255, 0.62);
  box-shadow: 0 16px 34px rgba(39, 126, 210, 0.16), 0 0 0 1px rgba(72, 194, 255, 0.18) inset;
}

.card-key-check {
  width: 19px;
  height: 19px;
  margin: 0;
  accent-color: #1677ff;
  cursor: pointer;
}

.ledger-summary code {
  overflow: hidden;
  color: var(--ink);
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: 13px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ledger-meta {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.ledger-meta span {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ledger-detail {
  display: none;
  grid-template-columns: minmax(0, 1.4fr) minmax(145px, 0.8fr) 95px 105px auto;
  gap: 10px;
  align-items: start;
  border-top: 1px solid rgba(100, 190, 255, 0.18);
  padding: 12px;
  background:
    linear-gradient(90deg, rgba(78, 231, 255, 0.08), transparent 68%),
    rgba(246, 251, 255, 0.76);
}

.ledger-row.is-open .ledger-detail {
  display: grid;
}

.ledger-pager {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.ledger-empty {
  border: 1px dashed rgba(54, 163, 255, 0.28);
  border-radius: 16px;
  padding: 18px;
  color: var(--muted);
  text-align: center;
  background: rgba(255, 255, 255, 0.64);
}

.card-code-input,
.card-key-select {
  width: 100%;
  min-width: 0;
  border: 1px solid rgba(71, 132, 180, 0.18);
  border-radius: 12px;
  padding: 10px 11px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--ink);
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

.card-code-input:focus,
.card-key-select:focus {
  border-color: rgba(54, 163, 255, 0.56);
  box-shadow: 0 0 0 3px rgba(54, 163, 255, 0.13);
}

.card-key-select:disabled {
  color: var(--muted);
  background: rgba(237, 245, 251, 0.88);
}

.ledger-actions {
  display: flex;
  justify-content: flex-end;
  gap: 7px;
}

.mini-button {
  border: 1px solid rgba(54, 163, 255, 0.24);
  border-radius: 999px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.74);
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.mini-button:hover {
  transform: translateY(-1px);
  border-color: rgba(54, 163, 255, 0.44);
  box-shadow: 0 10px 18px rgba(54, 163, 255, 0.14);
}

.mini-button.is-save {
  background: linear-gradient(135deg, rgba(54, 163, 255, 0.92), rgba(78, 231, 255, 0.78));
  color: #fff;
}

.mini-button.is-danger {
  border-color: rgba(255, 109, 126, 0.26);
  color: #d9485d;
}

.key-status {
  border-radius: 999px;
  padding: 3px 8px;
  text-align: center;
  font-size: 12px;
  font-weight: 900;
}

.key-status.is-available {
  background: rgba(69, 217, 143, 0.14);
  color: var(--green);
}

.key-status.is-sold {
  background: rgba(255, 196, 92, 0.14);
  color: var(--gold);
}

.key-status.is-reserved {
  background: rgba(54, 163, 255, 0.13);
  color: #1684d8;
}

.key-status.is-delivered {
  background: rgba(54, 163, 255, 0.13);
  color: #1a85da;
}

.key-status.is-pending {
  background: rgba(125, 146, 164, 0.12);
  color: var(--muted);
}

/* Card key database compact workbench */
body.admin-page .card-ledger {
  display: grid;
  gap: 10px;
}

body.admin-page .ledger-head {
  border: 0;
  border-radius: 16px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.72);
}

body.admin-page .ledger-bulk-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

body.admin-page .ledger-bulk-actions .mini-button {
  min-height: 34px;
  padding: 7px 12px;
}

body.admin-page .mini-button.is-soft {
  border-color: rgba(80, 174, 255, 0.28);
  background: rgba(236, 248, 255, 0.9);
  color: #27607f;
}

body.admin-page .ledger-head strong {
  font-size: 16px;
}

body.admin-page .ledger-head span {
  font-size: 12px;
}

body.admin-page .ledger-row {
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(239, 250, 255, 0.86)),
    #ffffff;
  box-shadow: 0 10px 28px rgba(36, 104, 156, 0.08);
}

body.admin-page .ledger-row:hover {
  transform: none;
}

body.admin-page .ledger-summary {
  grid-template-columns: 22px minmax(180px, 1.35fr) minmax(220px, 1.25fr) auto auto;
  gap: 14px;
  min-height: 58px;
  padding: 12px 16px;
}

body.admin-page .ledger-code-preview {
  display: block;
  max-width: 100%;
  border-radius: 12px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.7);
  color: #10243a;
  font-size: 13px;
  letter-spacing: 0;
}

body.admin-page .ledger-meta {
  grid-template-columns: 1fr;
  gap: 2px;
}

body.admin-page .ledger-meta span:first-child {
  color: #16314a;
  font-size: 13px;
  font-weight: 950;
}

body.admin-page .ledger-meta span:last-child {
  color: #6c8194;
  font-size: 12px;
}

body.admin-page .ledger-meta .is-muted {
  opacity: 0.68;
}

body.admin-page .ledger-meta .query-password-preview {
  color: #0b74df;
  font-weight: 900;
}

body.admin-page .key-status {
  min-width: 62px;
  padding: 6px 10px;
}

body.admin-page .ledger-detail {
  grid-template-columns: minmax(230px, 1.3fr) minmax(180px, 0.9fr) 110px 120px minmax(260px, 1.25fr) auto;
  gap: 10px;
  align-items: center;
  padding: 12px 16px 16px;
  background:
    linear-gradient(90deg, rgba(54, 163, 255, 0.08), transparent 70%),
    rgba(248, 252, 255, 0.86);
}

body.admin-page .card-key-bound-info {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  min-width: 0;
}

body.admin-page .card-key-bound-info label {
  display: grid;
  gap: 4px;
  min-width: 0;
}

body.admin-page .card-key-bound-info span {
  color: #638098;
  font-size: 11px;
  font-weight: 900;
}

body.admin-page .card-key-bound-info input {
  min-width: 0;
  min-height: 36px;
  border: 1px solid rgba(137, 190, 230, 0.24);
  border-radius: 11px;
  padding: 0 9px;
  background: rgba(236, 247, 255, 0.68);
  color: #25445f;
  font-size: 12px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.admin-page .card-code-input,
body.admin-page .card-key-select {
  min-height: 42px;
  border-radius: 13px;
  padding: 9px 11px;
}

body.admin-page .card-code-input {
  overflow: hidden;
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.admin-page .ledger-actions {
  align-items: center;
  justify-content: end;
  gap: 8px;
}

body.admin-page .ledger-actions .mini-button {
  min-height: 40px;
  padding: 8px 14px;
}

@media (max-width: 980px) {
  body.admin-page .ledger-summary {
    grid-template-columns: 22px 1fr auto auto;
  }

  body.admin-page .ledger-meta {
    grid-column: 2 / -1;
    grid-row: 2;
  }

  body.admin-page .ledger-detail {
    grid-template-columns: 1fr;
  }

  body.admin-page .card-key-bound-info {
    grid-template-columns: 1fr;
  }

  body.admin-page .ledger-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
}

.admin-item {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 12px;
  box-shadow: 0 8px 18px rgba(0, 20, 40, 0.06);
}

.admin-item img {
  width: 76px;
  height: 76px;
  object-fit: contain;
  padding: 8px;
  border: 1px solid rgba(137, 190, 230, 0.45);
  border-radius: 18px;
  background: linear-gradient(145deg, #ffffff, #edf8ff);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.75), 0 8px 20px rgba(38, 101, 148, 0.10);
}

.icon-button {
  width: 38px;
  padding: 0;
}

.empty-state {
  padding: 24px;
  color: var(--muted);
  text-align: center;
}

.trade-ticket {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(1, 10, 18, 0.58);
  backdrop-filter: blur(8px);
}

.trade-ticket-panel {
  width: min(440px, 100%);
  padding: 18px;
  box-shadow: var(--shadow);
  animation: popIn 180ms ease both;
}

.trade-ticket-panel p {
  color: var(--muted);
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.ticket-field {
  margin: 12px 0;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes liftIn {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes glint {
  0%,
  55% {
    transform: translateX(-90%) rotate(0);
  }
  72%,
  100% {
    transform: translateX(120%) rotate(0);
  }
}

@keyframes pulseDot {
  50% {
    box-shadow: 0 0 0 8px rgba(69, 217, 143, 0.06);
    transform: scale(0.92);
  }
}

@keyframes popIn {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes scanSheen {
  0%,
  62% {
    transform: translateX(-100%);
  }
  82%,
  100% {
    transform: translateX(100%);
  }
}

@keyframes modalFade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes modalFadeOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

@keyframes modalLift {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes dockReveal {
  from {
    opacity: 0;
    filter: blur(3px);
    transform: translateY(-10px) scale(0.96);
  }
  60% {
    opacity: 1;
    filter: blur(0);
    transform: translateY(2px) scale(1.015);
  }
  to {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0) scale(1);
  }
}

@keyframes ambientSweep {
  0%,
  100% {
    transform: translateX(-18%);
    opacity: 0.48;
  }
  50% {
    transform: translateX(12%);
    opacity: 0.88;
  }
}

@keyframes borderOrbit {
  0% {
    transform: translateX(-65%);
  }
  100% {
    transform: translateX(65%);
  }
}

@keyframes activeBreath {
  50% {
    box-shadow: 0 0 26px rgba(54, 163, 255, 0.46);
  }
}

@keyframes buttonFlow {
  from {
    background-position: 0 0;
  }
  to {
    background-position: 130px 0;
  }
}

@keyframes imageScan {
  0%,
  58% {
    transform: translateX(-100%);
  }
  78%,
  100% {
    transform: translateX(100%);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media (max-width: 860px) {
  .topbar,
  .store-hero,
  .shop-layout,
  .admin-layout,
  .admin-tools {
    grid-template-columns: 1fr;
  }

  .store-metrics,
  .database-metrics {
    grid-template-columns: 1fr;
  }

  .card-db-tools,
  .ledger-summary,
  .ledger-detail {
    grid-template-columns: 1fr;
  }

  .ledger-actions {
    justify-content: stretch;
  }

  .ledger-head,
  .ledger-pager {
    align-items: stretch;
    flex-direction: column;
  }

  .mini-button {
    flex: 1;
  }

  .announcement-modal {
    padding: 14px;
  }

  .announcement-modal-head {
    padding: 17px 16px 12px;
  }

  .announcement-modal-list {
    max-height: 52vh;
    padding: 14px 16px 2px;
  }

  .announcement-modal-list p {
    grid-template-columns: 1fr;
  }

  .announcement-confirm {
    width: calc(100% - 32px);
    margin: 14px 16px 16px;
  }

  .market-pulse,
  .ghost-link {
    justify-self: start;
  }

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

  .catalog-head {
    display: none;
  }

  .product-card {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .product-detail {
    grid-template-columns: 1fr;
  }

  .product-card.is-expanded .product-detail {
    max-height: 520px;
  }

  .product-body,
  .product-meta {
    display: grid;
    gap: 7px;
  }

  .product-title,
  .product-body p,
  .price,
  .stock,
  .trade-button {
    grid-column: auto;
    grid-row: auto;
  }

  .filters,
  .form-row,
  .form-actions,
  .lookup-form,
  .order-access {
    display: grid;
    grid-template-columns: 1fr;
  }

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

  .catalog-panel,
  .category-rail {
    border-radius: var(--radius-sm);
  }

  .notice-band strong {
    min-height: 42px;
  }
}

@media (max-width: 1180px) {
  .lookup-form {
    grid-template-columns: minmax(0, 1fr) minmax(220px, 0.55fr);
    max-width: none;
    margin-left: 0;
  }

  .lookup-form .primary-button {
    grid-column: 1 / -1;
    justify-self: end;
    min-width: 136px;
  }
}

@media (max-width: 760px) {
  .lookup-form {
    grid-template-columns: 1fr;
  }

  .lookup-form .primary-button {
    grid-column: auto;
    justify-self: stretch;
    width: 100%;
  }
}

/* Final storefront priority layer */
.store-hero.premium-hero {
  grid-template-columns: minmax(0, 1.02fr) minmax(360px, 0.78fr);
  min-height: 360px;
  padding: clamp(26px, 4vw, 42px);
  background:
    radial-gradient(circle at 10% 0%, rgba(78, 231, 255, 0.22), transparent 310px),
    radial-gradient(circle at 82% 24%, rgba(54, 163, 255, 0.18), transparent 260px),
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(237, 248, 255, 0.92) 58%, rgba(248, 252, 255, 0.96));
}

.store-hero.premium-hero h1 {
  max-width: 600px;
  color: #0e2c46;
  font-size: clamp(34px, 5vw, 62px);
  letter-spacing: 0;
}

.store-hero.premium-hero p {
  max-width: 560px;
  color: #4d6c83;
  font-size: 16px;
}

.store-hero.premium-hero .store-metrics {
  grid-template-columns: 1fr;
}

.store-hero.premium-hero .store-metrics div {
  border-radius: 16px;
  background:
    linear-gradient(90deg, rgba(54, 163, 255, 0.08), rgba(255, 255, 255, 0.76)),
    #fff;
}

.catalog-panel .product-card {
  border-color: rgba(100, 190, 255, 0.2);
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(246, 252, 255, 0.94)),
    #fff;
}

.catalog-panel .product-card::after {
  content: "";
  position: absolute;
  left: 14px;
  top: 12px;
  bottom: 12px;
  width: 3px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--cyan), var(--blue));
  opacity: 0.55;
  box-shadow: 0 0 14px rgba(78, 231, 255, 0.3);
}

.catalog-panel .product-title,
.catalog-panel .product-body p {
  padding-left: 12px;
}

@media (max-width: 860px) {
  .store-hero.premium-hero {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .store-hero.premium-hero .store-metrics {
    grid-template-columns: repeat(3, 1fr);
  }

  .catalog-panel .product-card::after {
    left: 12px;
    right: 12px;
    top: 0;
    bottom: auto;
    width: auto;
    height: 3px;
  }

  .catalog-panel .product-title,
  .catalog-panel .product-body p {
    padding-left: 0;
  }
}

@media (max-width: 560px) {
  .store-hero.premium-hero .store-metrics {
    grid-template-columns: 1fr;
  }
}

/* Chirou-inspired storefront pass */
body {
  background:
    linear-gradient(180deg, #f8fcff 0, #eaf7ff 46%, #f7fcff 100%),
    #f4fbff;
}

body::before {
  opacity: 0.48;
  background:
    linear-gradient(rgba(16, 132, 218, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(16, 132, 218, 0.035) 1px, transparent 1px);
  background-size: 32px 32px;
}

body::after {
  opacity: 0.42;
}

.shell {
  width: min(1520px, calc(100% - 40px));
  padding-top: 14px;
}

.topbar {
  position: sticky;
  top: 12px;
  z-index: 30;
  min-height: 70px;
  border: 1px solid rgba(136, 190, 230, 0.54);
  border-radius: 999px;
  padding: 9px 14px 9px 18px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow:
    0 18px 50px rgba(36, 92, 132, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(18px);
}

.brand-mark {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 28%, #ffffff 0 20%, transparent 21%),
    conic-gradient(from 220deg, #0877ee, #5ddcff, #0f6fed, #0877ee);
  box-shadow: 0 10px 24px rgba(22, 123, 220, 0.22);
}

.brand strong {
  color: #111820;
  font-size: 18px;
  font-weight: 950;
}

.brand small {
  color: #657583;
}

.nav-tabs {
  gap: 8px;
}

.nav-tab {
  min-height: 44px;
  border-radius: 999px;
  padding: 0 16px;
  color: #5f6870;
  font-weight: 900;
}

.nav-tab.is-active {
  background: #ffffff;
  color: #111820;
  box-shadow: 0 12px 28px rgba(37, 82, 116, 0.12);
}

.market-pulse {
  border-radius: 999px;
  padding: 12px 18px;
  background: #050505;
  color: #fff;
}

.trading-desk {
  margin-top: 24px;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.desk-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  padding: 0 4px;
}

.desk-toolbar h1 {
  margin: 0;
  color: #050505;
  font-size: 28px;
  line-height: 1.1;
}

.filters {
  border: 1px solid rgba(137, 190, 230, 0.5);
  border-radius: 999px;
  padding: 6px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 14px 32px rgba(36, 92, 132, 0.08);
}

.filters label {
  margin: 0;
}

.filters input,
.filters select {
  min-height: 42px;
  border-radius: 999px;
  background: transparent;
}

.shop-layout {
  display: grid;
  grid-template-columns: 430px minmax(0, 1fr);
  gap: 26px;
  align-items: start;
  background: transparent;
}

.category-rail {
  position: sticky;
  top: 100px;
  max-height: calc(100vh - 124px);
  overflow: auto;
  border: 1px solid rgba(137, 190, 230, 0.48);
  border-radius: 28px;
  padding: 28px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(250, 253, 255, 0.88)),
    #fff;
  box-shadow: 0 24px 64px rgba(38, 101, 148, 0.14);
}

.category-rail h3 {
  margin-bottom: 22px;
  color: #050505;
  font-size: 30px;
  font-weight: 950;
}

.category-button {
  min-height: 50px;
  border: 0;
  border-radius: 16px;
  padding: 0 14px;
  background: transparent;
  color: #59636d;
  font-size: 16px;
}

.category-button::before {
  content: "";
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 30%, #fff 0 22%, transparent 23%),
    linear-gradient(135deg, #21a1ff, #dff5ff);
  box-shadow: 0 6px 14px rgba(31, 127, 210, 0.16);
}

.category-button.is-active,
.category-button:hover {
  transform: none;
  background: #eff8ff;
  color: #101820;
  box-shadow: inset 0 0 0 1px rgba(93, 174, 230, 0.18);
}

.catalog-panel {
  border: 1px solid rgba(137, 190, 230, 0.48);
  border-radius: 0;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 18px 50px rgba(38, 101, 148, 0.1);
}

.catalog-head,
.product-card {
  grid-template-columns: minmax(420px, 1fr) 118px 96px 94px;
}

.catalog-head {
  padding: 14px 20px;
  background: rgba(251, 254, 255, 0.92);
  color: #6e7883;
}

.product-grid {
  gap: 0;
  padding: 0;
  background: transparent;
}

.catalog-panel .product-card {
  min-height: 94px;
  border: 0;
  border-bottom: 1px solid rgba(137, 190, 230, 0.34);
  border-radius: 0;
  padding: 16px 20px;
  background: rgba(255, 255, 255, 0.58);
  box-shadow: none;
}

.catalog-panel .product-card::after {
  display: none;
}

.catalog-panel .product-card:hover {
  transform: none;
  background: #f8fcff;
  box-shadow: inset 4px 0 0 #1696f7;
}

.product-body {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  grid-template-areas:
    "thumb title"
    "thumb copy"
    "thumb tags";
  gap: 4px 14px;
  align-items: center;
}

.product-thumb {
  grid-area: thumb;
  width: 52px;
  height: 52px;
  overflow: hidden;
  border: 1px solid rgba(137, 190, 230, 0.5);
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 8px 20px rgba(38, 101, 148, 0.12);
}

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

.catalog-panel .product-title {
  grid-area: title;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding-left: 0;
}

.catalog-panel .product-title h3 {
  color: #101820;
  font-size: 17px;
  font-weight: 950;
}

.catalog-panel .product-body p {
  grid-area: copy;
  display: none;
  padding-left: 0;
}

.tag-row {
  grid-area: tags;
  gap: 6px;
}

.tag-row span,
.status-badge {
  border: 0;
  border-radius: 999px;
  padding: 4px 9px;
  background: #e8f8ef;
  color: #079247;
  font-size: 12px;
  font-weight: 950;
}

.tag-row span:nth-child(even) {
  background: #eaf5ff;
  color: #087ee8;
}

.price {
  justify-self: start;
  color: #050505;
  font-size: 22px;
  font-weight: 950;
}

.stock {
  color: #657583;
  font-weight: 800;
}

.trade-button {
  min-height: 42px;
  border-radius: 999px;
  background: #050505;
  color: #ffffff;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.14);
}

.trade-button:hover:not(:disabled) {
  transform: translateY(-1px);
  background: #111820;
}

.product-detail {
  margin-top: 4px;
  border-radius: 24px;
  background: #f7fcff;
}

.product-card.is-expanded .product-detail {
  max-height: 340px;
  padding: 18px;
}

.detail-image {
  border-radius: 22px;
}

.notice-band {
  margin-top: 26px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.86);
}

.trade-ticket {
  overflow: auto;
  place-items: start center;
  padding: 34px 18px;
  background: rgba(229, 245, 255, 0.66);
}

.product-checkout {
  width: min(1460px, 100%);
  overflow: hidden;
  border: 1px solid rgba(137, 190, 230, 0.55);
  border-radius: 28px;
  padding: 26px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 253, 255, 0.96)),
    #fff;
  box-shadow: 0 34px 90px rgba(38, 101, 148, 0.22);
}

.checkout-hero {
  display: grid;
  grid-template-columns: minmax(360px, 0.95fr) minmax(360px, 1fr);
  gap: 28px;
}

.checkout-image {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(137, 190, 230, 0.5);
  border-radius: 28px;
  aspect-ratio: 1.48 / 1;
  background: #f6fbff;
}

.checkout-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.checkout-image::after {
  content: "查看原图";
  position: absolute;
  right: 18px;
  bottom: 18px;
  border-radius: 999px;
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.86);
  color: #1b2a36;
  font-weight: 900;
  box-shadow: 0 12px 30px rgba(30, 72, 110, 0.14);
}

.checkout-purchase {
  display: grid;
  align-content: start;
  gap: 16px;
}

.checkout-purchase h2 {
  margin: 0;
  color: #050505;
  font-size: clamp(28px, 3vw, 40px);
  line-height: 1.15;
}

.checkout-badges,
.checkout-pay-methods div {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.checkout-badges span,
.checkout-pay-methods span {
  border-radius: 999px;
  padding: 7px 12px;
  background: #e9f9ef;
  color: #078c42;
  font-weight: 950;
}

.checkout-badges span:nth-child(2),
.checkout-pay-methods span:nth-child(2) {
  background: #eaf5ff;
  color: #087ee8;
}

.checkout-price {
  color: #050505;
  font-size: 38px;
  font-weight: 950;
}

.ticket-field {
  display: grid;
  gap: 9px;
  margin: 0;
}

.ticket-field > span,
.checkout-pay-methods strong {
  color: #273845;
  font-weight: 950;
}

.ticket-field input {
  min-height: 52px;
  border: 1px solid rgba(137, 190, 230, 0.64);
  border-radius: 18px;
  padding: 0 15px;
  background: #fff;
  color: #13283b;
  outline: none;
}

.ticket-field input:focus {
  border-color: #1696f7;
  box-shadow: 0 0 0 4px rgba(22, 150, 247, 0.12);
}

.ticket-field input.is-invalid {
  border-color: rgba(255, 84, 104, 0.78);
  background: #fff8f9;
  box-shadow: 0 0 0 4px rgba(255, 84, 104, 0.1);
}

.quantity-stepper {
  display: inline-grid;
  grid-template-columns: 54px 96px 54px;
  width: max-content;
  overflow: hidden;
  border: 1px solid rgba(137, 190, 230, 0.64);
  border-radius: 999px;
  background: #fff;
}

.quantity-stepper button,
.quantity-stepper input {
  min-height: 52px;
  border: 0;
  border-radius: 0;
  text-align: center;
  background: transparent;
  color: #050505;
  font-size: 20px;
  font-weight: 950;
}

.checkout-pay-methods {
  display: grid;
  gap: 12px;
  border: 1px solid rgba(137, 190, 230, 0.48);
  border-radius: 22px;
  padding: 18px;
  background: #edf8ff;
}

.checkout-status {
  margin: 0;
  color: #617282;
}

.checkout-detail {
  margin-top: 28px;
  border: 1px solid rgba(137, 190, 230, 0.42);
  border-radius: 24px;
  background: #ffffff;
}

.checkout-detail h3 {
  margin: 0;
  border-bottom: 1px solid rgba(137, 190, 230, 0.28);
  padding: 20px 24px;
  color: #050505;
  font-size: 26px;
}

.checkout-detail p {
  margin: 0;
  padding: 24px;
  color: #101820;
  font-size: 16px;
  line-height: 1.8;
  white-space: pre-wrap;
}

.checkout-detail .detail-tags {
  padding: 0 24px 24px;
}

.product-checkout .order-access,
.product-checkout .payment-box,
.product-checkout .delivered-keys {
  margin-top: 0;
}

@media (max-width: 1100px) {
  .shop-layout {
    grid-template-columns: 300px minmax(0, 1fr);
  }

  .catalog-head,
  .product-card {
    grid-template-columns: minmax(280px, 1fr) 100px 82px 88px;
  }

  .checkout-hero {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 780px) {
  .shell {
    width: min(100% - 20px, 720px);
  }

  .topbar {
    position: relative;
    top: 0;
    border-radius: 26px;
    align-items: stretch;
  }

  .shop-layout {
    grid-template-columns: 1fr;
  }

  .category-rail {
    position: relative;
    top: 0;
    max-height: none;
  }

  .catalog-head {
    display: none;
  }

  .catalog-panel .product-card {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .price,
  .stock,
  .trade-button {
    justify-self: stretch;
  }

  .checkout-hero {
    gap: 18px;
  }

  .product-checkout {
    padding: 16px;
  }
}

/* Storefront compact correction */
.desk-toolbar {
  align-items: center;
  margin: 22px 0 16px;
}

.desk-toolbar h1 {
  font-size: 28px;
}

.filters {
  max-width: 420px;
}

.shop-layout {
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 24px;
}

.category-rail {
  padding: 22px;
}

.category-rail h3 {
  margin: 0 0 18px;
  padding: 0;
  background: transparent;
  font-size: 26px;
}

.category-button {
  min-height: 44px;
  margin: 4px 0;
}

.catalog-head,
.product-card {
  grid-template-columns: minmax(360px, 1fr) 110px 100px 96px;
}

.catalog-panel .product-card {
  min-height: 74px;
  padding: 12px 18px;
}

.product-thumb {
  width: 44px;
  height: 44px;
}

.product-body {
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 3px 12px;
}

.catalog-panel .product-title h3 {
  font-size: 16px;
}

.tag-row span,
.status-badge {
  padding: 3px 8px;
  font-size: 11px;
}

.price {
  font-size: 19px;
}

.trade-button {
  min-height: 38px;
  padding-inline: 14px;
}

@media (max-width: 980px) {
  .shop-layout {
    grid-template-columns: 260px minmax(0, 1fr);
  }

  .catalog-head,
  .product-card {
    grid-template-columns: minmax(260px, 1fr) 90px 86px 84px;
  }
}

/* Chirou layout correction: no detached catalog toolbar */
.shell {
  width: min(1600px, calc(100% - 42px));
}

.topbar {
  margin-bottom: 26px;
}

.trading-desk {
  margin-top: 0;
}

.desk-toolbar {
  display: none;
}

.shop-layout {
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 26px;
  align-items: start;
}

.category-rail {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 420px;
  padding: 26px 28px;
  border-radius: 26px;
}

.category-rail h3 {
  margin: 0 0 28px;
  border-bottom: 1px solid rgba(137, 190, 230, 0.28);
  padding: 0 0 18px;
  background: transparent;
  font-size: 28px;
  line-height: 1.1;
}

.category-button {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 12px;
  min-height: 50px;
  margin: 5px 0;
  padding: 0 14px;
  text-align: left;
}

#categoryRail {
  min-height: 290px;
  display: grid;
  align-content: center;
  gap: 18px;
  padding: 0 14px;
}

.category-button {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
}

.category-button::before {
  flex: 0 0 30px;
}

.catalog-panel {
  overflow: hidden;
  border-radius: 26px;
}

.catalog-head,
.product-card {
  grid-template-columns: minmax(360px, 1fr) 118px 104px 102px;
}

.catalog-head {
  min-height: 58px;
  padding: 0 20px;
}

.catalog-panel .product-card {
  min-height: 102px;
  padding: 14px 20px;
}

.catalog-panel .product-card:first-child {
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}

.catalog-panel .product-card:last-child {
  border-bottom-left-radius: 26px;
  border-bottom-right-radius: 26px;
  border-bottom: 0;
}

.product-body {
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 4px 14px;
}

.product-thumb {
  width: 52px;
  height: 52px;
}

.catalog-panel .product-title h3 {
  font-size: 17px;
}

.trade-button:disabled {
  background: #e8f1f8;
  color: #7a8fa0;
  box-shadow: none;
}

@media (max-width: 1100px) {
  .shop-layout {
    grid-template-columns: 280px minmax(0, 1fr);
  }
}

@media (max-width: 820px) {
  .shop-layout {
    grid-template-columns: 1fr;
  }

  .category-rail {
    min-height: 0;
  }

  .catalog-head {
    display: none;
  }

  .catalog-panel .product-card {
    grid-template-columns: 1fr;
  }
}

/* Admin isolation: keep storefront replica styles out of the backend */
body.admin-page {
  background:
    radial-gradient(circle at 14% -10%, rgba(54, 163, 255, 0.16), transparent 320px),
    linear-gradient(180deg, #f6fbff 0, #eef7ff 100%);
}

body.admin-page .shell {
  width: min(1280px, calc(100% - 32px));
  padding: 18px 0 38px;
}

body.admin-page .topbar {
  position: relative;
  top: auto;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(460px, 560px) minmax(170px, 1fr);
  min-height: 68px;
  margin-bottom: 18px;
  border-radius: 18px;
  padding: 0 18px;
}

body.admin-page .brand-mark {
  width: 38px;
  height: 38px;
}

body.admin-page .nav-tabs {
  justify-self: center;
  justify-content: center;
}

body.admin-page .admin-nav {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  width: min(100%, 720px);
  gap: 8px;
  padding: 7px;
}

body.admin-page .nav-tab {
  display: grid;
  place-items: center;
  min-height: 46px;
  border-radius: 16px;
  padding: 0 22px;
  text-align: center;
  white-space: nowrap;
}

body.admin-page .admin-top-actions {
  justify-content: end;
}

body.admin-page .admin-layout,
body.admin-page .admin-tools {
  margin-top: 14px;
}

body.admin-page .admin-section[hidden] {
  display: none !important;
}

body.admin-page .admin-tools {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

body.admin-page .admin-tools.admin-single-page {
  grid-template-columns: minmax(0, 1fr);
}

body.admin-page .admin-panel,
body.admin-page .admin-list {
  overflow: hidden;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.94);
}

body.admin-page .panel-head {
  gap: 12px;
  min-height: 70px;
}

body.admin-page .product-form,
body.admin-page #adminProducts {
  padding: 16px;
}

body.admin-page .card-db-tools {
  grid-template-columns: minmax(220px, 1.2fr) repeat(3, minmax(140px, 0.8fr)) auto;
}

body.admin-page .card-ledger {
  overflow-x: auto;
}

@media (max-width: 980px) {
  body.admin-page .topbar {
    grid-template-columns: 1fr;
    align-items: stretch;
    border-radius: 18px;
    padding: 14px;
  }

  body.admin-page .nav-tabs,
  body.admin-page .admin-top-actions {
    justify-content: start;
  }

  body.admin-page .admin-layout,
  body.admin-page .admin-tools {
    grid-template-columns: 1fr;
  }

  body.admin-page .card-db-tools {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 981px) and (max-width: 1180px) {
  body.admin-page .topbar {
    grid-template-columns: minmax(170px, 0.8fr) minmax(420px, 1.3fr) minmax(140px, 0.8fr);
    padding: 0 14px;
  }

  body.admin-page .admin-nav {
    width: min(100%, 500px);
  }

  body.admin-page .nav-tab {
    padding: 0 16px;
  }
}

/* Mobile final pass */
html {
  -webkit-text-size-adjust: 100%;
}

@media (max-width: 820px) {
  body {
    min-width: 0;
    overflow-x: hidden;
  }

  .shell,
  body.admin-page .shell {
    width: min(100% - 18px, 760px);
    padding-top: 10px;
  }

  .topbar,
  body.admin-page .topbar {
    position: sticky;
    top: 8px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    min-height: auto;
    border-radius: 22px;
    padding: 12px;
  }

  .brand {
    min-width: 0;
  }

  .brand-mark,
  body.admin-page .brand-mark {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
  }

  .brand strong {
    display: block;
    overflow: hidden;
    max-width: 100%;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .brand small {
    display: none;
  }

  .nav-tabs,
  body.admin-page .nav-tabs,
  body.admin-page .admin-nav {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    width: 100%;
    justify-self: stretch;
    overflow-x: auto;
    gap: 6px;
    padding: 5px;
    scrollbar-width: none;
  }

  .nav-tabs::-webkit-scrollbar,
  body.admin-page .admin-nav::-webkit-scrollbar {
    display: none;
  }

  .nav-tab,
  body.admin-page .nav-tab {
    min-width: max-content;
    min-height: 40px;
    padding: 0 14px;
    border-radius: 14px;
    font-size: 14px;
  }

  .market-pulse,
  .ghost-link,
  body.admin-page .admin-top-actions {
    justify-self: stretch;
  }

  .market-pulse,
  .ghost-link {
    justify-content: center;
    min-height: 40px;
    border-radius: 14px;
  }

  .trading-desk {
    margin-top: 14px;
  }

  .shop-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .category-rail {
    position: relative;
    top: 0;
    max-height: none;
    overflow: hidden;
    border-radius: 22px;
    padding: 16px;
  }

  .category-rail h3 {
    margin-bottom: 12px;
    font-size: 22px;
    text-align: left;
  }

  #categoryRail {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  #categoryRail::-webkit-scrollbar {
    display: none;
  }

  .category-button {
    flex: 0 0 auto;
    width: auto;
    min-height: 42px;
    margin: 0;
    padding: 0 14px 0 10px;
    border-radius: 999px;
    white-space: nowrap;
  }

  .category-button::before {
    width: 22px;
    height: 22px;
  }

  .catalog-panel {
    overflow: hidden;
    border-radius: 22px;
  }

  .catalog-head {
    display: none;
  }

  .catalog-panel .product-card,
  .product-card {
    grid-template-columns: 1fr;
    gap: 12px;
    min-height: 0;
    padding: 16px;
  }

  .catalog-panel .product-card {
    border-bottom-color: rgba(137, 190, 230, 0.24);
  }

  .product-body {
    grid-template-columns: 46px minmax(0, 1fr);
    gap: 5px 12px;
  }

  .product-thumb {
    width: 46px;
    height: 46px;
  }

  .catalog-panel .product-title h3 {
    font-size: 16px;
    line-height: 1.35;
  }

  .tag-row {
    overflow-x: auto;
    flex-wrap: nowrap;
    max-width: 100%;
    scrollbar-width: none;
  }

  .tag-row::-webkit-scrollbar {
    display: none;
  }

  .price,
  .stock {
    justify-self: start;
  }

  .price {
    font-size: 24px;
  }

  .trade-button {
    justify-self: stretch;
    width: 100%;
    min-height: 46px;
  }

  .product-card.is-expanded .product-detail {
    grid-template-columns: 1fr;
    max-height: none;
    padding: 14px;
  }

  .detail-image {
    aspect-ratio: 16 / 10;
  }

  .trade-ticket {
    align-items: start;
    padding: 10px;
  }

  .product-checkout {
    width: 100%;
    max-height: calc(100dvh - 20px);
    overflow: auto;
    border-radius: 22px;
    padding: 14px;
  }

  .checkout-hero {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .checkout-image {
    border-radius: 20px;
    aspect-ratio: 16 / 10;
  }

  .checkout-image::after {
    right: 10px;
    bottom: 10px;
    padding: 8px 12px;
    font-size: 12px;
  }

  .checkout-purchase {
    gap: 12px;
  }

  .checkout-purchase h2 {
    font-size: 24px;
  }

  .checkout-price {
    font-size: 30px;
  }

  .ticket-field input {
    min-height: 48px;
    border-radius: 15px;
  }

  .quantity-stepper {
    grid-template-columns: 48px minmax(72px, 1fr) 48px;
    width: min(100%, 220px);
  }

  .checkout-pay-methods {
    border-radius: 18px;
    padding: 14px;
  }

  .checkout-detail {
    margin-top: 16px;
    border-radius: 18px;
  }

  .checkout-detail h3 {
    padding: 16px;
    font-size: 20px;
  }

  .checkout-detail p,
  .checkout-detail .detail-tags {
    padding: 16px;
  }

  .orders-panel,
  .admin-panel,
  .admin-list {
    border-radius: 20px;
  }

  .orders-panel {
    padding: 18px;
  }

  .lookup-form,
  .form-row,
  body.admin-page .admin-layout,
  body.admin-page .admin-tools {
    grid-template-columns: 1fr;
  }

  body.admin-page .admin-login-screen {
    padding: 18px;
  }

  body.admin-page .admin-login-card {
    width: 100%;
    border-radius: 22px;
    padding: 24px 18px;
  }

  body.admin-page .admin-login-card h1 {
    font-size: 28px;
  }

  body.admin-page .panel-head {
    grid-template-columns: 1fr;
    align-items: start;
    padding: 16px;
  }

  body.admin-page .panel-head .ghost-button,
  body.admin-page .panel-head button {
    width: 100%;
  }

  body.admin-page .product-form,
  body.admin-page #adminProducts {
    padding: 14px;
  }

  body.admin-page .card-db-tools {
    grid-template-columns: 1fr;
  }

  body.admin-page .database-metrics {
    grid-template-columns: 1fr;
  }

  body.admin-page .card-ledger,
  body.admin-page #adminProducts {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  body.admin-page .card-row,
  body.admin-page .admin-item {
    min-width: 680px;
  }
}

@media (max-width: 520px) {
  .shell,
  body.admin-page .shell {
    width: min(100% - 12px, 520px);
  }

  .topbar,
  body.admin-page .topbar {
    top: 6px;
    border-radius: 18px;
    padding: 10px;
  }

  .category-rail,
  .catalog-panel,
  .orders-panel,
  .admin-panel,
  .admin-list {
    border-radius: 18px;
  }

  .category-rail {
    padding: 14px;
  }

  .category-rail h3 {
    font-size: 20px;
  }

  .catalog-panel .product-card,
  .product-card {
    padding: 14px;
  }

  .product-body {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .product-thumb {
    width: 42px;
    height: 42px;
  }

  .catalog-panel .product-title {
    gap: 6px;
  }

  .catalog-panel .product-title h3 {
    width: 100%;
  }

  .price {
    font-size: 22px;
  }

  .stock {
    font-size: 14px;
  }

  .product-checkout {
    border-radius: 18px;
    padding: 12px;
  }

  .checkout-image {
    border-radius: 16px;
  }

  .checkout-purchase h2 {
    font-size: 22px;
  }

  .checkout-badges span,
  .checkout-pay-methods span,
  .tag-row span,
  .status-badge {
    font-size: 11px;
  }

  .checkout-price {
    font-size: 28px;
  }

  .checkout-actions,
  .form-actions {
    grid-template-columns: 1fr;
  }

  .primary-button,
  .ghost-button {
    width: 100%;
  }

  .order-result,
  .order-access,
  .payment-box,
  .delivered-keys {
    border-radius: 16px;
    padding: 14px;
  }
}

@media (max-width: 380px) {
  .nav-tab,
  body.admin-page .nav-tab {
    padding: 0 10px;
    font-size: 13px;
  }

  .brand strong {
    font-size: 15px;
  }

  .catalog-panel .product-title h3,
  .category-button {
    font-size: 15px;
  }

  .checkout-purchase h2 {
    font-size: 20px;
  }
}

/* aiopc sci-fi brand avatar */
.brand-mark {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border: 1px solid rgba(96, 203, 255, 0.82);
  border-radius: 50%;
  background:
    radial-gradient(circle at 32% 28%, rgba(255, 255, 255, 0.98) 0 7%, transparent 8%),
    radial-gradient(circle at 66% 70%, rgba(78, 231, 255, 0.7) 0 5%, transparent 6%),
    linear-gradient(135deg, rgba(8, 119, 238, 0.95), rgba(11, 33, 53, 0.98) 48%, rgba(20, 214, 255, 0.9));
  box-shadow:
    0 0 0 4px rgba(54, 163, 255, 0.1),
    0 12px 28px rgba(10, 103, 202, 0.26),
    inset 0 0 18px rgba(255, 255, 255, 0.18);
}

.brand-mark::before,
.brand-mark::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.brand-mark::before {
  z-index: 1;
  background:
    linear-gradient(90deg, transparent 23%, rgba(255, 255, 255, 0.92) 24% 27%, transparent 28%),
    linear-gradient(0deg, transparent 27%, rgba(111, 216, 255, 0.92) 28% 31%, transparent 32%),
    linear-gradient(135deg, transparent 42%, rgba(255, 255, 255, 0.95) 43% 49%, transparent 50%),
    linear-gradient(45deg, transparent 53%, rgba(78, 231, 255, 0.84) 54% 59%, transparent 60%);
  clip-path: polygon(23% 70%, 39% 22%, 52% 22%, 77% 70%, 62% 70%, 57% 57%, 39% 57%, 35% 70%);
  filter: drop-shadow(0 0 8px rgba(95, 221, 255, 0.72));
}

.brand-mark::after {
  z-index: 2;
  inset: 7px;
  border: 1px solid rgba(255, 255, 255, 0.54);
  border-left-color: transparent;
  border-bottom-color: rgba(78, 231, 255, 0.92);
  border-radius: 50%;
  background:
    linear-gradient(rgba(255, 255, 255, 0.16) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.14) 1px, transparent 1px);
  background-size: 8px 8px;
  animation: brandOrbit 5.5s linear infinite;
}

@keyframes brandOrbit {
  to {
    transform: rotate(360deg);
  }
}

/* Mobile v2: phone-first storefront and admin */
@media (max-width: 640px) {
  body {
    background:
      radial-gradient(circle at 20% -8%, rgba(78, 231, 255, 0.18), transparent 240px),
      linear-gradient(180deg, #f7fcff 0, #edf8ff 100%);
  }

  body::before {
    background-size: 22px 22px;
    opacity: 0.24;
  }

  .shell,
  body.admin-page .shell {
    width: min(100% - 10px, 640px);
    padding: 6px 0 18px;
  }

  .topbar,
  body.admin-page .topbar {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px 10px;
    align-items: center;
    border-radius: 20px;
    padding: 9px;
  }

  .brand {
    min-width: 0;
  }

  .brand-mark,
  body.admin-page .brand-mark {
    width: 36px;
    height: 36px;
    flex-basis: 36px;
  }

  .brand strong {
    font-size: 17px;
  }

  .brand small {
    display: block;
    overflow: hidden;
    max-width: 11em;
    color: #5f7487;
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .market-pulse,
  .ghost-link {
    grid-column: 2;
    grid-row: 1;
    min-height: 34px;
    padding: 0 10px;
    font-size: 12px;
  }

  .nav-tabs,
  body.admin-page .nav-tabs,
  body.admin-page .admin-nav {
    grid-column: 1 / -1;
    grid-auto-columns: minmax(86px, 1fr);
    border-radius: 16px;
    background: rgba(236, 247, 255, 0.78);
  }

  .nav-tab,
  body.admin-page .nav-tab {
    min-height: 38px;
    border-radius: 12px;
  }

  .trading-desk {
    margin-top: 10px;
  }

  .shop-layout {
    gap: 10px;
  }

  .category-rail {
    border-radius: 18px;
    padding: 12px;
  }

  .category-rail h3 {
    margin-bottom: 9px;
    font-size: 18px;
  }

  .category-button {
    min-height: 38px;
    padding: 0 12px 0 9px;
    font-size: 14px;
  }

  .category-button::before {
    width: 18px;
    height: 18px;
  }

  .catalog-panel {
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.9);
  }

  .catalog-panel .product-card,
  .product-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "body body"
      "price stock"
      "buy buy"
      "detail detail";
    gap: 9px 12px;
    padding: 13px;
  }

  .product-body {
    grid-area: body;
    grid-template-columns: 44px minmax(0, 1fr);
    align-items: center;
  }

  .product-thumb {
    width: 44px;
    height: 44px;
  }

  .catalog-panel .product-title h3 {
    width: auto;
    font-size: 15px;
  }

  .status-badge {
    padding: 3px 8px;
    font-size: 11px;
  }

  .tag-row {
    gap: 5px;
  }

  .tag-row span {
    padding: 3px 8px;
  }

  .price {
    grid-area: price;
    align-self: center;
    font-size: 23px;
  }

  .stock {
    grid-area: stock;
    align-self: center;
    justify-self: end;
    border-radius: 999px;
    padding: 5px 9px;
    background: #eef7ff;
    color: #60798e;
    font-size: 12px;
  }

  .trade-button {
    grid-area: buy;
    min-height: 42px;
    border-radius: 14px;
  }

  .product-detail {
    grid-area: detail;
    border-radius: 16px;
  }

  .product-card.is-expanded .product-detail {
    gap: 10px;
    padding: 12px;
  }

  .detail-copy h4 {
    margin-top: 0;
  }

  .trade-ticket {
    align-items: end;
    padding: 0;
  }

  .product-checkout {
    width: 100%;
    max-height: 92dvh;
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 24px 24px 0 0;
    padding: 12px;
  }

  .checkout-image {
    aspect-ratio: 16 / 9;
  }

  .checkout-purchase h2 {
    font-size: 21px;
  }

  .checkout-price {
    font-size: 26px;
  }

  .ticket-field {
    gap: 7px;
  }

  .ticket-field input {
    min-height: 46px;
    font-size: 16px;
  }

  .quantity-stepper {
    width: 100%;
  }

  .quantity-stepper button,
  .quantity-stepper input {
    min-height: 46px;
  }

  .checkout-pay-methods,
  .order-access,
  .payment-box,
  .delivered-keys {
    padding: 12px;
  }

  .form-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 9px;
  }

  .primary-button,
  .ghost-button {
    min-height: 44px;
    border-radius: 14px;
  }

  .orders-panel {
    margin-top: 10px;
    padding: 14px;
  }

  .orders-panel h1 {
    font-size: 25px;
  }

  .lookup-form {
    gap: 10px;
  }

  body.admin-page .admin-login-screen {
    min-height: 100dvh;
    padding: 12px;
  }

  body.admin-page .admin-login-card {
    padding: 20px 16px;
  }

  body.admin-page .admin-login-card h1 {
    font-size: 25px;
  }

  body.admin-page .admin-layout,
  body.admin-page .admin-tools {
    gap: 10px;
    margin-top: 10px;
  }

  body.admin-page .admin-panel,
  body.admin-page .admin-list {
    border-radius: 18px;
  }

  body.admin-page .panel-head {
    min-height: auto;
    padding: 14px;
  }

  body.admin-page .panel-head h1,
  body.admin-page .panel-head h2 {
    font-size: 22px;
  }

  body.admin-page .product-form,
  body.admin-page #adminProducts {
    gap: 10px;
    padding: 12px;
  }

  body.admin-page input,
  body.admin-page select,
  body.admin-page textarea {
    font-size: 16px;
  }

  body.admin-page .database-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  body.admin-page .database-metrics div {
    min-width: 0;
    padding: 10px;
  }

  body.admin-page .database-metrics strong {
    font-size: 20px;
  }

  body.admin-page .database-metrics span {
    font-size: 11px;
  }

  body.admin-page .card-db-tools {
    border-radius: 16px;
    padding: 10px;
  }

  body.admin-page .ledger-head {
    align-items: start;
    flex-direction: column;
  }

  body.admin-page .ledger-row {
    min-width: 0;
  }

  body.admin-page .ledger-detail {
    grid-template-columns: 1fr;
  }

  body.admin-page .ledger-actions {
    justify-content: stretch;
  }

  body.admin-page .mini-button {
    flex: 1;
    min-height: 38px;
  }

  body.admin-page .admin-item {
    grid-template-columns: 60px minmax(0, 1fr);
    min-width: 0;
  }

  body.admin-page .admin-item img {
    width: 60px;
    height: 60px;
    padding: 6px;
  }

  body.admin-page .admin-actions {
    grid-column: 1 / -1;
    justify-content: stretch;
  }

  body.admin-page .admin-actions button {
    flex: 1;
  }
}

@media (max-width: 390px) {
  .brand small,
  .market-pulse {
    display: none;
  }

  .topbar,
  body.admin-page .topbar {
    grid-template-columns: 1fr;
  }

  .nav-tabs,
  body.admin-page .nav-tabs,
  body.admin-page .admin-nav {
    grid-column: 1;
  }

  .catalog-panel .product-card,
  .product-card {
    padding: 11px;
  }

  .product-body {
    grid-template-columns: 40px minmax(0, 1fr);
  }

  .product-thumb {
    width: 40px;
    height: 40px;
  }
}

@media (max-width: 1180px) {
  body.admin-page .standalone-admin {
    grid-template-columns: minmax(260px, 0.7fr) minmax(0, 1fr);
  }

  body.admin-page .standalone-admin .admin-list {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  body.admin-page .standalone-admin {
    grid-template-columns: 1fr;
  }

  body.admin-page .standalone-admin .admin-list {
    grid-column: auto;
  }
}

/* Product detail readability refresh */
.catalog-panel .product-card {
  align-items: center;
}

.catalog-panel .product-body {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  grid-template-areas:
    "thumb title";
  align-items: center;
  align-self: center;
  gap: 6px 14px;
  min-height: 64px;
}

.catalog-panel .product-thumb {
  align-self: center;
}

.catalog-panel .product-title {
  align-self: center;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.catalog-panel .product-title h3 {
  margin: 0;
  line-height: 1.18;
}

.catalog-panel .tag-row {
  display: none;
  align-self: start;
  min-height: 0;
}

.catalog-panel .product-detail {
  position: relative;
  grid-template-columns: 148px minmax(0, 1fr);
  gap: 18px;
  margin-top: 10px;
  border: 1px solid rgba(137, 190, 230, 0.42);
  border-radius: 22px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(236, 249, 255, 0.88)),
    #ffffff;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 16px 34px rgba(35, 105, 160, 0.1);
}

.catalog-panel .product-card.is-expanded .product-detail {
  max-height: none;
  padding: 14px;
}

.catalog-panel .detail-image {
  align-self: start;
  width: 148px;
  max-width: 148px;
  min-height: 0;
  aspect-ratio: 1;
  border-color: rgba(137, 190, 230, 0.46);
  border-radius: 16px;
  background: #f3faff;
  box-shadow: 0 14px 28px rgba(45, 111, 160, 0.12);
}

.catalog-panel .detail-image img {
  object-fit: contain;
  padding: 12px;
}

.catalog-panel .detail-copy {
  gap: 12px;
  min-width: 0;
  border-left: 0;
  padding-left: 0;
}

.catalog-panel .detail-copy h4 {
  display: inline-flex;
  width: max-content;
  align-items: center;
  gap: 8px;
  margin: 0;
  border-radius: 999px;
  padding: 6px 11px;
  background: #eaf6ff;
  color: #0d64c8;
  font-size: 14px;
  font-weight: 950;
}

.catalog-panel .detail-copy h4::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #36a3ff;
  box-shadow: 0 0 12px rgba(54, 163, 255, 0.65);
}

.catalog-panel .detail-description {
  position: relative;
  display: grid;
  gap: 10px;
  margin: 0;
  border: 1px solid rgba(137, 190, 230, 0.22);
  border-radius: 16px;
  padding: 14px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.82), rgba(245, 252, 255, 0.68)),
    rgba(255, 255, 255, 0.76);
  color: #4f6d86;
  font-size: 15px;
  line-height: 1.75;
  max-height: 230px;
  overflow: auto;
  overflow-wrap: anywhere;
  word-break: break-word;
  box-shadow: inset 4px 0 0 rgba(54, 163, 255, 0.22);
}

.catalog-panel .detail-description p {
  margin: 0;
  border: 1px solid rgba(137, 190, 230, 0.18);
  border-radius: 13px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.68);
}

.catalog-panel .detail-description-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.catalog-panel .detail-description-list li {
  position: relative;
  margin: 0;
  border: 1px solid rgba(137, 190, 230, 0.2);
  border-radius: 13px;
  padding: 9px 12px 9px 28px;
  background: rgba(255, 255, 255, 0.7);
}

.catalog-panel .detail-description-list li::before {
  content: "";
  position: absolute;
  left: 12px;
  top: 1.05em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: linear-gradient(135deg, #36a3ff, #4ee7ff);
  box-shadow: 0 0 10px rgba(54, 163, 255, 0.42);
}

.catalog-panel .detail-description::-webkit-scrollbar {
  width: 7px;
}

.catalog-panel .detail-description::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(54, 163, 255, 0.26);
}

.catalog-panel .detail-description::before {
  content: none;
}

.catalog-panel .detail-tags {
  gap: 7px;
  padding-top: 2px;
}

.catalog-panel .detail-tags span {
  border: 1px solid rgba(54, 163, 255, 0.24);
  border-radius: 999px;
  padding: 5px 10px;
  background: rgba(235, 247, 255, 0.9);
  color: #087ee8;
  font-size: 12px;
  font-weight: 950;
}

@media (max-width: 760px) {
  .catalog-panel .product-detail {
    grid-template-columns: 1fr;
  }

  .catalog-panel .product-card.is-expanded .product-detail {
    max-height: none;
    padding: 13px;
  }

  .catalog-panel .detail-image {
    width: 100%;
    max-width: none;
    min-height: 0;
    aspect-ratio: 16 / 9;
  }

  .catalog-panel .detail-copy {
    border-left: 0;
    border-top: 1px solid rgba(137, 190, 230, 0.24);
    padding-top: 12px;
    padding-left: 0;
  }

  .catalog-panel .detail-description {
    font-size: 13px;
  }
}

/* Product detail compact image lock */
.catalog-panel .product-detail {
  display: grid !important;
  grid-template-columns: 148px minmax(0, 1fr) !important;
  align-items: start !important;
}

.catalog-panel .detail-image {
  width: 148px !important;
  max-width: 148px !important;
  min-height: 0 !important;
  aspect-ratio: 1 !important;
}

.catalog-panel .detail-copy {
  min-width: 0 !important;
}

@media (max-width: 900px) {
  .catalog-panel .product-detail {
    grid-template-columns: 112px minmax(0, 1fr) !important;
    gap: 12px !important;
  }

  .catalog-panel .detail-image {
    width: 112px !important;
    max-width: 112px !important;
  }

  .catalog-panel .detail-description {
    font-size: 13px;
    line-height: 1.82;
  }
}

@media (max-width: 640px) {
  .catalog-panel .product-detail {
    grid-template-columns: 1fr !important;
  }

  .catalog-panel .detail-image {
    width: 100% !important;
    max-width: none !important;
    aspect-ratio: 16 / 9 !important;
  }
}

/* Checkout detail page refinement */
.product-checkout {
  width: min(1180px, calc(100vw - 32px));
  padding: 22px;
}

.checkout-hero {
  grid-template-columns: minmax(300px, 430px) minmax(420px, 1fr);
  align-items: start;
  gap: 24px;
}

.checkout-media-column {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.checkout-image {
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 3;
  border-radius: 22px;
  background:
    radial-gradient(circle at 50% 35%, rgba(54, 163, 255, 0.08), transparent 52%),
    #ffffff;
}

.checkout-image img {
  width: auto;
  height: auto;
  max-width: 82%;
  max-height: 82%;
  object-fit: contain !important;
  padding: 0;
}

.checkout-image::after {
  display: none;
}

.checkout-purchase {
  gap: 13px;
}

.checkout-purchase h2 {
  max-width: 760px;
  font-size: clamp(22px, 2.15vw, 32px);
  line-height: 1.22;
  letter-spacing: 0;
}

.checkout-badges {
  gap: 8px;
}

.checkout-badges span {
  padding: 6px 11px;
  font-size: 13px;
}

.checkout-price {
  font-size: 32px;
  line-height: 1.1;
}

.ticket-field {
  gap: 7px;
}

.ticket-field > span,
.checkout-pay-methods strong {
  font-size: 14px;
}

.ticket-field input {
  min-height: 46px;
  border-radius: 16px;
  font-size: 15px;
}

.quantity-stepper {
  grid-template-columns: 48px 88px 48px;
}

.quantity-stepper button,
.quantity-stepper input {
  min-height: 46px;
  font-size: 18px;
}

.checkout-pay-methods {
  gap: 10px;
  border-radius: 20px;
  padding: 14px 16px;
  background:
    linear-gradient(135deg, rgba(235, 248, 255, 0.95), rgba(245, 252, 255, 0.82)),
    #f5fbff;
}

.checkout-pay-methods div {
  gap: 8px;
}

.checkout-pay-methods span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(22, 119, 255, 0.18);
  border-radius: 999px;
  padding: 7px 13px 7px 8px;
  background: #ffffff;
  color: #0b74df;
  font-size: 14px;
  box-shadow: 0 8px 18px rgba(22, 119, 255, 0.08);
}

.checkout-pay-methods span::before {
  content: "支";
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 8px;
  background: linear-gradient(135deg, #1677ff, #45b6ff);
  color: #fff;
  font-size: 13px;
  font-weight: 950;
}

.checkout-detail {
  margin-top: 0;
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 252, 255, 0.94)),
    #ffffff;
}

.checkout-detail h3 {
  padding: 15px 18px;
  font-size: 20px;
}

.checkout-detail p {
  padding: 18px;
  font-size: 15px;
  line-height: 1.85;
}

.checkout-detail .detail-tags {
  padding: 0 18px 18px;
}

.checkout-status {
  font-size: 14px;
}

@media (max-width: 980px) {
  .product-checkout {
    width: min(100%, calc(100vw - 20px));
  }

  .checkout-hero {
    grid-template-columns: 1fr;
  }

  .checkout-media-column {
    gap: 12px;
  }

  .checkout-image {
    aspect-ratio: 16 / 10;
  }
}

@media (max-width: 640px) {
  .product-checkout {
    width: 100%;
    padding: 12px;
  }

  .checkout-purchase h2 {
    font-size: 21px;
  }

  .checkout-price {
    font-size: 26px;
  }

  .checkout-detail h3 {
    font-size: 18px;
  }
}

/* Mobile polish final layer */
@media (max-width: 760px) {
  html,
  body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  body {
    background:
      radial-gradient(circle at 50% -80px, rgba(78, 231, 255, 0.2), transparent 220px),
      linear-gradient(180deg, #f7fcff 0%, #ecf8ff 52%, #f9fdff 100%);
  }

  .shell,
  body.admin-page .shell {
    width: min(100% - 12px, 760px);
    padding-bottom: 20px;
  }

  .topbar,
  body.admin-page .topbar {
    position: sticky;
    top: 6px;
    z-index: 20;
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 10px;
    border-radius: 22px;
  }

  .brand {
    min-width: 0;
  }

  .brand-mark {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    flex: 0 0 36px;
  }

  .brand strong {
    font-size: 17px;
  }

  .brand small {
    max-width: 62vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12px;
  }

  .market-pulse,
  .ghost-link {
    display: none;
  }

  .nav-tabs,
  body.admin-page .nav-tabs,
  body.admin-page .admin-nav {
    display: flex;
    grid-column: 1;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 5px;
    scrollbar-width: none;
  }

  .nav-tabs::-webkit-scrollbar,
  body.admin-page .nav-tabs::-webkit-scrollbar {
    display: none;
  }

  .nav-tab,
  body.admin-page .nav-tab {
    flex: 1 0 auto;
    min-width: 94px;
    min-height: 42px;
    padding: 10px 14px;
    font-size: 14px;
    white-space: nowrap;
  }

  .shop-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 0;
  }

  .category-rail {
    padding: 14px;
    border-radius: 20px;
  }

  .category-rail h3 {
    margin-bottom: 12px;
    font-size: 22px;
  }

  #categoryRail {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 2px;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
  }

  #categoryRail::-webkit-scrollbar {
    display: none;
  }

  .category-button {
    flex: 0 0 auto;
    min-width: 132px;
    justify-content: center;
    scroll-snap-align: start;
  }

  .catalog-panel,
  .orders-panel,
  .admin-panel,
  .admin-list {
    overflow: hidden;
    border-radius: 20px;
  }

  .catalog-head {
    display: none;
  }

  .product-grid {
    gap: 10px;
    padding: 10px;
  }

  .catalog-panel .product-card,
  .product-card {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "body price"
      "body stock"
      "buy buy"
      "detail detail";
    gap: 10px 12px;
    min-height: 0;
    padding: 14px;
    border: 1px solid rgba(137, 190, 230, 0.38);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.88);
  }

  .catalog-panel .product-body,
  .product-body {
    grid-area: body;
    grid-template-columns: 46px minmax(0, 1fr);
    gap: 5px 10px;
    min-width: 0;
    min-height: 0;
  }

  .catalog-panel .product-thumb,
  .product-thumb {
    width: 46px;
    height: 46px;
  }

  .product-thumb img {
    object-fit: contain;
    padding: 3px;
  }

  .catalog-panel .product-title,
  .product-title {
    min-width: 0;
  }

  .catalog-panel .product-title h3,
  .product-title h3 {
    max-width: 100%;
    font-size: 16px;
    line-height: 1.25;
    word-break: break-word;
  }

  .status-badge {
    padding: 3px 8px;
    font-size: 11px;
  }

  .price {
    grid-area: price;
    justify-self: end;
    font-size: 20px;
    line-height: 1.2;
  }

  .stock {
    grid-area: stock;
    justify-self: end;
    font-size: 13px;
    white-space: nowrap;
  }

  .trade-button {
    grid-area: buy;
    width: 100%;
    min-height: 44px;
    border-radius: 15px;
  }

  .catalog-panel .product-detail,
  .product-detail {
    grid-area: detail;
    grid-template-columns: 1fr;
    gap: 10px;
    min-width: 0;
    border-radius: 18px;
  }

  .catalog-panel .product-card.is-expanded .product-detail,
  .product-card.is-expanded .product-detail {
    max-height: 760px;
    padding: 12px;
  }

  .catalog-panel .detail-image,
  .detail-image {
    width: 100%;
    max-width: 100%;
    aspect-ratio: 16 / 10;
  }

  .catalog-panel .detail-copy,
  .detail-copy {
    min-width: 0;
    padding: 12px;
    border-radius: 16px;
  }

  .catalog-panel .detail-description,
  .detail-description {
    max-height: 190px;
    font-size: 14px;
    line-height: 1.75;
  }

  .trade-ticket {
    align-items: end;
    padding: 0;
  }

  .product-checkout {
    width: 100%;
    max-width: 100%;
    max-height: 94dvh;
    overflow-y: auto;
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 24px 24px 0 0;
    padding: 12px;
  }

  .checkout-hero {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .checkout-image {
    aspect-ratio: 16 / 10;
    border-radius: 18px;
  }

  .checkout-image img {
    max-width: 78%;
    max-height: 78%;
  }

  .checkout-purchase h2 {
    font-size: 22px;
    line-height: 1.28;
  }

  .checkout-badges span,
  .checkout-pay-methods span {
    font-size: 12px;
  }

  .checkout-price {
    font-size: 28px;
  }

  .ticket-field input,
  .quantity-stepper button,
  .quantity-stepper input {
    min-height: 46px;
    font-size: 16px;
  }

  .quantity-stepper {
    width: 100%;
    grid-template-columns: 52px minmax(0, 1fr) 52px;
  }

  .form-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .primary-button,
  .ghost-button {
    width: 100%;
    min-height: 44px;
  }

  .orders-panel {
    padding: 16px;
  }

  .orders-panel h1 {
    font-size: 26px;
  }

  .orders-panel p {
    font-size: 14px;
    line-height: 1.75;
  }

  .lookup-form {
    grid-template-columns: 1fr;
    max-width: none;
    margin-left: 0;
  }

  .lookup-form .primary-button {
    justify-self: stretch;
  }

  .order-card,
  .order-access {
    grid-template-columns: 1fr;
  }

  body.admin-page .admin-layout,
  body.admin-page .standalone-admin,
  body.admin-page .admin-tools,
  body.admin-page .form-row,
  body.admin-page .card-db-tools,
  body.admin-page .ledger-detail,
  body.admin-page .card-key-bound-info {
    grid-template-columns: 1fr;
  }

  body.admin-page .admin-panel,
  body.admin-page .admin-list {
    min-width: 0;
  }

  body.admin-page .panel-head {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  body.admin-page .panel-head h1,
  body.admin-page .panel-head h2 {
    font-size: 22px;
  }

  body.admin-page .product-form,
  body.admin-page #adminProducts {
    padding: 12px;
  }

  body.admin-page input,
  body.admin-page select,
  body.admin-page textarea {
    min-width: 0;
    font-size: 16px;
  }

  body.admin-page #description {
    min-height: 240px;
  }

  body.admin-page .database-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  body.admin-page .database-metrics div {
    padding: 10px 8px;
  }

  body.admin-page .database-metrics strong {
    font-size: 20px;
  }

  body.admin-page .database-metrics span {
    font-size: 11px;
  }

  body.admin-page .card-ledger,
  body.admin-page #adminProducts {
    overflow-x: visible;
  }

  body.admin-page .ledger-row,
  body.admin-page .admin-item {
    min-width: 0;
  }

  body.admin-page .ledger-summary {
    grid-template-columns: 22px 1fr;
    gap: 8px;
  }

  body.admin-page .ledger-meta {
    grid-column: 2 / -1;
  }

  body.admin-page .key-status {
    justify-self: start;
  }

  body.admin-page .ledger-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }

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

  body.admin-page .admin-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 390px) {
  .catalog-panel .product-card,
  .product-card {
    grid-template-columns: 1fr;
    grid-template-areas:
      "body"
      "price"
      "stock"
      "buy"
      "detail";
  }

  .price,
  .stock {
    justify-self: start;
  }

  .nav-tab,
  body.admin-page .nav-tab {
    min-width: 82px;
    padding-inline: 11px;
  }
}

/* Admin usability final fixes */
#description {
  min-height: 340px;
  line-height: 1.75;
}

body.admin-page .description-field {
  display: grid;
  gap: 8px;
}

body.admin-page .description-field textarea {
  width: 100%;
  min-height: 220px;
  resize: vertical;
  border-radius: 18px;
  line-height: 1.75;
}

.compact-upload {
  min-height: 78px;
}

.compact-upload strong {
  color: #537089;
  font-size: 13px;
}

.category-icon-preview {
  display: grid;
  place-items: center;
  gap: 10px;
  min-height: 132px;
  border: 1px solid rgba(100, 190, 255, 0.26);
  border-radius: 18px;
  background:
    radial-gradient(circle at 50% 18%, rgba(78, 231, 255, 0.16), transparent 86px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(239, 249, 255, 0.78));
}

.category-icon-preview span,
.category-icon-preview img {
  width: 64px;
  height: 64px;
  border: 1px solid rgba(93, 174, 230, 0.28);
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 30%, #fff 0 22%, transparent 23%),
    linear-gradient(135deg, #21a1ff, #dff5ff);
  box-shadow: 0 16px 30px rgba(31, 127, 210, 0.18);
}

.category-icon-preview img {
  object-fit: cover;
}

.category-icon-preview strong {
  color: #17344e;
  font-size: 13px;
}

.category-button {
  display: flex;
  gap: 12px;
  align-items: center;
}

.category-button.has-icon::before {
  display: none;
}

.category-button img {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  border: 1px solid rgba(93, 174, 230, 0.28);
  border-radius: 50%;
  object-fit: cover;
  background: #f4fbff;
  box-shadow: 0 8px 18px rgba(31, 127, 210, 0.16);
}

.category-button > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Mobile hard override must stay last */
@media (max-width: 760px) {
  body.admin-page #description {
    min-height: 240px;
  }

  .category-rail {
    display: block;
    min-height: 0;
    padding: 12px;
    border-radius: 18px;
  }

  .category-rail h3 {
    margin: 0 0 10px;
    border-bottom: 0;
    padding: 0;
    font-size: 18px;
    line-height: 1.2;
  }

  #categoryRail {
    display: flex;
    min-height: 0;
    align-content: normal;
    gap: 8px;
    overflow-x: auto;
    padding: 0 2px 2px;
  }

  .category-button {
    flex: 0 0 auto;
    width: auto;
    min-width: 104px;
    min-height: 38px;
    justify-content: center;
    gap: 8px;
    margin: 0;
    padding: 0 12px;
    border-radius: 14px;
  }

  .category-button > span {
    max-width: 82px;
    font-size: 13px;
  }

  .category-button::before,
  .category-button img {
    width: 22px;
    height: 22px;
    flex-basis: 22px;
  }

  .catalog-panel .product-card,
  .product-card,
  .product-checkout,
  .orders-panel,
  body.admin-page .admin-panel,
  body.admin-page .admin-list {
    max-width: 100%;
  }

  .catalog-panel .product-card,
  .product-card {
    grid-template-columns: 52px minmax(0, 1fr) auto;
    grid-template-areas:
      "thumb title price"
      "thumb badge stock"
      "buy buy buy"
      "detail detail detail";
    gap: 8px 10px;
    padding: 12px;
    border-radius: 16px;
  }

  .catalog-panel .product-body,
  .product-body {
    display: contents;
  }

  .catalog-panel .product-thumb,
  .product-thumb {
    grid-area: thumb;
    width: 48px;
    height: 48px;
    align-self: start;
  }

  .catalog-panel .product-title,
  .product-title {
    grid-area: title;
    display: flex;
    min-width: 0;
    gap: 6px;
  }

  .catalog-panel .product-title h3,
  .product-title h3 {
    display: -webkit-box;
    overflow: hidden;
    max-width: 100%;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    font-size: 18px;
    line-height: 1.24;
  }

  .catalog-panel .product-title .status-badge,
  .product-title .status-badge,
  .status-badge {
    grid-area: badge;
    justify-self: start;
    align-self: center;
    padding: 4px 9px;
    font-size: 12px;
  }

  .price {
    grid-area: price;
    align-self: start;
    justify-self: end;
    font-size: 22px;
    line-height: 1.1;
  }

  .stock {
    grid-area: stock;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    justify-self: end;
    min-width: 64px;
    height: 34px;
    padding: 0 10px;
    border: 1px solid rgba(93, 174, 230, 0.22);
    border-radius: 999px;
    background: #eef8ff;
    color: #506d82;
    font-size: 15px;
    font-weight: 900;
    white-space: nowrap;
  }

  .stock::before {
    content: "状态";
    color: #7b93a6;
    font-size: 12px;
    font-weight: 850;
  }

  .trade-button {
    min-height: 42px;
    border-radius: 14px;
    font-size: 17px;
    box-shadow: 0 10px 22px rgba(4, 23, 42, 0.16);
  }
}

@media (max-width: 390px) {
  .catalog-panel .product-card,
  .product-card {
    grid-template-columns: 48px minmax(0, 1fr);
    grid-template-areas:
      "thumb title"
      "thumb badge"
      "price stock"
      "buy buy"
      "detail detail";
  }

  .price,
  .stock {
    justify-self: start;
  }
}

/* 20260709 final detail override at EOF */
body .shell .catalog-panel .tag-row,
body .shell .catalog-panel .detail-tags,
body .checkout-detail .detail-tags {
  display: none !important;
}

body .shell .catalog-panel .product-card.is-expanded .product-detail {
  display: block !important;
  width: 100% !important;
  max-height: none !important;
  margin-top: 10px !important;
  padding: 14px !important;
}

body .shell .catalog-panel .product-card.is-expanded .details-inner {
  display: grid !important;
  grid-template-columns: 172px minmax(0, 1fr) !important;
  gap: 20px !important;
  align-items: start !important;
  width: 100% !important;
  min-width: 0 !important;
}

body .shell .catalog-panel .product-card.is-expanded .detail-image {
  width: 172px !important;
  max-width: 172px !important;
  aspect-ratio: 1 !important;
}

body .shell .catalog-panel .product-card.is-expanded .detail-image img {
  object-fit: contain !important;
  padding: 14px !important;
}

body .shell .catalog-panel .product-card.is-expanded .detail-copy {
  display: grid !important;
  align-content: start !important;
  gap: 12px !important;
  width: 100% !important;
  min-width: 0 !important;
}

body .shell .catalog-panel .product-card.is-expanded .detail-copy h4 {
  display: inline-flex !important;
  width: max-content !important;
  align-items: center !important;
  gap: 8px !important;
  margin: 0 !important;
  border-radius: 999px !important;
  padding: 6px 12px !important;
  background: #eaf6ff !important;
  color: #0d64c8 !important;
  font-size: 14px !important;
  font-weight: 950 !important;
}

body .shell .catalog-panel .product-card.is-expanded .detail-description {
  width: 100% !important;
  min-width: 0 !important;
  max-height: 300px !important;
  overflow: auto !important;
  font-size: 15px !important;
  line-height: 1.85 !important;
}

@media (max-width: 760px) {
  body .shell .catalog-panel .product-card.is-expanded .details-inner {
    grid-template-columns: 1fr !important;
  }

  body .shell .catalog-panel .product-card.is-expanded .detail-image {
    width: 100% !important;
    max-width: none !important;
    aspect-ratio: 16 / 10 !important;
  }
}

/* 20260709 admin category grouped drag sorting */
body.admin-page #adminProducts {
  gap: 14px !important;
}

body.admin-page .admin-category-group {
  display: grid;
  gap: 10px;
  border: 1px solid rgba(137, 190, 230, 0.36);
  border-radius: 18px;
  padding: 12px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(236, 249, 255, 0.74)),
    #ffffff;
  box-shadow: 0 12px 28px rgba(39, 96, 144, 0.08);
}

body.admin-page .admin-category-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 2px 4px 8px;
  border-bottom: 1px solid rgba(137, 190, 230, 0.26);
}

body.admin-page .admin-category-head h3 {
  margin: 0;
  color: #12314c;
  font-size: 16px;
  font-weight: 950;
}

body.admin-page .admin-category-head span {
  color: #638098;
  font-size: 12px;
  font-weight: 900;
}

body.admin-page .admin-category-list {
  display: grid;
  gap: 10px;
  min-height: 24px;
}

body.admin-page .admin-category-list .admin-item {
  cursor: grab;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
}

body.admin-page .admin-category-list .admin-item:hover {
  border-color: rgba(54, 163, 255, 0.46);
  transform: translateY(-1px);
}

body.admin-page .admin-category-list .admin-item.is-dragging {
  opacity: 0.58;
  cursor: grabbing;
  border-color: rgba(22, 119, 255, 0.72);
  box-shadow: 0 18px 36px rgba(39, 126, 210, 0.16);
}

/* 20260709 draggable category cards */
body.admin-page .category-sort-panel {
  display: grid;
  gap: 10px;
}

/* 20260709 category panel layout */
body.admin-page .category-tool-form {
  gap: 14px;
}

body.admin-page .category-tool-section,
body.admin-page .category-sort-panel {
  border: 1px solid rgba(137, 190, 230, 0.28);
  border-radius: 18px;
  padding: 14px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.82), rgba(239, 249, 255, 0.58)),
    #ffffff;
  box-shadow: 0 10px 24px rgba(38, 101, 148, 0.06);
}

body.admin-page .category-manage-section,
body.admin-page .category-upload-section {
  display: grid;
  gap: 12px;
}

body.admin-page .category-add-row {
  grid-template-columns: minmax(0, 1fr) 76px;
  gap: 10px;
}

body.admin-page .compact-action {
  min-height: 46px;
  padding: 0 16px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 950;
  white-space: nowrap;
}

body.admin-page .category-delete-action {
  justify-self: start;
  min-width: 132px;
}

body.admin-page .icon-form-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 0;
}

body.admin-page .icon-form-actions .compact-action {
  width: 100%;
}

body.admin-page .category-tool-section .compact-upload {
  min-height: 102px;
  padding: 18px 14px;
}

body.admin-page .field-heading small {
  color: #6a8298;
  font-size: 12px;
  font-weight: 800;
}

body.admin-page .category-sort-list {
  display: grid;
  gap: 8px;
}

body.admin-page .category-sort-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  border: 1px solid rgba(137, 190, 230, 0.34);
  border-radius: 16px;
  padding: 10px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(238, 249, 255, 0.82)),
    #ffffff;
  box-shadow: 0 8px 20px rgba(38, 101, 148, 0.08);
  cursor: grab;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
}

body.admin-page .category-sort-card:hover {
  border-color: rgba(54, 163, 255, 0.48);
  transform: translateY(-1px);
}

body.admin-page .category-sort-card.is-dragging {
  opacity: 0.58;
  cursor: grabbing;
  border-color: rgba(22, 119, 255, 0.72);
  box-shadow: 0 16px 32px rgba(39, 126, 210, 0.16);
}

body.admin-page .category-sort-icon {
  display: inline-grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 14px;
  background:
    radial-gradient(circle at 32% 26%, rgba(255, 255, 255, 0.9) 0 7px, transparent 8px),
    linear-gradient(135deg, #3fb4ff, #9be4ff);
  box-shadow: 0 8px 18px rgba(54, 163, 255, 0.18);
}

body.admin-page img.category-sort-icon {
  object-fit: contain;
  padding: 5px;
  border: 1px solid rgba(137, 190, 230, 0.32);
  background: #f3faff;
}

body.admin-page .category-sort-card strong,
body.admin-page .category-sort-card small {
  display: block;
}

body.admin-page .category-sort-card strong {
  overflow: hidden;
  color: #12314c;
  font-size: 15px;
  font-weight: 950;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.admin-page .category-sort-card small {
  color: #6a8298;
  font-size: 12px;
  font-weight: 800;
}

body.admin-page .category-sort-card b {
  border-radius: 999px;
  padding: 5px 8px;
  background: rgba(235, 247, 255, 0.95);
  color: #1876d2;
  font-size: 11px;
  font-style: normal;
  font-weight: 950;
}

body.admin-page .category-sort-empty {
  border: 1px dashed rgba(137, 190, 230, 0.42);
  border-radius: 14px;
  padding: 12px;
  color: #6a8298;
  text-align: center;
  font-weight: 850;
}

body.admin-page .danger-button {
  border-color: rgba(255, 112, 128, 0.34) !important;
  color: #d9334f !important;
  background: rgba(255, 246, 248, 0.94) !important;
}

body.admin-page .danger-button:hover {
  box-shadow: 0 10px 22px rgba(217, 51, 79, 0.14) !important;
}

@media (max-width: 760px) {
  body.admin-page .admin-category-head {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* 20260709 final override: remove product tags and fix expanded detail layout */
.shell .catalog-panel .tag-row,
.shell .catalog-panel .detail-tags,
.checkout-detail .detail-tags {
  display: none !important;
}

.shell .catalog-panel .product-card.is-expanded .product-detail,
.product-card.is-expanded .product-detail {
  display: block !important;
  width: 100% !important;
  max-height: none !important;
  margin-top: 10px !important;
  padding: 14px !important;
  border-radius: 22px !important;
}

.shell .catalog-panel .details-inner,
.product-card .details-inner {
  display: grid !important;
  grid-template-columns: 172px minmax(0, 1fr) !important;
  gap: 20px !important;
  align-items: start !important;
  width: 100% !important;
  min-width: 0 !important;
}

.shell .catalog-panel .detail-image,
.product-card .detail-image {
  width: 172px !important;
  max-width: 172px !important;
  aspect-ratio: 1 !important;
}

.shell .catalog-panel .detail-image img,
.product-card .detail-image img {
  object-fit: contain !important;
  padding: 14px !important;
}

.shell .catalog-panel .detail-copy,
.product-card .detail-copy {
  display: grid !important;
  align-content: start !important;
  gap: 12px !important;
  width: 100% !important;
  min-width: 0 !important;
}

.shell .catalog-panel .detail-copy h4,
.product-card .detail-copy h4 {
  display: inline-flex !important;
  width: max-content !important;
  align-items: center !important;
  gap: 8px !important;
  margin: 0 !important;
  border-radius: 999px !important;
  padding: 6px 12px !important;
  background: #eaf6ff !important;
  color: #0d64c8 !important;
  font-size: 14px !important;
  font-weight: 950 !important;
}

.shell .catalog-panel .detail-description,
.product-card .detail-description {
  width: 100% !important;
  min-width: 0 !important;
  max-height: 300px !important;
  overflow: auto !important;
  font-size: 15px !important;
  line-height: 1.85 !important;
}

@media (max-width: 760px) {
  .shell .catalog-panel .details-inner,
  .product-card .details-inner {
    grid-template-columns: 1fr !important;
  }

  .shell .catalog-panel .detail-image,
  .product-card .detail-image {
    width: 100% !important;
    max-width: none !important;
    aspect-ratio: 16 / 10 !important;
  }
}

/* 20260709 tags removed and product detail final layout guard */
.tag-row,
.detail-tags,
.checkout-detail .detail-tags {
  display: none !important;
}

.catalog-panel .product-card.is-expanded .product-detail,
.product-card.is-expanded .product-detail {
  display: block !important;
  width: 100% !important;
  max-height: none;
}

.catalog-panel .details-inner,
.details-inner {
  display: grid !important;
  grid-template-columns: clamp(132px, 13vw, 180px) minmax(0, 1fr) !important;
  gap: 18px !important;
  align-items: start !important;
  width: 100% !important;
  min-width: 0 !important;
}

.catalog-panel .detail-copy,
.detail-copy {
  display: grid !important;
  align-content: start !important;
  gap: 12px !important;
  width: 100% !important;
  min-width: 0 !important;
}

.catalog-panel .detail-description,
.detail-description {
  width: 100% !important;
  min-width: 0 !important;
  max-height: 260px;
}

@media (max-width: 760px) {
  .catalog-panel .details-inner,
  .details-inner {
    grid-template-columns: 1fr !important;
  }
}

/* 20260709 final product detail width guard */
.catalog-panel .product-card.is-expanded .product-detail,
.product-card.is-expanded .product-detail {
  display: block !important;
  width: 100% !important;
}

.catalog-panel .details-inner,
.details-inner {
  display: grid !important;
  grid-template-columns: clamp(132px, 13vw, 180px) minmax(0, 1fr) !important;
  gap: 18px !important;
  align-items: start !important;
  width: 100% !important;
  min-width: 0 !important;
}

.catalog-panel .detail-copy,
.detail-copy {
  display: grid !important;
  align-content: start !important;
  gap: 12px !important;
  width: 100% !important;
  min-width: 0 !important;
}

.catalog-panel .detail-description,
.detail-description {
  width: 100% !important;
  min-width: 0 !important;
  max-height: 260px;
}

@media (max-width: 760px) {
  .catalog-panel .details-inner,
  .details-inner {
    grid-template-columns: 1fr !important;
  }
}

/* 20260709 product expanded detail layout repair */
.catalog-panel .product-detail,
.product-detail {
  display: block;
  width: 100%;
  min-width: 0;
}

.catalog-panel .details-inner,
.details-inner {
  display: grid;
  grid-template-columns: clamp(132px, 13vw, 180px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  width: 100%;
  min-width: 0;
}

.catalog-panel .detail-copy,
.detail-copy {
  display: grid;
  align-content: start;
  gap: 12px;
  width: 100%;
  min-width: 0;
}

.catalog-panel .detail-copy h4,
.detail-copy h4 {
  display: inline-flex;
  width: max-content;
  align-items: center;
  gap: 8px;
  margin: 0;
  border-radius: 999px;
  padding: 6px 11px;
  background: #eaf6ff;
  color: #0d64c8;
  font-size: 14px;
  font-weight: 950;
}

.catalog-panel .detail-copy h4::before,
.detail-copy h4::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #36a3ff;
  box-shadow: 0 0 12px rgba(54, 163, 255, 0.65);
}

.catalog-panel .detail-description,
.detail-description {
  width: 100%;
  min-width: 0;
  max-height: 260px;
}

.catalog-panel .detail-tags,
.detail-tags {
  width: 100%;
}

@media (max-width: 760px) {
  .catalog-panel .details-inner,
  .details-inner {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .catalog-panel .detail-image,
  .detail-image {
    width: 100% !important;
    max-width: none !important;
    aspect-ratio: 16 / 10 !important;
  }

  .catalog-panel .detail-description,
  .detail-description {
    max-height: 240px;
  }
}


/* 20260709 mobile announcement modal fit */
@media (max-width: 760px) {
  .announcement-modal {
    align-items: center;
    justify-items: center;
    padding: max(12px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom));
  }

  .announcement-modal-panel {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    width: min(100%, 420px);
    max-height: min(78dvh, 640px);
    border-radius: 22px;
  }

  .announcement-modal-head {
    align-items: center;
    padding: 14px 14px 12px;
  }

  .announcement-modal-head span {
    font-size: 11px;
  }

  .announcement-modal-head h2 {
    margin-top: 3px;
    font-size: 28px;
    line-height: 1.08;
  }

  .modal-close {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    font-size: 28px;
  }

  .announcement-modal-list {
    gap: 8px;
    max-height: none;
    min-height: 0;
    overflow: auto;
    padding: 12px 14px 2px;
  }

  .announcement-modal-list p {
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 8px;
    border-radius: 16px;
    padding: 12px 10px;
    font-size: 15px;
    font-weight: 850;
    line-height: 1.65;
  }

  .announcement-modal-list p span {
    width: 30px;
    height: 30px;
    border-radius: 11px;
    font-size: 12px;
  }

  .announcement-confirm {
    width: calc(100% - 28px);
    min-height: 48px;
    margin: 12px 14px 14px;
    border-radius: 16px;
    font-size: 17px;
  }
}

@media (max-width: 390px) {
  .announcement-modal-panel {
    max-height: 74dvh;
  }

  .announcement-modal-head h2 {
    font-size: 24px;
  }

  .announcement-modal-list p {
    font-size: 14px;
    line-height: 1.58;
  }

  .announcement-confirm {
    min-height: 46px;
    margin-bottom: 12px;
  }
}

/* Desktop product rows: compact, centered, table-like */
@media (min-width: 761px) {
  .category-rail {
    display: grid;
    align-content: start;
    height: fit-content;
    min-height: 0;
    max-height: calc(100vh - 124px);
    overflow: auto;
    padding: 24px;
  }

  .category-rail h3 {
    margin: 0 0 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(137, 190, 230, 0.34);
    font-size: 28px;
    line-height: 1.08;
  }

  #categoryRail {
    display: grid;
    align-content: start;
    gap: clamp(8px, 1.4vh, 14px);
    min-height: 0;
  }

  .category-button {
    min-height: 46px;
    justify-content: flex-start;
    padding: 0 14px;
  }

  .catalog-panel .product-card {
    min-height: 72px;
    padding: 9px 18px;
    align-items: center;
  }

  .catalog-panel .product-card:not(.is-expanded) {
    grid-template-rows: auto;
  }

  .catalog-panel .product-body {
    min-height: 50px;
    align-items: center;
  }

  .catalog-panel .product-thumb {
    width: 48px;
    height: 48px;
    align-self: center;
  }

  .catalog-panel .product-title {
    min-height: 48px;
    align-content: center;
    align-items: center;
  }

  .catalog-panel .product-title h3 {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    font-size: 17px;
    line-height: 1.22;
  }

  .catalog-panel .status-badge {
    align-self: center;
  }

  .catalog-panel .price,
  .catalog-panel .stock,
  .catalog-panel .trade-button {
    align-self: center;
    justify-self: center;
  }

  .catalog-panel .price,
  .catalog-panel .stock {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    line-height: 1;
  }

  .catalog-panel .trade-button {
    min-height: 42px;
    padding: 0 22px;
  }
}

/* Order lookup: balanced single-row tool card */
@media (min-width: 901px) {
  .orders-panel {
    grid-template-columns: minmax(250px, 0.7fr) minmax(250px, 0.8fr) minmax(520px, 1.15fr);
    align-items: center;
    gap: 18px;
    padding: 20px 24px;
  }

  .order-lookup-copy {
    display: grid;
    gap: 4px;
    align-content: center;
  }

  .order-lookup-copy h1 {
    margin: 0;
    font-size: 24px;
    line-height: 1.12;
  }

  .order-lookup-copy p {
    margin: 0;
    color: #4d6680;
    font-size: 13px;
    line-height: 1.55;
  }

  .lookup-note {
    align-self: center;
    margin: 0;
    border: 1px solid rgba(54, 163, 255, 0.18);
    border-radius: 16px;
    padding: 11px 13px;
    background:
      linear-gradient(135deg, rgba(54, 163, 255, 0.08), rgba(78, 231, 255, 0.04)),
      rgba(255, 255, 255, 0.72);
    color: #416078;
    font-size: 13px;
    font-weight: 800;
    line-height: 1.55;
    text-align: center;
  }

  .lookup-form {
    grid-template-columns: minmax(220px, 1fr) minmax(190px, 0.72fr) 126px;
    align-items: end;
    justify-self: stretch;
    max-width: none;
    margin-left: 0;
  }
}

@media (max-width: 900px) {
  .orders-panel {
    text-align: center;
  }

  .lookup-note {
    margin: 0;
    border: 1px solid rgba(54, 163, 255, 0.18);
    border-radius: 16px;
    padding: 11px 13px;
    background: rgba(245, 251, 255, 0.84);
    color: #416078;
    font-size: 13px;
    font-weight: 800;
    line-height: 1.65;
  }
}


/* 20260709 lookup note left refinement */
@media (min-width: 901px) {
  .orders-panel {
    grid-template-columns: minmax(340px, 0.72fr) minmax(720px, 1.28fr);
    gap: 22px;
    align-items: center;
    padding: 18px 24px;
  }

  .order-lookup-copy {
    max-width: 560px;
    gap: 6px;
  }

  .order-lookup-copy .lookup-note {
    justify-self: start;
    max-width: 520px;
    margin: 8px 0 0;
    border: 1px solid rgba(14, 118, 214, 0.28);
    border-radius: 14px;
    padding: 9px 12px;
    background:
      linear-gradient(135deg, rgba(54, 163, 255, 0.13), rgba(78, 231, 255, 0.06)),
      rgba(248, 253, 255, 0.9);
    color: #0f5f9f;
    font-size: 13px;
    font-weight: 950;
    line-height: 1.55;
    text-align: left;
    box-shadow: inset 3px 0 0 rgba(54, 163, 255, 0.38);
  }

  .lookup-form {
    grid-template-columns: minmax(390px, 1.45fr) minmax(250px, 0.85fr) 132px;
    width: min(100%, 920px);
    justify-self: start;
    margin-left: -8px;
  }
}

@media (max-width: 900px) {
  .order-lookup-copy .lookup-note {
    margin-top: 8px;
    color: #0f5f9f;
    font-weight: 950;
  }
}


/* 20260709 price decimals and column alignment */
@media (min-width: 761px) {
  .catalog-head,
  .catalog-panel .product-card {
    grid-template-columns: minmax(420px, 1fr) 132px 108px 112px;
  }

  .catalog-head {
    align-items: center;
  }

  .catalog-head span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    text-align: center;
  }

  .catalog-head span:first-child {
    justify-content: flex-start;
    text-align: left;
  }

  .catalog-panel .price,
  .catalog-panel .stock,
  .catalog-panel .trade-button {
    justify-self: center;
    text-align: center;
  }

  .catalog-panel .price {
    min-width: 112px;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
  }

  .catalog-panel .stock {
    min-width: 88px;
  }

  .catalog-panel .trade-button {
    min-width: 92px;
  }
}


/* 20260709 category select refinement */
body.admin-page #category {
  min-height: 46px;
  border: 1px solid rgba(137, 190, 230, 0.64);
  border-radius: 16px;
  padding: 0 40px 0 14px;
  background-color: rgba(255, 255, 255, 0.88);
  color: #13283b;
  font-weight: 850;
}

body.admin-page #category:disabled {
  color: #7b93a6;
  background-color: rgba(239, 248, 255, 0.72);
}


.admin-status[hidden] {
  display: none !important;
}


/* 20260709 add category controls */
.category-add-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.category-add-row input {
  min-width: 0;
}

.category-add-row .ghost-button {
  min-height: 46px;
  padding: 0 16px;
  white-space: nowrap;
}

@media (max-width: 520px) {
  .category-add-row {
    grid-template-columns: 1fr;
  }
}


/* 20260709 announcement toggle controls */
.notice-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(54, 163, 255, 0.22);
  border-radius: 16px;
  padding: 12px 14px;
  background: rgba(245, 251, 255, 0.82);
}

.notice-toggle input {
  width: 20px;
  height: 20px;
  accent-color: #1677ff;
}

.notice-toggle span {
  color: #17344e;
  font-weight: 950;
}


/* 20260709 single-card-key upload rows */
.card-key-upload-box {
  display: grid;
  gap: 12px;
  border: 1px solid rgba(137, 190, 230, 0.3);
  border-radius: 20px;
  padding: 16px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(239, 249, 255, 0.66)),
    #ffffff;
  box-shadow: 0 12px 28px rgba(38, 101, 148, 0.06);
}

.field-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #5b7489;
  font-weight: 950;
}

.mini-button {
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  white-space: nowrap;
}

.card-key-input-rows {
  display: grid;
  gap: 10px;
}

.card-key-input-row {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 118px 116px 48px;
  gap: 12px;
  align-items: center;
}

.card-key-input-row input {
  height: 54px;
  min-height: 54px;
  border: 1px solid rgba(137, 190, 230, 0.52);
  border-radius: 16px;
  padding: 0 14px;
  background: rgba(255, 255, 255, 0.92);
  color: #142c40;
  font-weight: 800;
}

.card-key-quantity {
  position: relative;
  display: block;
  margin: 0;
}

.card-key-quantity span {
  position: absolute;
  top: -17px;
  left: 4px;
  color: #6a8298;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
}

.card-key-quantity input {
  width: 100%;
  padding: 0 10px;
  text-align: center;
  font-size: 18px;
  font-weight: 950;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 48px;
  min-width: 48px;
  height: 48px;
  padding: 0;
  border-radius: 50%;
  font-size: 22px;
  line-height: 1;
}

.card-key-type-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 54px;
  border: 1px solid rgba(54, 163, 255, 0.22);
  border-radius: 999px;
  padding: 0 12px;
  background: linear-gradient(135deg, rgba(232, 247, 255, 0.95), rgba(255, 255, 255, 0.88));
  color: #0b75cf;
  font-size: 13px;
  font-weight: 950;
  white-space: nowrap;
}

.card-key-type-badge[data-type="待识别"] {
  color: #7b93a6;
}

.card-key-type-badge[data-type="账号密码"],
.card-key-type-badge[data-type="邮箱账号"] {
  background: linear-gradient(135deg, rgba(229, 255, 242, 0.95), rgba(255, 255, 255, 0.9));
  color: #078f53;
}

.card-key-type-badge[data-type="JSON"] {
  background: linear-gradient(135deg, rgba(245, 235, 255, 0.95), rgba(255, 255, 255, 0.9));
  color: #7655d8;
}

.card-key-upload-actions {
  display: flex;
  justify-content: flex-start;
  padding-top: 2px;
}

.card-key-upload-actions .primary-button {
  min-height: 46px;
  min-width: 116px;
  padding: 0 20px;
  border-radius: 999px;
}

/* 20260709 cardkey page sections */
body.admin-page .cardkey-page-form {
  gap: 16px;
  padding: 16px;
}

body.admin-page .cardkey-section {
  display: grid;
  gap: 12px;
  border: 1px solid rgba(137, 190, 230, 0.32);
  border-radius: 20px;
  padding: 16px;
  background:
    radial-gradient(circle at 82% 0%, rgba(78, 231, 255, 0.09), transparent 46%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(239, 249, 255, 0.72));
  box-shadow: 0 14px 32px rgba(38, 101, 148, 0.07);
}

body.admin-page .cardkey-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(137, 190, 230, 0.24);
}

body.admin-page .cardkey-section-head h2 {
  margin: 0;
  color: #17344e;
  font-size: 16px;
  font-weight: 950;
}

body.admin-page .cardkey-section .card-key-upload-box,
body.admin-page .cardkey-section .card-db-tools,
body.admin-page .cardkey-section .card-ledger {
  border-radius: 16px;
}

body.admin-page .cardkey-section .card-key-upload-box {
  border-color: rgba(137, 190, 230, 0.22);
  box-shadow: none;
}

body.admin-page .cardkey-section > label {
  display: grid;
  gap: 8px;
}

body.admin-page .cardkey-section .admin-status {
  min-height: 42px;
  display: flex;
  align-items: center;
  border-radius: 14px;
}

body.admin-page .cardkey-section .database-metrics {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

body.admin-page .cardkey-section .database-metrics div {
  min-height: 76px;
  display: grid;
  align-content: center;
  border-radius: 16px;
  padding: 16px;
  background:
    radial-gradient(circle at 82% 0%, rgba(78, 231, 255, 0.16), transparent 56%),
    rgba(255, 255, 255, 0.82);
}

body.admin-page .cardkey-section .card-summary {
  gap: 10px;
}

body.admin-page .cardkey-section .card-db-tools {
  grid-template-columns: minmax(220px, 1.35fr) minmax(160px, 0.9fr) minmax(140px, 0.75fr) minmax(140px, 0.75fr) auto;
  border-color: rgba(137, 190, 230, 0.24);
  padding: 14px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: none;
}

body.admin-page .cardkey-section .card-db-tools .ghost-button {
  min-height: 48px;
  border-radius: 999px;
  padding: 0 16px;
  white-space: nowrap;
}

@media (max-width: 980px) {
  body.admin-page .cardkey-section .card-db-tools {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.admin-page .cardkey-section .card-db-tools .ghost-button {
    width: 100%;
  }
}

@media (max-width: 640px) {
  body.admin-page .cardkey-page-form {
    padding: 10px;
  }

  body.admin-page .cardkey-section {
    padding: 12px;
    border-radius: 16px;
  }

  body.admin-page .cardkey-section .database-metrics,
  body.admin-page .cardkey-section .card-db-tools {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .field-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .mini-button {
    width: 100%;
  }

  .card-key-input-row {
    grid-template-columns: minmax(0, 1fr) 78px 40px;
    gap: 10px;
  }

  .card-key-type-badge {
    grid-column: 1 / -1;
    justify-content: flex-start;
    min-height: 42px;
  }

  .card-key-quantity {
    align-self: stretch;
  }

  .icon-button {
    width: 40px;
    min-width: 40px;
    height: 40px;
  }

  .card-key-upload-actions .primary-button {
    width: 100%;
  }
}


/* 20260709 announcement modal-to-dock motion */
@media (max-width: 520px) {
  .announcement-dock {
    margin: -2px 0 12px;
  }

  .announcement-dock-card {
    border-radius: 16px;
    padding: 10px;
  }

  .announcement-dock-head {
    margin-bottom: 6px;
  }

  .announcement-dock-body {
    gap: 6px;
  }

  .announcement-dock-body p {
    padding: 7px 9px;
    font-size: 11px;
    line-height: 1.5;
  }
}

@media (prefers-reduced-motion: reduce) {
  .announcement-dock.is-revealed .announcement-dock-card,
  .announcement-flight {
    animation: none;
    transition: none;
  }
}


/* 20260709 announcement dock top placement */
#market > .announcement-dock {
  width: 100%;
  margin: 10px 0 12px;
}

#market > .announcement-dock .announcement-dock-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  min-height: 48px;
  border-radius: 18px;
  padding: 10px 16px;
  background:
    radial-gradient(circle at 12% 50%, rgba(78, 231, 255, 0.2), transparent 28%),
    linear-gradient(90deg, rgba(255, 255, 255, 0.92), rgba(230, 248, 255, 0.78), rgba(255, 255, 255, 0.9));
}

#market > .announcement-dock .announcement-dock-head {
  justify-content: start;
  margin: 0;
}

#market > .announcement-dock .announcement-dock-head strong {
  white-space: nowrap;
}

#market > .announcement-dock .announcement-dock-body {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
  gap: 8px;
  min-width: 0;
}

#market > .announcement-dock .announcement-dock-body p {
  min-width: 0;
  white-space: normal;
  border-radius: 14px;
  padding: 10px 12px;
  line-height: 1.65;
}

@media (max-width: 900px) {
  #market > .announcement-dock .announcement-dock-card {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  #market > .announcement-dock .announcement-dock-body {
    grid-template-columns: 1fr;
    gap: 7px;
  }
}

@media (max-width: 520px) {
  #market > .announcement-dock {
    margin: 8px 0 10px;
  }

  #market > .announcement-dock .announcement-dock-card {
    min-height: 0;
    padding: 10px;
  }

  #market > .announcement-dock .announcement-dock-body p {
    white-space: normal;
  }
}


/* 20260709 restore compact catalog rows */
@media (min-width: 761px) {
  .catalog-panel .catalog-head,
  .catalog-panel .product-card {
    grid-template-columns: minmax(0, 1fr) 132px 104px 116px;
  }

  .catalog-panel .product-card {
    min-height: 88px;
    padding: 0;
  }

  .catalog-panel .product-row {
    display: contents;
  }

  .catalog-panel .product-body {
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr);
    grid-template-areas:
      "thumb title"
      "thumb tags";
    align-items: center;
    gap: 5px 14px;
    min-width: 0;
    padding: 14px 18px;
  }

  .catalog-panel .product-body > p {
    display: none !important;
  }

  .catalog-panel .tag-row {
    grid-area: tags;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }

  .catalog-panel .product-thumb {
    grid-area: thumb;
    width: 50px;
    height: 50px;
  }

  .catalog-panel .product-title {
    grid-area: title;
    min-height: 0;
    padding-left: 0;
  }

  .catalog-panel .product-title h3 {
    margin: 0;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .catalog-panel .change {
    display: none;
  }

  .catalog-panel .price,
  .catalog-panel .stock,
  .catalog-panel .trade-button {
    align-self: center;
    justify-self: center;
  }

  .catalog-panel .price {
    font-size: 20px;
    white-space: nowrap;
  }

  .catalog-panel .trade-button {
    width: 92px;
  }
}

/* 20260709 title-center */
@media (min-width: 761px) {
  .catalog-panel .product-body {
    grid-template-areas: "thumb title";
    grid-template-rows: 1fr;
    align-items: center;
  }

  .catalog-panel .product-title {
    display: flex;
    align-items: center;
    min-height: 54px;
    gap: 12px;
  }

  .catalog-panel .product-title .status-badge {
    flex: 0 0 auto;
  }
}


/* 20260709 mobile storefront final alignment */
@media (max-width: 760px) {
  html,
  body {
    width: 100%;
    overflow-x: hidden;
  }

  .shell,
  body.admin-page .shell {
    width: min(100% - 14px, 640px);
    padding-top: 8px;
  }

  .topbar,
  body.admin-page .topbar {
    position: sticky;
    top: 8px;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    border-radius: 22px;
    padding: 10px;
  }

  .brand {
    min-width: 0;
  }

  .brand-mark,
  body.admin-page .brand-mark {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
  }

  .brand strong {
    font-size: 18px;
    line-height: 1.05;
  }

  .brand small {
    display: block;
    max-width: 10em;
    overflow: hidden;
    color: #61778a;
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .market-pulse,
  .ghost-link {
    grid-column: 2;
    grid-row: 1;
    min-height: 34px;
    padding: 0 11px;
    font-size: 12px;
  }

  .nav-tabs,
  body.admin-page .nav-tabs,
  body.admin-page .admin-nav {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
    border-radius: 18px;
    padding: 5px;
  }

  body.admin-page .admin-nav {
    grid-template-columns: repeat(4, minmax(92px, 1fr));
    overflow-x: auto;
    scrollbar-width: none;
  }

  body.admin-page .admin-nav::-webkit-scrollbar {
    display: none;
  }

  .nav-tab,
  body.admin-page .nav-tab {
    min-width: 0;
    min-height: 40px;
    padding: 0 8px;
    font-size: 14px;
  }

  #market > .announcement-dock {
    margin: 8px 0 10px;
  }

  #market > .announcement-dock .announcement-dock-card {
    grid-template-columns: 1fr;
    gap: 8px;
    border-radius: 18px;
    padding: 10px;
  }

  #market > .announcement-dock .announcement-dock-head {
    justify-content: space-between;
  }

  #market > .announcement-dock .announcement-dock-body {
    grid-template-columns: 1fr;
  }

  #market > .announcement-dock .announcement-dock-body p {
    padding: 8px 10px;
    font-size: 12px;
    line-height: 1.55;
  }

  .trading-desk {
    margin-top: 10px;
  }

  .shop-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 0;
  }

  .category-rail {
    position: static;
    max-height: none;
    min-height: 0;
    overflow: hidden;
    border-radius: 20px;
    padding: 14px;
  }

  .category-rail h3 {
    margin: 0 0 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(137, 190, 230, 0.28);
    font-size: 21px;
    line-height: 1.1;
  }

  #categoryRail {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 0 1px 2px;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
  }

  #categoryRail::-webkit-scrollbar {
    display: none;
  }

  .category-button {
    flex: 0 0 auto;
    min-width: 112px;
    min-height: 40px;
    justify-content: center;
    gap: 8px;
    border-radius: 15px;
    padding: 0 12px;
    scroll-snap-align: start;
  }

  .category-button::before,
  .category-button img {
    width: 22px;
    height: 22px;
    flex: 0 0 22px;
  }

  .category-button > span {
    max-width: 92px;
    overflow: hidden;
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .catalog-head {
    display: none;
  }

  .catalog-panel {
    border-radius: 20px;
  }

  .product-grid {
    display: grid;
    gap: 10px;
    padding: 10px;
  }

  .catalog-panel .product-card,
  .product-card {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr) auto;
    grid-template-areas:
      "thumb title price"
      "thumb title stock"
      "buy buy buy"
      "detail detail detail";
    gap: 9px 10px;
    min-height: 0;
    border: 1px solid rgba(137, 190, 230, 0.36);
    border-radius: 18px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.9);
  }

  .catalog-panel .product-card::after,
  .product-card::after {
    display: none;
  }

  .catalog-panel .product-row,
  .product-row,
  .catalog-panel .product-body,
  .product-body {
    display: contents;
  }

  .catalog-panel .product-thumb,
  .product-thumb {
    grid-area: thumb;
    width: 50px;
    height: 50px;
    align-self: start;
  }

  .product-thumb img {
    object-fit: contain;
    padding: 3px;
  }

  .catalog-panel .product-title,
  .product-title {
    grid-area: title;
    display: flex;
    min-width: 0;
    align-items: flex-start;
    align-content: flex-start;
    gap: 6px;
  }

  .catalog-panel .product-title h3,
  .product-title h3 {
    display: -webkit-box;
    overflow: hidden;
    max-width: 100%;
    margin: 0;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    font-size: 17px;
    line-height: 1.24;
  }

  .catalog-panel .product-body > p,
  .product-body > p,
  .tag-row {
    display: none !important;
  }

  .status-badge {
    padding: 4px 8px;
    font-size: 11px;
    line-height: 1.1;
    white-space: nowrap;
  }

  .price {
    grid-area: price;
    align-self: start;
    justify-self: end;
    font-size: 21px;
    line-height: 1.1;
    white-space: nowrap;
  }

  .stock {
    grid-area: stock;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    justify-self: end;
    min-width: 72px;
    height: 32px;
    border: 1px solid rgba(93, 174, 230, 0.24);
    border-radius: 999px;
    padding: 0 10px;
    background: #eef8ff;
    color: #426277;
    font-size: 14px;
    font-weight: 950;
    white-space: nowrap;
  }

  .stock::before {
    content: "状态";
    color: #7b93a6;
    font-size: 11px;
    font-weight: 850;
  }

  .trade-button {
    grid-area: buy;
    width: 100%;
    min-height: 44px;
    border-radius: 15px;
    font-size: 17px;
  }

  .catalog-panel .product-detail,
  .product-detail {
    grid-area: detail;
    min-width: 0;
    border-radius: 18px;
  }

  .catalog-panel .product-card.is-expanded .product-detail,
  .product-card.is-expanded .product-detail {
    max-height: 760px;
    padding: 12px;
  }

  .details-inner {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .detail-image {
    width: 100%;
    aspect-ratio: 16 / 10;
  }

  .detail-description {
    max-height: 220px;
    overflow: auto;
    font-size: 13px;
  }

  .orders-panel {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 16px;
  }

  .lookup-form {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 390px) {
  .catalog-panel .product-card,
  .product-card {
    grid-template-columns: 48px minmax(0, 1fr);
    grid-template-areas:
      "thumb title"
      "price stock"
      "buy buy"
      "detail detail";
  }

  .price,
  .stock {
    justify-self: start;
  }
}

/* 20260709 true EOF detail override */
body .shell .catalog-panel .tag-row,
body .shell .catalog-panel .detail-tags,
body .checkout-detail .detail-tags {
  display: none !important;
}

body .shell .catalog-panel .product-card.is-expanded .product-detail {
  display: block !important;
  width: 100% !important;
  max-height: none !important;
  margin-top: 10px !important;
  padding: 14px !important;
}

body .shell .catalog-panel .product-card.is-expanded .details-inner {
  display: grid !important;
  grid-template-columns: 172px minmax(0, 1fr) !important;
  gap: 20px !important;
  align-items: start !important;
  width: 100% !important;
  min-width: 0 !important;
}

body .shell .catalog-panel .product-card.is-expanded .detail-image {
  width: 172px !important;
  max-width: 172px !important;
  aspect-ratio: 1 !important;
}

body .shell .catalog-panel .product-card.is-expanded .detail-image img {
  object-fit: contain !important;
  padding: 14px !important;
}

body .shell .catalog-panel .product-card.is-expanded .detail-copy {
  display: grid !important;
  align-content: start !important;
  gap: 12px !important;
  width: 100% !important;
  min-width: 0 !important;
}

body .shell .catalog-panel .product-card.is-expanded .detail-copy h4 {
  display: inline-flex !important;
  width: max-content !important;
  align-items: center !important;
  gap: 8px !important;
  margin: 0 !important;
  border-radius: 999px !important;
  padding: 6px 12px !important;
  background: #eaf6ff !important;
  color: #0d64c8 !important;
  font-size: 14px !important;
  font-weight: 950 !important;
}

body .shell .catalog-panel .product-card.is-expanded .detail-description {
  width: 100% !important;
  min-width: 0 !important;
  max-height: 300px !important;
  overflow: auto !important;
  font-size: 15px !important;
  line-height: 1.85 !important;
}

@media (max-width: 760px) {
  body .shell .catalog-panel .product-card.is-expanded .details-inner {
    grid-template-columns: 1fr !important;
  }

  body .shell .catalog-panel .product-card.is-expanded .detail-image {
    width: 100% !important;
    max-width: none !important;
    aspect-ratio: 16 / 10 !important;
  }
}

/* 20260709 row notice polish */
@media (min-width: 761px) {
  .catalog-panel .product-card:not(.is-expanded),
  .product-card:not(.is-expanded) {
    min-height: 84px;
    align-items: center;
  }

  .catalog-panel .product-body,
  .product-body {
    min-height: 84px;
    align-items: center;
    align-content: center;
    padding-block: 12px;
  }

  .catalog-panel .product-title,
  .product-title {
    align-items: center;
    align-self: center;
    min-height: 56px;
  }

  .catalog-panel .product-title h3,
  .product-title h3 {
    display: flex;
    align-items: center;
    min-height: 34px;
  }

  .catalog-panel .status-badge,
  .status-badge {
    min-height: 26px;
    border: 1px solid rgba(19, 178, 100, 0.18);
    border-radius: 999px;
    padding: 5px 12px;
    background:
      radial-gradient(circle at 18% 18%, rgba(255, 255, 255, 0.92) 0 5px, transparent 6px),
      linear-gradient(135deg, rgba(216, 255, 235, 0.96), rgba(237, 255, 246, 0.82));
    color: #049454;
    box-shadow: 0 8px 18px rgba(32, 185, 115, 0.11);
    font-size: 12px;
    line-height: 1;
  }

  .catalog-panel .stock,
  .stock {
    min-width: 64px;
    border: 1px solid rgba(42, 148, 231, 0.16);
    border-radius: 999px;
    padding: 7px 12px;
    background: linear-gradient(135deg, rgba(240, 250, 255, 0.96), rgba(255, 255, 255, 0.78));
    color: #4d6a80;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.88);
    text-align: center;
  }
}

#market > .announcement-dock .announcement-dock-card {
  grid-template-columns: 142px minmax(0, 1fr);
  align-items: stretch;
  gap: 18px;
  border-color: rgba(78, 181, 255, 0.28);
  border-radius: 18px;
  padding: 12px 14px;
  background:
    radial-gradient(circle at 6% 50%, rgba(54, 163, 255, 0.16), transparent 24%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(238, 249, 255, 0.86));
  box-shadow: 0 14px 34px rgba(38, 101, 148, 0.1);
}

#market > .announcement-dock .announcement-dock-head {
  min-width: 0;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 7px;
  border-right: 1px solid rgba(137, 190, 230, 0.28);
  padding: 4px 16px 4px 4px;
}

#market > .announcement-dock .announcement-dock-head span {
  min-width: 66px;
  justify-content: center;
  border-color: rgba(11, 107, 255, 0.2);
  padding: 4px 10px;
  background: rgba(232, 247, 255, 0.92);
  box-shadow: none;
  font-size: 10px;
}

#market > .announcement-dock .announcement-dock-head strong {
  margin: 0;
  color: #17344e;
  font-size: 17px;
  line-height: 1.2;
}

#market > .announcement-dock .announcement-dock-body {
  display: grid;
  grid-template-columns: minmax(210px, 0.82fr) minmax(290px, 1.1fr) minmax(320px, 1.22fr);
  align-items: stretch;
  gap: 8px;
}

#market > .announcement-dock .announcement-dock-body p {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  min-height: 66px;
  border: 1px solid rgba(137, 190, 230, 0.26);
  border-radius: 12px;
  padding: 12px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(247, 252, 255, 0.82));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.88);
  color: #405e76;
  font-size: 13px;
  line-height: 1.65;
}

#market > .announcement-dock .announcement-dock-index {
  display: inline-flex;
  width: 30px;
  height: 30px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(11, 107, 255, 0.18);
  border-radius: 8px;
  background: linear-gradient(145deg, #e8f7ff, #fff);
  color: #0877d6;
  font-size: 10px;
  font-weight: 950;
  line-height: 1;
}

#market > .announcement-dock .announcement-dock-copy {
  display: block;
  min-width: 0;
  padding-top: 3px;
}

@media (max-width: 1180px) {
  #market > .announcement-dock .announcement-dock-body {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  #market > .announcement-dock .announcement-dock-card,
  #market > .announcement-dock .announcement-dock-body {
    grid-template-columns: 1fr;
  }

  #market > .announcement-dock .announcement-dock-head {
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    border-right: 0;
    border-bottom: 1px solid rgba(137, 190, 230, 0.24);
    padding: 0 0 10px;
  }
}

@media (max-width: 520px) {
  #market > .announcement-dock .announcement-dock-card {
    gap: 10px;
    border-radius: 14px;
    padding: 10px;
  }

  #market > .announcement-dock .announcement-dock-head strong {
    font-size: 15px;
  }

  #market > .announcement-dock .announcement-dock-body p {
    grid-template-columns: 26px minmax(0, 1fr);
    gap: 8px;
    min-height: 0;
    padding: 10px;
    font-size: 12px;
  }

  #market > .announcement-dock .announcement-dock-index {
    width: 26px;
    height: 26px;
    border-radius: 7px;
  }
}

/* 20260709 visit analytics */
body.admin-page .analytics-dashboard {
  display: grid;
  gap: 16px;
  padding: 16px;
}

body.admin-page .analytics-metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

body.admin-page .analytics-metrics div,
body.admin-page .analytics-card {
  border: 1px solid rgba(137, 190, 230, 0.3);
  border-radius: 20px;
  background:
    radial-gradient(circle at 82% 0%, rgba(78, 231, 255, 0.1), transparent 46%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(239, 249, 255, 0.72));
  box-shadow: 0 14px 32px rgba(38, 101, 148, 0.07);
}

body.admin-page .analytics-metrics div {
  display: grid;
  gap: 8px;
  min-height: 92px;
  align-content: center;
  padding: 16px;
}

body.admin-page .analytics-metrics strong {
  color: #26cce9;
  font-size: 28px;
  line-height: 1;
}

body.admin-page .analytics-metrics span {
  color: #5b7489;
  font-weight: 900;
}

body.admin-page .analytics-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

body.admin-page .analytics-card {
  display: grid;
  gap: 12px;
  padding: 16px;
}

body.admin-page .analytics-card-head {
  border-bottom: 1px solid rgba(137, 190, 230, 0.24);
  padding-bottom: 8px;
}

body.admin-page .analytics-card-head h2 {
  margin: 0;
  color: #17344e;
  font-size: 16px;
}

body.admin-page .analytics-list,
body.admin-page .visit-log {
  display: grid;
  gap: 8px;
}

body.admin-page .analytics-rank-row,
body.admin-page .visit-log-row,
body.admin-page .analytics-empty {
  display: grid;
  align-items: center;
  border: 1px solid rgba(137, 190, 230, 0.22);
  border-radius: 16px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.76);
}

body.admin-page .analytics-rank-row {
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 10px;
}

body.admin-page .analytics-rank-row span {
  display: inline-grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 12px;
  background: #eaf7ff;
  color: #1677ff;
  font-weight: 950;
}

body.admin-page .analytics-rank-row strong,
body.admin-page .visit-log-row strong {
  overflow: hidden;
  color: #17344e;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.admin-page .analytics-rank-row em,
body.admin-page .visit-log-row em {
  color: #1677ff;
  font-style: normal;
  font-weight: 950;
}

body.admin-page .visit-log-row {
  grid-template-columns: minmax(180px, 1fr) minmax(260px, 1.2fr) 120px;
  gap: 12px;
}

body.admin-page .visit-log-row span,
body.admin-page .analytics-empty {
  color: #6a8298;
  font-weight: 800;
}

@media (max-width: 980px) {
  body.admin-page .analytics-metrics,
  body.admin-page .analytics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.admin-page .visit-log-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  body.admin-page .analytics-metrics,
  body.admin-page .analytics-grid {
    grid-template-columns: 1fr;
  }
}

/* 20260709 compact product rows */
@media (min-width: 761px) {
  .catalog-panel .catalog-head,
  .catalog-panel .product-card {
    grid-template-columns: minmax(0, 1fr) 124px 96px 108px;
  }

  .catalog-panel .product-card:not(.is-expanded),
  .product-card:not(.is-expanded) {
    min-height: 66px;
  }

  .catalog-panel .product-body,
  .product-body {
    grid-template-columns: 44px minmax(0, 1fr);
    min-height: 66px;
    padding: 8px 16px;
    gap: 4px 12px;
  }

  .catalog-panel .product-thumb,
  .product-thumb {
    width: 42px;
    height: 42px;
  }

  .catalog-panel .product-title,
  .product-title {
    min-height: 42px;
    gap: 10px;
  }

  .catalog-panel .product-title h3,
  .product-title h3 {
    min-height: 28px;
    font-size: 16px;
    line-height: 1.22;
  }

  .catalog-panel .status-badge,
  .status-badge {
    min-height: 24px;
    padding: 4px 10px;
    font-size: 11px;
  }

  .catalog-panel .price {
    font-size: 18px;
  }

  .catalog-panel .stock,
  .stock {
    min-width: 56px;
    padding: 6px 10px;
    font-size: 14px;
  }

  .catalog-panel .trade-button,
  .trade-button {
    min-height: 40px;
    width: 86px;
    padding: 0 14px;
  }
}

/* 20260709 final catalog column alignment */
@media (min-width: 761px) {
  .catalog-panel .catalog-head,
  .catalog-panel .product-card {
    grid-template-columns: minmax(0, 1fr) 128px 104px 116px !important;
    column-gap: 0 !important;
  }

  .catalog-panel .catalog-head {
    padding-inline: 0 !important;
  }

  .catalog-panel .catalog-head span {
    display: grid !important;
    place-items: center !important;
    min-width: 0;
    text-align: center !important;
  }

  .catalog-panel .catalog-head span:first-child {
    justify-content: start !important;
    padding-left: 18px;
    text-align: left !important;
  }

  .catalog-panel .product-card {
    padding: 0 !important;
  }

  .catalog-panel .product-row {
    display: contents !important;
  }

  .catalog-panel .price,
  .catalog-panel .stock,
  .catalog-panel .trade-button {
    justify-self: center !important;
    align-self: center !important;
    text-align: center !important;
  }

  .catalog-panel .price {
    width: 100%;
    min-width: 0 !important;
    font-variant-numeric: tabular-nums;
  }

  .catalog-panel .stock {
    display: inline-grid !important;
    min-width: 64px !important;
    place-items: center !important;
    white-space: nowrap;
  }

  .catalog-panel .trade-button {
    width: 88px !important;
    min-width: 88px !important;
  }
}

/* 20260709 mobile storefront and admin adaptation */
@media (max-width: 760px) {
  html,
  body {
    width: 100%;
    overflow-x: hidden;
  }

  .shell,
  body.admin-page .shell {
    width: 100%;
    max-width: 100%;
    padding: 10px;
  }

  .topbar,
  body.admin-page .topbar {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    border-radius: 22px;
    padding: 10px;
  }

  .brand {
    min-width: 0;
  }

  .brand strong,
  .brand small {
    max-width: 54vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .nav-tabs,
  body.admin-page .admin-nav {
    grid-column: 1 / -1;
    display: flex !important;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    gap: 6px;
    padding: 5px;
    scrollbar-width: none;
  }

  .nav-tabs::-webkit-scrollbar,
  body.admin-page .admin-nav::-webkit-scrollbar {
    display: none;
  }

  .nav-tab,
  body.admin-page .nav-tab {
    flex: 1 0 88px;
    min-width: 88px;
    min-height: 38px;
    padding: 0 10px;
    border-radius: 14px;
    font-size: 14px;
    white-space: nowrap;
  }

  .market-pulse,
  .ghost-link,
  body.admin-page .admin-top-actions {
    min-height: 38px;
    justify-self: end;
    padding-inline: 12px;
    border-radius: 999px;
  }

  .shop-layout {
    grid-template-columns: 1fr !important;
    gap: 10px;
  }

  .category-rail {
    min-height: 0 !important;
    padding: 12px !important;
    border-radius: 20px !important;
  }

  .category-rail h3 {
    margin: 0 0 10px !important;
    padding-bottom: 8px !important;
    font-size: 20px !important;
    line-height: 1.15;
  }

  #categoryRail {
    display: flex !important;
    overflow-x: auto;
    gap: 8px;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  #categoryRail::-webkit-scrollbar {
    display: none;
  }

  .category-button {
    flex: 0 0 auto;
    min-width: 108px;
    min-height: 40px;
    justify-content: center;
    border-radius: 15px;
    padding: 0 12px;
  }

  .category-button::before,
  .category-button img {
    width: 22px;
    height: 22px;
    flex-basis: 22px;
  }

  .category-button > span {
    max-width: 76px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .catalog-head {
    display: none !important;
  }

  .catalog-panel {
    border-radius: 20px !important;
  }

  .product-grid {
    gap: 10px !important;
    padding: 10px !important;
  }

  .catalog-panel .product-card,
  .product-card {
    display: grid !important;
    grid-template-columns: 54px minmax(0, 1fr) auto !important;
    grid-template-areas:
      "thumb title price"
      "thumb title stock"
      "buy buy buy"
      "detail detail detail" !important;
    gap: 9px 10px !important;
    min-height: 0 !important;
    border-radius: 18px !important;
    padding: 12px !important;
  }

  .catalog-panel .product-row,
  .product-row,
  .catalog-panel .product-body,
  .product-body {
    display: contents !important;
  }

  .catalog-panel .product-thumb,
  .product-thumb {
    grid-area: thumb;
    width: 50px !important;
    height: 50px !important;
    align-self: start;
  }

  .product-thumb img {
    object-fit: contain;
    padding: 3px;
  }

  .catalog-panel .product-title,
  .product-title {
    grid-area: title;
    display: flex !important;
    min-width: 0;
    align-items: flex-start;
    gap: 6px;
  }

  .catalog-panel .product-title h3,
  .product-title h3 {
    display: -webkit-box;
    overflow: hidden;
    max-width: 100%;
    margin: 0;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    font-size: 16px !important;
    line-height: 1.25 !important;
  }

  .catalog-panel .product-body > p,
  .product-body > p,
  .tag-row {
    display: none !important;
  }

  .status-badge {
    padding: 4px 8px !important;
    font-size: 11px !important;
    line-height: 1.1;
    white-space: nowrap;
  }

  .catalog-panel .price,
  .price {
    grid-area: price;
    align-self: start !important;
    justify-self: end !important;
    width: auto;
    min-width: 0 !important;
    font-size: 20px !important;
    line-height: 1.1;
    white-space: nowrap;
  }

  .catalog-panel .stock,
  .stock {
    grid-area: stock;
    display: inline-grid !important;
    min-width: 64px !important;
    height: 30px;
    place-items: center;
    justify-self: end !important;
    border-radius: 999px;
    padding: 0 10px !important;
    font-size: 13px !important;
    white-space: nowrap;
  }

  .stock::before {
    content: "状态";
    margin-right: 4px;
    color: #7890a4;
    font-size: 11px;
    font-weight: 850;
  }

  .catalog-panel .trade-button,
  .trade-button {
    grid-area: buy;
    width: 100% !important;
    min-height: 44px;
    border-radius: 15px;
    font-size: 16px;
  }

  .catalog-panel .product-detail,
  .product-detail {
    grid-area: detail;
    min-width: 0;
  }

  .catalog-panel .product-card.is-expanded .product-detail,
  .product-card.is-expanded .product-detail {
    max-height: 780px !important;
    padding: 12px !important;
  }

  .details-inner,
  body .shell .catalog-panel .product-card.is-expanded .details-inner {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  .detail-image,
  body .shell .catalog-panel .product-card.is-expanded .detail-image {
    width: 100% !important;
    max-width: none !important;
    aspect-ratio: 16 / 10 !important;
  }

  .detail-description,
  body .shell .catalog-panel .product-card.is-expanded .detail-description {
    max-height: 220px !important;
    overflow: auto;
    font-size: 13px !important;
    line-height: 1.75 !important;
  }

  .trade-ticket {
    align-items: end;
    padding: 0;
  }

  .product-checkout {
    width: 100% !important;
    max-width: 100% !important;
    max-height: 94dvh;
    overflow-y: auto;
    border-radius: 24px 24px 0 0 !important;
    padding: 12px !important;
  }

  .checkout-hero {
    grid-template-columns: 1fr !important;
    gap: 14px;
  }

  .checkout-image {
    aspect-ratio: 16 / 10 !important;
  }

  .checkout-purchase h2 {
    font-size: 22px !important;
    line-height: 1.28;
  }

  .checkout-actions,
  .lookup-form,
  .orders-panel,
  .order-card,
  .order-access {
    grid-template-columns: 1fr !important;
  }

  .lookup-form {
    max-width: none !important;
    margin-left: 0 !important;
  }

  body.admin-page .admin-layout,
  body.admin-page .standalone-admin,
  body.admin-page .admin-tools,
  body.admin-page .form-row,
  body.admin-page .card-db-tools,
  body.admin-page .ledger-detail,
  body.admin-page .card-key-bound-info,
  body.admin-page .analytics-grid {
    grid-template-columns: 1fr !important;
  }

  body.admin-page .admin-panel,
  body.admin-page .admin-list,
  body.admin-page .card-ledger,
  body.admin-page #adminProducts {
    min-width: 0;
    overflow: visible;
  }

  body.admin-page .panel-head {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 12px;
    padding: 14px;
  }

  body.admin-page .panel-head .ghost-button,
  body.admin-page .panel-head button {
    width: 100%;
  }

  body.admin-page .product-form,
  body.admin-page #adminProducts,
  body.admin-page .analytics-dashboard {
    padding: 12px !important;
  }

  body.admin-page input,
  body.admin-page select,
  body.admin-page textarea {
    min-width: 0;
    width: 100%;
    font-size: 16px;
  }

  body.admin-page #description {
    min-height: 220px !important;
  }

  body.admin-page .category-tool-form {
    grid-template-columns: 1fr !important;
  }

  body.admin-page .category-add-row,
  body.admin-page .icon-form-actions,
  body.admin-page .admin-actions,
  body.admin-page .ledger-actions {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  body.admin-page .category-delete-action {
    width: 100%;
  }

  body.admin-page .database-metrics,
  body.admin-page .analytics-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 8px;
  }

  body.admin-page .database-metrics div,
  body.admin-page .analytics-metrics div {
    min-height: 76px;
    padding: 10px 8px;
  }

  body.admin-page .database-metrics strong,
  body.admin-page .analytics-metrics strong {
    font-size: 20px;
  }

  body.admin-page .card-key-input-row {
    display: grid !important;
    grid-template-columns: 1fr 92px 80px 42px;
    gap: 8px;
    align-items: end;
  }

  body.admin-page .card-key-upload-actions,
  body.admin-page .cardkey-section .card-db-tools {
    display: grid !important;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  body.admin-page .ledger-row {
    min-width: 0 !important;
  }

  body.admin-page .ledger-summary {
    grid-template-columns: 24px minmax(0, 1fr) !important;
    gap: 8px;
  }

  body.admin-page .ledger-meta {
    grid-column: 2 / -1 !important;
    grid-template-columns: 1fr;
  }

  body.admin-page .key-status {
    justify-self: start !important;
  }

  body.admin-page .visit-log-row,
  body.admin-page .analytics-rank-row {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 430px) {
  .shell,
  body.admin-page .shell {
    padding: 8px;
  }

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

  .catalog-panel .product-card,
  .product-card {
    grid-template-columns: 48px minmax(0, 1fr) auto !important;
    gap: 8px !important;
    padding: 10px !important;
  }

  .catalog-panel .product-thumb,
  .product-thumb {
    width: 44px !important;
    height: 44px !important;
  }

  .catalog-panel .product-title h3,
  .product-title h3 {
    font-size: 15px !important;
  }

  .catalog-panel .price,
  .price {
    font-size: 18px !important;
  }

  .catalog-panel .stock,
  .stock {
    min-width: 58px !important;
    height: 28px;
    padding: 0 8px !important;
    font-size: 12px !important;
  }

  .stock::before {
    display: none;
  }

  body.admin-page .database-metrics,
  body.admin-page .analytics-metrics {
    grid-template-columns: 1fr !important;
  }

  body.admin-page .category-add-row,
  body.admin-page .icon-form-actions,
  body.admin-page .admin-actions,
  body.admin-page .ledger-actions,
  body.admin-page .card-key-input-row {
    grid-template-columns: 1fr !important;
  }

  body.admin-page .nav-tab {
    flex-basis: 84px;
    min-width: 84px;
    font-size: 13px;
  }
}

/* 20260711 aligned catalog rows and purchase-only details */
.catalog-panel .product-card > .product-detail {
  display: none !important;
}

@media (min-width: 761px) {
  .catalog-panel .product-card {
    min-height: 72px !important;
    align-items: center !important;
    cursor: default !important;
  }

  .catalog-panel .product-body {
    min-height: 72px !important;
    align-items: center !important;
    align-content: center !important;
    padding: 10px 18px !important;
  }

  .catalog-panel .product-thumb,
  .catalog-panel .product-title,
  .catalog-panel .price,
  .catalog-panel .stock,
  .catalog-panel .trade-button {
    align-self: center !important;
  }

  .catalog-panel .product-title {
    min-height: 0 !important;
    align-items: center !important;
  }

  .catalog-panel .product-title h3 {
    min-height: 0 !important;
    margin: 0 !important;
  }
}

.catalog-panel .stock {
  min-width: 76px !important;
  border-color: rgba(28, 146, 226, 0.24) !important;
  background: #eef8ff !important;
  color: #315f7d !important;
  font-variant-numeric: tabular-nums;
}

.catalog-panel .stock.is-manual {
  border-color: rgba(23, 178, 105, 0.2) !important;
  background: #ecfbf3 !important;
  color: #07864c !important;
}

.catalog-panel .stock.is-empty {
  border-color: rgba(137, 153, 168, 0.2) !important;
  background: #f1f5f8 !important;
  color: #73879a !important;
}

.catalog-panel .stock::before {
  display: none !important;
  content: none !important;
}

/* 20260711 full-length card-key display */
body.admin-page .ledger-code-preview {
  white-space: pre-wrap !important;
  overflow-wrap: anywhere;
  word-break: break-word;
  overflow: visible !important;
  text-overflow: clip !important;
}

body.admin-page textarea.card-code-input {
  min-height: 88px;
  resize: vertical;
  white-space: pre-wrap !important;
  overflow-wrap: anywhere;
  word-break: break-word;
  text-overflow: clip !important;
}

/* 20260713 admin login feedback */
body.admin-page .admin-login-card .admin-login-status {
  display: flex;
  width: 100%;
  min-height: 42px;
  margin: 2px 0 0;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(54, 163, 255, 0.2);
  border-radius: 12px;
  padding: 9px 12px;
  background: rgba(54, 163, 255, 0.07);
  color: #39708f;
  font-size: 13px;
  font-weight: 750;
  line-height: 1.45;
  text-align: center;
}

body.admin-page .admin-login-card .admin-login-status[data-tone="error"] {
  border-color: rgba(220, 68, 84, 0.24);
  background: rgba(220, 68, 84, 0.08);
  color: #c33849;
}

body.admin-page .admin-login-card .admin-login-status[data-tone="success"] {
  border-color: rgba(20, 166, 102, 0.24);
  background: rgba(20, 166, 102, 0.08);
  color: #07864c;
}

/* 20260713 compact SEO storefront identity */
.store-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: center;
  margin: 0 0 18px;
  border-bottom: 1px solid rgba(52, 112, 158, 0.14);
  padding: 22px 2px 20px;
}

.store-intro-copy {
  min-width: 0;
}

.store-intro-kicker {
  display: block;
  margin-bottom: 5px;
  color: #1677c8;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
}

.store-intro h1 {
  margin: 0;
  color: #102b40;
  font-size: 28px;
  font-weight: 900;
  line-height: 1.18;
  letter-spacing: 0;
}

.store-intro p {
  max-width: 760px;
  margin: 8px 0 0;
  color: #647d90;
  font-size: 14px;
  line-height: 1.65;
}

.store-keywords {
  display: grid;
  grid-template-columns: repeat(2, minmax(96px, 1fr));
  gap: 8px;
}

.store-keywords :is(span, a) {
  display: flex;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(39, 133, 201, 0.17);
  border-radius: 8px;
  padding: 7px 12px;
  background: #f7fbfe;
  color: #285d7e;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  text-decoration: none;
}

.store-keywords a {
  color: #0b6bff;
}

.store-keywords a:hover {
  border-color: rgba(11, 107, 255, 0.38);
  background: #eef8ff;
}

.seo-page-meta {
  display: flex;
  min-width: 0;
  align-items: baseline;
  gap: 12px;
  margin: 0 0 10px;
  border-bottom: 1px solid rgba(52, 112, 158, 0.12);
  padding: 2px 2px 9px;
}

.seo-page-meta h1 {
  flex: 0 0 auto;
  margin: 0;
  color: #183b54;
  font-size: 17px;
  font-weight: 900;
  line-height: 1.35;
}

.seo-page-meta p {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  color: #718697;
  font-size: 12px;
  line-height: 1.5;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.seo-discovery {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.8fr);
  gap: 18px 28px;
  align-items: start;
  margin-top: 18px;
  border-top: 1px solid rgba(52, 112, 158, 0.14);
  padding: 18px 2px 5px;
}

.seo-discovery:empty {
  display: none;
}

.seo-discovery-copy {
  min-width: 0;
}

.seo-discovery-kicker {
  display: block;
  margin-bottom: 5px;
  color: #1677c8;
  font-size: 10px;
  font-weight: 900;
  line-height: 1.3;
}

.seo-discovery h2 {
  margin: 0;
  color: #183b54;
  font-size: 17px;
  font-weight: 900;
  line-height: 1.4;
}

.seo-discovery p {
  max-width: 820px;
  margin: 7px 0 0;
  color: #667f91;
  font-size: 12px;
  line-height: 1.75;
}

.seo-discovery-links {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  gap: 7px;
}

.seo-discovery-links a {
  display: inline-flex;
  min-height: 31px;
  align-items: center;
  border: 1px solid rgba(39, 133, 201, 0.17);
  border-radius: 8px;
  padding: 6px 10px;
  background: #f8fcff;
  color: #22658f;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.35;
  text-decoration: none;
}

.seo-discovery-links a:hover {
  border-color: rgba(11, 107, 255, 0.38);
  background: #eef8ff;
  color: #0b6bff;
}

.product-title h3 a {
  color: inherit;
  text-decoration: none;
}

.product-title h3 a:hover {
  color: #0b6bff;
}

.seo-guide {
  margin: 0 0 18px;
  border-top: 1px solid rgba(39, 133, 201, 0.16);
  border-bottom: 1px solid rgba(39, 133, 201, 0.16);
  padding: 24px 2px;
}

.seo-guide[hidden] {
  display: none;
}

.seo-guide-head {
  max-width: 860px;
}

.seo-guide-kicker,
.seo-guide-index {
  color: #0b6bff;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
}

.seo-guide h2 {
  margin: 7px 0 0;
  color: #102b40;
  font-size: 22px;
  line-height: 1.35;
  letter-spacing: 0;
}

.seo-guide-head > p {
  margin: 10px 0 0;
  color: #587186;
  font-size: 14px;
  line-height: 1.75;
}

.seo-guide-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 20px;
}

.seo-guide-item {
  min-width: 0;
  border: 1px solid rgba(39, 133, 201, 0.16);
  border-radius: 8px;
  padding: 16px;
  background: #f8fcff;
}

.seo-guide-item h3,
.seo-related-products h3 {
  margin: 7px 0 0;
  color: #183b54;
  font-size: 15px;
  line-height: 1.45;
}

.seo-guide-item p {
  margin: 8px 0 0;
  color: #647d90;
  font-size: 13px;
  line-height: 1.7;
}

.seo-related-products {
  margin-top: 20px;
}

.seo-related-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.seo-related-links a {
  border: 1px solid rgba(11, 107, 255, 0.2);
  border-radius: 8px;
  padding: 8px 11px;
  background: #fff;
  color: #175b8a;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.4;
  text-decoration: none;
}

.seo-related-links a:hover {
  border-color: rgba(11, 107, 255, 0.42);
  color: #0b6bff;
}

a.category-button {
  cursor: pointer;
  text-decoration: none;
}

@media (max-width: 760px) {
  .seo-page-meta {
    display: block;
    margin-bottom: 8px;
    padding: 1px 1px 8px;
    text-align: center;
  }

  .seo-page-meta h1 {
    font-size: 15px;
  }

  .seo-page-meta p {
    margin-top: 3px;
    font-size: 10px;
    white-space: normal;
  }

  .seo-discovery {
    grid-template-columns: 1fr;
    gap: 12px;
    margin-top: 14px;
    padding: 16px 1px 4px;
    text-align: left;
  }

  .seo-discovery h2 {
    font-size: 15px;
  }

  .seo-discovery p {
    font-size: 11px;
  }

  .seo-discovery-links {
    gap: 6px;
  }

  .seo-discovery-links a {
    min-height: 30px;
    padding: 6px 9px;
    font-size: 10px;
  }

  .store-intro {
    grid-template-columns: 1fr;
    gap: 14px;
    margin-bottom: 14px;
    padding: 18px 2px 16px;
    text-align: center;
  }

  .store-intro h1 {
    font-size: 23px;
  }

  .store-intro p {
    margin-top: 7px;
    font-size: 13px;
  }

  .store-keywords {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
  }

  .store-keywords :is(span, a) {
    min-height: 32px;
    padding: 6px 4px;
    font-size: 10px;
  }

  .store-keywords a {
    line-height: 1.25;
    text-align: center;
    white-space: normal;
  }

  .seo-guide {
    margin-bottom: 14px;
    padding: 20px 2px;
    text-align: left;
  }

  .seo-guide h2 {
    font-size: 19px;
  }

  .seo-guide-grid {
    grid-template-columns: 1fr;
  }

  .seo-related-links {
    display: grid;
    grid-template-columns: 1fr;
  }
}

/* 20260713 compact admin segmented navigation */
body.admin-page .admin-nav {
  width: min(100%, 620px);
  min-height: 48px;
  gap: 4px;
  border: 1px solid rgba(111, 169, 211, 0.24);
  border-radius: 15px;
  padding: 4px;
  background: rgba(237, 246, 252, 0.9);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 7px 18px rgba(36, 93, 134, 0.06);
}

body.admin-page .admin-nav .nav-tab {
  position: relative;
  min-width: 0;
  min-height: 38px;
  border-radius: 11px;
  padding: 0 14px;
  color: #5a6b79;
  font-size: 14px;
  font-weight: 850;
  line-height: 1;
  animation: none;
  transform: none;
}

body.admin-page .admin-nav .nav-tab:hover:not(.is-active) {
  background: rgba(255, 255, 255, 0.56);
  color: #235b82;
  box-shadow: none;
  transform: none;
}

body.admin-page .admin-nav .nav-tab.is-active {
  background: rgba(255, 255, 255, 0.98);
  color: #0b6bff;
  box-shadow:
    0 5px 14px rgba(48, 104, 145, 0.1),
    inset 0 0 0 1px rgba(124, 180, 221, 0.12);
  animation: none;
  transform: none;
}

body.admin-page .admin-nav .nav-tab.is-active::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 4px;
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, #0b6bff, #25b9ff);
  box-shadow: 0 0 8px rgba(11, 107, 255, 0.28);
  transform: translateX(-50%);
}

@media (max-width: 760px) {
  body.admin-page .admin-nav {
    min-height: 44px;
    gap: 3px;
    border-radius: 13px;
    padding: 4px;
  }

  body.admin-page .admin-nav .nav-tab {
    flex: 1 0 82px;
    min-width: 82px;
    min-height: 36px;
    border-radius: 9px;
    padding: 0 9px;
    font-size: 13px;
  }
}

/* 20260713 compact card-key upload table */
body.admin-page .card-key-upload-box {
  gap: 9px;
  padding: 16px 18px 18px;
}

body.admin-page .card-key-upload-box .field-heading {
  min-height: 36px;
  padding: 0 2px 2px;
  color: #284e69;
}

body.admin-page .card-key-upload-box .field-heading > span {
  font-size: 15px;
}

body.admin-page .card-key-upload-box .mini-button {
  min-height: 34px;
  border-radius: 10px;
  padding: 0 13px;
  color: #17689d;
  font-size: 12px;
  box-shadow: none;
}

body.admin-page .card-key-upload-box .mini-button::before {
  content: "+";
  margin-right: 5px;
  color: #0b79d0;
  font-size: 16px;
  font-weight: 800;
  line-height: 1;
}

body.admin-page .card-key-input-head,
body.admin-page .card-key-input-row {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) 94px 108px 40px;
  gap: 10px;
  align-items: center;
}

body.admin-page .card-key-input-head {
  padding: 0 9px;
  color: #748b9d;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
}

body.admin-page .card-key-input-head span:nth-child(2),
body.admin-page .card-key-input-head span:nth-child(3) {
  text-align: center;
}

body.admin-page .card-key-input-rows {
  gap: 8px;
}

body.admin-page .card-key-input-row {
  min-width: 0;
  min-height: 58px;
  border: 1px solid rgba(123, 180, 221, 0.3);
  border-radius: 14px;
  padding: 6px 8px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 5px 14px rgba(39, 98, 139, 0.035);
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
}

body.admin-page .card-key-input-row:hover {
  border-color: rgba(75, 158, 218, 0.46);
  background: rgba(255, 255, 255, 0.96);
}

body.admin-page .card-key-input-row:focus-within {
  border-color: rgba(11, 107, 255, 0.48);
  box-shadow: 0 0 0 3px rgba(11, 107, 255, 0.07);
}

body.admin-page .card-key-input-row input[data-card-key-input] {
  width: 100%;
  min-width: 0;
  height: 44px;
  min-height: 44px;
  border: 0;
  border-radius: 9px;
  padding: 0 12px;
  background: transparent;
  box-shadow: none;
  font-size: 14px;
}

body.admin-page .card-key-input-row input[data-card-key-input]:focus {
  outline: none;
}

body.admin-page .card-key-quantity {
  min-width: 0;
}

body.admin-page .card-key-quantity > span {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

body.admin-page .card-key-quantity input {
  width: 100%;
  height: 42px;
  min-height: 42px;
  border: 1px solid rgba(123, 180, 221, 0.3);
  border-radius: 10px;
  padding: 0 8px;
  background: #f4f9fc;
  font-size: 16px;
  font-weight: 850;
}

body.admin-page .card-key-type-badge {
  min-width: 0;
  min-height: 40px;
  border-radius: 10px;
  padding: 0 9px;
  font-size: 12px;
  box-shadow: none;
}

body.admin-page .card-key-input-row .icon-button {
  width: 40px;
  min-width: 40px;
  height: 40px;
  border-radius: 10px;
  color: #6e8495;
  font-size: 20px;
  box-shadow: none;
}

body.admin-page .card-key-input-row .icon-button:hover {
  border-color: rgba(225, 80, 91, 0.28);
  background: rgba(255, 241, 243, 0.94);
  color: #d74350;
}

body.admin-page .card-key-upload-actions {
  padding: 3px 0 0;
}

body.admin-page .card-key-upload-actions .primary-button {
  min-width: 128px;
  min-height: 44px;
  border-radius: 11px;
  padding: 0 20px;
}

@media (max-width: 760px) {
  body.admin-page .card-key-upload-box {
    padding: 13px;
  }

  body.admin-page .card-key-input-head {
    display: none;
  }

  body.admin-page .card-key-input-row {
    grid-template-columns: minmax(0, 1fr) 84px 96px 40px !important;
    gap: 7px;
    align-items: center;
  }
}

@media (max-width: 560px) {
  body.admin-page .card-key-upload-box .field-heading {
    flex-direction: row;
    align-items: center;
  }

  body.admin-page .card-key-upload-box .mini-button {
    width: auto;
  }

  body.admin-page .card-key-input-row {
    grid-template-columns: 84px minmax(0, 1fr) 40px !important;
    gap: 7px;
    padding: 7px;
  }

  body.admin-page .card-key-input-row input[data-card-key-input] {
    grid-column: 1 / -1;
    border: 1px solid rgba(123, 180, 221, 0.22);
    background: #fbfdff;
  }

  body.admin-page .card-key-quantity {
    grid-column: 1;
  }

  body.admin-page .card-key-type-badge {
    grid-column: 2;
    justify-content: center;
    min-height: 40px;
  }

  body.admin-page .card-key-input-row .icon-button {
    grid-column: 3;
  }

  body.admin-page .card-key-upload-actions .primary-button {
    width: 100%;
  }
}
