* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
  background: linear-gradient(135deg, #0a0e27 0%, #1a1a3e 50%, #0d0d1a 100%);
  color: #e0e0e0;
  line-height: 1.5;
}

#app {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

/* ===== 头部 ===== */
header {
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 2px solid rgba(0, 200, 255, 0.3);
}

h1 {
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 4px;
  color: #00d4ff;
  text-shadow: 0 0 20px rgba(0, 212, 255, 0.3);
}

.subtitle {
  font-size: 13px;
  color: #888;
  margin-bottom: 12px;
}

.progress-section {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(0, 200, 255, 0.2);
}

.progress-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 12px;
}

#stageName {
  color: #00d4ff;
  font-weight: 700;
}

#progressPercent {
  color: #00ff88;
  font-weight: 700;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: rgba(0, 212, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid rgba(0, 212, 255, 0.3);
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #0084ff, #00d4ff, #00ff88);
  width: 0%;
  transition: width 0.3s ease;
  box-shadow: 0 0 15px rgba(0, 212, 255, 0.5);
}

.status-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px;
  font-size: 13px;
}

.stat {
  background: rgba(0, 212, 255, 0.08);
  border-left: 3px solid #00d4ff;
  padding: 10px 12px;
  border-radius: 4px;
}

.stat .label {
  display: block;
  color: #888;
  font-size: 11px;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.stat span:last-child {
  display: block;
  font-size: 18px;
  font-weight: 800;
  color: #00ff88;
}

/* ===== 主区域布局 ===== */
main {
  display: grid;
  grid-template-columns: 2fr 1.2fr;
  gap: 20px;
  margin-bottom: 20px;
}

.core {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.side {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ===== 地点标签 ===== */
.location-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  border-bottom: 2px solid rgba(0, 200, 255, 0.2);
  padding-bottom: 12px;
}

.location-tab {
  padding: 8px 16px;
  border: 2px solid rgba(0, 200, 255, 0.3);
  background: rgba(0, 212, 255, 0.05);
  color: #00d4ff;
  font-weight: 700;
  font-size: 13px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s;
}

.location-tab:hover {
  background: rgba(0, 212, 255, 0.15);
  border-color: rgba(0, 212, 255, 0.6);
}

.location-tab.active {
  background: #00d4ff;
  color: #000;
  box-shadow: 0 0 20px rgba(0, 212, 255, 0.4);
}

/* ===== 行动面板 ===== */
.action-panel {
  background: rgba(20, 30, 60, 0.9);
  border: 2px solid rgba(0, 200, 255, 0.4);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
}

.action-panel h2 {
  font-size: 18px;
  margin-bottom: 16px;
  color: #00d4ff;
}

.big-btn {
  width: 100%;
  padding: 28px 16px;
  font-size: 20px;
  font-weight: 800;
  border: none;
  border-radius: 8px;
  background: linear-gradient(135deg, #0084ff, #00d4ff);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 0 30px rgba(0, 212, 255, 0.3);
  transition: all 0.2s;
  margin-bottom: 12px;
}

.big-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 50px rgba(0, 212, 255, 0.5);
}

.big-btn:active {
  transform: translateY(0);
  box-shadow: 0 0 20px rgba(0, 212, 255, 0.4);
}

.btn-hint {
  font-size: 12px;
  color: #888;
}

/* ===== 日志容器 ===== */
.log-container {
  background: rgba(10, 10, 25, 0.95);
  border: 2px solid rgba(0, 200, 255, 0.2);
  border-radius: 8px;
  padding: 16px;
  min-height: 320px;
  max-height: 500px;
  overflow-y: auto;
  flex: 1;
}

.log-container h2 {
  font-size: 16px;
  margin-bottom: 12px;
  color: #00d4ff;
}

#log {
  font-size: 12px;
  line-height: 1.8;
}

.log-line {
  margin-bottom: 6px;
  opacity: 0.85;
  padding: 4px;
  border-left: 2px solid rgba(0, 212, 255, 0.3);
  padding-left: 10px;
}

.log-line.success {
  color: #00ff88;
  border-left-color: #00ff88;
}

.log-line.warning {
  color: #ffa500;
  border-left-color: #ffa500;
}

.log-line.error {
  color: #ff6b6b;
  border-left-color: #ff6b6b;
}

/* ===== 面板样式 ===== */
.panel {
  background: rgba(15, 15, 40, 0.95);
  border: 2px solid rgba(0, 200, 255, 0.3);
  border-radius: 8px;
  padding: 16px;
  flex: 1;
  min-height: 300px;
  overflow-y: auto;
}

.panel h2 {
  font-size: 15px;
  margin-bottom: 12px;
  color: #00d4ff;
}

/* ===== 建筑项 ===== */
.building-item {
  background: rgba(0, 212, 255, 0.05);
  border: 2px solid rgba(0, 212, 255, 0.2);
  border-radius: 6px;
  padding: 10px;
  margin-bottom: 10px;
  font-size: 12px;
  transition: all 0.3s;
}

.building-item:hover {
  background: rgba(0, 212, 255, 0.12);
  border-color: rgba(0, 212, 255, 0.5);
  transform: translateX(2px);
}

.building-item.can-upgrade {
  border-color: #00ff88;
  background: rgba(0, 255, 136, 0.08);
}

.building-item.can-upgrade:hover {
  background: rgba(0, 255, 136, 0.15);
  box-shadow: 0 0 15px rgba(0, 255, 136, 0.3);
}

.building-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.building-name {
  font-weight: 700;
  color: #00d4ff;
}

.building-level {
  background: rgba(0, 255, 136, 0.2);
  color: #00ff88;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 700;
}

.building-effect {
  color: #888;
  margin-bottom: 4px;
  font-size: 11px;
}

.building-cost {
  color: #ffa500;
  margin-bottom: 6px;
  font-size: 11px;
}

.building-btn {
  width: 100%;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  background: #00d4ff;
  color: #000;
  border: none;
  border-radius: 3px;
  transition: all 0.2s;
}

.building-btn:hover:not(:disabled) {
  background: #00ff88;
  transform: scale(1.02);
}

.building-btn:disabled {
  background: #444;
  color: #888;
  cursor: not-allowed;
  opacity: 0.5;
}

/* ===== 行星卡片 ===== */
.planet-item {
  background: rgba(30, 50, 100, 0.6);
  border: 2px solid rgba(100, 150, 255, 0.3);
  border-radius: 6px;
  padding: 10px;
  margin-bottom: 10px;
  font-size: 12px;
  transition: all 0.3s;
  cursor: pointer;
}

.planet-item:hover {
  background: rgba(30, 50, 100, 0.9);
  border-color: rgba(100, 150, 255, 0.6);
  transform: translateX(2px);
}

.planet-item.colonized {
  border-color: #00ff88;
  background: rgba(0, 255, 136, 0.08);
}

.planet-name {
  font-weight: 700;
  color: #a0d8ff;
  margin-bottom: 4px;
}

.planet-info {
  color: #888;
  font-size: 11px;
  margin-bottom: 4px;
}

.planet-status {
  color: #ffa500;
  font-size: 11px;
}

.planet-status.done {
  color: #00ff88;
}

/* ===== 弹窗 ===== */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  backdrop-filter: blur(4px);
}

