.typing-content {
  margin-bottom: 28px;
}

.typing-hero {
  width: 100vw;
  max-width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  background: linear-gradient(180deg, rgba(43, 132, 193, 0.95) 0%, rgba(26, 93, 146, 0.97) 100%);
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  border-bottom: 1px solid rgba(0, 0, 0, 0.18);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    inset 0 -1px 0 rgba(0, 0, 0, 0.12);
  padding: 12px 14px 16px;
}

.typing-shell {
  width: min(1080px, 100%);
  margin: 0 auto;
}

.lesson-toolbar-compact {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 10px;
  margin-bottom: 6px;
}

.lesson-top-info {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 4px 6px;
  min-width: 0;
  flex: 1;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.92);
  overflow: hidden;
}

.lesson-title {
  color: #fff;
  font-size: 0.95rem;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}

.lesson-top-info .sep {
  color: rgba(255, 255, 255, 0.4);
  flex-shrink: 0;
}

.lesson-status {
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.86rem;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 1;
  min-width: 60px;
}

.target-inline {
  color: rgba(255, 255, 255, 0.95);
  font-size: 0.9rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.target-inline strong {
  font-weight: 700;
  color: #fff;
  margin-left: 2px;
}

.hint-inline {
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.82rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 1;
  min-width: 40px;
}

.lesson-stage {
  margin-top: 0;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 10px;
  padding: 8px 10px;
  background: rgba(8, 23, 41, 0.26);
}

.text-display {
  min-height: 88px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 10px;
  background: rgba(10, 22, 36, 0.42);
  padding: 10px 12px;
  line-height: 1.65;
  font-size: 1.12rem;
  letter-spacing: 0.02em;
  color: rgba(255, 255, 255, 0.75);
  white-space: pre-wrap;
  word-break: break-word;
}

.lesson-meta {
  margin: 16px auto 0;
  max-width: min(1080px, 100%);
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  background: #101b30;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 12px;
}

.lesson-meta .meta-card {
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  padding: 10px 12px;
}

.lesson-meta .meta-label {
  margin: 0;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.62);
  text-transform: none;
  letter-spacing: normal;
}

.lesson-meta .meta-value {
  margin: 6px 0 0;
  color: #fff;
  font-size: 1.26rem;
  font-weight: 600;
}

.lesson-meta .meta-value .unit {
  font-size: 0.6em;
  font-weight: 400;
  margin-left: 2px;
  opacity: 0.85;
}

.char-correct {
  color: #d4ffe0;
}

.char-wrong {
  color: #ffd8de;
  background: rgba(203, 73, 89, 0.42);
  border-radius: 3px;
}

.char-current {
  color: #ffffff;
  background: rgba(255, 229, 152, 0.32);
  border-bottom: 2px solid rgba(255, 255, 255, 0.95);
}

.char-pending {
  color: rgba(255, 255, 255, 0.56);
}

.typing-input {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.actions {
  margin-top: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex-shrink: 0;
}

/* 文章上方单行工具栏的紧凑按钮 - 全部四个按钮统一样式 */
.lesson-toolbar-compact .actions button {
  padding: 4px 10px;
  font-size: 0.82rem;
  border-radius: 6px;
  line-height: 1.3;
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.12s ease, border-color 0.12s ease, opacity 0.12s ease;
  border: 1px solid transparent;

  /* 统一风格：半透明背景 + 浅边框（开始练习 / 暂停 / 重新开始 / 下一段 完全一致） */
  background: rgba(255, 255, 255, 0.10);
  border-color: rgba(255, 255, 255, 0.32);
  color: rgba(255, 255, 255, 0.95);
}

.lesson-toolbar-compact .actions button:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.50);
}

