:root {
  --ink: #172026;
  --muted: #64727f;
  --line: #dfe7eb;
  --paper: #ffffff;
  --soft: #f4f7f8;
  --teal: #007f78;
  --teal-dark: #00645f;
  --gold: #d8941f;
  --red: #cc3d3d;
  --blue: #2d6cdf;
  --shadow: 0 18px 50px rgba(22, 42, 52, 0.16);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  font-family:
    "Microsoft YaHei", "PingFang SC", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--paper);
}

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

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

button {
  cursor: pointer;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  color: #fff;
  background: rgba(11, 24, 28, 0.94);
  backdrop-filter: blur(18px);
}

.topbar__inner,
.hero__inner,
.quick-band__inner,
.section,
.split-section,
.notice-band,
.footer {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  gap: 28px;
}

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

.brand__mark {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 8px;
  color: #10201f;
  font-weight: 900;
  background: linear-gradient(135deg, #f4c15d, #33c5b8);
}

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

.brand small {
  margin-top: 2px;
  color: #b9c9cf;
  font-size: 11px;
  letter-spacing: 0;
}

.nav {
  display: flex;
  flex: 1;
  justify-content: center;
  gap: 24px;
  color: #d7e6e9;
  font-size: 15px;
}

.nav a:hover {
  color: #fff;
}

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

.primary-btn,
.ghost-btn,
.search-btn,
.chip,
.game-link,
.icon-btn {
  min-height: 38px;
  border: 0;
  border-radius: 8px;
}

.primary-btn {
  padding: 0 18px;
  color: #071f1d;
  font-weight: 800;
  background: linear-gradient(135deg, #f6be53, #42d1bd);
}

.ghost-btn {
  padding: 0 16px;
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.ghost-btn--dark {
  color: var(--ink);
  background: #edf3f4;
}

.hero {
  position: relative;
  min-height: 640px;
  overflow: hidden;
  color: #fff;
  background: #0b181c;
}

.hero__art,
.hero__shade {
  position: absolute;
  inset: 0;
}

.hero__art {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.hero__shade {
  background:
    linear-gradient(90deg, rgba(8, 20, 24, 0.98) 0%, rgba(8, 20, 24, 0.88) 42%, rgba(8, 20, 24, 0.42) 100%),
    linear-gradient(180deg, rgba(8, 20, 24, 0.2), rgba(8, 20, 24, 0.88));
}

.hero__inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 460px;
  gap: 44px;
  align-items: center;
  min-height: 640px;
  padding: 46px 0 64px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--gold);
  font-size: 13px;
  font-weight: 900;
}

.hero h1 {
  max-width: 660px;
  margin: 0;
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1.08;
  letter-spacing: 0;
}

.hero__lead {
  max-width: 610px;
  margin: 22px 0 0;
  color: #d5e4e7;
  font-size: 18px;
  line-height: 1.8;
}

.hero__stats {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.hero__stats span {
  display: inline-flex;
  flex-direction: column;
  min-width: 128px;
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
}

.hero__stats strong {
  margin-bottom: 4px;
  color: #fff;
  font-size: 24px;
}

.search-panel {
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(247, 251, 251, 0.96);
  box-shadow: var(--shadow);
  color: var(--ink);
}

.segmented {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 4px;
  border-radius: 8px;
  background: #e9eff1;
}

.segmented button {
  min-height: 40px;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  font-weight: 800;
  background: transparent;
}

.segmented .is-active {
  color: #fff;
  background: var(--teal);
}

.search-grid,
.modal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.search-grid {
  margin-top: 18px;
}

label span {
  display: block;
  margin-bottom: 7px;
  color: #52616c;
  font-size: 13px;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--ink);
  background: #fff;
}

textarea {
  padding-top: 10px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  outline: 3px solid rgba(0, 127, 120, 0.18);
  border-color: var(--teal);
}

.query-field {
  grid-column: span 2;
}

.search-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin-top: 18px;
  color: #fff;
  font-weight: 900;
  background: var(--teal);
}

.quick-band {
  background: #102429;
  color: #fff;
}

.quick-band__inner {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: rgba(255, 255, 255, 0.1);
}

.quick-band a {
  display: flex;
  min-height: 98px;
  flex-direction: column;
  justify-content: center;
  padding: 18px;
  background: #102429;
}

.quick-band strong {
  font-size: 18px;
}

.quick-band span {
  margin-top: 8px;
  color: #b8cace;
  font-size: 13px;
}

.section {
  padding: 76px 0;
}

.section__head,
.listing-toolbar,
.dashboard__head,
.modal__head,
.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

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

.section h2,
.split-section h2,
.notice-band h2 {
  margin-bottom: 0;
  font-size: clamp(26px, 3vw, 38px);
  letter-spacing: 0;
}

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

.chip {
  padding: 0 14px;
  color: var(--muted);
  font-weight: 800;
  background: #edf3f4;
}

.chip.is-active {
  color: #fff;
  background: var(--teal);
}

.market-layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 24px;
  margin-top: 28px;
}

