/* ===== 賽博龐克個人資料系統 ===== */
:root {
  /* 賽博龐克主色調 */
  --cyber-primary: #ff006e;
  --cyber-secondary: #00f5ff;
  --cyber-accent: #bf00ff;
  --cyber-warning: #ffaa00;
  --cyber-success: #00ff41;
  --cyber-danger: #ff0040;

  /* 霓虹發光色 */
  --neon-pink: #ff006e;
  --neon-blue: #00f5ff;
  --neon-purple: #bf00ff;
  --neon-green: #00ff41;
  --neon-yellow: #ffde00;

  /* 背景色 */
  --bg-dark: #0a0a0f;
  --bg-darker: #050507;
  --bg-card: #0f0f1a;
  --bg-hover: #1a1a2e;
  --bg-glass: rgba(15, 15, 26, 0.85);

  /* 邊框和線條 */
  --border-neon: #00f5ff;
  --border-dim: rgba(0, 245, 255, 0.2);
  --grid-color: rgba(0, 245, 255, 0.1);

  /* 文字色彩 */
  --text-primary: #ffffff;
  --text-secondary: #00f5ff;
  --text-muted: #8b8b9a;

  /* 發光效果 */
  --glow-pink: 0 0 20px #ff006e, 0 0 40px #ff006e, 0 0 60px #ff006e;
  --glow-blue: 0 0 20px #00f5ff, 0 0 40px #00f5ff, 0 0 60px #00f5ff;
  --glow-purple: 0 0 20px #bf00ff, 0 0 40px #bf00ff, 0 0 60px #bf00ff;
  --glow-small: 0 0 10px currentColor;
  --glow-medium: 0 0 20px currentColor;
  --glow-large: 0 0 30px currentColor;

  /* 字體變數已移至全域CSS */

  /* 動畫時間 */
  --trans-fast: 0.2s ease;
  --trans-normal: 0.3s ease;
  --trans-slow: 0.5s ease;
}

/* ===== 全局樣式 ===== */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  background-color: var(--bg-darker);
  color: var(--text-primary);
  font-size: 16px;
  line-height: 1.5;
  min-height: 100vh;
  position: relative;
}

/* 賽博龐克背景效果 */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(ellipse at top, rgba(191, 0, 255, 0.1) 0%, transparent 50%),
    radial-gradient(
      ellipse at bottom,
      rgba(0, 245, 255, 0.1) 0%,
      transparent 50%
    );
  pointer-events: none;
  z-index: 0;
}

/* 網格背景 */
body::after {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image:
    linear-gradient(var(--grid-color) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-color) 1px, transparent 1px);
  background-size: 50px 50px;
  background-position: -1px -1px;
  pointer-events: none;
  z-index: 0;
  opacity: 0.5;
  animation: grid-move 10s linear infinite;
}

@keyframes grid-move {
  0% {
    transform: translate(0, 0);
  }

  100% {
    transform: translate(50px, 50px);
  }
}

/* ===== 主容器 ===== */
.cyber-profile {
  width: 100%;
  min-height: 100vh;
  padding: 20px;
  margin-top: 60px;
  position: relative;
  z-index: 1;
  max-width: 1600px;
  margin-left: auto;
  margin-right: auto;
}

/* ===== 用戶資訊面板 ===== */
.user-info-panel {
  background: var(--bg-glass);
  border: 1px solid var(--border-dim);
  padding: 30px;
  margin-bottom: 30px;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(10px);
  clip-path: polygon(
    0 20px,
    20px 0,
    calc(100% - 20px) 0,
    100% 20px,
    100% calc(100% - 20px),
    calc(100% - 20px) 100%,
    20px 100%,
    0 calc(100% - 20px)
  );
}

.panel-border-effect {
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(
    45deg,
    var(--neon-pink),
    var(--neon-blue),
    var(--neon-purple)
  );
  z-index: -1;
  opacity: 0.3;
  filter: blur(8px);
  clip-path: inherit;
}

.scan-line {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--neon-blue),
    transparent
  );
  animation: scan-line 3s linear infinite;
}

@keyframes scan-line {
  0% {
    transform: translateX(-100%);
  }

  100% {
    transform: translateX(100%);
  }
}

.user-primary-data {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 30px;
  align-items: center;
}

/* ===== 頭像系統 ===== */
.avatar-container {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.avatar-hexagon {
  width: 120px;
  height: 120px;
  position: relative;
  clip-path: polygon(
    30% 0%,
    70% 0%,
    100% 30%,
    100% 70%,
    70% 100%,
    30% 100%,
    0% 70%,
    0% 30%
  );
  background: var(--bg-dark);
  border: 2px solid var(--border-neon);
  overflow: hidden;
}

.cyber-avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(1.2) brightness(1.1);
}

.avatar-glow {
  position: absolute;
  top: -4px;
  left: -4px;
  right: -4px;
  bottom: -4px;
  background: linear-gradient(45deg, var(--neon-pink), var(--neon-blue));
  clip-path: inherit;
  z-index: -1;
  opacity: 0.6;
  filter: blur(10px);
  animation: avatar-glow 2s ease-in-out infinite alternate;
}

@keyframes avatar-glow {
  0% {
    opacity: 0.3;
  }

  100% {
    opacity: 0.8;
  }
}

.status-indicator {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  position: absolute;
  bottom: 10px;
  right: 10px;
  border: 2px solid var(--bg-dark);
}

.status-indicator.online {
  background: var(--cyber-success);
  box-shadow: 0 0 5px var(--cyber-success);
  animation: status-pulse 2s infinite;
}

@keyframes status-pulse {
  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.2);
  }
}

/* ===== 用戶身份資料 ===== */
.user-identity {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cyber-title {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: 5px;
}

.cyber-username {
  font-size: 2.5rem;
  font-weight: 900;
  color: var(--text-secondary);
  text-shadow: var(--glow-small);
  margin: 0;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.user-id-code {
  color: var(--text-muted);
  font-size: 0.9rem;
  letter-spacing: 1px;
}

.id-number {
  color: var(--cyber-accent);
  text-shadow: var(--glow-small);
}

.user-metadata {
  display: flex;
  gap: 30px;
  margin-top: 15px;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
}

.meta-item i {
  color: var(--cyber-warning);
  font-size: 1rem;
}

.meta-label {
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 1px;
}

.meta-value {
  color: var(--text-primary);
  font-weight: 700;
}

/* ===== 用戶餘額 ===== */
.user-balance {
  margin-top: 16px;
  margin-bottom: 16px;
}

.balance-container::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--cyber-primary),
    transparent
  );
  animation: balanceScan 3s linear infinite;
}

.balance-label {
  font-size: 11px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.6);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.balance-value {
  font-size: 24px;
  font-weight: 900;
  color: var(--cyber-secondary);
  text-shadow: var(--glow-blue);
  margin-top: 4px;
  min-height: 32px;
  /* 🔧 固定最小高度，避免餘額更新時布局跳動 */
  display: flex;
  align-items: center;
}

.balance-refresh {
  background: rgba(255, 0, 110, 0.1);
  border: 1px solid rgba(255, 0, 110, 0.3);
  border-radius: 6px;
  color: var(--cyber-primary);
  padding: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 12px;
}

.balance-refresh:hover {
  background: rgba(255, 0, 110, 0.2);
  box-shadow: 0 0 5px var(--glow-pink);
  transform: translateY(-1px);
}

.balance-refresh.spinning {
  animation: spin 1s linear infinite;
}

@keyframes balanceScan {
  0% {
    left: -100%;
  }

  100% {
    left: 100%;
  }
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

/* ===== 用戶操作按鈕 ===== */
.user-actions {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.cyber-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-dim);
  padding: 12px 20px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all var(--trans-normal);
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 140px;
  justify-content: center;
}

.cyber-btn:hover .btn-glow {
  left: 100%;
}

.cyber-btn.primary {
  border-color: var(--cyber-primary);
  color: var(--cyber-primary);
}

.cyber-btn.primary:hover {
  background: var(--bg-dark);
  color: var(--text-primary);
}

.cyber-btn.secondary {
  border-color: var(--cyber-secondary);
  color: var(--cyber-secondary);
}

.cyber-btn.secondary:hover {
  background: var(--bg-dark);
  color: var(--text-primary);
}

/* ===== 統計數據矩陣 ===== */
.stats-matrix {
  margin-bottom: 30px;
}

.matrix-title {
  font-size: 1.2rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text-secondary);
  margin-bottom: 25px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.title-glyph {
  color: var(--cyber-primary);
  animation: blink 1s infinite;
}

@keyframes blink {
  0%,
  50% {
    opacity: 1;
  }

  51%,
  100% {
    opacity: 0;
  }
}

/* ===== 等級模組 ===== */
.level-module {
  background: var(--bg-glass);
  border: 1px solid var(--border-dim);
  padding: 25px;
  margin-bottom: 25px;
  position: relative;
  backdrop-filter: blur(10px);
  overflow: hidden;
}

.module-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.module-label {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 2px;
}

.level-display {
  display: flex;
  align-items: baseline;
  gap: 5px;
}

.level-prefix {
  font-size: 1rem;
  color: var(--text-muted);
  font-weight: 600;
}

.level-number {
  font-size: 2rem;
  font-weight: 900;
  color: var(--cyber-success);
  text-shadow: var(--glow-small);
}

.exp-system {
  position: relative;
}

.exp-bar-container {
  position: relative;
  margin-bottom: 15px;
  height: 14px;
  /* 🔧 固定容器高度，避免布局跳動 */
}

.exp-bar-track {
  width: 100%;
  height: 12px;
  background: var(--bg-dark);
  border: 1px solid var(--border-dim);
  position: relative;
  overflow: hidden;
}

.exp-bar-fill {
  height: 100%;
  background: var(--cyber-success);
  width: 0%;
  transition: width 1s ease;
  position: relative;
}

.exp-bar-glow {
  /* 完全移除所有顏色和特效 */
  display: none;
}

.exp-data {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.exp-current {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--text-primary);
  font-weight: 600;
}

.exp-separator {
  color: var(--text-muted);
}

.exp-unit {
  color: var(--cyber-warning);
  font-weight: 700;
}

.exp-percentage {
  color: var(--cyber-success);
  font-weight: 700;
}

/* ===== 等級升級信息 ===== */
.level-up-info {
  margin-top: 15px;
  padding: 12px 16px;
  background: linear-gradient(135deg, var(--bg-glass), var(--bg-dark));
  border: 1px solid var(--border-dim);
  border-radius: 8px;
  backdrop-filter: blur(5px);
}

.level-status {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.level-status.max-level {
  text-align: center;
  color: var(--cyber-warning);
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.level-status.max-level i {
  color: #ffd700;
  font-size: 1.1rem;
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.next-level-info .label {
  display: block;
  margin-bottom: 8px;
  color: var(--text-muted);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.requirements {
  display: flex;
  align-items: center;
  gap: 15px;
  flex-wrap: wrap;
}

.xp-req {
  color: var(--cyber-primary);
  font-weight: 600;
  font-size: 0.95rem;
}

.usd-req {
  color: var(--cyber-warning);
  font-weight: 700;
  font-size: 1rem;
  padding: 4px 8px;
  background: rgba(255, 165, 2, 0.1);
  border: 1px solid rgba(255, 165, 2, 0.3);
  border-radius: 4px;
  text-shadow: var(--glow-small);
}

/* ===== 統計數據網格 ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
}

.stat-module {
  background: var(--bg-card);
  border: 1px solid var(--border-dim);
  padding: 20px;
  position: relative;
  overflow: hidden;
  transition: all var(--trans-normal);
  display: flex;
  align-items: center;
  gap: 20px;
}

.stat-module:hover {
  border-color: var(--border-neon);
  box-shadow: inset 0 0 5px rgba(0, 245, 255, 0.1);
}

.stat-border-effect {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--cyber-secondary),
    transparent
  );
  animation: stat-scan 3s linear infinite;
}

@keyframes stat-scan {
  0% {
    transform: translateX(-100%);
  }

  100% {
    transform: translateX(100%);
  }
}

.stat-icon-container {
  width: 50px;
  height: 50px;
  background: var(--bg-dark);
  border: 1px solid var(--border-neon);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  clip-path: polygon(
    20% 0%,
    80% 0%,
    100% 20%,
    100% 80%,
    80% 100%,
    20% 100%,
    0% 80%,
    0% 20%
  );
}

.stat-icon-container i {
  font-size: 20px;
  color: var(--cyber-secondary);
}

/* 自定義 SVG 圖標樣式 */
.stat-custom-icon {
  width: 45px;
  height: 45px;
  transition: all var(--trans-normal);
}

.stat-module:hover .stat-custom-icon {
  transform: scale(1.1);
}

.icon-pulse {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: transparent;
  border-radius: 0;
  z-index: -1;
  opacity: 0.6;
  box-shadow:
    0 0 8px var(--cyber-secondary),
    0 0 10px var(--cyber-secondary),
    inset 0 0 8px rgba(0, 245, 255, 0.2);
  animation: icon-pulse 2s ease-in-out infinite;
}

@keyframes icon-pulse {
  0%,
  100% {
    opacity: 0.4;
    box-shadow:
      0 0 6px var(--cyber-secondary),
      0 0 12px var(--cyber-secondary),
      inset 0 0 6px rgba(0, 245, 255, 0.1);
  }

  50% {
    opacity: 0.8;
    box-shadow:
      0 0 12px var(--cyber-secondary),
      0 0 24px var(--cyber-secondary),
      0 0 36px rgba(0, 245, 255, 0.3),
      inset 0 0 12px rgba(0, 245, 255, 0.3);
  }
}

.stat-data {
  flex: 1;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 1px;
  margin-bottom: 5px;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--text-primary);
  text-shadow: var(--glow-small);
  min-height: 2rem;
  /* 🔧 固定最小高度，避免數字變化時布局跳動 */
  display: flex;
  align-items: center;
}

/* ===== 購買監控系統 ===== */
.purchase-monitor {
  background: var(--bg-glass);
  border: 1px solid var(--border-dim);
  padding: 25px;
  margin-bottom: 30px;
  backdrop-filter: blur(10px);
}

.monitor-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.header-title {
  font-size: 1.1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 10px;
}

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

.no-purchases-state {
  text-align: center;
  padding: 40px;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
}

.no-purchases-state i {
  font-size: 3rem;
  color: var(--border-dim);
}

/* ===== 庫存系統 ===== */
.inventory-system {
  background: var(--bg-glass);
  border: 1px solid var(--border-dim);
  padding: 25px;
  backdrop-filter: blur(10px);
  position: relative;
  overflow: hidden;
}

.system-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
  flex-wrap: wrap;
  gap: 20px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 20px;
}

.system-title {
  font-size: 1.2rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 10px;
}

.inventory-controls {
  display: flex;
  gap: 20px;
  align-items: center;
}

/* ===== 賽博龐克控制元件 ===== */
.cyber-refresh-btn,
.cyber-search,
.cyber-sort {
  position: relative;
}

.cyber-refresh-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-dim);
  padding: 10px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--trans-normal);
}

.cyber-refresh-btn:hover {
  border-color: var(--border-neon);
  color: var(--text-primary);
  box-shadow: 0 0 5px var(--cyber-primary);
}

.refresh-glow {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    45deg,
    transparent,
    rgba(0, 245, 255, 0.2),
    transparent
  );
  opacity: 0;
  transition: opacity var(--trans-normal);
}

.cyber-refresh-btn:hover .refresh-glow {
  opacity: 1;
}

.cyber-search {
  position: relative;
  display: flex;
  align-items: center;
}

.cyber-search input {
  background: var(--bg-card);
  border: 1px solid var(--border-dim);
  padding: 10px 15px 10px 40px;
  color: var(--text-primary);
  font-size: 0.9rem;
  width: 250px;
  transition: all var(--trans-normal);
}

.cyber-search input:focus {
  outline: none;
}

.cyber-search i {
  position: absolute;
  left: 12px;
  color: var(--text-muted);
  z-index: 1;
}

.search-glow {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(0, 245, 255, 0.1),
    transparent
  );
  opacity: 0;
  animation: search-glow 2s ease-in-out infinite;
  pointer-events: none;
  /* 🔧 讓點擊事件穿過glow效果 */
}

