* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  font-family: "Segoe UI", "Microsoft YaHei", sans-serif;
  background: linear-gradient(160deg, #0f0c29 0%, #1a1a3e 50%, #24243e 100%);
  color: #e8e6f0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 0;
}

.game-container {
  width: min(640px, 96vw);
  padding: 2rem;
}

.game-header h1 {
  text-align: center;
  font-size: 1.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  margin-bottom: 1.25rem;
  color: #c9b8ff;
  text-shadow: 0 0 20px rgba(160, 120, 255, 0.4);
}

.game-header {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 0;
}

/* ===== 窃取页布局 ===== */
.page-steal {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.currency-panel {
  text-align: center;
}

.currency-label {
  font-size: 0.95rem;
  color: #9a8fc7;
  margin-bottom: 0.5rem;
}

.currency-value {
  font-size: 2.5rem;
  font-weight: 700;
  color: #e0d4ff;
  font-variant-numeric: tabular-nums;
}

.steal-panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.progress-wrapper {
  width: 100%;
  height: 28px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(180, 150, 255, 0.2);
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #6b4ce6, #a78bfa);
  border-radius: 14px;
  transition: width 0.1s linear;
  box-shadow: 0 0 12px rgba(139, 92, 246, 0.5);
}

.progress-bar.full {
  background: linear-gradient(90deg, #a78bfa, #fbbf24);
  box-shadow: 0 0 14px rgba(251, 191, 36, 0.45);
}

.pending-label {
  text-align: center;
  font-size: 0.9rem;
  color: #b0a3d4;
  font-variant-numeric: tabular-nums;
}

.pending-cap {
  color: #fbbf24;
  font-size: 0.82rem;
  margin-left: 0.25rem;
}

.pending-cap.hidden {
  display: none;
}

.steal-btn {
  padding: 0.9rem 1.5rem;
  font-size: 1.1rem;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, #7c3aed, #5b21b6);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 4px 16px rgba(124, 58, 237, 0.4);
}

.steal-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(124, 58, 237, 0.55);
}

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

.steal-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

/* ===== 猎犬面板 ===== */
.hound-panel {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(180, 150, 255, 0.15);
  border-radius: 16px;
  padding: 1.25rem;
}

.hound-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.hound-title {
  font-size: 1rem;
  font-weight: 600;
  color: #d4c4ff;
}

.capture-count {
  font-size: 0.85rem;
  color: #9a8fc7;
  font-variant-numeric: tabular-nums;
}

.risk-panel {
  margin-bottom: 1rem;
}

.risk-hint {
  font-size: 0.72rem;
  color: #8a7aaa;
  margin-top: 0.35rem;
  text-align: center;
}

.risk-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: #c4a8a8;
  margin-bottom: 0.4rem;
  font-variant-numeric: tabular-nums;
}

.risk-wrapper {
  height: 14px;
  border-color: rgba(220, 100, 100, 0.25);
}

