:root {
  --bg: #fafafa;
  --panel-blue: #2c87c5;
  --panel-red: #cb4b3f;
  --panel-green: #4caf50;
  --text-dark: #f7f7f7;
  --body-text: #333;
  --card-border: #e7e7e7;
  --muted: #808080;
  --content-max-width: 1060px;
  --content-padding-x: 16px;
  --nav-blue: #2c87c5;
  --nav-blue-hover: #236fa3;
}

* {
  box-sizing: border-box;
}

/* 仅屏幕阅读器可见：用于放置语义化标题等不影响视觉的 SEO 元素 */
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

body {
  margin: 0;
  font-family: "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--body-text);
}

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: clip;
}

.layout-narrow {
  width: min(var(--content-max-width), 100%);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--content-padding-x);
  padding-right: var(--content-padding-x);
  box-sizing: border-box;
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 18px;
  min-height: 56px;
}

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

.page > .topbar {
  display: block;
  padding: 0;
  height: auto;
  min-height: 56px;
}

.topbar {
  background: transparent;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  padding: 0;
  color: #fff;
}

.brand-logo {
  display: block;
  flex-shrink: 0;
  text-decoration: none;
  color: inherit;
}

.brand-logo:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.65);
  outline-offset: 3px;
  border-radius: 8px;
}

.brand-icon {
  height: 40px;
  width: auto;
  flex-shrink: 0;
  border-radius: 6px;
  display: block;
}

.brand-title {
  font-size: 1.375rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #fff;
  text-decoration: none;
  line-height: 1.2;
  white-space: nowrap;
  flex-shrink: 0;
}

.brand-title:hover {
  color: #fff;
}

.brand-title:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.65);
  outline-offset: 3px;
  border-radius: 4px;
}

.nav {
  display: flex;
  gap: 6px;
  align-items: center;
  font-size: 14px;
  font-weight: 600;
}

.nav-link {
  color: #fff;
  text-decoration: none;
  padding: 8px 14px;
  border-radius: 2px;
  transition:
    color 120ms ease,
    background-color 120ms ease,
    border-color 120ms ease;
}

.nav-link:hover {
  color: rgba(255, 255, 255, 0.82);
}

.nav-link[aria-current="page"] {
  color: #fff;
  font-weight: 700;
  border-left: 2px solid rgba(255, 255, 255, 0.55);
  border-right: 2px solid rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.12);
  padding-left: 12px;
  padding-right: 12px;
}

/* 临时禁用状态样式（可复用） */
.nav-link.nav-disabled {
  color: rgba(255, 255, 255, 0.5);
  cursor: default;
  pointer-events: none;
}

.nav-link.nav-disabled:hover {
  color: rgba(255, 255, 255, 0.5);
}

/* 禁用时不显示激活边框效果 */
.nav-link.nav-disabled[aria-current="page"] {
  border-left: none;
  border-right: none;
  background: transparent;
}

.content {
  width: min(var(--content-max-width), 100%);
  margin: 0 auto 56px;
  padding: 0 var(--content-padding-x);
}

.reaction-panel {
  min-height: 420px;
  width: 100vw;
  max-width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  border-radius: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  border-bottom: 1px solid rgba(0, 0, 0, 0.16);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    inset 0 -1px 0 rgba(0, 0, 0, 0.12);
  cursor: pointer;
  user-select: none;
  touch-action: manipulation;
  display: grid;
  place-items: center;
  text-align: center;
  outline: none;
  transition: background-color 120ms ease;
}

.reaction-panel:focus-visible {
  box-shadow:
    0 0 0 4px rgba(44, 135, 197, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    inset 0 -1px 0 rgba(0, 0, 0, 0.12);
}

.reaction-panel.state-idle {
  background: var(--panel-blue);
}

.reaction-panel.state-waiting,
.reaction-panel.state-too-soon {
  background: var(--panel-red);
}

.reaction-panel.state-ready {
  background: var(--panel-green);
  /* 与原站一致：绿幕无过渡，避免计时早于「可见全绿」 */
  transition: none;
}

.panel-inner {
  color: var(--text-dark);
  padding: 32px 16px;
}

.panel-inner h1 {
  margin: 0;
  font-size: 56px;
  font-weight: 500;
  line-height: 1.12;
}

.panel-inner p {
  margin: 12px 0 0;
  font-size: 32px;
  line-height: 1.3;
  font-weight: 500;
}

.panel-inner #panel-hint {
  margin-top: 10px;
  font-size: 30px;
}

