/* ========================================
   鸡你太美 ASCII 播放器 - 样式系统
   ======================================== */

/* --- CSS 变量 / 设计令牌 --- */
:root {
  --bg: #0a0a0a;
  --bg-secondary: #111111;
  --text-primary: #00ff41;
  --text-glow: rgba(0, 255, 65, 0.6);
  --text-dim: #00aa2a;
  --accent: #00ff41;
  --accent-glow: 0 0 10px rgba(0, 255, 65, 0.5), 0 0 20px rgba(0, 255, 65, 0.2);
  --controls-bg: rgba(10, 10, 10, 0.95);
  --controls-border: rgba(0, 255, 65, 0.15);
  --progress-track: rgba(255, 255, 255, 0.08);
  --progress-fill: var(--accent);
  --font-mono: 'Fira Code', 'Consolas', 'Monaco', monospace;
  --font-ui: 'Noto Sans SC', 'Microsoft YaHei', sans-serif;
}

/* ========================================
   主题定义（纯 CSS，不影响 DOM 结构）
   ======================================== */

/* 🟢 经典绿屏 */
[data-theme="classic-green"] {
  --text-primary: #00ff41;
  --text-glow: rgba(0, 255, 65, 0.6);
  --text-dim: #00aa2a;
  --accent: #00ff41;
  --accent-glow: 0 0 10px rgba(0, 255, 65, 0.5), 0 0 20px rgba(0, 255, 65, 0.2);
  --controls-border: rgba(0, 255, 65, 0.15);
  --progress-fill: #00ff41;
}

/* 🟠 琥珀复古 */
[data-theme="amber"] {
  --text-primary: #ffb000;
  --text-glow: rgba(255, 176, 0, 0.6);
  --text-dim: #cc8800;
  --accent: #ffb000;
  --accent-glow: 0 0 10px rgba(255, 176, 0, 0.5), 0 0 20px rgba(255, 176, 0, 0.2);
  --controls-border: rgba(255, 176, 0, 0.15);
  --progress-fill: #ffb000;
}

/* 🔵 冰蓝科技 */
[data-theme="ice-blue"] {
  --text-primary: #00d4ff;
  --text-glow: rgba(0, 212, 255, 0.6);
  --text-dim: #0099bb;
  --accent: #00d4ff;
  --accent-glow: 0 0 10px rgba(0, 212, 255, 0.5), 0 0 20px rgba(0, 212, 255, 0.2);
  --controls-border: rgba(0, 212, 255, 0.15);
  --progress-fill: #00d4ff;
}

/* 💜 矩阵紫雨 */
[data-theme="matrix-purple"] {
  --text-primary: #bf5fff;
  --text-glow: rgba(191, 95, 255, 0.6);
  --text-dim: #8833cc;
  --accent: #bf5fff;
  --accent-glow: 0 0 10px rgba(191, 95, 255, 0.5), 0 0 20px rgba(191, 95, 255, 0.2);
  --controls-border: rgba(191, 95, 255, 0.15);
  --progress-fill: #bf5fff;
}

