/* ==========================================================================
   HELLDIVERS 2 DESIGN SYSTEM & STYLE SYSTEM
   ========================================================================== */

:root {
  --color-yellow: #ffe600;
  --color-yellow-glow: rgba(255, 230, 0, 0.4);
  --color-yellow-dim: #cca800;
  --color-bg-darkest: #07090b;
  --color-bg-dark: #0f1317;
  --color-bg-panel: #161c22;
  --color-bg-card: #1f2730;
  --color-border: #2e3b48;
  --color-text-bright: #ffffff;
  --color-text-dim: #9aa7b5;
  --color-red: #ff3333;
  --color-red-glow: rgba(255, 51, 51, 0.4);
  --font-display: 'Orbitron', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-body: 'Montserrat', sans-serif;
  --glow-shadow: 0 0 10px var(--color-yellow-glow);
  --glow-shadow-intense: 0 0 20px rgba(255, 230, 0, 0.7);
}

/* ==========================================================================
   RESET & BASE STYLES
   ========================================================================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none; /* 防止文字选中破坏沉浸感 */
}

body {
  background-color: var(--color-bg-darkest);
  color: var(--color-text-dim);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  padding: 20px;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* ==========================================================================
   HOLOGRAPHIC & CRT EFFECTS
   ========================================================================== */

/* 全息背景扫描线 */
.crt-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
  background-size: 100% 4px, 6px 100%;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.8;
}

/* CRT 闪烁与全息发光 */
.hologram-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 230, 0, 0.015);
  box-shadow: inset 0 0 80px rgba(255, 230, 0, 0.1);
  z-index: 9998;
  pointer-events: none;
  animation: crt-flicker 0.15s infinite;
}

@keyframes crt-flicker {
  0% { opacity: 0.98; }
  50% { opacity: 1; }
  100% { opacity: 0.99; }
}

/* 科幻字体类 */
.font-orbitron {
  font-family: var(--font-display);
  letter-spacing: 1px;
}

.glow-yellow {
  color: var(--color-yellow);
  text-shadow: 0 0 8px var(--color-yellow-glow);
}

.hidden {
  display: none !important;
}

/* ==========================================================================
   CONTAINER
   ========================================================================== */
.terminal-container {
  width: 100%;
  max-width: 1200px;
  background-color: var(--color-bg-dark);
  border: 2px solid var(--color-border);
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.5), inset 0 0 15px rgba(255, 230, 0, 0.05);
  padding: 24px;
  position: relative;
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* 装饰性外框边角 */
.terminal-container::before, .terminal-container::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  border-color: var(--color-yellow);
  border-style: solid;
  pointer-events: none;
}
.terminal-container::before {
  top: -2px; left: -2px;
  border-width: 4px 0 0 4px;
}
.terminal-container::after {
  bottom: -2px; right: -2px;
  border-width: 0 4px 4px 0;
}

/* ==========================================================================
   HEADER
   ========================================================================== */
.terminal-header {
  display: flex;
  align-items: center;
  border-bottom: 2px solid var(--color-border);
  padding-bottom: 16px;
  gap: 16px;
}

.skull-svg {
  filter: drop-shadow(0 0 5px var(--color-yellow-glow));
}

.header-text {
  flex: 1;
}

.header-text h1 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 900;
}

.header-text .subtitle {
  font-size: 12px;
  color: var(--color-text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.header-status {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
}

.status-dot {
  width: 8px;
  height: 8px;
  background-color: var(--color-yellow);
  border-radius: 50%;
  box-shadow: 0 0 6px var(--color-yellow);
}

.pulsing {
  animation: pulse 1.5s infinite;
}

.pool-count-dot {
  background-color: #00ff66;
  box-shadow: 0 0 6px #00ff66;
}

.pool-count-dot.empty {
  background-color: var(--color-red);
  box-shadow: 0 0 6px var(--color-red);
}

@keyframes pulse {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.2); opacity: 0.4; }
  100% { transform: scale(1); opacity: 1; }
}