.icon {
  width: 92px;
  height: 92px;
  margin: 0 auto 24px;
  position: relative;
}

.icon::before,
.icon::after {
  content: "";
  position: absolute;
}

.icon-lightning::before {
  left: 34px;
  top: 2px;
  width: 24px;
  height: 88px;
  background: var(--text-dark);
  clip-path: polygon(44% 0, 100% 0, 60% 44%, 82% 44%, 0 100%, 30% 58%, 8% 58%);
}

.icon-circle::before {
  inset: 6px;
  border: 8px solid var(--text-dark);
  border-radius: 50%;
}

.icon-cross::before,
.icon-cross::after {
  left: 44px;
  top: 5px;
  width: 6px;
  height: 82px;
  background: var(--text-dark);
  border-radius: 4px;
}

.icon-cross::before {
  transform: rotate(45deg);
}

.icon-cross::after {
  transform: rotate(-45deg);
}

.daily-stats-root {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.daily-stats-card.statistics {
  margin-top: 0;
}

.daily-stats-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.daily-stats-date {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: #fff;
  line-height: 1.35;
  flex: 1 1 auto;
  min-width: 0;
}

.statistics .daily-stats-date {
  margin: 0;
}

.daily-stats-clear {
  flex-shrink: 0;
}

.daily-history-title {
  margin: 18px 0 0;
  font-size: 17px;
  font-weight: 600;
  color: #fff;
}

.statistics {
  margin-top: 24px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  padding: 20px;
  color: #fff;
}

.about {
  margin-top: 24px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  padding: 20px;
  color: #fff;
}

.statistics h2 {
  margin: 0 0 16px;
  font-size: 24px;
  font-weight: 600;
  color: #fff;
}

.about h2 {
  margin: 0 0 16px;
  font-size: 24px;
  font-weight: 600;
  color: #fff;
}

.statistics .stat-card {
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
}

.statistics .stat-label {
  color: rgba(255, 255, 255, 0.62);
}

.statistics .stat-value {
  color: #fff;
}

.statistics .history-header h3 {
  color: #fff;
}

.statistics .history-list {
  color: rgba(255, 255, 255, 0.88);
  list-style: none;
  padding-left: 0;
  margin: 10px 0 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.statistics .history-list li {
  padding: 0;
  font-size: 14px;
}

.statistics .history-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  min-height: 48px;
  box-sizing: border-box;
}

@media (max-width: 720px) {
  .statistics .history-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 420px) {
  .statistics .history-list {
    grid-template-columns: 1fr;
  }
}

.statistics .history-row-main {
  min-width: 0;
}

.statistics .history-remove {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.85);
  border-radius: 6px;
  cursor: pointer;
  line-height: 1;
}

.statistics .history-remove-icon {
  font-size: 1.25rem;
  font-weight: 300;
  line-height: 1;
  transform: translateY(-0.06em);
}

.statistics .history-remove:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.statistics .history-remove:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.55);
  outline-offset: 2px;
}

.statistics .ghost-btn {
  border-color: rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.statistics .ghost-btn:hover {
  background: rgba(255, 255, 255, 0.14);
}

.statistics .primary-btn {
  background: var(--panel-blue);
  border-color: var(--panel-blue);
  color: #fff;
}

.stats-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
}

.stat-card {
  border: 1px solid var(--card-border);
  border-radius: 4px;
  padding: 12px;
  background: #fcfcfc;
}

.stat-label {
  margin: 0;
  font-size: 13px;
  color: #7a7a7a;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.stat-value {
  margin: 6px 0 0;
  font-size: 28px;
  font-weight: 700;
  color: #3d3d3d;
}

