:root {
  --bg-dark: #0a0e1a;
  --bg-panel: #111827;
  --bg-card: #1a2338;
  --bg-hover: #243150;
  --text-main: #c8d4e8;
  --text-dim: #6b7a99;
  --text-bright: #e8edf5;
  --accent-cyan: #00d4ff;
  --accent-cyan-dim: #0099bb;
  --accent-gold: #ffd700;
  --accent-gold-dim: #b8860b;
  --accent-green: #4ade80;
  --accent-red: #ff6b6b;
  --accent-purple: #a78bfa;
  --accent-orange: #fb923c;
  --border-color: #2a3556;
  --shadow-glow: 0 0 20px rgba(0, 212, 255, 0.15);
  --radius: 8px;
}

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

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

#app {
  width: 100%;
  height: 100%;
  position: relative;
}

.screen {
  display: none;
  width: 100%;
  height: 100%;
}

.screen.active {
  display: flex;
}

/* ============ 标题界面 ============ */
#title-screen {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at center, #0d1429 0%, #050810 100%);
  position: relative;
  overflow: hidden;
}

.title-bg-effects {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.particle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: var(--accent-cyan);
  border-radius: 50%;
  left: var(--x);
  top: var(--y);
  opacity: 0;
  animation: float 6s ease-in-out infinite;
  animation-delay: var(--d);
  box-shadow: 0 0 8px var(--accent-cyan);
}

@keyframes float {
  0%, 100% { opacity: 0; transform: translateY(0) scale(0.5); }
  50% { opacity: 0.6; transform: translateY(-30px) scale(1.5); }
}

.title-content {
  text-align: center;
  z-index: 1;
  animation: fadeInUp 1.2s ease;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

.title-sub {
  color: var(--accent-cyan);
  font-size: 1.1rem;
  letter-spacing: 0.5em;
  margin-bottom: 0.5rem;
  text-shadow: 0 0 15px rgba(0, 212, 255, 0.5);
}

.title-main {
  font-size: 6rem;
  font-weight: 900;
  letter-spacing: 0.3em;
  color: transparent;
  background: linear-gradient(135deg, #00d4ff, #a78bfa, #ffd700);
  -webkit-background-clip: text;
  background-clip: text;
  margin: 0.5rem 0;
  line-height: 1.1;
  text-shadow: 0 0 60px rgba(0, 212, 255, 0.3);
}

.title-tagline {
  color: var(--text-dim);
  font-size: 1rem;
  margin-bottom: 3rem;
  font-style: italic;
}

.title-buttons {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
}

/* 年代选择卡片 */
.era-cards {
  display: flex;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.era-card {
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: 10px;
  padding: 1.2rem 1.5rem;
  cursor: pointer;
  transition: all 0.3s;
  font-family: inherit;
  text-align: center;
  min-width: 140px;
  position: relative;
  overflow: hidden;
}

.era-card::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.08;
  transition: opacity 0.3s;
}

.era-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent-cyan);
  box-shadow: 0 8px 30px rgba(0, 212, 255, 0.2);
}

.era-card:hover::before {
  opacity: 0.15;
}

.era-card:active {
  transform: translateY(-1px);
}

