:root {
  --night-deep: #121b36;
  --gold-warm: #f6c467;
  --gold-soft: #ffe8b3;
  --card-border: rgba(247, 214, 152, 0.45);
  --cream: #fff7e8;
  --muted: rgba(255, 244, 224, 0.74);
  --serif: "Noto Serif SC", "Songti SC", "STSong", "Cormorant Garamond", Georgia, serif;
  --sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
}

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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--night-deep);
  color: var(--cream);
  font-family: var(--sans);
  user-select: none;
  -webkit-font-smoothing: antialiased;
}

#canvas-wrap {
  position: fixed;
  inset: 0;
  z-index: 1;
}

#canvas-wrap canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

/* 入场轻语提示：6 秒后自然渐隐，不占任何屏幕交互区 */
.easter-whisper {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  z-index: 10;
  pointer-events: none;
  padding: 7px 18px;
  border-radius: 999px;
  background: rgba(18, 25, 50, 0.72);
  border: 1px solid rgba(246, 196, 103, 0.28);
  color: rgba(255, 244, 220, 0.88);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  white-space: nowrap;
  max-width: 94vw;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: opacity 1.2s ease, transform 1.2s ease;
}

.easter-whisper strong {
  color: var(--gold-soft);
  font-weight: 600;
}

.easter-whisper.is-faded {
  opacity: 0;
  transform: translate(-50%, 8px);
}

/* 彩蛋触发时的顶部童话飘字（无背景按钮框，自然浮现消散） */
.egg-banner {
  position: fixed;
  left: 50%;
  top: 26px;
  transform: translate(-50%, -8px);
  z-index: 15;
  pointer-events: none;
  font-family: var(--serif);
  font-size: 1.02rem;
  letter-spacing: 0.1em;
  color: var(--gold-soft);
  text-shadow: 0 2px 12px rgba(248, 172, 58, 0.75), 0 1px 4px rgba(8, 12, 28, 0.9);
  opacity: 0;
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.egg-banner.is-shown {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* 自动播放解锁浮条 */
.autoplay-toast {
  position: fixed;
  left: 50%;
  bottom: 58px;
  transform: translateX(-50%);
  z-index: 25;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 10px 22px;
  border-radius: 999px;
  border: 1.5px solid rgba(255, 216, 138, 0.75);
  background: linear-gradient(135deg, rgba(168, 48, 44, 0.94), rgba(116, 32, 38, 0.94));
  color: var(--cream);
  font-size: 0.88rem;
  letter-spacing: 0.06em;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
  animation: toastFloat 2.4s ease-in-out infinite;
}

.autoplay-toast[hidden] {
  display: none !important;
}

@keyframes toastFloat {
  0%, 100% { transform: translate(-50%, 0); }
  50% { transform: translate(-50%, -5px); }
}

/* 拖拽上传遮罩 */
.drop-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(14, 21, 44, 0.82);
  display: flex;
  align-items: center;
  justify-content: center;
}

.drop-overlay[hidden] {
  display: none !important;
}

.drop-box {
  padding: 38px 52px;
  border-radius: 26px;
  border: 2px dashed var(--gold-warm);
  background: rgba(34, 44, 78, 0.92);
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.drop-icon {
  font-size: 2.6rem;
  color: var(--gold-soft);
}

.drop-title {
  margin-top: 10px;
  font-family: var(--serif);
  font-size: 1.35rem;
  color: var(--cream);
}

.drop-sub {
  margin-top: 6px;
  font-size: 0.85rem;
  color: var(--muted);
}

/* 歌词编辑弹窗 */
.lrc-modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(10, 14, 30, 0.78);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.lrc-modal[hidden] {
  display: none !important;
}

.lrc-dialog {
  width: min(520px, 100%);
  padding: 22px;
  border-radius: 20px;
  background: #1e2749;
  border: 1.5px solid var(--card-border);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6);
  user-select: text;
}

.lrc-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.lrc-dialog-head h3 {
  font-family: var(--serif);
  font-size: 1.1rem;
  color: var(--gold-soft);
}

.lrc-dialog-head button {
  border: none;
  background: none;
  color: var(--muted);
  font-size: 1.1rem;
  cursor: pointer;
}

.lrc-hint {
  font-size: 0.78rem;
  line-height: 1.55;
  color: var(--muted);
  margin-bottom: 12px;
}

.lrc-hint code {
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--gold-soft);
}

#lrc-textarea {
  width: 100%;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 232, 185, 0.28);
  background: rgba(12, 17, 35, 0.78);
  color: var(--cream);
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 0.82rem;
  line-height: 1.55;
  resize: vertical;
  outline: none;
}

#lrc-textarea:focus {
  border-color: var(--gold-warm);
}

.lrc-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
  gap: 10px;
}

.lrc-actions-right {
  display: flex;
  gap: 8px;
}

.lrc-file-btn,
.btn-ghost,
.btn-apply {
  padding: 8px 15px;
  border-radius: 999px;
  font-size: 0.8rem;
  cursor: pointer;
  border: 1px solid rgba(255, 232, 185, 0.32);
}

.lrc-file-btn,
.btn-ghost {
  background: rgba(255, 255, 255, 0.08);
  color: var(--cream);
}

.btn-apply {
  background: linear-gradient(135deg, #ffe29d, #eba844);
  border-color: transparent;
  color: #241608;
  font-weight: 600;
}

/* 返回转场幕布 */
.exit-curtain {
  position: fixed;
  inset: 0;
  z-index: 55;
  background: #0f0e0d;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.55s ease;
}

.exit-curtain.is-active {
  opacity: 1;
}

/* 加载幕布 */
.loading-screen {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: radial-gradient(circle at 50% 42%, #223362 0%, #111933 75%);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.65s ease, visibility 0.65s ease;
}

.loading-screen.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loading-inner {
  text-align: center;
}

.loading-star {
  font-size: 2.6rem;
  color: var(--gold-warm);
  animation: starPulse 1.6s ease-in-out infinite;
}

@keyframes starPulse {
  0%, 100% { transform: scale(1) rotate(0deg); opacity: 0.85; }
  50% { transform: scale(1.22) rotate(18deg); opacity: 1; }
}

.loading-title {
  margin-top: 12px;
  font-family: var(--serif);
  font-size: 1.2rem;
  letter-spacing: 0.1em;
  color: var(--cream);
}

.loading-sub {
  margin-top: 6px;
  font-size: 0.8rem;
  color: var(--muted);
}