/* 🌈 彩虹渐变 - 使用 CSS background-clip:text 实现 */
[data-theme="rainbow"] {
  --text-primary: #ff6b6b;
  --text-dim: #cc5555;
  --accent: #ff6b6b;
  --accent-glow: 0 0 10px rgba(255, 107, 107, 0.5);
  --controls-border: rgba(255, 107, 107, 0.2);
  --progress-fill: linear-gradient(90deg, #ff6b6b, #ffa500, #ffd700, #00ff41, #00d4ff, #bf5fff);
}

[data-theme="rainbow"] .ascii-display,
[data-theme="rainbow"] .boot-logo {
  background: linear-gradient(180deg,
      #ff6b6b 0%, #ffa500 16%, #ffd700 32%,
      #00ff41 48%, #00d4ff 64%, #bf5fff 80%, #ff6b6b 100%);
  background-size: 100% 200%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: rainbowScroll 4s linear infinite;
  text-shadow: none;
}

@keyframes rainbowScroll {
  0% {
    background-position: 0 0;
  }

  100% {
    background-position: 0 200%;
  }
}

/* 🎲 霓虹随机 - 用 CSS animation 实现颜色循环 */
[data-theme="neon-random"] {
  --text-primary: #ff00ff;
  --text-dim: #aa00aa;
  --accent: #ff00ff;
  --accent-glow: 0 0 10px rgba(255, 0, 255, 0.5);
  --controls-border: rgba(255, 0, 255, 0.2);
  --progress-fill: #ff00ff;
}

[data-theme="neon-random"] .ascii-display,
[data-theme="neon-random"] .boot-logo {
  animation: neonCycle 2s steps(9) infinite;
  text-shadow: 0 0 8px currentColor;
}

@keyframes neonCycle {
  0% {
    color: #ff003c;
  }

  11% {
    color: #ff6600;
  }

  22% {
    color: #ffe600;
  }

  33% {
    color: #00ff41;
  }

  44% {
    color: #00ffcc;
  }

  55% {
    color: #00aaff;
  }

  66% {
    color: #7b00ff;
  }

  77% {
    color: #ff00ff;
  }

  88% {
    color: #ff0066;
  }

  100% {
    color: #ff003c;
  }
}

/* 🔥 火焰熔岩 */
[data-theme="lava"] {
  --text-primary: #ff4400;
  --text-glow: rgba(255, 68, 0, 0.7);
  --text-dim: #cc3300;
  --accent: #ff4400;
  --accent-glow: 0 0 12px rgba(255, 68, 0, 0.6), 0 0 30px rgba(255, 0, 0, 0.3);
  --controls-border: rgba(255, 68, 0, 0.2);
  --progress-fill: linear-gradient(90deg, #ff0000, #ff4400, #ff8800, #ffcc00);
}

[data-theme="lava"] .ascii-display,
[data-theme="lava"] .boot-logo {
  background: linear-gradient(180deg,
      #ffcc00 0%, #ff8800 25%, #ff4400 50%, #cc0000 75%, #ff4400 100%);
  background-size: 100% 300%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: lavaFlow 3s ease-in-out infinite alternate;
  text-shadow: none;
}

@keyframes lavaFlow {
  0% {
    background-position: 0 0;
  }

  100% {
    background-position: 0 300%;
  }
}

/* 🩵 赛博朋克 */
[data-theme="cyberpunk"] {
  --bg: #0d0221;
  --text-primary: #0abdc6;
  --text-glow: rgba(10, 189, 198, 0.6);
  --text-dim: #078a91;
  --accent: #ea00d9;
  --accent-glow: 0 0 10px rgba(234, 0, 217, 0.5), 0 0 25px rgba(10, 189, 198, 0.3);
  --controls-bg: rgba(13, 2, 33, 0.95);
  --controls-border: rgba(234, 0, 217, 0.25);
  --progress-fill: linear-gradient(90deg, #0abdc6, #ea00d9, #ff3864);
}

[data-theme="cyberpunk"] .ascii-display,
[data-theme="cyberpunk"] .boot-logo {
  background: linear-gradient(135deg,
      #0abdc6 0%, #ea00d9 50%, #ff3864 100%);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: cyberShift 5s ease-in-out infinite alternate;
  text-shadow: none;
}

@keyframes cyberShift {
  0% {
    background-position: 0% 0%;
  }

  50% {
    background-position: 100% 100%;
  }

  100% {
    background-position: 0% 0%;
  }
}

/* ☠️ 黑客帝国 */
[data-theme="hacker"] {
  --text-primary: #00ff00;
  --text-glow: rgba(0, 255, 0, 0.8);
  --text-dim: #009900;
  --accent: #00ff00;
  --accent-glow: 0 0 15px rgba(0, 255, 0, 0.6), 0 0 40px rgba(0, 255, 0, 0.2);
  --controls-border: rgba(0, 255, 0, 0.2);
  --progress-fill: #00ff00;
}

[data-theme="hacker"] .ascii-display,
[data-theme="hacker"] .boot-logo {
  text-shadow: 0 0 8px rgba(0, 255, 0, 0.8), 0 0 20px rgba(0, 255, 0, 0.4), 0 0 40px rgba(0, 255, 0, 0.2);
  animation: hackerFlicker 0.15s infinite;
}

@keyframes hackerFlicker {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.96;
  }

  75% {
    opacity: 0.99;
  }
}

/* 🌊 海洋深渊 */
[data-theme="ocean"] {
  --bg: #020c1b;
  --text-primary: #64ffda;
  --text-glow: rgba(100, 255, 218, 0.5);
  --text-dim: #38b2ac;
  --accent: #64ffda;
  --accent-glow: 0 0 10px rgba(100, 255, 218, 0.5);
  --controls-bg: rgba(2, 12, 27, 0.95);
  --controls-border: rgba(100, 255, 218, 0.15);
  --progress-fill: linear-gradient(90deg, #0ea5e9, #64ffda);
}

[data-theme="ocean"] .ascii-display,
[data-theme="ocean"] .boot-logo {
  background: linear-gradient(180deg,
      #0ea5e9 0%, #64ffda 30%, #38b2ac 60%, #0ea5e9 100%);
  background-size: 100% 300%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: oceanWave 6s ease-in-out infinite;
  text-shadow: none;
}

@keyframes oceanWave {

  0%,
  100% {
    background-position: 0 0;
  }

  50% {
    background-position: 0 300%;
  }
}

/* 🌸 樱花粉 */
[data-theme="sakura"] {
  --bg: #1a0a14;
  --text-primary: #ff69b4;
  --text-glow: rgba(255, 105, 180, 0.5);
  --text-dim: #cc5590;
  --accent: #ff69b4;
  --accent-glow: 0 0 10px rgba(255, 105, 180, 0.5), 0 0 25px rgba(255, 182, 193, 0.2);
  --controls-bg: rgba(26, 10, 20, 0.95);
  --controls-border: rgba(255, 105, 180, 0.2);
  --progress-fill: linear-gradient(90deg, #ff69b4, #ffb6c1, #ff1493);
}

[data-theme="sakura"] .ascii-display,
[data-theme="sakura"] .boot-logo {
  background: linear-gradient(180deg,
      #ffb6c1 0%, #ff69b4 40%, #ff1493 70%, #ffb6c1 100%);
  background-size: 100% 250%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: sakuraBreeze 5s ease-in-out infinite alternate;
  text-shadow: none;
}

@keyframes sakuraBreeze {
  0% {
    background-position: 0 0;
  }

  100% {
    background-position: 0 250%;
  }
}

/* ⚡ 雷电风暴 */
[data-theme="thunder"] {
  --text-primary: #e8e8ff;
  --text-glow: rgba(232, 232, 255, 0.8);
  --text-dim: #9999cc;
  --accent: #8888ff;
  --accent-glow: 0 0 10px rgba(136, 136, 255, 0.5);
  --controls-border: rgba(136, 136, 255, 0.2);
  --progress-fill: linear-gradient(90deg, #4444cc, #8888ff, #ffffff, #8888ff, #4444cc);
}

[data-theme="thunder"] .ascii-display,
[data-theme="thunder"] .boot-logo {
  animation: thunderFlash 3s ease-in-out infinite;
}

@keyframes thunderFlash {

  0%,
  100% {
    color: #9999cc;
    text-shadow: 0 0 4px rgba(153, 153, 204, 0.3);
  }

  45% {
    color: #bbbbdd;
    text-shadow: 0 0 6px rgba(187, 187, 221, 0.4);
  }

  50% {
    color: #ffffff;
    text-shadow: 0 0 30px rgba(255, 255, 255, 1), 0 0 60px rgba(136, 136, 255, 0.8);
  }

  55% {
    color: #bbbbdd;
    text-shadow: 0 0 6px rgba(187, 187, 221, 0.4);
  }

  70% {
    color: #9999cc;
    text-shadow: 0 0 4px rgba(153, 153, 204, 0.3);
  }

  72% {
    color: #eeeeff;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.6);
  }

  74% {
    color: #9999cc;
    text-shadow: 0 0 4px rgba(153, 153, 204, 0.3);
  }
}

/* 🥶 冰霜冻结 */
[data-theme="frost"] {
  --bg: #050a14;
  --text-primary: #a8d8ea;
  --text-glow: rgba(168, 216, 234, 0.5);
  --text-dim: #7ab8cc;
  --accent: #a8d8ea;
  --accent-glow: 0 0 10px rgba(168, 216, 234, 0.5);
  --controls-bg: rgba(5, 10, 20, 0.95);
  --controls-border: rgba(168, 216, 234, 0.2);
  --progress-fill: linear-gradient(90deg, #a8d8ea, #ffffff, #a8d8ea);
}

[data-theme="frost"] .ascii-display,
[data-theme="frost"] .boot-logo {
  background: linear-gradient(180deg,
      #ffffff 0%, #a8d8ea 20%, #7ab8cc 50%, #a8d8ea 80%, #ffffff 100%);
  background-size: 100% 400%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: frostShimmer 8s ease-in-out infinite;
  text-shadow: none;
}

@keyframes frostShimmer {

  0%,
  100% {
    background-position: 0 0;
  }

  50% {
    background-position: 0 400%;
  }
}

/* 🪩 蒸汽波 */
[data-theme="vaporwave"] {
  --bg: #16001e;
  --text-primary: #ff71ce;
  --text-glow: rgba(255, 113, 206, 0.5);
  --text-dim: #b967ff;
  --accent: #ff71ce;
  --accent-glow: 0 0 10px rgba(255, 113, 206, 0.5), 0 0 20px rgba(1, 205, 254, 0.3);
  --controls-bg: rgba(22, 0, 30, 0.95);
  --controls-border: rgba(255, 113, 206, 0.2);
  --progress-fill: linear-gradient(90deg, #ff71ce, #01cdfe, #05ffa1, #b967ff, #ff71ce);
}

[data-theme="vaporwave"] .ascii-display,
[data-theme="vaporwave"] .boot-logo {
  background: linear-gradient(180deg,
      #ff71ce 0%, #01cdfe 25%, #05ffa1 50%, #b967ff 75%, #ff71ce 100%);
  background-size: 100% 300%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: vaporShift 4s linear infinite;
  text-shadow: none;
}

@keyframes vaporShift {
  0% {
    background-position: 0 0;
  }

  100% {
    background-position: 0 300%;
  }
}

/* --- 彩虹进度条 --- */
[data-theme="rainbow"] .progress-bar,
[data-theme="cyberpunk"] .progress-bar,
[data-theme="lava"] .progress-bar,
[data-theme="ocean"] .progress-bar,
[data-theme="sakura"] .progress-bar,
[data-theme="vaporwave"] .progress-bar,
[data-theme="thunder"] .progress-bar,
[data-theme="frost"] .progress-bar {
  background: var(--progress-fill);
}

/* --- 基础重置 --- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text-primary);
  font-family: var(--font-ui);
  transition: background 0.3s ease;
}

/* ========================================
   启动界面
   ======================================== */
.boot-screen {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: bootFadeIn 0.5s ease-out;
  transition: background 0.3s ease;
}

@keyframes bootFadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.boot-content {
  text-align: center;
  max-width: 90vw;
}

.boot-logo {
  font-family: var(--font-mono);
  font-size: clamp(6px, 1.2vw, 14px);
  line-height: 1.2;
  color: var(--text-primary);
  text-shadow: var(--accent-glow);
  white-space: pre;
  margin-bottom: 16px;
  animation: logoGlow 2s ease-in-out infinite alternate;
}

@keyframes logoGlow {
  from {
    filter: brightness(0.9);
  }

  to {
    filter: brightness(1.3);
  }
}

.boot-subtitle {
  font-family: var(--font-ui);
  font-size: 18px;
  color: var(--text-dim);
  letter-spacing: 8px;
  margin-bottom: 40px;
  text-transform: uppercase;
  transition: color 0.3s ease;
}

/* 加载进度条 */
.boot-loading {
  width: 400px;
  max-width: 80vw;
  margin: 0 auto;
}

.loading-bar-track {
  height: 3px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 12px;
}

.loading-bar-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  box-shadow: var(--accent-glow);
  transition: width 0.1s linear;
  border-radius: 2px;
}

.loading-text {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-dim);
}

/* 启动提示 */
.boot-prompt {
  margin-top: 20px;
}

.prompt-text {
  font-family: var(--font-mono);
  font-size: 16px;
  color: var(--text-primary);
}

.prompt-cursor {
  font-family: var(--font-mono);
  font-size: 16px;
  color: var(--text-primary);
  animation: blink 0.8s step-end infinite;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

/* 启动界面主题选择器 */
.boot-theme-bar {
  margin-top: 36px;
  display: grid;
  grid-template-columns: repeat(7, 40px);
  gap: 10px;
  justify-content: center;
  margin-left: auto;
  margin-right: auto;
}

.boot-theme-btn {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.03);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  outline: none;
}

.boot-theme-btn::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1px solid transparent;
  transition: all 0.25s;
}

/* 工具提示 */
.boot-theme-btn::after {
  content: attr(title);
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  white-space: nowrap;
  font-size: 12px;
  font-family: var(--font-ui);
  color: #ddd;
  background: rgba(10, 10, 10, 0.95);
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  opacity: 0;
  pointer-events: none;
  transition: all 0.2s;
  backdrop-filter: blur(10px);
  z-index: 10;
}

.boot-theme-btn:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.boot-theme-btn:hover {
  border-color: rgba(255, 255, 255, 0.3);
  transform: scale(1.25);
  background: rgba(255, 255, 255, 0.08);
}

.boot-theme-btn:hover::before {
  border-color: var(--accent);
  box-shadow: var(--accent-glow);
}

.boot-theme-btn.active {
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.06);
  transform: scale(1.15);
}

.boot-theme-btn.active::before {
  border-color: var(--accent);
  box-shadow: var(--accent-glow);
  animation: activeRing 2s ease-in-out infinite alternate;
}

@keyframes activeRing {
  from {
    box-shadow: 0 0 8px var(--accent);
  }

  to {
    box-shadow: 0 0 16px var(--accent), 0 0 30px rgba(255, 255, 255, 0.1);
  }
}

/* ========================================
   主播放器
   ======================================== */
.player {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: background 0.3s ease;
}

/* CRT 扫描线效果 */
.scanlines {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 10;
  background: repeating-linear-gradient(0deg,
      transparent,
      transparent 2px,
      rgba(0, 0, 0, 0.08) 2px,
      rgba(0, 0, 0, 0.08) 4px);
}

/* --- 主题选择器（播放器内） --- */
.theme-selector {
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 100;
}

.theme-toggle {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(15, 15, 15, 0.85);
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(16px);
  outline: none;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
}

.theme-toggle:hover {
  border-color: var(--accent);
  box-shadow: var(--accent-glow), 0 4px 20px rgba(0, 0, 0, 0.5);
  transform: scale(1.1) rotate(15deg);
}

.theme-dropdown {
  position: absolute;
  top: 52px;
  right: 0;
  background: rgba(12, 12, 12, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 8px;
  width: 340px;
  max-height: 75vh;
  overflow-y: auto;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-10px) scale(0.96);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(30px);
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
}

.theme-dropdown::-webkit-scrollbar {
  width: 4px;
}

.theme-dropdown::-webkit-scrollbar-track {
  background: transparent;
}

.theme-dropdown::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 2px;
}

.theme-dropdown.open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.theme-option {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.04);
  background: rgba(255, 255, 255, 0.02);
  color: #999;
  font-size: 12px;
  font-family: var(--font-ui);
  text-align: left;
  cursor: pointer;
  border-radius: 10px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  outline: none;
}

/* 顶部颜色预览条 */
.theme-option::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  opacity: 0;
  transition: opacity 0.2s, height 0.2s;
}

/* 每个主题的预览条颜色 */
.theme-option[data-theme="classic-green"]::before {
  background: #00ff41;
}

.theme-option[data-theme="amber"]::before {
  background: #ffb000;
}

.theme-option[data-theme="ice-blue"]::before {
  background: #00d4ff;
}

.theme-option[data-theme="matrix-purple"]::before {
  background: #bf5fff;
}

.theme-option[data-theme="rainbow"]::before {
  background: linear-gradient(90deg, #ff6b6b, #ffa500, #ffd700, #00ff41, #00d4ff, #bf5fff);
}

.theme-option[data-theme="neon-random"]::before {
  background: linear-gradient(90deg, #ff003c, #ffe600, #00ff41, #00aaff, #ff00ff);
}

.theme-option[data-theme="lava"]::before {
  background: linear-gradient(90deg, #ff0000, #ff4400, #ff8800, #ffcc00);
}

.theme-option[data-theme="cyberpunk"]::before {
  background: linear-gradient(90deg, #0abdc6, #ea00d9, #ff3864);
}

.theme-option[data-theme="hacker"]::before {
  background: #00ff00;
}

.theme-option[data-theme="ocean"]::before {
  background: linear-gradient(90deg, #0ea5e9, #64ffda);
}

.theme-option[data-theme="sakura"]::before {
  background: linear-gradient(90deg, #ff69b4, #ffb6c1, #ff1493);
}

.theme-option[data-theme="thunder"]::before {
  background: linear-gradient(90deg, #4444cc, #8888ff, #ffffff, #8888ff);
}

.theme-option[data-theme="frost"]::before {
  background: linear-gradient(90deg, #a8d8ea, #ffffff, #a8d8ea);
}

.theme-option[data-theme="vaporwave"]::before {
  background: linear-gradient(90deg, #ff71ce, #01cdfe, #05ffa1, #b967ff);
}

.theme-option:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.12);
  color: #eee;
  transform: translateY(-1px);
}

.theme-option:hover::before {
  opacity: 1;
  height: 3px;
}

.theme-option.active {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--accent);
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}

.theme-option.active::before {
  opacity: 1;
  height: 3px;
}

.theme-option .theme-emoji {
  font-size: 16px;
  flex-shrink: 0;
}

.theme-option .theme-name {
  font-weight: 500;
  letter-spacing: 0.3px;
}

/* 自定义调色盘 */
.theme-custom-row {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  margin-top: 4px;
}

.theme-custom-label {
  font-family: var(--font-ui);
  font-size: 12px;
  color: #999;
  white-space: nowrap;
}

.custom-color-input {
  -webkit-appearance: none;
  appearance: none;
  width: 36px;
  height: 28px;
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  padding: 0;
  transition: all 0.2s;
}

.custom-color-input::-webkit-color-swatch-wrapper {
  padding: 2px;
}

.custom-color-input::-webkit-color-swatch {
  border: none;
  border-radius: 3px;
}

.custom-color-input:hover {
  border-color: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

/* --- 故障模式 --- */
.glitch-mode .ascii-display {
  animation: glitchShake 0.05s infinite;
}

.glitch-mode .ascii-display::after {
  content: attr(data-text);
  position: absolute;
  left: 2px;
  top: 0;
  color: #ff0040;
  mix-blend-mode: screen;
  clip-path: inset(0 0 50% 0);
  animation: glitchClip 0.3s infinite;
}

@keyframes glitchShake {
  0% {
    transform: translate(0);
  }

  20% {
    transform: translate(-2px, 1px);
  }

  40% {
    transform: translate(2px, -1px);
  }

  60% {
    transform: translate(-1px, -2px);
  }

  80% {
    transform: translate(1px, 2px);
  }

  100% {
    transform: translate(0);
  }
}

@keyframes glitchClip {
  0% {
    clip-path: inset(20% 0 60% 0);
  }

  25% {
    clip-path: inset(50% 0 10% 0);
  }

  50% {
    clip-path: inset(10% 0 70% 0);
  }

  75% {
    clip-path: inset(80% 0 5% 0);
  }

  100% {
    clip-path: inset(30% 0 40% 0);
  }
}

/* --- 弹幕系统 --- */
.danmaku-layer {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 120px;
  pointer-events: none;
  z-index: 8;
  overflow: hidden;
}

.danmaku-item {
  position: absolute;
  white-space: nowrap;
  font-family: var(--font-ui);
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.9), -1px -1px 2px rgba(0, 0, 0, 0.9);
  will-change: transform;
  pointer-events: none;
  animation: danmakuFly linear forwards;
}

/* 预设弹幕 — 大号金色发光，非常突出 */
.danmaku-item.highlight {
  font-size: 28px;
  font-weight: 900;
  color: #ffd700;
  text-shadow:
    0 0 10px rgba(255, 215, 0, 0.8),
    0 0 20px rgba(255, 215, 0, 0.5),
    0 0 40px rgba(255, 215, 0, 0.3),
    2px 2px 4px rgba(0, 0, 0, 0.9);
  padding: 4px 12px;
  background: rgba(255, 215, 0, 0.08);
  border: 1px solid rgba(255, 215, 0, 0.15);
  border-radius: 6px;
  animation: danmakuFly linear forwards, highlightPulse 1s ease-in-out infinite alternate;
}

@keyframes highlightPulse {
  from {
    filter: brightness(1);
  }

  to {
    filter: brightness(1.3);
  }
}

/* 顶部固定弹幕 */
.danmaku-item.top-fixed {
  left: 50% !important;
  right: auto !important;
  transform: translateX(-50%);
  animation: topDanmakuFade 4s ease-in-out forwards;
  font-size: 24px;
  text-align: center;
}

@keyframes topDanmakuFade {
  0% {
    opacity: 0;
  }

  15% {
    opacity: 1;
  }

  85% {
    opacity: 1;
  }

  100% {
    opacity: 0;
  }
}

/* 路人/氛围弹幕 — 小号半透明 */
.danmaku-item.atmosphere {
  font-size: 16px;
  font-weight: 500;
  opacity: 0.6;
  color: #ccc;
  text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.7);
}

@keyframes danmakuFly {
  from {
    transform: translateX(0);
  }

  to {
    transform: translateX(calc(-100% - 100vw));
  }
}

/* 弹幕输入栏 */
.danmaku-bar {
  position: fixed;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(10, 10, 10, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  padding: 4px 6px 4px 4px;
  backdrop-filter: blur(16px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  transition: all 0.25s;
}

.danmaku-bar:focus-within {
  border-color: var(--accent);
  box-shadow: var(--accent-glow), 0 4px 20px rgba(0, 0, 0, 0.4);
}

.danmaku-input {
  background: transparent;
  border: none;
  outline: none;
  color: #ddd;
  font-family: var(--font-ui);
  font-size: 13px;
  width: 200px;
  padding: 6px 10px;
}

.danmaku-input::placeholder {
  color: #555;
}

.danmaku-send {
  padding: 5px 14px;
  border-radius: 16px;
  border: none;
  background: var(--accent);
  color: #000;
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.danmaku-send:hover {
  filter: brightness(1.2);
  transform: scale(1.05);
}

.danmaku-toggle.active {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--accent);
}

/* 弹幕隐藏时 */
.danmaku-hidden .danmaku-layer {
  display: none;
}

.danmaku-hidden .danmaku-bar {
  opacity: 0.4;
}

/* --- 分享弹窗 --- */
.share-modal {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.share-modal.open {
  opacity: 1;
  pointer-events: auto;
}

.share-content {
  background: rgba(15, 15, 15, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 32px;
  width: 420px;
  max-width: 90vw;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
  text-align: center;
}

.share-title {
  font-family: var(--font-ui);
  font-size: 20px;
  font-weight: 700;
  color: #eee;
  margin-bottom: 8px;
}

.share-desc {
  font-family: var(--font-ui);
  font-size: 13px;
  color: #777;
  margin-bottom: 20px;
  line-height: 1.5;
}

.share-input {
  width: 100%;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  color: #eee;
  font-family: var(--font-ui);
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s;
  box-sizing: border-box;
}

.share-input:focus {
  border-color: var(--accent);
}

.share-preview {
  margin-top: 12px;
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  font-family: var(--font-mono);
  font-size: 11px;
  color: #666;
  word-break: break-all;
  min-height: 20px;
  text-align: left;
}

.share-actions {
  margin-top: 20px;
  display: flex;
  gap: 10px;
  justify-content: center;
}

.share-btn-copy {
  padding: 10px 24px;
  border-radius: 12px;
  border: none;
  background: var(--accent);
  color: #000;
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.share-btn-copy:hover {
  filter: brightness(1.2);
  transform: scale(1.03);
}

.share-btn-close {
  padding: 10px 20px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: transparent;
  color: #aaa;
  font-family: var(--font-ui);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}

.share-btn-close:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

/* --- 欢迎弹幕横幅 --- */
.welcome-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 120px;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  animation: welcomeFadeIn 1s ease-out;
}

.welcome-text {
  display: inline-block;
  font-family: var(--font-ui);
  font-size: 42px;
  font-weight: 900;
  color: #ffd700;
  text-shadow: 0 0 30px rgba(255, 215, 0, 0.8), 0 0 60px rgba(255, 215, 0, 0.4), 0 4px 8px rgba(0, 0, 0, 0.9);
  padding: 20px 48px;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 20px;
  backdrop-filter: blur(12px);
  border: 2px solid rgba(255, 215, 0, 0.3);
  animation: welcomePulse 2s ease-in-out infinite alternate;
  letter-spacing: 2px;
}

@keyframes welcomeFadeIn {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes welcomePulse {
  from {
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.4), 0 2px 4px rgba(0, 0, 0, 0.8);
  }

  to {
    text-shadow: 0 0 40px rgba(255, 215, 0, 0.8), 0 0 80px rgba(255, 215, 0, 0.3), 0 2px 4px rgba(0, 0, 0, 0.8);
  }
}

/* --- ASCII 显示区域 --- */
.display-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 10px;
}

.ascii-display {
  font-family: var(--font-mono);
  font-size: clamp(4px, 0.95vw, 11px);
  line-height: 1.15;
  color: var(--text-primary);
  text-shadow: 0 0 4px var(--text-glow);
  white-space: pre;
  letter-spacing: 0;
  user-select: none;
  will-change: contents;
  text-rendering: optimizeSpeed;
  transition: color 0.3s ease;
}

/* --- 控制栏 --- */
.controls {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background: var(--controls-bg);
  border-top: 1px solid var(--controls-border);
  padding: 10px 16px;
  backdrop-filter: blur(20px);
  transition: background 0.3s ease, border-color 0.3s ease;
}

.controls-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ctrl-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--controls-border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--accent);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}

.ctrl-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--accent);
  box-shadow: var(--accent-glow);
}

/* 进度条 */
.progress-container {
  flex: 1;
  height: 6px;
  background: var(--progress-track);
  border-radius: 3px;
  cursor: pointer;
  overflow: hidden;
  position: relative;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: var(--progress-fill);
  border-radius: 3px;
  transition: width 0.05s linear;
  box-shadow: 0 0 6px var(--text-glow);
}

.time-display,
.frame-display {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
  white-space: nowrap;
  flex-shrink: 0;
  transition: color 0.3s ease;
}

/* --- 播放器动画 --- */
.player-enter {
  animation: playerFadeIn 0.6s ease-out;
}

@keyframes playerFadeIn {
  from {
    opacity: 0;
    filter: brightness(3);
  }

  to {
    opacity: 1;
    filter: brightness(1);
  }
}

.crt-boot {
  animation: crtBoot 0.8s ease-out;
}

@keyframes crtBoot {
  0% {
    transform: scaleY(0.01) scaleX(0.5);
    filter: brightness(5);
  }

  40% {
    transform: scaleY(0.01) scaleX(1);
    filter: brightness(3);
  }

  60% {
    transform: scaleY(1) scaleX(1);
    filter: brightness(2);
  }

  100% {
    transform: scaleY(1) scaleX(1);
    filter: brightness(1);
  }
}

/* --- 趣味功能栏 --- */
.fun-bar {
  position: fixed;
  bottom: 58px;
  left: 0;
  right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  background: rgba(8, 8, 8, 0.9);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(16px);
  flex-wrap: wrap;
}

.fun-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.fun-label {
  font-family: var(--font-ui);
  font-size: 11px;
  color: #666;
  white-space: nowrap;
  user-select: none;
}

.fun-divider {
  width: 1px;
  height: 24px;
  background: rgba(255, 255, 255, 0.08);
  margin: 0 4px;
}

.fun-btn {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.03);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  outline: none;
  position: relative;
}

.fun-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.15);
  transform: scale(1.1);
}

.fun-btn.active {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--accent);
  box-shadow: 0 0 8px var(--text-glow);
}

/* 速度滑块 */
.speed-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 80px;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}

.speed-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 6px var(--text-glow);
  cursor: pointer;
  transition: transform 0.15s;
}

.speed-slider::-webkit-slider-thumb:hover {
  transform: scale(1.3);
}

.speed-value {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
  min-width: 32px;
  text-align: center;
  font-weight: 700;
}

/* 字符集按钮组 */
.charset-btns {
  display: flex;
  gap: 3px;
}

.charset-btn {
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.03);
  color: #777;
  font-size: 11px;
  font-family: var(--font-mono);
  cursor: pointer;
  transition: all 0.15s;
  outline: none;
}

.charset-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ccc;
}

.charset-btn.active {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--accent);
  color: var(--accent);
}

/* --- 派对模式 --- */
.party-mode .ascii-display {
  animation: partyShake 0.1s infinite;
}

.party-mode .scanlines {
  animation: partyScanlines 0.5s steps(3) infinite;
  opacity: 0.15;
}

@keyframes partyShake {

  0%,
  100% {
    transform: translate(0, 0);
  }

  25% {
    transform: translate(-2px, 1px);
  }

  50% {
    transform: translate(1px, -1px);
  }

  75% {
    transform: translate(-1px, -2px);
  }
}

@keyframes partyScanlines {
  0% {
    background-position: 0 0;
  }

  33% {
    background-position: 0 1px;
  }

  66% {
    background-position: 0 3px;
  }

  100% {
    background-position: 0 0;
  }
}

/* 派对粒子 */
.party-particles {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 5;
  overflow: hidden;
}

.party-particle {
  position: absolute;
  font-size: 20px;
  animation: particleFall linear forwards;
  pointer-events: none;
}

@keyframes particleFall {
  0% {
    transform: translateY(-20px) rotate(0deg);
    opacity: 1;
  }

  100% {
    transform: translateY(105vh) rotate(720deg);
    opacity: 0;
  }
}

/* --- Toast 通知 --- */
.toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(-60px);
  background: rgba(15, 15, 15, 0.95);
  border: 1px solid var(--controls-border);
  border-radius: 10px;
  padding: 10px 20px;
  font-family: var(--font-ui);
  font-size: 13px;
  color: var(--accent);
  z-index: 200;
  backdrop-filter: blur(20px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s;
  opacity: 0;
  white-space: nowrap;
  pointer-events: none;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* --- 快捷键面板 --- */
.help-panel {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}

.help-panel.open {
  opacity: 1;
  pointer-events: auto;
}

.help-content {
  background: rgba(15, 15, 15, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 28px 32px;
  min-width: 360px;
  box-shadow: 0 16px 60px rgba(0, 0, 0, 0.6);
}

.help-title {
  font-family: var(--font-ui);
  font-size: 18px;
  font-weight: 700;
  color: #eee;
  margin-bottom: 20px;
  text-align: center;
}

.help-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px 16px;
  align-items: center;
}

.help-grid kbd {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 5px;
  padding: 3px 8px;
  text-align: center;
  min-width: 36px;
}

.help-grid span {
  font-family: var(--font-ui);
  font-size: 13px;
  color: #aaa;
}

.help-close {
  margin-top: 20px;
  text-align: center;
  font-size: 12px;
  color: #555;
  font-family: var(--font-ui);
}

/* --- 镜像模式 --- */
.mirror-mode .ascii-display {
  transform: scaleX(-1);
}

/* --- 响应式 --- */
@media (max-width: 768px) {
  .ascii-display {
    font-size: clamp(2px, 1.5vw, 6px);
  }

  .boot-logo {
    font-size: clamp(4px, 2vw, 8px);
  }

  .controls {
    padding: 8px 10px;
  }

  .frame-display {
    display: none;
  }

  .boot-theme-bar {
    grid-template-columns: repeat(7, 34px);
    gap: 6px;
  }

  .boot-theme-btn {
    width: 34px;
    height: 34px;
    font-size: 15px;
  }

  .boot-theme-btn::after {
    display: none;
  }

  .theme-dropdown {
    width: 280px;
    grid-template-columns: 1fr 1fr;
  }

  .theme-option {
    padding: 8px 8px;
    font-size: 11px;
  }

  .fun-bar {
    bottom: 50px;
    padding: 6px 10px;
    gap: 4px;
  }

  .fun-label {
    display: none;
  }

  .speed-slider {
    width: 50px;
  }

  .fun-divider {
    display: none;
  }

  .help-content {
    min-width: auto;
    margin: 16px;
    padding: 20px;
  }
}