@keyframes search-glow {
  0%,
  100% {
    opacity: 0;
    transform: translateX(-100%);
  }

  50% {
    opacity: 1;
    transform: translateX(100%);
  }
}

.cyber-sort select {
  background: var(--bg-card);
  border: 1px solid var(--border-dim);
  padding: 10px 15px;
  color: var(--text-primary);
  cursor: pointer;
  transition: all var(--trans-normal);
  min-width: 150px;
}

.cyber-sort select:focus {
  outline: none;
}

/* ===== 庫存網格（3:4比例三排布局） ===== */
.cyber-inventory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  grid-template-rows: repeat(3, 240px);
  /* 🔧 明確定義三排，每排240px */
  gap: 20px;
  width: 100%;
  /* 🔧 修復：確保寬度填滿容器 */
  height: 780px;
  /* 🔧 三排容器：240px × 3 + 20px × 2 + 10px + 10px = 780px */
  overflow: hidden;
  /* 🔧 隱藏溢出，不要滾動條 */
  padding: 10px 0;
  /* 🔧 上下各10px空間 */
  align-content: start;
  /* 🔧 內容從頂部開始排列 */
  box-sizing: border-box;
  /* 🔧 確保 padding 計算正確 */
}

/* ===== 固定高度狀態，避免布局跳動 ===== */
.loading-state {
  height: 750px;
  /* 🔧 與庫存網格相同高度 */
  width: 100%;
  /* 🔧 修復：確保寬度填滿容器 */
  box-sizing: border-box;
  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-dim);
  border-radius: 8px;
  margin: 10px 0;
  /* 🔧 修復：讓元素占滿整個網格區域 */
  grid-column: 1 / -1;
  /* 跨越所有列 */
  grid-row: 1 / -1;
  /* 跨越所有行 */
}

.empty-inventory,
.error-message {
  height: 780px;
  /* 🔧 與庫存網格相同高度 */
  width: 100%;
  /* 🔧 修復：確保寬度填滿容器 */
  box-sizing: border-box;
  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 60px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-dim);
  border-radius: 8px;
  position: relative;
  overflow: hidden;
  margin: 10px 0;
  /* 🔧 修復：讓元素占滿整個網格區域 */
  grid-column: 1 / -1;
  /* 跨越所有列 */
  grid-row: 1 / -1;
  /* 跨越所有行 */
}

/* 原本的loading-state已經在上面重新定義，這裡移除重複 */

.cyber-loader {
  position: relative;
  width: 60px;
  height: 60px;
}

.cyber-loader.small {
  width: 30px;
  height: 30px;
}

.loader-ring {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 2px solid transparent;
  border-top: 2px solid var(--cyber-secondary);
  border-right: 2px solid var(--cyber-primary);
  border-radius: 50%;
  animation: loader-spin 1s linear infinite;
}

.loader-core {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 20px;
  height: 20px;
  background: var(--cyber-accent);
  border-radius: 50%;
  animation: core-pulse 1.5s ease-in-out infinite;
}

@keyframes loader-spin {
  0% {
    transform: rotate(0deg);
  }

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

@keyframes core-pulse {
  0%,
  100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }

  50% {
    transform: translate(-50%, -50%) scale(0.5);
    opacity: 0.5;
  }
}

.loading-text {
  color: var(--text-muted);
  letter-spacing: 2px;
  font-weight: 600;
}

/* ===== 空狀態和錯誤狀態（已在上面重新定義，移除重複） ===== */

.empty-inventory::before,
.error-message::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--cyber-primary),
    transparent
  );
  animation: scan-line 2s linear infinite;
}

.empty-inventory {
  color: var(--text-muted);
  font-size: 1.1rem;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.error-message {
  color: var(--cyber-danger);
  font-size: 1rem;
  text-align: center;
  line-height: 1.5;
}

.retry-btn {
  background: var(--bg-dark);
  border: 1px solid var(--cyber-danger);
  color: var(--cyber-danger);
  padding: 10px 20px;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: all var(--trans-normal);
  margin-top: 15px;
}

.retry-btn:hover {
  background: var(--cyber-danger);
  color: var(--text-primary);
  box-shadow: 0 0 5px var(--cyber-danger);
}

/* ===== 庫存物品卡片（3:4寬高比） ===== */
.profile-inventory-item,
.inventory-item {
  background: var(--bg-card);
  border: 1px solid var(--border-dim);
  padding: 0;
  transition: all var(--trans-normal);
  position: relative;
  overflow: hidden;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  height: 240px;
  /* 🔧 桌面版3:4比例：180px寬 → 240px高 */
  border-radius: 8px;
  backdrop-filter: blur(10px);
}

/* 🔧 購買中狀態樣式 */
.profile-inventory-item.purchasing,
.inventory-item.purchasing {
  opacity: 0.5;
  pointer-events: none;
  background: var(--bg-dark);
  border-color: var(--border-dim);
}

.profile-inventory-item.purchasing::before,
.inventory-item.purchasing::before {
  background: linear-gradient(
    45deg,
    transparent,
    rgba(255, 165, 0, 0.1),
    transparent
  );
  opacity: 1;
}

/* 🔧 孤兒購買狀態樣式 */
.profile-inventory-item.orphaned,
.inventory-item.orphaned {
  opacity: 0.6;
  border-color: var(--cyber-warning);
}

.profile-inventory-item::before,
.inventory-item::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    45deg,
    transparent,
    rgba(0, 245, 255, 0.05),
    transparent
  );
  opacity: 0;
  transition: opacity var(--trans-normal);
}

.profile-inventory-item:hover::before,
.inventory-item:hover::before {
  opacity: 1;
}

.profile-inventory-item:hover,
.inventory-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

/* 物品邊框效果 */
.item-border-effect {
  position: absolute;
  top: -1px;
  left: -1px;
  right: -1px;
  bottom: -1px;
  opacity: 0;
  transition: opacity var(--trans-normal);
  z-index: -1;
  border-radius: 8px;
}

/* 稀有度專屬邊框效果 */
.rarity-consumer .item-border-effect {
  background: linear-gradient(45deg, #b0c3d9, #8db5d6, #b0c3d9);
}

.rarity-industrial .item-border-effect {
  background: linear-gradient(45deg, #5e98d9, #4285d6, #5e98d9);
}

.rarity-mil-spec .item-border-effect {
  background: linear-gradient(45deg, #4b69ff, #3654ff, #4b69ff);
}

.rarity-restricted .item-border-effect {
  background: linear-gradient(45deg, #8847ff, #7332ff, #8847ff);
}

.rarity-classified .item-border-effect {
  background: linear-gradient(45deg, #d32ce6, #bf17d3, #d32ce6);
}

.rarity-covert .item-border-effect {
  background: linear-gradient(45deg, #eb4b4b, #d93636, #eb4b4b);
}

.rarity-gold .item-border-effect {
  background: linear-gradient(45deg, #ffd700, #ffcc00, #ffd700);
}

.profile-inventory-item:hover .item-border-effect,
.inventory-item:hover .item-border-effect {
  opacity: 0.2;
}

/* 物品掃描線 */
.item-scan-line {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  animation: item-scan 3s linear infinite;
  opacity: 0;
}

/* 稀有度專屬掃描線顏色 */
.rarity-consumer .item-scan-line {
  background: linear-gradient(90deg, transparent, #b0c3d9, transparent);
}

.rarity-industrial .item-scan-line {
  background: linear-gradient(90deg, transparent, #5e98d9, transparent);
}

.rarity-mil-spec .item-scan-line {
  background: linear-gradient(90deg, transparent, #4b69ff, transparent);
}

.rarity-restricted .item-scan-line {
  background: linear-gradient(90deg, transparent, #8847ff, transparent);
}

.rarity-classified .item-scan-line {
  background: linear-gradient(90deg, transparent, #d32ce6, transparent);
}

.rarity-covert .item-scan-line {
  background: linear-gradient(90deg, transparent, #eb4b4b, transparent);
}

.rarity-gold .item-scan-line {
  background: linear-gradient(90deg, transparent, #ffd700, transparent);
}

.profile-inventory-item:hover .item-scan-line,
.inventory-item:hover .item-scan-line {
  opacity: 0.6;
}

@keyframes item-scan {
  0% {
    transform: translateX(-100%);
  }

  100% {
    transform: translateX(100%);
  }
}

.item-image-container {
  height: 150px;
  /* 🔧 桌面版圖像容器，適配240px總高度 */
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-dark);
  border: 1px solid var(--border-dim);
  position: relative;
  border-radius: 6px;
  overflow: hidden;
}

/* 確保開箱歷史小卡的圖片容器正確置中 */
.case-history-card .item-image-container {
  display: flex;
  align-items: center;
  justify-content: center;
}

.item-image-container img {
  max-width: 85%;
  max-height: 85%;
  object-fit: contain;
  filter: drop-shadow(0 0 8px rgba(0, 245, 255, 0.4));
  transition: all var(--trans-normal);
}

.profile-inventory-item:hover .item-image-container img,
.inventory-item:hover .item-image-container img {
  transform: scale(1.05);
}

.item-glow-effect {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity var(--trans-normal);
}

.item-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 0 15px 15px 15px;
  gap: 5px;
}

.item-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
  text-align: center;
  letter-spacing: 0.5px;
  word-wrap: break-word;
  height: 2.6em;
  /* 🔧 固定高度，約兩行 */
  overflow: hidden;
  /* 🔧 隱藏溢出文字 */
  display: -webkit-box;
  /* 🔧 使用webkit-box布局 */
  -webkit-line-clamp: 2;
  /* 🔧 限制最多顯示2行 */
  -webkit-box-orient: vertical;
  /* 🔧 垂直方向排列 */
}

.item-wear {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.item-price {
  font-size: 1rem;
  font-weight: 700;
  color: var(--cyber-success);
  text-align: center;
  text-shadow: var(--glow-small);
  margin-top: 0;
}

/* ===== 物品操作按鈕 ===== */
.item-action-buttons {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  opacity: 0;
  transition: opacity var(--trans-normal);
  z-index: 10;
}

/* 🔧 物品狀態顯示 */
.item-status {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
  z-index: 10;
}

.item-status .status-text {
  background: var(--bg-glass);
  border: 1px solid var(--cyber-warning);
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 0.75rem;
  color: var(--cyber-warning);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  backdrop-filter: blur(10px);
  white-space: nowrap;
}

.item-status i {
  color: var(--cyber-warning);
  font-size: 0.9rem;
}

.profile-inventory-item:hover .item-action-buttons,
.inventory-item:hover .item-action-buttons {
  opacity: 1;
}

.cyber-action-btn {
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  background: var(--bg-glass);
  border: 1px solid var(--border-dim);
  border-radius: 4px;
  color: var(--text-secondary);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all var(--trans-normal);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  backdrop-filter: blur(10px);
}

.cyber-action-btn:hover {
  border-color: var(--border-neon);
  color: var(--text-primary);
  box-shadow: 0 0 5px var(--glow-blue);
  transform: scale(1.1);
}

.cyber-action-btn .btn-glow {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity var(--trans-normal);
}

.cyber-action-btn:hover .btn-glow {
  opacity: 1;
}

.cyber-action-btn.collect-btn:hover {
  border-color: var(--cyber-success);
  color: var(--cyber-success);
  box-shadow: 0 0 5px var(--cyber-success);
}

.cyber-action-btn.sell-btn {
  background: var(--bg-dark);
  border-color: var(--cyber-primary);
  color: var(--cyber-primary);
}

.cyber-action-btn.sell-btn:hover {
  background: var(--bg-dark);
  box-shadow: 0 0 5px var(--cyber-primary);
  color: var(--cyber-primary);
}

/* 按鈕文字樣式 */
.cyber-action-btn .btn-text {
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: all var(--trans-normal);
}

/* 🔧 新增：對戰分享物品樣式 */
.profile-inventory-item.battle-shared {
  background: linear-gradient(
    135deg,
    rgba(255, 165, 0, 0.15) 0%,
    rgba(255, 140, 0, 0.08) 100%
  );
  border: 1px solid rgba(255, 165, 0, 0.4);
}

/* 📦 箱子物品樣式 */
.cyber-inventory-item.case-item {
  background: linear-gradient(
    135deg,
    rgba(255, 215, 0, 0.15) 0%,
    rgba(255, 140, 0, 0.08) 100%
  );
  border: 1px solid rgba(255, 215, 0, 0.4);
  position: relative;
  overflow: hidden;
}

.cyber-inventory-item.case-item::before {
  content: "📦";
  position: absolute;
  top: 4px;
  right: 4px;
  font-size: 12px;
  opacity: 0.6;
  z-index: 1;
}

.cyber-inventory-item.case-item:hover {
  border-color: rgba(255, 215, 0, 0.8);
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
  transform: translateY(-2px);
}

/* 箱子邊框特效 */
.item-rarity-border.case-border {
  background: linear-gradient(45deg, #ffd700, #ffaa00, #ffd700);
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

/* 箱子圖片容器 */
.case-image-container {
  position: relative;
  background: radial-gradient(
    circle at center,
    rgba(255, 215, 0, 0.1) 0%,
    transparent 70%
  );
}

.case-image {
  filter: drop-shadow(0 0 5px rgba(255, 215, 0, 0.3));
  transition: all var(--trans-normal);
}

.case-item:hover .case-image {
  filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.6));
  transform: scale(1.05);
}

/* 箱子數量顯示 */
.item-quantity {
  position: absolute;
  bottom: 2px;
  right: 2px;
  background: linear-gradient(135deg, #ffd700, #ffaa00);
  color: #000;
  font-size: 10px;
  font-weight: bold;
  padding: 2px 6px;
  border-radius: 10px;
  z-index: 2;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* 箱子詳情樣式 */
.case-details .case-name {
  color: #ffd700;
  font-weight: 600;
  text-shadow: 0 0 5px rgba(255, 215, 0, 0.5);
  /* 🔧 確保箱子名稱在一行顯示，不換行 */
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  line-height: 1.2;
  font-size: 0.75rem; /* 調小字體確保能在一行顯示 */
  max-width: 100%;
}

.case-details .item-type {
  color: var(--cyber-warning);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* 開啟箱子按鈕 */
.open-case-btn {
  background: linear-gradient(135deg, #ffd700, #ffaa00);
  border: 1px solid #ffd700;
  color: #000;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all var(--trans-normal);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

.open-case-btn:hover {
  background: linear-gradient(135deg, #ffaa00, #ffd700);
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.6);
  transform: translateY(-1px);
}

.open-case-btn:active {
  transform: translateY(0);
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

.open-case-btn i {
  font-size: 14px;
}

.profile-inventory-item.battle-shared:hover {
  border-color: rgba(255, 165, 0, 0.7);
  box-shadow: 0 10px 30px rgba(255, 165, 0, 0.2);
}

.profile-inventory-item.battle-shared .item-border-effect {
  background: linear-gradient(
    45deg,
    rgba(255, 165, 0, 0.3),
    rgba(255, 140, 0, 0.4),
    rgba(255, 165, 0, 0.3)
  );
}

.profile-inventory-item.battle-shared .item-scan-line {
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 165, 0, 0.8),
    transparent
  );
}

.battle-shared-notice {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  background: rgba(255, 165, 0, 0.2);
  border: 1px solid rgba(255, 165, 0, 0.4);
  border-radius: 4px;
  color: #ffaa00;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.battle-shared-notice i {
  font-size: 0.8rem;
}

/* ===== 稀有度指示器 ===== */
.item-rarity-indicator {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: var(--border-dim);
  transition: all var(--trans-normal);
}

/* 稀有度樣式 */
.rarity-consumer {
  border-color: #b0c3d9;
}

.rarity-consumer .item-rarity-indicator {
  background: linear-gradient(90deg, #b0c3d9, #8db5d6);
}

.rarity-industrial {
  border-color: #5e98d9;
}

.rarity-industrial .item-rarity-indicator {
  background: linear-gradient(90deg, #5e98d9, #4285d6);
}

.rarity-mil-spec {
  border-color: #4b69ff;
}

.rarity-mil-spec .item-rarity-indicator {
  background: linear-gradient(90deg, #4b69ff, #3654ff);
}

.rarity-restricted {
  border-color: #8847ff;
}

.rarity-restricted .item-rarity-indicator {
  background: linear-gradient(90deg, #8847ff, #7332ff);
}

.rarity-classified {
  border-color: #d32ce6;
}

.rarity-classified .item-rarity-indicator {
  background: linear-gradient(90deg, #d32ce6, #bf17d3);
}

.rarity-covert {
  border-color: #eb4b4b;
}

.rarity-covert .item-rarity-indicator {
  background: linear-gradient(90deg, #eb4b4b, #d93636);
}

.rarity-gold {
  border-color: #ffd700;
}

.rarity-gold .item-rarity-indicator {
  background: linear-gradient(90deg, #ffd700, #ffcc00);
}

/* ===== 稀有度專屬hover效果（輕微炫光） ===== */
.rarity-consumer:hover {
  border-color: #b0c3d9;
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.4),
    0 0 8px rgba(176, 195, 217, 0.3);
}

.rarity-consumer:hover .item-glow-effect {
  background: radial-gradient(
    circle at center,
    rgba(176, 195, 217, 0.08),
    transparent
  );
  opacity: 1;
}

.rarity-consumer:hover .item-image-container img {
  filter: drop-shadow(0 0 8px rgba(176, 195, 217, 0.4));
}

.rarity-industrial:hover {
  border-color: #5e98d9;
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.4),
    0 0 8px rgba(94, 152, 217, 0.3);
}

.rarity-industrial:hover .item-glow-effect {
  background: radial-gradient(
    circle at center,
    rgba(94, 152, 217, 0.08),
    transparent
  );
  opacity: 1;
}

.rarity-industrial:hover .item-image-container img {
  filter: drop-shadow(0 0 8px rgba(94, 152, 217, 0.4));
}

.rarity-mil-spec:hover {
  border-color: #4b69ff;
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.4),
    0 0 8px rgba(75, 105, 255, 0.3);
}

.rarity-mil-spec:hover .item-glow-effect {
  background: radial-gradient(
    circle at center,
    rgba(75, 105, 255, 0.08),
    transparent
  );
  opacity: 1;
}

.rarity-mil-spec:hover .item-image-container img {
  filter: drop-shadow(0 0 8px rgba(75, 105, 255, 0.4));
}

.rarity-restricted:hover {
  border-color: #8847ff;
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.4),
    0 0 8px rgba(136, 71, 255, 0.3);
}

.rarity-restricted:hover .item-glow-effect {
  background: radial-gradient(
    circle at center,
    rgba(136, 71, 255, 0.08),
    transparent
  );
  opacity: 1;
}

.rarity-restricted:hover .item-image-container img {
  filter: drop-shadow(0 0 8px rgba(136, 71, 255, 0.4));
}

.rarity-classified:hover {
  border-color: #d32ce6;
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.4),
    0 0 8px rgba(211, 44, 230, 0.3);
}

.rarity-classified:hover .item-glow-effect {
  background: radial-gradient(
    circle at center,
    rgba(211, 44, 230, 0.08),
    transparent
  );
  opacity: 1;
}

.rarity-classified:hover .item-image-container img {
  filter: drop-shadow(0 0 8px rgba(211, 44, 230, 0.4));
}

.rarity-covert:hover {
  border-color: #eb4b4b;
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.4),
    0 0 8px rgba(235, 75, 75, 0.3);
}

.rarity-covert:hover .item-glow-effect {
  background: radial-gradient(
    circle at center,
    rgba(235, 75, 75, 0.08),
    transparent
  );
  opacity: 1;
}

.rarity-covert:hover .item-image-container img {
  filter: drop-shadow(0 0 8px rgba(235, 75, 75, 0.4));
}

.rarity-gold:hover {
  border-color: #ffd700;
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.4),
    0 0 8px rgba(255, 215, 0, 0.3);
}

.rarity-gold:hover .item-glow-effect {
  background: radial-gradient(
    circle at center,
    rgba(255, 215, 0, 0.08),
    transparent
  );
  opacity: 1;
}

.rarity-gold:hover .item-image-container img {
  filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.4));
}

/* ===== 模態框系統 ===== */
.cyber-modal-backdrop {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000 !important;
  backdrop-filter: blur(5px);
  /* 🔧 確保不受父容器transform影響 */
  transform: none !important;
}

.cyber-modal {
  background: var(--bg-glass);
  border: 1px solid var(--border-dim);
  width: 90%;
  max-width: 800px;
  max-height: 80vh;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(10px);
  clip-path: polygon(
    0 20px,
    20px 0,
    calc(100% - 20px) 0,
    100% 20px,
    100% calc(100% - 20px),
    calc(100% - 20px) 100%,
    20px 100%,
    0 calc(100% - 20px)
  );
}

.modal-border-effect {
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(
    45deg,
    var(--neon-pink),
    var(--neon-blue),
    var(--neon-purple)
  );
  z-index: -1;
  opacity: 0.4;
  filter: blur(8px);
  clip-path: inherit;
}

.modal-scan-line {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--neon-blue),
    transparent
  );
  animation: scan-line 3s linear infinite;
}

.modal-header {
  padding: 25px;
  border-bottom: 1px solid var(--border-dim);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-dark);
}

.modal-title {
  font-size: 1.2rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text-secondary);
}

.history-filter select {
  background: var(--bg-card);
  border: 1px solid var(--border-dim);
  padding: 8px 12px;
  color: var(--text-primary);
}

.cyber-close-btn {
  background: none;
  border: 1px solid var(--border-dim);
  padding: 8px 12px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--trans-normal);
}

.cyber-close-btn:hover {
  border-color: var(--cyber-danger);
  color: var(--cyber-danger);
  box-shadow: 0 0 5px var(--cyber-danger);
}

.modal-body {
  padding: 25px;
  max-height: 60vh;
  overflow-y: auto;
}

.history-data-stream {
  min-height: 200px;
}

.history-pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border-dim);
}

.pagination-info {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.pagination-controls {
  display: flex;
  gap: 10px;
}

.cyber-nav-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-dim);
  padding: 8px 12px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--trans-normal);
}

.cyber-nav-btn:hover:not(:disabled) {
  border-color: var(--border-neon);
  color: var(--text-primary);
  box-shadow: 0 0 5px var(--glow-blue);
}

.cyber-nav-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ===== 模態框按鈕樣式 ===== */
.modal-buttons {
  display: flex;
  gap: 15px;
  justify-content: flex-end;
  padding: 20px 25px;
  border-top: 1px solid var(--border-dim);
  background: var(--bg-dark);
}

.modal-buttons .cyber-btn {
  min-width: 100px;
}

/* ===== 庫存分頁控制 ===== */
.inventory-pagination {
  margin-top: 30px;
  padding: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-dim);
  border-radius: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.inventory-pagination::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--cyber-secondary),
    transparent
  );
  animation: scan-line 4s linear infinite;
}

.pagination-info {
  color: var(--text-muted);
  font-size: 0.9rem;
  letter-spacing: 1px;
}

.pagination-info .current-page,
.pagination-info .total-pages {
  color: var(--cyber-secondary);
  font-weight: 700;
}

.pagination-controls {
  display: flex;
  gap: 15px;
}

.pagination-btn {
  background: var(--bg-dark);
  border: 1px solid var(--border-dim);
  color: var(--text-secondary);
  padding: 10px 15px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all var(--trans-normal);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 8px;
}

.pagination-btn:hover:not(:disabled) {
  border-color: var(--border-neon);
  color: var(--text-primary);
  box-shadow: 0 0 5px var(--glow-blue);
  transform: translateY(-1px);
}

.pagination-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

.pagination-btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    45deg,
    transparent,
    rgba(0, 245, 255, 0.1),
    transparent
  );
  opacity: 0;
  transition: opacity var(--trans-normal);
}