.history-header {
  margin-top: 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.history-header h3 {
  margin: 0;
  font-size: 17px;
}

.history-list {
  margin: 10px 0 0;
  padding-left: 22px;
  color: #4f4f4f;
}

.history-list li {
  padding: 4px 0;
  font-size: 15px;
}

.ghost-btn,
.primary-btn {
  border-radius: 4px;
  border: 1px solid #d2d2d2;
  background: #fff;
  color: #505050;
  padding: 8px 12px;
  font-size: 14px;
  cursor: pointer;
}

.primary-btn {
  background: #2c87c5;
  border-color: #2c87c5;
  color: #fff;
}

.primary-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.about p {
  margin: 10px 0 0;
  font-size: 15px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.88);
}

.footer {
  margin-top: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  background: transparent;
  color: rgba(255, 255, 255, 0.55);
  font-size: 13px;
  padding: 20px 16px 24px;
  text-align: center;
}

.footer-beian {
  margin: 0 0 12px;
  line-height: 1.5;
}

.footer-beian-link {
  color: rgba(255, 255, 255, 0.68);
  text-decoration: none;
}

.footer-beian-link:hover {
  color: #fff;
  text-decoration: underline;
}

.footer-copy {
  margin: 0 auto 14px;
  max-width: 42em;
  line-height: 1.65;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
}

.footer-friends {
  margin: 0;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-friends-title {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.48);
  letter-spacing: 0.06em;
}

.footer-friends-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  justify-content: center;
  align-items: center;
}

.footer-friends-list a {
  color: rgba(255, 255, 255, 0.68);
  text-decoration: none;
}

.footer-friends-list a:hover {
  color: #fff;
  text-decoration: underline;
}

@media (max-width: 920px) {
  .panel-inner h1 {
    font-size: 42px;
  }

  .panel-inner p {
    font-size: 24px;
  }

  .panel-inner #panel-hint {
    font-size: 22px;
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(120px, 1fr));
  }
}

