/* ===== 冷光·个人数字空间 - 全局样式 ===== */
:root {
  --primary: #4a9eff;
  --accent: #8b5cf6;
  --cyan: #06b6d4;
  --silver: #94a3b8;
  --bg: #0a0e1a;
  --bg-secondary: #111827;
  --card-bg: rgba(15, 23, 42, 0.75);
  --text: #e2e8f0;
  --text-muted: #94a3b8;
  --border: rgba(74, 158, 255, 0.15);
  --glass-blur: 12px;
  --radius: 16px;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --font-base: 16px;
  --player-height: 70px;
  --sidebar-width: 250px;
}

/* 夜间/日间模式 */
[data-theme="light"] {
  --bg: #f0f4f8;
  --bg-secondary: #e2e8f0;
  --card-bg: rgba(255, 255, 255, 0.75);
  --text: #1e293b;
  --text-muted: #64748b;
  --border: rgba(74, 158, 255, 0.2);
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html {
  font-size: var(--font-base);
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
}

/* ===== 粒子背景 ===== */
#particle-canvas {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 0;
  pointer-events: none;
}

.bg-image {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  z-index: 0;
}

/* ===== 导航栏 ===== */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  background: rgba(10, 14, 26, 0.8);
  backdrop-filter: blur(var(--glass-blur));
  border-bottom: 1px solid var(--border);
  z-index: 1000;
}

.navbar .logo {
  font-size: 1.25rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.navbar .nav-links {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.navbar .nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  transition: var(--transition);
}

.navbar .nav-links a:hover { color: var(--primary); }

.theme-toggle {
  width: 36px; height: 36px;
  border: none;
  border-radius: 50%;
  background: rgba(74, 158, 255, 0.1);
  color: var(--primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.theme-toggle:hover { background: rgba(74, 158, 255, 0.2); transform: rotate(15deg); }

/* ===== 主内容区 ===== */
.main-content {
  position: relative;
  z-index: 1;
  padding: 80px 2rem calc(var(--player-height) + 2rem);
  max-width: 1400px;
  margin: 0 auto;
  transition: var(--transition);
}

.main-content.sidebar-open {
  margin-right: var(--sidebar-width);
}

/* ===== 卡片网格 ===== */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
  padding: 1rem 0;
}

/* 常驻卡片（排行榜）加宽 */
.card.always-card { grid-column: span 2; min-height: 340px; }
/* 后台可调宽度（w=2/3）*/
.card.card-w2 { grid-column: span 2; }
.card.card-w3 { grid-column: span 3; }

/* ===== 毛玻璃卡片 ===== */
.card {
  background: var(--card-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  min-height: 280px;
  display: flex;
  flex-direction: column;
}

.card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent), var(--cyan));
  opacity: 0;
  transition: var(--transition);
}

.card:hover {
  transform: translateY(-4px);
  border-color: rgba(74, 158, 255, 0.3);
  box-shadow: 0 12px 40px rgba(74, 158, 255, 0.15);
}

.card:hover::before { opacity: 1; }

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.card-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card-title i { color: var(--primary); }

.card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ===== 按钮 ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.6rem 1.2rem;
  border: none;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  min-height: 44px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
}

.btn-primary:hover { opacity: 0.9; transform: translateY(-1px); box-shadow: 0 4px 15px rgba(74, 158, 255, 0.4); }

.btn-secondary {
  background: rgba(74, 158, 255, 0.1);
  color: var(--primary);
  border: 1px solid var(--border);
}

.btn-secondary:hover { background: rgba(74, 158, 255, 0.2); }

.btn-danger { background: rgba(239, 68, 68, 0.15); color: #ef4444; }
.btn-danger:hover { background: rgba(239, 68, 68, 0.25); }

.btn-sm { padding: 0.4rem 0.8rem; font-size: 0.8rem; min-height: 36px; }

/* ===== 输入框 ===== */
.input {
  width: 100%;
  padding: 0.7rem 1rem;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.9rem;
  transition: var(--transition);
  min-height: 44px;
}

.input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(74, 158, 255, 0.1);
}

.input::placeholder { color: var(--text-muted); }

textarea.input { resize: vertical; min-height: 80px; }

/* ===== 音乐播放器 ===== */
.music-player {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: var(--player-height);
  background: rgba(10, 14, 26, 0.9);
  backdrop-filter: blur(var(--glass-blur));
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  gap: 1rem;
  z-index: 1000;
  transition: var(--transition);
}

.music-player.hidden { transform: translateY(100%); }

