:root {
  --bg-color: #0b1120;
  --screen-bezel: #1e293b;
  --screen-inner: #070d18;
  --text-green: #22c55e;
  --text-yellow: #facc15;
  --key-bg: #ffffff;
  --key-text: #0f172a;
  --key-shadow: #94a3b8;
  --key-active: #e2e8f0;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: linear-gradient(180deg, #090d16 0%, #0f172a 100%);
  color: #f8fafc;
  height: var(--game-content-height);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: env(safe-area-inset-top, 6px) 8px env(safe-area-inset-bottom, 6px) 8px;
  overflow: hidden;
  touch-action: manipulation;
}

/* 顶部标题与状态栏 */
.top-bar {
  width: 100%;
  max-width: 480px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 6px;
  flex-shrink: 0;
}

.app-title {
  font-size: 1rem;
  font-weight: 800;
  color: #38bdf8;
  display: flex;
  align-items: center;
  gap: 6px;
  letter-spacing: 0.5px;
}

.char-badge-count {
  font-size: 0.75rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 3px 10px;
  color: #94a3b8;
}

/* 🖥️ 电脑屏幕主体 (带逼真外壳、边框和反光质感) */
.computer-monitor {
  width: 100%;
  max-width: 480px;
  background: linear-gradient(145deg, #1e293b, #0f172a);
  border: 2px solid #334155;
  border-radius: 16px;
  padding: 8px 8px 6px 8px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  margin-bottom: 8px;
  position: relative;
}

/* 显示器顶部小摄像头和微标 */
.monitor-bezel-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 4px 4px 4px;
  font-size: 0.65rem;
  color: #64748b;
  font-family: monospace;
}

.webcam-dot {
  width: 6px;
  height: 6px;
  background: #090d16;
  border: 1px solid #475569;
  border-radius: 50%;
}

/* 内部真正发光的显示屏 */
.display-screen {
  background: var(--screen-inner);
  border-radius: 8px;
  border: 1px solid #1e293b;
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 8px;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 0 16px rgba(0, 0, 0, 0.9);
}

/* 微妙的 CRT 屏幕扫描线质感 */
.display-screen::before {
  content: " ";
  display: block;
  position: absolute;
  top: 0; left: 0; bottom: 0; right: 0;
  background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.03), rgba(0, 255, 0, 0.01), rgba(0, 0, 255, 0.03));
  z-index: 2;
  background-size: 100% 2px, 3px 100%;
  pointer-events: none;
}

/* 打字显示滚动区 */
.text-viewport {
  flex: 1;
  overflow-y: auto;
  font-family: "SF Pro Mono", Menlo, Consolas, "Courier New", monospace;
  font-size: 1.25rem;
  line-height: 1.5;
  color: #e2e8f0;
  word-break: break-all;
  white-space: pre-wrap;
  position: relative;
  z-index: 3;
  padding-bottom: 4px;
  scroll-behavior: smooth;
}

.placeholder-guide {
  color: #475569;
  font-size: 0.95rem;
  line-height: 1.6;
}

