:root {
  color-scheme: light;
  --bg: #eef2f6;
  --surface: #ffffff;
  --surface-soft: #f7f9fc;
  --line: #d7e0ea;
  --line-strong: #b8c6d5;
  --text: #102033;
  --muted: #617287;
  --blue: #2368b3;
  --blue-dark: #164f8f;
  --green: #17744b;
  --amber: #9a6100;
  --red: #b42318;
  --shadow: 0 16px 36px rgba(22, 43, 67, 0.10);
}

* {
  box-sizing: border-box;
}

html {
  font-family: Inter, "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
  color: var(--text);
  background:
    linear-gradient(140deg, rgba(35, 104, 179, 0.14), transparent 34%),
    linear-gradient(26deg, rgba(23, 116, 75, 0.10), transparent 28%),
    var(--bg);
  letter-spacing: 0;
}

body {
  margin: 0;
  min-width: 320px;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  width: min(1480px, calc(100% - 32px));
  margin: 0 auto;
  padding: 26px 0 48px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(360px, 520px);
  gap: 24px;
  align-items: stretch;
  margin-bottom: 16px;
}

.hero-copy {
  padding: 30px;
  color: #fff;
  background:
    linear-gradient(135deg, rgba(13, 30, 50, 0.92), rgba(28, 82, 129, 0.86)),
    url("https://ld5.res.netease.com/pc/zt/20260429201944/static/images/pc/bg-2.a57e1d1c0f270ccc082bf8f856c0ac4b.jpg") center / cover;
  box-shadow: var(--shadow);
  min-height: 188px;
}

.eyebrow {
  margin: 0 0 8px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 13px;
  font-weight: 800;
}

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

h1 {
  max-width: 8em;
  font-size: 42px;
  line-height: 1.05;
  font-weight: 900;
}

.hero-copy p:last-child {
  max-width: 560px;
  margin-top: 16px;
  color: rgba(255, 255, 255, 0.82);
  line-height: 1.6;
}

h2 {
  font-size: 20px;
  line-height: 1.3;
  font-weight: 900;
}

h3 {
  font-size: 16px;
  line-height: 1.3;
  font-weight: 900;
}

.status-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
}

.status-strip > div {
  display: grid;
  align-content: center;
  min-height: 120px;
  padding: 18px 20px;
  border-right: 1px solid var(--line);
}

.status-strip > div:last-child {
  border-right: 0;
}

.status-strip span {
  display: block;
  font-size: 34px;
  line-height: 1;
  font-weight: 900;
}

.status-strip small {
  margin-top: 10px;
  color: var(--muted);
}

.submit-panel,
.filter-panel {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.submit-panel {
  display: grid;
  grid-template-columns: minmax(240px, 340px) 1fr;
  gap: 24px;
  align-items: end;
  padding: 20px;
  margin-bottom: 16px;
}

.submit-panel p,
.filter-head p {
  margin-top: 7px;
  color: var(--muted);
  line-height: 1.5;
}

.submit-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: end;
}

label,
.input-wrap {
  display: grid;
  gap: 8px;
}

label span,
.input-wrap span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

textarea {
  width: 100%;
  min-height: 86px;
  max-height: 180px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 12px 13px;
  color: var(--text);
  background: #fff;
  outline: none;
  resize: vertical;
}

textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(35, 104, 179, 0.14);
}

.primary-btn,
.secondary-btn,
.link-btn,
.text-btn {
  min-height: 44px;
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 10px 15px;
  font-weight: 900;
  text-decoration: none;
  text-align: center;
  white-space: nowrap;
}

.primary-btn,
.link-btn {
  color: #fff;
  background: var(--blue);
}

.primary-btn:hover,
.link-btn:hover {
  background: var(--blue-dark);
}

.secondary-btn,
.text-btn {
  color: var(--text);
  background: #fff;
  border-color: var(--line-strong);
}

.secondary-btn:hover,
.text-btn:hover {
  border-color: var(--blue);
}

.filter-panel {
  padding: 16px;
  margin-bottom: 14px;
}

.filter-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}

.filter-tools {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.toggle-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  white-space: nowrap;
}

.toggle-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--blue);
}

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

.card-selector {
  min-width: 0;
  border: 1px solid var(--line);
  background: var(--surface-soft);
}

.selector-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 13px 14px 0;
}

.selector-title span {
  color: var(--blue);
  font-weight: 900;
}

.selection-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 34px;
  padding: 10px 14px 12px;
  color: var(--muted);
  font-size: 13px;
}

.selection-summary span {
  padding: 4px 8px;
  border-radius: 999px;
  color: var(--text);
  background: #e9f1fb;
}

.region-list {
  display: grid;
  gap: 10px;
  padding: 0 12px 12px;
}

.region-group {
  border: 1px solid color-mix(in srgb, var(--region-color), white 68%);
  background: color-mix(in srgb, var(--region-color), white 92%);
}

.region-group summary {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  list-style: none;
  cursor: pointer;
  border-left: 5px solid var(--region-color);
}

.region-group summary::-webkit-details-marker {
  display: none;
}