.pagination-btn:hover:not(:disabled)::before {
  opacity: 1;
}

/* ===== 全部出售按鈕 ===== */
.sell-all-btn {
  background: var(--bg-dark);
  border: 1px solid var(--cyber-primary);
  color: var(--cyber-primary);
  padding: 8px 16px;
  margin-left: 15px;
  cursor: pointer;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: all var(--trans-normal);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sell-all-btn:hover {
  background: var(--bg-dark);
  color: var(--text-primary);
  transform: translateY(-1px);
}

.sell-all-btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity var(--trans-normal);
}

.sell-all-btn:hover::before {
  opacity: 1;
}

/* ===== 響應式設計 ===== */
@media (max-width: 1200px) {
  .user-primary-data {
    grid-template-columns: 1fr;
    gap: 20px;
    text-align: center;
  }

  .user-actions {
    flex-direction: row;
    justify-content: center;
  }
}

@media (max-width: 768px) {
  .cyber-profile {
    padding: 10px;
    margin-top: 40px;
  }

  .user-info-panel,
  .level-module,
  .inventory-system {
    padding: 20px;
  }

  /* 等級升級信息響應式樣式 */
  .requirements {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .level-up-info {
    padding: 10px 12px;
  }

  .next-level-info .label {
    font-size: 0.8rem;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .system-header {
    flex-direction: column;
    align-items: stretch;
  }

  .inventory-controls {
    flex-direction: column;
    gap: 15px;
  }

  .cyber-search input {
    width: 100%;
  }

  .cyber-inventory-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    grid-template-rows: repeat(3, 200px);
    /* 🔧 明確定義三排，每排200px */
    gap: 15px;
    width: 100%;
    /* 🔧 確保寬度填滿容器 */
    height: 650px;
    /* 🔧 平板版三排：200px × 3 + 15px × 2 + 10px + 10px = 650px */
    padding: 10px 0;
    /* 🔧 上下各10px空間 */
    align-content: start;
    /* 🔧 內容從頂部開始排列 */
    box-sizing: border-box;
    /* 🔧 確保 padding 計算正確 */
  }

  .inventory-item {
    height: 200px;
    /* 🔧 平板版3:4比例：150px寬 → 200px高 */
  }

  .item-image-container {
    height: 120px;
    /* 🔧 平板版圖像容器，適配200px總高度 */
  }

  .loading-state,
  .empty-inventory,
  .error-message {
    height: 650px;
    /* 🔧 平板版狀態高度 */
    /* 🔧 修復：讓元素占滿整個網格區域 */
    grid-column: 1 / -1;
    /* 跨越所有列 */
    grid-row: 1 / -1;
    /* 跨越所有行 */
  }

  .item-action-buttons {
    opacity: 1;
    /* 在手機上始終顯示按鈕 */
  }

  .cyber-action-btn {
    min-width: 28px;
    height: 28px;
    padding: 0 6px;
  }

  /* 在小螢幕上隱藏按鈕文字 */
  .cyber-action-btn .btn-text {
    display: none;
  }

  .user-metadata {
    flex-direction: column;
    gap: 15px;
  }

  .cyber-modal {
    width: 95%;
    margin: 10px;
  }

  .modal-header {
    flex-direction: column;
    gap: 15px;
    align-items: stretch;
  }
}

@media (max-width: 480px) {
  .cyber-username {
    font-size: 2rem;
  }

  .avatar-hexagon {
    width: 100px;
    height: 100px;
  }

  .user-actions {
    flex-direction: column;
  }

  .cyber-inventory-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(3, 218px);
    /* 🔧 明確定義三排，每排218px */
    width: 100%;
    /* 🔧 確保寬度填滿容器 */
    height: 704px;
    /* 🔧 手機版三排：218px × 3 + 15px × 2 + 10px + 10px = 704px */
    padding: 10px 0;
    /* 🔧 上下各10px空間 */
    align-content: start;
    /* 🔧 內容從頂部開始排列 */
    box-sizing: border-box;
    /* 🔧 確保 padding 計算正確 */
  }

  .inventory-item {
    height: 218px;
    /* 🔧 手機版3:4比例：約164px寬 → 218px高 */
  }

  .item-image-container {
    height: 130px;
    /* 🔧 手機版圖像容器，適配218px總高度 */
    margin: 8px;
  }

  .loading-state,
  .empty-inventory,
  .error-message {
    height: 704px;
    /* 🔧 手機版狀態高度 */
    /* 🔧 修復：讓元素占滿整個網格區域 */
    grid-column: 1 / -1;
    /* 跨越所有列 */
    grid-row: 1 / -1;
    /* 跨越所有行 */
  }

  .inventory-pagination {
    flex-direction: column;
    gap: 15px;
    text-align: center;
  }

  .pagination-controls {
    justify-content: center;
  }

  .sell-all-btn {
    margin-left: 0;
    margin-top: 10px;
    width: 100%;
    justify-content: center;
  }
}

/* ===== 簡化模態框基礎樣式 ===== */
.simple-modal-backdrop,
.profile-simple-modal-backdrop {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000 !important;
  /* 🔧 確保不受父容器transform影響 */
  transform: none !important;
  backdrop-filter: blur(5px);
}

.simple-modal,
.profile-simple-modal {
  background: var(--bg-dark);
  border: 1px solid var(--border-dim);
  border-radius: 8px;
  position: relative;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}

.simple-modal .modal-header,
.profile-simple-modal .modal-header,
.profile-simple-modal .profile-modal-header {
  padding: 20px 25px;
  border-bottom: 1px solid var(--border-dim);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-card);
  border-radius: 8px 8px 0 0;
}

.simple-modal .modal-title,
.profile-simple-modal .modal-title,
.profile-simple-modal .profile-modal-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.simple-close-btn,
.profile-simple-close-btn {
  background: none;
  border: 1px solid var(--border-dim);
  padding: 6px 10px;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.3s ease;
}

.simple-close-btn:hover,
.profile-simple-close-btn:hover {
  border-color: #e53e3e;
  color: #e53e3e;
}

/* ===== 設定模態框專用樣式（簡化版） ===== */
.profile-edit-modal {
  max-width: 500px;
  width: 90%;
}

/* ===== Profile模態框內容體樣式 ===== */
.profile-modal-body {
  padding: 30px;
}

.profile-edit-modal .modal-body {
  padding: 30px;
}

.profile-edit-modal .form-group,
.profile-form-group {
  margin-bottom: 20px;
}

.profile-edit-modal label,
.profile-form-group label {
  display: block;
  margin-bottom: 8px;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.9rem;
}

.profile-edit-modal input[type="url"],
.profile-form-group input[type="url"] {
  width: 100%;
  padding: 12px 15px;
  background: var(--bg-card);
  border: 1px solid var(--border-dim);
  color: var(--text-primary);
  font-size: 0.9rem;
  border-radius: 4px;
  transition: border-color 0.3s ease;
  box-sizing: border-box;
}

.profile-edit-modal input[type="url"]:focus,
.profile-form-group input[type="url"]:focus {
  outline: none;
  border-color: var(--cyber-secondary);
}

.profile-edit-modal .helper-text,
.profile-helper-text {
  margin-top: 8px;
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.profile-edit-modal .find-trade-url-btn,
.profile-find-trade-url-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 15px;
  background: #4a5568;
  color: #e2e8f0;
  text-decoration: none;
  border-radius: 4px;
  font-size: 0.9rem;
  transition: background-color 0.3s ease;
  margin: 15px 0;
}

.profile-edit-modal .find-trade-url-btn:hover,
.profile-find-trade-url-btn:hover {
  background: #2d3748;
}

.profile-edit-modal .form-actions,
.profile-form-actions {
  display: flex;
  gap: 15px;
  justify-content: flex-end;
  margin-top: 25px;
  padding-top: 20px;
  border-top: 1px solid var(--border-dim);
}

.profile-edit-modal .submit-btn,
.profile-submit-btn {
  background: #000000;
  border: 1px solid #00f5ff;
  border-radius: 4px;
  padding: 10px 20px;
  color: #00f5ff;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-shadow: 0 0 5px #00f5ff;
}

.profile-edit-modal .submit-btn:hover:not(:disabled),
.profile-submit-btn:hover:not(:disabled) {
  background: #111111;
  box-shadow:
    0 0 5px #00f5ff,
    0 4px 15px rgba(0, 245, 255, 0.3);
  transform: translateY(-1px);
}

.profile-edit-modal .submit-btn:disabled,
.profile-submit-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: #333333;
  color: #666666;
  border-color: #666666;
  text-shadow: none;
}

.profile-edit-modal .cancel-btn,
.profile-cancel-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-dim);
  border-radius: 4px;
  padding: 10px 20px;
  color: var(--text-secondary);
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.3s ease;
}

.profile-edit-modal .cancel-btn:hover,
.profile-cancel-btn:hover {
  border-color: #e53e3e;
  color: #e53e3e;
}

