
/* ============================================================================
   2026-09-30 商人页改版：optarkov 商人面板信息架构 + lightsns 配色（11 个商人页统一）
   作用域：body.tfshop-page（由 generate_trader_pages.js 产出的商人页）。
   令牌与 template/pc/skin/css/home-lightsns.css 同源（.local/lightsns-ref/vars.json）：
   底色 #f5f6f7 / 白卡 / 主色 #3b82f6（hover #2563eb）/ 文字 #1f2937·#606060·#909090
   / 分隔线 #e5e7eb·#f3f4f6 / 圆角 10px。卡片投影用项目验证过的描边阴影
   （官方 xs 阴影在 #f5f6f7 上不可见）。
   2026-09-30 全量统一后，旧的 .tftrader-* 样式与生成器里的旧常量已整体删除。
   ============================================================================ */

.tfshop-page {
  --tfshop-card: #fff;
  --tfshop-line: #e5e7eb;
  --tfshop-line-soft: #f3f4f6;
  --tfshop-ink: #1f2937;
  --tfshop-muted: #606060;
  /* 2026-10-05 对比度修复：#909090 在 #f5f6f7/#f8fafc/#eff6ff 上只有 2.9-3.2:1（AA 需 4.5:1），
     改用同色系更深的 #68707d（4.6-5.0:1）。--tfshop-muted(#606060) 未变。 */
  --tfshop-dim: #68707d;
  --tfshop-blue: #3b82f6;
  --tfshop-blue-strong: #2563eb;
  --tfshop-blue-soft: #eff6ff;
  --tfshop-surface: #f8fafc;
  --tfshop-shadow: 0 1px 3px rgba(15, 23, 42, 0.07), 0 0 0 1px rgba(15, 23, 42, 0.045);
  background: #f5f6f7;
  color: var(--tfshop-ink);
  font-size: 14px;
  line-height: 1.6;
}

.tfshop-main {
  /* 2026-10-05 加宽：1200px → 1560px，让顶部 11 张商人卡片在桌面一屏全部显示 */
  width: min(1560px, calc(100% - 32px));
  margin: 0 auto;
  padding: 18px 0 56px;
}

.tfshop-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.tfshop-crumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 0 0 14px;
  font-size: 13px;
  color: var(--tfshop-muted);
}

.tfshop-crumb a {
  color: var(--tfshop-blue-strong);
  text-decoration: none;
}

.tfshop-crumb a:hover {
  color: #1d4ed8;
  text-decoration: underline;
}

.tfshop-crumb span {
  /* 分隔符原本 #c7ccd4（1.49:1），达不到 4.5:1，改用中性灰 */
  color: var(--tfshop-dim);
}

.tfshop-crumb strong {
  color: var(--tfshop-ink);
  font-weight: 600;
}

/* ---- 顶部商人切换条（optarkov 商人卡片行）：一行头像卡片 + 左右滚动箭头 ---- */
.tfshop-switcher {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px;
}

