/* ===== 蛮荒人生模拟器 · 样式 ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg-dark: #0a0a12;
  --bg-card: #12121f;
  --bg-card-hover: #1a1a2e;
  --border: #2a2a4a;
  --text: #e0e0e0;
  --text-dim: #888;
  --gold: #ffd700;
  --gold-dim: #b8960f;
  --red: #ff4444;
  --green: #44ff88;
  --blue: #4488ff;
  --purple: #aa44ff;
  --cyan: #44ffdd;
  --accent: #6c5ce7;
}

body {
  background: var(--bg-dark);
  color: var(--text);
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
}

#game-container {
  max-width: 780px;
  margin: 0 auto;
  padding: 18px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---------- 标题页 ---------- */
#title-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  text-align: center;
  animation: fadeIn 1s ease;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }
@keyframes glow {
  0%, 100% { text-shadow: 0 0 20px rgba(108,92,231,0.5); }
  50% { text-shadow: 0 0 40px rgba(108,92,231,0.8), 0 0 60px rgba(108,92,231,0.3); }
}

.title-main {
  font-family: "STKaiti", "KaiTi", "SimSun", serif;
  font-size: 2.6em;
  font-weight: 700;
  color: var(--gold);
  animation: glow 3s ease-in-out infinite;
  margin-bottom: 10px;
  letter-spacing: 4px;
}

.title-sub {
  font-size: 1em;
  color: var(--text-dim);
  margin-bottom: 36px;
}

.title-quote {
  font-size: 0.9em;
  color: var(--accent);
  margin-bottom: 44px;
  max-width: 480px;
  line-height: 1.9;
  padding: 18px;
  border-left: 3px solid var(--accent);
  text-align: left;
}

.btn {
  padding: 13px 44px;
  border: 2px solid var(--accent);
  background: transparent;
  color: var(--text);
  font-size: 1.05em;
  cursor: pointer;
  transition: all 0.3s;
  border-radius: 4px;
  letter-spacing: 2px;
  font-family: inherit;
}

.btn:hover {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 0 20px rgba(108,92,231,0.4);
}

.btn-small {
  padding: 9px 26px;
  font-size: 0.9em;
  margin: 5px;
}

.btn-choice {
  display: block;
  width: 100%;
  text-align: left;
  padding: 13px 18px;
  margin: 8px 0;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  font-size: 0.92em;
  cursor: pointer;
  transition: all 0.3s;
  border-radius: 6px;
  line-height: 1.6;
  font-family: inherit;
}

.btn-choice:hover {
  border-color: var(--accent);
  background: var(--bg-card-hover);
  transform: translateX(5px);
}

/* ---------- 属性面板 ---------- */
.stats-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  margin: 12px 0;
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.stat-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 10px;
  border-radius: 4px;
  background: rgba(255,255,255,0.03);
}

.stat-label { color: var(--text-dim); font-size: 0.85em; }
.stat-value { font-weight: 700; font-size: 0.92em; }
.stat-value.gold { color: var(--gold); }
.stat-value.red { color: var(--red); }
.stat-value.green { color: var(--green); }
.stat-value.blue { color: var(--blue); }
.stat-value.purple { color: var(--purple); }
.stat-value.cyan { color: var(--cyan); }

/* ---------- 事件卡片 ---------- */
.event-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 22px;
  margin: 12px 0;
  animation: slideUp 0.5s ease;
}

.event-age {
  font-size: 0.82em;
  color: var(--accent);
  margin-bottom: 8px;
  letter-spacing: 2px;
}

.event-title {
  font-family: "STKaiti", "KaiTi", serif;
  font-size: 1.35em;
  color: var(--gold);
  margin-bottom: 14px;
}

.event-text {
  line-height: 1.9;
  color: var(--text);
  font-size: 0.93em;
  margin-bottom: 14px;
}

.event-text .highlight { color: var(--gold); font-weight: 700; }
.event-text .danger { color: var(--red); }
.event-text .info { color: var(--cyan); }