/* ===== 全部出售模態框專用樣式 ===== */
.sell-all-modal-backdrop .modal-body {
  padding: 25px 30px;
}

.sell-all-modal-backdrop .sell-summary {
  background: var(--bg-card);
  border: 1px solid var(--border-dim);
  border-radius: 8px;
  padding: 20px;
  margin: 20px 0;
}

.sell-all-modal-backdrop .summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-dim);
}

.sell-all-modal-backdrop .summary-row:last-child {
  border-bottom: none;
  font-weight: 700;
  font-size: 1.1rem;
}

.sell-all-modal-backdrop .summary-row.total {
  color: var(--cyber-secondary);
  text-shadow: 0 0 5px var(--cyber-secondary);
}

.sell-all-modal-backdrop .summary-row .label {
  color: var(--text-secondary);
}

.sell-all-modal-backdrop .summary-row .value {
  color: var(--text-primary);
  font-weight: 600;
}

.sell-all-modal-backdrop .warning-notice {
  background: rgba(255, 170, 0, 0.1);
  border: 1px solid var(--cyber-warning);
  border-radius: 6px;
  padding: 15px;
  margin-top: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--cyber-warning);
  font-size: 0.9rem;
}

.sell-all-modal-backdrop .warning-notice i {
  font-size: 1.2rem;
  color: var(--cyber-warning);
}

/* 響應式設計：設定模態框 */
@media (max-width: 768px) {
  .simple-modal,
  .profile-simple-modal {
    margin: 20px;
    width: calc(100% - 40px);
  }

  .profile-edit-modal {
    width: 100%;
  }

  .profile-edit-modal .modal-body,
  .profile-modal-body {
    padding: 20px;
  }

  .profile-edit-modal .form-actions,
  .profile-form-actions {
    flex-direction: column;
    gap: 10px;
  }

  .profile-edit-modal .submit-btn,
  .profile-edit-modal .cancel-btn,
  .profile-submit-btn,
  .profile-cancel-btn {
    width: 100%;
    text-align: center;
  }

  /* 全部出售模態框響應式 */
  .sell-all-modal-backdrop .modal-body {
    padding: 20px;
  }

  .sell-all-modal-backdrop .sell-summary {
    padding: 15px;
    margin: 15px 0;
  }

  .sell-all-modal-backdrop .summary-row {
    flex-direction: column;
    text-align: center;
    gap: 5px;
  }

  .sell-all-modal-backdrop .warning-notice {
    flex-direction: column;
    text-align: center;
    gap: 8px;
  }
}

/* ===== 歷史記錄模態框樣式（profile-前綴版本） ===== */
.profile-cyber-modal-backdrop {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000 !important;
  backdrop-filter: blur(5px);
  /* 🔧 確保不受父容器transform影響 */
  transform: none !important;
}

.profile-cyber-modal {
  background: var(--bg-glass);
  border: 1px solid var(--border-dim);
  width: 90%;
  max-height: 80vh;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(10px);
  clip-path: polygon(
    0 20px,
    20px 0,
    calc(100% - 20px) 0,
    100% 20px,
    100% calc(100% - 20px),
    calc(100% - 20px) 100%,
    20px 100%,
    0 calc(100% - 20px)
  );
}

.profile-modal-border-effect {
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(
    45deg,
    var(--neon-pink),
    var(--neon-blue),
    var(--neon-purple)
  );
  z-index: -1;
  opacity: 0.4;
  filter: blur(8px);
  clip-path: inherit;
}

.profile-modal-scan-line {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--neon-blue),
    transparent
  );
  animation: scan-line 3s linear infinite;
}

.profile-modal-header {
  padding: 25px;
  border-bottom: 1px solid var(--border-dim);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-dark);
}

.profile-modal-title {
  font-size: 1.2rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text-secondary);
}

.profile-history-filter select {
  background: var(--bg-card);
  border: 1px solid var(--border-dim);
  padding: 8px 12px;
  color: var(--text-primary);
}

.profile-cyber-close-btn {
  background: none;
  border: 1px solid var(--border-dim);
  padding: 8px 12px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--trans-normal);
}

.profile-cyber-close-btn:hover {
  border-color: var(--cyber-danger);
  color: var(--cyber-danger);
  box-shadow: 0 0 5px var(--cyber-danger);
}

/* ===== 歷史記錄標籤頁樣式 ===== */
.profile-history-tabs {
  display: flex;
  background: var(--bg-darker);
  border-bottom: 1px solid var(--border-dim);
  position: relative;
  overflow: hidden;
}

.profile-history-tabs::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--cyber-secondary),
    transparent
  );
  animation: scan-line 4s linear infinite;
}

.profile-tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  padding: 15px 20px;
  color: var(--text-muted);
  cursor: pointer;
  position: relative;
  transition: all var(--trans-normal);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-bottom: 2px solid transparent;
}

.profile-tab-btn:hover {
  color: var(--text-secondary);
  background: rgba(0, 245, 255, 0.05);
}

.profile-tab-btn.active {
  color: var(--cyber-secondary);
  background: rgba(0, 245, 255, 0.1);
  border-bottom-color: var(--cyber-secondary);
  text-shadow: 0 0 5px var(--cyber-secondary);
}

.profile-tab-btn.active::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    135deg,
    transparent,
    rgba(0, 245, 255, 0.1),
    transparent
  );
  pointer-events: none;
}

.profile-tab-btn i {
  font-size: 1rem;
  transition: transform var(--trans-normal);
}

.profile-tab-btn:hover i,
.profile-tab-btn.active i {
  transform: scale(1.1);
}

/* 標籤頁內容區域 */
.profile-history-tab-content {
  display: none;
}

.profile-history-tab-content.active {
  display: block;
}

.profile-modal-body {
  padding: 0;
  max-height: 60vh;
  overflow: hidden;
}

.profile-history-tab-content {
  padding: 25px;
  height: 60vh;
  overflow-y: auto;
}

.profile-history-data-stream {
  min-height: 200px;
}

.profile-history-pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border-dim);
}

.profile-pagination-info {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.profile-pagination-controls {
  display: flex;
  gap: 10px;
}

.profile-cyber-nav-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-dim);
  padding: 8px 12px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--trans-normal);
}

.profile-cyber-nav-btn:hover:not(:disabled) {
  border-color: var(--border-neon);
  color: var(--text-primary);
  box-shadow: 0 0 5px var(--glow-blue);
}

.profile-cyber-nav-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* 歷史記錄項目樣式 */
.profile-loading-history {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
  color: var(--text-muted);
  gap: 15px;
}

.profile-cyber-loader {
  position: relative;
  width: 30px;
  height: 30px;
}

.profile-loader-ring {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 2px solid transparent;
  border-top: 2px solid var(--cyber-secondary);
  border-right: 2px solid var(--cyber-primary);
  border-radius: 50%;
  animation: loader-spin 1s linear infinite;
}

/* 🎯 新設計的開箱歷史項目 */
.case-history-item {
  display: flex;
  background: var(--bg-card);
  border: 1px solid var(--border-dim);
  border-radius: 0;
  /* 🔧 移除圓角 */
  clip-path: polygon(
    0 0,
    calc(100% - 10px) 0,
    100% 10px,
    100% 100%,
    10px 100%,
    0 calc(100% - 10px)
  );
  /* 🎨 添加切角 */
  padding: 20px;
  margin-bottom: 20px;
  position: relative;
  overflow: hidden;
  transition: all var(--trans-normal);
  gap: 20px;
  min-height: 120px;
}

.case-history-item:hover {
  border-color: var(--border-neon);
  box-shadow:
    inset 0 0 10px rgba(0, 245, 255, 0.1),
    0 0 20px rgba(0, 245, 255, 0.05);
  transform: translateY(-2px);
}

.case-history-item::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--cyber-secondary),
    transparent
  );
  animation: stat-scan 4s linear infinite;
}

/* 左側：獎項展示區域 */
.item-showcase {
  flex: 0 0 200px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.item-image-container {
  position: relative;
  width: 180px;
  height: 140px;
  border-radius: 0;
  /* 🔧 移除圓角 */
  clip-path: polygon(
    5px 0,
    100% 0,
    100% calc(100% - 5px),
    calc(100% - 5px) 100%,
    0 100%,
    0 5px
  );
  /* 🎨 添加切角 */
  overflow: hidden;
  cursor: pointer;
  transition: all var(--trans-normal);
  border: 2px solid var(--border-dim);
  background: radial-gradient(
    circle at center,
    rgba(255, 255, 255, 0.05),
    transparent
  );
}

.item-image-container:hover {
  transform: scale(1.05);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  border-color: var(--cyber-secondary);
}

/* 🎯 武器內容（預設顯示） */
.weapon-content {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px;
  opacity: 1;
  visibility: visible;
  transition: all 0.3s ease;
  z-index: 2;
}

.weapon-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  text-align: center;
  margin-bottom: 4px;
  line-height: 1.2;
}

.weapon-price {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--cyber-success);
  text-shadow: 0 0 5px var(--cyber-success);
}

/* 🎁 箱子內容（hover顯示） */
.case-content {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 3;
}

.case-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--cyber-primary);
  text-align: center;
  line-height: 1.2;
  text-shadow: 0 0 5px var(--cyber-primary);
}

/* 🎯 hover效果：切換顯示內容 */
.item-image-container:hover .weapon-content {
  opacity: 0;
  visibility: hidden;
}

.item-image-container:hover .case-content {
  opacity: 1;
  visibility: visible;
}

.item-image-container:hover .weapon-image {
  transform: scale(1.1);
}

.item-image-container:hover .case-image {
  transform: scale(1.1) rotate(-5deg);
}

/* 稀有度光效 */
.rarity-glow {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0.6;
  z-index: 1;
  pointer-events: none;
}

.rarity-glow.common {
  background: linear-gradient(
    45deg,
    rgba(176, 196, 222, 0.2),
    rgba(176, 196, 222, 0.1)
  );
  box-shadow: inset 0 0 10px rgba(176, 196, 222, 0.3);
}

.rarity-glow.uncommon {
  background: linear-gradient(
    45deg,
    rgba(94, 152, 217, 0.2),
    rgba(94, 152, 217, 0.1)
  );
  box-shadow: inset 0 0 10px rgba(94, 152, 217, 0.3);
}

.rarity-glow.rare {
  background: linear-gradient(
    45deg,
    rgba(75, 105, 255, 0.2),
    rgba(75, 105, 255, 0.1)
  );
  box-shadow: inset 0 0 10px rgba(75, 105, 255, 0.3);
}

.rarity-glow.mythical {
  background: linear-gradient(
    45deg,
    rgba(136, 71, 255, 0.2),
    rgba(136, 71, 255, 0.1)
  );
  box-shadow: inset 0 0 10px rgba(136, 71, 255, 0.3);
}

.rarity-glow.legendary {
  background: linear-gradient(
    45deg,
    rgba(211, 44, 230, 0.2),
    rgba(211, 44, 230, 0.1)
  );
  box-shadow: inset 0 0 10px rgba(211, 44, 230, 0.3);
}

.rarity-glow.ancient {
  background: linear-gradient(
    45deg,
    rgba(235, 75, 75, 0.2),
    rgba(235, 75, 75, 0.1)
  );
  box-shadow: inset 0 0 10px rgba(235, 75, 75, 0.3);
}

.rarity-glow.immortal {
  background: linear-gradient(
    45deg,
    rgba(228, 174, 57, 0.2),
    rgba(228, 174, 57, 0.1)
  );
  box-shadow: inset 0 0 10px rgba(228, 174, 57, 0.3);
}

/* 物品資訊顯示 */
.item-info,
.case-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
  transition: all var(--trans-normal);
  z-index: 3;
}

.item-name,
.case-name {
  color: var(--text-primary);
  font-size: 0.85rem;
  font-weight: 600;
  text-align: center;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
  margin-bottom: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.item-price {
  color: var(--cyber-secondary);
  font-size: 0.9rem;
  font-weight: 700;
  text-align: center;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

.case-icon {
  width: 24px;
  height: 24px;
  object-fit: contain;
  margin: 0 auto 4px;
  display: block;
}

/* 舊的歷史項目樣式保留（用於其他歷史類型） */
.history-item {
  background: var(--bg-card);
  border: 1px solid var(--border-dim);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 15px;
  position: relative;
  overflow: hidden;
  transition: all var(--trans-normal);
}

.history-item:hover {
  border-color: var(--border-neon);
  box-shadow: inset 0 0 5px rgba(0, 245, 255, 0.1);
}

.history-item::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--cyber-secondary),
    transparent
  );
  animation: stat-scan 3s linear infinite;
}

.history-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: var(--bg-dark);
  border: 1px solid var(--border-neon);
  border-radius: 50%;
  margin-right: 15px;
  color: var(--cyber-secondary);
}

.history-item-detail {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
  margin-top: 15px;
}

.detail-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.detail-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
}

/* 右側：種子信息面板 */
.seed-info-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.seed-info-column {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.info-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  transition: all var(--trans-normal);
}

.info-item:last-child {
  border-bottom: none;
}

.info-item:hover {
  background: rgba(0, 245, 255, 0.02);
  border-radius: 0;
  /* 🔧 移除圓角 */
  padding-left: 8px;
  padding-right: 8px;
}

.info-label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  min-width: 100px;
  /* 🔧 減少最小寬度 */
  flex-shrink: 0;
}

.info-label i {
  width: 14px;
  text-align: center;
  opacity: 0.7;
  color: var(--cyber-secondary);
}

.info-value {
  color: var(--text-primary);
  font-size: 0.75rem;
  /* 🔧 稍微減小字體 */
  text-align: center !important;
  /* 🎯 置中對齊顯示 */
  word-break: break-all;
  flex: 1;
  /* 🔧 讓值區域佔用剩餘空間 */
  min-width: 0;
  /* 🔧 允許收縮 */
  width: 100%;
  /* 🔧 確保佔滿容器寬度 */
  overflow: visible !important;
  /* 🔧 強制移除溢出隱藏 */
  text-overflow: none !important;
  /* 🔧 強制移除省略號 */
  white-space: normal !important;
  /* 🔧 允許正常換行 */
  line-height: 1.4;
  /* 🔧 增加行高 */
  max-height: none !important;
  /* 🔧 移除高度限制 */
  overflow-wrap: break-word;
  /* 🔧 確保長單詞會換行 */
  max-width: none !important;
  /* 🔧 移除最大寬度限制 */
}

.info-value.mono-font {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.7rem;
  /* 🔧 稍微減小字體 */
  background: rgba(0, 0, 0, 0.3);
  padding: 8px 12px;
  /* 🔧 增加內邊距，確保內容不會被截斷 */
  border-radius: 0;
  /* 🔧 移除圓角 */
  clip-path: polygon(
    3px 0,
    100% 0,
    100% calc(100% - 3px),
    calc(100% - 3px) 100%,
    0 100%,
    0 3px
  );
  /* 🎨 添加切角 */
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all var(--trans-normal);
  text-align: center !important;
  /* 🎯 種子信息也置中顯示 */
  overflow: visible !important;
  /* 🔧 確保不會被隱藏 */
  text-overflow: none !important;
  /* 🔧 確保不會有省略號 */
  white-space: normal !important;
  /* 🔧 允許換行 */
  word-break: break-all;
  /* 🔧 長種子會自動換行 */
  max-width: none !important;
  /* 🔧 移除最大寬度限制 */
  width: 100%;
  /* 🔧 佔滿容器寬度 */
}

.info-value.mono-font:hover {
  background: rgba(0, 245, 255, 0.1);
  border-color: var(--cyber-secondary);
  color: var(--cyber-secondary);
  transform: scale(1.02);
  /* 🎨 輕微放大效果 */
}

/* 🎯 專門針對種子信息的樣式，確保完整顯示 */
.seed-info .info-value.mono-font {
  text-align: center !important;
  overflow: visible !important;
  text-overflow: none !important;
  white-space: normal !important;
  word-break: break-all !important;
  max-width: none !important;
  width: 100% !important;
  display: block !important;
  min-height: auto !important;
  height: auto !important;
}

/* =========== 🚀 升級歷史記錄樣式 =========== */

/* 升級歷史特殊樣式 */
.upgrade-history-item {
  border-left: 4px solid var(--cyber-warning);
}

