:root {
  --bg: #111630;
  --panel: rgba(30, 39, 72, 0.82);
  --panel-soft: rgba(24, 32, 61, 0.62);
  --ink: #f5f7ff;
  --muted: #9aa4c0;
  --line: rgba(165, 180, 220, 0.16);
  --green: #55e49a;
  --red: #ef5c6f;
  --orange: #f2a94b;
  --blue: #7fa6ff;
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 72% 18%, rgba(72, 92, 148, 0.34), transparent 32rem),
    radial-gradient(circle at 70% 96%, rgba(68, 31, 93, 0.38), transparent 30rem),
    linear-gradient(180deg, #1f2947 0, #131935 42%, #111630 100%);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Microsoft YaHei", sans-serif;
}

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

button,
input,
select {
  font: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  gap: 24px;
  align-items: center;
  padding: 14px max(22px, calc((100vw - 1340px) / 2));
  background: rgba(17, 22, 48, 0.86);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  gap: 12px;
  align-items: center;
  min-width: 0;
}

.brand-mark {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  box-shadow: 0 10px 24px rgba(28, 211, 150, 0.22);
}

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

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

.brand strong {
  color: #fff;
}

.brand small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.topnav {
  display: flex;
  gap: 18px;
  color: #c5cce1;
  font-size: 14px;
}

.topnav a:hover {
  color: var(--green);
}

.xianyu-link,
.primary-action,
.secondary-action {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 800;
}

.cart-toggle {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  color: #eef4ff;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  font-weight: 900;
}

.cart-toggle:hover {
  border-color: rgba(85, 228, 154, 0.34);
}

.cart-toggle span {
  display: grid;
  min-width: 22px;
  height: 22px;
  place-items: center;
  color: #10162f;
  background: var(--green);
  border-radius: 999px;
  font-size: 12px;
}

.xianyu-link,
.primary-action {
  padding: 0 18px;
  color: #10162f;
  background: var(--green);
  box-shadow: 0 12px 28px rgba(85, 228, 154, 0.2);
}

.secondary-action {
  padding: 0 14px;
  color: #dce4ff;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--line);
}

.primary-action:disabled,
.secondary-action:disabled {
  cursor: not-allowed;
  opacity: 0.5;
  box-shadow: none;
}

