.wardrobe {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  overflow: hidden;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(40, 46, 48, .5), rgba(20, 26, 28, .55));
  box-shadow: inset 0 0 0 1px rgba(255, 244, 220, .08);
}

/* ---------- 左侧大类 ---------- */
.wd-rail {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  padding: 12px 8px;
  background: rgba(6, 9, 10, .42);
  box-shadow: inset -1px 0 0 rgba(255, 244, 220, .08);
}
.wd-rail__kind {
  margin: 6px 0 0;
  color: var(--cream-faint);
  font-size: 11px;
  letter-spacing: .3em;
  text-align: center;
}
.wd-rail__kind:not(:first-child) { margin-top: 12px; padding-top: 12px; border-top: 2px solid rgba(255, 244, 220, .14); }
.wd-rail__btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 8px 2px 6px;
  border: 0;
  border-radius: 18px;
  background: transparent;
  color: var(--cream-dim);
  transition: background .2s, box-shadow .2s, color .2s;
}
.wd-rail__btn img { width: 40px; height: 40px; object-fit: contain; opacity: .7; transition: opacity .2s, transform .2s var(--ease-spring); }
.wd-rail__btn:hover { background: rgba(255, 244, 220, .07); color: var(--cream); }
.wd-rail__btn:hover img { opacity: 1; }
.wd-rail__btn.is-active { background: rgba(255, 244, 220, .13); box-shadow: inset 0 0 0 2px rgba(255, 244, 220, .75); color: var(--cream); }
.wd-rail__btn.is-active img { opacity: 1; transform: scale(1.06); }
.wd-rail__btn:focus-visible { outline: 2px solid var(--cream); outline-offset: 1px; }
.wd-rail__label { font-size: 12px; }
.wd-rail__count { color: var(--cream-faint); font-size: 10.5px; }

/* ---------- 主区域 ---------- */
.wd-main { display: flex; flex-direction: column; min-width: 0; }

.wd-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 14px 18px 4px;
}
.wd-modes button { display: inline-flex; align-items: baseline; gap: 6px; padding: 6px 16px; }
.wd-modes__n { font-size: 11px; opacity: .7; }
.wd-modes__n:empty { display: none; }
.wd-search { flex: 1; min-width: 160px; max-width: 280px; height: 34px; margin-left: auto; border-radius: 999px; }

/* 子页签：复刻游戏内 Z [图标] [图标] [图标] C */
.wd-tabs {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 18px 0;
  box-shadow: inset 0 -2px 0 rgba(255, 244, 220, .5);
}
.wd-tabs__key {
  align-self: center;
  margin-bottom: 4px;
  padding: 4px;
  border: 0;
  background: transparent;
  transition: transform .15s;
}
.wd-tabs__key:not(:disabled):active { transform: scale(.9); }
.wd-tabs__key:disabled { opacity: .3; cursor: default; }
.wd-tabs__list { display: flex; justify-content: center; gap: clamp(12px, 5vw, 52px); }
.wd-tab {
  position: relative;
  display: grid;
  place-items: center;
  width: 64px;
  height: 58px;
  padding: 0;
  border: 0;
  border-radius: 4px 4px 0 0;
  background: transparent;
  transition: background .2s;
}
.wd-tab img { width: 42px; height: 42px; object-fit: contain; opacity: .78; transition: opacity .2s; }
.wd-tab:hover img { opacity: 1; }
.wd-tab.is-active { background: linear-gradient(180deg, rgba(255, 244, 220, .04), rgba(255, 244, 220, .16)); }
.wd-tab.is-active img { opacity: 1; }
.wd-tab.is-active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: var(--cream);
}
.wd-tab:focus-visible { outline: 2px solid var(--cream); outline-offset: -2px; }
.wd-tab__dot {
  position: absolute;
  top: 6px;
  right: 9px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--red-dot);
}

.wd-subline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  padding: 10px 20px 0;
  color: var(--cream-dim);
  font-size: 13px;
}
.wd-subline b { color: var(--cream); font-weight: 600; }
.wd-subline__muted { color: var(--cream-faint); }
.wd-subline__legend { display: inline-flex; align-items: center; gap: 5px; margin-left: auto; color: var(--cream-faint); font-size: 12px; }
.wd-legend { display: inline-block; }
.wd-legend--iap {
  padding: 0 4px;
  border-radius: 4px;
  background: var(--pink);
  color: #3b1d22;
  font-size: 10px;
  font-weight: 700;
  line-height: 15px;
}
.wd-legend--grad {
  width: 14px;
  height: 14px;
  margin-left: 8px;
  border-radius: 50%;
  background: radial-gradient(circle, #ffe7a8 0 30%, #d8a64a 60%, transparent 66%);
}

.wd-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  align-content: start;
  gap: 14px;
  height: 560px;
  padding: 10px 18px 18px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.wd-cell { width: 100%; }

.wd-cell.is-chosen { box-shadow: inset 0 0 0 2.5px rgba(255, 244, 220, .85); }
.wd-cell__dot {
  position: absolute;
  left: 6px;
  top: 6px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  box-shadow: 0 0 0 1.5px rgba(0, 0, 0, .35);
  pointer-events: none;
}
.cell-badge--pick {
  position: absolute;
  left: 5px;
  bottom: 5px;
  display: grid;
  place-items: center;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  background: var(--cream);
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  pointer-events: none;
}

/* 选择模式下的顶部条 */
.wd-modes--pick { display: flex; width: 100%; align-items: center; gap: 10px; background: transparent; box-shadow: none; padding: 0; }
.wd-modes--pick .wd-modes__focus {
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--well);
  color: var(--cream-dim);
  font-size: 12px;
}
.wd-modes--pick .wd-modes__focus.is-active { background: var(--cream); color: var(--ink); font-weight: 600; }
.wd-modes--pick .wd-modes__focus:disabled { visibility: hidden; }
.wd-modes--pick .wd-modes__count { margin-left: auto; color: var(--cream-faint); font-size: 12px; }