.tfshop-switcher__track {
  display: flex;
  flex: 1 1 auto;
  gap: 10px;
  min-width: 0;
  margin: 0;
  padding: 4px 2px;
  list-style: none;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.tfshop-switcher__track::-webkit-scrollbar {
  display: none;
}

.tfshop-switcher__track > li {
  /* 桌面均分整行：11 张卡片按可用宽度伸缩，窄屏低于 min-width 时退回横向滚动 */
  display: flex;
  flex: 1 1 92px;
  min-width: 92px;
  max-width: 132px;
  scroll-snap-align: start;
}

.tfshop-tradercard {
  display: flex;
  height: 100%;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  box-sizing: border-box;
  width: 100%;
  padding: 10px 8px;
  border: 1px solid var(--tfshop-line);
  border-radius: 12px;
  background: #fff;
  color: inherit;
  text-decoration: none;
  transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.tfshop-tradercard:hover {
  border-color: rgba(59, 130, 246, 0.35);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
  transform: translateY(-1px);
}

.tfshop-tradercard__img {
  width: 64px;
  height: 64px;
  padding: 4px;
  border-radius: 10px;
  background: var(--tfshop-surface);
  object-fit: contain;
}

.tfshop-tradercard__name {
  max-width: 100%;
  overflow: hidden;
  font-size: 13px;
  font-weight: 600;
  color: var(--tfshop-ink);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tfshop-tradercard__en {
  max-width: 100%;
  overflow: hidden;
  font-size: 11px;
  color: var(--tfshop-dim);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tfshop-tradercard.is-active {
  border-color: rgba(59, 130, 246, 0.45);
  background: var(--tfshop-blue-soft);
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.12);
}

.tfshop-tradercard.is-active .tfshop-tradercard__name {
  color: var(--tfshop-blue-strong);
}

.tfshop-switcher__arrow {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 32px;
  height: 32px;
  border: 1px solid var(--tfshop-line);
  border-radius: 999px;
  background: #fff;
  color: var(--tfshop-muted);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.tfshop-switcher__arrow:hover {
  border-color: rgba(59, 130, 246, 0.45);
  color: var(--tfshop-blue-strong);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08);
}

/* 无溢出或已到头时隐藏箭头（由页面脚本切换 hidden 属性）；无 JS 时箭头默认不显示，轨道仍可原生横向滚动 */
.tfshop-switcher__arrow[hidden] {
  display: none;
}

/* ---- 顶部商人面板：左横幅 + 右等级选择 ---- */
.tfshop-panel {
  margin-bottom: 16px;
  padding: 18px;
  border-radius: 12px;
  background: var(--tfshop-card);
  box-shadow: var(--tfshop-shadow);
}

.tfshop-panel__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 372px;
  gap: 16px;
  align-items: start;
}

.tfshop-banner {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 16px;
  border: 1px solid var(--tfshop-line-soft);
  border-radius: 12px;
  background: linear-gradient(135deg, #f6faff 0%, #fff 54%);
}

.tfshop-banner::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 10% 14%, rgba(59, 130, 246, 0.1), transparent 44%);
  pointer-events: none;
}

.tfshop-banner__top {
  position: relative;
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.tfshop-banner__portrait {
  flex: 0 0 104px;
  width: 104px;
  height: 104px;
  padding: 6px;
  border: 1px solid var(--tfshop-line);
  border-radius: 12px;
  background: #fff;
  object-fit: contain;
}

.tfshop-banner__body {
  min-width: 0;
}

.tfshop-kicker {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  /* 12px 小字用深一档的蓝：#3b82f6 在白底只有 3.68:1，#2563eb 为 5.17:1 */
  color: var(--tfshop-blue-strong);
}

.tfshop-title {
  margin: 0 0 8px;
  font-size: 26px;
  line-height: 1.25;
  color: var(--tfshop-ink);
}

.tfshop-lede {
  max-width: 640px;
  margin: 0 0 12px;
  font-size: 14px;
  color: var(--tfshop-muted);
}

.tfshop-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  padding: 5px 12px;
  border: 1px solid rgba(59, 130, 246, 0.28);
  border-radius: 999px;
  background: var(--tfshop-blue-soft);
  font-size: 12px;
  color: var(--tfshop-blue-strong);
}

.tfshop-pill i {
  font-style: normal;
  color: var(--tfshop-muted);
}

.tfshop-pill strong {
  font-size: 13px;
  font-weight: 700;
}

.tfshop-reqs {
  display: block;
}

.tfshop-reqs__set {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* 无 JS 时所有等级的门槛 chip 依次展示（与售卖区堆叠的降级一致）；有 JS 时只显示当前等级 */
.js .tfshop-reqs__set {
  display: none;
}

.js .tfshop-reqs__set.is-active {
  display: flex;
}

.tfshop-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 5px 10px;
  border: 1px solid var(--tfshop-line);
  border-radius: 8px;
  background: var(--tfshop-surface);
  font-size: 12px;
  color: var(--tfshop-muted);
}

.tfshop-chip b {
  font-size: 13px;
  font-weight: 600;
  color: var(--tfshop-ink);
}

.tfshop-stats {
  position: relative;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  /* 面板高度由右侧等级面板决定：数据条用 auto 上边距贴住卡片底部，避免留出空洞 */
  margin: auto 0 0;
  padding: 12px 0 0;
  border-top: 1px solid var(--tfshop-line-soft);
}

.tfshop-stats div {
  padding: 0 12px;
  box-shadow: inset 1px 0 var(--tfshop-line-soft);
}

.tfshop-stats div:first-child {
  padding-left: 0;
  box-shadow: none;
}

.tfshop-stats dt {
  margin-bottom: 2px;
  font-size: 12px;
  color: var(--tfshop-dim);
}

.tfshop-stats dd {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--tfshop-ink);
}