main {
  width: min(1340px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 18px 0 38px;
}

.market-shell {
  display: grid;
  gap: 16px;
}

.asset-console {
  display: grid;
  gap: 14px;
  padding: 16px 18px;
  background: linear-gradient(135deg, rgba(31, 39, 78, 0.86), rgba(32, 44, 77, 0.72));
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.avatar-frame-entry {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px;
  align-items: center;
  padding: 18px 20px;
  background:
    radial-gradient(circle at 94% 26%, rgba(85, 228, 154, 0.22), transparent 24rem),
    linear-gradient(135deg, rgba(17, 24, 49, 0.88), rgba(27, 37, 76, 0.72));
  border: 1px solid rgba(85, 228, 154, 0.2);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.avatar-frame-entry h2,
.avatar-frame-entry p {
  margin: 0;
}

.avatar-frame-entry h2 {
  font-size: 22px;
}

.avatar-frame-entry span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 14px;
}

.console-head {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px;
  align-items: end;
}

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

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

h1 {
  margin-bottom: 0;
  font-size: 30px;
  line-height: 1;
  letter-spacing: 0;
}

.market-stats {
  display: flex;
  gap: 10px;
  align-items: center;
}

.market-stats span {
  padding: 8px 12px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  border-radius: 6px;
  white-space: nowrap;
}

.market-stats strong {
  color: #fff;
}

.filter-table {
  display: grid;
  gap: 10px;
  padding-top: 2px;
}

.filter-line {
  display: grid;
  grid-template-columns: 116px 1fr;
  gap: 14px;
  align-items: start;
}

.filter-name {
  color: #aab3cd;
  font-size: 13px;
  font-weight: 800;
}

.filter-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-option {
  min-height: 28px;
  padding: 0 12px;
  color: #edf2ff;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(165, 180, 220, 0.12);
  border-radius: 999px;
  cursor: pointer;
  font-size: 13px;
}

.filter-option:hover,
.filter-option.is-active {
  color: var(--green);
  background: rgba(85, 228, 154, 0.1);
  border-color: rgba(85, 228, 154, 0.28);
}

.notice-list {
  display: grid;
  gap: 8px;
  padding: 8px 0 2px;
}

.notice {
  display: flex;
  gap: 12px;
  align-items: center;
  margin: 0;
  color: #ff7d71;
  font-size: 14px;
}

.notice span {
  display: grid;
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  place-items: center;
  color: #fff;
  background: var(--orange);
  border-radius: 50%;
  font-size: 13px;
  font-weight: 900;
}

.notice.important {
  color: #ff5f99;
}

.notice.important b,
.notice.important strong {
  color: var(--green);
}

.notice.delivery {
  color: var(--orange);
}

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

.search-box {
  position: relative;
}

.search-box span {
  position: absolute;
  top: 14px;
  left: 16px;
  width: 12px;
  height: 12px;
  border: 2px solid var(--muted);
  border-radius: 50%;
}

.search-box span::after {
  position: absolute;
  right: -7px;
  bottom: -5px;
  width: 8px;
  height: 2px;
  background: var(--muted);
  border-radius: 2px;
  content: "";
  transform: rotate(45deg);
}

.search-box input,
select {
  width: 100%;
  height: 42px;
  color: #eef4ff;
  background: rgba(11, 16, 36, 0.66);
  border: 1px solid var(--line);
  border-radius: 6px;
  outline: none;
}

.search-box input {
  padding: 0 16px 0 42px;
}

select {
  padding: 0 12px;
}

.search-box input:focus,
select:focus {
  border-color: rgba(85, 228, 154, 0.5);
  box-shadow: 0 0 0 4px rgba(85, 228, 154, 0.08);
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(227px, 1fr));
  justify-items: center;
  gap: 22px 14px;
  padding: 10px 0 8px;
}

.load-more-row {
  grid-column: 1 / -1;
  width: 100%;
  padding: 12px;
  color: var(--muted);
  text-align: center;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(165, 180, 220, 0.1);
  border-radius: 8px;
  font-size: 13px;
}

.product-card {
  position: relative;
  display: grid;
  gap: 0;
  width: 100%;
  max-width: 227px;
  min-width: 0;
  padding: 0;
  background: rgba(8, 11, 26, 0.84);
  border: 1px solid rgba(165, 180, 220, 0.08);
  border-radius: 8px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.16);
  overflow: visible;
}

.product-card:hover {
  z-index: 12;
  border-color: rgba(85, 228, 154, 0.28);
}

.product-media {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0)),
    rgba(11, 16, 36, 0.46);
  border-radius: 8px 8px 0 0;
}

.product-media::before {
  position: absolute;
  inset: 18%;
  z-index: 1;
  border: 1px dashed rgba(162, 174, 212, 0.2);
  content: "";
  transform: rotate(45deg);
}

.product-media img,
.product-preview-video {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.product-media img {
  opacity: 1;
  filter: saturate(1.12) contrast(1.05);
}

.product-preview-video {
  opacity: 1;
  background: #050713;
  object-fit: contain;
}

.sound-ribbon {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 4;
  display: inline-flex;
  gap: 4px;
  align-items: center;
  padding: 4px 8px;
  color: #04121d;
  background:
    linear-gradient(135deg, rgba(134, 246, 231, 0.96), rgba(79, 223, 157, 0.92));
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: 999px;
  box-shadow:
    0 8px 22px rgba(25, 246, 183, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0;
}

.sound-ribbon span {
  display: inline-grid;
  width: 16px;
  height: 16px;
  place-items: center;
  color: #eafffa;
  background: rgba(7, 20, 36, 0.84);
  border-radius: 50%;
  font-size: 11px;
}

.product-preview-panel {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  z-index: 20;
  aspect-ratio: 750 / 1624;
  overflow: hidden;
  padding: 0;
  color: inherit;
  background: #050713;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.48);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px);
  transition:
    opacity 160ms ease,
    transform 160ms ease;
}

.product-preview-panel::after {
  position: absolute;
  inset: auto 0 0;
  z-index: 3;
  height: 30%;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.82));
  content: "";
}