.game-list {
  align-self: start;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.game-list h3 {
  margin-bottom: 14px;
}

.game-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-top: 8px;
  padding: 0 12px;
  color: #52616c;
  text-align: left;
  background: #f5f8f9;
}

.game-link span {
  color: #91a0a8;
  font-size: 12px;
}

.game-link.is-active {
  color: #fff;
  background: var(--teal);
}

.game-link.is-active span {
  color: #dcf6f4;
}

.listing-toolbar {
  min-height: 44px;
  margin-bottom: 16px;
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-weight: 800;
}

.toggle span {
  margin: 0;
}

.toggle input {
  width: 18px;
  min-height: 18px;
}

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

.listing-card {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 14px;
  min-height: 190px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    border-color 0.2s ease;
}

.listing-card:hover {
  transform: translateY(-2px);
  border-color: rgba(0, 127, 120, 0.35);
  box-shadow: 0 14px 34px rgba(30, 55, 62, 0.12);
}

.listing-badge {
  display: grid;
  width: 72px;
  height: 72px;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  font-size: 28px;
  font-weight: 900;
  background: linear-gradient(135deg, var(--teal), var(--blue));
}

.listing-card h3 {
  margin: 0 0 8px;
  overflow-wrap: anywhere;
  font-size: 17px;
}

.listing-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.listing-meta span {
  padding: 4px 7px;
  border-radius: 6px;
  color: #53636e;
  font-size: 12px;
  font-weight: 800;
  background: #eef3f4;
}

.listing-foot {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
}

.price {
  color: var(--red);
  font-size: 24px;
  font-weight: 900;
}

.seller {
  color: var(--muted);
  font-size: 13px;
}

.buy-btn {
  min-width: 88px;
  min-height: 36px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  font-weight: 900;
  background: var(--teal);
}

.split-section {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: 24px;
  padding: 74px 0;
}

.sell-panel {
  padding: 34px;
  border-radius: 8px;
  color: #fff;
  background: #0d3032;
}

.sell-panel p {
  color: #d6e5e6;
  line-height: 1.8;
}

.sell-steps {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin: 24px 0;
}

.sell-steps span {
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
}