.era-90s::before { background: linear-gradient(135deg, #4ade80, #22d3ee); }
.era-00s::before { background: linear-gradient(135deg, #a78bfa, #6366f1); }
.era-10s::before { background: linear-gradient(135deg, #fb923c, #f59e0b); }

.era-card-year {
  font-size: 1.6rem;
  font-weight: bold;
  letter-spacing: 0.05em;
  margin-bottom: 0.3rem;
  position: relative;
}

.era-90s .era-card-year { color: #4ade80; }
.era-00s .era-card-year { color: #a78bfa; }
.era-10s .era-card-year { color: #fb923c; }

.era-card-name {
  font-size: 0.9rem;
  color: var(--text-main);
  margin-bottom: 0.3rem;
  position: relative;
}

.era-card-hint {
  font-size: 0.72rem;
  color: var(--text-dim);
  position: relative;
}

.btn-small {
  font-size: 0.85rem !important;
  padding: 0.5rem 1.2rem !important;
  opacity: 0.7;
}

.btn-small:hover {
  opacity: 1;
}

@media (max-width: 640px) {
  .era-cards {
    flex-direction: column;
    width: 100%;
  }
  .era-card {
    min-width: auto;
    width: 100%;
  }
}


.btn-title {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 0.8rem 3rem;
  font-size: 1.05rem;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.3s ease;
  min-width: 220px;
  font-family: inherit;
  letter-spacing: 0.1em;
}

.btn-title:hover {
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  background: rgba(0, 212, 255, 0.05);
  box-shadow: var(--shadow-glow);
  transform: translateY(-2px);
}

.title-footer {
  position: absolute;
  bottom: 1.5rem;
  color: var(--text-dim);
  font-size: 0.8rem;
}

/* ============ 游戏界面 ============ */
#game-screen {
  background: var(--bg-dark);
}

.game-layout {
  display: flex;
  width: 100%;
  height: 100%;
}

/* 系统面板 */
.system-panel {
  width: 280px;
  min-width: 280px;
  background: var(--bg-panel);
  border-right: 1px solid var(--border-color);
  padding: 1rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.system-panel::-webkit-scrollbar {
  width: 4px;
}

.system-panel::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 2px;
}

.sys-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-color);
}

.sys-icon {
  color: var(--accent-cyan);
  font-size: 1.3rem;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; text-shadow: 0 0 10px var(--accent-cyan); }
  50% { opacity: 0.6; text-shadow: 0 0 20px var(--accent-cyan); }
}

.sys-name {
  font-weight: bold;
  color: var(--text-bright);
  font-size: 0.95rem;
  flex: 1;
}

.sys-lv {
  background: var(--accent-cyan-dim);
  color: var(--bg-dark);
  font-size: 0.75rem;
  font-weight: bold;
  padding: 2px 8px;
  border-radius: 4px;
}

.sys-points {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-card);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
}

.sys-points .label {
  color: var(--text-dim);
  font-size: 0.8rem;
}

.sys-points .value {
  color: var(--accent-gold);
  font-weight: bold;
  font-size: 1.1rem;
}

.era-display {
  text-align: center;
  padding: 0.5rem;
  background: linear-gradient(135deg, rgba(0,212,255,0.08), rgba(167,139,250,0.08));
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  font-size: 0.85rem;
  color: var(--accent-cyan);
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.stat-item {
  background: var(--bg-card);
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  font-size: 0.8rem;
}

.stat-item .stat-name {
  color: var(--text-dim);
  font-size: 0.7rem;
}

.stat-item .stat-val {
  font-weight: bold;
  font-size: 0.95rem;
}

.stat-bar {
  height: 3px;
  background: var(--bg-hover);
  border-radius: 2px;
  margin-top: 3px;
  overflow: hidden;
}

.stat-bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.5s ease;
}

.sys-section {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
  overflow: hidden;
}

.sys-section-title {
  padding: 0.5rem 0.75rem;
  font-size: 0.8rem;
  color: var(--text-main);
  cursor: pointer;
  user-select: none;
  border-bottom: 1px solid transparent;
  transition: all 0.2s;
}

.sys-section-title:hover {
  background: var(--bg-hover);
}

.sys-section-title.expanded {
  border-bottom-color: var(--border-color);
}

.sys-section-body {
  display: none;
  padding: 0.5rem 0.75rem;
  font-size: 0.78rem;
}

.sys-section-body.show {
  display: block;
}

.quest-item {
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--border-color);
}

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

.quest-item .quest-name {
  color: var(--accent-gold);
  font-size: 0.78rem;
}

.quest-item .quest-desc {
  color: var(--text-dim);
  font-size: 0.72rem;
  margin-top: 2px;
}

.quest-item.completed .quest-name {
  color: var(--accent-green);
  text-decoration: line-through;
}

.inv-item {
  display: flex;
  justify-content: space-between;
  padding: 0.3rem 0;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.78rem;
}

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

.rel-item {
  display: flex;
  justify-content: space-between;
  padding: 0.3rem 0;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.78rem;
}

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

.rel-bar {
  display: inline-block;
  width: 40px;
  height: 6px;
  background: var(--bg-hover);
  border-radius: 3px;
  overflow: hidden;
  vertical-align: middle;
  margin-left: 4px;
}

.rel-bar-fill {
  height: 100%;
  border-radius: 3px;
}

.sys-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-top: auto;
  padding-top: 0.5rem;
}

.btn-sys {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 0.5rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.82rem;
  transition: all 0.2s;
  font-family: inherit;
}

.btn-sys:hover {
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  background: rgba(0, 212, 255, 0.05);
}

/* 叙事区 */
.story-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 1.5rem 2.5rem 0.5rem;
  overflow: hidden;
  position: relative;
}

.story-text::-webkit-scrollbar {
  width: 4px;
}

.story-text::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 2px;
}

