* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  background: #0e0e14; color: #e8e4dc;
  font-family: "Noto Serif SC", "Source Han Serif SC", serif;
  display: flex; justify-content: center; min-height: 100vh; padding: 20px;
}
#game {
  width: 100%; max-width: 760px; background: #16161f;
  border: 1px solid #2e2e3e; border-radius: 12px;
  display: flex; flex-direction: column; min-height: 90vh;
  box-shadow: 0 0 40px rgba(0,0,0,0.6);
}
header {
  padding: 14px 24px; border-bottom: 1px solid #2e2e3e;
  display: flex; justify-content: space-between; align-items: center;
}
#date-display { font-size: 18px; letter-spacing: 2px; color: #d8c9a3; }
#pt-display { font-size: 11px; color: #6a6458; margin-top: 2px; }
#moon-display { font-size: 16px; color: #a8b8d8; }
#affection-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  padding: 12px 24px;
  border-bottom: 1px solid #2e2e3e;
  background: #12121a;
}
.aff-item { min-width: 0; font-size: 12px; }

/* 中屏：2 × 2 */
@media (max-width: 639px) {
  #affection-bar { grid-template-columns: repeat(2, 1fr); }
}

/* 窄屏：一列 */
@media (max-width: 379px) {
  #affection-bar { grid-template-columns: 1fr; }
}
.aff-label { display: flex; justify-content: space-between; margin-bottom: 4px; color: #b8b0a0; }
.aff-track { height: 6px; background: #262632; border-radius: 3px; overflow: hidden; }
.aff-fill { height: 100%; border-radius: 3px; transition: width 0.4s; }
.aff-yuan .aff-fill { background: linear-gradient(90deg,#c88,#e8a0a0); }
.aff-aa .aff-fill { background: linear-gradient(90deg,#c8a06a,#e8c88a); }
.aff-yang .aff-fill { background: linear-gradient(90deg,#9a8ac8,#b8a8e8); }
.aff-bin .aff-fill { background: linear-gradient(90deg,#6ac8b8,#8ae8d8); }
#text {
  flex: 1; padding: 28px 32px; font-size: 16px; line-height: 1.9;
  white-space: pre-wrap; overflow-y: auto; color: #ddd8cc;
}
#choices {
  padding: 20px 32px 28px; display: flex; flex-direction: column;
  gap: 10px; border-top: 1px solid #2e2e3e;
}
.choice-btn {
  background: #1e1e2a; border: 1px solid #3a3a4e; color: #e0dccc;
  padding: 14px 20px; border-radius: 8px; font-size: 15px;
  font-family: inherit; cursor: pointer; text-align: left;
  transition: all 0.2s;
}
.choice-btn:hover {
  background: #2a2a3a; border-color: #6a5a8a; transform: translateX(4px);
}
.choice-btn.lock { border-color: #c88; color: #f0c8c8; }
#status-hint { padding: 8px 32px 16px; font-size: 12px; color: #7a7468; text-align: right; }

/* ===== 菜单按钮 ===== */
#menu-btn {
  background: #1e1e2a; border: 1px solid #3a3a4e; color: #d8c9a3;
  width: 34px; height: 34px; border-radius: 8px; font-size: 18px;
  cursor: pointer; font-family: inherit; transition: all 0.2s;
}
#menu-btn:hover { background: #2a2a3a; border-color: #6a5a8a; }

/* ===== 覆盖层 ===== */
#overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.7);
  display: flex; align-items: center; justify-content: center;
  z-index: 100; padding: 20px;
}
#overlay.hidden { display: none; }
.overlay-box {
  background: #16161f; border: 1px solid #3a3a4e; border-radius: 12px;
  width: 100%; max-width: 640px; max-height: 85vh;
  display: flex; flex-direction: column;
  box-shadow: 0 0 60px rgba(0,0,0,0.8);
}
.overlay-header {
  padding: 16px 20px; border-bottom: 1px solid #2e2e3e;
  display: flex; justify-content: space-between; align-items: center;
  font-size: 17px; color: #d8c9a3;
}
#overlay-close {
  background: none; border: none; color: #b8b0a0;
  font-size: 24px; cursor: pointer; line-height: 1;
}
#overlay-close:hover { color: #e8a0a0; }
#overlay-body {
  padding: 20px; overflow-y: auto; flex: 1;
  font-size: 14px; line-height: 1.8; color: #ddd8cc;
}

/* ===== 菜单项 ===== */
.menu-section { margin-bottom: 20px; }
.menu-section-title {
  font-size: 12px; color: #7a7468; letter-spacing: 2px;
  margin-bottom: 8px; padding-bottom: 4px;
  border-bottom: 1px solid #262632;
}
.menu-item {
  display: block; width: 100%; text-align: left;
  background: #1e1e2a; border: 1px solid #3a3a4e; color: #e0dccc;
  padding: 10px 14px; border-radius: 6px; font-size: 14px;
  font-family: inherit; cursor: pointer; margin-bottom: 6px;
  transition: all 0.15s;
}
.menu-item:hover { background: #2a2a3a; border-color: #6a5a8a; }
.menu-item:disabled, .menu-item.disabled {
  opacity: 0.4; cursor: not-allowed;
}
.menu-item.danger { border-color: #5a3a3a; color: #e0a0a0; }
.menu-item.danger:hover { border-color: #8a4a4a; background: #2a1e1e; }

.slot-info {
  font-size: 12px; color: #8a8478; margin-top: 4px;
}
.slot-empty { color: #5a5448; font-style: italic; }