/* 禁用状态统一 */
.lesson-toolbar-compact .actions button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.keyboard-wrap {
  margin-top: 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  padding: 12px;
  background: transparent;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* 固定键盘在容器内居中显示（小屏可横向滚动查看完整键盘） */
.keyboard-wrap .keyboard-stack {
  margin-left: auto;
  margin-right: auto;
}

/* 旧的单独提示行样式已合并到文章上方的单行工具栏内，保留基础以防其他地方使用 */
.keyboard-hint {
  margin: 0 0 6px;
  color: rgba(255, 255, 255, 0.92);
  font-size: 0.9rem;
}

.keyboard-hint-detail {
  margin: 0 0 6px;
  min-height: 1.2em;
  font-size: 0.85rem;
  line-height: 1.3;
  color: rgba(255, 255, 255, 0.78);
}

/* .virtual-keyboard base kept for potential other use; the edclub one uses flex with fixed keys */

.keyboard-stack {
  position: relative;
  margin: 8px auto 4px;
  /* 宽度按第二行（QWERTY行）右边缘对齐：14.5U + 13*gap */
  width: calc(14.5 * var(--kb-unit) + 13 * var(--kb-gap) + 20px);
  min-height: 350px;
  --kb-gap: 4px;
  --kb-unit: 60px;
  /* 键盘底板透明，让 typing-hero 的蓝色渐变背景透出来 */
  background: transparent;
  border-radius: 10px;
  padding: 11px 9px 7px;
  box-shadow: none;
}

.kb-hands-holder {
  position: absolute;
  left: 0;
  right: 0;
  /* SVG 内部用 viewBox 自适应，这里覆盖整个键盘区域 */
  top: 0;
  bottom: 0;
  z-index: 4;
  pointer-events: none;
}

.kb-hands-svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* 手指本身不再单独移动（相对手保持固定），过渡交给 .hand-group */
.kb-hands-svg .finger {
  /* no-op */
}

/* 整只手作为一个组的过渡动画（手指和掌心一起平滑移动） */
.kb-hands-svg .hand-group {
  transition: transform 280ms cubic-bezier(0.22, 0.61, 0.36, 1);
  transform-origin: 0 0;
}

/* 基础手的外观：略透明的灰色线稿 */
.keyboard-stack .kb-hand-finger {
  fill: rgba(238, 242, 248, 0.62);
  stroke: #5f6b7d;
  stroke-width: 3px;
  transition: stroke 120ms ease, stroke-width 120ms ease, fill 120ms ease;
}

/* 掌心略透明 */
.keyboard-stack .kb-palm {
  fill: rgba(238, 242, 248, 0.56);
  stroke: #6f7c90;
  stroke-width: 2.5px;
}

/* 激活的手指：略透明的蓝色高亮 */
.keyboard-stack .finger.finger-on .kb-hand-finger {
  stroke: #1d4ed8 !important;
  stroke-width: 5.5px;
  fill: rgba(191, 219, 254, 0.82);
}

.virtual-keyboard.vc-keyboard-edclub {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: var(--kb-gap);
  padding-bottom: 6px;
  width: 100%;
}

/* ===== 键盘上方手指图例：与按键列对齐，竖线分隔 ===== */
.kb-finger-legend {
  display: flex;
  align-items: stretch;
  width: 100%;
  padding: 6px 0 8px;
  margin: 0 0 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.22);
  box-sizing: border-box;
}

.kb-finger-tag {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px 2px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: #ffffff;
  text-align: center;
  /* 用竖线分隔相邻标签 */
  border-right: 1px solid rgba(255, 255, 255, 0.28);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.kb-finger-tag:last-child {
  border-right: none;
}

/* 各手指标签用对应按键的颜色（与键盘分区完全一致） */
.kb-finger-tag.fp-lp,
.kb-finger-tag.fp-rp {
  background: rgba(59, 130, 246, 0.55);
}

.kb-finger-tag.fp-lr,
.kb-finger-tag.fp-rr {
  background: rgba(34, 197, 94, 0.55);
}

.kb-finger-tag.fp-lm,
.kb-finger-tag.fp-rm {
  background: rgba(245, 158, 11, 0.55);
}

.kb-finger-tag.fp-li,
.kb-finger-tag.fp-ri {
  background: rgba(239, 68, 68, 0.55);
}

.vc-keyboard-edclub .kb-key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  flex: 0 0 var(--kb-unit);
  width: var(--kb-unit);
  min-width: var(--kb-unit);
  max-width: var(--kb-unit);
  height: 48px;
  padding: 0 3px;
  border-radius: 7px;
  /* 按键背景透明，轮廓白色，文字白色（在蓝色 hero 背景上显示） */
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.55);
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: default;
  user-select: none;
  /* 数字+符号双排布局 */
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  line-height: 1.05;
  transition:
    transform 0.06s ease,
    background-color 0.12s ease,
    border-color 0.12s ease,
    color 0.12s ease;
}

/* 数字行：上方符号 + 下方数字 */
.vc-keyboard-edclub .kb-key .kb-symbol {
  font-size: 12px;
  font-weight: 600;
  opacity: 0.95;
  line-height: 1;
}

.vc-keyboard-edclub .kb-key .kb-num {
  font-size: 11px;
  font-weight: 500;
  opacity: 0.7;
  line-height: 1;
}

/* F / J 键下方的小横线（home row 标记） */
.vc-keyboard-edclub .kb-key.kb-key-home {
  position: relative;
}

