﻿/* Prep tab — doll + dual storage */

.home-page.is-prep-tab>.home-hud{display:none}
.prep-page-head{display:flex;align-items:center;justify-content:space-between;min-height:42px;padding:0 4px;border-bottom:1px solid rgba(67,211,255,.28);flex:none}
.prep-page-head h2{margin:0;color:#fff;font-size:24px;font-style:italic;text-shadow:0 0 14px rgba(83,220,255,.28)}

.prep-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  gap: var(--sp-2);
  overflow: hidden;
}

.prep-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
  padding: 6px 10px;
  min-height: 40px;
  border-bottom: 1px solid var(--line-1);
  flex-shrink: 0;
}

.prep-section-head h3 {
  margin: 0;
  font-size: var(--fs-h3);
  font-weight: var(--fw-b);
  white-space: nowrap;
}

.prep-head-left {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  flex: 1;
  min-width: 0;
  padding-left: 8px;
}

.prep-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 6px;
  flex-shrink: 0;
  max-width: 100%;
}

/* 仓库模式只保留仓库操作，角色详情仅属于角色人偶模式。 */
.prep-top.is-wh #prepRoleDetail {
  display: none !important;
}

/* 仓库标题与全部操作保持同一行，关闭按钮不再掉到下一行。 */
.prep-top.is-wh > .prep-section-head,
.prep-top.is-wh > .prep-section-head .prep-toolbar {
  flex-wrap: nowrap;
  white-space: nowrap;
}
.prep-top.is-wh > .prep-section-head .prep-head-left {
  flex: 1 1 auto;
  min-width: 68px;
  padding-left: 4px;
}
.prep-top.is-wh > .prep-section-head .prep-toolbar {
  flex: 0 0 auto;
  gap: 5px;
}
.prep-top.is-wh > .prep-section-head .prep-toolbar .game-select {
  flex: 0 0 104px;
  width: 104px;
}
.prep-top.is-wh > .prep-section-head .prep-toolbar .btn-sm {
  flex: 0 0 auto;
  padding-inline: 9px;
}

.prep-type-filter {
  min-width: 88px;
  height: 34px;
  padding: 0 24px 0 9px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  color: var(--text-2);
  font-size: var(--fs-cap);
  outline: none;
}

.prep-type-filter:focus {
  border-color: var(--line-focus);
  box-shadow: 0 0 0 2px rgba(53, 215, 255, 0.1);
}

.prep-type-dd {
  position: relative;
  z-index: 5;
  flex: 0 0 auto;
}
.prep-type-dd-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 96px;
  height: 34px;
  padding: 0 10px 0 11px;
  border: 1px solid rgba(53, 215, 255, 0.38);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(28, 40, 64, 0.96), rgba(16, 24, 42, 0.96));
  color: #e8f7ff;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 0 0 1px rgba(53, 215, 255, 0.06);
}
.prep-type-dd.open .prep-type-dd-btn,
.prep-type-dd-btn:focus-visible {
  border-color: rgba(53, 215, 255, 0.72);
  box-shadow: 0 0 0 2px rgba(53, 215, 255, 0.14), 0 0 14px rgba(53, 215, 255, 0.18);
}
.prep-type-dd-value {
  flex: 1;
  text-align: left;
  white-space: nowrap;
}
.prep-type-dd-caret {
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid rgba(183, 236, 255, 0.85);
  transition: transform var(--t-fast) var(--ease);
}
.prep-type-dd.open .prep-type-dd-caret {
  transform: rotate(180deg);
}
.prep-type-dd-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 100%;
  width: max-content;
  padding: 6px;
  border-radius: 12px;
  border: 1px solid rgba(53, 215, 255, 0.28);
  background: linear-gradient(180deg, rgba(22, 32, 54, 0.98), rgba(12, 18, 34, 0.98));
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.prep-type-dd-option {
  display: block;
  width: 100%;
  border: none;
  border-radius: 8px;
  padding: 9px 12px;
  background: transparent;
  color: rgba(232, 240, 255, 0.88);
  font-size: 12px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  white-space: nowrap;
}
.prep-type-dd-option:hover,
.prep-type-dd-option:active {
  background: rgba(53, 215, 255, 0.12);
  color: #fff;
}
.prep-type-dd-option.active {
  background: linear-gradient(135deg, rgba(124, 92, 255, 0.38), rgba(53, 215, 255, 0.28));
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(53, 215, 255, 0.22);
}