/* ---- 等级选择面板（optarkov「选择等级」） ---- */
.tfshop-levels {
  padding: 14px;
  border: 1px solid var(--tfshop-line-soft);
  border-radius: 12px;
  background: var(--tfshop-surface);
}

.tfshop-levels__head {
  margin-bottom: 10px;
}

.tfshop-levels__head h2 {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 600;
  color: var(--tfshop-ink);
}

.tfshop-levels__head p {
  margin: 0;
  font-size: 12px;
  line-height: 1.55;
  color: var(--tfshop-dim);
}

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

.tfshop-leveltab {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 10px 12px;
  border: 1px solid var(--tfshop-line);
  border-radius: 10px;
  background: #fff;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.tfshop-leveltab__top {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.tfshop-leveltab__top strong {
  font-size: 14px;
  font-weight: 700;
  color: var(--tfshop-ink);
}

.tfshop-leveltab__top em {
  font-style: normal;
  font-size: 11px;
  color: var(--tfshop-dim);
}

.tfshop-leveltab__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: var(--tfshop-dim);
}

.tfshop-leveltab__row b {
  font-weight: 600;
  color: var(--tfshop-muted);
}

.tfshop-leveltab__foot {
  margin-top: 2px;
  font-size: 11px;
  color: var(--tfshop-dim);
}

.tfshop-leveltab:hover {
  border-color: rgba(59, 130, 246, 0.35);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.06);
}

.tfshop-leveltab.is-active {
  border-color: rgba(59, 130, 246, 0.45);
  background: var(--tfshop-blue-soft);
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.12);
}

.tfshop-leveltab.is-active .tfshop-leveltab__top strong,
.tfshop-leveltab.is-active .tfshop-leveltab__row b {
  color: var(--tfshop-blue-strong);
}

/* ---- 售卖卡片：页签 + 密集商品网格 / 换物清单 ---- */
.tfshop-shop {
  margin-bottom: 16px;
  padding: 14px 18px 18px;
  border-radius: 12px;
  background: var(--tfshop-card);
  box-shadow: var(--tfshop-shadow);
}

.js .tfshop-shop:not(.is-active) {
  display: none;
}

.tfshop-shop__head {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--tfshop-line-soft);
}

.tfshop-tabs {
  display: flex;
  gap: 22px;
}

