/* === 回声博物馆 · 全局样式 === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: #ffffff;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  font-size: 15px;
  line-height: 1.8;
  color: #1a1a1a;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

#app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  position: relative;
  display: flex;
  flex-direction: column;
}

/* Header */
#header {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid #e8e8e8;
  background: #fff;
  position: sticky;
  top: 0;
  z-index: 100;
  min-height: 52px;
}

#header h1 {
  flex: 1;
  text-align: center;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.header-btn {
  background: none;
  border: none;
  color: #2563eb;
  font-size: 14px;
  cursor: pointer;
  padding: 4px 8px;
  white-space: nowrap;
}

.header-spacer { width: 50px; }

/* Main content */
#content {
  flex: 1;
  padding: 16px;
  padding-bottom: 80px;
}

/* Cards */
.card {
  background: #fff;
  border: 1px solid #e8e8e8;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 12px;
  cursor: pointer;
  transition: box-shadow 0.2s;
}

.card:active { background: #fafafa; }

.card-title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 6px;
  color: #1a1a1a;
}

.card-subtitle {
  font-size: 13px;
  color: #888;
  margin-bottom: 8px;
}

.card-text {
  font-size: 14px;
  color: #555;
  line-height: 1.7;
}

/* Buttons */
.btn-primary {
  display: block;
  width: 100%;
  padding: 14px;
  background: #2563eb;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  text-align: center;
  transition: background 0.2s;
}

.btn-primary:active { background: #1d4ed8; }

.btn-secondary {
  display: block;
  width: 100%;
  padding: 12px;
  background: #f5f5f5;
  color: #333;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  font-size: 15px;
  cursor: pointer;
  text-align: center;
}

.btn-secondary:active { background: #eee; }

/* Input */
.input-field {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  border: 1px solid #d0d0d0;
  border-radius: 8px;
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s;
}

.input-field:focus { border-color: #2563eb; }

/* Inventory button */
#inventoryBtn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #2563eb;
  color: #fff;
  border: none;
  font-size: 22px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(37,99,235,0.3);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Inventory panel */
.inventory-panel {
  position: fixed;
  inset: 0;
  z-index: 300;
}

.inventory-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.3);
}

.inventory-content {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  max-height: 70vh;
  background: #fff;
  border-radius: 16px 16px 0 0;
  display: flex;
  flex-direction: column;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from { transform: translateX(-50%) translateY(100%); }
  to { transform: translateX(-50%) translateY(0); }
}

.inventory-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #e8e8e8;
}

.inventory-header h2 { font-size: 17px; font-weight: 600; }

.inventory-header button {
  background: none;
  border: none;
  font-size: 20px;
  color: #888;
  cursor: pointer;
  padding: 4px 8px;
}

.inventory-list {
  padding: 16px 20px;
  overflow-y: auto;
  flex: 1;
}

.clue-item {
  padding: 12px;
  border: 1px solid #e8e8e8;
  border-radius: 8px;
  margin-bottom: 10px;
  font-size: 13px;
  line-height: 1.6;
  color: #444;
}

.clue-item .clue-title {
  font-weight: 600;
  color: #1a1a1a;
  margin-bottom: 4px;
  font-size: 14px;
}

.empty-hint {
  text-align: center;
  color: #aaa;
  padding: 40px 0;
  font-size: 14px;
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.4);
}

.modal-content {
  position: relative;
  width: calc(100% - 32px);
  max-width: 448px;
  max-height: 80vh;
  background: #fff;
  border-radius: 12px;
  padding: 24px 20px;
  overflow-y: auto;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: none;
  border: none;
  font-size: 20px;
  color: #888;
  cursor: pointer;
  padding: 4px 8px;
}

/* Puzzle feedback */
.feedback {
  text-align: center;
  padding: 12px;
  border-radius: 8px;
  margin-top: 12px;
  font-size: 14px;
  font-weight: 500;
  animation: popIn 0.3s ease;
}

@keyframes popIn {
  0% { transform: scale(0.8); opacity: 0; }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); opacity: 1; }
}

.feedback.correct {
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
}

.feedback.wrong {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
}

.feedback.hint {
  background: #fffbeb;
  color: #b45309;
  border: 1px solid #fde68a;
}

/* Intro text */
.intro-text {
  font-size: 14px;
  line-height: 2;
  color: #333;
  white-space: pre-line;
  margin-bottom: 20px;
}

/* Section divider */
.divider {
  text-align: center;
  margin: 24px 0;
  color: #ccc;
  font-size: 13px;
}

.divider::before, .divider::after {
  content: '';
  display: inline-block;
  width: 40px;
  height: 1px;
  background: #e0e0e0;
  vertical-align: middle;
  margin: 0 12px;
}

/* Room badge */
.room-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
  margin-bottom: 8px;
}

/* Locked overlay */
.locked-overlay {
  text-align: center;
  padding: 60px 20px;
  color: #aaa;
}

.locked-overlay .lock-icon { font-size: 48px; margin-bottom: 16px; }
.locked-overlay p { font-size: 14px; }

/* Progress dots */
.progress-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 16px 0;
}

.progress-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #e0e0e0;
}

.progress-dot.active { background: #2563eb; }
.progress-dot.completed { background: #059669; }

/* Scrollbar */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d0d0d0; border-radius: 2px; }