.hidden {
  display: none;
}

.modal-content {
  background: linear-gradient(135deg, #1a1a3e 0%, #0d0d2b 100%);
  border: 2px solid #00d4ff;
  padding: 24px;
  border-radius: 12px;
  width: 90%;
  max-width: 1000px;
  max-height: 95vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 0 50px rgba(0, 212, 255, 0.3);
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: none;
  border: none;
  font-size: 28px;
  color: #00d4ff;
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.modal-close:hover {
  color: #ff6b6b;
  transform: rotate(90deg);
}

.modal-content h2 {
  font-size: 20px;
  color: #00d4ff;
  margin-bottom: 16px;
  margin-top: 0;
}

.modal-info {
  margin-bottom: 16px;
}

.modal-info p {
  margin-bottom: 10px;
  font-size: 13px;
  line-height: 1.6;
  color: #ccc;
}

#modalPlanetReq {
  color: #ffa500;
  font-weight: 600;
}

#modalPlanetMission {
  background: rgba(0, 212, 255, 0.1);
  border-left: 3px solid #00d4ff;
  padding: 10px;
  border-radius: 4px;
  margin-bottom: 12px;
  font-size: 12px;
  color: #aaa;
}

.modal-buttons {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.modal-buttons button {
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 700;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
}

#colonizeBtn {
  background: linear-gradient(135deg, #0084ff, #00d4ff);
  color: #fff;
}

#colonizeBtn:hover {
  box-shadow: 0 0 20px rgba(0, 212, 255, 0.4);
}

#colonizeBtn:disabled {
  background: #444;
  color: #888;
  cursor: not-allowed;
}

#closeModalBtn {
  background: rgba(255, 255, 255, 0.1);
  color: #aaa;
}

#closeModalBtn:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* ===== 阶段弹窗 ===== */
.stage-modal {
  text-align: center;
  background: linear-gradient(135deg, #0a1a3a 0%, #1a0a2a 100%);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.stage-visual {
  width: 100%;
  height: 900px;
  border-radius: 12px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 120px;
  border: none;
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 120px rgba(0, 212, 255, 0.6), inset 0 0 100px rgba(0, 0, 0, 0.7);
  transition: all 0.6s ease;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  z-index: 2;
}

.stage-visual::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.6));
  pointer-events: none;
  z-index: 1;
  border-radius: 12px;
}

.modal-content h2 {
  font-size: 24px;
  margin-bottom: 8px;
}

.stage-mood {
  font-size: 13px;
  color: #ffa500;
  font-weight: 700;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.stage-text {
  background: rgba(0, 212, 255, 0.08);
  border-left: 4px solid #00d4ff;
  padding: 16px;
  border-radius: 6px;
  margin-bottom: 16px;
  font-size: 14px;
  line-height: 1.8;
  color: #ddd;
  font-style: italic;
}

.stage-continue-btn {
  padding: 14px 40px;
  font-size: 15px;
  font-weight: 800;
  background: linear-gradient(135deg, #0084ff, #00d4ff);
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.stage-continue-btn:hover {
  box-shadow: 0 0 20px rgba(0, 212, 255, 0.5);
  transform: translateY(-2px);
}

/* 替换为真实图片的示例注释：
   如果要使用真实照片，可以这样修改：
   
   在 main.js 的 locationResources 中，将 image 改为图片URL：
   moon: { ... image: 'url("https://images.nasa.gov/...月球图片.jpg")' }
   mars: { ... image: 'url("https://images.nasa.gov/...火星图片.jpg")' }
   
   或者直接用本地文件路径：
   moon: { ... image: 'url("./images/moon.jpg")' }
   
   推荐图片来源：NASA Image Library (images.nasa.gov)
*/

/* ===== 滚动条 ===== */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.3);
}

::-webkit-scrollbar-thumb {
  background: rgba(0, 212, 255, 0.5);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 212, 255, 0.8);
}

/* ===== 响应式设计 ===== */
@media (max-width: 768px) {
  main {
    grid-template-columns: 1fr;
  }

  .status-bar {
    grid-template-columns: repeat(2, 1fr);
  }

  header {
    margin-bottom: 16px;
  }

  h1 {
    font-size: 22px;
  }
}
