.exchange-hero {
  min-height: 330px;
  background:
    linear-gradient(90deg, rgba(5, 8, 8, .96) 0%, rgba(5, 8, 8, .78) 50%, rgba(5, 8, 8, .42) 100%),
    url("./assets/combat.jpg") center 54% / cover no-repeat;
}

.exchange-hero h1 {
  font-size: clamp(44px, 6vw, 72px);
  letter-spacing: 0;
}

.exchange-hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  margin-top: 24px;
  color: #d8ddda;
  font-size: 13px;
}

.exchange-hero-stats strong { color: #fff1c9; }

.exchange-main { padding-top: 28px; }
.exchange-inner { max-width: 1320px; }

.exchange-rules {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--line-strong);
  background: rgba(12, 17, 16, .94);
}

.exchange-rules > div {
  min-width: 0;
  padding: 18px 20px;
  border-right: 1px solid var(--line);
}

.exchange-rules > div:last-child { border-right: 0; }
.exchange-rules strong,
.exchange-rules span { display: block; }
.exchange-rules strong { color: #fff0cd; font-size: 14px; }
.exchange-rules span { margin-top: 6px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.exchange-rules .source-rule strong { color: #a8dec9; }

.exchange-toolbar {
  position: sticky;
  top: 74px;
  z-index: 10;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  margin-top: 18px;
  border: 1px solid var(--line-strong);
  background: rgba(7, 10, 11, .96);
  box-shadow: 0 12px 28px rgba(0, 0, 0, .26);
  padding: 12px;
}

.exchange-category-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.exchange-category-tabs button,
.exchange-summary button {
  border: 1px solid var(--line);
  border-radius: 4px;
  background: rgba(236, 230, 203, .035);
  color: #c8cec8;
  font: 800 13px/1 "Segoe UI", "Microsoft YaHei", sans-serif;
  cursor: pointer;
}

.exchange-category-tabs button {
  height: 40px;
  padding: 0 14px;
  white-space: nowrap;
}

.exchange-category-tabs button:hover { border-color: rgba(208, 183, 102, .52); color: #fff0cd; }
.exchange-category-tabs button.active { border-color: var(--gold); background: var(--gold); color: #15130d; }

.exchange-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 430px;
}

.exchange-search {
  display: flex;
  align-items: center;
  flex: 1 1 280px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: rgba(4, 6, 6, .55);
  padding: 0 12px;
}

.exchange-search span { color: var(--gold-2); font-size: 12px; font-weight: 900; }
.exchange-search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font: 600 13px/1.2 "Segoe UI", "Microsoft YaHei", sans-serif;
  padding: 0 0 0 10px;
}
.exchange-search input::placeholder { color: #78817a; }

.exchange-select {
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 4px;
  outline: 0;
  background: #101513;
  color: #e9e3d0;
  font-weight: 800;
  padding: 0 34px 0 12px;
}

.exchange-summary {
  display: flex;
  align-items: baseline;
  gap: 7px;
  min-height: 54px;
  padding: 15px 4px 9px;
  color: var(--muted);
  font-size: 13px;
}
.exchange-summary strong { color: var(--gold-2); font-size: 24px; }
.exchange-summary button { margin-left: auto; min-height: 32px; padding: 0 11px; }
.exchange-summary button:hover { color: #fff0cd; border-color: rgba(208, 183, 102, .52); }

.exchange-list { display: block; }

.exchange-group + .exchange-group { margin-top: 34px; }

.exchange-group-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--line-strong);
  padding: 0 2px 11px;
}

.exchange-group-head h2 {
  margin: 0;
  color: #fff0cd;
  font-size: 24px;
  letter-spacing: 0;
}

.exchange-group-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

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

.exchange-card {
  --category-accent: #d0b766;
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-width: 0;
  min-height: 250px;
  border: 1px solid var(--line);
  border-top: 3px solid var(--category-accent);
  border-radius: 6px;
  background: linear-gradient(180deg, rgba(19, 25, 23, .97), rgba(9, 13, 12, .99));
  box-shadow: 0 14px 34px rgba(0, 0, 0, .24);
  overflow: hidden;
}

.exchange-card[data-category="sniper"] { --category-accent: #d0b766; }
.exchange-card[data-category="armor"] { --category-accent: #70b79f; }
.exchange-card[data-category="keycard"] { --category-accent: #d8796d; }
.exchange-card[data-category="explosive"] { --category-accent: #d99155; }
.exchange-card[data-category="hideout"] { --category-accent: #7fa7cf; }

.exchange-card:hover { border-color: color-mix(in srgb, var(--category-accent) 54%, transparent); }

.exchange-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 19px 20px 16px;
  border-bottom: 1px solid rgba(236, 230, 203, .1);
}

.exchange-card-title { min-width: 0; }
.exchange-card-title h3 {
  margin: 0;
  color: #fff2d3;
  font-size: 20px;
  line-height: 1.35;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.exchange-card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px 10px;
  margin-top: 9px;
}

.exchange-category-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border: 1px solid color-mix(in srgb, var(--category-accent) 50%, transparent);
  border-radius: 3px;
  background: color-mix(in srgb, var(--category-accent) 12%, transparent);
  color: var(--category-accent);
  font-size: 11px;
  font-weight: 900;
  padding: 0 7px;
}

.exchange-task-id {
  color: #7f8d84;
  font: 800 11px/1.3 Consolas, monospace;
}

.exchange-limit {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 58px;
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0 9px;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}
.exchange-limit.daily { border-color: rgba(108, 181, 158, .5); color: #a5dfca; background: rgba(50, 112, 94, .13); }
.exchange-limit.weekly { border-color: rgba(208, 183, 102, .52); color: #f1d989; background: rgba(142, 112, 42, .14); }
.exchange-limit.repeat { border-color: rgba(152, 162, 190, .38); color: #c6cbe0; background: rgba(95, 104, 135, .12); }

.exchange-materials { min-width: 0; padding: 17px 20px 18px; }
.exchange-materials-label {
  display: block;
  margin-bottom: 10px;
  color: #9ba69f;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .08em;
}

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

.exchange-material {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  min-width: 0;
  min-height: 40px;
  border: 1px solid rgba(236, 230, 203, .1);
  border-radius: 4px;
  background: rgba(236, 230, 203, .035);
  padding: 8px 10px;
}
.exchange-material span { min-width: 0; color: #d9ddd7; font-size: 12px; line-height: 1.35; overflow-wrap: anywhere; }
.exchange-material strong { color: #fff0cd; font-size: 13px; white-space: nowrap; }
.exchange-material.btc { border-color: rgba(218, 181, 71, .34); background: rgba(157, 119, 28, .12); }
.exchange-material.btc span,
.exchange-material.btc strong { color: #f3d978; }
.exchange-material.moonshine { border-color: rgba(127, 167, 207, .35); background: rgba(62, 100, 138, .13); }
.exchange-material.moonshine span,
.exchange-material.moonshine strong { color: #aed0ed; }
.exchange-material.cash { border-color: rgba(112, 183, 159, .34); background: rgba(48, 111, 90, .12); }
.exchange-material.cash span,
.exchange-material.cash strong { color: #a8dec9; }

.exchange-card-note {
  min-height: 44px;
  margin: 0;
  border-top: 1px solid rgba(236, 230, 203, .08);
  color: #9dad9f;
  font-size: 12px;
  line-height: 1.5;
  padding: 12px 20px;
}
.exchange-card-note:empty::before { content: "按任务奖励直接领取"; color: #707c74; }

.exchange-empty {
  border: 1px dashed var(--line-strong);
  border-radius: 6px;
  padding: 42px 20px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 1080px) {
  .exchange-toolbar { grid-template-columns: 1fr; }
  .exchange-category-tabs { overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
  .exchange-category-tabs::-webkit-scrollbar { display: none; }
  .exchange-tools { min-width: 0; width: 100%; }
}

@media (max-width: 820px) {
  .exchange-hero { min-height: 290px; background-position: 62% center; }
  .exchange-main { padding: 16px 14px 58px; }
  .exchange-rules { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .exchange-rules > div { border-bottom: 1px solid var(--line); }
  .exchange-rules > div:nth-child(2) { border-right: 0; }
  .exchange-rules > div:nth-child(n+3) { border-bottom: 0; }
  .exchange-toolbar { top: 106px; }
  .exchange-card-grid { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .exchange-hero-stats { display: grid; gap: 6px; }
  .exchange-rules { grid-template-columns: 1fr; }
  .exchange-rules > div { border-right: 0; border-bottom: 1px solid var(--line); }
  .exchange-rules > div:nth-child(n+3) { border-bottom: 1px solid var(--line); }
  .exchange-rules > div:last-child { border-bottom: 0; }
  .exchange-tools { display: grid; grid-template-columns: minmax(0, 1fr) 112px; }
  .exchange-search { padding: 0 10px; }
  .exchange-search span { display: none; }
  .exchange-search input { padding-left: 0; }
  .exchange-card { min-height: 0; }
  .exchange-card-head { padding: 16px; }
  .exchange-card-title h3 { font-size: 18px; }
  .exchange-materials { padding: 15px 16px 16px; }
  .exchange-material-grid { grid-template-columns: 1fr; }
  .exchange-card-note { padding: 11px 16px; }
}