.vc-keyboard-edclub .kb-key.kb-key-home .kb-home-bar {
  display: block;
  position: absolute;
  left: 50%;
  bottom: 4px;
  transform: translateX(-50%);
  width: 14px;
  height: 2px;
  background: #ffffff;
  border-radius: 1px;
  opacity: 0.9;
}

/* ===== 手指分区配色（加深版，在透明背景下用更深的半透明色块区分） =====
   lp/lr/lm/li = 左手 小/无名/中/食
   rp/rr/rm/ri = 右手 小/无名/中/食
*/
.vc-keyboard-edclub .kb-key.fp-lp,
.vc-keyboard-edclub .kb-key.fp-rp {
  /* 小指：蓝色（加深） */
  background: rgba(59, 130, 246, 0.55);
  border-color: rgba(96, 165, 250, 1);
  color: #ffffff;
}

.vc-keyboard-edclub .kb-key.fp-lr,
.vc-keyboard-edclub .kb-key.fp-rr {
  /* 无名指：绿色（加深） */
  background: rgba(34, 197, 94, 0.55);
  border-color: rgba(74, 222, 128, 1);
  color: #ffffff;
}

.vc-keyboard-edclub .kb-key.fp-lm,
.vc-keyboard-edclub .kb-key.fp-rm {
  /* 中指：橙黄色（加深） */
  background: rgba(245, 158, 11, 0.55);
  border-color: rgba(251, 191, 36, 1);
  color: #ffffff;
}

.vc-keyboard-edclub .kb-key.fp-li,
.vc-keyboard-edclub .kb-key.fp-ri {
  /* 食指：珊瑚红（加深） */
  background: rgba(239, 68, 68, 0.55);
  border-color: rgba(248, 113, 113, 1);
  color: #ffffff;
}

.vc-keyboard-edclub .kb-key-muted {
  font-size: 12px;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0.01em;
  color: rgba(255, 255, 255, 0.92);
}

.vc-keyboard-edclub .kb-row-bottom-mac .kb-key {
  font-size: 12px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.92);
  text-transform: none;
}

/* 按键宽度按参考图单位比例（1U = 标准字母键宽） */
.vc-keyboard-edclub .kb-key.key-tab {
  width: calc(1.5 * var(--kb-unit));
  flex: 0 0 calc(1.5 * var(--kb-unit));
  min-width: calc(1.5 * var(--kb-unit));
  max-width: calc(1.5 * var(--kb-unit));
}
.vc-keyboard-edclub .kb-key.key-caps {
  width: calc(1.75 * var(--kb-unit));
  flex: 0 0 calc(1.75 * var(--kb-unit));
  min-width: calc(1.75 * var(--kb-unit));
  max-width: calc(1.75 * var(--kb-unit));
}
.vc-keyboard-edclub .kb-key.key-enter {
  /* 缩减长度，使右边缘与第二行（QWERTY行）右边缘对齐 */
  width: calc(1.75 * var(--kb-unit) + var(--kb-gap));
  flex: 0 0 calc(1.75 * var(--kb-unit) + var(--kb-gap));
  min-width: calc(1.75 * var(--kb-unit) + var(--kb-gap));
  max-width: calc(1.75 * var(--kb-unit) + var(--kb-gap));
}
.vc-keyboard-edclub .kb-key.key-wide {
  /* backspace: 1.5U - 缩减以使右边缘与第二行 \ 键对齐 */
  width: calc(1.5 * var(--kb-unit));
  flex: 0 0 calc(1.5 * var(--kb-unit));
  min-width: calc(1.5 * var(--kb-unit));
  max-width: calc(1.5 * var(--kb-unit));
}
.vc-keyboard-edclub .kb-key.key-shift.key-lshift {
  width: calc(2.25 * var(--kb-unit));
  flex: 0 0 calc(2.25 * var(--kb-unit));
  min-width: calc(2.25 * var(--kb-unit));
  max-width: calc(2.25 * var(--kb-unit));
}
.vc-keyboard-edclub .kb-key.key-shift.key-rshift {
  /* 缩减长度，使右边缘与第二行右边缘对齐 */
  width: calc(2.25 * var(--kb-unit) + 2 * var(--kb-gap));
  flex: 0 0 calc(2.25 * var(--kb-unit) + 2 * var(--kb-gap));
  min-width: calc(2.25 * var(--kb-unit) + 2 * var(--kb-gap));
  max-width: calc(2.25 * var(--kb-unit) + 2 * var(--kb-gap));
}
.vc-keyboard-edclub .kb-key.key-backslash {
  /* 与 ] 同宽：1U */
  width: var(--kb-unit);
  flex: 0 0 var(--kb-unit);
  min-width: var(--kb-unit);
  max-width: var(--kb-unit);
}
.vc-keyboard-edclub .kb-key.key-mod {
  width: calc(1.25 * var(--kb-unit));
  flex: 0 0 calc(1.25 * var(--kb-unit));
  min-width: calc(1.25 * var(--kb-unit));
  max-width: calc(1.25 * var(--kb-unit));
}
.vc-keyboard-edclub .kb-key.key-space {
  width: calc(6.25 * var(--kb-unit));
  flex: 0 0 calc(6.25 * var(--kb-unit));
  min-width: calc(6.25 * var(--kb-unit));
  max-width: calc(6.25 * var(--kb-unit));
  justify-content: center;
  letter-spacing: 0.04em;
  height: 44px;
}