@media (max-width: 560px) {
  .topbar-inner {
    min-height: 52px;
    gap: 10px;
    flex-wrap: wrap;
    row-gap: 8px;
  }

  .brand-icon {
    height: 34px;
  }

  .brand-title {
    font-size: 1.12rem;
    white-space: normal;
    min-width: 0;
  }

  .nav {
    font-size: 13px;
  }

  .nav-link {
    padding: 6px 10px;
  }

  .nav-link[aria-current="page"] {
    padding-left: 8px;
    padding-right: 8px;
  }

  .panel-inner h1 {
    font-size: 34px;
  }
}
:root {
  --bg: #0b1322;
  --surface: #172135;
  --surface-2: #202c45;
  --text: #f6f8ff;
  --muted: #9ea8bc;
  --primary: #2c7cff;
  --primary-hover: #1f67dc;
  --danger: #e5484d;
  --success: #2ca46d;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 0% 0%, #1e315f, transparent 40%),
    radial-gradient(circle at 100% 0%, #133b64, transparent 42%),
    var(--bg);
  min-height: 100vh;
}

.page-shell {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 0 20px 20px;
  box-sizing: border-box;
}

/* 为右侧固定广告留出空间，避免正文与页脚被挡 */
@media (min-width: 1181px) {
  .page-shell {
    padding-right: calc(20px + 160px + 16px);
  }
}

.topbar {
  width: 100%;
  margin: 0;
  padding: 20px 0 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* 主内容区（广告已脱离文档流固定到视口右侧） */
.content-with-rail {
  display: block;
  width: 100%;
}

/* 右侧竖条：视口垂直居中固定，随滚轮时保持在屏幕中间 */
.ad-rail-right {
  position: fixed;
  right: max(12px, env(safe-area-inset-right, 0px));
  top: 50%;
  transform: translateY(-50%);
  width: 160px;
  max-height: calc(100vh - 24px);
  overflow: auto;
  text-align: center;
  box-sizing: border-box;
  z-index: 40;
  -webkit-overflow-scrolling: touch;
  /* 略作衬底，避免与白边广告糊成一片 */
  padding: 8px 0;
  pointer-events: auto;
}

.ad-rail-right iframe {
  display: block;
  margin-left: auto;
  margin-right: auto;
  max-width: 100%;
}

@media (max-width: 1180px) {
  .ad-rail-right {
    display: none;
  }

  .page-shell {
    padding-right: 20px;
  }
}

.brand-link {
  text-decoration: none;
  color: inherit;
}

.brand {
  display: flex;
  gap: 14px;
  align-items: center;
}

.brand h1 {
  margin: 0;
  font-size: 1.5rem;
}

.brand p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.logo {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(145deg, #4a8dff, #35d7dc);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.52rem;
  line-height: 1.05;
  letter-spacing: 0;
}

.logo span:last-child {
  font-size: 0.5rem;
}

main {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 1120px;
  margin: 0;
  padding: 20px 0;
}

.site-footer {
  width: 100%;
  margin: 28px 0 0;
  padding: 0;
}

.footer-panel {
  background: rgba(23, 33, 53, 0.72);
  border: 1px solid rgba(52, 69, 106, 0.85);
  border-radius: 16px;
  padding: 18px 22px 20px;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.04) inset,
    0 16px 48px rgba(0, 0, 0, 0.22);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px 14px;
  font-size: 0.92rem;
  color: var(--muted);
}

.footer-links-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(158, 168, 188, 0.95);
}

.footer-links-label::before {
  content: "";
  width: 3px;
  height: 1rem;
  border-radius: 3px;
  background: linear-gradient(180deg, #4a8dff, #35d7dc);
  flex-shrink: 0;
}

.footer-link-row {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
}

.footer-links a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
  padding: 2px 0;
  border-bottom: 1px solid transparent;
  transition: color 0.14s ease, border-color 0.14s ease;
}

.footer-links a:hover {
  color: #6ba3ff;
  border-bottom-color: rgba(44, 124, 255, 0.45);
}

.footer-links-sep {
  color: rgba(52, 69, 106, 0.95);
  user-select: none;
  font-weight: 600;
}

.footer-meta {
  margin: 14px 0 0;
  padding-top: 14px;
  border-top: 1px solid rgba(52, 69, 106, 0.55);
  color: rgba(158, 168, 188, 0.82);
  font-size: 0.8rem;
  line-height: 1.5;
  letter-spacing: 0.02em;
}

.home h2 {
  margin: 12px 0 6px;
  font-size: 2rem;
}

.subtitle {
  color: var(--muted);
  margin-bottom: 24px;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.card,
.primary-btn,
.ghost-btn {
  border: none;
  cursor: pointer;
  color: inherit;
  font: inherit;
  transition: 0.14s ease;
}

.card {
  text-align: left;
  background: rgba(23, 33, 53, 0.92);
  border: 1px solid #34456a;
  border-radius: 14px;
  padding: 18px;
}

.card:hover {
  transform: translateY(-2px);
  border-color: #66a2ff;
  box-shadow: 0 10px 25px rgba(18, 65, 130, 0.25);
}

.card h3 {
  margin: 0 0 6px;
}

.card p {
  margin: 0;
  color: var(--muted);
}

.history-board {
  margin-top: 24px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.history-column {
  background: rgba(23, 33, 53, 0.8);
  border: 1px solid #34456a;
  border-radius: 12px;
  padding: 14px;
}

.history-column h3 {
  margin: 0 0 10px;
}

.history-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.history-list li {
  font-size: 0.92rem;
  color: #ced8ea;
  border-bottom: 1px dashed #374b73;
  padding-bottom: 6px;
}

.flow-step {
  animation: panel-in 0.2s ease;
}

.rule-list {
  margin: 10px 0 0;
  padding-left: 20px;
  color: #d6e4ff;
  line-height: 1.7;
}

.panel {
  background: rgba(23, 33, 53, 0.88);
  border: 1px solid #34456a;
  border-radius: 16px;
  padding: 24px;
  animation: panel-in 0.2s ease;
}

@keyframes panel-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.panel h2 {
  margin-top: 0;
}

.primary-btn {
  background: var(--primary);
  padding: 10px 18px;
  border-radius: 10px;
  margin-top: 14px;
}

.primary-btn:hover {
  background: var(--primary-hover);
}

.ghost-btn {
  background: transparent;
  border: 1px solid #4e6288;
  padding: 9px 16px;
  border-radius: 10px;
}

.ghost-btn:hover {
  border-color: #7e93bb;
}

.result {
  margin-top: 14px;
  min-height: 24px;
  color: #8ec5ff;
}

.meta-note {
  margin: 8px 0 0;
  font-size: 0.88rem;
  color: #9fb0cf;
}

.hidden {
  display: none !important;
}

.reaction-pad {
  margin-top: 14px;
  height: 260px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 1.25rem;
  user-select: none;
}

.reaction-pad.idle {
  background: #334d7c;
}

.reaction-pad.wait {
  background: var(--danger);
}

.reaction-pad.ready {
  background: var(--success);
}

.number-display {
  margin: 14px 0;
  min-height: 70px;
  border-radius: 12px;
  border: 1px solid #48618f;
  background: #101b30;
  display: grid;
  place-items: center;
  font-size: 2rem;
  letter-spacing: 0.2rem;
}

#numberInput {
  width: 240px;
  max-width: 100%;
  background: #101b30;
  color: var(--text);
  border: 1px solid #48618f;
  border-radius: 8px;
  padding: 10px 12px;
  margin-right: 8px;
}

.stat-row {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  color: #bed4ff;
}

.word-card {
  margin-top: 14px;
  min-height: 120px;
  border-radius: 12px;
  background: #101b30;
  border: 1px solid #48618f;
  display: grid;
  place-items: center;
  font-size: 2rem;
  text-transform: lowercase;
}

.actions {
  margin-top: 14px;
  display: flex;
  gap: 10px;
}

.grid {
  margin-top: 16px;
  width: min(360px, 100%);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.cell {
  aspect-ratio: 1;
  background: #101b30;
  border: 1px solid #48618f;
  border-radius: 10px;
  cursor: pointer;
}

.cell.active {
  background: #63acff;
}

.typing-prompt {
  margin: 14px 0 10px;
  line-height: 1.7;
  background: #101b30;
  border: 1px solid #48618f;
  border-radius: 12px;
  padding: 12px;
  color: #d8e6ff;
}

.typing-input {
  width: 100%;
  resize: vertical;
  border-radius: 10px;
  background: #0d1628;
  color: var(--text);
  border: 1px solid #48618f;
  padding: 12px;
  font: inherit;
}

.aim-arena {
  margin-top: 14px;
  border-radius: 12px;
  border: 1px solid #48618f;
  background: #101b30;
  position: relative;
  width: 100%;
  height: 360px;
  overflow: hidden;
}

.aim-target {
  position: absolute;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: #f1f5ff;
  border: 4px solid #ff5d73;
  margin: 0;
  padding: 0;
}

.aim-hint {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #a8bcdf;
}

.chimp-grid {
  margin-top: 14px;
  width: min(450px, 100%);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}

.chimp-cell {
  aspect-ratio: 1;
  border: 1px solid #48618f;
  border-radius: 10px;
  background: #101b30;
  display: grid;
  place-items: center;
  font-size: 1.1rem;
  cursor: pointer;
}

.chimp-cell.showing {
  background: #e9eef8;
  color: #0a1020;
  font-weight: 600;
}

.chimp-cell.correct {
  background: #2ca46d;
}

.chimp-cell.wrong {
  background: #e5484d;
}

.stats-table {
  margin-top: 12px;
  overflow-x: auto;
}

.stats-table table {
  width: 100%;
  border-collapse: collapse;
  min-width: 620px;
}

.stats-table th,
.stats-table td {
  text-align: left;
  border-bottom: 1px solid #30456f;
  padding: 10px 8px;
  color: #d7e4fb;
}

.stats-table th {
  color: #a8bce0;
  font-weight: 600;
}

@media (max-width: 560px) {
  .topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .word-card {
    font-size: 1.5rem;
  }

  .aim-arena {
    height: 300px;
  }
}

/* 反应区加高（全宽样式已在前面定义） */
.reaction-panel {
  min-height: 560px;
}

@media (max-width: 920px) {
  .reaction-panel {
    min-height: 480px;
  }
}

@media (max-width: 560px) {
  .reaction-panel {
    min-height: 420px;
  }
}

/* ==========================================================================
   打字测试页样式（原 typing.css，合并于此）
   ========================================================================== */
.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;
}