/* 光标闪烁 */
.cursor {
  display: inline-block;
  width: 9px;
  height: 1.2rem;
  vertical-align: text-bottom;
  background: var(--text-green);
  box-shadow: 0 0 8px var(--text-green);
  animation: blink 1s steps(2, start) infinite;
  margin-left: 2px;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* 字符样式 */
.char-badge {
  display: inline-block;
  animation: popChar 0.12s ease-out;
}

.char-num {
  color: #facc15;
  font-weight: 800;
}

.char-letter {
  color: #38bdf8;
  font-weight: 700;
}

@keyframes popChar {
  0% { transform: scale(1.35); opacity: 0.8; }
  100% { transform: scale(1); opacity: 1; }
}

/* 📌 核心重点：数字的英文对照面板 (打什么数字旁边显示英文) */
.english-number-panel {
  position: relative;
  z-index: 3;
  background: rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(8px);
  border-top: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 8px;
  padding: 6px 8px;
  margin-top: 4px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.current-number-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.num-left-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.num-circle {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  font-weight: 900;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.5);
  transition: transform 0.15s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.num-circle.bounce {
  transform: scale(1.25);
}

.num-english-words {
  display: flex;
  flex-direction: column;
}

.english-word-main {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: #38bdf8;
  text-transform: uppercase;
  line-height: 1.2;
}

.chinese-word-sub {
  font-size: 0.75rem;
  color: #94a3b8;
}

.key-hint-tag {
  font-size: 0.7rem;
  padding: 2px 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  color: #cbd5e1;
}

/* 0~9 数字英语横向对照卡条 */
.number-cards-strip {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.number-cards-strip::-webkit-scrollbar {
  display: none;
}

.mini-num-tag {
  flex: 0 0 auto;
  background: rgba(30, 41, 59, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  padding: 2px 5px;
  font-size: 0.65rem;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 3px;
  transition: all 0.2s ease;
  cursor: pointer;
}

.mini-num-tag.active {
  background: rgba(56, 189, 248, 0.2);
  border-color: #38bdf8;
  color: #38bdf8;
  font-weight: bold;
  transform: translateY(-2px);
  box-shadow: 0 2px 6px rgba(56, 189, 248, 0.4);
}

.mini-num-digit {
  font-weight: 800;
  color: #facc15;
}

/* 屏幕底部电脑指示灯 */
.monitor-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 4px;
  padding: 0 2px;
}

.power-led-box {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.62rem;
  color: #64748b;
}

.power-led {
  width: 7px;
  height: 7px;
  background: #22c55e;
  border-radius: 50%;
  box-shadow: 0 0 8px #22c55e;
}

.brand-name {
  font-size: 0.62rem;
  font-weight: 800;
  color: #475569;
  letter-spacing: 1px;
}

/* ⌨️ 手机触摸键盘 */
.keyboard-box {
  width: 100%;
  max-width: 480px;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 14px;
  padding: 6px 4px 6px 4px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex-shrink: 0;
}

.keyboard-row {
  display: flex;
  justify-content: center;
  gap: 4px;
  width: 100%;
}

/* 键盘按键 (立体机械触感) */
.key-btn {
  flex: 1;
  height: 44px;
  background: var(--key-bg);
  color: var(--key-text);
  border: none;
  outline: none;
  border-radius: 6px;
  box-shadow: 0 3px 0 var(--key-shadow), 0 4px 5px rgba(0, 0, 0, 0.3);
  font-family: inherit;
  font-weight: 700;
  font-size: 1.05rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  transition: transform 0.05s ease, box-shadow 0.05s ease;
  touch-action: manipulation;
}

.key-btn:active, .key-btn.pressed {
  transform: translateY(3px);
  box-shadow: 0 0 0 var(--key-shadow), 0 1px 2px rgba(0, 0, 0, 0.2);
  background: var(--key-active);
}

/* 数字按键: 附带对应英文小注 */
.key-number {
  background: #ffffff;
  color: #0f172a;
}

.key-number .key-sub {
  font-size: 0.5rem;
  color: #64748b;
  font-weight: 600;
  margin-top: -3px;
  letter-spacing: -0.2px;
}

/* 字母按键 */
.key-letter {
  background: #f8fafc;
  color: #0f172a;
}

/* 功能按键 (退格、清屏、空格、回车) */
.key-backspace {
  flex: 1.5;
  background: #fed7aa;
  color: #9a3412;
  font-size: 0.85rem;
  box-shadow: 0 3px 0 #fb923c, 0 4px 5px rgba(0, 0, 0, 0.3);
}
.key-backspace:active, .key-backspace.pressed {
  box-shadow: 0 0 0 #fb923c;
}

.key-clear {
  flex: 1.3;
  background: #fecaca;
  color: #991b1b;
  font-size: 0.85rem;
  box-shadow: 0 3px 0 #f87171, 0 4px 5px rgba(0, 0, 0, 0.3);
}
.key-clear:active, .key-clear.pressed {
  box-shadow: 0 0 0 #f87171;
}

.key-space {
  flex: 3.2;
  background: #e2e8f0;
  color: #334155;
  font-size: 0.85rem;
  letter-spacing: 1px;
}

.key-enter {
  flex: 1.5;
  background: #bbf7d0;
  color: #166534;
  font-size: 0.85rem;
  box-shadow: 0 3px 0 #4ade80, 0 4px 5px rgba(0, 0, 0, 0.3);
}
.key-enter:active, .key-enter.pressed {
  box-shadow: 0 0 0 #4ade80;
}