.event-effect {
  padding: 9px 14px;
  background: rgba(108,92,231,0.1);
  border-left: 3px solid var(--accent);
  border-radius: 0 4px 4px 0;
  margin: 8px 0;
  font-size: 0.88em;
  color: var(--text-dim);
}

.event-effect.positive { border-left-color: var(--green); background: rgba(68,255,136,0.08); }
.event-effect.negative { border-left-color: var(--red); background: rgba(255,68,68,0.08); }

.divider {
  height: 1px;
  background: linear-gradient(to right, transparent, var(--border), transparent);
  margin: 16px 0;
}

/* ---------- 成就弹窗 ---------- */
.achievement-popup {
  position: fixed;
  top: 20px;
  right: 20px;
  background: var(--bg-card);
  border: 2px solid var(--gold);
  border-radius: 8px;
  padding: 14px 18px;
  z-index: 1000;
  animation: slideUp 0.5s ease, fadeOut 0.5s ease 2.5s forwards;
  box-shadow: 0 0 30px rgba(255,215,0,0.3);
}

@keyframes fadeOut { to { opacity: 0; transform: translateY(-20px); } }

.achievement-popup .ach-label { color: var(--gold); font-size: 0.78em; letter-spacing: 2px; margin-bottom: 4px; }
.achievement-popup .ach-name { font-size: 1.05em; font-weight: 700; }
.achievement-popup .ach-points { color: var(--green); font-size: 0.82em; margin-top: 4px; }

/* ---------- 总结页 ---------- */
.summary-box {
  background: var(--bg-card);
  border: 1px solid var(--gold-dim);
  border-radius: 8px;
  padding: 26px;
  margin: 12px 0;
  text-align: center;
}

.summary-title {
  font-family: "STKaiti", "KaiTi", serif;
  font-size: 1.7em;
  color: var(--gold);
  margin-bottom: 18px;
}

.timeline {
  text-align: left;
  margin: 16px 0;
  padding-left: 18px;
  border-left: 2px solid var(--border);
}

.timeline-item {
  padding: 5px 0 5px 14px;
  font-size: 0.88em;
  color: var(--text-dim);
  position: relative;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -6px;
  top: 12px;
  width: 9px;
  height: 9px;
  background: var(--accent);
  border-radius: 50%;
}

.timeline-item.highlight { color: var(--text); }
.timeline-item.death { color: var(--red); }

.achievements-earned {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin: 12px 0;
}

.ach-badge {
  padding: 5px 13px;
  background: rgba(255,215,0,0.1);
  border: 1px solid var(--gold-dim);
  border-radius: 20px;
  font-size: 0.78em;
  color: var(--gold);
}

.final-quote {
  font-style: italic;
  color: var(--text-dim);
  margin-top: 22px;
  padding: 14px;
  border-top: 1px solid var(--border);
  line-height: 1.8;
}

/* ---------- 属性提升 ---------- */
.meta-panel {
  background: var(--bg-card);
  border: 1px solid var(--purple);
  border-radius: 8px;
  padding: 18px;
  margin: 12px 0;
}

.meta-title { color: var(--purple); font-size: 1.05em; margin-bottom: 14px; text-align: center; }
.meta-points { text-align: center; font-size: 1.4em; color: var(--purple); margin-bottom: 14px; }

.upgrade-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px;
  margin: 5px 0;
  background: rgba(255,255,255,0.03);
  border-radius: 4px;
}

.upgrade-name { font-size: 0.88em; }
.upgrade-cost { color: var(--purple); font-size: 0.82em; }

.btn-upgrade {
  padding: 5px 14px;
  border: 1px solid var(--purple);
  background: transparent;
  color: var(--purple);
  font-size: 0.78em;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.3s;
  font-family: inherit;
}

.btn-upgrade:hover { background: var(--purple); color: #fff; }
.btn-upgrade:disabled { opacity: 0.3; cursor: not-allowed; }

/* ---------- 滚动条 / 响应式 ---------- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-dark); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

@media (max-width: 600px) {
  .title-main { font-size: 1.7em; }
  .stats-grid { grid-template-columns: 1fr; }
  .btn { padding: 11px 30px; font-size: 1em; }
}