/* 播放器最小化：收缩为右下角悬浮胶囊 */
.music-player.minimized {
  left: auto; right: 1rem; bottom: 1rem;
  width: auto; height: auto;
  border-radius: 999px;
  border: 1px solid var(--border);
  padding: 0.4rem 0.6rem;
  gap: 0.6rem;
  box-shadow: 0 10px 32px rgba(0,0,0,0.5);
}
.music-player.minimized .player-cover { width: 36px; height: 36px; border-radius: 50%; }
.music-player.minimized .player-info { display: block; max-width: 130px; }
.music-player.minimized .player-info .song-name { font-size: 0.75rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.music-player.minimized .player-info .artist { display: none; }
.music-player.minimized .player-controls #btn-prev,
.music-player.minimized .player-controls #btn-next { display: none; }
.music-player.minimized .player-progress,
.music-player.minimized .player-volume,
.music-player.minimized .player-mode { display: none; }
.player-minimize { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 0.9rem; padding: 0.3rem; transition: var(--transition); border-radius: 50%; }
.player-minimize:hover { color: var(--primary); background: rgba(74,158,255,0.12); }

.player-cover {
  width: 48px; height: 48px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--bg-secondary);
}

.player-info {
  flex: 0 0 150px;
  overflow: hidden;
}