.risk-bar {
  background: linear-gradient(90deg, #dc2626, #f87171);
  box-shadow: 0 0 10px rgba(220, 38, 38, 0.45);
}

.cursed-hound-panel {
  margin-bottom: 1rem;
}

.cursed-hound-panel.hidden {
  display: none;
}

.cursed-hound-bar {
  background: linear-gradient(90deg, #be123c, #f43f5e);
  box-shadow: 0 0 10px rgba(244, 63, 94, 0.45);
}

.curse-stats {
  background: rgba(127, 29, 29, 0.15);
  border: 1px solid rgba(248, 113, 113, 0.2);
  border-radius: 10px;
  padding: 0.65rem 0.75rem;
  margin-bottom: 1rem;
}

.curse-stats.hidden {
  display: none;
}

.curse-stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  padding: 0.2rem 0;
}

.curse-stat-label {
  color: #c4a8a8;
}

.curse-stat-value {
  color: #fca5a5;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.stats-panel {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.stat-item {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 10px;
  padding: 0.6rem 0.4rem;
  text-align: center;
}

.stat-name {
  display: block;
  font-size: 0.72rem;
  color: #9a8fc7;
  margin-bottom: 0.25rem;
}

.stat-value {
  display: block;
  font-size: 0.95rem;
  font-weight: 600;
  color: #e8dfff;
  font-variant-numeric: tabular-nums;
}

.stat-item.stat-curse.hidden {
  display: none;
}

/* ===== 部件面板 ===== */
.parts-panel {
  margin-top: 0.5rem;
}

.parts-title {
  font-size: 0.85rem;
  color: #9a8fc7;
  margin-bottom: 0.6rem;
}

.parts-list {
  max-height: 220px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.parts-empty {
  text-align: center;
  font-size: 0.85rem;
  color: #6b6288;
  padding: 0.75rem 0;
}

.part-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  background: rgba(0, 0, 0, 0.22);
  border-radius: 8px;
  padding: 0.55rem 0.75rem;
  border-left: 3px solid #7c3aed;
}

.part-main {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.part-concentration {
  font-size: 0.72rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.part-concentration.conc-low {
  color: #93c5fd;
}

.part-concentration.conc-mid {
  color: #fbbf24;
}

.part-concentration.conc-high {
  color: #f472b6;
  text-shadow: 0 0 8px rgba(244, 114, 182, 0.4);
}

.part-item.stat-timeFlow {
  border-left-color: #60a5fa;
}

.part-item.stat-stealMultiplier {
  border-left-color: #f59e0b;
}

.part-item.stat-luck {
  border-left-color: #34d399;
}

.part-item.stat-timeCurse {
  border-left-color: #e11d48;
}

.part-name {
  font-size: 0.85rem;
  color: #ddd6f5;
}

.part-bonus {
  font-size: 0.8rem;
  color: #b0a3d4;
  font-variant-numeric: tabular-nums;
}

.cursed-equipped-panel.hidden {
  display: none;
}

.cursed-equipped-panel {
  margin-top: 0.75rem;
}

.cursed-equipped .part-item {
  border-left-color: #f472b6;
}

.cursed-equipped .part-item.stat-timeCurse {
  border-left-color: #e11d48;
}

/* ===== 升级面板 ===== */
.upgrade-panel {
  background: rgba(124, 58, 237, 0.1);
  border: 1px solid rgba(167, 139, 250, 0.35);
  border-radius: 16px;
  padding: 1.25rem;
  animation: panel-in 0.35s ease;
}

.upgrade-panel.hidden {
  display: none;
}

.upgrade-header {
  margin-bottom: 0.85rem;
}

.upgrade-title {
  font-size: 0.92rem;
  font-weight: 600;
  color: #c4b5fd;
}

.upgrade-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.upgrade-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.5rem 0.75rem;
  align-items: center;
  background: rgba(0, 0, 0, 0.22);
  border-radius: 10px;
  padding: 0.65rem 0.75rem;
}

.upgrade-info {
  min-width: 0;
}

.upgrade-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: #e8dfff;
}

.upgrade-desc {
  font-size: 0.75rem;
  color: #9a8fc7;
  margin-top: 0.15rem;
}

.upgrade-level {
  font-size: 0.72rem;
  color: #7c6fa8;
  margin-top: 0.1rem;
}

.upgrade-btn {
  padding: 0.5rem 0.85rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, #6d28d9, #5b21b6);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.15s, transform 0.15s;
  touch-action: manipulation;
  user-select: none;
}

.upgrade-btn:hover:not(:disabled) {
  transform: translateY(-1px);
}

.upgrade-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ===== Toast ===== */
.toast {
  position: fixed;
  top: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(30, 20, 50, 0.95);
  border: 1px solid rgba(220, 100, 100, 0.5);
  border-radius: 12px;
  padding: 1rem 1.5rem;
  min-width: 260px;
  text-align: center;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  z-index: 100;
  animation: toast-in 0.3s ease;
}

.toast.hidden {
  display: none;
}

.toast-title {
  font-size: 1rem;
  font-weight: 600;
  color: #fca5a5;
  margin-bottom: 0.4rem;
}

.toast-body {
  font-size: 0.9rem;
  color: #ddd6f5;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(-12px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

@keyframes panel-in {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== 重置存档按钮 ===== */
.reset-save-btn {
  padding: 0.8rem 1rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, #991b1b, #7f1d1d);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 4px 16px rgba(153, 27, 27, 0.4);
}

.reset-save-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(153, 27, 27, 0.55);
}

/* ===== 响应式 ===== */
@media (max-width: 720px) {
  .game-container {
    padding: 1rem;
  }

  .stats-panel {
    grid-template-columns: repeat(2, 1fr);
  }
}