.wd-info__selected { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.wd-info__col { color: var(--cream-dim); font-size: 13px; white-space: nowrap; }
.wd-info__col--strong { color: var(--cream); font-weight: 600; }
.wd-chips { display: flex; flex-wrap: wrap; gap: 5px; min-width: 0; max-height: 56px; overflow: hidden; }
.wd-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 150px;
  padding: 2px 6px 2px 2px;
  border: 0;
  border-radius: 9px;
  background: var(--well);
  color: var(--cream-dim);
  font-size: 11.5px;
}
.wd-chip:hover { background: rgba(235, 167, 175, .18); color: var(--cream); }
.wd-chip img { width: 20px; height: 20px; object-fit: contain; }
.wd-chip span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.wd-chip i { font-size: 9px; opacity: .7; }
.wd-chips__more { color: var(--cream-faint); font-size: 12px; align-self: center; }

.wd-empty {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 80px 0;
  color: var(--cream-faint);
}
.cell-badge--iap {
  position: absolute;
  top: 6px;
  right: 6px;
  padding: 0 4px;
  border-radius: 5px;
  background: rgba(235, 167, 175, .92);
  color: #3b1d22;
  font-size: 10px;
  font-weight: 700;
  line-height: 15px;
  pointer-events: none;
}
.cell-badge--grad {
  position: absolute;
  right: 3px;
  bottom: 3px;
  width: 22px !important;
  height: 22px !important;
  object-fit: contain;
  filter: drop-shadow(0 0 3px rgba(0, 0, 0, .6));
  pointer-events: none;
}
.wd-cell.is-missing .cell-badge { opacity: .45; }

.wd-empty__orb {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 250, 240, .9) 0 16%, rgba(255, 236, 196, .4) 36%, transparent 70%);
}

/* 底部信息栏：复刻游戏内「信息 Q · 选择 SPACE · 退后 ESC」 */
.wd-info {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 84px;
  padding: 10px 18px;
  background: rgba(6, 9, 10, .3);
  box-shadow: inset 0 2px 0 rgba(255, 244, 220, .5);
}
.wd-info__hint { color: var(--cream-faint); }
.wd-info__keys { display: flex; gap: 22px; margin-left: auto; color: var(--cream); font-size: 14px; }
.wd-info__keys > span { display: inline-flex; align-items: center; gap: 6px; }
.wd-info__cell { flex: none; width: 62px; border-radius: 16px; }
.wd-info__text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.wd-info__name { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; color: var(--cream); font-size: 16px; font-weight: 600; }
.wd-info__alias { color: var(--cream-faint); font-size: 12px; font-weight: 400; }
.wd-info__tags { display: flex; flex-wrap: wrap; gap: 6px; }
.wd-info__id {
  align-self: flex-start;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--cream-faint);
  font-size: 11px;
}
.wd-info__id:hover { color: var(--cream); text-decoration: underline; }
.wd-info__close { margin-left: auto; padding: 4px; border: 0; background: transparent; }

.wardrobe--pick .wd-grid { height: 520px; }

/* 选择器在窄屏由外层 flex 控制高度，这里让位给 auto */
@media (max-width: 1023px) {
  .list-layout.is-picking .wardrobe--pick .wd-grid { height: auto; }
}

@media (max-width: 760px) {
  .wardrobe { grid-template-columns: 1fr; }
  .wardrobe--pick .wd-grid { height: 52vh; min-height: 260px; }

  .wd-rail {
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 4px;
    overflow-x: auto;
    padding: 6px;
    box-shadow: inset 0 -1px 0 rgba(255, 244, 220, .08);
    scrollbar-width: none;
  }
  .wd-rail::-webkit-scrollbar { display: none; }
  .wd-rail__kind { display: none; }
  .wd-rail__btn {
    flex: 1 1 0;
    min-width: 0;
    height: 58px;
    justify-content: center;
    flex-direction: column;
    gap: 1px;
    padding: 4px 2px;
    border-radius: 12px;
  }
  .wd-rail__btn img { width: 24px; height: 24px; }
  .wd-rail__label { font-size: 12px; white-space: nowrap; }
  .wd-rail__count { display: none; }
  .wd-toolbar { padding: 12px 12px 4px; }
  .wd-modes { display: flex; width: 100%; flex-wrap: nowrap; }
  .wd-modes button { flex: 1; justify-content: center; padding: 6px 4px; }
  .wd-search { max-width: none; margin-left: 0; }
  .wd-tabs { padding: 4px 8px 0; }
  .wd-tab { width: 54px; height: 50px; }
  .wd-tab img { width: 36px; height: 36px; }
  .wd-grid { grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 10px; height: 460px; padding: 8px 12px 12px; }
  .wd-subline { padding: 8px 12px 0; }
  .wd-subline__legend { display: none; }
  .wd-info { padding: 10px 12px; }
  .wd-info__keys { display: none; }
}