.product-card:hover .product-preview-panel {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.preview-video-hitarea {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  overflow: hidden;
  background: #050713;
  border: 0;
  cursor: pointer;
}

.preview-action-bar {
  position: absolute;
  right: 14px;
  bottom: 16px;
  left: 14px;
  z-index: 4;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  opacity: 0;
  transform: translateY(8px);
  transition:
    opacity 160ms ease,
    transform 160ms ease;
}

.product-card:hover .preview-action-bar {
  opacity: 1;
  transform: translateY(0);
}

.preview-add-button,
.preview-detail-button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.preview-add-button {
  color: #10162f;
  background: var(--green);
  box-shadow: 0 10px 22px rgba(85, 228, 154, 0.2);
}

.preview-detail-button {
  color: #fff;
  background: #1976ff;
  box-shadow: 0 10px 22px rgba(25, 118, 255, 0.22);
}

.preview-add-button:disabled {
  color: rgba(255, 255, 255, 0.76);
  background: rgba(255, 255, 255, 0.16);
  cursor: default;
  box-shadow: none;
}

.preview-detail-button::before {
  width: 14px;
  height: 14px;
  background: currentColor;
  clip-path: polygon(20% 12%, 88% 50%, 20% 88%);
  content: "";
}

.product-body {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 14px 16px 18px;
  background: linear-gradient(180deg, rgba(9, 13, 29, 0.94), rgba(8, 11, 26, 0.98));
  border-top: 1px solid rgba(165, 180, 220, 0.08);
  border-radius: 0 0 8px 8px;
}

.title-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: start;
  min-width: 0;
}

.product-body h3 {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  color: #fff;
  font-size: 18px;
  font-weight: 900;
  line-height: 1.18;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.asset-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
}

.asset-meta span {
  padding: 4px 7px;
  color: #98a3bd;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(165, 180, 220, 0.08);
  border-radius: 6px;
  font-size: 12px;
  line-height: 1;
}