/* ==========================================================================
   ACTIVE LOADOUT CARDS (FOUR SLOTS)
   ========================================================================== */
.active-loadout-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.loadout-slot-card {
  background-color: var(--color-bg-panel);
  border: 1px solid var(--color-border);
  border-radius: 2px;
  padding: 16px;
  position: relative;
  display: flex;
  flex-direction: column;
  height: 250px;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.4);
}

/* 卡槽悬停效果 */
.loadout-slot-card:hover {
  border-color: var(--color-yellow-dim);
  box-shadow: 0 0 12px rgba(255, 230, 0, 0.1), inset 0 0 10px rgba(0, 0, 0, 0.4);
}

.slot-number {
  font-size: 11px;
  color: var(--color-text-dim);
  margin-bottom: 12px;
  font-weight: 600;
  border-bottom: 1px dashed var(--color-border);
  padding-bottom: 4px;
}

.slot-body {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  overflow: hidden;
}

/* 卡槽空闲雷达扫描动画 */
.slot-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-align: center;
  width: 100%;
  height: 100%;
}

.radar-scan {
  width: 50px;
  height: 50px;
  border: 1px solid var(--color-border);
  border-radius: 50%;
  position: relative;
  background: radial-gradient(circle, rgba(255, 230, 0, 0.02) 0%, rgba(255, 230, 0, 0.1) 80%, transparent 100%);
}

.radar-scan::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  border-radius: 50%;
  border: 1px solid var(--color-yellow);
  border-top-color: transparent;
  border-left-color: transparent;
  animation: spin 3s linear infinite;
  box-shadow: 0 0 6px var(--color-yellow-glow);
}

@keyframes spin {
  100% { transform: rotate(360deg); }
}

.empty-text {
  font-size: 10px;
  color: var(--color-border);
  font-weight: 700;
}

/* 填充状态 */
.slot-fill-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: 100%;
  height: 100%;
  animation: card-appear 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes card-appear {
  0% { transform: scale(0.85) translateY(10px); opacity: 0; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}

.slot-icon-wrapper {
  background-color: var(--color-bg-darkest);
  border: 1px solid var(--color-border);
  padding: 10px;
  width: 70px;
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  border-radius: 2px;
  box-shadow: 0 0 10px rgba(0,0,0,0.5);
  position: relative;
}

.slot-icon {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 0 3px var(--color-yellow-glow));
}

.slot-info {
  width: 100%;
}