.upgrade-showcase {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  min-height: 350px;
  justify-content: space-between;
  padding: 15px;
  flex: 0 0 200px;
  /* 調整到與普通展示區域相同的寬度 */
  max-width: 200px;
}

/* 升級歷史的小卡不要有滑鼠移動效果 */
.upgrade-showcase .item-image-container {
  transition: none !important;
  cursor: default !important;
}

.upgrade-showcase .item-image-container:hover {
  transform: none !important;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.3) !important;
  border-color: var(--border-dim) !important;
}

/* 確保升級歷史的武器內容在hover時不會消失 */
.upgrade-showcase .item-image-container:hover .weapon-content {
  opacity: 1 !important;
  visibility: visible !important;
}

/* 升級歷史沒有箱子內容，確保不會意外顯示 */
.upgrade-showcase .item-image-container:hover .case-content {
  opacity: 0 !important;
  visibility: hidden !important;
}

/* 升級歷史的武器圖片在hover時不要變化 */
.upgrade-showcase .item-image-container:hover .weapon-image {
  transform: none !important;
}

/* 分頁控制樣式 */
.upgrade-pagination-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 4px;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.75rem;
}

.upgrade-pagination-controls .pagination-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-dim);
  color: var(--text-primary);
  padding: 3px 6px;
  cursor: pointer;
  transition: all 0.3s ease;
  border-radius: 2px;
  font-size: 0.7rem;
}

.upgrade-pagination-controls .pagination-btn:hover:not(:disabled) {
  background: var(--cyber-secondary);
  border-color: var(--cyber-secondary);
  color: var(--text-primary);
}

.upgrade-pagination-controls .pagination-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.upgrade-pagination-controls .page-info {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.upgrade-pagination-controls .current-page {
  color: var(--cyber-secondary);
  font-weight: 700;
}

/* 箭頭樣式 */
.upgrade-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 2px solid;
  border-radius: 50%;
  font-size: 1rem;
  transition: all 0.3s ease;
}

.upgrade-arrow.success {
  border-color: var(--cyber-success);
  color: var(--cyber-success);
  background: rgba(34, 197, 94, 0.1);
}

.upgrade-arrow.failed {
  border-color: var(--cyber-danger);
  color: var(--cyber-danger);
  background: rgba(239, 68, 68, 0.1);
}

/* 確保升級歷史的小卡有合適的尺寸 */
.upgrade-showcase .item-image-container {
  width: 160px;
  height: 120px;
  flex-shrink: 0;
}

/* 武器內容樣式 */
.upgrade-showcase .weapon-content {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px;
  background: rgba(0, 0, 0, 0.4);
  border-radius: inherit;
}

.upgrade-showcase .weapon-image {
  width: 70px;
  height: 50px;
  object-fit: contain;
  margin-bottom: 6px;
  filter: drop-shadow(0 0 3px rgba(0, 0, 0, 0.8));
}

.upgrade-showcase .weapon-name {
  color: var(--text-primary);
  font-size: 0.8rem;
  font-weight: 600;
  text-align: center;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
  margin-bottom: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.upgrade-showcase .weapon-price {
  color: var(--cyber-secondary);
  font-size: 0.85rem;
  font-weight: 700;
  text-align: center;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

/* 隱藏的犧牲物品數據容器 */
.sacrifice-items-data {
  display: none !important;
}

/* ========== 升級歷史新架構說明 ========== */
/* 
 * 新的升級歷史使用以下結構：
 * 1. .upgrade-showcase - 主要展示容器
 * 2. .item-image-container - 犧牲物品和目標物品的小卡（與箱子歷史相同）
 * 3. .upgrade-pagination-controls - 分頁控制
 * 4. .upgrade-arrow - 升級箭頭
 * 5. .sacrifice-items-data - 隱藏的犧牲物品數據（用於分頁）
 * 
 * 舊的 .sacrifice-items-container 相關樣式已被上述新樣式取代
 */

.sacrifice-items-container .weapon-image {
  width: 120px;
  height: 80px;
  object-fit: contain;
  margin-bottom: 8px;
  filter: drop-shadow(0 0 10px rgba(0, 245, 255, 0.5));
  transition: transform 0.3s ease;
}

.sacrifice-items-container .weapon-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  text-align: center;
  margin-bottom: 4px;
  line-height: 1.2;
}

.sacrifice-items-container .weapon-price {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--cyber-success);
  text-shadow: 0 0 5px var(--cyber-success);
}

/* 2. 分頁控制區域 */
.upgrade-pagination-container {
  flex: none;
  margin: 5px 0;
}

/* 3. 箭頭區域（小一點） */
.upgrade-arrow-container {
  flex: none;
  margin: 8px 0;
}

.upgrade-arrow-container .upgrade-arrow {
  color: var(--text-secondary);
  font-size: 0.8rem;
  animation: arrow-pulse 2s ease-in-out infinite;
}

.upgrade-arrow-container .upgrade-arrow.success {
  color: #00ff88;
  text-shadow: 0 0 3px #00ff88;
}

.upgrade-arrow-container .upgrade-arrow.failed {
  color: #ff4757;
  text-shadow: 0 0 3px #ff4757;
}

/* 4. 目標物品區域 */
.upgrade-target-section {
  flex: none;
  width: 100%;
  display: flex;
  justify-content: center;
}

.target-weapon-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  width: 140px;
}

.target-weapon-content .weapon-image {
  width: 120px;
  height: 80px;
  object-fit: contain;
  margin-bottom: 8px;
  filter: drop-shadow(0 0 10px rgba(0, 245, 255, 0.5));
  transition: transform 0.3s ease;
}

.target-weapon-content .weapon-price {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--cyber-success);
  text-shadow: 0 0 5px var(--cyber-success);
}

/* 左側：升級視覺效果 */
.upgrade-showcase {
  flex: 2;
  display: flex;
  flex-direction: column;
  /* 🔧 改為垂直布局：上面-中間-下面 */
  align-items: center;
  justify-content: space-between;
  min-height: 300px;
}