.price {
  display: inline-flex;
  align-items: baseline;
  gap: 1px;
  color: #c6c9d2;
  font-size: 22px;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

.price small {
  color: #8f98b1;
  font-size: 13px;
  font-weight: 900;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-start;
}

.tag-list span {
  padding: 4px 9px;
  color: #f0f3ff;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.tag-list .tag-hot {
  color: #111630;
  background: var(--orange);
}

.order-panel {
  display: grid;
  grid-template-columns: 1fr 2fr auto;
  gap: 20px;
  align-items: center;
  margin-top: 10px;
  padding: 18px;
  color: #fff;
  background: rgba(10, 14, 32, 0.78);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.order-panel h2,
.order-panel p,
.order-panel ol {
  margin-bottom: 0;
}

.order-panel ol {
  display: flex;
  gap: 18px;
  padding-left: 20px;
  color: rgba(255, 255, 255, 0.78);
}

.preview-dialog {
  width: min(940px, calc(100vw - 112px));
  max-height: calc(100vh - 96px);
  padding: 0;
  overflow: hidden;
  color: #f5f7ff;
  background: #090d1d;
  border: 1px solid rgba(165, 180, 220, 0.18);
  border-radius: 8px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.44);
}

.preview-dialog::backdrop {
  background: rgba(6, 9, 22, 0.76);
  backdrop-filter: blur(8px);
}

.close-button {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  width: 38px;
  height: 38px;
  color: #fff;
  background: rgba(255, 255, 255, 0.13);
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  font-size: 26px;
  line-height: 1;
}

.preview-dialog[open] {
  display: grid;
  grid-template-columns: minmax(280px, 40%) 1fr;
}

.dialog-media {
  min-height: 560px;
  aspect-ratio: 720 / 1280;
  background: #06080d;
}

.dialog-media video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.dialog-detail {
  display: grid;
  align-content: center;
  gap: 16px;
  padding: 28px;
  color: #f5f7ff;
  background: linear-gradient(135deg, #151b32, #0d1226);
  border-left: 1px solid rgba(165, 180, 220, 0.16);
}

.dialog-detail h2 {
  margin-bottom: 0;
  color: #fff;
  font-size: 34px;
}

.dialog-detail p {
  color: #a4aec8;
}

.dialog-detail dl {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin: 0;
}

.dialog-detail dl div {
  padding: 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(165, 180, 220, 0.16);
  border-radius: 8px;
}

.dialog-detail dt {
  color: #9aa4c0;
  font-size: 12px;
}

.dialog-detail dd {
  margin: 4px 0 0;
  color: #fff;
  font-weight: 800;
}

.dialog-actions {
  display: flex;
  gap: 10px;
}

.dialog-status {
  min-height: 20px;
  margin: 0;
  color: var(--green);
  font-size: 13px;
  font-weight: 800;
}

.cart-backdrop {
  position: fixed;
  inset: 0;
  z-index: 28;
  background: rgba(4, 7, 18, 0.58);
  backdrop-filter: blur(4px);
}

.cart-backdrop[hidden] {
  display: none;
}

.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 29;
  display: grid;
  grid-template-rows: auto 1fr auto;
  width: min(420px, calc(100vw - 18px));
  height: 100vh;
  padding: 20px;
  color: #f5f7ff;
  background:
    radial-gradient(circle at 80% 4%, rgba(85, 228, 154, 0.14), transparent 18rem),
    linear-gradient(180deg, #151b33, #080c1d);
  border-left: 1px solid rgba(165, 180, 220, 0.18);
  box-shadow: -24px 0 70px rgba(0, 0, 0, 0.36);
  transform: translateX(110%);
  transition: transform 180ms ease;
}

.cart-drawer.is-open {
  transform: translateX(0);
}

.cart-head {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: start;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.cart-head h2 {
  margin: 0;
  font-size: 26px;
}

.cart-close {
  position: static;
  flex: 0 0 auto;
}

.cart-empty {
  align-self: start;
  margin: 16px 0 0;
  padding: 14px;
  color: #aab3cd;
  background: rgba(255, 255, 255, 0.05);
  border: 1px dashed rgba(165, 180, 220, 0.2);
  border-radius: 8px;
}

.cart-empty[hidden] {
  display: none;
}

.cart-list {
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 0;
  padding: 16px 2px 16px 0;
  overflow: auto;
}

.cart-item {
  display: grid;
  grid-template-columns: 58px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(165, 180, 220, 0.12);
  border-radius: 8px;
}

.cart-item img {
  width: 58px;
  height: 58px;
  object-fit: cover;
  border-radius: 6px;
}

.cart-item-main {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.cart-item-main strong {
  overflow: hidden;
  color: #fff;
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cart-item-meta {
  overflow: hidden;
  color: #9aa4c0;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cart-item-side {
  display: grid;
  gap: 8px;
  justify-items: end;
}

.cart-item-price {
  color: var(--green);
  font-weight: 900;
}

.cart-remove {
  min-height: 28px;
  padding: 0 9px;
  color: #dce4ff;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(165, 180, 220, 0.14);
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}

.cart-remove:hover {
  color: #fff;
  border-color: rgba(239, 92, 111, 0.52);
}

.cart-footer {
  display: grid;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.cart-summary {
  margin: 0;
  color: #fff;
  font-size: 18px;
  font-weight: 900;
}

.cart-actions {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}

.cart-status {
  min-height: 18px;
  margin: 0;
  color: var(--green);
  font-size: 13px;
  font-weight: 800;
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: center;
  padding: 26px 16px 38px;
  color: var(--muted);
  font-size: 14px;
}

@media (max-width: 900px) {
  .topbar {
    grid-template-columns: 1fr auto auto;
  }

  .topnav {
    display: none;
  }

  .console-head,
  .order-panel,
  .preview-dialog[open],
  .console-search {
    grid-template-columns: 1fr;
  }

  .market-stats,
  .order-panel ol {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-line {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .dialog-media {
    min-height: 420px;
  }

  .cart-actions {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  main {
    width: min(100vw - 20px, 1340px);
    padding-top: 12px;
  }

  .topbar {
    padding: 12px 10px;
  }

  .brand small,
  .xianyu-link {
    display: none;
  }

  .cart-toggle {
    min-height: 36px;
    padding: 0 10px;
    font-size: 13px;
  }

  h1 {
    font-size: 26px;
  }

  .dialog-media {
    min-height: 360px;
  }
}