.tfshop-tab {
  margin-bottom: -1px;
  padding: 8px 2px 10px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: none;
  font-size: 15px;
  font-weight: 500;
  color: var(--tfshop-muted);
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.tfshop-tab em {
  font-style: normal;
  font-size: 12px;
  color: var(--tfshop-dim);
}

.tfshop-tab:hover {
  color: var(--tfshop-blue-strong);
}

.tfshop-tab.is-active {
  border-bottom-color: var(--tfshop-blue);
  color: var(--tfshop-blue-strong);
}

.tfshop-tab.is-active em {
  /* 12px 小字用 #2563eb（5.17:1），#3b82f6 只有 3.68:1 */
  color: var(--tfshop-blue-strong);
}

.tfshop-shop__more {
  font-size: 13px;
  color: var(--tfshop-muted);
  text-decoration: none;
}

/* 无固定货架商人（黑商 / 灯塔商人 / BTR 司机）：标题替代页签，保持同一行高与分隔线 */
.tfshop-shop__title {
  padding: 8px 0 10px;
  font-size: 15px;
  font-weight: 500;
  color: var(--tfshop-ink);
}

.tfshop-shop__more::after {
  content: " →";
  color: var(--tfshop-dim);
}

.tfshop-shop__more:hover {
  color: var(--tfshop-blue-strong);
}

.js .tfshop-pane:not(.is-active) {
  display: none;
}

.tfshop-items {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 10px;
}

.tfshop-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--tfshop-line-soft);
  border-radius: 10px;
  background: #fff;
  color: inherit;
  text-decoration: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.tfshop-item:hover {
  border-color: rgba(59, 130, 246, 0.35);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
  transform: translateY(-1px);
}

.tfshop-item__pic {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 64px;
  border-radius: 8px;
  background: var(--tfshop-surface);
}

.tfshop-item__pic img {
  max-width: 100%;
  max-height: 56px;
  object-fit: contain;
}

.tfshop-item__noimg {
  font-size: 12px;
  color: var(--tfshop-dim);
}

.tfshop-item__name {
  display: -webkit-box;
  min-height: 2.8em;
  overflow: hidden;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--tfshop-ink);
  overflow-wrap: break-word;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.tfshop-item__price {
  display: flex;
  align-items: baseline;
  gap: 4px;
  font-size: 13px;
  font-weight: 700;
  color: var(--tfshop-blue-strong);
}

.tfshop-item__price em {
  font-style: normal;
  font-size: 11px;
  font-weight: 400;
  color: var(--tfshop-dim);
}

.tfshop-item__limit {
  font-size: 11px;
  color: var(--tfshop-dim);
}

.tfshop-barters {
  display: grid;
  gap: 10px;
}

.tfshop-barter {
  padding: 12px;
  border: 1px solid var(--tfshop-line-soft);
  border-radius: 10px;
  background: #fff;
}

.tfshop-barter__flow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 40px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.tfshop-barter__col {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--tfshop-surface);
}

.tfshop-barter__label {
  font-size: 12px;
  font-weight: 600;
  color: var(--tfshop-dim);
}

.tfshop-barter__items {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tfshop-bitem {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
  padding: 6px 10px 6px 6px;
  border: 1px solid var(--tfshop-line);
  border-radius: 10px;
  background: #fff;
  color: inherit;
  text-decoration: none;
  transition: border-color 0.15s ease;
}

.tfshop-bitem:hover {
  border-color: rgba(59, 130, 246, 0.45);
}

.tfshop-bitem img {
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  border: 1px solid var(--tfshop-line-soft);
  border-radius: 8px;
  background: #fff;
  object-fit: contain;
}

.tfshop-bitem span {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.tfshop-bitem strong {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--tfshop-ink);
  overflow-wrap: break-word;
}

.tfshop-bitem em {
  font-style: normal;
  font-size: 12px;
  color: var(--tfshop-dim);
}

.tfshop-bitem--reward {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.tfshop-bitem--reward em {
  color: #047857;
}

.tfshop-barter__arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin: 0 auto;
  border-radius: 999px;
  background: var(--tfshop-blue-soft);
  font-size: 15px;
  font-weight: 700;
  color: var(--tfshop-blue-strong);
}

.tfshop-barter__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--tfshop-line-soft);
  font-size: 12px;
}

.tfshop-bmeta {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
}

.tfshop-bmeta i {
  font-style: normal;
  color: var(--tfshop-dim);
}

.tfshop-bmeta b {
  font-weight: 600;
  color: var(--tfshop-ink);
}

.tfshop-bmeta--task b {
  color: var(--tfshop-blue-strong);
}

.tfshop-empty {
  margin: 0;
  font-size: 13px;
  line-height: 1.7;
  color: var(--tfshop-dim);
}