.chapter-info {
  color: var(--accent-cyan);
  font-size: 0.85rem;
  margin-bottom: 1rem;
  letter-spacing: 0.1em;
  opacity: 0.7;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.5rem;
}

.story-text {
  flex: 1;
  overflow-y: auto;
  font-size: 1.05rem;
  line-height: 2;
  color: var(--text-main);
  margin-bottom: 0.5rem;
  min-height: 100px;
  cursor: pointer;
  padding-right: 6px;
}

.story-text .narration {
  margin-bottom: 1rem;
}

.story-text .system-msg {
  background: linear-gradient(135deg, rgba(0,212,255,0.06), rgba(0,212,255,0.02));
  border-left: 3px solid var(--accent-cyan);
  padding: 0.75rem 1rem;
  margin: 1rem 0;
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--accent-cyan);
  font-size: 0.95rem;
}

.story-text .system-msg .sys-tag {
  font-weight: bold;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
}

.story-text .thought {
  color: var(--text-dim);
  font-style: italic;
  padding-left: 1rem;
  border-left: 2px solid var(--border-color);
  margin: 0.75rem 0;
}

.story-text .dialogue {
  color: var(--text-bright);
  margin: 0.5rem 0;
}

.story-text .dialogue .speaker {
  color: var(--accent-purple);
  font-weight: bold;
  font-size: 0.9rem;
}

.story-text .warning {
  color: var(--accent-red);
  font-weight: bold;
}

.story-text .reward {
  color: var(--accent-gold);
}

.story-text .time-pass {
  text-align: center;
  color: var(--text-dim);
  font-size: 0.85rem;
  margin: 1.5rem 0;
  letter-spacing: 0.3em;
}

.typing-cursor {
  display: inline-block;
  width: 8px;
  height: 1.1em;
  background: var(--accent-cyan);
  animation: blink 0.8s infinite;
  vertical-align: text-bottom;
  margin-left: 2px;
}

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

/* 选项 */
.choices-container {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-bottom: 0.5rem;
  flex-shrink: 0;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-color);
}

.choice-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.98rem;
  text-align: left;
  transition: all 0.25s ease;
  font-family: inherit;
  line-height: 1.5;
  position: relative;
  opacity: 0;
  animation: choiceFadeIn 0.4s ease forwards;
}

@keyframes choiceFadeIn {
  from { opacity: 0; transform: translateX(-15px); }
  to { opacity: 1; transform: translateX(0); }
}

.choice-btn:hover {
  border-color: var(--accent-cyan);
  background: var(--bg-hover);
  color: var(--text-bright);
  transform: translateX(5px);
  box-shadow: -3px 0 15px rgba(0, 212, 255, 0.1);
}

.choice-btn:hover::before {
  content: "▸ ";
  color: var(--accent-cyan);
}

.choice-btn .choice-hint {
  display: block;
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-top: 4px;
}

.choice-btn.locked {
  opacity: 0.4;
  cursor: not-allowed;
  border-style: dashed;
}

.choice-btn.locked:hover {
  border-color: var(--accent-red);
  transform: none;
  box-shadow: none;
}