/* 🔧 新增：犧牲物品容器（一次只顯示一張） */
.sacrifice-item-container {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.sacrifice-items {
  position: relative;
  width: 150px;
  height: 150px;
}

.sacrifice-item-page {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.sacrifice-item-page.active {
  opacity: 1;
  visibility: visible;
}

.sacrifice-label {
  font-size: 0.9rem;
  color: var(--text-secondary);
  text-align: center;
  margin-top: 8px;
}

/* 犧牲物品區域 */
.sacrifice-section {
  flex: none;
  /* 🔧 不需要flex分配，固定大小 */
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
  /* 🔧 佔滿寬度 */
}

.sacrifice-items-container {
  position: relative;
  width: 100%;
  min-height: 90px;
  display: flex;
  justify-content: center;
}

.sacrifice-items-page {
  display: none;
  justify-content: center;
  align-items: flex-start;
  gap: 8px;
  width: 100%;
}

.sacrifice-items-page.active {
  display: flex;
}

.sacrifice-item {
  text-align: center;
  min-width: 60px;
  max-width: 80px;
}

.sacrifice-item-image {
  position: relative;
  width: 60px;
  height: 45px;
  margin: 0 auto 4px;
  border-radius: 0;
  /* 🔧 移除圓角 */
  clip-path: polygon(
    3px 0,
    100% 0,
    100% calc(100% - 3px),
    calc(100% - 3px) 100%,
    0 100%,
    0 3px
  );
  /* 🎨 添加切角 */
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.sacrifice-item-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sacrifice-item-name {
  font-size: 0.7rem;
  color: var(--text-primary);
  font-weight: 500;
  margin-bottom: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sacrifice-item-price {
  font-size: 0.65rem;
  color: var(--cyber-secondary);
  font-weight: 600;
}

/* 犧牲物品分頁控制 */
.sacrifice-pagination {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

.sacrifice-prev-btn,
.sacrifice-next-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0;
  /* 🔧 移除圓角 */
  clip-path: polygon(
    2px 0,
    100% 0,
    100% calc(100% - 2px),
    calc(100% - 2px) 100%,
    0 100%,
    0 2px
  );
  /* 🎨 添加切角 */
  color: var(--text-primary);
  padding: 4px 8px;
  cursor: pointer;
  transition: all var(--trans-fast);
  font-size: 0.7rem;
}

.sacrifice-prev-btn:hover:not(:disabled),
.sacrifice-next-btn:hover:not(:disabled) {
  background: rgba(0, 245, 255, 0.1);
  border-color: var(--cyber-secondary);
  color: var(--cyber-secondary);
}

.sacrifice-prev-btn:disabled,
.sacrifice-next-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.sacrifice-page-info {
  font-size: 0.65rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.sacrifice-total-price {
  font-size: 0.7rem;
  color: var(--cyber-secondary);
  font-weight: 600;
  margin-top: 4px;
}

/* 舊的升級箭頭樣式已移除 - 現在使用sacrifice-content中的箭頭 */

/* 簡化的脈動動畫 */
@keyframes arrow-pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.8;
  }

  50% {
    transform: scale(1.1);
    opacity: 1;
  }
}

/* 舊樣式已移除 - 現在使用upgrade-arrow-section */

.arrow-line {
  width: 3px;
  /* 🔧 垂直箭頭：寬高互換 */
  height: 40px;
  /* 🔧 垂直箭頭：寬高互換 */
  border-radius: 0;
  /* 🔧 移除圓角 */
  margin-bottom: 8px;
  position: relative;
  transition: all var(--trans-normal);
}

.arrow-head {
  width: 0;
  height: 0;
  border-top: 12px solid;
  /* 🔧 垂直箭頭：改為頂部邊框 */
  border-left: 8px solid transparent;
  /* 🔧 垂直箭頭：調整方向 */
  border-right: 8px solid transparent;
  /* 🔧 垂直箭頭：調整方向 */
  margin-bottom: 8px;
  transition: all var(--trans-normal);
  position: relative;
}

.arrow-head i {
  position: absolute;
  top: -8px;
  /* 🔧 垂直箭頭：調整位置 */
  left: 50%;
  /* 🔧 垂直箭頭：水平居中 */
  transform: translateX(-50%);
  /* 🔧 垂直箭頭：水平居中 */
  font-size: 0.8rem;
  color: white;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

.upgrade-rate {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-primary);
  text-align: center;
  background: rgba(0, 0, 0, 0.3);
  padding: 3px 8px;
  border-radius: 0;
  /* 🔧 移除圓角 */
  clip-path: polygon(
    2px 0,
    100% 0,
    100% calc(100% - 2px),
    calc(100% - 2px) 100%,
    0 100%,
    0 2px
  );
  /* 🎨 添加切角 */
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* 升級成功/失敗的箭頭樣式 */
.arrow-success .arrow-line {
  background: #00ff88;
  box-shadow: 0 0 10px rgba(0, 255, 136, 0.3);
}

.arrow-success .arrow-head {
  border-top-color: #00ff88;
  /* 🔧 垂直箭頭：改為頂部顏色 */
}

.arrow-success .upgrade-rate {
  color: #00ff88;
  border-color: rgba(0, 255, 136, 0.3);
}

.arrow-failed .arrow-line {
  background: #ff4757;
  box-shadow: 0 0 10px rgba(255, 71, 87, 0.3);
}

.arrow-failed .arrow-head {
  border-top-color: #ff4757;
  /* 🔧 垂直箭頭：改為頂部顏色 */
}

.arrow-failed .upgrade-rate {
  color: #ff4757;
  border-color: rgba(255, 71, 87, 0.3);
}

/* 🔧 新增：目標物品容器 */
.target-item-container {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.target-label {
  font-size: 0.9rem;
  color: var(--text-secondary);
  text-align: center;
  margin-top: 8px;
}

/* 物品分頁控制 */
.item-pagination {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.pagination-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0;
  clip-path: polygon(
    2px 0,
    100% 0,
    100% calc(100% - 2px),
    calc(100% - 2px) 100%,
    0 100%,
    0 2px
  );
  color: var(--text-primary);
  padding: 4px 8px;
  cursor: pointer;
  transition: all var(--trans-fast);
  font-size: 0.7rem;
}

.pagination-btn:hover:not(:disabled) {
  background: rgba(0, 245, 255, 0.1);
  border-color: var(--cyber-secondary);
  color: var(--cyber-secondary);
}

.pagination-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.page-info {
  font-size: 0.65rem;
  color: var(--text-muted);
  white-space: nowrap;
}

/* 舊的目標物品區域 */
.target-section {
  flex: none;
  /* 🔧 不需要flex分配，固定大小 */
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
  /* 🔧 佔滿寬度 */
}

.target-item {
  text-align: center;
}

.target-item-image {
  position: relative;
  width: 80px;
  height: 60px;
  margin: 0 auto 8px;
  border-radius: 0;
  /* 🔧 移除圓角 */
  clip-path: polygon(
    4px 0,
    100% 0,
    100% calc(100% - 4px),
    calc(100% - 4px) 100%,
    0 100%,
    0 4px
  );
  /* 🎨 添加切角 */
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.target-item-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.target-item-name {
  font-size: 0.8rem;
  color: var(--text-primary);
  font-weight: 600;
  margin-bottom: 4px;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100px;
}

.target-item-price {
  font-size: 0.75rem;
  color: var(--cyber-secondary);
  font-weight: 600;
}

/* 響應式設計 */
@media (max-width: 768px) {
  .case-history-item {
    flex-direction: column;
    gap: 15px;
    padding: 15px;
  }

  .item-showcase {
    flex: none;
    width: 100%;
  }

  .item-image-container {
    width: 150px;
    height: 120px;
    margin: 0 auto;
  }

  /* 手機版升級歷史布局 */
  .upgrade-layout {
    min-height: 250px !important;
    padding: 12px !important;
  }

  /* 手機版犧牲物品區域 */
  .sacrifice-items-container {
    width: 120px;
    height: 120px;
  }

  .sacrifice-items-container .weapon-image {
    width: 100px;
    height: 65px;
  }

  /* 手機版目標物品區域 */
  .target-weapon-content {
    width: 120px;
  }

  .target-weapon-content .weapon-image {
    width: 100px;
    height: 65px;
  }

  /* 手機版箭頭 */
  .upgrade-arrow-container .upgrade-arrow {
    font-size: 0.7rem;
  }
}

.info-value.no-data {
  color: var(--text-muted);
  font-style: italic;
  opacity: 0.6;
}

/* 時間信息特殊樣式 */
.time-info .info-value {
  color: var(--cyber-secondary);
  font-weight: 600;
}

.time-info .info-label i {
  color: var(--cyber-secondary);
}

/* 驗證按鈕區域 */
.verify-section {
  margin-top: 8px;
  border-bottom: none !important;
  justify-content: center;
}

.fairness-verify-btn {
  background: linear-gradient(
    45deg,
    var(--cyber-primary),
    var(--cyber-secondary)
  );
  border: none;
  padding: 8px 16px;
  border-radius: 0;
  /* 🔧 移除圓角 */
  clip-path: polygon(
    4px 0,
    100% 0,
    100% calc(100% - 4px),
    calc(100% - 4px) 100%,
    0 100%,
    0 4px
  );
  /* 🎨 添加切角 */
  color: white;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--trans-normal);
  display: flex;
  align-items: center;
  gap: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.fairness-verify-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 245, 255, 0.3);
  background: linear-gradient(
    45deg,
    var(--cyber-secondary),
    var(--cyber-primary)
  );
}

.fairness-verify-btn i {
  font-size: 0.9rem;
}

/* 響應式設計 */
@media (max-width: 768px) {
  .case-history-item {
    flex-direction: column;
    gap: 15px;
    padding: 15px;
  }

  .item-showcase {
    flex: none;
    align-self: center;
  }

  .item-image-container {
    width: 120px;
    height: 80px;
  }

  .info-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .info-value {
    text-align: center !important;
    /* 🎯 手機版也保持置中對齊 */
    max-width: none !important;
    /* 🔧 移除最大寬度限制 */
    width: 100%;
    /* 🔧 佔滿容器寬度 */
    overflow: visible !important;
    /* 🔧 確保內容不被隱藏 */
    text-overflow: none !important;
    /* 🔧 確保沒有省略號 */
    white-space: normal !important;
    /* 🔧 允許換行 */
  }
}

.detail-value {
  color: var(--text-primary);
  font-weight: 500;
}

.item-detail-special {
  color: var(--cyber-secondary);
  font-weight: 600;
}

.seed-detail {
  font-family: monospace;
  font-size: 0.85rem;
  word-break: break-all;
}

.fairness-verify-btn {
  background: var(--bg-dark);
  border: 1px solid var(--cyber-warning);
  color: var(--cyber-warning);
  padding: 6px 12px;
  margin-top: 8px;
  cursor: pointer;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: all var(--trans-normal);
  border-radius: 0;
  /* 🔧 移除圓角 */
}

.fairness-verify-btn:hover {
  background: var(--cyber-warning);
  color: var(--text-primary);
  box-shadow: 0 0 5px var(--cyber-warning);
}

.empty-history {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  color: var(--text-muted);
  font-size: 1.1rem;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.empty-history::before {
  content: "📋";
  font-size: 3rem;
  margin-bottom: 20px;
}

/* ===== 升級歷史特定樣式 ===== */
.history-item.upgrade-success {
  border-left: 4px solid var(--cyber-success);
}

.history-item.upgrade-success .history-icon {
  background: var(--bg-dark);
  border-color: var(--cyber-success);
  color: var(--cyber-success);
}

.history-item.upgrade-failed {
  border-left: 4px solid var(--cyber-danger);
}

.history-item.upgrade-failed .history-icon {
  background: var(--bg-dark);
  border-color: var(--cyber-danger);
  color: var(--cyber-danger);
}

.detail-value.success {
  color: var(--cyber-success);
  font-weight: 700;
  text-shadow: 0 0 5px var(--cyber-success);
}

.detail-value.failed {
  color: var(--cyber-danger);
  font-weight: 700;
  text-shadow: 0 0 5px var(--cyber-danger);
}

/* ===== 戰鬥歷史特定樣式 ===== */
.history-item.battle-win {
  border-left: 4px solid var(--cyber-warning);
}

.history-item.battle-win .history-icon {
  background: var(--bg-dark);
  border-color: var(--cyber-warning);
  color: var(--cyber-warning);
}

.history-item.battle-lose {
  border-left: 4px solid var(--text-muted);
}

.history-item.battle-lose .history-icon {
  background: var(--bg-dark);
  border-color: var(--text-muted);
  color: var(--text-muted);
}

.history-item.battle-draw {
  border-left: 4px solid #ffd700;
}

.history-item.battle-draw .history-icon {
  background: linear-gradient(135deg, #f39c12, #e67e22);
  color: white;
}

.detail-value.win {
  color: var(--cyber-warning);
  font-weight: 700;
  text-shadow: 0 0 5px var(--cyber-warning);
}

.detail-value.lose {
  color: var(--text-muted);
  font-weight: 700;
}

/* ===== 歷史記錄模態框響應式設計 ===== */
@media (max-width: 768px) {
  .profile-cyber-modal {
    width: 95%;
    margin: 10px;
  }

  .profile-modal-header {
    flex-direction: column;
    gap: 15px;
    align-items: stretch;
  }

  /* 標籤頁響應式 */
  .profile-tab-btn {
    padding: 12px 10px;
    font-size: 0.8rem;
  }

  .profile-tab-btn span {
    display: none;
  }

  .profile-tab-btn i {
    font-size: 1.2rem;
  }

  .profile-history-tab-content {
    padding: 15px;
    height: 55vh;
  }

  .profile-history-pagination {
    flex-direction: column;
    gap: 15px;
    text-align: center;
  }

  .profile-pagination-controls {
    justify-content: center;
  }

  .history-item-detail {
    grid-template-columns: 1fr;
    gap: 10px;
  }
}

@media (max-width: 480px) {
  .profile-history-tabs {
    border-bottom: 2px solid var(--border-dim);
  }

  .profile-tab-btn {
    padding: 10px 8px;
  }

  .profile-tab-btn i {
    font-size: 1.4rem;
  }

  .profile-history-tab-content {
    padding: 10px;
    height: 50vh;
  }

  .history-item {
    padding: 15px;
    margin-bottom: 10px;
  }

  .history-item-detail {
    gap: 8px;
  }

  .detail-group {
    gap: 3px;
  }

  .detail-label {
    font-size: 0.75rem;
  }

  .detail-value {
    font-size: 0.9rem;
  }
}

/* 🎮 戰鬥回放功能樣式 */
.battle-replay-btn {
  background: linear-gradient(
    135deg,
    var(--arena-bg-card) 0%,
    rgba(0, 245, 255, 0.1) 100%
  );
  color: white;
  border: 2px solid var(--arena-border);
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  clip-path: polygon(8px 0, 100% 0, calc(100% - 8px) 100%, 0 100%);
}

.battle-replay-btn:hover {
  background: linear-gradient(135deg, #5a67d8, #6b46c1);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.battle-replay-btn:active {
  transform: translateY(0);
}

.battle-replay-btn i {
  font-size: 13px !important;
}

/* 🎮 回放模式動畫 */
@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.8);
  }

  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

@keyframes fadeOutScale {
  from {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }

  to {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.8);
  }
}

/* 🎮 回放物品結果樣式 */
.replay-item-result {
  animation: slideInRight 0.5s ease-out;
}

.replay-item-result .item-image img {
  width: 50px;
  height: 50px;
  object-fit: cover;
  border-radius: 4px;
}

.replay-item-result .item-info {
  margin-left: 12px;
}

.replay-item-result .item-name {
  font-weight: 500;
  color: #00ff88;
  font-size: 14px;
  margin-bottom: 4px;
}

.replay-item-result .item-price {
  color: #ffd700;
  font-size: 13px;
  font-weight: 600;
}

/* 🎮 回放橫幅樣式 */
.replay-banner {
  background: linear-gradient(45deg, #ff6b6b, #ee5a24);
  color: white;
  text-align: center;
  padding: 10px;
  font-weight: bold;
  box-shadow: 0 2px 10px rgba(255, 107, 107, 0.3);
  margin-bottom: 20px;
  border-radius: 8px;
}

.replay-banner-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.replay-banner-content i {
  font-size: 16px;
}

/* 🎮 平手結果顯示樣式 */
.draw-result-display {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 30px;
  border-radius: 15px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  z-index: 1000;
  text-align: center;
  animation: fadeInScale 0.5s ease-out;
}

.draw-result-content h3 {
  margin: 0 0 20px 0;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.draw-result-info p {
  margin: 8px 0;
  font-size: 14px;
}

.draw-result-info strong {
  color: #ffd700;
  font-size: 16px;
}

/* 空歷史狀態樣式 */
.empty-history {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  text-align: center;
}

.empty-history-content {
  max-width: 400px;
  padding: 40px;
  background: rgba(0, 0, 0, 0.3);
  border: 2px dashed rgba(100, 200, 255, 0.3);
  border-radius: 15px;
}

.empty-history-content i {
  font-size: 3rem;
  color: rgba(100, 200, 255, 0.5);
  margin-bottom: 20px;
}

.empty-history-content h3 {
  color: rgba(255, 255, 255, 0.8);
  font-size: 1.2rem;
  margin-bottom: 15px;
}

.empty-history-content p {
  color: rgba(255, 255, 255, 0.6);
  line-height: 1.5;
}

.empty-history-content a {
  color: var(--neon-cyan, #00f5ff);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.3s ease;
}

.empty-history-content a:hover {
  color: #ffffff;
  text-shadow: 0 0 10px var(--neon-cyan, #00f5ff);
}

/* 🎮 完整的戰鬥房間樣式 - 為個人資料頁面定制 */

/* CSS變數定義 */
.rooms-cyber-grid {
  --arena-primary: #ff006e;
  --arena-secondary: #00f5ff;
  --arena-accent: #bf00ff;
  --arena-warning: #ffaa00;
  --arena-success: #00ff41;
  --arena-danger: #ff0040;

  --neon-pink: #ff006e;
  --neon-cyan: #00f5ff;
  --neon-purple: #bf00ff;
  --neon-green: #00ff41;
  --neon-orange: #ffaa00;

  --arena-bg-dark: #0a0a0f;
  --arena-bg-darker: #050507;
  --arena-bg-card: rgba(15, 15, 26, 0.95);
  --arena-bg-glass: rgba(15, 15, 26, 0.85);
  --arena-bg-panel: rgba(26, 26, 46, 0.9);

  --arena-border: rgba(0, 245, 255, 0.4);
  --arena-border-bright: rgba(0, 245, 255, 0.8);
  --arena-border-active: rgba(255, 0, 110, 0.6);

  --arena-text-primary: #ffffff;
  --arena-text-secondary: #00f5ff;
  --arena-text-muted: #8b8b9a;

  --arena-glow-cyan: 0 0 20px #00f5ff, 0 0 40px #00f5ff;
  --arena-glow-pink: 0 0 20px #ff006e, 0 0 40px #ff006e;
  --arena-glow-purple: 0 0 20px #bf00ff, 0 0 40px #bf00ff;

  --arena-transition: 0.3s ease;
  --arena-transition-slow: 0.6s ease;
}

.rooms-cyber-grid {
  display: flex;
  flex-direction: column;
  gap: 25px;
  min-height: 200px;
}

/* ===== 戰鬥房間卡片樣式 ===== */
.battle_room {
  background: linear-gradient(
    135deg,
    rgba(15, 20, 35, 0.95) 0%,
    rgba(25, 30, 45, 0.9) 100%
  );
  border: 2px solid rgba(100, 200, 255, 0.4);
  border-radius: 0;
  clip-path: polygon(20px 0, 100% 0, calc(100% - 20px) 100%, 0 100%);
  padding: 0;
  overflow: hidden;
  position: relative;
  transition: var(--arena-transition, 0.3s ease);
  align-items: center;
  backdrop-filter: blur(10px);
  box-shadow:
    0 0 25px rgba(100, 200, 255, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  margin-bottom: 25px;
  /* 🔧 增加底部間距 */
}

.battle_room::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    45deg,
    transparent 30%,
    rgba(0, 245, 255, 0.05) 50%,
    transparent 70%
  );
  opacity: 0;
  transition: var(--arena-transition, 0.3s ease);
}

.battle_room:hover {
  border-color: rgba(100, 200, 255, 0.6);
  box-shadow:
    0 0 35px rgba(100, 200, 255, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
  transform: translateY(-5px);
}

.battle_room:hover::before {
  opacity: 1;
}

/* 房間標題 */
.battle_room .room_header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  /* 🔧 增加間距 */
  padding: 20px 25px;
  /* 🔧 增加內邊距 */
  background: linear-gradient(
    135deg,
    rgba(0, 245, 255, 0.1) 0%,
    transparent 100%
  );
  border-bottom: 1px solid var(--arena-border, rgba(0, 245, 255, 0.4));
  position: relative;
  width: 100%;
  min-height: 60px;
  /* 🔧 增加最小高度 */
}

.battle_room .room_header::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    var(--neon-cyan, #00f5ff) 50%,
    transparent 100%
  );
  opacity: 0;
  transition: var(--arena-transition, 0.3s ease);
}

.battle_room:hover .room_header::after {
  opacity: 1;
}

.battle_room .room_id {
  font-size: 1.3rem;
  /* 🔧 增加字體大小 */
  font-weight: 600;
  color: var(--neon-cyan, #00f5ff);
  text-shadow: 0 0 10px var(--neon-cyan, #00f5ff);
}

/* 房間內容區域 */
.battle_room .room-main-content {
  display: flex;
  align-items: center;
  padding: 25px 30px;
  /* 🔧 增加內邊距 */
  gap: 30px;
  /* 🔧 增加間距 */
  width: 100%;
  box-sizing: border-box;
  min-height: 120px;
  /* 🔧 增加最小高度 */
}

/* 回合信息 */
.battle_room .round {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  min-width: 100px;
  /* 🔧 增加最小寬度 */
  flex-shrink: 0;
  padding: 10px;
  /* 🔧 增加內邊距 */
}

.battle_room .round_info {
  font-size: 1rem;
  /* 🔧 增加字體大小 */
  color: var(--arena-text-muted, rgba(255, 255, 255, 0.6));
  margin-bottom: 8px;
  /* 🔧 增加間距 */
  text-transform: uppercase;
}

.battle_room .round_value {
  font-size: 1.4rem;
  /* 🔧 增加字體大小 */
  font-weight: 700;
  color: var(--neon-cyan, #00f5ff);
  text-shadow: 0 0 10px var(--neon-cyan, #00f5ff);
}

/* 箱子滾動區域 */
.battle_room .case_scroll_wrapper {
  position: relative;
  display: flex;
  align-items: center;
  gap: 15px;
  /* 🔧 增加間距 */
  flex: 1;
  min-width: 250px;
  /* 🔧 增加最小寬度 */
  padding: 5px 0;
  /* 🔧 增加內邊距 */
}

.battle_room .scroll_btn {
  background: rgba(100, 200, 255, 0.2);
  border: 1px solid rgba(100, 200, 255, 0.5);
  color: var(--neon-cyan, #00f5ff);
  width: 45px;
  /* 🔧 增加按鈕寬度 */
  height: 45px;
  /* 🔧 增加按鈕高度 */
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  opacity: 0;
  visibility: hidden;
  font-size: 18px;
  /* 🔧 增加字體大小 */
}

.battle_room .scroll_btn.visible {
  opacity: 1;
  visibility: visible;
}

.battle_room .scroll_btn:hover {
  background: rgba(100, 200, 255, 0.4);
  transform: scale(1.1);
  box-shadow: 0 0 15px rgba(100, 200, 255, 0.5);
}

.battle_room .battleCaseContainer {
  display: flex;
  align-items: center;
  gap: 15px;
  /* 🔧 增加間距 */
  overflow-x: auto;
  overflow-y: hidden;
  flex: 1;
  padding: 8px 0;
  /* 🔧 增加內邊距 */
  scrollbar-width: thin;
  scrollbar-color: var(--neon-cyan, #00f5ff) transparent;
}

.battle_room .battleCaseContainer::-webkit-scrollbar {
  height: 6px;
  /* 🔧 增加滾動條高度 */
}

.battle_room .battleCaseContainer::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
}

.battle_room .battleCaseContainer::-webkit-scrollbar-thumb {
  background: var(--neon-cyan, #00f5ff);
  border-radius: 2px;
}

.battle_room .caseitem img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 4px;
}

/* 價格區域 */
.battle_room .price_area {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  min-width: 120px;
  /* 🔧 增加最小寬度 */
  flex-shrink: 0;
  position: relative;
  padding: 10px;
  /* 🔧 增加內邊距 */
}

.battle_room .price_info {
  font-size: 1rem;
  /* 🔧 增加字體大小 */
  color: var(--arena-text-muted, rgba(255, 255, 255, 0.6));
  margin-bottom: 8px;
  /* 🔧 增加間距 */
  text-transform: uppercase;
}

.battle_room .price {
  font-size: 1.5rem;
  /* 🔧 增加字體大小 */
  font-weight: 700;
  color: #ffd700;
  text-shadow: 0 0 10px #ffd700;
  margin-bottom: 8px;
  /* 🔧 增加間距 */
}

/* 🎯 入場費樣式 */
.battle_room .cost_info {
  font-size: 0.9rem;
  /* 🔧 增加字體大小 */
  color: #ff9800;
  margin-bottom: 5px;
  /* 🔧 增加間距 */
  opacity: 0.9;
}

.battle_room .cost_value {
  font-weight: bold;
  color: #ffb74d;
  text-shadow: 0 0 5px rgba(255, 183, 77, 0.3);
}

.battle_room .lobby_mode_info {
  font-size: 0.9rem;
  /* 🔧 增加字體大小 */
  color: var(--neon-orange, #ffaa00);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* 玩家區域 */
.battle_room .player_area {
  min-width: 180px;
  /* 🔧 增加最小寬度 */
  flex-shrink: 0;
  padding: 10px;
  /* 🔧 增加內邊距 */
}

.battle_room .players_list,
.battle_room .players_list_2v2 {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  /* 🔧 增加間距 */
}

.battle_room .players_list_2v2 {
  flex-direction: column;
  gap: 15px;
  /* 🔧 增加間距 */
}

.battle_room .team {
  display: flex;
  align-items: center;
  gap: 12px;
  /* 🔧 增加間距 */
}

.battle_room .vs_text {
  font-size: 1rem;
  /* 🔧 增加字體大小 */
  color: var(--neon-orange, #ffaa00);
  font-weight: 600;
  text-shadow: 0 0 8px var(--neon-orange, #ffaa00);
  text-transform: uppercase;
}

.battle_room .players {
  width: 45px;
  /* 🔧 增加玩家頭像寬度 */
  height: 45px;
  /* 🔧 增加玩家頭像高度 */
  border-radius: 50%;
  border: 2px solid var(--arena-border, rgba(100, 200, 255, 0.4));
  background: var(--arena-bg-card, rgba(15, 15, 26, 0.95));
  overflow: hidden;
  position: relative;
  transition: all 0.3s ease;
}

.battle_room .players:hover {
  border-color: rgba(100, 200, 255, 0.8);
  transform: scale(1.1);
  box-shadow: 0 0 15px rgba(100, 200, 255, 0.4);
}

.battle_room .player_icon {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* 按鈕區域 */
.battle_room .button_area {
  display: flex;
  justify-content: center;
  min-width: 140px;
  /* 🔧 增加最小寬度 */
  flex-shrink: 0;
  padding: 10px;
  /* 🔧 增加內邊距 */
}

.battle_room .common_btu:hover {
  border-color: var(--arena-border-bright, rgba(0, 245, 255, 0.8));
  background: linear-gradient(
    135deg,
    rgba(0, 245, 255, 0.1) 0%,
    rgba(0, 245, 255, 0.2) 100%
  );
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0, 245, 255, 0.3);
  text-shadow: 0 0 10px var(--neon-cyan, #00f5ff);
}

.battle_room .common_btu::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.1),
    transparent
  );
  transition: left 0.5s ease;
}

.battle_room .common_btu:hover::before {
  left: 100%;
}

/* 響應式設計 */
@media (max-width: 1024px) {
  .battle_room .room-main-content {
    flex-wrap: wrap;
    gap: 15px;
  }

  .battle_room .case_scroll_wrapper {
    order: 1;
    width: 100%;
  }

  .battle_room .round {
    order: 2;
  }

  .battle_room .price_area {
    order: 3;
  }

  .battle_room .player_area {
    order: 4;
  }

  .battle_room .button_area {
    order: 5;
  }
}

@media (max-width: 768px) {
  .battle_room {
    margin-bottom: 20px;
    /* 🔧 增加移動端間距 */
  }

  .battle_room .room_header {
    flex-direction: column;
    gap: 15px;
    /* 🔧 增加移動端間距 */
    text-align: center;
    padding: 20px;
    /* 🔧 增加移動端內邊距 */
    min-height: 80px;
    /* 🔧 增加移動端最小高度 */
  }

  .battle_room .room-main-content {
    flex-direction: column;
    align-items: stretch;
    gap: 20px;
    /* 🔧 增加移動端間距 */
    padding: 20px;
    /* 🔧 增加移動端內邊距 */
  }

  .battle_room .round,
  .battle_room .price_area,
  .battle_room .player_area,
  .battle_room .button_area {
    min-width: auto;
    width: 100%;
  }

  .battle_room .case_scroll_wrapper {
    min-width: auto;
    width: 100%;
    padding: 10px 0;
    /* 🔧 增加移動端滾動區域內邊距 */
  }

  .battle_room .battleCaseContainer {
    justify-content: center;
    gap: 15px;
    /* 🔧 增加移動端箱子間距 */
  }

  /* 🔧 移動端箱子尺寸調整 */
  .battle_room .caseitem {
    min-width: 70px;
    height: 70px;
  }

  .battle_room .players_list {
    flex-wrap: wrap;
    justify-content: center;
  }

  .battle_room .players_list_2v2 {
    gap: 15px;
  }
}

/* ===== 開箱歷史小卡樣式 ===== */
.case-history-card {
  position: relative;
}

/* 檢查 Icon 樣式 */
.case-check-icon {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  background: var(--bg-glass);
  border: 1px solid var(--border-dim);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 15;
  /* 提高z-index確保在最上層 */
  transition: all var(--trans-normal);
  backdrop-filter: blur(10px);
  pointer-events: all;
  /* 確保圖標可以被點擊 */
}

.case-check-icon:hover {
  background: var(--cyber-primary);
  border-color: var(--cyber-primary);
  color: var(--text-primary);
  box-shadow: 0 0 8px var(--cyber-primary);
  transform: scale(1.1);
}

.case-check-icon i {
  font-size: 12px;
  color: var(--text-secondary);
  transition: color var(--trans-normal);
}

.case-check-icon:hover i {
  color: var(--text-primary);
}

/* Tooltip Popup 樣式 */
.case-history-tooltip-popup {
  position: fixed;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  pointer-events: auto;
  background: var(--bg-card);
  border: 1px solid var(--border-neon);
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(20px);
  max-width: 320px;
  min-width: 280px;
}

.case-history-tooltip-popup.visible {
  opacity: 1;
  visibility: visible;
}

/* Tooltip 內容樣式 */
.case-history-tooltip {
  padding: 0;
  background: transparent;
}

.tooltip-header {
  background: var(--cyber-primary);
  color: var(--text-primary);
  padding: 8px 12px;
  border-radius: 6px 6px 0 0;
  font-size: 0.85rem;
  text-align: center;
}

.tooltip-body {
  padding: 12px;
}

.tooltip-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 0.75rem;
}

.tooltip-item:last-child {
  margin-bottom: 0;
}

.tooltip-label {
  color: var(--text-muted);
  font-weight: 500;
  flex-shrink: 0;
  margin-right: 8px;
}

.tooltip-value {
  color: var(--text-primary);
  text-align: right;
  word-break: break-all;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tooltip-value.mono-font {
  font-family: "Courier New", monospace;
  font-size: 0.7rem;
}

.tooltip-actions {
  margin-top: 12px;
  padding-top: 8px;
  border-top: 1px solid var(--border-dim);
  text-align: center;
}

.fairness-verify-btn-tooltip {
  background: var(--cyber-success);
  border: none;
  color: var(--text-primary);
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all var(--trans-normal);
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0 auto;
}

.fairness-verify-btn-tooltip:hover {
  background: var(--cyber-success-bright);
  box-shadow: 0 0 8px var(--cyber-success);
  transform: scale(1.05);
}

/* Tooltip 箭頭指示器 */
.case-history-tooltip-popup::before {
  content: "";
  position: absolute;
  top: -6px;
  right: 20px;
  border: 6px solid transparent;
  border-bottom-color: var(--border-neon);
  z-index: 1001;
}

/* 開箱歷史容器專用樣式 */
.case-history-container .cyber-inventory-grid {
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 20px;
}

.case-history-container .case-history-card {
  cursor: default;
}

.case-history-container .case-history-card:hover {
  transform: translateY(-3px);
}

/* 開箱歷史小卡hover效果 */
.case-hover-container {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.case-hover-container .case-image {
  position: absolute;
  opacity: 0;
  transition: opacity 0.3s ease;
  max-width: 85%;
  max-height: 85%;
  object-fit: contain;
  z-index: 2;
}

.case-history-card:hover .case-hover-container .weapon-image {
  opacity: 0;
}

.case-history-card:hover .case-hover-container .case-image {
  opacity: 1;
}

.weapon-info {
  opacity: 1;
  transition: opacity 0.3s ease;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.case-info {
  opacity: 0;
  transition: opacity 0.3s ease;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.case-history-card:hover .weapon-info {
  opacity: 0;
}

.case-history-card:hover .case-info {
  opacity: 1;
}

/* 武器名稱換行樣式 */
.case-history-card .item-name {
  line-height: 1.2;
  height: auto;
  min-height: 2.4em;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

/* 查看內容物按鈕樣式 */
.case-content-btn {
  background: var(--cyber-primary);
  border: none;
  color: var(--text-primary);
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all var(--trans-normal);
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 8px auto 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.case-content-btn:hover {
  background: var(--cyber-primary-bright);
  box-shadow: 0 0 8px var(--cyber-primary);
  transform: scale(1.05);
}

.case-content-btn i {
  font-size: 0.7rem;
}

/* 箱子圖片點擊提示 */
.case-clickable {
  transition: all var(--trans-normal);
}

.case-clickable:hover {
  transform: scale(1.02);
  filter: brightness(1.1) drop-shadow(0 0 10px rgba(0, 245, 255, 0.6));
}

/* 響應式調整 */
@media (max-width: 768px) {
  .case-check-icon {
    width: 24px;
    height: 24px;
  }

  .case-check-icon i {
    font-size: 10px;
  }

  .case-history-tooltip-popup {
    max-width: 280px;
    min-width: 220px;
  }

  .case-history-card .item-name {
    font-size: 0.8rem;
    min-height: 2.2em;
  }

  .case-history-card .item-wear {
    font-size: 0.7rem;
  }

  .case-history-card .item-price {
    font-size: 0.9rem;
  }

  /* 手機端網格調整 */
  .case-history-container .cyber-inventory-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
  }

  .case-content-btn {
    font-size: 0.7rem;
    padding: 5px 10px;
    margin: 6px auto 0;
  }

  .case-content-btn i {
    font-size: 0.65rem;
  }
}

/* ===== 箱子內容物預覽模態框樣式 (戰鬥風格) ===== */
.case-contents-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(15px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9998;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  pointer-events: none;
}

.case-contents-overlay.show {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.case-contents-preview {
  background: linear-gradient(
    135deg,
    rgba(15, 15, 26, 0.95) 0%,
    rgba(25, 30, 45, 0.9) 50%,
    rgba(15, 15, 26, 0.95) 100%
  );
  border: 2px solid rgba(0, 245, 255, 0.4);
  width: 90%;
  max-width: 900px;
  max-height: 85vh;
  overflow: hidden;
  box-shadow:
    0 0 40px rgba(0, 245, 255, 0.2),
    0 0 80px rgba(255, 0, 110, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  backdrop-filter: blur(15px);
  position: relative;
  color: #ffffff;
  font-family: "Orbitron", "JetBrains Mono", "Microsoft JhengHei", monospace;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  pointer-events: none;

  /* 戰鬥風格科技感邊框 */
  clip-path: polygon(
    30px 0%,
    100% 0%,
    100% calc(100% - 30px),
    calc(100% - 30px) 100%,
    0% 100%,
    0% 30px
  );
}

.case-contents-preview.show {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* 邊框掃描動畫 */
.case-contents-preview::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    #00f5ff 50%,
    transparent 100%
  );
  animation: border-scan 4s ease-in-out infinite;
  z-index: 1;
}

@keyframes border-scan {
  0% {
    left: -100%;
  }

  50% {
    left: 100%;
  }

  100% {
    left: 100%;
  }
}

.preview-header {
  background: linear-gradient(
    135deg,
    rgba(15, 25, 45, 0.9) 0%,
    rgba(25, 35, 55, 0.9) 100%
  );
  color: var(--text-primary);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2px solid rgba(0, 245, 255, 0.3);
  position: relative;
  flex-shrink: 0;
}

.preview-header::before {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--cyber-primary),
    var(--border-neon),
    var(--cyber-primary),
    transparent
  );
  animation: headerGlow 2s ease-in-out infinite alternate;
}

@keyframes headerGlow {
  0% {
    opacity: 0.5;
  }

  100% {
    opacity: 1;
  }
}

.preview-header h3 {
  margin: 0;
  font-size: 1.3rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
  text-shadow: 0 0 8px var(--cyber-primary);
  letter-spacing: 0.5px;
}

.preview-header h3 i {
  color: var(--cyber-primary);
  filter: drop-shadow(0 0 4px var(--cyber-primary));
}

.case-stats {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.preview-close {
  position: relative;
  background: rgba(255, 0, 64, 0.1);
  border: 1px solid rgba(255, 0, 64, 0.3);
  color: #ff0040;
  font-size: 18px;
  font-weight: bold;
  cursor: pointer;
  width: 35px;
  height: 35px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;

  clip-path: polygon(6px 0, 100% 0, calc(100% - 6px) 100%, 0 100%);
}

.preview-close:hover {
  background: rgba(255, 0, 64, 0.2);
  border-color: rgba(255, 0, 64, 0.6);
  color: #ff4466;
  text-shadow: 0 0 8px rgba(255, 0, 64, 0.8);
  transform: scale(1.1);
}

.preview-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

.loading-spinner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
  color: var(--text-muted);
  gap: 15px;
}

.case-contents-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 18px;
  padding: 20px;
  max-height: 55vh;
  overflow-y: auto;
}

.case-item {
  background: linear-gradient(
    135deg,
    rgba(30, 35, 50, 0.9) 0%,
    rgba(20, 25, 35, 0.9) 100%
  );
  border: 1px solid var(--border-dim);
  border-radius: 8px;
  padding: 0;
  transition: all var(--trans-normal);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.case-item:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

.case-item::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    45deg,
    transparent,
    rgba(0, 245, 255, 0.05),
    transparent
  );
  opacity: 0;
  transition: opacity var(--trans-normal);
}

.case-item:hover::before {
  opacity: 1;
}

/* 稀有度邊框 */
.item-rarity-border {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 2;
}

/* 物品發光效果 */
.item-glow-effect {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity var(--trans-normal);
  border-radius: 6px;
}

.case-item:hover .item-glow-effect {
  opacity: 0.3;
}

.case-item .item-image-container {
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(
    135deg,
    rgba(40, 45, 60, 0.5) 0%,
    rgba(25, 30, 40, 0.5) 100%
  );
  border-bottom: 1px solid var(--border-dim);
  margin: 0;
  position: relative;
  flex-shrink: 0;
}

.case-item .item-image {
  max-width: 85%;
  max-height: 85%;
  object-fit: contain;
  filter: drop-shadow(0 0 8px rgba(0, 245, 255, 0.3));
  transition: all var(--trans-normal);
  z-index: 1;
}

.case-item:hover .item-image {
  transform: scale(1.05);
  filter: drop-shadow(0 0 12px rgba(0, 245, 255, 0.5));
}

.case-item .item-details {
  text-align: center;
  padding: 12px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.case-item .item-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.2;
  text-shadow: 0 0 4px rgba(0, 245, 255, 0.3);
  flex-grow: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.case-item .item-wear {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.case-item .item-price {
  font-size: 1rem;
  color: var(--cyber-success);
  font-weight: 700;
  text-shadow: 0 0 6px var(--cyber-success);
}

.case-item .item-drop-rate {
  font-size: 0.8rem;
  color: var(--cyber-primary);
  font-weight: 600;
  text-shadow: 0 0 4px var(--cyber-primary);
  background: rgba(0, 245, 255, 0.1);
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid rgba(0, 245, 255, 0.3);
}

.case-item .item-rarity-badge {
  position: absolute;
  bottom: 8px;
  right: 8px;
  font-size: 0.7rem;
  padding: 3px 8px;
  border-radius: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border: 1px solid;
  backdrop-filter: blur(10px);
  z-index: 3;
  text-shadow: 0 0 4px currentColor;
}

/* 稀有度顏色系統 */
.case-item.rarity-consumer {
  border-color: rgba(176, 195, 217, 0.4);
}

.case-item.rarity-consumer .item-rarity-border {
  background: linear-gradient(90deg, #b0c3d9, #8db5d6);
}

.case-item.rarity-consumer .item-glow-effect {
  background: radial-gradient(
    circle,
    rgba(176, 195, 217, 0.2) 0%,
    transparent 70%
  );
}

.case-item.rarity-consumer .item-rarity-badge {
  background: rgba(176, 195, 217, 0.2);
  color: #b0c3d9;
  border-color: #b0c3d9;
}

.case-item.rarity-industrial {
  border-color: rgba(94, 152, 217, 0.4);
}

.case-item.rarity-industrial .item-rarity-border {
  background: linear-gradient(90deg, #5e98d9, #4285d6);
}

.case-item.rarity-industrial .item-glow-effect {
  background: radial-gradient(
    circle,
    rgba(94, 152, 217, 0.2) 0%,
    transparent 70%
  );
}

.case-item.rarity-industrial .item-rarity-badge {
  background: rgba(94, 152, 217, 0.2);
  color: #5e98d9;
  border-color: #5e98d9;
}

.case-item.rarity-mil-spec {
  border-color: rgba(75, 105, 255, 0.4);
}

.case-item.rarity-mil-spec .item-rarity-border {
  background: linear-gradient(90deg, #4b69ff, #3654ff);
}

.case-item.rarity-mil-spec .item-glow-effect {
  background: radial-gradient(
    circle,
    rgba(75, 105, 255, 0.2) 0%,
    transparent 70%
  );
}

.case-item.rarity-mil-spec .item-rarity-badge {
  background: rgba(75, 105, 255, 0.2);
  color: #4b69ff;
  border-color: #4b69ff;
}

.case-item.rarity-restricted {
  border-color: rgba(136, 71, 255, 0.4);
}

.case-item.rarity-restricted .item-rarity-border {
  background: linear-gradient(90deg, #8847ff, #7332ff);
}

.case-item.rarity-restricted .item-glow-effect {
  background: radial-gradient(
    circle,
    rgba(136, 71, 255, 0.2) 0%,
    transparent 70%
  );
}

.case-item.rarity-restricted .item-rarity-badge {
  background: rgba(136, 71, 255, 0.2);
  color: #8847ff;
  border-color: #8847ff;
}

.case-item.rarity-classified {
  border-color: rgba(211, 44, 230, 0.4);
}

.case-item.rarity-classified .item-rarity-border {
  background: linear-gradient(90deg, #d32ce6, #bf17d3);
}

.case-item.rarity-classified .item-glow-effect {
  background: radial-gradient(
    circle,
    rgba(211, 44, 230, 0.2) 0%,
    transparent 70%
  );
}

.case-item.rarity-classified .item-rarity-badge {
  background: rgba(211, 44, 230, 0.2);
  color: #d32ce6;
  border-color: #d32ce6;
}

.case-item.rarity-covert {
  border-color: rgba(235, 75, 75, 0.4);
}

.case-item.rarity-covert .item-rarity-border {
  background: linear-gradient(90deg, #eb4b4b, #d93636);
}

.case-item.rarity-covert .item-glow-effect {
  background: radial-gradient(
    circle,
    rgba(235, 75, 75, 0.2) 0%,
    transparent 70%
  );
}

.case-item.rarity-covert .item-rarity-badge {
  background: rgba(235, 75, 75, 0.2);
  color: #eb4b4b;
  border-color: #eb4b4b;
}

.case-item.rarity-gold {
  border-color: rgba(255, 215, 0, 0.4);
}

.case-item.rarity-gold .item-rarity-border {
  background: linear-gradient(90deg, #ffd700, #ffcc00);
}

.case-item.rarity-gold .item-glow-effect {
  background: radial-gradient(
    circle,
    rgba(255, 215, 0, 0.2) 0%,
    transparent 70%
  );
}

.case-item.rarity-gold .item-rarity-badge {
  background: rgba(255, 215, 0, 0.2);
  color: #ffd700;
  border-color: #ffd700;
}

.empty-case {
  text-align: center;
  padding: 40px;
  color: var(--text-muted);
  font-size: 1.1rem;
}

.error-message {
  text-align: center;
  padding: 40px;
  color: var(--cyber-danger);
}

.error-message i {
  font-size: 3rem;
  margin-bottom: 15px;
  opacity: 0.7;
}

.error-message p {
  margin: 15px 0;
  font-size: 1.1rem;
}

.retry-btn {
  background: var(--cyber-danger);
  border: none;
  color: var(--text-primary);
  padding: 10px 20px;
  border-radius: 4px;
  cursor: pointer;
  transition: all var(--trans-normal);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 15px;
}

.retry-btn:hover {
  background: var(--cyber-danger-bright);
  transform: scale(1.05);
}

/* ===== 歷史記錄載入動畫 ===== */
.loading-state {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 750px;
}

.loading-dots {
  display: flex;
  gap: 8px;
  align-items: center;
}

.loading-dots .dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--neon-blue);
  animation: loading-bounce 1.4s ease-in-out infinite both;
  box-shadow: 0 0 10px var(--neon-blue);
}

.loading-dots .dot:nth-child(1) {
  animation-delay: -0.32s;
}

.loading-dots .dot:nth-child(2) {
  animation-delay: -0.16s;
}

.loading-dots .dot:nth-child(3) {
  animation-delay: 0s;
}

@keyframes loading-bounce {
  0%,
  80%,
  100% {
    transform: scale(0.8);
    opacity: 0.5;
  }
  40% {
    transform: scale(1.2);
    opacity: 1;
    box-shadow: 0 0 20px var(--neon-blue);
  }
}

/* ===== 分頁按鈕增強樣式 ===== */
.pagination-btn.disabled-style {
  opacity: 0.4;
  cursor: not-allowed;
  filter: grayscale(0.7);
}

.pagination-btn.disabled-style:hover {
  transform: none;
  box-shadow: none;
  background: var(--bg-card);
}

.pagination-btn.disabled-style:active {
  transform: none;
}

/* 響應式設計 */
@media (max-width: 768px) {
  .case-contents-preview {
    width: 95%;
    max-height: 90vh;
  }

  .case-contents-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
  }

  .case-item .item-image-container {
    height: 100px;
  }

  .preview-header {
    padding: 12px 15px;
  }

  .preview-body {
    padding: 15px;
  }

  .loading-state {
    padding: 20px 0;
    min-height: 600px;
  }

  .loading-dots .dot {
    width: 10px;
    height: 10px;
  }
}

/* ===== 升級歷史小卡片樣式 ===== */
.upgrade-history-card {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  border: 1px solid rgba(0, 245, 255, 0.3);
  transition: all 0.3s ease;
  cursor: pointer;
  display: flex;
  flex-direction: column;
}

.upgrade-history-card:hover {
  transform: translateY(-5px);
  border-color: rgba(0, 245, 255, 0.6);
  box-shadow: 0 10px 30px rgba(0, 245, 255, 0.2);
}

.upgrade-history-card.success {
  border: 4px solid rgba(0, 255, 0, 0.5);
}

.upgrade-history-card.success:hover {
  border: 4px solid rgba(0, 255, 0, 0.8);
  box-shadow: 0 10px 30px rgba(0, 255, 0, 0.3);
}

.upgrade-history-card.failed {
  border: 4px solid rgba(255, 0, 0, 0.5);
}

.upgrade-history-card.failed:hover {
  border: 4px solid rgba(255, 0, 0, 0.8);
  box-shadow: 0 10px 30px rgba(255, 0, 0, 0.3);
}

/* 升級檢查圖標 */
.upgrade-check-icon {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  background: rgba(0, 245, 255, 0.2);
  border: 1px solid rgba(0, 245, 255, 0.5);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 5;
  transition: all 0.3s ease;
}

.upgrade-check-icon:hover {
  background: rgba(0, 245, 255, 0.4);
  border-color: rgba(0, 245, 255, 0.8);
  transform: scale(1.1);
}

.upgrade-check-icon i {
  font-size: 12px;
  color: #00f5ff;
}

.upgrade-history-card .item-name {
  font-size: 14px;
  font-weight: bold;
  color: #fff;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.upgrade-history-card .item-price {
  font-size: 16px;
  font-weight: bold;
  color: #00f5ff;
}

/* 升級hover效果 */
.upgrade-hover-container {
  position: relative;
  overflow: hidden;
}

.upgrade-hover-container .target-image {
  transition: opacity 0.3s ease;
}

.upgrade-hover-container .sacrifice-preview {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 3;
  padding: 10px;
}

.upgrade-history-card.showing-sacrifice .target-image {
  opacity: 0.2;
}

.upgrade-history-card.showing-sacrifice .sacrifice-preview {
  opacity: 1;
}

.sacrifice-scroll-container {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 8px 0;
  max-width: 100%;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 245, 255, 0.5) transparent;
}

.sacrifice-scroll-container::-webkit-scrollbar {
  height: 6px;
}

.sacrifice-scroll-container::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 3px;
}

.sacrifice-scroll-container::-webkit-scrollbar-thumb {
  background: linear-gradient(
    90deg,
    rgba(0, 245, 255, 0.6),
    rgba(255, 0, 255, 0.6)
  );
  border-radius: 3px;
}

.sacrifice-scroll-container::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(
    90deg,
    rgba(0, 245, 255, 0.8),
    rgba(255, 0, 255, 0.8)
  );
}

.sacrifice-mini-card {
  position: relative;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  border: 1px solid rgba(0, 245, 255, 0.3);
  border-radius: 4px;
  padding: 6px;
  text-align: center;
  transition: all 0.3s ease;
  overflow: hidden;
  flex-shrink: 0;
  width: 80px;
  min-width: 80px;
}

.sacrifice-mini-card.common {
  border-color: rgba(160, 160, 160, 0.5);
}

.sacrifice-mini-card.uncommon {
  border-color: rgba(94, 152, 217, 0.5);
}

.sacrifice-mini-card.rare {
  border-color: rgba(75, 105, 255, 0.5);
}

.sacrifice-mini-card.mythical {
  border-color: rgba(136, 71, 255, 0.5);
}

.sacrifice-mini-card.legendary {
  border-color: rgba(211, 44, 230, 0.5);
}

.sacrifice-mini-card.ancient {
  border-color: rgba(235, 75, 75, 0.5);
}

.sacrifice-mini-card.immortal {
  border-color: rgba(228, 174, 57, 0.5);
}

.mini-card-glow {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  opacity: 0;
  border-radius: 4px;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.sacrifice-mini-card:hover .mini-card-glow {
  opacity: 0.3;
}

.mini-card-glow.common {
  background: radial-gradient(
    circle,
    rgba(160, 160, 160, 0.3) 0%,
    transparent 70%
  );
}

.mini-card-glow.uncommon {
  background: radial-gradient(
    circle,
    rgba(94, 152, 217, 0.3) 0%,
    transparent 70%
  );
}

.mini-card-glow.rare {
  background: radial-gradient(
    circle,
    rgba(75, 105, 255, 0.3) 0%,
    transparent 70%
  );
}

.mini-card-glow.mythical {
  background: radial-gradient(
    circle,
    rgba(136, 71, 255, 0.3) 0%,
    transparent 70%
  );
}

.mini-card-glow.legendary {
  background: radial-gradient(
    circle,
    rgba(211, 44, 230, 0.3) 0%,
    transparent 70%
  );
}

.mini-card-glow.ancient {
  background: radial-gradient(
    circle,
    rgba(235, 75, 75, 0.3) 0%,
    transparent 70%
  );
}

.mini-card-glow.immortal {
  background: radial-gradient(
    circle,
    rgba(228, 174, 57, 0.3) 0%,
    transparent 70%
  );
}

.sacrifice-mini-card:hover {
  border-color: rgba(0, 245, 255, 0.6);
  transform: scale(1.05);
}

.sacrifice-mini-card img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  margin-bottom: 4px;
}

.mini-card-info {
  font-size: 8px;
  line-height: 1.2;
}

.mini-card-name {
  color: #fff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-bottom: 1px;
}

.no-sacrifice-items {
  color: #666;
  font-size: 10px;
  text-align: center;
  padding: 20px 0;
}

/* 升級歷史tooltip */
.upgrade-history-tooltip-popup {
  position: fixed;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  border: 1px solid rgba(0, 245, 255, 0.5);
  border-radius: 8px;
  padding: 0;
  z-index: 10001;
  max-width: 300px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

.upgrade-history-tooltip-popup .tooltip-content {
  display: flex;
  flex-direction: column;
}

.upgrade-history-tooltip-popup .tooltip-header {
  padding: 12px 15px;
  background: linear-gradient(
    135deg,
    rgba(0, 245, 255, 0.1),
    rgba(255, 0, 255, 0.1)
  );
  border-bottom: 1px solid rgba(0, 245, 255, 0.3);
}

.upgrade-history-tooltip-popup .tooltip-header h4 {
  margin: 0;
  font-size: 14px;
  color: #fff;
  font-weight: bold;
}

.upgrade-history-tooltip-popup .tooltip-price {
  font-size: 16px;
  color: #00f5ff;
  font-weight: bold;
  margin-top: 4px;
}

.upgrade-history-tooltip-popup .tooltip-body {
  padding: 15px;
}

.upgrade-history-tooltip-popup .upgrade-details,
.upgrade-history-tooltip-popup .fairness-info,
.upgrade-history-tooltip-popup .seeds-info {
  margin-bottom: 15px;
}

.upgrade-history-tooltip-popup .upgrade-details:last-child,
.upgrade-history-tooltip-popup .fairness-info:last-child,
.upgrade-history-tooltip-popup .seeds-info:last-child {
  margin-bottom: 0;
}

.upgrade-history-tooltip-popup .detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 12px;
}

.upgrade-history-tooltip-popup .detail-row:last-child {
  margin-bottom: 0;
}

.upgrade-history-tooltip-popup .label {
  color: #aaa;
  font-weight: normal;
}

.upgrade-history-tooltip-popup .value {
  color: #fff;
  font-weight: bold;
}

.upgrade-history-tooltip-popup .value.success {
  color: #00ff00;
}

.upgrade-history-tooltip-popup .value.failed {
  color: #ff0000;
}

.upgrade-history-tooltip-popup .mono-font {
  font-family: "Courier New", monospace;
  font-size: 11px;
}

.upgrade-history-tooltip-popup .seed-item {
  margin-bottom: 6px;
  font-size: 11px;
  color: #ccc;
}

.upgrade-history-tooltip-popup .seed-item:last-child {
  margin-bottom: 0;
}

.tooltip-verify-section {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(0, 245, 255, 0.3);
  text-align: center;
}

.fairness-verify-btn-tooltip {
  background: linear-gradient(135deg, #4fc3f7 0%, #29b6f6 100%);
  border: 1px solid rgba(79, 195, 247, 0.5);
  color: white;
  border-radius: 4px;
  padding: 6px 10px;
  font-size: 10px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  text-decoration: none;
}

.fairness-verify-btn-tooltip:hover {
  background: linear-gradient(135deg, #81d4fa 0%, #4fc3f7 100%);
  border-color: rgba(129, 212, 250, 0.8);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(79, 195, 247, 0.3);
}

.fairness-verify-btn-tooltip i {
  font-size: 10px;
}

/* 升級歷史載入狀態 */
.loading-wear {
  color: #666 !important;
  font-style: italic;
  font-size: 11px !important;
}

.loading-sacrifice-items {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 60px;
}

.loading-sacrifice-items .loading-dots {
  padding: 0;
}

.loading-sacrifice-items .loading-dots .dot {
  width: 6px;
  height: 6px;
}

/* ===== Best Drop 樣式 ===== */
.best-drop-module {
  position: relative;
  overflow: hidden;
}

.best-drop-container {
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.best-drop-content {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  max-width: 280px;
}

.best-drop-image {
  width: 60px;
  height: 60px;
  border-radius: 8px;
  overflow: hidden;
  background: rgba(0, 245, 255, 0.1);
  border: 1px solid rgba(0, 245, 255, 0.2);
  flex-shrink: 0;
  box-shadow: 0 0 10px rgba(0, 245, 255, 0.3);
}

.best-drop-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 5px;
}

.best-drop-info {
  flex: 1;
  min-width: 0;
  text-align: left;
}

.best-drop-info .weapon-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
  margin-bottom: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  white-space: normal;
  max-height: 2.6em;
}

.best-drop-info .skin-name {
  font-size: 10px;
  color: var(--text-muted);
  line-height: 1.3;
  margin-bottom: 5px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  white-space: normal;
}

.best-drop-info .weapon-price {
  font-size: 14px;
  font-weight: 700;
  color: var(--neon-green);
  text-shadow: 0 0 10px var(--neon-green);
}

.best-drop-loading,
.best-drop-empty,
.best-drop-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-size: 10px;
  color: var(--text-muted);
  min-height: 50px;
}

.best-drop-loading i {
  font-size: 16px;
  color: var(--neon-blue);
}

.best-drop-empty i {
  font-size: 20px;
  color: #666;
}

.best-drop-error i {
  font-size: 16px;
  color: #ff6b6b;
}

/* 響應式調整 */
@media (max-width: 768px) {
  .best-drop-content {
    max-width: 220px;
  }
  
  .best-drop-image {
    width: 50px;
    height: 50px;
  }
  
  .best-drop-info .weapon-name {
    font-size: 11px;
  }
  
  .best-drop-info .skin-name {
    font-size: 9px;
  }
  
  .best-drop-info .weapon-price {
    font-size: 12px;
  }
}