/* ---- 任务与相关入口 ---- */
.tfshop-block {
  margin-bottom: 16px;
  padding: 16px 18px 18px;
  border-radius: 12px;
  background: var(--tfshop-card);
  box-shadow: var(--tfshop-shadow);
}

.tfshop-block__head {
  margin-bottom: 14px;
}

.tfshop-block__head h2 {
  margin: 0 0 4px;
  font-size: 18px;
  font-weight: 600;
  color: var(--tfshop-ink);
}

.tfshop-block__head p {
  margin: 0;
  font-size: 13px;
  color: var(--tfshop-dim);
}

.tfshop-tasklist {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 10px;
}

.tfshop-task {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--tfshop-line-soft);
  border-radius: 10px;
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.tfshop-task:hover {
  border-color: rgba(59, 130, 246, 0.35);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}

.tfshop-task__main {
  display: flex;
  flex: 1;
  gap: 12px;
  align-items: center;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.tfshop-task__badge {
  flex: 0 0 auto;
  min-width: 46px;
  padding: 5px 8px;
  border-radius: 8px;
  background: var(--tfshop-blue-soft);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  color: var(--tfshop-blue-strong);
}

.tfshop-task__body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.tfshop-task__body strong {
  font-size: 14px;
  line-height: 1.4;
  color: var(--tfshop-ink);
  overflow-wrap: anywhere;
}

.tfshop-task__body em {
  display: -webkit-box;
  overflow: hidden;
  font-style: normal;
  font-size: 12px;
  line-height: 1.5;
  color: var(--tfshop-dim);
  overflow-wrap: anywhere;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.tfshop-task__go {
  flex: 0 0 auto;
  font-size: 13px;
  color: var(--tfshop-blue-strong);
  text-decoration: none;
  white-space: nowrap;
}

.tfshop-task__go:hover {
  text-decoration: underline;
}

.tfshop-related__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}

.tfshop-related__grid a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 14px;
  border: 1px solid var(--tfshop-line);
  border-radius: 10px;
  background: var(--tfshop-surface);
  font-size: 14px;
  color: var(--tfshop-ink);
  text-decoration: none;
  transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

.tfshop-related__grid a::after {
  content: "→";
  color: var(--tfshop-dim);
}

.tfshop-related__grid a:hover {
  border-color: rgba(59, 130, 246, 0.35);
  background: var(--tfshop-blue-soft);
  color: var(--tfshop-blue-strong);
}

.tfshop-related__grid a:hover::after {
  color: var(--tfshop-blue-strong);
}

.tfshop-page a:focus-visible,
.tfshop-page button:focus-visible {
  outline: 2px solid rgba(59, 130, 246, 0.55);
  outline-offset: 2px;
}

@media (max-width: 1080px) {
  .tfshop-panel__grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .tfshop-levels__grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .tfshop-items {
    grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  }

  .tfshop-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    row-gap: 10px;
  }

  .tfshop-stats div:nth-child(3n + 1) {
    padding-left: 0;
    box-shadow: none;
  }
}