.region-group summary span {
  font-weight: 900;
}

.region-group summary small {
  color: var(--muted);
  font-weight: 800;
}

.team-stack {
  display: grid;
  gap: 8px;
  padding: 0 10px 10px;
}

.team-row {
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: 10px;
  align-items: center;
  padding: 10px;
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid rgba(255, 255, 255, 0.88);
}

.team-name {
  color: var(--text);
  font-size: 13px;
  line-height: 1.25;
  font-weight: 900;
}

.mini-card-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(54px, 1fr));
  gap: 7px;
  min-width: 0;
}

.mini-card {
  display: grid;
  gap: 5px;
  justify-items: center;
  min-width: 0;
  min-height: 104px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 4px;
  color: var(--text);
  background: #fff;
}

.mini-card:hover {
  border-color: var(--region-color);
  transform: translateY(-1px);
}

.mini-card.selected {
  border-color: var(--region-color);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--region-color), transparent 78%);
}

.mini-card img {
  width: 46px;
  height: 64px;
  object-fit: cover;
  object-position: top center;
  border-radius: 4px;
}

.mini-card span {
  max-width: 100%;
  color: var(--text);
  font-size: 11px;
  line-height: 1.1;
  font-weight: 800;
  text-align: center;
  overflow-wrap: anywhere;
}

.team-placeholder,
.region-empty {
  color: var(--muted);
  font-size: 13px;
}

.region-empty {
  padding: 8px 10px;
}

.notice {
  min-height: 24px;
  margin: 8px 0 12px;
  color: var(--muted);
  font-size: 14px;
}

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

.trade-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 14px;
}

.trade-card {
  display: grid;
  gap: 14px;
  min-width: 0;
  padding: 15px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.trade-card.expired {
  background: #eef1f4;
  color: #6a7480;
}

.trade-card.expired .card-visual img,
.trade-card.expired .link-btn {
  filter: grayscale(1);
  opacity: 0.6;
}

.trade-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.player {
  min-width: 0;
}

.player strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 280px;
}

.player small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

.badge {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 900;
  background: #e8f2ec;
  color: var(--green);
}

.badge.checking {
  background: #fff6df;
  color: var(--amber);
}

.badge.expired {
  background: #f3d7d4;
  color: var(--red);
}

.swap-row {
  display: grid;
  grid-template-columns: 1fr 38px 1fr;
  align-items: center;
  gap: 10px;
}

.card-visual {
  display: grid;
  justify-items: center;
  gap: 8px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
}

.card-visual img {
  width: 94px;
  height: 132px;
  object-fit: cover;
  object-position: top center;
  display: block;
}

.card-visual h3 {
  max-width: 100%;
  font-size: 16px;
  text-align: center;
  overflow-wrap: anywhere;
}

.card-visual p {
  max-width: 100%;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  text-align: center;
  overflow-wrap: anywhere;
}

.swap-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #e7f0fb;
  color: var(--blue);
  font-size: 18px;
  font-weight: 900;
}

.compat-line {
  padding: 10px 12px;
  color: var(--muted);
  background: #f3f7fb;
  border: 1px solid var(--line);
  font-size: 13px;
}

.compat-line strong {
  color: var(--text);
}

.trade-actions {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  align-items: center;
}

.trade-actions .link-btn.disabled {
  pointer-events: none;
  background: #9aa4af;
}

.text-btn[disabled] {
  cursor: not-allowed;
  opacity: 0.65;
}

.token-line {
  color: var(--muted);
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.image-placeholder {
  display: grid;
  place-items: center;
  width: 94px;
  height: 132px;
  color: var(--muted);
  border: 1px dashed var(--line-strong);
  background: #fff;
  font-weight: 900;
}

.empty-state {
  display: grid;
  gap: 8px;
  place-items: center;
  min-height: 220px;
  border: 1px dashed var(--line-strong);
  background: var(--surface);
  color: var(--muted);
}

.empty-state h2 {
  color: var(--text);
}

@media (max-width: 1120px) {
  .hero,
  .submit-panel,
  .submit-form,
  .selector-grid {
    grid-template-columns: 1fr;
  }

  .status-strip {
    width: 100%;
  }
}

@media (max-width: 760px) {
  .app-shell {
    width: min(100% - 20px, 1480px);
    padding-top: 16px;
  }

  .hero-copy {
    padding: 22px;
  }

  h1 {
    font-size: 34px;
  }

  .status-strip {
    grid-template-columns: 1fr;
  }

  .status-strip > div {
    min-height: 82px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .status-strip > div:last-child {
    border-bottom: 0;
  }

  .filter-head,
  .filter-tools {
    display: grid;
  }

  .team-row {
    grid-template-columns: 1fr;
  }

  .mini-card-grid {
    grid-template-columns: repeat(4, minmax(56px, 1fr));
  }

  .trade-grid,
  .swap-row,
  .trade-actions {
    grid-template-columns: 1fr;
  }

  .swap-icon {
    justify-self: center;
    transform: rotate(90deg);
  }
}