.slot-name-zh {
  font-size: 15px;
  font-weight: 900;
  color: var(--color-yellow);
  margin-bottom: 2px;
  text-shadow: 0 0 6px var(--color-yellow-glow);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.slot-name-en {
  font-size: 11px;
  color: var(--color-text-bright);
  font-weight: 600;
  margin-bottom: 6px;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.slot-tag {
  font-size: 9px;
  color: var(--color-text-dim);
  background-color: var(--color-bg-darkest);
  border: 1px solid var(--color-border);
  padding: 2px 6px;
  border-radius: 10px;
  font-weight: 600;
  text-transform: uppercase;
}

/* 锁定按钮 */
.lock-btn {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: 85%;
  background: transparent;
  border: 1px solid var(--color-border);
  color: var(--color-text-dim);
  padding: 6px 12px;
  border-radius: 2px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.lock-btn:hover {
  background-color: rgba(255, 230, 0, 0.05);
  border-color: var(--color-yellow-dim);
  color: var(--color-yellow);
}

.lock-icon {
  fill: var(--color-text-dim);
  transition: all 0.2s ease;
}

.lock-btn:hover .lock-icon {
  fill: var(--color-yellow);
}

.lock-text {
  font-size: 10px;
  font-weight: 700;
}

/* 锁定状态的卡槽样式 */
.loadout-slot-card.locked {
  border-color: var(--color-yellow);
  box-shadow: 0 0 15px rgba(255, 230, 0, 0.2), inset 0 0 10px rgba(0, 0, 0, 0.4);
}

.loadout-slot-card.locked .lock-btn {
  background-color: var(--color-yellow);
  border-color: var(--color-yellow);
  color: var(--color-bg-darkest);
}

.loadout-slot-card.locked .lock-icon {
  fill: var(--color-bg-darkest) !important;
}

/* 老虎机快速抽卡滚动效果 */
.loadout-slot-card.rolling {
  animation: roll-shuffle 0.08s infinite alternate ease-in-out;
}

@keyframes roll-shuffle {
  0% { transform: translateY(-2px) scale(0.99); filter: blur(0.5px); }
  100% { transform: translateY(2px) scale(1.01); filter: blur(1px); }
}

/* ==========================================================================
   ROLL DEPLOY BUTTON & CONSOLE LOGS
   ========================================================================== */
.control-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* 巨型部署按钮 */
.deploy-btn {
  position: relative;
  width: 100%;
  height: 60px;
  background-color: var(--color-yellow);
  border: none;
  cursor: pointer;
  overflow: hidden;
  border-radius: 2px;
  box-shadow: var(--glow-shadow);
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.deploy-btn::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  border: 1px solid var(--color-yellow);
  box-shadow: inset 0 0 15px rgba(255, 255, 255, 0.4);
  pointer-events: none;
}

/* 警戒黄黑斜条纹 */
.stripe-bg {
  position: absolute;
  top: 0; left: 0;
  width: 200%; height: 100%;
  background: repeating-linear-gradient(
    45deg,
    var(--color-yellow),
    var(--color-yellow) 15px,
    #000000 15px,
    #000000 30px
  );
  opacity: 0.12;
  transition: transform 0.5s linear;
}

.deploy-btn:hover .stripe-bg {
  transform: translateX(-50px);
}

.deploy-btn:hover {
  background-color: #fff066;
  box-shadow: var(--glow-shadow-intense);
  transform: translateY(-1px);
}

.deploy-btn:active {
  transform: translateY(1px);
  box-shadow: var(--glow-shadow);
}

.btn-text {
  position: relative;
  z-index: 10;
  font-size: 18px;
  font-weight: 900;
  color: #000000;
  text-shadow: 0 0 1px rgba(255, 255, 255, 0.5);
}

/* 诊断信息后台终端 */
.diagnostic-console {
  background-color: var(--color-bg-darkest);
  border: 1px solid var(--color-border);
  padding: 12px 16px;
  height: 90px;
  border-radius: 2px;
  overflow-y: auto;
  font-family: var(--font-display);
}

.console-title {
  font-size: 10px;
  color: var(--color-yellow-dim);
  font-weight: 700;
  margin-bottom: 6px;
}

.console-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.console-line {
  font-size: 11px;
  color: var(--color-yellow);
  text-shadow: 0 0 3px rgba(255, 230, 0, 0.2);
  word-break: break-all;
}

.console-line.text-dim {
  color: var(--color-text-dim);
  text-shadow: none;
}

.console-line.text-success {
  color: #00ff66;
  text-shadow: 0 0 3px rgba(0, 255, 102, 0.2);
}

.console-line.text-error {
  color: var(--color-red);
  text-shadow: 0 0 3px var(--color-red-glow);
}

/* ==========================================================================
   POOL CONFIGURATION SECTION
   ========================================================================== */
.pool-management-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
  border-top: 1px solid var(--color-border);
  padding-top: 24px;
}

.section-title-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.section-title-bar h2 {
  font-size: 15px;
  font-weight: 800;
}

.bulk-actions {
  display: flex;
  gap: 10px;
}

.bulk-btn {
  background-color: transparent;
  border: 1px solid var(--color-border);
  color: var(--color-text-bright);
  font-size: 10px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 2px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.bulk-btn:hover {
  background-color: var(--color-bg-panel);
  border-color: var(--color-yellow-dim);
  color: var(--color-yellow);
}

/* 各分类分组的网格容器 */
.category-groups-container {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.category-group {
  border: 1px solid var(--color-border);
  background-color: rgba(22, 28, 34, 0.3);
  padding: 16px;
  position: relative;
  border-radius: 2px;
}

.category-title {
  position: absolute;
  top: -10px;
  left: 12px;
  background-color: var(--color-bg-dark);
  padding: 0 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--color-yellow);
  text-shadow: 0 0 5px var(--color-yellow-glow);
}

.category-header-controls {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 12px;
}

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

/* 备选卡牌小卡 */
.pool-item-card {
  background-color: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: 2px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

.pool-item-card:hover {
  border-color: var(--color-yellow-dim);
  box-shadow: 0 0 8px rgba(255, 230, 0, 0.08);
}

.pool-item-icon-wrapper {
  width: 36px;
  height: 36px;
  background-color: var(--color-bg-darkest);
  border: 1px solid var(--color-border);
  border-radius: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.pool-item-icon {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.pool-item-details {
  flex: 1;
  min-width: 0;
}

.pool-item-name-zh {
  font-size: 12px;
  font-weight: 700;
  color: var(--color-text-bright);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: all 0.2s ease;
}

.pool-item-name-en {
  font-size: 9px;
  color: var(--color-text-dim);
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 自定义复选框点缀 */
.checkbox-indicator {
  width: 12px;
  height: 12px;
  border: 1px solid var(--color-border);
  border-radius: 1px;
  flex-shrink: 0;
  position: relative;
  background-color: var(--color-bg-darkest);
  transition: all 0.2s ease;
}

/* 激活状态 */
.pool-item-card.active {
  border-color: var(--color-yellow);
  box-shadow: 0 0 10px rgba(255, 230, 0, 0.1);
}

.pool-item-card.active .pool-item-icon-wrapper {
  border-color: var(--color-yellow);
}

.pool-item-card.active .pool-item-icon {
  filter: drop-shadow(0 0 2px var(--color-yellow-glow));
}

.pool-item-card.active .pool-item-name-zh {
  color: var(--color-yellow);
  text-shadow: 0 0 4px var(--color-yellow-glow);
}

.pool-item-card.active .checkbox-indicator {
  border-color: var(--color-yellow);
  background-color: var(--color-yellow);
  box-shadow: 0 0 6px var(--color-yellow-glow);
}

.pool-item-card.active .checkbox-indicator::after {
  content: '';
  position: absolute;
  top: 2px; left: 2px;
  width: 6px; height: 6px;
  background-color: var(--color-bg-darkest);
}

/* 禁用/置灰状态 */
.pool-item-card.disabled {
  opacity: 0.35;
}

.pool-item-card.disabled:hover {
  opacity: 0.55;
  border-color: var(--color-border);
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.terminal-footer {
  display: flex;
  justify-content: space-between;
  border-top: 1px solid var(--color-border);
  padding-top: 12px;
  font-family: var(--font-display);
  font-size: 10px;
  color: var(--color-border);
  font-weight: 700;
}

.separator {
  margin: 0 8px;
}

/* ==========================================================================
   RESPONSIVE DESIGN (自适应调节)
   ========================================================================== */
@media (max-width: 1024px) {
  .active-loadout-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .loadout-slot-card {
    height: 220px;
  }
}

@media (max-width: 768px) {
  body {
    padding: 10px;
  }
  .terminal-container {
    padding: 16px;
    gap: 16px;
  }
  .terminal-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .header-status {
    flex-direction: row;
    justify-content: space-between;
    width: 100%;
  }
  .category-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .active-loadout-grid {
    grid-template-columns: 1fr;
  }
  .loadout-slot-card {
    height: 200px;
  }
}