@media (max-width: 640px) {
  .tfshop-main {
    width: calc(100% - 24px);
    padding: 12px 0 40px;
  }

  .tfshop-switcher {
    gap: 6px;
    margin-bottom: 10px;
  }

  .tfshop-switcher__track {
    gap: 8px;
  }

  /* 手机改回固定卡宽 + 横向滚动（桌面是均分整行） */
  .tfshop-switcher__track > li {
    flex: 0 0 auto;
    min-width: 0;
    max-width: none;
  }

  .tfshop-tradercard {
    box-sizing: border-box;
    width: 96px;
    padding: 8px 6px;
    gap: 4px;
  }

  .tfshop-tradercard__img {
    width: 52px;
    height: 52px;
    padding: 3px;
  }

  .tfshop-tradercard__name {
    font-size: 12px;
  }

  .tfshop-tradercard__en {
    font-size: 10px;
  }

  .tfshop-switcher__arrow {
    box-sizing: border-box;
    width: 28px;
    height: 28px;
    font-size: 14px;
  }

  .tfshop-panel,
  .tfshop-block {
    padding: 14px;
    border-radius: 10px;
  }

  .tfshop-shop {
    padding: 12px 14px 14px;
    border-radius: 10px;
  }

  .tfshop-banner {
    padding: 12px;
  }

  .tfshop-banner__top {
    flex-direction: column;
    gap: 10px;
  }

  .tfshop-banner__portrait {
    flex-basis: 72px;
    width: 72px;
    height: 72px;
    padding: 4px;
    border-radius: 10px;
  }

  .tfshop-title {
    font-size: 21px;
  }

  .tfshop-lede {
    margin-bottom: 10px;
  }

  .tfshop-levels__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tfshop-levels {
    padding: 12px;
  }

  .tfshop-tabs {
    gap: 16px;
  }

  .tfshop-tab {
    font-size: 14px;
  }

  .tfshop-shop__more {
    font-size: 12px;
  }

  .tfshop-items {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .tfshop-item {
    gap: 5px;
    padding: 8px;
  }

  .tfshop-item__pic {
    height: 52px;
  }

  .tfshop-item__pic img {
    max-height: 46px;
  }

  .tfshop-item__name {
    font-size: 12px;
  }

  .tfshop-item__price {
    font-size: 12px;
  }

  /* 移动端换物清单：还原「需要 → 获得」并排流，压缩卡片高度
     （旧版 19 条换物在手机上堆成 6647px，并排后约 2200px，名称仍保留两行）。 */
  .tfshop-barter {
    padding: 10px;
  }

  .tfshop-barter__flow {
    grid-template-columns: minmax(0, 1fr) 24px minmax(0, 1fr);
    gap: 8px;
  }

  .tfshop-barter__col {
    gap: 6px;
    padding: 8px;
  }

  .tfshop-barter__arrow {
    width: 24px;
    height: 24px;
    transform: none;
    font-size: 13px;
  }

  .tfshop-barter__items {
    gap: 6px;
  }

  .tfshop-bitem {
    gap: 6px;
    padding: 4px 6px 4px 4px;
  }

  .tfshop-bitem img {
    flex-basis: 26px;
    width: 26px;
    height: 26px;
  }

  .tfshop-bitem strong {
    display: -webkit-box;
    overflow: hidden;
    font-size: 11.5px;
    line-height: 1.3;
    /* 手机上窄列放不下超长物品名（如「Iskra（“火花”）单兵口粮」），给到 3 行：
       只有含长名的换物行会变高，其余行高度不变。 */
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
  }

  .tfshop-bitem em {
    font-size: 11px;
  }

  .tfshop-barter__meta {
    gap: 4px 12px;
    margin-top: 8px;
    padding-top: 8px;
    font-size: 11px;
  }

  .tfshop-tasklist {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .tfshop-task {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding: 9px;
  }

  .tfshop-task__main {
    gap: 7px;
    align-items: flex-start;
  }

  .tfshop-task__badge {
    min-width: 32px;
    padding: 2px 6px;
    font-size: 11px;
  }

  .tfshop-task__body strong {
    font-size: 13px;
    line-height: 1.35;
  }

  .tfshop-task__body em {
    -webkit-line-clamp: 1;
  }

  .tfshop-task__go {
    align-self: flex-end;
    font-size: 12px;
  }
}

@media (max-width: 420px) {
  .tfshop-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tfshop-stats div:nth-child(2n + 1) {
    padding-left: 0;
    box-shadow: none;
  }

  .tfshop-items {
    gap: 6px;
  }
}

/* 超窄屏（≤340px）兜底：任务卡两列会窄到放不下任务名，退回单列 */
@media (max-width: 340px) {
  .tfshop-tasklist {
    grid-template-columns: minmax(0, 1fr);
  }
}