.dashboard {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.dashboard canvas {
  display: block;
  width: 100%;
  height: auto;
  margin-top: 10px;
}

.ticker {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.ticker span {
  padding: 8px 10px;
  border-radius: 7px;
  color: #32535b;
  font-size: 13px;
  font-weight: 800;
  background: #edf5f5;
}

.order-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 28px;
}

.order-card {
  min-height: 220px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.order-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.order-card__head span {
  padding: 5px 8px;
  border-radius: 6px;
  color: #0d4d49;
  font-size: 12px;
  font-weight: 900;
  background: #dff4f1;
}

.order-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.section--soft {
  width: 100%;
  max-width: none;
  padding-right: max(16px, calc((100% - 1180px) / 2));
  padding-left: max(16px, calc((100% - 1180px) / 2));
  background: var(--soft);
}

.service-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-top: 28px;
}

.service-grid article {
  min-height: 210px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.service-icon {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  margin-bottom: 18px;
  border-radius: 8px;
  color: #fff;
  font-weight: 900;
  background: linear-gradient(135deg, var(--gold), var(--teal));
}

.service-grid p {
  color: var(--muted);
  line-height: 1.75;
}

.notice-band {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 24px;
  margin-top: 20px;
  margin-bottom: 70px;
  padding: 32px;
  border-radius: 8px;
  color: #fff;
  background: #20313b;
}

.notice-band ul {
  margin: 0;
  padding-left: 20px;
  color: #dbe7ea;
  line-height: 2;
}

.footer {
  min-height: 96px;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.footer strong,
.footer span {
  display: block;
}

.footer strong {
  margin-bottom: 5px;
  color: var(--ink);
}

.footer__links {
  display: flex;
  gap: 18px;
}

.footer__links a:hover {
  color: var(--teal);
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: none;
}

.modal.is-open {
  display: block;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 18, 22, 0.6);
}

.modal__panel {
  position: relative;
  width: min(560px, calc(100% - 28px));
  max-height: calc(100vh - 36px);
  margin: 18px auto;
  overflow: auto;
  padding: 22px;
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.modal__panel label {
  display: block;
  margin-top: 14px;
}

.form-tip {
  margin: 8px 0 0;
  padding: 10px 12px;
  border-radius: 8px;
  color: #52616c;
  font-size: 13px;
  line-height: 1.7;
  background: #f2f6f7;
}

.modal__head h2 {
  margin-bottom: 0;
}

.icon-btn {
  display: grid;
  width: 38px;
  place-items: center;
  color: #fff;
  font-size: 24px;
  background: #26343b;
}

.modal-submit {
  width: 100%;
  margin-top: 18px;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 50;
  max-width: min(360px, calc(100% - 36px));
  padding: 14px 16px;
  border-radius: 8px;
  color: #fff;
  background: #13282d;
  box-shadow: var(--shadow);
  transform: translateY(24px);
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
}

.toast.is-visible {
  transform: translateY(0);
  opacity: 1;
}

.admin-page {
  background: #f4f7f8;
}

.admin-locked .admin-protected,
.admin-locked .admin-nav a:not(:first-child) {
  display: none;
}

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

.admin-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 34px 0 70px;
}

.admin-login-screen {
  display: grid;
  min-height: calc(100vh - 150px);
  place-items: center;
}

.admin-login-card {
  width: min(440px, 100%);
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.admin-login-card h1 {
  margin: 0 0 10px;
  font-size: 32px;
  letter-spacing: 0;
}

.admin-login-card p {
  color: var(--muted);
  line-height: 1.7;
}

.admin-login-card label {
  display: block;
  margin-top: 14px;
}

.admin-login-card__link {
  display: block;
  margin-top: 14px;
  color: var(--teal);
  font-weight: 800;
  text-align: center;
}

.admin-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 24px;
  align-items: end;
  padding: 34px;
  border-radius: 8px;
  color: #fff;
  background: #13282d;
}

.admin-hero h1 {
  margin: 0 0 12px;
  font-size: clamp(30px, 4vw, 48px);
  letter-spacing: 0;
}

.admin-hero p {
  color: #d7e6e9;
}

.admin-login {
  padding: 18px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
}

.admin-login label {
  display: block;
  margin-bottom: 12px;
}

.admin-login label span {
  color: #d7e6e9;
}

.admin-metrics {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 14px;
  margin: 24px 0;
}

.admin-metrics article {
  min-height: 112px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.admin-metrics strong,
.admin-metrics span {
  display: block;
}

.admin-metrics strong {
  margin-bottom: 10px;
  color: var(--teal);
  font-size: 28px;
}

.admin-metrics span {
  color: var(--muted);
  font-weight: 800;
}

.admin-panel {
  margin-top: 22px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

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

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

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

.admin-table th {
  color: #52616c;
  font-size: 13px;
  background: #f5f8f9;
}

.mini-btn {
  min-height: 30px;
  margin: 2px;
  border: 0;
  border-radius: 7px;
  padding: 0 10px;
  color: #fff;
  font-weight: 800;
  background: var(--teal);
}

.mini-btn--danger {
  background: var(--red);
}

@media (max-width: 980px) {
  .topbar__inner {
    flex-wrap: wrap;
    padding: 12px 0;
  }

  .nav {
    order: 3;
    width: 100%;
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .hero__inner,
  .market-layout,
  .split-section,
  .notice-band {
    grid-template-columns: 1fr;
  }

  .hero__inner {
    min-height: auto;
    padding-top: 70px;
  }

  .search-panel {
    max-width: 620px;
  }

  .quick-band__inner,
  .service-grid,
  .order-grid,
  .admin-metrics {
    grid-template-columns: repeat(2, 1fr);
  }

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

  .game-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .game-list h3 {
    grid-column: 1 / -1;
  }

  .game-link {
    margin-top: 0;
  }
}

@media (max-width: 680px) {
  .top-actions {
    width: 100%;
  }

  .top-actions button {
    flex: 1;
  }

  .hero {
    min-height: auto;
  }

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

  .hero__lead {
    font-size: 16px;
  }

  .search-grid,
  .modal-grid,
  .listing-grid,
  .quick-band__inner,
  .service-grid,
  .sell-steps,
  .order-grid,
  .admin-metrics {
    grid-template-columns: 1fr;
  }

  .query-field {
    grid-column: auto;
  }

  .section__head,
  .listing-toolbar,
  .footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .game-list {
    grid-template-columns: 1fr;
  }

  .listing-card {
    grid-template-columns: 58px minmax(0, 1fr);
  }

  .listing-badge {
    width: 58px;
    height: 58px;
    font-size: 22px;
  }

  .listing-foot {
    align-items: flex-start;
    flex-direction: column;
  }
}