.choice-btn.locked .lock-info {
  color: var(--accent-red);
  font-size: 0.75rem;
}

.choice-btn.special {
  border-color: var(--accent-gold-dim);
}

.choice-btn.special:hover {
  border-color: var(--accent-gold);
  box-shadow: -3px 0 15px rgba(255, 215, 0, 0.15);
}

.story-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
  padding: 0.3rem 0;
}

.skip-hint {
  color: var(--text-dim);
  font-size: 0.75rem;
}

.btn-control {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-dim);
  padding: 0.3rem 0.8rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.78rem;
  font-family: inherit;
  transition: all 0.2s;
}

.btn-control:hover {
  color: var(--accent-cyan);
  border-color: var(--accent-cyan);
}

.story-controls-right {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.btn-skip {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-dim);
  padding: 0.3rem 0.8rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.78rem;
  font-family: inherit;
  transition: all 0.2s;
  white-space: nowrap;
}

.btn-skip:hover {
  color: var(--accent-gold);
  border-color: var(--accent-gold);
}

.btn-skip:active {
  transform: scale(0.95);
}

/* 系统弹窗 */
.system-popup {
  position: fixed;
  top: 30%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.8);
  background: linear-gradient(135deg, rgba(10,14,26,0.98), rgba(17,24,39,0.98));
  border: 1px solid var(--accent-cyan);
  border-radius: var(--radius);
  padding: 1rem 2rem;
  color: var(--accent-cyan);
  font-size: 1rem;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: all 0.4s ease;
  box-shadow: 0 0 40px rgba(0, 212, 255, 0.3);
  text-align: center;
  max-width: 500px;
}

.system-popup.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.system-popup .popup-title {
  font-weight: bold;
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  margin-bottom: 0.4rem;
}

.system-popup .popup-body {
  color: var(--text-main);
  font-size: 0.95rem;
}

.system-popup.gold {
  border-color: var(--accent-gold);
  box-shadow: 0 0 40px rgba(255, 215, 0, 0.3);
}

.system-popup.gold .popup-title {
  color: var(--accent-gold);
}

.system-popup.red {
  border-color: var(--accent-red);
  box-shadow: 0 0 40px rgba(255, 107, 107, 0.3);
}

.system-popup.red .popup-title {
  color: var(--accent-red);
}

/* 弹窗 */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(5, 8, 16, 0.85);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}

.modal-overlay.show {
  display: flex;
}

.modal-box {
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 1.5rem;
  width: 420px;
  max-width: 90vw;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 0 60px rgba(0, 212, 255, 0.1);
}

.modal-lg {
  width: 640px;
}

.modal-title {
  font-size: 1.2rem;
  color: var(--accent-cyan);
  margin-bottom: 1rem;
  text-align: center;
  font-weight: bold;
}

.shop-points {
  text-align: center;
  color: var(--accent-gold);
  margin-bottom: 1rem;
  font-size: 0.95rem;
}

.shop-items {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-bottom: 1rem;
}

.shop-item {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 0.75rem;
  cursor: pointer;
  transition: all 0.2s;
}

.shop-item:hover {
  border-color: var(--accent-cyan);
  background: var(--bg-hover);
}

.shop-item .shop-item-name {
  font-weight: bold;
  color: var(--text-bright);
  font-size: 0.9rem;
}

.shop-item .shop-item-desc {
  color: var(--text-dim);
  font-size: 0.78rem;
  margin: 0.2rem 0;
}

.shop-item .shop-item-cost {
  color: var(--accent-gold);
  font-size: 0.82rem;
}

.shop-item.disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-close {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 0.6rem;
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.9rem;
  transition: all 0.2s;
}