.player-info .song-name {
  font-size: 0.9rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-info .artist {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.player-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.player-controls button {
  width: 36px; height: 36px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  font-size: 1rem;
}

.player-controls button:hover { color: var(--primary); background: rgba(74, 158, 255, 0.1); }
.player-controls .btn-play { width: 44px; height: 44px; background: var(--primary); color: #fff; font-size: 1.1rem; }
.player-controls .btn-play:hover { transform: scale(1.05); }

.player-progress {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.progress-bar {
  flex: 1;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  cursor: pointer;
  position: relative;
}

.progress-bar .progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 2px;
  width: 0%;
  transition: width 0.1s linear;
}

.progress-time { font-size: 0.75rem; color: var(--text-muted); min-width: 40px; }

.player-volume {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.volume-slider {
  width: 80px;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  cursor: pointer;
}

.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--primary);
}

.player-mode { font-size: 0.85rem; }

/* ===== 歌词侧边栏 ===== */
.lyrics-sidebar {
  position: fixed;
  top: 60px;
  right: 0;
  bottom: var(--player-height);
  width: var(--sidebar-width);
  background: rgba(10, 22, 40, 0.85);
  backdrop-filter: blur(var(--glass-blur));
  border-left: 1px solid var(--border);
  z-index: 999;
  padding: 1.5rem 1rem;
  overflow-y: auto;
  transition: var(--transition);
}

.lyrics-sidebar.hidden { transform: translateX(100%); }
.lyrics-sidebar.hero-hidden { transform: translateX(100%); }

.lyrics-sidebar .lyrics-title {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  text-align: center;
}

/* 歌词面板标题栏 + 收起按钮（桌面隐藏按钮，手机显示） */
.lyrics-head { display: flex; align-items: center; justify-content: center; position: relative; }
.lyrics-head .lyrics-title { margin-bottom: 0; }
.lyrics-close {
  display: none;
  position: absolute; right: 0; top: 50%; transform: translateY(-50%);
  width: 28px; height: 28px; border-radius: 50%;
  background: rgba(74,158,255,0.1); border: 1px solid var(--border);
  color: var(--text-muted); cursor: pointer;
  align-items: center; justify-content: center; font-size: 0.75rem;
  transition: var(--transition);
}
.lyrics-close:hover { color: var(--primary); background: rgba(74,158,255,0.22); }

.lyrics-sidebar .lyric-line {
  padding: 0.4rem 0;
  font-size: 0.9rem;
  color: #c0d0e0;
  text-align: center;
  transition: var(--transition);
  cursor: default;
}

.lyrics-sidebar .lyric-line.active {
  color: var(--primary);
  font-weight: 600;
  transform: scale(1.05);
}

/* 手机端歌词浮动按钮 */
.lyrics-fab {
  display: none;
  position: fixed;
  bottom: calc(var(--player-height) + 1rem);
  right: 1rem;
  width: 48px; height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  border: none;
  cursor: grab;
  z-index: 1001;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  box-shadow: 0 4px 15px rgba(74, 158, 255, 0.4);
  touch-action: none;
}

/* 可拖动浮动元素（歌词按钮、最小化播放器胶囊） */
.music-player.minimized { touch-action: none; cursor: grab; }
/* 拖动中：关闭一切过渡动画（否则 left/top 变化会被 transition 拖慢，手感发飘），松手恢复 */
.dragging { cursor: grabbing !important; opacity: 0.9; transition: none !important; will-change: left, top; box-shadow: 0 14px 40px rgba(0,0,0,0.55) !important; }

/* ===== 页脚 ===== */
.footer {
  text-align: center;
  padding: 2rem;
  color: var(--text-muted);
  font-size: 0.8rem;
  position: relative;
  z-index: 1;
}

/* ===== 模态框 ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

.modal-overlay.active { opacity: 1; visibility: visible; }

.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  width: 90%;
  max-width: 420px;
  transform: scale(0.9);
  transition: var(--transition);
}

.modal-overlay.active .modal { transform: scale(1); }

.modal h3 { margin-bottom: 1rem; color: var(--text); }

/* ===== 滚动条 ===== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(74, 158, 255, 0.3); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(74, 158, 255, 0.5); }

/* ===== 动画 ===== */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.animate-in { animation: fadeInUp 0.5s ease forwards; }

/* ===== 响应式 ===== */
@media (max-width: 1199px) {
  :root { --font-base: 15px; --sidebar-width: 200px; }
  .cards-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.card.always-card { grid-column: span 2; }
}

@media (max-width: 991px) {
  :root { --player-height: 60px; }
  .main-content { padding: 70px 1rem calc(var(--player-height) + 1rem); }
  .cards-grid { grid-template-columns: repeat(2, 1fr); gap: 1rem; }
  .player-info { flex: 0 0 100px; }
  .player-volume { display: none; }
  .lyrics-sidebar { width: 200px; }
}

@media (max-width: 767px) {
  :root { --font-base: 14px; --player-height: 56px; }
  .navbar { padding: 0 1rem; height: 52px; }
  .navbar .nav-links { gap: 0.75rem; }
  .navbar .nav-links a span { display: none; }
  .main-content { padding: 62px 0.75rem calc(var(--player-height) + 0.75rem); }
  .main-content.sidebar-open { margin-right: 0; }
  .cards-grid { grid-template-columns: 1fr; gap: 0.75rem; }
  .card { min-height: auto; padding: 1rem; }
  .card.always-card { grid-column: span 1; }
  .card.card-w2, .card.card-w3 { grid-column: span 1; }

  /* 播放器手机端 */
  .music-player { padding: 0 0.75rem; gap: 0.5rem; }
  .player-cover { width: 36px; height: 36px; }
  .player-info { flex: 1; }
  .player-progress { display: none; }
  .player-volume { display: none; }
  .music-player.expanded { height: auto; flex-wrap: wrap; padding: 1rem; }
  .music-player.expanded .player-progress { display: flex; width: 100%; order: 10; margin-top: 0.5rem; }

  /* 歌词侧边栏变为抽屉 */
    /* 歌词面板手机端改为顶部停靠：只占约 1/6 屏高（原 1/3 削半），不遮挡下方游戏区 */
  .lyrics-sidebar, .lyrics-sidebar.hero-hidden {
    top: 0; left: 0; right: 0; bottom: auto;
    width: 100% !important; max-width: none;
    height: min(17vh, 165px);
    transform: translateY(-105%);
    border-left: none;
    border-bottom: 1px solid var(--border);
    border-radius: 0 0 16px 16px;
    padding: 0.4rem 1rem 0.5rem;
    z-index: 2001;
  }
  .lyrics-sidebar .lyrics-head { margin-bottom: 0.15rem; }
  .lyrics-sidebar .lyric-line { padding: 0.2rem 0; font-size: 0.78rem; }
  .lyrics-sidebar .lyric-line.active { transform: scale(1.03); }
  .lyrics-sidebar.mobile-open, .lyrics-sidebar.hero-hidden.mobile-open { transform: translateY(0); }
  .lyrics-close { display: flex; }
  .lyrics-fab { display: flex; }

  .btn { min-height: 44px; }
  .input { min-height: 44px; }
}

/* ===== 游戏通用 ===== */
.game-canvas {
  width: 100%;
  max-width: 100%;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.3);
  touch-action: none;
}

.game-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.game-score {
  font-size: 0.85rem;
  color: var(--primary);
  font-weight: 600;
}

/* ===== 加载动画 ===== */
.loading-spinner {
  width: 40px; height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 2rem auto;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ===== 提示消息 ===== */
.toast {
  position: fixed;
  top: 80px;
  right: 1rem;
  padding: 0.8rem 1.5rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.9rem;
  z-index: 3000;
  transform: translateX(120%);
  transition: var(--transition);
  box-shadow: var(--shadow);
}

.toast.show { transform: translateX(0); }
.toast.success { border-color: #10b981; }
.toast.error { border-color: #ef4444; }

/* ===== 首屏 Hero ===== */
.hero-screen {
  position: relative;
  width: 100%;
  height: 100vh;
  height: 100svh; /* 手机浏览器可见视口高（去掉地址栏/工具栏），与后台手机舞台 9/19.5 一致，保证编辑后前台位置一致 */
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  z-index: 1;
}

.carousel-bg {
  position: absolute;
  inset: -4%;
  z-index: 0;
  will-change: transform;
}

.carousel-slide {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 1.5s ease;
}

.carousel-slide.active { opacity: 1; animation: kenburns 26s ease-in-out infinite alternate; }
@keyframes kenburns {
  from { transform: scale(1.02) translate(0, 0); }
  to { transform: scale(1.14) translate(1.6%, -1.4%); }
}

.carousel-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(10,14,26,0.4) 0%, rgba(10,14,26,0.7) 100%);
}

.hero-content {
  position: relative;
  z-index: 2;
  padding: 2rem;
  height: 100%;
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.hero-clock {
  font-family: 'Inter', monospace;
  font-weight: 700;
  letter-spacing: 2px;
  text-shadow: 0 0 30px rgba(74,158,255,0.3);
  margin-bottom: 0.5rem;
}

.hero-date {
  font-size: 1.1rem;
  color: rgba(226,232,240,0.7);
  margin-bottom: 0.75rem;
}

.hero-weather {
  font-size: 0.95rem;
  color: rgba(226,232,240,0.6);
  margin-bottom: 1.5rem;
  min-height: 1.5em;
}

.hero-slogan {
  font-weight: 300;
  letter-spacing: 1px;
  text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.scroll-hint {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: rgba(226,232,240,0.6);
  font-size: 0.8rem;
  cursor: pointer;
  animation: bounceDown 2s infinite;
}

.scroll-hint i { font-size: 1.2rem; }

@keyframes bounceDown {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(8px); }
}

/* 导航栏初始隐藏，滚动后显示 */
.navbar {
  transform: translateY(-100%);
  transition: transform 0.3s ease;
}
.navbar.visible { transform: translateY(0); }

/* 功能区标题 */
.section-heading {
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text);
}
.section-heading i { color: var(--primary); }

/* ===== 游戏封面/启动界面 ===== */
.game-cover {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 180px;
  gap: 1rem;
  text-align: center;
}

.game-cover-icon {
  font-size: 2.5rem;
  color: var(--primary);
  opacity: 0.7;
}

.game-cover-title {
  font-size: 1rem;
  color: var(--text-muted);
}
.game-score-rule {
  font-size: 0.68rem;
  color: var(--text-muted);
  background: rgba(74,158,255,0.08);
  border: 1px solid rgba(74,158,255,0.15);
  border-radius: 20px;
  padding: 0.2rem 0.7rem;
  line-height: 1.5;
  max-width: 90%;
}
.game-score-rule i { font-size: 0.55rem; color: var(--accent); margin-right: 0.25rem; }

.game-start-btn {
  padding: 0.6rem 1.5rem;
}

/* 游戏运行中隐藏封面 */
.card-body.game-active .game-cover { display: none; }
.card-body .game-container { display: none; }
.card-body.game-active .game-container { display: block; }

/* ===== 排行榜 ===== */
.leaderboard-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.leaderboard-tabs button {
  padding: 0.3rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.8rem;
  transition: all 0.2s;
}
.leaderboard-tabs button.active {
  background: rgba(74,158,255,0.15);
  color: var(--primary);
  border-color: var(--primary);
}
.leaderboard-list {
  font-size: 0.85rem;
}
.leaderboard-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
}
.leaderboard-rank {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  background: rgba(74,158,255,0.1);
  color: var(--primary);
}
.leaderboard-rank.top1 { background: rgba(245,158,11,0.2); color: #f59e0b; }
.leaderboard-rank.top2 { background: rgba(148,163,184,0.2); color: #94a3b8; }
.leaderboard-rank.top3 { background: rgba(180,83,9,0.2); color: #d97706; }

/* ===== 响应式补充 ===== */
@media (max-width: 767px) {
  .hero-clock { font-size: 3rem !important; }
  .hero-slogan { font-size: 0.95rem !important; }
  .game-cover { min-height: 140px; }
  .game-cover-icon { font-size: 2rem; }
}
/* 系统开启“减弱动态效果”时关闭背景缩放动画 */
@media (prefers-reduced-motion: reduce) {
  .carousel-slide.active { animation: none; }
  .hero-screen.shaken .hero-el { animation: none; }
}
/* 后台关闭“背景呼吸缩放”开关 */
.fx-kenburns-off .carousel-slide.active { animation: none; }

/* ===== 留言板分区 ===== */
.message-section {
  position: relative;
  z-index: 1;
  padding: 4rem 2rem calc(var(--player-height) + 3rem);
}
.message-inner { max-width: 800px; margin: 0 auto; }
.msg-compose { min-height: auto; margin-bottom: 1.5rem; }
.msg-item {
  background: var(--card-bg);
  backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 0.75rem;
  transition: var(--transition);
}
.msg-item:hover { border-color: rgba(74,158,255,0.3); transform: translateY(-2px); }
.msg-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.5rem; }
.msg-nickname { font-weight: 600; color: var(--primary); font-size: 0.9rem; }
.msg-time { font-size: 0.75rem; color: var(--text-muted); }
.msg-content { font-size: 0.9rem; line-height: 1.6; color: var(--text); word-break: break-word; }
.msg-actions { display: flex; gap: 0.5rem; margin-top: 0.5rem; }
.msg-actions button {
  font-size: 0.75rem; padding: 0.2rem 0.6rem; border: none; border-radius: 4px;
  cursor: pointer; background: rgba(239,68,68,0.1); color: #ef4444; transition: all 0.2s;
}
.msg-actions button:hover { background: rgba(239,68,68,0.2); }
@media (max-width: 767px) { .message-section { padding: 3rem 1rem calc(var(--player-height) + 2rem); } }

/* ===== 游戏暂停/结束控制 ===== */
.game-ctrl { display: flex; gap: 0.5rem; margin-top: 0.5rem; justify-content: center; flex-wrap: wrap; }
.game-score-info { font-size: 0.7rem; color: var(--text-muted); text-align: center; margin-top: 0.4rem; }

/* ===== 3D立体照片/卡片质感 ===== */
.photo-3d {
  --photo-depth: 8px;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.12);
  transform: translateY(calc(var(--photo-depth) / -1.5)) rotateX(2deg);
  box-shadow:
    0 var(--photo-depth) calc(var(--photo-depth) * 2) rgba(0,0,0,0.55),
    0 calc(var(--photo-depth) / 2) var(--photo-depth) rgba(0,0,0,0.4),
    0 calc(var(--photo-depth) * 2.5) calc(var(--photo-depth) * 4) rgba(74,158,255,0.12),
    inset 0 1px 0 rgba(255,255,255,0.15);
  transition: transform 0.35s ease, box-shadow 0.35s ease;
}
.photo-3d::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(145deg, rgba(255,255,255,0.12) 0%, transparent 45%);
  pointer-events: none;
}
.photo-3d img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-3d:hover {
  transform: translateY(calc(var(--photo-depth) / -1)) rotateX(0deg) scale(1.02);
  box-shadow:
    0 calc(var(--photo-depth) * 1.6) calc(var(--photo-depth) * 3) rgba(0,0,0,0.65),
    0 var(--photo-depth) calc(var(--photo-depth) * 1.8) rgba(0,0,0,0.5),
    0 calc(var(--photo-depth) * 3.2) calc(var(--photo-depth) * 5) rgba(74,158,255,0.18),
    inset 0 1px 0 rgba(255,255,255,0.2);
}
/* 照片卡片布局 */
.photo-3d-wrap { display:flex;align-items:center;justify-content:center;min-height:220px;perspective:900px;padding:1rem 0; }
.card.photo-card .card-body { display:flex;align-items:center;justify-content:center; }
.card.photo-card .photo-3d { width:min(240px, 85%);aspect-ratio:3/3.6; }
/* 卡片颜色强调条（后台可调颜色）*/
.card.game-card { position:relative; }
.card.game-card[style*="--card-accent"] .card-header { border-bottom:2px solid var(--card-accent); }
.card.game-card[style*="--card-accent"] .card-title i { color: var(--card-accent); }
/* 自定义代码模块 */
.custom-block-content { width:100%;min-height:120px;overflow:auto; }
.card.custom-card .card-body { display:block; }

/* ===== 首屏自定义元素（后台可视化编辑） ===== */
.hero-content.hero-custom { display:block; padding:0; transform-origin:center center; }
.hero-el { position:absolute; transform:translate(-50%,-50%) translate3d(var(--px,0px),var(--py,0px),0); z-index:2; text-align:center; max-width:92vw; will-change:transform; transition:opacity 0.4s; }
.hero-el.hero-clock { font-family:'Inter',monospace; font-weight:700; letter-spacing:2px; text-shadow:0 0 30px rgba(74,158,255,0.3); white-space:nowrap; }
.hero-el.hero-date { color:rgba(226,232,240,0.7); white-space:nowrap; }
.hero-el.hero-weather { color:rgba(226,232,240,0.6); white-space:nowrap; min-height:1.5em; }
.hero-el.hero-slogan { font-weight:300; letter-spacing:1px; text-shadow:0 2px 10px rgba(0,0,0,0.3); }
.hero-el.hero-text { font-weight:400; letter-spacing:0.5px; text-shadow:0 2px 10px rgba(0,0,0,0.35); line-height:1.6; }
.hero-el.hero-img { border-radius:12px; box-shadow:0 12px 40px rgba(0,0,0,0.45), 0 0 0 1px rgba(255,255,255,0.08); height:auto; }

/* 摇晃回应：用力摇手机时首屏元素集体摆动（保留视差变量，不干扰定位） */
.hero-screen.shaken .hero-el { animation: heroShake 0.75s cubic-bezier(.36,.07,.19,.97) both; }
.hero-screen.shaken .hero-el.hero-img { animation-duration: 0.95s; }
.hero-screen.shaken .hero-el.hero-clock { animation-duration: 0.6s; }
@keyframes heroShake {
  0%, 100% { transform: translate(-50%,-50%) translate3d(var(--px,0px),var(--py,0px),0) rotate(0deg) scale(1); }
  15% { transform: translate(-50%,-50%) translate3d(var(--px,0px),var(--py,0px),0) rotate(-2.4deg) scale(1.04); }
  35% { transform: translate(-50%,-50%) translate3d(var(--px,0px),var(--py,0px),0) rotate(2deg) scale(0.97); }
  55% { transform: translate(-50%,-50%) translate3d(var(--px,0px),var(--py,0px),0) rotate(-1.3deg) scale(1.02); }
  75% { transform: translate(-50%,-50%) translate3d(var(--px,0px),var(--py,0px),0) rotate(0.7deg) scale(1); }
}

/* ===== 窄屏首屏：图文关系固定，自动整理为竖向流式布局 =====
   手机端不再用桌面的绝对坐标（避免重叠/截断），
   按「时间→日期→天气→图片→标语→文字」竖向居中排布，字号随视口伸缩；
   若后台已单独配置「手机版首屏」（.hero-mobile-design）则保持其自由构图，不走自动整理 */
@media (max-width: 859px) {
  .hero-content.hero-custom:not(.hero-mobile-design) {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: clamp(0.7rem, 2.4vh, 1.4rem);
    padding: 4rem 1.2rem 3.4rem;
    box-sizing: border-box;
    overflow-y: auto;
  }
  .hero-content.hero-custom:not(.hero-mobile-design) .hero-el {
    position: static;
    transform: translate3d(var(--px, 0px), var(--py, 0px), 0);
    max-width: 88vw;
  }
  .hero-content.hero-custom:not(.hero-mobile-design) .hero-el.hero-clock   { order: 1; font-size: clamp(2.4rem, 11vw, 3.6rem) !important; }
  .hero-content.hero-custom:not(.hero-mobile-design) .hero-el.hero-date    { order: 2; font-size: clamp(0.85rem, 3.6vw, 1.05rem) !important; }
  .hero-content.hero-custom:not(.hero-mobile-design) .hero-el.hero-weather { order: 3; font-size: clamp(0.8rem, 3.2vw, 1rem) !important; white-space: normal; }
  .hero-content.hero-custom:not(.hero-mobile-design) .hero-el.hero-img     { order: 4; width: min(300px, 68vw) !important; }
  .hero-content.hero-custom:not(.hero-mobile-design) .hero-el.hero-slogan  { order: 5; font-size: clamp(1rem, 4.4vw, 1.3rem) !important; line-height: 1.7; }
  .hero-content.hero-custom:not(.hero-mobile-design) .hero-el.hero-text    { order: 6; font-size: clamp(0.95rem, 4vw, 1.2rem) !important; line-height: 1.7; }
  /* 已配置手机版布局：维持绝对定位自由构图，仅限制元素不超出屏幕 */
  .hero-content.hero-mobile-design .hero-el { max-width: 92vw; }
}

/* ===== 弹幕区 ===== */
.danmaku-zone {
  position: relative;
  height: 170px;
  margin: 0 auto 1.5rem;
  border: 1px solid rgba(74,158,255,0.18);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(15,23,42,0.55) 0%, rgba(15,23,42,0.2) 100%);
  overflow: hidden;
}
.danmaku-zone::before, .danmaku-zone::after {
  content:''; position:absolute; top:0; bottom:0; width:48px; z-index:2; pointer-events:none;
}
.danmaku-zone::before { left:0; background:linear-gradient(90deg, rgba(10,14,26,0.75), transparent); }
.danmaku-zone::after { right:0; background:linear-gradient(-90deg, rgba(10,14,26,0.75), transparent); }
.danmaku-stage { position:absolute; inset:0; }
.danmaku-label {
  position:absolute; left:12px; bottom:8px; z-index:3;
  font-size:0.68rem; letter-spacing:1px; color:rgba(148,163,184,0.75);
  display:flex; align-items:center; gap:5px;
}
.danmaku-label i { color:var(--primary); animation:dmPulse 2s ease-in-out infinite; }
@keyframes dmPulse { 0%,100%{opacity:0.5} 50%{opacity:1} }
.danmaku-item {
  position:absolute; left:100%; white-space:nowrap;
  font-size:0.88rem; padding:3px 14px; border-radius:20px;
  background:rgba(15,23,42,0.35); color:#dbeafe;
  text-shadow:0 1px 3px rgba(0,0,0,0.6);
  animation:dmFly var(--dm-dur,12s) linear forwards;
  will-change:transform;
}
.danmaku-item .dm-nick { color:#7dd3fc; font-weight:600; margin-right:4px; }
.danmaku-item.mine {
  background:linear-gradient(135deg, rgba(74,158,255,0.4), rgba(139,92,246,0.4));
  border:1px solid rgba(74,158,255,0.55); color:#fff;
  box-shadow:0 0 16px rgba(74,158,255,0.35);
}
@keyframes dmFly { to { transform:translateX(calc(-100vw - 100%)); } }

/* ===== 自定义页面分区 ===== */
.custom-page-section { position:relative; z-index:1; padding:3rem 2rem; max-width:1200px; margin:0 auto; }
/* 自由构图画布：元素位置/大小由后台可视化舞台按百分比布置，与舞台一一对应 */
.cp-canvas { position:relative; aspect-ratio:16/9; min-height:480px; margin-top:1.25rem; }
.cp-canvas.cp-canvas-m { aspect-ratio: 9 / 19.5; min-height: 600px; }
.cp-canvas .cp-el { position:absolute; transform:translate(-50%,-50%); }
.cp-el.cp-text { padding:0.4rem 0.25rem; line-height:1.8; word-break:break-word; }
.cp-el.cp-image { text-align:center; }
.cp-el.cp-image img { border-radius:12px; box-shadow:0 10px 30px rgba(0,0,0,0.4); max-width:100%; transition:transform 0.3s; }
.cp-el.cp-image img:hover { transform:translateY(-4px) scale(1.01); }
.cp-el.cp-html .card-body { padding:1rem; display:block; }

/* ===== 站点元素（图片链接：点击跳转，链接不外露） ===== */
.cp-site { display:block; line-height:0; }
.cp-site img {
  width:100%; aspect-ratio:1/1; object-fit:cover; display:block;
  box-shadow:0 10px 30px rgba(0,0,0,0.45), 0 0 0 1px rgba(255,255,255,0.08);
  transition:transform 0.25s ease, box-shadow 0.25s ease, filter 0.25s ease;
}
.cp-site.shape-circle img { border-radius:50%; }
.cp-site.shape-square img { border-radius:4px; }
.cp-site.shape-rounded img { border-radius:22%; }
.cp-site.shape-hexagon img { clip-path:polygon(25% 3%, 75% 3%, 98% 50%, 75% 97%, 25% 97%, 2% 50%); box-shadow:none; filter:drop-shadow(0 10px 24px rgba(0,0,0,0.45)); }
.cp-site:hover img { transform:translateY(-5px) scale(1.045); box-shadow:0 18px 44px rgba(74,158,255,0.35), 0 0 0 2px rgba(74,158,255,0.5); }
.cp-site:active img { transform:scale(0.95); }

/* ===== 音乐元素（页面专属音乐徽章：进入本页自动切歌，离开恢复主音乐） ===== */
.cp-el.cp-music { line-height:1; }
.cp-music-badge {
  display:flex; align-items:center; gap:0.7rem;
  padding:0.65rem 1rem;
  background:rgba(10,22,40,0.82);
  border:1px solid rgba(139,92,246,0.45);
  border-radius:999px;
  backdrop-filter:blur(var(--glass-blur));
  box-shadow:0 8px 26px rgba(0,0,0,0.4), 0 0 18px rgba(139,92,246,0.18);
  transition:var(--transition);
}
.cp-music-badge:hover { transform:translateY(-3px); border-color:rgba(139,92,246,0.75); box-shadow:0 12px 32px rgba(0,0,0,0.45), 0 0 26px rgba(139,92,246,0.32); }
.cp-music-badge > i {
  flex:none; width:34px; height:34px; border-radius:50%;
  display:flex; align-items:center; justify-content:center;
  background:linear-gradient(135deg, var(--primary), var(--accent));
  color:#fff; font-size:0.9rem;
  animation:cpMusicPulse 2.2s ease-in-out infinite;
}
.cp-music-info { min-width:0; }
.cp-music-name { font-size:0.85rem; font-weight:600; color:var(--text); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:180px; }
.cp-music-tip { font-size:0.66rem; color:var(--text-muted); margin-top:2px; letter-spacing:0.5px; }
@keyframes cpMusicPulse { 0%,100%{ transform:scale(1); box-shadow:0 0 0 0 rgba(139,92,246,0.45); } 50%{ transform:scale(1.08); box-shadow:0 0 0 7px rgba(139,92,246,0); } }

/* ===== 留言板嵌入元素（自定义页面内的留言板，与主留言板数据互通） ===== */
.cp-el.cp-message .msg-embed { height:100%; display:flex; flex-direction:column; gap:0.75rem; }
.msg-embed .msg-compose { margin:0; }
.msg-embed-list { flex:1; min-height:120px; overflow-y:auto; padding-right:4px; display:flex; flex-direction:column; gap:0.6rem; }
.msg-embed-list::-webkit-scrollbar { width:5px; }
.msg-embed-list::-webkit-scrollbar-thumb { background:rgba(74,158,255,0.3); border-radius:3px; }

/* ===== 相册（幻灯片轮播元素） ===== */
.cp-el.cp-album { justify-self:center; }
.cp-album {
  position: relative; aspect-ratio: 4 / 3;
  border-radius: 14px; overflow: hidden; cursor: pointer;
  background: #0d1526;
  box-shadow: 0 14px 40px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.08);
  transition: transform 0.3s, box-shadow 0.3s;
}
/* 悬停上浮：仅后台开启 fx_lift 时生效（默认关闭，防止鼠标经过乱动） */
.cp-album[data-fx-lift]:hover { transform: translateY(-4px); box-shadow: 0 20px 50px rgba(0,0,0,0.55), 0 0 0 1px rgba(74,158,255,0.25); }
/* 鼠标倾斜跟随：3D 透视倾斜（JS 驱动 rotateX/Y，此处提供过渡手感） */
.cp-album[data-fx-tilt] { will-change: transform; }
.cp-album .album-slide {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  opacity: 0;
  transition: opacity 1.2s ease;
}
/* 呼吸缩放：仅后台开启 fx_zoom 时生效（Ken Burns 缓慢推近） */
.cp-album[data-fx-zoom] .album-slide { transform: scale(1.08); transition: opacity 1.2s ease, transform 7s linear; }
.cp-album .album-slide.active { opacity: 1; }
.cp-album[data-fx-zoom] .album-slide.active { transform: scale(1); }
.cp-album .album-dots { position: absolute; left: 0; right: 0; bottom: 9px; display: flex; justify-content: center; gap: 6px; z-index: 2; }
.cp-album .album-dot {
  width: 7px; height: 7px; padding: 0; border: none; border-radius: 50%;
  background: rgba(255,255,255,0.4); cursor: pointer; transition: var(--transition);
}
.cp-album .album-dot.active { background: #fff; transform: scale(1.3); box-shadow: 0 0 6px rgba(255,255,255,0.7); }
/* 点按暂停时的角标 */
.cp-album.paused::after {
  content: '\f04c'; font-family: 'Font Awesome 6 Free'; font-weight: 900;
  position: absolute; top: 10px; right: 12px; z-index: 2;
  width: 26px; height: 26px; display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 0.72rem; background: rgba(0,0,0,0.55); border-radius: 50%;
}
@media (max-width: 767px) { .custom-page-section { padding:2rem 1rem; } .danmaku-zone { height:140px; } }