.prep-toolbar button.active,
.prep-toolbar .btn-ghost.active {
  border-color: var(--line-focus);
  background: rgba(124, 92, 255, 0.22);
  color: #fff;
}
.prep-refresh{display:inline-flex;align-items:center;justify-content:center;gap:3px;white-space:nowrap}
.prep-refresh span{display:inline-block;color:#55e5ff;font-size:16px;line-height:1;text-shadow:0 0 9px rgba(60,220,255,.75)}
.prep-refresh.is-loading span{animation:prep-refresh-spin .7s linear infinite}
@keyframes prep-refresh-spin{to{transform:rotate(360deg)}}

.prep-meta {
  font-size: var(--fs-cap);
  color: var(--text-3);
  white-space: nowrap;
}

.prep-hero-name-inline {
  font-size: var(--fs-body);
  font-weight: var(--fw-b);
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 120px;
}

/* —— 上区：人偶定高；仓库同尺寸覆盖，不再撑大 —— */
.prep-top {
  position: relative;
  flex: 0 0 auto;
  flex-shrink: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  border-radius: var(--r-lg);
  background: var(--surface-0);
  border: 1px solid var(--line-1);
  overflow: hidden;
}

.prep-top.is-wh {
  flex: 0 0 auto;
}

.prep-top-stage {
  position: relative;
  flex: 0 0 auto;
  min-height: 0;
}

.prep-doll-body {
  padding: 10px 10px 14px;
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.prep-doll-body.is-placeholder,
.prep-empty-tip.is-placeholder {
  visibility: hidden;
  pointer-events: none;
}

.prep-wh-layer {
  position: absolute;
  inset: 0;
  z-index: 2;
  overflow-x: hidden;
  overflow-y: scroll;
  -webkit-overflow-scrolling: touch;
  padding: 8px 10px 10px;
  background: var(--surface-0);
  box-sizing: border-box;
  scrollbar-gutter: stable;
}

/* 仓库与战斗背包共用的常驻霓虹滚动条。原生滑块可直接拖拽。 */
.prep-persistent-scrollbar {
  overflow-y: scroll;
  scrollbar-gutter: stable;
  scrollbar-width: auto;
  scrollbar-color: #45cfff rgba(7, 15, 31, 0.9);
  /* 最后一列与滚动控制条之间额外留出 10px，避免压住装备框。 */
  padding-right: 20px;
}
.prep-persistent-scrollbar::-webkit-scrollbar { width: 12px; }
.prep-persistent-scrollbar::-webkit-scrollbar-track {
  margin: 0 2px;
  border: 1px solid rgba(73, 136, 191, 0.18);
  border-radius: 999px;
  background:
    linear-gradient(90deg, transparent calc(50% - 1px), rgba(80, 210, 255, .55) calc(50% - 1px), rgba(80, 210, 255, .55) calc(50% + 1px), transparent calc(50% + 1px)),
    linear-gradient(180deg, rgba(9, 19, 38, 0.96), rgba(15, 12, 42, 0.96));
  box-shadow: inset 0 0 7px rgba(0, 0, 0, 0.65), 0 0 5px rgba(42, 185, 255, .12);
}
.prep-persistent-scrollbar::-webkit-scrollbar-thumb {
  min-height: 44px;
  border: 2px solid rgba(5, 12, 27, 0.98);
  border-radius: 999px;
  background: linear-gradient(180deg, #79e8ff 0%, #329fe8 52%, #7557ff 100%);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.3),
    0 0 8px rgba(68, 201, 255, 0.55);
}
.prep-persistent-scrollbar::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #a4f2ff 0%, #4fc4ff 48%, #8e72ff 100%);
  box-shadow: 0 0 12px rgba(73, 211, 255, 0.78);
}
.prep-persistent-scrollbar::-webkit-scrollbar-thumb:active {
  background: linear-gradient(180deg, #d1f9ff, #45bfff 45%, #9f7cff);
}
.prep-persistent-scrollbar::-webkit-scrollbar-button:single-button {
  display: block;
  width: 12px;
  height: 14px;
  border: 0;
  background-color: rgba(8, 17, 35, .98);
  background-position: center;
  background-repeat: no-repeat;
  background-size: 8px 6px;
}
.prep-persistent-scrollbar::-webkit-scrollbar-button:single-button:vertical:decrement {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='6' viewBox='0 0 8 6'%3E%3Cpath d='M4 0 8 6H0Z' fill='%2379e8ff'/%3E%3C/svg%3E");
}
.prep-persistent-scrollbar::-webkit-scrollbar-button:single-button:vertical:increment {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='6' viewBox='0 0 8 6'%3E%3Cpath d='M0 0h8L4 6Z' fill='%2379e8ff'/%3E%3C/svg%3E");
}
.prep-persistent-scrollbar::-webkit-scrollbar-button:single-button:hover {
  background-color: rgba(24, 46, 77, .98);
  filter: brightness(1.3);
}

.prep-doll-row {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 8px;
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  box-sizing: border-box;
}

.prep-skill-col {
  display: grid;
  grid-template-rows: repeat(4, 72px);
  align-items: center;
  justify-items: center;
  gap: 8px;
  flex: 0 0 56px;
  align-self: stretch;
  padding: 0;
  position: relative;
  z-index: 1;
}

.prep-skill-slot {
  position: relative;
  width: 52px;
  height: 52px;
  border-radius: var(--r-md);
  border: 1px dashed rgba(53, 215, 255, 0.28);
  background: rgba(53, 215, 255, 0.06);
  display: grid;
  place-items: center;
  place-content: center;
  overflow: hidden;
  padding: 4px 3px 14px;
  box-sizing: border-box;
  cursor: pointer;
  touch-action: none;
  user-select: none;
  color: var(--text);
  transition: border-color var(--t-fast) var(--ease), background var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.prep-skill-slot .skill-hex-frame{inset:0}
.prep-skill-slot:active { transform: scale(0.96); }
.prep-skill-slot.filled {
  border-style: solid;
  border-color: rgba(53, 215, 255, 0.45);
  background: rgba(53, 215, 255, 0.14);
  padding-bottom: 0;
}
.prep-skill-slot.filled .prep-skill-slot-label {
  display: none;
}
.prep-skill-slot.is-ultimate.filled {
  border-color: rgba(251, 191, 36, 0.5);
  background: rgba(251, 191, 36, 0.14);
}
.prep-skill-slot.is-small.filled {
  border-color: rgba(167, 139, 250, 0.5);
  background: rgba(167, 139, 250, 0.14);
}
.prep-skill-slot.drop-compatible,
.equip-slot.drop-compatible {
  border-style: solid;
  border-color: rgba(91, 236, 255, 0.95);
  background: rgba(37, 196, 255, 0.2);
  box-shadow: inset 0 0 15px rgba(66, 220, 255, 0.2), 0 0 12px rgba(66, 220, 255, 0.55);
  animation: prep-compatible-pulse 1.05s ease-in-out infinite alternate;
}

.prep-skill-slot.drag-over,
.equip-slot.drag-over {
  border-color: #8dffb0;
  background: rgba(74, 222, 128, 0.28);
  box-shadow: inset 0 0 18px rgba(74, 222, 128, 0.28), 0 0 18px rgba(74, 222, 128, 0.75);
  transform: scale(1.08);
  animation: none;
}

.prep-skill-slot.filled.drop-compatible {
  border-color: rgba(91, 236, 255, 0.98);
  background: rgba(37, 196, 255, 0.24);
  box-shadow: inset 0 0 16px rgba(66, 220, 255, 0.28), 0 0 14px rgba(66, 220, 255, 0.7);
  animation: prep-compatible-pulse 1.05s ease-in-out infinite alternate;
}

.prep-skill-slot.filled.drag-over {
  border-color: #8dffb0;
  background: rgba(74, 222, 128, 0.32);
  box-shadow: inset 0 0 18px rgba(74, 222, 128, 0.32), 0 0 18px rgba(74, 222, 128, 0.8);
  transform: scale(1.08);
  animation: none;
}
.prep-skill-slot-img {
  width: 40px;
  height: 40px;
  max-width: none;
  max-height: none;
  object-fit: contain;
  pointer-events: none;
  margin: 0;
  filter: drop-shadow(0 0 3px rgba(0, 220, 255, 0.25));
}
.prep-skill-slot-emoji {
  font-size: 22px;
  line-height: 1;
  margin: 0;
  pointer-events: none;
}
.prep-skill-slot-name {
  font-size: 10px;
  font-weight: 700;
  line-height: 1.15;
  text-align: center;
  max-width: 100%;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  color: var(--text);
}
.prep-skill-slot-empty {
  font-size: 12px;
  color: var(--text-4);
  font-weight: 600;
}
.prep-skill-slot-label {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 1px;
  text-align: center;
  font-size: 9px;
  line-height: 1.2;
  color: var(--text-3);
  pointer-events: none;
}

.equip-doll {
  display: grid;
  grid-template-columns: 56px 1fr 56px;
  grid-template-rows: 72px 72px 72px 72px;
  grid-template-areas:
    ". helmet ."
    "weapon body armor"
    "gloves body legs"
    "acc1 acc2 acc3";
  gap: 8px 10px;
  align-items: center;
  justify-items: center;
  flex: 1 1 auto;
  max-width: 300px;
  min-width: 0;
  position: relative;
  z-index: 2;
}

.equip-doll-body {
  width: 100%;
  height: 100%;
  min-height: 120px;
  border-radius: var(--r-md);
  background: var(--surface-1);
  border: 1px solid var(--line-1);
  display: grid;
  place-items: center;
  cursor: pointer;
}

.equip-doll-body.art-ready {
  background-color: rgba(255, 255, 255, 0.2) !important;
  background-size: contain;
  background-position: center center;
  background-repeat: no-repeat !important;
  border-color: rgba(203, 213, 225, 0.82) !important;
  box-shadow:
    inset 0 0 0 1px rgba(203, 213, 225, 0.42),
    inset 0 -28px 34px rgba(116, 207, 255, 0.16),
    0 0 14px rgba(82, 211, 255, 0.22) !important;
  filter: none;
}

.equip-doll-body.drop-compatible {
  border-color: rgba(91, 236, 255, 0.82);
  box-shadow: inset 0 0 34px rgba(53, 215, 255, 0.2), 0 0 15px rgba(53, 215, 255, 0.36);
}

.equip-doll-body.drag-over {
  border-color: #8dffb0;
  box-shadow: inset 0 0 42px rgba(74, 222, 128, 0.24), 0 0 20px rgba(74, 222, 128, 0.5);
}

@keyframes prep-compatible-pulse {
  from { filter: brightness(1); }
  to { filter: brightness(1.25); }
}

.equip-doll-body.art-ready .equip-doll-figure {
  display: none;
}

.equip-doll-figure {
  transform: scale(0.72);
  transform-origin: center center;
}

.equip-slot {
  position: relative;
  width: 56px;
  height: 56px;
  border-radius: var(--r-md);
  border: 1px dashed var(--line-2);
  background: var(--surface-1);
  display: grid;
  place-items: center;
  place-content: center;
  overflow: hidden;
  padding-bottom: 14px;
  box-sizing: border-box;
  transition: border-color var(--t-fast) var(--ease), background var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
  cursor: pointer;
  touch-action: none;
  user-select: none;
  --rar: var(--rar-normal);
}

.equip-slot:active {
  transform: scale(0.96);
}

.equip-slot.filled {
  padding-bottom: 0;
  border-style: solid;
  border-color: color-mix(in srgb, var(--rar) 72%, #fff 8%);
  background:
    radial-gradient(circle at 50% 34%, color-mix(in srgb, var(--rar) 26%, transparent), transparent 62%),
    color-mix(in srgb, var(--rar) 12%, var(--surface-1));
  box-shadow:
    inset 0 0 12px color-mix(in srgb, var(--rar) 13%, transparent),
    0 0 8px color-mix(in srgb, var(--rar) 22%, transparent);
}

/* Occupied compatible slots are valid replacement/swap targets. Keep the
   drag affordance above the rarity styling declared by `.filled`. */
.equip-slot.filled.drop-compatible {
  border-color: rgba(91, 236, 255, 0.98);
  background:
    radial-gradient(circle at 50% 42%, rgba(53, 215, 255, 0.34), transparent 66%),
    color-mix(in srgb, var(--rar) 12%, var(--surface-1));
  box-shadow:
    inset 0 0 18px rgba(66, 220, 255, 0.3),
    0 0 15px rgba(66, 220, 255, 0.72);
  animation: prep-compatible-pulse 1.05s ease-in-out infinite alternate;
}

.equip-slot.filled.drag-over {
  border-color: #8dffb0;
  background:
    radial-gradient(circle at 50% 42%, rgba(74, 222, 128, 0.4), transparent 68%),
    color-mix(in srgb, var(--rar) 10%, var(--surface-1));
  box-shadow:
    inset 0 0 20px rgba(74, 222, 128, 0.34),
    0 0 20px rgba(74, 222, 128, 0.82);
  transform: scale(1.08);
  animation: none;
}

.equip-slot.filled .equip-slot-label {
  display: none;
}

.equip-slot.filled .equip-slot-emoji {
  color: var(--rar);
  opacity: 1;
  filter: drop-shadow(0 0 5px color-mix(in srgb, var(--rar) 65%, transparent));
}

.equip-slot-label {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 1px;
  text-align: center;
  font-size: 10px;
  line-height: 1.2;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
  z-index: 1;
}

.equip-slot-img {
  width: 44px;
  height: 44px;
  max-width: none;
  max-height: none;
  object-fit: contain;
  pointer-events: none;
  margin: 0;
  filter: drop-shadow(0 0 3px rgba(0, 220, 255, 0.25));
}

.equip-slot-emoji {
  font-size: 28px;
  line-height: 1;
  margin: 0;
}

.equip-slot-sil {
  font-size: 16px;
  line-height: 1;
  opacity: 0.35;
  margin-top: -4px;
}

.equip-doll-body.art-slot,
.equip-doll-body.art-ready {
  background-repeat: no-repeat !important;
}

.prep-stat-brief {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.prep-stat-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 4px;
  border-radius: var(--r-sm);
  background: var(--surface-1);
  border: 1px solid var(--line-1);
}

.prep-stat-chip-label {
  font-size: var(--fs-micro);
  color: var(--text-3);
}

.prep-stat-chip-value {
  font-size: var(--fs-body);
  font-weight: var(--fw-b);
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}

.prep-drag-hint {
  flex-shrink: 0;
  text-align: center;
  font-size: var(--fs-sub);
  font-weight: var(--fw-b);
  color: var(--accent);
  padding: 6px 10px;
  border-radius: var(--r-sm);
  background: rgba(53, 215, 255, 0.1);
  border: 1px solid rgba(53, 215, 255, 0.28);
  pointer-events: none;
}

/* —— 下区：吃掉角色区以外的剩余高度 —— */
.prep-bottom {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  border-radius: var(--r-lg);
  background: var(--surface-0);
  border: 1px solid var(--line-1);
  overflow: hidden;
}

/* 战斗背包筛选与批量操作固定同排，窄屏也不换行。 */
.prep-bottom > .prep-section-head {
  flex-wrap: nowrap;
}
.prep-bottom > .prep-section-head .prep-head-left {
  flex: 1 1 auto;
  min-width: 0;
}
.prep-bottom > .prep-section-head .prep-toolbar {
  flex: 0 0 auto;
  flex-wrap: nowrap;
  white-space: nowrap;
}
.prep-bottom > .prep-section-head .prep-toolbar .game-select {
  flex: 0 0 104px;
  width: 104px;
}
.prep-bottom > .prep-section-head .prep-toolbar .btn-sm {
  flex: 0 0 auto;
  padding-inline: 10px;
}

/* 拖拽进入备战背包流程时，用整条标题栏给出明确落点提示。 */
.prep-bottom > .prep-section-head::after {
  display: none;
  flex: 1 1 auto;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  color: #bdf8ff;
  content: '↓  拖至下方，松开放入背包';
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .02em;
  text-align: center;
  text-shadow: 0 0 8px rgba(70, 229, 255, .72);
}
.prep-bottom.drop-compatible > .prep-section-head {
  border-bottom-color: rgba(77, 232, 180, .42);
  background: linear-gradient(90deg, rgba(20, 90, 83, .3), rgba(23, 44, 88, .5), rgba(69, 39, 113, .3));
  box-shadow: inset 0 0 18px rgba(77, 232, 180, .07);
}
.prep-bottom.drop-compatible > .prep-section-head .prep-head-left,
.prep-bottom.drop-compatible > .prep-section-head .prep-toolbar {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}
.prep-bottom.drop-compatible > .prep-section-head::after {
  display: flex;
}
.prep-bottom.drag-over > .prep-section-head::after {
  color: #edfff9;
  content: '✓  松开放入战斗背包';
  text-shadow: 0 0 10px rgba(77, 232, 180, .95);
}

/* 仓库打开时采用与战斗背包一致的整面板拖放引导。 */
.prep-top.is-wh > .prep-section-head::after {
  display: none;
  flex: 1 1 auto;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  color: #bdf8ff;
  content: '↑  拖至上方，松开存入仓库';
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .02em;
  text-align: center;
  text-shadow: 0 0 8px rgba(70, 229, 255, .72);
}
.prep-top.is-wh.drop-compatible > .prep-section-head {
  border-bottom-color: rgba(77, 232, 180, .42);
  background: linear-gradient(90deg, rgba(20, 90, 83, .3), rgba(23, 44, 88, .5), rgba(69, 39, 113, .3));
  box-shadow: inset 0 0 18px rgba(77, 232, 180, .07);
}
.prep-top.is-wh.drop-compatible > .prep-section-head .prep-head-left,
.prep-top.is-wh.drop-compatible > .prep-section-head .prep-toolbar {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}
.prep-top.is-wh.drop-compatible > .prep-section-head::after {
  display: flex;
}
.prep-top.is-wh.drag-over > .prep-section-head::after {
  color: #edfff9;
  content: '✓  松开存入仓库';
  text-shadow: 0 0 10px rgba(77, 232, 180, .95);
}

.prep-bottom.drop-compatible > .prep-section-head::after,
.prep-top.is-wh.drop-compatible > .prep-section-head::after {
  position: absolute;
  inset: 6px 10px;
  width: auto;
  height: 32px;
  max-height: 32px;
  min-width: 0;
  min-height: 32px;
  flex: none;
  padding: 0 4px;
  overflow: hidden;
  font-size: 10px;
  line-height: 1;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap !important;
}

.prep-bottom > .prep-section-head,
.prep-top.is-wh > .prep-section-head {
  position: relative;
  overflow: hidden;
}

@media (max-width: 360px) {
  .prep-bottom.drop-compatible > .prep-section-head::after,
  .prep-top.is-wh.drop-compatible > .prep-section-head::after {
    padding-inline: 0;
    font-size: 9px;
    letter-spacing: 0;
  }
}

/* 独立绘制的滚动控制条：不依赖浏览器原生滚动条是否显示。 */
.prep-persistent-scrollbar {
  scrollbar-width: none;
}
.prep-persistent-scrollbar::-webkit-scrollbar {
  width: 0;
  height: 0;
}
.prep-custom-scrollbar {
  position: absolute;
  z-index: 8;
  right: 5px;
  bottom: 8px;
  width: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 2px 0;
  border-radius: 6px;
  background: rgba(5, 12, 28, .88);
  box-shadow: inset 0 0 0 1px rgba(79, 191, 255, .20), 0 0 7px rgba(50, 173, 255, .16);
  user-select: none;
  touch-action: none;
}
.prep-custom-scrollbar-wh { top: 8px; }
.prep-custom-scrollbar-bag { top: 52px; }
.prep-scroll-arrow {
  flex: 0 0 7px;
  width: 10px;
  min-width: 10px;
  height: 7px;
  min-height: 7px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  cursor: pointer;
  filter: drop-shadow(0 0 3px rgba(73, 216, 255, .72));
}
.prep-scroll-arrow.is-up {
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
  background: linear-gradient(180deg, #d1f8ff, #4bcfff);
}
.prep-scroll-arrow.is-down {
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  background: linear-gradient(180deg, #4bcfff, #9c75ff);
}
.prep-scroll-arrow:hover { filter: brightness(1.35) drop-shadow(0 0 5px #4bd9ff); }
.prep-scroll-track {
  position: relative;
  flex: 1 1 auto;
  width: 10px;
  min-height: 28px;
  border-radius: 999px;
  cursor: pointer;
  background:
    linear-gradient(90deg, transparent 4px, rgba(88, 211, 255, .72) 4px, rgba(88, 211, 255, .72) 6px, transparent 6px);
  box-shadow: inset 0 0 5px rgba(48, 175, 255, .16);
}
.prep-scroll-thumb {
  position: absolute;
  top: 0;
  left: 1px;
  width: 8px;
  min-height: 20px;
  border: 1px solid rgba(202, 248, 255, .92);
  border-radius: 999px;
  box-sizing: border-box;
  background: linear-gradient(180deg, #bdf6ff 0%, #3bc9ff 45%, #7658ff 100%);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.22), 0 0 7px rgba(60, 207, 255, .82);
  cursor: grab;
  will-change: transform;
}
.prep-scroll-thumb:active {
  cursor: grabbing;
  background: linear-gradient(180deg, #effdff, #62dcff 42%, #a17dff);
  box-shadow: 0 0 10px rgba(92, 221, 255, .95);
}

/* 矮屏：略压缩人偶格，优先保证角色区仍完整可见 */
@media (max-height: 740px) {
  .prep-doll-row { max-width: 380px; gap: 6px; }
  .prep-skill-col {grid-template-rows:repeat(4,54px);flex-basis:48px;gap:6px}
  .prep-skill-slot { width: 44px; height: 44px; }
  .prep-skill-slot-img { width: 34px; height: 34px; }
  .equip-doll {
    grid-template-columns: 48px 1fr 48px;
    grid-template-rows: repeat(4, 54px);
    gap: 6px 8px;
    max-width: 260px;
  }
  .equip-slot {
    width: 48px;
    height: 48px;
    padding-bottom: 12px;
  }
  .equip-doll-body {
    min-height: 100px;
  }
  .prep-doll-body {
    padding: 8px 8px 12px;
  }
  .equip-slot-label {
    font-size: 9px;
  }
}

@media (max-height: 640px) {
  .prep-doll-row { max-width: 340px; gap: 4px; }
  .prep-skill-col {grid-template-rows:repeat(4,48px);flex-basis:44px;gap:4px}
  .prep-skill-slot { width: 40px; height: 40px; padding-bottom: 11px; }
  .prep-skill-slot.filled { padding-bottom: 0; }
  .prep-skill-slot-img { width: 30px; height: 30px; }
  .prep-skill-slot-name { font-size: 9px; }
  .equip-doll {
    grid-template-columns: 44px 1fr 44px;
    grid-template-rows: repeat(4, 48px);
    gap: 4px 6px;
    max-width: 240px;
  }
  .equip-slot {
    width: 44px;
    height: 44px;
    padding-bottom: 11px;
  }
  .equip-doll-body {
    min-height: 88px;
  }
  .equip-doll-figure {
    transform: scale(0.62);
  }
  .prep-stat-chip {
    padding: 4px 2px;
  }
}

/* 装备槽：完整复用技能框层次，仅将轮廓改为四角切角方框。 */
.equip-slot{--equip-frame:#389dff;--equip-frame-soft:#82ecff;overflow:visible!important;clip-path:none!important;border:0!important;border-radius:0!important;background:transparent!important;box-shadow:none!important;filter:none!important;padding:8px 7px!important}
.equip-slot::before,.equip-slot::after{content:none!important}
.equip-square-frame{position:absolute;inset:0;z-index:0;pointer-events:none;filter:drop-shadow(0 0 3px rgba(90,216,255,.9)) drop-shadow(0 0 9px rgba(58,168,216,.45)) drop-shadow(0 0 13px rgba(123,45,255,.3))}
.equip-square-core,.equip-square-inner{position:absolute;display:block;clip-path:polygon(13% 0,87% 0,100% 13%,100% 87%,87% 100%,13% 100%,0 87%,0 13%)}
.equip-square-core{inset:8%;z-index:0;background:radial-gradient(ellipse at 50% 45%,#101028 0%,#070712 70%)}
.equip-square-inner{display:none}
.equip-square-frame>svg{position:absolute;inset:0;z-index:2;width:100%;height:100%;overflow:visible}
.equip-square-dash{display:none}
.equip-square-corners{fill:none;stroke:url(#skill-frame-metal);stroke-width:3.1;stroke-linecap:round;stroke-linejoin:round}.equip-square-corners .edge{stroke:url(#skill-frame-soft);stroke-width:1.15;opacity:.72}
.equip-slot>.equip-slot-empty-plus,.equip-slot>.equip-slot-img,.equip-slot>.equip-slot-emoji,.equip-slot>.equip-slot-label{position:relative;z-index:2}
.equip-slot.filled{--equip-frame:var(--rar,#389dff);--equip-frame-soft:color-mix(in srgb,var(--rar,#389dff) 34%,white)}.equip-slot.filled .equip-square-frame{filter:drop-shadow(0 0 3px color-mix(in srgb,var(--equip-frame) 88%,white)) drop-shadow(0 0 10px color-mix(in srgb,var(--equip-frame) 72%,transparent)) drop-shadow(0 0 15px color-mix(in srgb,var(--equip-frame) 38%,transparent))}
.equip-slot:hover .equip-square-frame,.equip-slot:focus-visible .equip-square-frame{filter:brightness(1.2) drop-shadow(0 0 5px var(--equip-frame-soft)) drop-shadow(0 0 13px var(--equip-frame))}
.equip-slot.drop-compatible .equip-square-frame{opacity:.4}.equip-slot.drag-over .equip-square-frame{opacity:.25}

.prep-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: scroll;
  padding: 8px 10px 10px;
  -webkit-overflow-scrolling: touch;
}

.prep-bag-zone {
  flex: 1 1 auto;
  width: 100%;
  min-height: 100%;
}

.prep-bottom > .prep-bag-scroll-shell {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: stretch;
}

.prep-empty-tip {
  padding: 20px 12px;
  text-align: center;
  color: var(--text-3);
  font-size: var(--fs-body);
}

.prep-drop-zone {
  outline: 2px dashed rgba(105, 219, 124, 0.45);
  outline-offset: -3px;
  background: rgba(105, 219, 124, 0.06);
}

/* Pointer 拖拽：仓库、战斗背包与装备槽共用反馈。 */
.prep-drag-source{opacity:.28!important;transform:scale(.94)}
.prep-drag-ghost{position:fixed;z-index:99999;max-width:150px;transform:translate(-50%,-125%);pointer-events:none;padding:7px 12px;border:1px solid #55ddff;border-radius:9px;color:#fff;background:rgba(8,18,38,.96);box-shadow:0 10px 28px #000,0 0 16px rgba(53,215,255,.35);font-size:12px;font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
[data-drop].drop-compatible{outline:1px dashed rgba(77,232,180,.7);outline-offset:-3px;box-shadow:inset 0 0 22px rgba(77,232,180,.08)}
[data-drop].drag-over{outline:2px solid #4de8b4;outline-offset:-3px;background-color:rgba(77,232,180,.12)!important;box-shadow:inset 0 0 28px rgba(77,232,180,.18),0 0 16px rgba(77,232,180,.24)!important}
.equip-slot.drop-compatible .equip-square-frame{opacity:.65!important;filter:brightness(1.25) drop-shadow(0 0 7px #4de8b4)!important}
.equip-slot.drag-over .equip-square-frame{opacity:1!important;filter:brightness(1.4) drop-shadow(0 0 10px #4de8b4) drop-shadow(0 0 20px rgba(77,232,180,.55))!important}

.prep-item-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  grid-auto-rows: max-content;
  align-content: start;
  gap: 10px 6px;
  width: 100%;
  box-sizing: border-box;
}

.prep-item-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  min-width: 0;
}

.prep-item {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  border-radius: var(--r-md);
  border: 1px solid var(--line-2);
  background: var(--surface-1);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  box-sizing: border-box;
  cursor: grab;
  user-select: none;
  touch-action: none;
  transition: border-color var(--t-fast), transform var(--t-fast);
  overflow: hidden;
}

.prep-item::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 8px 8px 0 0;
  border-color: var(--rar, var(--line-2)) transparent transparent transparent;
  opacity: 0.85;
}

.prep-item:active {
  cursor: grabbing;
  transform: scale(0.96);
}

.prep-item.selected {
  border-color: rgba(124, 92, 255, 0.85);
  box-shadow: inset 0 0 0 1px rgba(124, 92, 255, 0.4);
}

.prep-item.drag-over {
  border-color: rgba(105, 219, 124, 0.9);
  background: rgba(105, 219, 124, 0.16);
  transform: scale(1.04);
}

.prep-item-icon {
  font-size: 28px;
  line-height: 1;
}

.prep-item-img {
  width: 70%;
  height: 70%;
  max-width: 52px;
  max-height: 52px;
  object-fit: contain;
  pointer-events: none;
}

/* 仓库与背包统一放大素材，只调整内容图，不改变格子和文字布局。 */
.prep-wh-layer .prep-item-img,
.prep-bag-zone .prep-item-img {
  width: 100%;
  height: 100%;
  max-width: 64px;
  max-height: 64px;
}

.prep-wh-layer .prep-item-icon,
.prep-bag-zone .prep-item-icon {
  font-size: 32px;
}

.prep-item-qty {
  position: absolute;
  left: 3px;
  right: auto;
  bottom: 3px;
  z-index: 4;
}

.prep-item-name {
  margin-top: 4px;
  width: 100%;
  font-size: var(--fs-micro);
  line-height: 1.25;
  text-align: center;
  color: var(--text-2);
}

/* 批量底栏 */
.batch-bar {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(var(--tabbar-safe-h, var(--tabbar-h)) + 8px);
  z-index: var(--z-sheet);
  width: min(var(--app-w), calc(100% - 24px));
  min-height: 48px;
  height: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 10px;
  border-radius: var(--r-lg);
  background: var(--panel);
  border: 1px solid var(--line-focus);
  box-shadow: var(--sh-2);
  font-size: var(--fs-sub);
  font-weight: var(--fw-b);
}

.batch-bar > span {
  flex: 1 1 auto;
  min-width: 0;
  color: var(--text-2);
}

.batch-bar .btn-discard.active,
.batch-bar .btn-discard {
  color: #ff8a9a;
  border-color: rgba(255, 100, 120, 0.35);
}

.confirm-discard-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 4px 2px 8px;
}
.confirm-discard-body p {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-2);
}
.confirm-discard-body .confirm-discard-warn {
  color: #ff8a9a;
  font-size: 12px;
}
.confirm-discard-actions {
  display: flex;
  gap: 10px;
}
.confirm-discard-actions .btn-block {
  flex: 1;
}

.prep-panel:has(+ *) {
  /* spacer when batch bar visible handled by padding on home-page via class if needed */
}

html:has(.home-page),
body:has(.home-page) {
  overflow: hidden;
  height: 100%;
}

/* 物品详情标签（保留） */
.prep-item-tags,
.item-detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  justify-content: center;
  width: 100%;
  margin-top: 3px;
}

.item-detail-tags {
  margin-top: 8px;
}

.item-tag.tag-material {
  color: #8ce99a;
  background: rgba(140, 233, 154, 0.12);
  border: 1px solid rgba(140, 233, 154, 0.25);
}
.item-tag.tag-weapon {
  color: #74c0fc;
  background: rgba(116, 192, 252, 0.1);
  border: 1px solid rgba(116, 192, 252, 0.25);
}
.item-tag.tag-armor {
  color: #b197fc;
  background: rgba(177, 151, 252, 0.1);
  border: 1px solid rgba(177, 151, 252, 0.25);
}
.item-tag.tag-gloves,
.item-tag.tag-legs,
.item-tag.tag-helmet {
  color: #91a7ff;
  background: rgba(145, 167, 255, 0.1);
  border: 1px solid rgba(145, 167, 255, 0.25);
}
.item-tag.tag-accessory {
  color: #ffd43b;
  background: rgba(255, 212, 59, 0.08);
  border: 1px solid rgba(255, 212, 59, 0.22);
}
.item-tag.tag-skill {
  color: #63e6be;
  background: rgba(99, 230, 190, 0.08);
  border: 1px solid rgba(99, 230, 190, 0.22);
}