.btn-close:hover {
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

/* 存档 */
.save-slots {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.save-slot {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 0.75rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.save-slot-info {
  flex: 1;
}

.save-slot-name {
  font-weight: bold;
  color: var(--text-bright);
  font-size: 0.9rem;
}

.save-slot-detail {
  color: var(--text-dim);
  font-size: 0.78rem;
  margin-top: 2px;
}

.save-slot-actions {
  display: flex;
  gap: 0.4rem;
}

.btn-slot {
  background: var(--bg-hover);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 0.3rem 0.7rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.78rem;
  font-family: inherit;
  transition: all 0.2s;
}

.btn-slot:hover {
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

.btn-slot.danger:hover {
  border-color: var(--accent-red);
  color: var(--accent-red);
}

/* 对话记录 */
.log-content {
  max-height: 50vh;
  overflow-y: auto;
  margin-bottom: 1rem;
  font-size: 0.88rem;
  line-height: 1.8;
}

.log-entry {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border-color);
}

.log-entry .log-chapter {
  color: var(--accent-cyan);
  font-size: 0.78rem;
}

/* 结局弹窗 */
.ending-content {
  text-align: center;
  margin-bottom: 1.5rem;
}

.ending-rank {
  font-size: 0.85rem;
  letter-spacing: 0.3em;
  margin-bottom: 0.5rem;
}

.ending-title {
  font-size: 1.8rem;
  font-weight: bold;
  margin-bottom: 1rem;
}

.ending-desc {
  color: var(--text-main);
  line-height: 1.8;
  text-align: left;
  font-size: 0.95rem;
  margin-bottom: 1rem;
}

.ending-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  margin-bottom: 1rem;
}

.ending-stat {
  background: var(--bg-card);
  padding: 0.3rem 0.7rem;
  border-radius: 4px;
  font-size: 0.8rem;
  border: 1px solid var(--border-color);
}

.ending-buttons {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
}

.ending-buttons button {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 0.6rem 1.5rem;
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.9rem;
  transition: all 0.2s;
}

.ending-buttons button:hover {
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

/* 关于界面 */
#about-screen, #gallery-screen {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at center, #0d1429 0%, #050810 100%);
  padding: 2rem;
}

.about-content, .gallery-content {
  max-width: 600px;
  width: 100%;
  text-align: center;
}

.about-content h2, .gallery-content h2 {
  color: var(--accent-cyan);
  font-size: 2rem;
  margin-bottom: 1.5rem;
}

.about-text {
  text-align: left;
  line-height: 2;
  margin-bottom: 2rem;
}

.about-text p {
  margin-bottom: 0.75rem;
}

.about-content button, .gallery-content > button {
  margin-top: 1rem;
}

/* 结局图鉴 */
.gallery-stats {
  color: var(--text-dim);
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
}

.gallery-stats .unlocked {
  color: var(--accent-gold);
  font-weight: bold;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.75rem;
  margin-bottom: 2rem;
  text-align: left;
  max-height: 50vh;
  overflow-y: auto;
}

.gallery-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 0.75rem;
  cursor: default;
  transition: all 0.2s;
}

.gallery-card.unlocked {
  border-color: var(--accent-gold-dim);
}

.gallery-card.unlocked:hover {
  border-color: var(--accent-gold);
  box-shadow: 0 0 15px rgba(255, 215, 0, 0.1);
}

.gallery-card .card-rank {
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  margin-bottom: 0.2rem;
}

.gallery-card .card-title {
  font-weight: bold;
  font-size: 0.88rem;
  color: var(--text-bright);
}

.gallery-card .card-era {
  font-size: 0.72rem;
  color: var(--text-dim);
  margin-top: 0.2rem;
}

.gallery-card.locked .card-title,
.gallery-card.locked .card-era {
  color: var(--text-dim);
}

.gallery-card.locked .card-title::before {
  content: "??? ";
}

/* 响应式 */
@media (max-width: 768px) {
  .game-layout {
    flex-direction: column;
  }
  .system-panel {
    width: 100%;
    min-width: 0;
    max-height: 35vh;
    border-right: none;
    border-bottom: 1px solid var(--border-color);
  }
  .story-area {
    padding: 1rem 1.2rem;
  }
  .title-main {
    font-size: 4rem;
  }
  .modal-lg {
    width: 90vw;
  }
}
