/* 模型和技能资料紧邻左侧名册，右侧留给后续技能操作。 */
:root { --inspector-top: 112px; }
.tank-card.chosen { border-color: #f2d27e; background: #6b5a2a55; box-shadow: inset 3px 0 #f2d27e; }
#tank-inspector {
  position: fixed; top: var(--inspector-top);
  width: clamp(205px, 18vw, 285px); max-height: calc(100vh - var(--inspector-top) - 85px);
  padding: 0 8px 12px; overflow-y: auto; z-index: 11;
  scrollbar-width: thin; scrollbar-color: #6d795044 transparent;
}
#tank-inspector { left: calc(var(--panel-w) + 12px); width: clamp(170px, 14vw, 240px); }
#tank-skills { margin-top: 9px; }
#tank-skills .tank-metrics { margin-top: 0; flex-wrap: wrap; }
#tank-skills .skill-heading b { font-size: 18px; }
#roster-list { min-height: 0; }
.inspector-heading { padding: 0 7px; }
.inspector-heading h2 { margin: 0 0 7px; font-size: 23px; font-weight: 650; letter-spacing: 2px; }
#tank-context { color: #98a48c; font-size: 11px; }
#model-stage { position: relative; height: clamp(125px, 25vh, 205px); margin-top: 4px; background: radial-gradient(ellipse at 50% 68%, #49563d33, transparent 70%); }
#model-canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; }
#model-canvas:active { cursor: grabbing; }
#model-empty { position: absolute; inset: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: #a7b09c; font-size: 11px; }
#model-empty[hidden] { display: none; }
.fallback-tank { width: 135px; height: 135px; background-size: 200% 200%; background-repeat: no-repeat; }
.model-tools { display: flex; justify-content: space-between; align-items: center; padding: 0 7px; color: #849177; font-size: 10px; }
.model-tools button { padding: 2px 7px; font-size: 10px; border-color: #69765655; }
.tank-metrics { display: flex; justify-content: space-between; gap: 16px; margin: 7px 0; padding: 6px 7px; border-bottom: 1px solid #b4ba9b26; }
.tank-metrics div { display: flex; gap: 8px; align-items: baseline; }
.tank-metrics small { color: #8e9a83; font-size: 11px; }
.tank-metrics strong { font-size: 15px; font-weight: 550; }
.skill-section { padding: 0 7px; }
.skill-heading { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: 12px; }
#skill-status { color: #c2a772; font-size: 10px; }
#tank-description { color: #b9c3ab; font-size: 12px; line-height: 1.8; margin: 10px 0 0; white-space: pre-line; }
#model-loading { position: fixed; inset: 0; z-index: 100; background: #151d17f5; color: #dfd5ac; display: grid; place-items: center; padding: 40px; }
#model-loading[hidden] { display: none; }
@media (max-width: 1200px) {
  #model-stage { height: clamp(115px, 23vh, 165px); }
  .inspector-heading h2 { font-size: 20px; }
  .tank-metrics { gap: 6px; }
  .tank-metrics div { gap: 4px; }
}
/* 空间较窄时预览放进左栏顶部，避免在棋盘上叠出第二列。 */
@media (max-width: 1050px) {
  #tank-inspector {
    position: relative; left: auto; top: auto; width: 100%; max-height: 48vh;
    flex: 0 0 auto; padding: 6px 0 9px; overflow-y: auto;
    border-bottom: 1px solid #b4ba9b26;
  }
  #model-stage { height: clamp(95px, 18vh, 150px); }
  .inspector-heading h2 { font-size: 17px; margin-bottom: 4px; }
  #tank-context { font-size: 10px; }
  .model-tools { padding: 0; font-size: 9px; }
}
@media (max-width: 900px) {
  .tank-metrics { flex-wrap: wrap; margin: 7px 0; padding: 5px 0; }
  #tank-description { font-size: 11px; }
  .skill-heading { flex-wrap: wrap; }
}

#airdrop-controls { margin-top: 8px; }
#airdrop-controls[hidden] { display: none; }
#btn-airdrop { width: 100%; border-color: #c2a772; padding: 9px 10px; }
#airdrop-status { display: block; color: #aeb99f; font-size: 11px; line-height: 1.6; margin-top: 6px; }

/* 通信技能优先露出操作按钮：指标单行，正文紧凑，保留易读字号。 */
#tank-inspector.is-comms .tank-metrics { flex-wrap: nowrap; gap: 6px; }
#tank-inspector.is-comms .tank-metrics div { gap: 4px; white-space: nowrap; }
#tank-inspector.is-comms #tank-description { font-size: 11px; line-height: 1.55; margin-top: 6px; }
#tank-inspector.is-comms .inspector-heading h2 { margin-bottom: 3px; }
#tank-inspector.is-comms #tank-skills { margin-top: 6px; }
@media (max-height: 760px) and (min-width: 1051px) {
  #tank-inspector.is-comms #model-stage { height: 120px; }
}
@media (max-width: 1050px) {
  #tank-inspector.is-comms { max-height: min(70vh, 470px); }
  #tank-inspector.is-comms #model-stage { height: 95px; }
}

/* 技能工作区：同一页完整展示；模型利用余量，按钮固定在说明下方的底部。 */
#tank-inspector, #tank-inspector.is-comms {
  height: calc(100dvh - var(--inspector-top) - 54px); max-height: none;
  display: flex; flex-direction: column; overflow: hidden; padding-bottom: 8px;
}
.inspector-heading, .model-tools { flex: 0 0 auto; }
#model-stage, #tank-inspector.is-comms #model-stage { flex: 1 1 205px; height: auto; min-height: 72px; max-height: 230px; }
#tank-skills, #tank-inspector.is-comms #tank-skills { flex: 0 0 auto; margin-top: 8px; }
#tank-skills .tank-metrics { flex-wrap: nowrap; gap: 6px; margin: 0 0 8px; padding: 6px 4px; }
.tank-metrics div { gap: 4px; white-space: nowrap; }
#tank-description, #tank-inspector.is-comms #tank-description { font-size: 12px; line-height: 1.65; margin-top: 8px; }
#skill-controls { margin-top: 12px; min-height: 78px; }
#skill-buttons { display: flex; flex-wrap: wrap; gap: 6px; }
.skill-button { position: relative; flex: 1 1 calc(50% - 6px); display: flex; align-items: center; justify-content: center; gap: 5px; min-width: 0; padding: 7px 4px; font-size: 11px; border: 1px solid #c4aa69; border-radius: 5px; background: #293022; isolation: isolate; }
.skill-button:disabled { opacity: .45; cursor: default; }
.skill-icon { position: relative; display: grid; place-items: center; flex: 0 0 29px; height: 29px; border: 1px solid #b4a274; border-radius: 4px; background: radial-gradient(circle,#777a58,#283022); color: #eee0b0; font-size: 22px; overflow: hidden; }
.skill-cooling .skill-icon::after { content: ''; position: absolute; inset: 0; background: conic-gradient(#090e15bf var(--cooldown-angle), transparent 0); }
.skill-count { position: absolute; z-index: 1; inset: 0; display: grid; place-items: center; font: bold 18px sans-serif; color: white; text-shadow: 0 1px 3px #000; }
#skill-feedback { display: block; margin-top: 6px; font-size: 10px; line-height: 1.45; color: #aeb99f; }
.skill-reactive { color: #fff3bd; border-color: #ffe28d; background: #4c4725; box-shadow: 0 0 12px #efcd6a77; }
.skill-reactive::before { content: ''; position: absolute; inset: -3px; border: 2px dashed #ffe7a2; border-radius: 7px; pointer-events: none; animation: armor-border 1.2s linear infinite; }
@keyframes armor-border { 0% {clip-path:inset(0 0 65% 0)} 25% {clip-path:inset(0 0 0 65%)} 50% {clip-path:inset(65% 0 0 0)} 75% {clip-path:inset(0 65% 0 0)} 100% {clip-path:inset(0 0 65% 0)} }
@media(prefers-reduced-motion:reduce){.skill-reactive::before{animation:none;}}
@media(max-width:1050px){
  #tank-inspector, #tank-inspector.is-comms { height: min(72dvh,620px); max-height: none; flex: 0 0 auto; }
  #model-stage, #tank-inspector.is-comms #model-stage { max-height: 150px; }
}

#tank-skills, #tank-inspector.is-comms #tank-skills { margin-top: auto; padding-top: 8px; }

@property --armor-angle { syntax: '<angle>'; initial-value: 0deg; inherits: false; }
.skill-reactive::before {
  border: 0; padding: 2px; clip-path: none;
  background: conic-gradient(from var(--armor-angle), #8f783422 45%, #ffeab0 72%, #fff5d1 78%, #8f783422 95%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  animation: armor-orbit 1.5s linear infinite;
}
@keyframes armor-orbit { to { --armor-angle: 360deg; } }
@media(prefers-reduced-motion:reduce){.skill-reactive::before{animation:none;}}