.kb-spacer {
  flex: 0 0 var(--kb-unit);
  width: var(--kb-unit);
  min-width: var(--kb-unit);
  max-width: var(--kb-unit);
  height: 48px;
  pointer-events: none;
}

.kb-row {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: var(--kb-gap);
  width: 100%;
  justify-content: flex-start;
  flex-shrink: 0;
  box-sizing: border-box;
  /* 各行左对齐；错位由左侧修饰键宽度差异自然形成（与参考图一致） */
  margin-left: 0;
}

.kb-row-bottom-mac {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: var(--kb-gap);
  width: 100%;
  box-sizing: border-box;
  margin-left: 0;
}

.kb-row-bottom-mac > .kb-key.key-mod {
  height: 44px;
}

.vc-keyboard-edclub .kb-key.is-active,
.vc-keyboard-edclub .kb-key.is-active-shift-target {
  /* 目标键：参考图中是黑色，这里用深色突出 */
  background: #1f2937;
  border-color: #0f172a;
  color: #ffffff;
}

.vc-keyboard-edclub .kb-key.is-active-modifier {
  background: #111827;
  border-color: #030712;
  color: #ffffff;
}

.vc-keyboard-edclub .kb-key.is-pressed {
  transform: translateY(2px);
  filter: brightness(0.94);
}

.typing-content .about {
  margin-top: 20px;
}

@media (max-width: 980px) {
  .lesson-meta {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .text-display {
    font-size: 1.02rem;
    min-height: 76px;
  }

  .lesson-toolbar-compact {
    gap: 6px 8px;
  }

  .lesson-top-info {
    font-size: 0.82rem;
  }

  .lesson-toolbar-compact .actions button {
    padding: 3px 8px;
    font-size: 0.78rem;
    min-height: 24px;
  }
}

@media (max-width: 560px) {
  .typing-hero {
    padding: 10px 10px 12px;
  }

  .lesson-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .meta-value {
    font-size: 1.15rem;
  }

  /* 键盘保持固定尺寸，小屏下由外层允许横向滚动查看完整大键盘 */
  .keyboard-stack {
    width: calc(14.5 * var(--kb-unit) + 13 * var(--kb-gap) + 20px);
  }
}

/* ===== 每日测试记录 (使用和前两个页面相同的 daily-stats-root 结构) */
#daily-stats-root {
  margin-top: 16px;
}

/* 让整个每日结果区域有和前两个页面一致的深色背景和文字 */
#daily-stats-root .statistics,
#daily-stats-root .daily-stats-card {
  background: #101b30;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 16px;
  color: #fff;
  margin-bottom: 16px;
}

#daily-stats-root .daily-stats-date {
  color: #fff !important;
  font-size: 1.25rem;
  font-weight: 600;
}

#daily-stats-root .stat-label {
  color: rgba(255, 255, 255, 0.62);
  text-transform: none;
  letter-spacing: normal;
  font-size: 12px;
  line-height: 1.3;
}

#daily-stats-root .stat-value {
  color: #fff;
}

#daily-stats-root .stat-value .unit {
  font-size: 0.55em;
  font-weight: 400;
  margin-left: 3px;
  opacity: 0.8;
  vertical-align: baseline;
}

#daily-stats-root .history-row-main .unit {
  font-size: 0.75em;
  font-weight: 400;
  margin-left: 1px;
  opacity: 0.85;
}

.daily-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* 旧的 day-card 样式已清理，现在使用与反应测试、序列记忆完全一致的 daily-stats-root + .statistics .daily-stats-card 结构，日期在 h2.daily-stats-date，上面是当天统计（速度、准确率），下面是单条记录列表 */

/* For typing page, each single record now shows many fields (进度 + 两个速度 + 准确率 + 用时 + 错误), so use single column list for readability */
#daily-stats-root .statistics .history-list {
  grid-template-columns: 1fr;
}
