:root {
  --bg: #fff9e8;
  --surface: #ffffff;
  --ink: #173044;
  --muted: #5f7180;
  --line: #c7e6f6;
  --primary: #2385e8;
  --primary-strong: #1661a6;
  --accent: #fff3c8;
  --danger: #d95757;
  --success: #35b978;
  --kid-salt-blue: #dff4ff;
  --kid-ice-pink: #ffe5f0;
  --kid-milk-yellow: #fff3c8;
  --kid-coral: #ff8a70;
  --kid-mint-soft: #eafcf4;
  --kid-sky-soft: #dff4ff;
  --kid-yellow-soft: #fff3c8;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Microsoft YaHei", "Segoe UI", sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

.topbar {
  align-items: center;
  background: linear-gradient(90deg, #e8f7ff 0%, #fff6d6 100%);
  border-bottom: 1px solid #c9e7f7;
  color: var(--ink);
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(180px, 1fr) auto minmax(180px, 1fr);
  min-height: 64px;
  padding: 0 32px;
}

.brand {
  align-items: center;
  color: var(--primary-strong);
  display: inline-flex;
  font-size: 20px;
  font-weight: 700;
  gap: 12px;
  justify-self: start;
}

.brand-logo {
  background: transparent;
  border: 0;
  border-radius: 8px;
  height: 46px;
  object-fit: contain;
  padding: 0;
  width: 46px;
}

.topbar-title {
  color: #153449;
  font-size: clamp(22px, 1.8vw, 32px);
  font-weight: 1000;
  justify-self: center;
  letter-spacing: 0.08em;
  line-height: 1;
  max-width: min(58vw, 820px);
  overflow: hidden;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.page-shell {
  margin: 0 auto;
  max-width: 1440px;
  padding: 32px;
}

.page-heading {
  align-items: center;
  display: flex;
  gap: 24px;
  justify-content: space-between;
  margin-bottom: 28px;
}

.page-toolbar {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: flex-start;
  margin-bottom: 18px;
}

.page-heading h1,
.presentation-board h1,
.interaction-heading h1 {
  font-size: 42px;
  line-height: 1.1;
  margin: 4px 0 8px;
}

.eyebrow,
.tag {
  color: var(--primary);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0;
  margin: 0;
}

.muted,
.summary {
  color: var(--muted);
}

.primary-action,
.secondary-action,
.ghost-action,
.touch-choice {
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  font-weight: 700;
  justify-content: center;
  min-height: 48px;
  padding: 14px 20px;
  transition: transform 120ms ease, background 120ms ease;
}

.primary-action {
  background: var(--primary);
  color: #fff;
}

.primary-action:hover,
.touch-choice:hover {
  transform: translateY(-1px);
}

.secondary-action {
  background: var(--kid-sky-soft);
  color: var(--primary-strong);
}

.ghost-action {
  background: var(--kid-yellow-soft);
  color: var(--primary-strong);
}

.content-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.content-card,
.empty-state,
.form-panel,
.activity-box,
.lesson-block,
.login-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 24px;
}

.content-card {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-height: 260px;
}

.content-card h2 {
  font-size: 28px;
  margin: 8px 0;
}

.card-meta {
  color: var(--muted);
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: auto;
}

.ppt-path {
  overflow-wrap: anywhere;
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.editor-layout {
  align-items: start;
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
}

.form-stack,
.form-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-panel input,
.form-panel select,
.form-panel textarea,
.login-panel input {
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 44px;
  padding: 10px 12px;
  width: 100%;
}

.activity-row {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
}

.auth-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
}

.login-panel {
  max-width: 460px;
  width: calc(100% - 32px);
}

.presentation-board {
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(0, 1.4fr) minmax(360px, 0.6fr);
}

.presentation-main,
.interaction-panel {
  min-width: 0;
}

.course-meta-strip,
.rhythm-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 18px 0;
}

.course-meta-strip span,
.rhythm-step {
  background: var(--kid-sky-soft);
  border: 1px solid #b9def5;
  border-radius: 8px;
  color: var(--primary-strong);
  font-weight: 700;
  padding: 12px 14px;
}

.rhythm-step {
  align-items: center;
  display: inline-flex;
  flex-direction: column;
  min-height: 78px;
  min-width: 150px;
}

.rhythm-step span {
  color: var(--muted);
  font-size: 14px;
  margin-top: 4px;
}

.rhythm-active {
  background: var(--kid-yellow-soft);
  border-color: var(--accent);
}

.jump-action {
  font-size: 24px;
  margin-bottom: 20px;
  min-height: 72px;
  min-width: 240px;
}

.demo-layout {
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(420px, 0.9fr) minmax(320px, 1.1fr);
}

.board-placeholder {
  background: #f5fbff;
  border: 2px solid #b9def5;
  border-radius: 8px;
  color: var(--ink);
  padding: 18px;
}

.board-grid {
  aspect-ratio: 1;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  overflow: hidden;
  border-radius: 6px;
}

.board-grid span {
  background: #fff7cf;
}

.board-grid span:nth-child(16n + 2),
.board-grid span:nth-child(16n + 4),
.board-grid span:nth-child(16n + 6),
.board-grid span:nth-child(16n + 8),
.board-grid span:nth-child(16n + 9),
.board-grid span:nth-child(16n + 11),
.board-grid span:nth-child(16n + 13),
.board-grid span:nth-child(16n + 15) {
  background: #8fd7ff;
}

.board-caption {
  font-size: 20px;
  font-weight: 700;
  padding-top: 10px;
  text-align: center;
}

.lesson-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.lesson-video {
  background: #e4f6ff;
  border: 2px dashed #93ccef;
  border-radius: 8px;
  min-height: 220px;
  width: 100%;
}

.asset-path {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.interaction-panel {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.interaction-panel h2 {
  font-size: 32px;
  margin: 0;
}

.student-interaction-page {
  max-width: 1200px;
}

.interaction-heading {
  margin-bottom: 22px;
}

.student-activity-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
}

.student-activity-box h2 {
  font-size: 34px;
  margin: 10px 0;
}

.activity-prompt {
  font-size: 24px;
  margin: 0 0 18px;
}

.touch-choice-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.touch-choice {
  background: var(--primary);
  color: #fff;
  font-size: 26px;
  min-height: 96px;
  width: 100%;
}

.feedback-slot {
  min-height: 92px;
}

.feedback-card {
  border-radius: 8px;
  font-size: 22px;
  padding: 18px;
}

.feedback-card strong {
  display: block;
  font-size: 28px;
  margin-bottom: 8px;
}

.feedback-success {
  background: var(--kid-mint-soft);
  border: 2px solid var(--success);
}

.feedback-retry {
  background: var(--kid-yellow-soft);
  border: 2px solid var(--accent);
}

pre {
  overflow-x: auto;
  white-space: pre-wrap;
}

@media (max-width: 1100px) {
  .presentation-board,
  .demo-layout,
  .editor-layout {
    grid-template-columns: 1fr;
  }
}

/* Classroom console layout */
:root {
  --topbar-height: 64px;
  --sidebar-width: 220px;
  --sidebar-collapsed-width: 76px;
  --panel-width: 420px;
  --stage-panel-width: 420px;
  --blue: #2385e8;
  --yellow: #fff3c8;
  --kid-mint: #ffe5f0;
  --kid-sky: #dff4ff;
  --kid-cream: #fff3c8;
}

body {
  height: 100vh;
  overflow: hidden;
}

.topbar {
  height: var(--topbar-height);
  min-height: var(--topbar-height);
}

.topbar-status {
  color: #547086;
  font-weight: 700;
  grid-column: 3;
  justify-self: end;
}

.topbar-home-link {
  align-items: center;
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(126, 207, 255, 0.72);
  border-radius: 999px;
  color: #1661a6;
  display: inline-flex;
  font-size: 16px;
  font-weight: 900;
  min-height: 34px;
  padding: 7px 14px;
}

.topbar-home-link:hover {
  background: #ffffff;
  color: #2385e8;
}

.app-frame {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  height: calc(100vh - var(--topbar-height));
  overflow: hidden;
}

.app-stage .app-frame {
  grid-template-columns: var(--sidebar-collapsed-width) minmax(0, 1fr);
}

.page-shell {
  height: 100%;
  margin: 0;
  max-width: none;
  min-width: 0;
  overflow: hidden;
  padding: 24px;
}

.app-home .page-shell {
  padding: 0;
}

/* 首页内容高度随视口和轮播内容变化，避免移动端被固定画布裁切。 */
body.app-home {
  height: auto;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  overflow-y: auto;
}

.app-home .app-frame {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  height: auto;
  min-height: calc(100vh - var(--topbar-height));
  min-height: calc(100dvh - var(--topbar-height));
  overflow: visible;
}

.app-home .page-shell {
  height: auto;
  min-height: calc(100vh - var(--topbar-height));
  min-height: calc(100dvh - var(--topbar-height));
  overflow: visible;
}

/* 国象历史视频课 */
.app-history-video .page-shell {
  background:
    linear-gradient(140deg, rgba(241, 209, 149, 0.42), transparent 36%),
    linear-gradient(220deg, rgba(126, 207, 255, 0.26), transparent 42%),
    #edf7f4;
  overflow: hidden;
  padding: clamp(20px, 3cqi, 40px);
}

.history-video-page {
  container-type: inline-size;
  display: grid;
  gap: clamp(14px, 1.8cqi, 24px);
  grid-template-rows: auto minmax(0, 1fr);
  height: 100%;
  margin: 0 auto;
  max-width: 1180px;
  min-height: 0;
}

.history-video-header {
  justify-self: center;
  text-align: center;
}

.history-video-header h1 {
  color: #163e46;
  font-size: clamp(28px, 3.2cqi, 42px);
  font-weight: 900;
  line-height: 1.08;
  margin: 0;
  text-wrap: balance;
}

.history-video-player {
  align-items: start;
  display: grid;
  justify-content: center;
  min-height: 0;
  width: 100%;
}

.history-video-media {
  aspect-ratio: 16 / 9;
  background: #101b1d;
  border: 7px solid #fffdf4;
  border-radius: 8px;
  box-shadow: 0 20px 44px rgba(22, 62, 70, 0.22);
  height: 100%;
  max-width: 100%;
  overflow: hidden;
  position: relative;
  width: auto;
}

.history-video {
  background: #101b1d;
  display: block;
  height: 100%;
  object-fit: contain;
  width: 100%;
}

.history-video-play {
  align-items: center;
  background: rgba(255, 253, 244, 0.94);
  border: 0;
  border-radius: 50%;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.28);
  cursor: pointer;
  display: inline-flex;
  height: clamp(58px, 8cqi, 84px);
  justify-content: center;
  left: 50%;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  transition: background 160ms ease, transform 160ms ease;
  width: clamp(58px, 8cqi, 84px);
}

.history-video-play:hover,
.history-video-play:focus-visible {
  background: #ffffff;
  transform: translate(-50%, -50%) scale(1.06);
}

.history-video-play:active {
  transform: translate(-50%, -50%) scale(0.98);
}

.history-video-play-icon {
  border-bottom: clamp(10px, 1.5cqi, 16px) solid transparent;
  border-left: clamp(16px, 2.3cqi, 24px) solid #176fbc;
  border-top: clamp(10px, 1.5cqi, 16px) solid transparent;
  margin-left: 5%;
}

.history-video-player[data-video-state="playing"] .history-video-play {
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0.88);
}

.history-video-error {
  background: rgba(73, 33, 19, 0.9);
  bottom: 0;
  color: #fffdf4;
  font-size: clamp(14px, 2.2cqi, 18px);
  font-weight: 700;
  left: 0;
  margin: 0;
  padding: 10px 16px;
  position: absolute;
  right: 0;
}

.history-video-unavailable {
  align-items: center;
  background: rgba(255, 253, 244, 0.8);
  border: 1px solid rgba(22, 111, 188, 0.28);
  border-radius: 8px;
  color: #163e46;
  display: flex;
  font-size: 18px;
  font-weight: 800;
  min-height: 260px;
  padding: 24px;
}

.classroom-sidebar {
  background: linear-gradient(180deg, #dff4ff 0%, #fff3c8 62%, #ffe5f0 100%);
  border-right: 1px solid #bddff2;
  color: #153449;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  height: 100%;
  overflow: hidden;
  padding: 14px 12px;
  position: relative;
  z-index: 8;
}

.sidebar-zone {
  min-width: 0;
}

.icon-row {
  display: flex;
  gap: 10px;
  justify-content: center;
  position: relative;
}

.icon-tool-form {
  display: inline-flex;
  margin: 0;
}

.sidebar-tools-top {
  padding-bottom: 12px;
}

.sidebar-tools-bottom {
  padding-top: 12px;
}

.icon-tool,
.course-directory-item {
  align-items: center;
  border: 0;
  border-radius: 8px;
  color: inherit;
  cursor: pointer;
  display: grid;
  font-weight: 700;
  gap: 10px;
  grid-template-columns: 44px minmax(0, 1fr);
  min-height: 56px;
  padding: 8px 10px;
  text-align: left;
}

.icon-row .icon-tool {
  background: transparent;
  border: 0;
  box-shadow: none;
  grid-template-columns: 48px;
  min-height: 56px;
  padding: 4px;
  position: relative;
  width: 56px;
}

.tool-icon,
.course-icon {
  align-items: center;
  background: var(--kid-sky);
  border-radius: 8px;
  display: inline-flex;
  font-size: 22px;
  height: 44px;
  justify-content: center;
  width: 44px;
}

.icon-sprite {
  height: 0;
  position: absolute;
  width: 0;
}

.svg-icon {
  display: block;
  fill: none;
  height: 1em;
  overflow: visible;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.35;
  width: 1em;
}

.function-icon {
  display: block;
  height: 1em;
  object-fit: contain;
  width: 1em;
}

/* 新增按钮 SVG 使用蒙版统一着色，保留素材轮廓并保证各处视觉一致。 */
.button-svg-icon {
  --button-icon-color: #2385e8;
  -webkit-mask: var(--button-svg-mask) center / contain no-repeat;
  background: var(--button-icon-color);
  display: block;
  filter: drop-shadow(0 2px 1px rgba(17, 64, 92, 0.28));
  height: 100%;
  mask: var(--button-svg-mask) center / contain no-repeat;
  width: 100%;
}

.button-svg-icon-home,
.button-svg-icon-topic-prev,
.button-svg-icon-rook-previous-lecture {
  --button-icon-color: #2385e8;
}

.button-svg-icon-fullscreen,
.button-svg-icon-piece-style {
  --button-icon-color: #d89517;
}

.button-svg-icon-settings,
.button-svg-icon-topic-reset,
.button-svg-icon-rook-lecture-reset {
  --button-icon-color: #d85b8c;
}

.button-svg-icon-logout {
  --button-icon-color: #d95757;
}

.button-svg-icon-topic-next {
  --button-icon-color: #7b61d9;
}

.button-svg-icon-rook-example {
  --button-icon-color: #2e9b62;
}

.button-svg-icon-start-answer,
.button-svg-icon-function-check,
.button-svg-icon-next-question {
  --button-icon-color: #2e9b62;
}

.svg-icon-fill,
.svg-icon-soft-fill {
  fill: currentColor;
  opacity: 0.2;
  stroke: none;
}

.svg-icon-dot {
  fill: currentColor;
  opacity: 0.72;
  stroke: none;
}

.tool-icon .svg-icon,
.course-icon .svg-icon {
  font-size: 25px;
}

.tool-icon .function-icon {
  height: 44px;
  width: 44px;
}

.course-icon .course-group-icon {
  display: block;
  height: 28px;
  object-fit: contain;
  width: 28px;
}

.course-submenu-icon .svg-icon {
  font-size: 25px;
}

.course-submenu-icon .course-menu-icon {
  display: block;
  filter: saturate(1.1) contrast(1.05) drop-shadow(0 1px 1px rgba(20, 57, 74, 0.2));
  height: 30px;
  object-fit: contain;
  width: 30px;
}

.course-icon {
  background: transparent;
}

.icon-row .tool-icon {
  background: transparent;
}

.tool-home .tool-icon {
  color: #2385e8;
}

.tool-fullscreen .tool-icon {
  color: #d49a18;
}

.tool-settings .tool-icon {
  color: #d85b8c;
}

.tool-custom-board .tool-icon {
  color: #30a66a;
}

.tool-return-course .tool-icon {
  color: #7b61d9;
}

.tool-logout .tool-icon {
  color: #e36b7d;
}

.icon-row .icon-tool::after {
  background: #2f6fbd;
  border-radius: 8px;
  color: #fff;
  content: attr(data-tooltip);
  font-size: 14px;
  font-weight: 800;
  left: 50%;
  opacity: 0;
  padding: 8px 10px;
  pointer-events: none;
  position: absolute;
  top: calc(100% + 8px);
  transform: translateX(-50%) translateY(-4px);
  transition: opacity 120ms ease, transform 120ms ease;
  white-space: nowrap;
  z-index: 30;
}

.icon-row .icon-tool:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.sidebar-tools-bottom .icon-tool::after {
  bottom: calc(100% + 8px);
  top: auto;
  transform: translateX(-50%) translateY(4px);
}

.sidebar-tools-bottom .icon-tool:hover::after {
  transform: translateX(-50%) translateY(0);
}

.course-directory {
  border-bottom: 1px solid #bddff2;
  border-top: 1px solid #bddff2;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: hidden auto;
  padding: 12px 0;
}

.sidebar-label {
  color: #547086;
  font-size: 13px;
  font-weight: 700;
  margin: 0 10px 4px;
}

.course-directory-item {
  --course-accent: #2385e8;
  background: rgba(255, 255, 255, 0.78);
  border: 0;
  border-left: 7px solid var(--course-accent);
  box-shadow: 0 8px 18px rgba(35, 133, 232, 0.08);
  font-family: inherit;
  font-size: 20px;
  font-weight: 800;
  line-height: 1.2;
}

.course-group-history {
  --course-accent: #d49a18;
  background: linear-gradient(90deg, rgba(255, 243, 200, 0.96) 0%, rgba(255, 255, 255, 0.78) 100%);
}

.course-group-pieces {
  --course-accent: #d85b8c;
  background: linear-gradient(90deg, rgba(255, 229, 240, 0.98) 0%, rgba(255, 255, 255, 0.78) 100%);
}

.course-group-basic-knowledge {
  --course-accent: #2385e8;
  background: linear-gradient(90deg, rgba(223, 244, 255, 0.98) 0%, rgba(255, 255, 255, 0.78) 100%);
}

.course-group-skill-progression {
  --course-accent: #7b61d9;
  background: linear-gradient(90deg, rgba(242, 236, 255, 0.98) 0%, rgba(255, 255, 255, 0.78) 100%);
}

.course-group-basic-skills {
  --course-accent: #30a66a;
  background: linear-gradient(90deg, rgba(234, 252, 244, 0.98) 0%, rgba(255, 255, 255, 0.78) 100%);
}

.course-group-beginner-tactics {
  --course-accent: #c45a1a;
  background: linear-gradient(90deg, rgba(255, 237, 220, 0.98) 0%, rgba(255, 255, 255, 0.78) 100%);
}

.course-group-advanced-tactics {
  --course-accent: #087f8c;
  background: linear-gradient(90deg, rgba(221, 246, 248, 0.98) 0%, rgba(255, 255, 255, 0.78) 100%);
}

.course-directory-item:hover,
.icon-tool:hover {
  filter: brightness(0.98);
}

.course-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-stage .classroom-sidebar {
  padding-left: 10px;
  padding-right: 10px;
}

.app-stage .icon-row {
  align-items: center;
  flex-direction: column;
}

.app-stage .sidebar-label,
.app-stage .course-title,
.app-stage .icon-tool span:not(.tool-icon) {
  display: none;
}

.app-stage .icon-tool,
.app-stage .course-directory-item {
  grid-template-columns: 44px;
  justify-content: center;
  padding: 8px 6px;
}

.course-panel-layer {
  inset: var(--topbar-height) auto auto 0;
  pointer-events: none;
  position: fixed;
  z-index: 12;
}

.course-panel {
  background: rgba(255, 249, 238, 0.96);
  border: 0;
  border-radius: 0 22px 22px 0;
  box-shadow: 14px 12px 30px rgba(35, 133, 232, 0.16);
  display: none;
  flex-direction: column;
  gap: 0;
  height: auto;
  left: var(--sidebar-width);
  max-height: calc(100vh - var(--course-panel-top, calc(var(--topbar-height) + 52px)) - 16px);
  min-width: 205px;
  padding: 12px;
  position: fixed;
  top: var(--course-panel-top, calc(var(--topbar-height) + 52px));
  width: 205px;
}

.app-stage .course-panel {
  left: var(--sidebar-collapsed-width);
}

.course-panel:target,
.course-panel.is-open {
  display: flex;
  pointer-events: auto;
}

.course-panel-body {
  color: var(--ink);
  font-size: 20px;
  line-height: 1.2;
  overflow: hidden auto;
}

.course-submenu {
  display: grid;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.course-submenu-item {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 14px;
  color: #153449;
  cursor: pointer;
  display: flex;
  gap: 12px;
  font: inherit;
  font-weight: 800;
  min-height: 46px;
  padding: 9px 12px;
  text-align: left;
  text-decoration: none;
  width: 100%;
}

.course-submenu-icon {
  color: #2385e8;
  display: inline-flex;
  flex: 0 0 32px;
  font-size: 24px;
  justify-content: center;
}

.course-submenu-title {
  min-width: 0;
}

.course-submenu-title-four-and-half-wide {
  display: inline-block;
  text-align: justify;
  text-align-last: justify;
  width: 4.5em;
}

.course-submenu li:nth-child(2n) .course-submenu-icon {
  color: #d85b8c;
}

.course-submenu li:nth-child(3n) .course-submenu-icon {
  color: #d49a18;
}

.course-submenu li:nth-child(4n) .course-submenu-icon {
  color: #30a66a;
}

.course-submenu li:nth-child(5n) .course-submenu-icon {
  color: #7b61d9;
}

.course-submenu-item:hover {
  background: rgba(223, 244, 255, 0.82);
}

.course-panel-empty {
  font-weight: 800;
  margin: 0;
  padding: 12px 16px;
}

.panel-action,
.stage-action,
.stage-panel-actions button {
  align-items: center;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  font-weight: 800;
  justify-content: center;
  min-height: 64px;
  padding: 14px 18px;
}

.panel-action,
.stage-action-strong,
.stage-panel-actions button {
  background: var(--primary);
  color: #fff;
}

.panel-action.interaction-tab,
.stage-action {
  background: var(--kid-mint);
  color: var(--primary-strong);
}

.home-stage {
  display: block;
  min-height: calc(100vh - var(--topbar-height));
  min-height: calc(100dvh - var(--topbar-height));
}

.photo-carousel {
  background: linear-gradient(120deg, #fff3c8 0%, #dff4ff 48%, #ffe5f0 100%);
  border-radius: 0;
  color: #153449;
  display: block;
  height: auto;
  min-height: inherit;
  overflow: hidden;
  padding: 36px;
  position: relative;
}

.photo-carousel::before {
  background:
    radial-gradient(circle at 12% 18%, rgba(255, 229, 240, 0.78) 0 90px, transparent 92px),
    radial-gradient(circle at 82% 12%, rgba(255, 243, 200, 0.82) 0 110px, transparent 112px),
    linear-gradient(90deg, rgba(35, 133, 232, 0.08) 1px, transparent 1px),
    linear-gradient(0deg, rgba(35, 133, 232, 0.08) 1px, transparent 1px);
  background-size: auto, auto, 72px 72px, 72px 72px;
  content: "";
  inset: 0;
  position: absolute;
}

.carousel-slide {
  align-items: center;
  display: grid;
  gap: 30px;
  grid-template-columns: minmax(0, 0.72fr) minmax(0, 1.28fr);
  inset: 0;
  opacity: 0;
  padding: 46px 48px;
  position: absolute;
  transition: opacity 600ms ease;
  z-index: 1;
}

.carousel-slide.is-active {
  opacity: 1;
  z-index: 2;
}

.carousel-copy {
  max-width: 620px;
  min-width: 0;
}

.carousel-copy .eyebrow {
  color: #2385e8;
  font-size: clamp(22px, 2vw, 26px);
  font-weight: 900;
  line-height: 1.1;
  margin: 0 0 6px;
}

.carousel-copy h1 {
  color: #153449;
  font-size: clamp(40px, 4.8vw, 64px);
  font-weight: 900;
  line-height: 1.03;
  margin: 8px 0 16px;
  white-space: nowrap;
}

.carousel-copy > p:not(.eyebrow) {
  color: #0b4f7d;
  font-size: clamp(24px, 2.3vw, 30px);
  font-weight: 800;
  line-height: 1.2;
  margin: 0 0 8px;
  white-space: nowrap;
}

.carousel-copy span {
  color: #547086;
  display: block;
  font-size: clamp(18px, 1.6vw, 24px);
  font-weight: 700;
  line-height: 1.35;
  max-width: 540px;
  white-space: nowrap;
}

.home-start-action {
  align-items: center;
  align-self: flex-start;
  background: transparent;
  border: 0;
  box-shadow: none;
  color: #1661a6;
  display: inline-flex;
  font-size: 20px;
  font-weight: 900;
  justify-content: center;
  line-height: 1;
  margin-top: 18px;
  min-height: 32px;
  padding: 2px 0;
  text-decoration: underline;
  text-decoration-thickness: 3px;
  text-underline-offset: 6px;
  transition: color 160ms ease;
}

.home-start-action:focus-visible {
  color: #2385e8;
  outline: 2px solid #1661a6;
  outline-offset: 4px;
}

@media (max-width: 1100px) {
  .photo-carousel { padding: 24px; }
  .carousel-slide { gap: 20px; }
  .carousel-copy .eyebrow { font-size: clamp(20px, 2vw, 24px); }
  .carousel-copy h1 { font-size: clamp(32px, 4.8vw, 52px); }
  .carousel-copy > p:not(.eyebrow) { font-size: clamp(20px, 2.3vw, 28px); }
  .carousel-copy span { font-size: clamp(16px, 1.6vw, 21px); }
  .home-start-action { font-size: 18px; margin-top: 14px; min-height: 30px; padding: 2px 0; }
}

.carousel-photo {
  align-self: center;
  aspect-ratio: 4 / 3;
  background: #fff;
  border: 8px solid rgba(255, 255, 255, 0.82);
  border-radius: 8px;
  box-shadow: 0 18px 34px rgba(35, 133, 232, 0.14);
  height: auto;
  margin: 0;
  overflow: hidden;
  position: relative;
  width: min(100%, 88vh, 980px);
}

.carousel-photo img {
  display: block;
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.carousel-picture {
  display: block;
  height: 100%;
  width: 100%;
}

.carousel-strip {
  align-items: center;
  bottom: 26px;
  display: flex;
  gap: 0;
  position: absolute;
  right: 30px;
  z-index: 3;
}

.carousel-tabs {
  align-items: flex-start;
  display: inline-flex;
  gap: 18px;
}

.carousel-tab {
  appearance: none;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  color: #153449;
  cursor: pointer;
  display: inline-flex;
  align-items: flex-start;
  justify-content: center;
  font-family: inherit;
  font-size: 22px;
  font-weight: 900;
  line-height: 1;
  min-height: 42px;
  padding: 0 0 8px;
  position: relative;
  transition: color 160ms ease;
}

.carousel-tab:hover {
  color: #2385e8;
}

.carousel-tab.is-active {
  background: transparent;
  color: #2385e8;
}

.carousel-tab.is-active::after {
  background: #2385e8;
  bottom: 0;
  content: "";
  height: 4px;
  left: 0;
  position: absolute;
  right: 0;
}

.carousel-autoplay-control {
  align-items: flex-start;
  appearance: none;
  background: transparent;
  border: 0;
  border-left: 2px solid rgba(21, 52, 73, 0.2);
  border-radius: 0;
  box-shadow: none;
  color: #8a6215;
  cursor: pointer;
  display: inline-flex;
  font-family: inherit;
  font-size: 22px;
  font-weight: 900;
  line-height: 1;
  margin-left: 22px;
  min-height: 42px;
  padding: 0 0 0 18px;
  transition: color 160ms ease;
}

.carousel-autoplay-control:hover {
  color: #6f4d09;
}

.carousel-tab:focus-visible,
.carousel-autoplay-control:focus-visible {
  outline: 3px solid #153449;
  outline-offset: 3px;
}

@media (max-width: 700px) {
  .app-home .app-frame {
    display: block;
  }

  .photo-carousel {
    min-height: 0;
    overflow: visible;
    padding: 0;
  }

  .carousel-slide {
    align-content: start;
    gap: 14px;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto;
    inset: auto;
    min-height: calc(100vh - var(--topbar-height));
    min-height: calc(100dvh - var(--topbar-height));
    padding: 22px 18px 70px;
    position: relative;
  }

  .carousel-slide:not(.is-active) {
    display: none;
  }

  .carousel-slide.is-active {
    display: grid;
    opacity: 1;
  }

  .carousel-copy { max-width: none; }

  .carousel-copy .eyebrow {
    font-size: 18px;
    margin-bottom: 4px;
  }

  .carousel-copy h1 {
    font-size: clamp(30px, 10vw, 40px);
    white-space: normal;
  }

  .carousel-copy > p:not(.eyebrow) {
    font-size: 18px;
    white-space: normal;
  }

  .carousel-copy span {
    font-size: 16px;
    white-space: normal;
  }

  .home-start-action {
    font-size: 17px;
    margin-top: 10px;
  }

  .carousel-photo {
    align-self: start;
    border-width: 5px;
    width: 100%;
  }

  .carousel-strip {
    bottom: 14px;
    right: 14px;
  }

  .carousel-tabs { gap: 12px; }

  .carousel-tab {
    font-size: 16px;
    min-height: 34px;
    padding-bottom: 6px;
  }

  .carousel-autoplay-control {
    font-size: 16px;
    margin-left: 14px;
    min-height: 34px;
    padding-left: 12px;
  }
}

.stage-console {
  display: grid;
  gap: 20px;
  grid-template-columns: minmax(0, 1fr) var(--stage-panel-width);
  height: 100%;
  overflow: hidden;
}

.tab-radio {
  display: none;
}

.board-stage,
.stage-panel {
  min-height: 0;
  min-width: 0;
}

.board-stage {
  background: linear-gradient(135deg, #dff4ff 0%, #fff3c8 56%, #ffe5f0 100%);
  border-radius: 8px;
  color: #153449;
  overflow: hidden;
  padding: 22px;
  position: relative;
}

.stage-menu-trigger {
  background: #ffffff;
  border: 1px solid #bfe2f5;
  border-radius: 8px;
  font-weight: 800;
  left: 22px;
  min-height: 52px;
  padding: 14px 18px;
  position: absolute;
  top: 22px;
  z-index: 2;
}

.board-mode {
  display: none;
  height: 100%;
  padding-top: 58px;
}

#teacher-tab:checked ~ .board-stage .board-mode-teaching,
#interaction-tab:checked ~ .board-stage .board-mode-interaction {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
}

.board-mode h1 {
  font-size: 44px;
  line-height: 1.05;
  margin: 6px 0 18px;
}

.board-stage .board-placeholder {
  align-self: center;
  justify-self: center;
  max-height: calc(100% - 12px);
  max-width: 760px;
  width: min(100%, 50vh);
}

.board-placeholder-active {
  outline: 4px solid var(--yellow);
}

.stage-panel {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}

.tab-control {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 14px;
}

.tab-button {
  align-items: center;
  background: var(--kid-sky-soft);
  border-radius: 8px;
  color: var(--primary-strong);
  cursor: pointer;
  display: inline-flex;
  font-size: 20px;
  font-weight: 900;
  justify-content: center;
  min-height: 64px;
}

#teacher-tab:checked ~ .stage-panel .tab-button-teacher,
#interaction-tab:checked ~ .stage-panel .tab-button-interaction {
  background: var(--primary);
  color: #fff;
}

.tab-page {
  display: none;
  min-height: 0;
}

#teacher-tab:checked ~ .stage-panel .tab-page-teacher,
#interaction-tab:checked ~ .stage-panel .tab-page-interaction {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
}

.stage-panel-body {
  overflow: hidden auto;
  padding: 10px 22px 18px;
}

.stage-panel-body h2 {
  font-size: 30px;
  line-height: 1.18;
  margin: 10px 0 16px;
}

.rhythm-line {
  display: grid;
  gap: 8px;
}

.rhythm-line span {
  background: #fffdf6;
  border-left: 6px solid var(--yellow);
  border-radius: 8px;
  font-weight: 800;
  padding: 12px 14px;
}

.stage-panel-actions {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr 1fr;
  padding: 14px;
}

.stage-panel-actions button {
  font-size: 18px;
}

.stage-panel .touch-choice-grid {
  grid-template-columns: 1fr 1fr;
}

.stage-panel .touch-choice {
  min-height: 88px;
}

@media (max-width: 1180px) {
  .app-frame,
  .app-stage .app-frame {
    grid-template-columns: var(--sidebar-collapsed-width) minmax(0, 1fr);
  }

  .course-panel {
    left: var(--sidebar-collapsed-width);
  }

  .stage-console {
    grid-template-columns: minmax(0, 1fr) 360px;
  }
}

/* 识别棋子：图片轮播、标准棋子与初始摆放。 */
.piece-intro-gallery {
  align-items: center;
  background: #e8f4fb;
  border: 1px solid #74bce9;
  border-radius: 8px;
  box-shadow: 0 16px 34px rgba(21, 52, 73, 0.28);
  display: grid;
  inset: 8%;
  opacity: 0;
  padding: 16px 58px;
  pointer-events: none;
  position: absolute;
  transform: scale(0.96);
  transition: opacity 220ms ease, transform 220ms ease;
  z-index: 5;
}

.piece-intro-gallery.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1);
}

.piece-intro-gallery-stage,
.piece-intro-gallery-slide {
  height: 100%;
  margin: 0;
  min-height: 0;
}

.piece-intro-gallery-slide {
  display: none;
  grid-template-rows: minmax(0, 1fr) auto;
}

.piece-intro-gallery-slide.is-active { display: grid; }

.piece-intro-gallery-slide img {
  height: 100%;
  max-height: 100%;
  object-fit: contain;
  width: 100%;
}

.piece-intro-gallery-slide figcaption {
  border-top: 1px solid #bfe2f5;
  color: #153449;
  font-size: 17px;
  font-weight: 800;
  padding-top: 10px;
  text-align: center;
}

.piece-intro-gallery-control {
  align-items: center;
  background: #153449;
  border: 0;
  border-radius: 10px;
  box-shadow: 0 6px 12px rgba(21, 52, 73, 0.22);
  color: #ffffff;
  cursor: pointer;
  display: flex;
  font-size: 42px;
  font-weight: 400;
  height: 64px;
  justify-content: center;
  line-height: 0.8;
  padding: 0 0 6px;
  position: absolute;
  top: calc(50% - 32px);
  width: 48px;
}

.piece-intro-gallery-prev { left: 10px; }
.piece-intro-gallery-next { right: 10px; }

.piece-intro-gallery-close {
  align-items: center;
  background: #153449;
  border: 0;
  border-radius: 10px;
  box-shadow: 0 6px 12px rgba(21, 52, 73, 0.22);
  color: #ffffff;
  cursor: pointer;
  display: flex;
  font-size: 28px;
  font-weight: 700;
  height: 44px;
  justify-content: center;
  line-height: 1;
  padding: 0 0 3px;
  position: absolute;
  right: 10px;
  top: 10px;
  width: 44px;
  z-index: 1;
}

.piece-intro-gallery-control:hover,
.piece-intro-gallery-control:focus-visible,
.piece-intro-gallery-close:hover,
.piece-intro-gallery-close:focus-visible {
  background: #0f558b;
  outline: 3px solid rgba(255, 184, 61, 0.82);
  outline-offset: 2px;
}

.piece-intro-board-piece,
.piece-intro-workbench-piece {
  align-items: center;
  background: transparent;
  border: 0;
  cursor: pointer;
  display: flex;
  justify-content: center;
  padding: 0;
  transition: opacity 260ms ease, transform 260ms ease;
}

.piece-intro-board-piece {
  height: 38%;
  left: 31%;
  position: absolute;
  top: 31%;
  width: 38%;
  z-index: 4;
}

.piece-intro-board-piece .chess-piece { height: 100%; width: 100%; }

.piece-intro-layout .lesson-console-topic-pages {
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  margin-top: 0;
  overflow: hidden;
}

.piece-intro-layout .lesson-console-topic-page.is-active {
  align-items: center;
  display: grid;
  gap: 12px;
  grid-template-rows: auto minmax(0, 1fr);
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.piece-intro-workbench-piece {
  --piece-intro-workbench-max-size: min(
    408px,
    calc(var(--board-intro-panel-width) - 52px)
  );
  aspect-ratio: 1;
  height: min(100%, var(--piece-intro-workbench-max-size));
  margin: 0 auto;
  max-height: 100%;
  max-width: 100%;
  transform-origin: center;
  width: auto;
}

.piece-intro-workbench-piece .chess-piece { height: 100%; width: 100%; }

.piece-intro-workbench-gallery {
  background: transparent;
  border: 0;
  border-radius: 0;
  display: grid;
  overflow: hidden;
  padding: 0 34px 28px;
  position: relative;
}

.piece-intro-workbench-gallery-stage,
.piece-intro-workbench-slide {
  height: 100%;
  margin: 0;
  min-height: 0;
}

.piece-intro-workbench-slide {
  align-items: center;
  display: none;
  grid-template-rows: minmax(0, 1fr);
}

.piece-intro-workbench-slide.is-active { display: grid; }

.piece-intro-workbench-slide img {
  height: 100%;
  max-height: 100%;
  object-fit: contain;
  width: 100%;
}

.piece-intro-workbench-gallery-control {
  align-items: center;
  background: #153449;
  border: 0;
  border-radius: 6px;
  color: #ffffff;
  cursor: pointer;
  display: flex;
  font-size: 24px;
  height: 34px;
  justify-content: center;
  line-height: 1;
  padding: 0 0 3px;
  position: absolute;
  top: calc(50% - 17px);
  width: 26px;
}

.piece-intro-workbench-gallery-prev { left: 4px; }
.piece-intro-workbench-gallery-next { right: 4px; }

.piece-intro-board-piece.is-hidden,
.piece-intro-workbench-piece.is-hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px) scale(0.82);
}

.piece-intro-board-piece:not(.is-hidden) { animation: pieceIntroFadeIn 360ms ease both; }
.piece-intro-workbench-piece:not(.is-hidden) { animation: pieceIntroWorkbenchFadeIn 360ms ease both; }

.piece-intro-board-piece.is-enlarging {
  animation: pieceIntroEnlarge 420ms cubic-bezier(0.22, 0.72, 0.24, 1) both;
  pointer-events: none;
}

.piece-intro-board-piece.is-exploding {
  animation: pieceIntroExplode 420ms ease both;
  pointer-events: none;
}

.piece-intro-placement-layer {
  inset: 0;
  pointer-events: none;
  position: absolute;
  z-index: 4;
}

.piece-intro-placement {
  align-items: center;
  display: flex;
  height: 12.5%;
  justify-content: center;
  opacity: 0;
  position: absolute;
  transform: scale(0.48);
  width: 12.5%;
}

.piece-intro-placement .chess-piece { height: var(--board-square-piece-fill); width: var(--board-square-piece-fill); }
.piece-intro-placement[data-piece-placement="a1"] { --piece-travel-x: 350%; --piece-travel-y: -350%; --piece-split-x: 318%; --piece-split-y: -318%; bottom: 0; left: 0; }
.piece-intro-placement[data-piece-placement="h1"] { --piece-travel-x: -350%; --piece-travel-y: -350%; --piece-split-x: -318%; --piece-split-y: -318%; bottom: 0; right: 0; }
.piece-intro-placement[data-piece-placement="a8"] { --piece-travel-x: 350%; --piece-travel-y: 350%; --piece-split-x: 318%; --piece-split-y: 318%; left: 0; top: 0; }
.piece-intro-placement[data-piece-placement="h8"] { --piece-travel-x: -350%; --piece-travel-y: 350%; --piece-split-x: -318%; --piece-split-y: 318%; right: 0; top: 0; }
.piece-intro-placement-layer.is-visible .piece-intro-placement { opacity: 1; transform: scale(1); }
.piece-intro-placement-layer.is-splitting .piece-intro-placement { animation: pieceIntroPlacementSplit 260ms cubic-bezier(0.16, 0.8, 0.22, 1) both; }
.piece-intro-placement-layer.is-traveling .piece-intro-placement { animation: pieceIntroPlacementTravel 920ms cubic-bezier(0.18, 0.8, 0.26, 1) both; }

.piece-setup-board {
  container-type: inline-size;
  inset: 0;
  pointer-events: none;
  position: absolute;
  z-index: 5;
}

.piece-setup-rank-guide {
  align-items: center;
  box-sizing: border-box;
  display: none;
  height: 25%;
  justify-content: center;
  left: 0;
  overflow: hidden;
  position: absolute;
  width: 100%;
}

.piece-setup-rank-guide.is-visible { display: flex; }
.piece-setup-rank-guide.is-drawing { animation: pieceSetupGuideDrawTimer 760ms linear both; }
.piece-setup-rank-guide-white { bottom: 0; color: #ffffff; }
.piece-setup-rank-guide-black { color: #111111; top: 0; }

.piece-setup-rank-guide::before {
  background: currentColor;
  content: "";
  inset: 5px;
  opacity: 0;
  position: absolute;
  z-index: 1;
}

.piece-setup-rank-guide.is-finished::before { opacity: 0.16; }
.piece-setup-rank-guide.is-blinking::before { animation: pieceSetupGuideMaskPulse 920ms ease-in-out infinite; }

.piece-setup-rank-guide-line {
  background: currentColor;
  display: block;
  position: absolute;
  z-index: 3;
}

.piece-setup-rank-guide-line:nth-child(1),
.piece-setup-rank-guide-line:nth-child(3) {
  height: 5px;
  transform: scaleX(0);
  width: 100%;
}

.piece-setup-rank-guide-line:nth-child(2),
.piece-setup-rank-guide-line:nth-child(4) {
  height: 100%;
  transform: scaleY(0);
  width: 5px;
}

.piece-setup-rank-guide-white .piece-setup-rank-guide-line:nth-child(1) { bottom: 0; left: 0; transform-origin: left center; }
.piece-setup-rank-guide-white .piece-setup-rank-guide-line:nth-child(2) { bottom: 0; right: 0; transform-origin: center bottom; }
.piece-setup-rank-guide-white .piece-setup-rank-guide-line:nth-child(3) { left: 0; top: 0; transform-origin: right center; }
.piece-setup-rank-guide-white .piece-setup-rank-guide-line:nth-child(4) { left: 0; top: 0; transform-origin: center top; }
.piece-setup-rank-guide-black .piece-setup-rank-guide-line:nth-child(1) { left: 0; top: 0; transform-origin: left center; }
.piece-setup-rank-guide-black .piece-setup-rank-guide-line:nth-child(2) { right: 0; top: 0; transform-origin: center top; }
.piece-setup-rank-guide-black .piece-setup-rank-guide-line:nth-child(3) { bottom: 0; left: 0; transform-origin: right center; }
.piece-setup-rank-guide-black .piece-setup-rank-guide-line:nth-child(4) { bottom: 0; left: 0; transform-origin: center bottom; }

.piece-setup-rank-guide.is-drawing .piece-setup-rank-guide-line:nth-child(1) { animation: pieceSetupGuideHorizontalDraw 180ms ease-out both; }
.piece-setup-rank-guide.is-drawing .piece-setup-rank-guide-line:nth-child(2) { animation: pieceSetupGuideVerticalDraw 180ms ease-out 180ms both; }
.piece-setup-rank-guide.is-drawing .piece-setup-rank-guide-line:nth-child(3) { animation: pieceSetupGuideHorizontalDraw 180ms ease-out 360ms both; }
.piece-setup-rank-guide.is-drawing .piece-setup-rank-guide-line:nth-child(4) { animation: pieceSetupGuideVerticalDraw 180ms ease-out 540ms both; }
.piece-setup-rank-guide.is-finished .piece-setup-rank-guide-line:nth-child(1),
.piece-setup-rank-guide.is-finished .piece-setup-rank-guide-line:nth-child(3) { transform: scaleX(1); }
.piece-setup-rank-guide.is-finished .piece-setup-rank-guide-line:nth-child(2),
.piece-setup-rank-guide.is-finished .piece-setup-rank-guide-line:nth-child(4) { transform: scaleY(1); }
.piece-setup-rank-guide.is-blinking .piece-setup-rank-guide-line { animation: pieceSetupGuideLinePulse 920ms ease-in-out infinite; }

.piece-setup-rank-guide span {
  align-items: center;
  display: flex;
  font-size: clamp(44px, 5.6vmin, 52px);
  font-weight: 1000;
  height: 100%;
  justify-content: center;
  letter-spacing: 0.18em;
  opacity: 0;
  position: relative;
  transition: opacity 180ms ease;
  width: 75%;
  z-index: 2;
}

.piece-setup-rank-guide.is-finished span { opacity: 1; }

.piece-setup-rank-guide-white span {
  color: #ffffff;
  text-shadow: 0 2px 2px #000000;
}

.piece-setup-rank-guide-black span {
  color: #111111;
  text-shadow: 0 2px 2px rgba(255, 255, 255, 0.9);
}

.piece-setup-rank-guide.is-frame-only::before { animation: none; opacity: 0; }
.piece-setup-rank-guide.is-frame-only span { opacity: 0; }

.piece-setup-placement-layer {
  inset: 0;
  pointer-events: none;
  position: absolute;
  z-index: 6;
}

.piece-setup-board-piece {
  align-items: center;
  display: flex;
  height: 38%;
  justify-content: center;
  left: 31%;
  pointer-events: none;
  position: absolute;
  top: 31%;
  transform-origin: center;
  transition: opacity 260ms ease, transform 260ms ease;
  width: 38%;
  z-index: 7;
}

.piece-setup-board-piece .chess-piece { height: 100%; object-fit: contain; width: 100%; }

.piece-setup-board-piece.is-hidden {
  opacity: 0;
  transform: translateY(12px) scale(0.82);
}

.piece-setup-board-piece:not(.is-hidden) { animation: pieceIntroFadeIn 360ms ease both; }
.piece-setup-board-piece.is-enlarging { animation: pieceIntroEnlarge 420ms cubic-bezier(0.22, 0.72, 0.24, 1) both; }
.piece-setup-board-piece.is-exploding { animation: pieceIntroExplode 420ms ease both; }

.piece-setup-placement.is-pawn-splitting { animation: pieceIntroPlacementSplit 260ms cubic-bezier(0.16, 0.8, 0.22, 1) both; }
.piece-setup-placement.is-pawn-traveling { animation: pieceIntroPlacementTravel 920ms cubic-bezier(0.18, 0.8, 0.26, 1) both; }
.piece-setup-placement.is-major-piece-splitting { animation: pieceIntroPlacementSplit 260ms cubic-bezier(0.16, 0.8, 0.22, 1) both; }
.piece-setup-placement.is-major-piece-traveling { animation: pieceIntroPlacementTravel 920ms cubic-bezier(0.18, 0.8, 0.26, 1) both; }
.piece-setup-placement.is-queen-splitting { animation: pieceIntroPlacementSplit 260ms cubic-bezier(0.16, 0.8, 0.22, 1) both; }
.piece-setup-placement.is-queen-traveling { animation: pieceIntroPlacementTravel 920ms cubic-bezier(0.18, 0.8, 0.26, 1) both; }
.piece-setup-placement.is-king-splitting { animation: pieceIntroPlacementSplit 260ms cubic-bezier(0.16, 0.8, 0.22, 1) both; }
.piece-setup-placement.is-king-traveling { animation: pieceIntroPlacementTravel 920ms cubic-bezier(0.18, 0.8, 0.26, 1) both; }
.piece-setup-placement.is-visible.is-pawn-pulsing {
  animation: pieceSetupPawnPulse 1150ms ease-in-out infinite;
  opacity: 1;
}
.piece-setup-placement.is-visible.is-major-piece-pulsing {
  animation: pieceSetupMajorPiecePulse 1150ms ease-in-out infinite;
  opacity: 1;
}
.piece-setup-placement.is-visible.is-queen-pulsing {
  animation: pieceSetupQueenPulse 1150ms ease-in-out infinite;
  opacity: 1;
}
.piece-setup-placement.is-visible.is-king-pulsing {
  animation: pieceSetupKingPulse 1150ms ease-in-out infinite;
  opacity: 1;
}

.piece-setup-queen-overlay {
  --piece-setup-queen-contrast-color: #23303a;
  --piece-setup-queen-frame-color: #ffffff;
  background: transparent;
  border: 4px solid var(--piece-setup-queen-frame-color);
  box-sizing: border-box;
  height: 12.5%;
  opacity: 0;
  pointer-events: none;
  position: absolute;
  transition: opacity 240ms ease;
  width: 12.5%;
  z-index: 0;
}

.piece-setup-queen-overlay.is-white-square {
  --piece-setup-queen-contrast-color: #23303a;
  --piece-setup-queen-frame-color: #ffffff;
}

.piece-setup-queen-overlay.is-black-square {
  --piece-setup-queen-contrast-color: #ffffff;
  --piece-setup-queen-frame-color: #101820;
}

.piece-setup-queen-overlay.is-visible {
  box-shadow: 0 0 0 100vmax rgba(13, 25, 34, 0.58), 0 0 0 2px var(--piece-setup-queen-contrast-color);
  opacity: 1;
}
.piece-setup-queen-overlay.is-visible.is-queen-pulsing { animation: pieceSetupQueenOverlayPulse 1150ms ease-in-out infinite; }

.piece-setup-queen-pairing-tip {
  align-items: center;
  background: #fffdf8;
  border: 2px solid #23303a;
  border-radius: 4px;
  box-sizing: border-box;
  box-shadow: 0 5px 14px rgba(13, 25, 34, 0.32);
  color: #172833;
  display: flex;
  gap: clamp(12px, 4cqi, 24px);
  left: 50%;
  max-width: calc(100% - 24px);
  min-height: clamp(100px, 24cqi, 144px);
  opacity: 0;
  padding: clamp(12px, 3cqi, 18px) clamp(14px, 4cqi, 24px);
  pointer-events: none;
  position: absolute;
  right: auto;
  top: 50%;
  transform: translate(-50%, -50%) scale(0.92);
  transition: opacity 220ms ease, transform 220ms ease;
  z-index: 3;
}

.piece-setup-queen-pairing-tip.is-visible {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.piece-setup-queen-pairing-arrow {
  display: inline-block;
  fill: #23303a;
  flex: 0 1 auto;
  height: clamp(32px, 8cqi, 64px);
  width: clamp(44px, 12cqi, 90px);
}

.piece-setup-queen-pairing-piece {
  display: block;
  flex: 0 1 auto;
  filter: drop-shadow(0 4px 3px rgba(13, 25, 34, 0.28));
  height: clamp(48px, 14cqi, 116px);
  object-fit: contain;
  width: clamp(48px, 14cqi, 116px);
}

.piece-setup-queen-color-chip {
  background: #ffffff;
  border: 3px solid #23303a;
  display: block;
  flex: 0 1 auto;
  height: clamp(42px, 12cqi, 100px);
  width: clamp(42px, 12cqi, 100px);
}

.piece-setup-queen-pairing-tip.is-black-square .piece-setup-queen-color-chip {
  background: #101820;
  border-color: #101820;
}

.piece-setup-placement.chess-piece {
  height: var(--board-square-piece-size);
  object-fit: contain;
  opacity: 0;
  pointer-events: none;
  position: absolute;
  transform: translate(8%, -8%) scale(0.82);
  width: var(--board-square-piece-size);
}

.piece-setup-placement.is-visible {
  animation: pieceSetupFadeIn 360ms ease both;
  animation-delay: calc(var(--setup-reveal-delay) * 220ms);
}

.piece-setup-workbench { width: 100%; }

.piece-setup-workbench.is-expanded {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  height: 100%;
  min-height: 0;
}

.piece-setup-workbench-actions {
  display: grid;
  gap: 8px;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  margin-top: 10px;
  min-height: 0;
}

.piece-setup-workbench-actions[hidden] { display: none; }

.piece-setup-workbench-action {
  background: transparent;
  border: 0;
  color: #153449;
  cursor: pointer;
  font-family: inherit;
  font-size: 22px;
  font-weight: 1000;
  padding: 6px 2px;
  text-align: left;
  white-space: nowrap;
}

.piece-setup-workbench-action:hover { color: #ff6d2d; }

.piece-setup-workbench-answer {
  display: none;
  margin-left: 8px;
}

.piece-setup-workbench-answer.is-visible { color: #ff6d2d; display: inline; }

.piece-setup-rhyme-lines {
  color: #ff6d2d;
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  font-family: inherit;
  font-size: clamp(24px, 2vw, 30px);
  font-weight: 1000;
  justify-content: space-evenly;
  line-height: 1.1;
  margin: 6px 0 0;
  min-height: 0;
  padding: 4px clamp(16px, 4vw, 32px);
  text-align: center;
  width: 100%;
}

.piece-setup-rhyme-lines p { margin: 0; }

.lesson-console-action.piece-intro-name-card {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  text-align: center;
  width: 100%;
}

.lesson-console-action.piece-intro-name-card-static {
  cursor: default;
  pointer-events: none;
}

.piece-intro-name-card-line {
  display: block;
  flex: 0 0 100%;
}

.piece-intro-name-card-line + .piece-intro-name-card-line {
  color: #ff6d2d;
}

.piece-intro-topic-placeholder {
  color: #5b788d;
  font-size: 19px;
  font-weight: 800;
  margin: 18px 0;
  text-align: center;
}

@keyframes pieceIntroFadeIn {
  from { opacity: 0; transform: translateY(12px) scale(0.82); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes pieceIntroWorkbenchFadeIn {
  from { opacity: 0; transform: translateY(12px) scale(0.82); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes pieceIntroEnlarge {
  0% { filter: brightness(1); transform: scale(1); }
  100% { filter: brightness(1.1) drop-shadow(0 0 12px rgba(255, 184, 61, 0.5)); transform: scale(1.18); }
}

@keyframes pieceIntroExplode {
  0% { opacity: 1; transform: scale(1.18); }
  55% { filter: brightness(1.8) drop-shadow(0 0 20px #ffb83d); opacity: 1; transform: scale(1.42) rotate(7deg); }
  100% { opacity: 0; transform: scale(0.22) rotate(-18deg); }
}

@keyframes pieceIntroPlacementSplit {
  0% { filter: brightness(2.1) drop-shadow(0 0 18px #ffb83d); opacity: 0; transform: translate(var(--piece-travel-x), var(--piece-travel-y)) scale(0.36); }
  55% { filter: brightness(1.7) drop-shadow(0 0 14px #ffb83d); opacity: 1; transform: translate(var(--piece-split-x), var(--piece-split-y)) scale(0.7); }
  100% { filter: brightness(1.2) drop-shadow(0 0 7px rgba(255, 184, 61, 0.48)); opacity: 1; transform: translate(var(--piece-split-x), var(--piece-split-y)) scale(0.76); }
}

@keyframes pieceIntroPlacementTravel {
  0% { filter: brightness(1.35) drop-shadow(0 0 12px #ffb83d); opacity: 1; transform: translate(var(--piece-split-x), var(--piece-split-y)) scale(0.76); }
  18% { filter: brightness(1.16) drop-shadow(0 0 7px rgba(255, 184, 61, 0.4)); opacity: 1; transform: translate(var(--piece-split-x), var(--piece-split-y)) scale(0.84); }
  100% { filter: brightness(1); opacity: 1; transform: translate(0, 0) scale(1); }
}

@keyframes pieceSetupFadeIn {
  from { opacity: 0; transform: translate(8%, -8%) scale(0.82); }
  to { opacity: 1; transform: translate(8%, -8%) scale(1); }
}

@keyframes pieceSetupPawnPulse {
  0%, 100% { filter: drop-shadow(0 4px 3px rgba(0, 0, 0, 0.24)); transform: translate(8%, -8%) scale(1); }
  50% { filter: drop-shadow(0 7px 8px rgba(255, 184, 61, 0.42)); transform: translate(8%, -8%) scale(1.12); }
}

@keyframes pieceSetupMajorPiecePulse {
  0%, 100% { filter: drop-shadow(0 4px 3px rgba(0, 0, 0, 0.24)); transform: translate(8%, -8%) scale(1); }
  50% { filter: drop-shadow(0 7px 8px rgba(73, 179, 255, 0.46)); transform: translate(8%, -8%) scale(1.1); }
}

@keyframes pieceSetupQueenPulse {
  0%, 100% { filter: drop-shadow(0 4px 3px rgba(0, 0, 0, 0.24)); transform: translate(8%, -8%) scale(1); }
  50% { filter: drop-shadow(0 7px 8px rgba(255, 215, 94, 0.56)); transform: translate(8%, -8%) scale(1.12); }
}

@keyframes pieceSetupKingPulse {
  0%, 100% { filter: drop-shadow(0 4px 3px rgba(0, 0, 0, 0.24)); transform: translate(8%, -8%) scale(1); }
  50% { filter: drop-shadow(0 7px 8px rgba(102, 203, 244, 0.56)); transform: translate(8%, -8%) scale(1.12); }
}

@keyframes pieceSetupQueenOverlayPulse {
  0%, 100% {
    box-shadow: 0 0 0 100vmax rgba(13, 25, 34, 0.58), 0 0 0 2px var(--piece-setup-queen-contrast-color);
    opacity: 0.9;
  }
  50% {
    box-shadow: 0 0 0 100vmax rgba(13, 25, 34, 0.46), 0 0 0 3px var(--piece-setup-queen-contrast-color);
    opacity: 1;
  }
}

@keyframes pieceSetupGuideDrawTimer {
  from { opacity: 1; }
  to { opacity: 1; }
}

@keyframes pieceSetupGuideHorizontalDraw {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

@keyframes pieceSetupGuideVerticalDraw {
  from { transform: scaleY(0); }
  to { transform: scaleY(1); }
}

@keyframes pieceSetupGuideMaskPulse {
  0%, 100% { opacity: 0.12; }
  50% { opacity: 0.3; }
}

@keyframes pieceSetupGuideLinePulse {
  0%, 100% { opacity: 0.66; }
  50% { opacity: 1; }
}

/* Board intro secondary page */
.app-lesson-stage {
  background: linear-gradient(120deg, #fff3c8 0%, #dff4ff 48%, #ffe5f0 100%);
}

.app-lesson-stage .app-frame {
  grid-template-columns: 0 minmax(0, 1fr);
}

.app-lesson-stage .page-shell {
  height: calc(100vh - var(--topbar-height));
  padding: 0;
}

.app-lesson-stage .classroom-sidebar {
  bottom: 0;
  box-shadow: 18px 0 38px rgba(34, 114, 96, 0.18);
  height: auto;
  left: 0;
  position: fixed;
  top: var(--topbar-height);
  transform: translateX(calc(-1 * var(--sidebar-width)));
  transition: transform 180ms ease;
  width: var(--sidebar-width);
}

.app-lesson-stage.lesson-sidebar-open .classroom-sidebar {
  transform: translateX(0);
}

.app-lesson-stage .course-panel {
  left: var(--sidebar-width);
}

.lesson-sidebar-toggle {
  align-items: center;
  background: #fff9ee;
  border: 0;
  border-radius: 0 18px 18px 0;
  box-shadow: 8px 8px 22px rgba(35, 133, 232, 0.16);
  color: #2385e8;
  cursor: pointer;
  display: inline-flex;
  font-size: 18px;
  font-weight: 900;
  gap: 8px;
  left: 0;
  min-height: 58px;
  padding: 10px 14px 10px 12px;
  position: fixed;
  top: calc(var(--topbar-height) + 18px);
  z-index: 11;
}

.lesson-sidebar-toggle span {
  font-size: 26px;
}

.lesson-sidebar-open .lesson-sidebar-toggle {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-120%);
}

.board-intro-layout {
  display: grid;
  gap: 20px;
  grid-template-columns: minmax(0, 1fr) 420px;
  height: auto;
  inset: calc(var(--topbar-height) + 18px) 22px 22px 22px;
  left: 22px;
  overflow: hidden;
  position: fixed;
  right: 22px;
  top: calc(var(--topbar-height) + 18px);
  z-index: 1;
}

.board-intro-stage {
  background: linear-gradient(135deg, #193f55 0%, #275d6e 52%, #386b59 100%);
  border-radius: 18px;
  color: #fff;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  height: 100%;
  min-width: 0;
  overflow: hidden;
  padding: 28px;
  position: relative;
}

.board-intro-stage::before {
  background:
    radial-gradient(circle at 18% 16%, rgba(255, 229, 240, 0.24), transparent 30%),
    radial-gradient(circle at 82% 12%, rgba(255, 243, 200, 0.24), transparent 28%);
  content: "";
  inset: 0;
  pointer-events: none;
  position: absolute;
}

.board-intro-stage-head,
.board-intro-board-wrap,
.board-intro-controls,
.board-intro-play {
  position: relative;
  z-index: 1;
}

.board-intro-stage-head {
  max-width: 760px;
}

.board-intro-stage-head h1 {
  font-size: clamp(42px, 4.8vw, 72px);
  line-height: 1.02;
  margin: 6px 0 10px;
}

.board-intro-stage-head p:last-child {
  color: #dff4ff;
  font-size: clamp(20px, 1.8vw, 28px);
  font-weight: 800;
  margin: 0;
}

.board-intro-board-wrap {
  align-self: center;
  display: grid;
  gap: 14px;
  grid-template-rows: auto minmax(0, 1fr);
  justify-self: center;
  max-height: min(60vh, 640px);
  max-width: min(74vh, 760px);
  min-height: 420px;
  width: min(100%, 760px);
}

.board-intro-teaching-strip {
  align-items: center;
  background: rgba(255, 249, 238, 0.95);
  border-radius: 16px;
  color: #153449;
  display: flex;
  gap: 14px;
  justify-content: center;
  min-height: 58px;
  padding: 10px 18px;
}

.board-intro-teaching-strip strong {
  color: #2385e8;
  font-size: 24px;
  font-weight: 900;
}

.board-intro-teaching-strip span {
  font-size: 20px;
  font-weight: 900;
}

.board-intro-board-shell {
  align-self: stretch;
  background: rgba(255, 249, 238, 0.16);
  border: 2px solid rgba(255, 249, 238, 0.42);
  border-radius: 18px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  grid-template-rows: minmax(0, 1fr) 34px;
  min-height: 0;
  padding: 18px;
}

.board-intro-board {
  aspect-ratio: 1;
  border: 10px solid #fff9ee;
  border-radius: 12px;
  box-shadow: 0 24px 44px rgba(0, 0, 0, 0.24);
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  grid-template-rows: repeat(8, 1fr);
  overflow: hidden;
  position: relative;
}

.board-intro-square:nth-child(16n + 1),
.board-intro-square:nth-child(16n + 3),
.board-intro-square:nth-child(16n + 5),
.board-intro-square:nth-child(16n + 7),
.board-intro-square:nth-child(16n + 10),
.board-intro-square:nth-child(16n + 12),
.board-intro-square:nth-child(16n + 14),
.board-intro-square:nth-child(16n + 16) {
  background: #fff3c8;
}

.board-intro-square {
  background: #7bc6df;
}

.board-intro-file-labels,
.board-intro-rank-labels {
  color: #fff9ee;
  display: grid;
  font-size: 18px;
  font-weight: 900;
  text-align: center;
}

.board-intro-file-labels {
  grid-column: 1;
  grid-row: 2;
  grid-template-columns: repeat(8, 1fr);
}

.board-intro-rank-labels {
  align-items: center;
  grid-column: 2;
  grid-row: 1;
  grid-template-rows: repeat(8, 1fr);
}

.board-intro-play {
  align-items: center;
  align-self: center;
  background: #ff8a1d;
  border: 6px solid rgba(255, 255, 255, 0.28);
  border-radius: 50%;
  box-shadow: 0 12px 24px rgba(255, 138, 29, 0.32);
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  font-size: 42px;
  height: 92px;
  justify-content: center;
  justify-self: center;
  margin-top: -46px;
  width: 92px;
}

.board-intro-controls {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 18px;
}

.board-intro-controls button,
.lesson-panel-actions button {
  background: #fff9ee;
  border: 0;
  border-radius: 12px;
  color: #153449;
  cursor: pointer;
  font-size: 20px;
  font-weight: 900;
  min-height: 62px;
  padding: 12px;
}

.board-intro-side-panel {
  background: #4f9a3c;
  border-radius: 18px;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  height: 100%;
  min-width: 0;
  overflow: hidden;
}

.lesson-board-scene {
  background:
    linear-gradient(90deg, rgba(87, 44, 13, 0.34) 1px, transparent 1px),
    linear-gradient(180deg, #81501f 0%, #6e4116 100%);
  background-size: 82px 100%, auto;
  min-height: 0;
  overflow: hidden;
  padding: 28px 28px 0;
  position: relative;
}

.lesson-scroll-paper {
  background: #ffeac3;
  border-radius: 14px;
  color: #5d3c20;
  margin: 20px auto 0;
  max-width: 250px;
  min-height: 230px;
  padding: 34px 24px 26px;
  position: relative;
  text-align: center;
}

.lesson-scroll-paper::before,
.lesson-scroll-paper::after {
  background: #78c255;
  content: "";
  height: 54px;
  left: -8px;
  position: absolute;
  right: -8px;
}

.lesson-scroll-paper::before {
  border-radius: 16px 16px 4px 4px;
  top: -22px;
}

.lesson-scroll-paper::after {
  background: #fff0c9;
  border-radius: 999px;
  bottom: -18px;
  height: 28px;
}

.lesson-scroll-label,
.lesson-scroll-paper h2,
.lesson-scroll-paper p {
  position: relative;
  z-index: 1;
}

.lesson-scroll-label {
  color: #fff;
  font-size: 18px;
  font-weight: 900;
  margin: -22px 0 28px;
}

.lesson-scroll-paper h2 {
  font-size: 26px;
  margin: 0 0 12px;
}

.lesson-scroll-paper p {
  font-size: 18px;
  font-weight: 800;
  line-height: 1.45;
  margin: 0;
}

.lesson-helper {
  bottom: 18px;
  height: 172px;
  left: 50%;
  position: absolute;
  transform: translateX(-50%);
  width: 170px;
}

.helper-body {
  background: #514d45;
  border-radius: 48px 48px 20px 20px;
  bottom: 0;
  display: block;
  height: 112px;
  left: 34px;
  position: absolute;
  width: 102px;
}

.helper-head {
  background: #5f5a51;
  border-radius: 50%;
  display: block;
  height: 92px;
  left: 38px;
  position: absolute;
  top: 8px;
  width: 92px;
}

.helper-book {
  background: #fff9ee;
  border-radius: 4px;
  bottom: 54px;
  display: block;
  height: 34px;
  left: 8px;
  position: absolute;
  transform: rotate(-24deg);
  width: 70px;
}

.lesson-panel-bottom {
  background: #f3ecff;
  border-top: 8px solid rgba(255, 255, 255, 0.38);
  display: grid;
  gap: 14px;
  padding: 18px 20px 20px;
}

.lesson-step-list ol {
  display: grid;
  gap: 8px;
  margin: 8px 0 0;
  padding-left: 24px;
}

.lesson-step-list li {
  color: #153449;
  font-size: 18px;
  font-weight: 800;
}

.lesson-panel-actions {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr 1fr;
}

.lesson-panel-actions button {
  background: #dff4ff;
  font-size: 17px;
  min-height: 56px;
}

@media (max-width: 1180px) {
  .board-intro-layout {
    grid-template-columns: minmax(0, 1fr) 360px;
  }

  .board-intro-stage {
    padding: 22px;
  }
}

/* Board intro teaching-console layout */
.app-lesson-stage {
  --board-intro-edge: clamp(18px, 2vw, 36px);
  /* 侧栏默认收起并覆盖棋盘；页面右边距仍与左边距保持一致。 */
  --board-intro-sidebar-reserve: 0px;
  --board-intro-right-edge: var(--board-intro-edge);
  --board-intro-gap: clamp(18px, 1.5vw, 30px);
  --board-intro-panel-width: clamp(380px, 24vw, 460px);
  --board-intro-size: min(
    calc(100vh - var(--topbar-height) - (2 * var(--board-intro-edge))),
    calc(100vw - var(--board-intro-panel-width) - var(--board-intro-gap) - var(--board-intro-edge) - var(--board-intro-right-edge) - var(--board-intro-sidebar-reserve))
  );
}

.app-lesson-stage .topbar {
  position: relative;
}

.app-lesson-stage .app-frame {
  grid-template-columns: 0 minmax(0, 1fr);
}

.app-lesson-stage .page-shell {
  padding: 0;
}

.board-intro-layout {
  align-items: center;
  background: transparent;
  display: grid;
  gap: var(--board-intro-gap);
  grid-template-columns: minmax(0, 1fr) var(--board-intro-panel-width);
  height: auto;
  inset: calc(var(--topbar-height) + var(--board-intro-edge)) var(--board-intro-right-edge) var(--board-intro-edge) var(--board-intro-edge);
  overflow: visible;
  position: fixed;
}

.board-intro-stage {
  background: transparent;
  border-radius: 0;
  display: grid;
  height: var(--board-intro-size);
  justify-items: end;
  min-width: 0;
  overflow: visible;
  padding: 0;
  place-items: center end;
  position: relative;
}

.board-intro-board-stage {
  --coach-mascot-height: clamp(220px, 57%, 480px);
  aspect-ratio: 1;
  height: var(--board-intro-size);
  max-height: 100%;
  max-width: 100%;
  position: relative;
  width: var(--board-intro-size);
}

.coach-mascot {
  animation: coachMascotFloatIn 1350ms cubic-bezier(0.16, 1, 0.3, 1) both;
  bottom: 0;
  height: var(--coach-mascot-height);
  pointer-events: none;
  position: absolute;
  right: 2.7%;
  transition: opacity 620ms ease, transform 620ms ease, visibility 620ms ease;
  width: auto;
  z-index: 5;
}

.coach-mascot-picture {
  display: block;
  height: 100%;
}

.coach-mascot-image {
  display: block;
  height: 100%;
  object-fit: contain;
  width: auto;
}

.coach-mascot-wrist {
  left: 12.66%;
  position: absolute;
  top: 20.57%;
  transform-origin: 74% 74%;
  width: 18.99%;
  z-index: 2;
}

.coach-mascot-wrist-image {
  display: block;
  height: auto;
  position: relative;
  width: 100%;
  z-index: 1;
}

.coach-mascot-wrist-picture {
  display: block;
}

.coach-mascot-pointer {
  background: linear-gradient(90deg, #4c3324 0 12%, #f4b166 12% 82%, #7a4a2d 82% 100%);
  border: 1px solid #3c291d;
  border-radius: 999px;
  height: 249%;
  left: 41.5%;
  pointer-events: none;
  position: absolute;
  top: 9.57%;
  transform: translate(-50%, -100%) rotate(-30deg);
  transform-origin: 50% 100%;
  width: 7.4%;
  z-index: 0;
}

.coach-mascot.is-hidden {
  animation: none;
  display: none;
  opacity: 0;
  pointer-events: none;
  transition: none;
  transform: translateY(-12px) scale(0.98);
  visibility: hidden;
}

.coach-mascot.is-leaving {
  opacity: 0;
  transform: translateY(-34px) scale(0.94) rotate(-1deg);
}

.coach-mascot.is-tapping .coach-mascot-wrist {
  animation: coachWristTap 420ms cubic-bezier(0.36, 0, 0.2, 1) 3;
}

@keyframes coachMascotFloatIn {
  from {
    opacity: 0;
    transform: translateY(44px) scale(0.92);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes coachWristTap {
  0%,
  100% {
    transform: rotate(0deg);
  }

  28% {
    transform: rotate(-5deg);
  }

  48% {
    transform: rotate(2deg);
  }
}

@media (max-width: 1020px) {
  .board-intro-board-stage {
    --coach-mascot-height: clamp(160px, 52%, 360px);
  }
}

@media (max-width: 720px) {
  .app-history-video .page-shell {
    padding: 18px 16px 22px;
  }

  .history-video-page {
    gap: 14px;
  }

  .history-video-header {
    justify-self: start;
    text-align: left;
  }

  .history-video-header h1 {
    font-size: clamp(28px, 9cqi, 34px);
  }

  .history-video-player {
    justify-content: start;
  }

  .history-video-media {
    border-width: 4px;
    height: auto;
    width: 100%;
  }

  .board-intro-board-stage {
    --coach-mascot-height: clamp(102px, 32%, 148px);
  }
}

@media (max-width: 620px) {
  .app-history-video .topbar {
    gap: 8px;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    padding: 0 10px;
  }

  .app-history-video .brand {
    font-size: 16px;
    gap: 8px;
    line-height: 1.1;
    min-width: 0;
  }

  .app-history-video .brand-logo {
    height: 38px;
    width: 38px;
  }

  .app-history-video .topbar-title {
    font-size: 20px;
    letter-spacing: 0.03em;
    max-width: 28vw;
  }

  .app-history-video .topbar-status {
    min-width: 0;
  }

  .app-history-video .topbar-home-link {
    font-size: 13px;
    min-height: 30px;
    padding: 5px 8px;
  }
}

.lesson-brief-board {
  --lesson-brief-character-reserve: clamp(128px, 20%, 190px);
  --lesson-brief-size: min(86%, 660px);
  animation: lessonBriefFloatIn 1350ms cubic-bezier(0.16, 1, 0.3, 1) both;
  aspect-ratio: 1;
  container-type: size;
  height: var(--lesson-brief-size);
  left: 50%;
  pointer-events: none;
  position: absolute;
  top: clamp(18px, 4.2vh, 44px);
  transform: translateX(-50%);
  transition: opacity 620ms ease, transform 620ms ease, visibility 620ms ease;
  width: var(--lesson-brief-size);
  z-index: 4;
}

.lesson-brief-skip {
  align-items: center;
  background: rgba(10, 50, 33, 0.72);
  border: 1px solid rgba(255, 253, 240, 0.78);
  border-radius: 4px;
  color: #fffdf0;
  cursor: pointer;
  display: inline-flex;
  font-size: 16px;
  font-weight: 800;
  justify-content: center;
  line-height: 1;
  padding: 8px 12px;
  pointer-events: auto;
  position: absolute;
  right: clamp(28px, 3.6vw, 44px);
  top: clamp(28px, 3.6vw, 44px);
  transition: background 140ms ease, border-color 140ms ease, transform 140ms ease;
  z-index: 2;
}

.lesson-brief-skip:hover,
.lesson-brief-skip:focus-visible {
  background: rgba(10, 50, 33, 0.94);
  border-color: #fff;
  transform: translateY(-1px);
}

.lesson-brief-board .lesson-brief-skip {
  pointer-events: auto;
}

.board-intro-side-panel.is-lesson-opening-locked,
.board-intro-board.is-lesson-opening-locked {
  cursor: wait;
  opacity: 0.62;
  pointer-events: none;
}

@keyframes lessonBriefFloatIn {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(44px) scale(0.92);
  }

  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
  }
}

.lesson-brief-board.is-hidden {
  animation: none;
  display: none;
  opacity: 0;
  pointer-events: none;
  transition: none;
  transform: translateX(-50%) translateY(-12px) scale(0.98);
  visibility: hidden;
}

.lesson-brief-board.is-leaving {
  opacity: 0;
  transform: translateX(-50%) translateY(-34px) scale(0.94) rotate(-1deg);
}

.lesson-brief-frame {
  background:
    linear-gradient(90deg, rgba(139, 78, 24, 0.42), transparent 14%, transparent 86%, rgba(139, 78, 24, 0.42)),
    linear-gradient(180deg, #f0b95d 0%, #c7812f 100%);
  border: 2px solid #7c4b1d;
  border-radius: 8px;
  box-sizing: border-box;
  box-shadow: 0 24px 38px rgba(20, 42, 54, 0.28);
  height: 100%;
  padding: clamp(12px, 1.2vw, 18px);
}

.lesson-brief-surface {
  background:
    radial-gradient(circle at 50% 44%, rgba(255, 255, 255, 0.16), transparent 34%),
    linear-gradient(135deg, #245734 0%, #123f2a 100%);
  border: 3px solid rgba(36, 88, 51, 0.9);
  border-radius: 4px;
  box-shadow:
    inset 0 0 18px rgba(0, 0, 0, 0.28),
    inset 0 0 60px rgba(255, 255, 255, 0.08);
  box-sizing: border-box;
  color: #fffdf0;
  height: 100%;
  min-height: 0;
  padding-bottom: calc(clamp(22px, 5cqi, 34px) + clamp(28px, 7%, 70px));
  padding-left: clamp(24px, 5cqi, 42px);
  padding-right: calc(clamp(24px, 5cqi, 42px) + var(--lesson-brief-character-reserve));
  padding-top: clamp(22px, 5cqi, 34px);
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.24);
}

.lesson-brief-title {
  color: #fffdf0;
  font-size: clamp(28px, min(8cqi, 8cqb), 54px);
  line-height: 1.05;
  margin: 0 calc(-1 * var(--lesson-brief-character-reserve)) clamp(14px, 3cqi, 24px) 0;
  text-align: center;
  text-decoration: underline;
  text-decoration-thickness: clamp(2px, 0.6cqi, 4px);
  text-underline-offset: clamp(4px, 1cqi, 8px);
  width: calc(100% + var(--lesson-brief-character-reserve));
}

.lesson-brief-title.is-typing::after,
.lesson-brief-list li.is-typing::after {
  animation: typewriterCursorBlink 680ms steps(1) infinite;
  content: "";
  display: inline-block;
  height: 0.9em;
  margin-left: 0.12em;
  transform: translateY(0.12em);
  width: 0.12em;
  background: #fffdf0;
}

@keyframes typewriterCursorBlink {
  0%,
  48% {
    opacity: 1;
  }

  49%,
  100% {
    opacity: 0;
  }
}

.lesson-brief-list {
  display: grid;
  gap: clamp(8px, 2cqi, 15px);
  list-style: disc;
  margin: 0;
  padding-left: clamp(18px, 3.6cqi, 30px);
}

.lesson-brief-list li {
  font-size: clamp(16px, min(4.2cqi, 4.2cqb), 28px);
  font-weight: 900;
  line-height: 1.24;
  opacity: 0;
  transition: opacity 180ms ease;
  overflow-wrap: anywhere;
  white-space: normal;
}

.lesson-brief-list li.is-typing,
.lesson-brief-list li.is-typed {
  opacity: 1;
}

.board-intro-board {
  --board-dark-square: #be6537;
  --board-light-square: #f1d5b1;
  --board-outline-board: #00d5ff;
  --board-outline-square: #1de9b6;
  --board-outline-file-line: #13e6b7;
  --board-outline-rank-line: #22c8ff;
  --board-outline-diagonal-line: #4ade80;
  --board-mark-line: #38bdf8;
  --board-mark-region: #2dd4bf;
  --board-mark-region-soft: rgba(45, 212, 191, 0.34);
  --board-outline-center: #14f1c9;
  --board-outline-back-rank: #22c8ff;
  --board-outline-edge-line: #58f0a8;
  --board-outline-light-diagonal: #00c2a8;
  --board-outline-dark-diagonal: #3b82f6;
  aspect-ratio: 1;
  border: 2px solid #5d8a39;
  border-radius: 4px;
  box-shadow: 0 26px 54px rgba(16, 44, 56, 0.32);
  background: var(--board-dark-square);
  display: block;
  height: 100%;
  overflow: hidden;
  position: relative;
  width: 100%;
}

.board-intro-square-grid {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  grid-template-rows: repeat(8, minmax(0, 1fr));
  height: 100%;
  inset: 0;
  position: absolute;
  width: 100%;
  z-index: 1;
}

.board-intro-square-grid .board-intro-square {
  align-items: center;
  background: var(--board-dark-square);
  border: 0;
  border-radius: 0;
  color: #f3efd4;
  cursor: default;
  display: flex;
  font: inherit;
  justify-content: center;
  min-height: 0;
  min-width: 0;
  padding: 0;
  position: relative;
  z-index: 1;
}

.board-intro-board[data-square-click-enabled="true"] .board-intro-square {
  cursor: pointer;
  touch-action: manipulation;
}

/* 触屏走子使用棋盘格接收点击，棋子和覆盖层不能截断格子的命中。 */
.board-intro-board .chess-piece {
  pointer-events: none;
  user-select: none;
}

.board-intro-board[data-board-touch-active="true"] .board-intro-square {
  touch-action: none;
}

.board-intro-square.is-board-touch-source {
  box-shadow: inset 0 0 0 clamp(2px, 0.6cqi, 5px) rgba(255, 184, 61, .96);
  z-index: 3;
}

.board-intro-board.is-memory-challenge-active .board-intro-square {
  cursor: pointer;
  touch-action: manipulation;
}

.board-intro-board[data-square-click-enabled="true"] .board-intro-square:focus-visible:not(.is-memory-selected):not(.is-memory-correct):not(.is-memory-wrong),
.board-intro-board[data-square-click-enabled="true"] .board-intro-square.is-selected:not(.is-memory-selected):not(.is-memory-correct):not(.is-memory-wrong) {
  outline: 4px solid rgba(255, 184, 61, 0.92);
  outline-offset: -4px;
  z-index: 2;
}

.board-intro-board[data-square-selection-visual="none"] .board-intro-square:focus-visible:not(.is-memory-selected):not(.is-memory-correct):not(.is-memory-wrong),
.board-intro-board[data-square-selection-visual="none"] .board-intro-square.is-selected:not(.is-memory-selected):not(.is-memory-correct):not(.is-memory-wrong) {
  outline: 0;
  outline-offset: 0;
  z-index: 1;
}

.board-intro-square.is-memory-selected,
.board-intro-square.is-memory-correct,
.board-intro-square.is-memory-wrong {
  outline-offset: -5px;
  z-index: 3;
}

.board-intro-square.is-memory-selected {
  outline: 5px solid #2563eb;
}

.board-intro-square.is-memory-correct {
  outline: var(--lesson-frame-width, 5px) solid var(--lesson-safe, #22c55e);
}

.board-intro-square.is-memory-wrong {
  outline: var(--lesson-frame-width, 5px) solid var(--lesson-danger, #ef4444);
}

.board-intro-square.is-corner-reminder {
  box-shadow: inset 0 0 0 5px #ef4444;
  z-index: 4;
}

.corner-reminder-star {
  aspect-ratio: 1;
  color: #ef4444;
  filter: drop-shadow(0 5px 10px rgba(239, 68, 68, 0.28));
  left: 16%;
  opacity: 0;
  position: absolute;
  top: 16%;
  transform: scale(0.82);
  transition: opacity 160ms ease, transform 220ms cubic-bezier(0.16, 1, 0.3, 1);
  width: 68%;
  z-index: 2;
}

.corner-reminder-star .feedback-star-body-fill,
.corner-reminder-star .feedback-star-body-frame,
.corner-reminder-star img {
  height: 100%;
  inset: 0;
  pointer-events: none;
  position: absolute;
  width: 100%;
}

.corner-reminder-star .feedback-star-body-fill {
  background: #ffb4b4;
  -webkit-mask: url("images/interaction-feedback/happy-star-1-fill.svg") center / contain no-repeat;
  mask: url("images/interaction-feedback/happy-star-1-fill.svg") center / contain no-repeat;
  z-index: 0;
}

.corner-reminder-star .feedback-star-body-frame {
  background: currentColor;
  -webkit-mask: url("images/interaction-feedback/happy-star-1-body.svg") center / contain no-repeat;
  mask: url("images/interaction-feedback/happy-star-1-body.svg") center / contain no-repeat;
  z-index: 1;
}

.corner-reminder-star img {
  z-index: 2;
}

.board-intro-square.is-corner-reminder .corner-reminder-star {
  opacity: 1;
  transform: scale(1);
}

.board-intro-square.is-corner-reminder-flashing .corner-reminder-star {
  animation: cornerReminderStarFlash 540ms ease-in-out 3;
}

@keyframes cornerReminderStarFlash {
  0%,
  100% {
    opacity: 0.22;
    transform: scale(0.82);
  }

  50% {
    opacity: 1;
    transform: scale(1.08);
  }
}

.board-intro-square-grid .board-intro-square.is-coordinate-fly-source {
  z-index: var(--coordinate-fly-z, 30);
}

.board-intro-square.is-memory-correct::after,
.board-intro-square.is-memory-wrong::after {
  align-items: center;
  border-radius: 999px;
  display: flex;
  font-size: clamp(24px, 4vw, 48px);
  font-weight: 1000;
  height: 58%;
  justify-content: center;
  left: 21%;
  line-height: 1;
  pointer-events: none;
  position: absolute;
  top: 21%;
  width: 58%;
  z-index: 4;
}

.board-intro-square.is-memory-correct::after {
  color: #16a34a;
  content: "✓";
  text-shadow: 0 2px 8px rgba(255, 255, 255, 0.82);
}

.board-intro-square.is-memory-wrong::after {
  color: #dc2626;
  content: "×";
  text-shadow: 0 2px 8px rgba(255, 255, 255, 0.82);
}

.square-coordinate-label,
.square-name-label {
  line-height: 1;
  opacity: 0;
  pointer-events: none;
  position: absolute;
  transform: translateY(4px);
  transition: opacity 280ms ease, transform 280ms ease;
  z-index: 3;
}

.square-coordinate-label {
  font-size: clamp(12px, 1.1vw, 18px);
  font-weight: 1000;
}

.square-coordinate-file-label {
  bottom: 4px;
  right: 5px;
}

.square-coordinate-rank-label {
  left: 5px;
  top: 5px;
}

.square-name-label {
  align-items: center;
  color: #123f86;
  display: flex;
  font-size: clamp(27px, 3.35vw, 48px);
  font-weight: 1000;
  inset: 0;
  justify-content: center;
  text-shadow: 0 1px 7px rgba(255, 255, 255, 0.82);
}

.board-intro-square.is-file-coordinate-visible .square-coordinate-file-label,
.board-intro-square.is-rank-coordinate-visible .square-coordinate-rank-label {
  opacity: 1;
  transform: translateY(0);
}

.board-intro-square.is-file-coordinate-visible .square-coordinate-file-label:not(.is-coordinate-flying),
.board-intro-square.is-rank-coordinate-visible .square-coordinate-rank-label:not(.is-coordinate-flying) {
  animation:
    squareIntroFadeIn 360ms ease both,
    squareCoordinateBreath 1600ms ease-in-out 420ms 3;
}

.board-intro-square.is-file-coordinate-visible .square-coordinate-file-label.is-coordinate-flying,
.board-intro-square.is-rank-coordinate-visible .square-coordinate-rank-label.is-coordinate-flying {
  animation:
    squareCoordinateFlyIn 1200ms cubic-bezier(0.18, 0.88, 0.24, 1) var(--coordinate-fly-delay, 0ms) both,
    squareCoordinateBreath 1600ms ease-in-out calc(var(--coordinate-fly-delay, 0ms) + 1280ms) 3;
  opacity: 1;
  transform-origin: center;
  z-index: 8;
}

.board-intro-board.is-square-coordinate-static .board-intro-square.is-file-coordinate-visible .square-coordinate-file-label,
.board-intro-board.is-square-coordinate-static .board-intro-square.is-rank-coordinate-visible .square-coordinate-rank-label {
  animation: none;
  opacity: 1;
  transform: translateY(0);
}

.board-intro-square.is-square-name-visible .square-name-label {
  opacity: 1;
  transform: translateY(0);
}

.board-intro-square.is-square-name-visible.is-square-name-revealing .square-name-label {
  animation: squareIntroFadeIn 360ms ease var(--square-intro-name-delay, 0ms) both;
}

.board-intro-square.is-square-name-visible.is-square-name-breathing .square-name-label {
  animation: squareNameBreath 1600ms ease-in-out 420ms infinite;
}

.board-intro-square.is-square-name-visible.is-square-name-breathing-three .square-name-label {
  animation: squareNameBreath 900ms ease-in-out 420ms 3;
}

.board-intro-square.is-square-name-visible.is-square-name-revealing.is-square-name-breathing .square-name-label {
  animation:
    squareIntroFadeIn 360ms ease var(--square-intro-name-delay, 0ms) both,
    squareNameBreath 1600ms ease-in-out 420ms infinite;
}

.board-intro-square.is-square-name-masked {
  z-index: 2;
}

.board-intro-square.is-square-name-masked::before {
  background: rgba(255, 246, 214, 0.52);
  content: "";
  inset: 0;
  pointer-events: none;
  position: absolute;
  z-index: 2;
}

.board-intro-square.is-square-name-masked .square-name-label {
  color: #123f86;
  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.78),
    0 0 10px rgba(255, 255, 255, 0.7);
  z-index: 4;
}

.board-intro-square.is-square-name-highlighted {
  box-shadow: inset 0 0 0 5px rgba(255, 184, 61, 0.96);
  z-index: 2;
}

.board-intro-square-grid .board-intro-square[data-square-name^="a"] .square-coordinate-file-label,
.board-intro-square-grid .board-intro-square[data-square-name^="c"] .square-coordinate-file-label,
.board-intro-square-grid .board-intro-square[data-square-name^="e"] .square-coordinate-file-label,
.board-intro-square-grid .board-intro-square[data-square-name^="g"] .square-coordinate-file-label,
.board-intro-square-grid .board-intro-square[data-square-name$="7"] .square-coordinate-rank-label,
.board-intro-square-grid .board-intro-square[data-square-name$="5"] .square-coordinate-rank-label,
.board-intro-square-grid .board-intro-square[data-square-name$="3"] .square-coordinate-rank-label,
.board-intro-square-grid .board-intro-square[data-square-name$="1"] .square-coordinate-rank-label {
  color: #fff4d7;
  text-shadow: 0 1px 2px rgba(62, 25, 10, 0.68);
}

.board-intro-square-grid .board-intro-square[data-square-name^="b"] .square-coordinate-file-label,
.board-intro-square-grid .board-intro-square[data-square-name^="d"] .square-coordinate-file-label,
.board-intro-square-grid .board-intro-square[data-square-name^="f"] .square-coordinate-file-label,
.board-intro-square-grid .board-intro-square[data-square-name^="h"] .square-coordinate-file-label,
.board-intro-square-grid .board-intro-square[data-square-name$="8"] .square-coordinate-rank-label,
.board-intro-square-grid .board-intro-square[data-square-name$="6"] .square-coordinate-rank-label,
.board-intro-square-grid .board-intro-square[data-square-name$="4"] .square-coordinate-rank-label,
.board-intro-square-grid .board-intro-square[data-square-name$="2"] .square-coordinate-rank-label {
  color: #6b2e17;
  text-shadow: 0 1px 1px rgba(255, 248, 226, 0.72);
}

.square-name-arrow-layer,
.square-name-build-layer,
.square-name-center-label {
  inset: 0;
  pointer-events: none;
  position: absolute;
}

.square-name-arrow-layer {
  z-index: 5;
}

.square-name-build-layer {
  z-index: 7;
}

.square-name-arrow {
  --arrow-left: 0%;
  --arrow-top: 0%;
  --arrow-length: 0%;
  --arrow-color: #2385e8;
  background: var(--arrow-color);
  border-radius: 999px;
  box-shadow: 0 0 0 5px rgba(35, 133, 232, 0.16), 0 0 18px rgba(35, 133, 232, 0.46);
  opacity: 0;
  position: absolute;
}

.square-name-arrow::after {
  border: 10px solid transparent;
  content: "";
  position: absolute;
}

.square-name-arrow-file {
  height: var(--arrow-length);
  left: var(--arrow-left);
  top: var(--arrow-top);
  transform: scaleY(0);
  transform-origin: bottom center;
  width: 8px;
}

.square-name-arrow-file::after {
  border-bottom-color: var(--arrow-color);
  left: 50%;
  top: -19px;
  transform: translateX(-50%);
}

.square-name-arrow-rank {
  height: 8px;
  left: var(--arrow-left);
  top: var(--arrow-top);
  transform: scaleX(0);
  transform-origin: left center;
  width: var(--arrow-length);
}

.square-name-arrow-rank::after {
  border-left-color: var(--arrow-color);
  right: -19px;
  top: 50%;
  transform: translateY(-50%);
}

.square-name-arrow.is-drawing {
  opacity: 1;
}

.square-name-arrow-file.is-drawing {
  animation: squareNameArrowDrawY 820ms ease both;
}

.square-name-arrow-rank.is-drawing {
  animation: squareNameArrowDrawX 820ms ease both;
}

.square-name-center-label {
  align-items: center;
  color: #0f558b;
  display: flex;
  font-size: clamp(72px, 9vw, 132px);
  font-weight: 1000;
  justify-content: center;
  opacity: 0;
  text-shadow:
    0 6px 0 rgba(15, 85, 139, 0.22),
    0 0 24px rgba(255, 255, 255, 0.8);
  transform: scale(0.78);
  transition: opacity 260ms ease, transform 360ms cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 6;
}

.square-name-center-label.is-visible {
  opacity: 1;
  transform: scale(1);
}

.square-name-build-glyph {
  color: #123f86;
  font-size: clamp(12px, 1.1vw, 18px);
  font-weight: 1000;
  left: 0;
  line-height: 1;
  opacity: 0;
  position: absolute;
  text-shadow:
    0 3px 0 rgba(18, 63, 134, 0.18),
    0 0 14px rgba(255, 255, 255, 0.72);
  top: 0;
  transform: translate(-50%, -50%) scale(0.18);
  will-change: opacity, transform;
}

.square-name-build-glyph-file {
  z-index: 8;
}

.square-name-build-glyph-rank {
  z-index: 7;
}

.square-name-build-glyph.is-growing {
  animation: squareNameBuildGrow 520ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.square-name-build-glyph.is-moving {
  animation: squareNameBuildMove 980ms cubic-bezier(0.2, 0.82, 0.18, 1) both;
  opacity: 1;
}

.square-name-build-glyph.is-stacked {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.square-name-build-glyph.is-final-file {
  animation: squareNameBuildFileBounce 560ms cubic-bezier(0.16, 1, 0.3, 1) both;
  opacity: 1;
  z-index: 9;
}

.square-name-build-glyph.is-final-rank {
  animation: squareNameBuildRankBounce 560ms cubic-bezier(0.16, 1, 0.3, 1) both;
  opacity: 1;
}

.square-name-push-arrow {
  --push-angle: 0deg;
  --push-left: 0px;
  --push-length: 0px;
  --push-top: 0px;
  background: #123f86;
  border-radius: 999px;
  box-shadow: 0 0 0 4px rgba(18, 63, 134, 0.14), 0 0 16px rgba(18, 63, 134, 0.42);
  height: 7px;
  left: var(--push-left);
  opacity: 0;
  position: absolute;
  top: var(--push-top);
  transform: rotate(var(--push-angle)) scaleX(0);
  transform-origin: left center;
  width: var(--push-length);
  z-index: 6;
}

.square-name-push-arrow::after {
  border: 9px solid transparent;
  border-left-color: #123f86;
  content: "";
  position: absolute;
  right: -17px;
  top: 50%;
  transform: translateY(-50%);
}

.square-name-push-arrow.is-pushing {
  animation: squareNamePushArrow 1140ms ease both;
}

@keyframes squareNameBuildGrow {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.18);
  }

  68% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.08);
  }

  100% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

@keyframes squareNameBuildMove {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }

  100% {
    opacity: 1;
    transform: translate(calc(-50% + var(--move-x)), calc(-50% + var(--move-y))) scale(1);
  }
}

@keyframes squareNameBuildFileBounce {
  0% {
    transform: translate(-50%, -50%) scale(1);
  }

  64% {
    transform: translate(calc(-50% - 0.46em), -50%) scale(1.12);
  }

  100% {
    transform: translate(calc(-50% - 0.31em), -50%) scale(1);
  }
}

@keyframes squareNameBuildRankBounce {
  0% {
    transform: translate(-50%, -50%) scale(1);
  }

  64% {
    transform: translate(calc(-50% + 0.46em), -50%) scale(1.12);
  }

  100% {
    transform: translate(calc(-50% + 0.31em), -50%) scale(1);
  }
}

@keyframes squareNamePushArrow {
  0% {
    opacity: 0;
    transform: rotate(var(--push-angle)) scaleX(0);
  }

  12% {
    opacity: 1;
  }

  78% {
    opacity: 1;
    transform: rotate(var(--push-angle)) scaleX(1);
  }

  100% {
    opacity: 0;
    transform: rotate(var(--push-angle)) scaleX(1);
  }
}

@keyframes squareIntroFadeIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes squareCoordinateFlyIn {
  0% {
    filter: brightness(1.26);
    opacity: 0;
    transform: translate(var(--coordinate-fly-x), var(--coordinate-fly-y)) scale(10.5);
  }

  10% {
    opacity: 1;
    transform: translate(var(--coordinate-fly-x), var(--coordinate-fly-y)) scale(10.5);
  }

  52% {
    filter: brightness(1.26);
    opacity: 1;
    transform: translate(var(--coordinate-fly-x), var(--coordinate-fly-y)) scale(10.5);
  }

  78% {
    filter: brightness(1.16);
    opacity: 1;
    transform: translate(calc(var(--coordinate-fly-x) * 0.08), calc(var(--coordinate-fly-y) * 0.08)) scale(1.34);
  }

  100% {
    filter: brightness(1);
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes squareCoordinateBreath {
  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0;
  }
}

@keyframes squareNameBreath {
  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0;
  }
}

@keyframes squareNameArrowDrawY {
  from {
    transform: scaleY(0);
  }

  to {
    transform: scaleY(1);
  }
}

@keyframes squareNameArrowDrawX {
  from {
    transform: scaleX(0);
  }

  to {
    transform: scaleX(1);
  }
}

.board-intro-square-grid .board-intro-square:nth-child(16n + 1),
.board-intro-square-grid .board-intro-square:nth-child(16n + 3),
.board-intro-square-grid .board-intro-square:nth-child(16n + 5),
.board-intro-square-grid .board-intro-square:nth-child(16n + 7),
.board-intro-square-grid .board-intro-square:nth-child(16n + 10),
.board-intro-square-grid .board-intro-square:nth-child(16n + 12),
.board-intro-square-grid .board-intro-square:nth-child(16n + 14),
.board-intro-square-grid .board-intro-square:nth-child(16n + 16) {
  background: var(--board-light-square);
}

.board-intro-square-grid .board-intro-square.is-demo-square-outline-drawing,
.board-intro-square-grid .board-intro-square.is-demo-square-outline-drawn,
.board-intro-square-grid .board-intro-square.is-demo-diagonal-outline-drawing,
.board-intro-square-grid .board-intro-square.is-demo-diagonal-outline-drawn {
  z-index: 2;
}

.board-outline-drawer {
  --outline-color: var(--square-outline-color, var(--board-outline-square));
  --outline-thickness: 10%;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  position: absolute;
}

.board-outline-edge {
  background: var(--outline-color);
  opacity: 1;
  position: absolute;
}

.board-outline-edge-top,
.board-outline-edge-bottom {
  height: var(--outline-y-thickness, var(--outline-thickness));
  left: 0;
  transform: scaleX(0);
  width: 100%;
}

.board-outline-edge-top {
  top: 0;
  transform-origin: left center;
}

.board-outline-edge-bottom {
  bottom: 0;
  transform-origin: right center;
}

.board-outline-edge-right,
.board-outline-edge-left {
  height: 100%;
  top: 0;
  transform: scaleY(0);
  width: var(--outline-x-thickness, var(--outline-thickness));
}

.board-outline-edge-right {
  right: 0;
  transform-origin: center top;
}

.board-outline-edge-left {
  left: 0;
  transform-origin: center bottom;
}

.board-intro-square.is-demo-square-outline-drawing .board-square-outline-drawer,
.board-intro-square.is-demo-square-outline-drawn .board-square-outline-drawer,
.board-intro-square.is-demo-diagonal-outline-drawing .board-square-outline-drawer,
.board-intro-square.is-demo-diagonal-outline-drawn .board-square-outline-drawer {
  opacity: 1;
}

.board-intro-square.is-demo-square-outline-drawing .board-outline-edge-top {
  animation: boardOutlineDrawX 450ms linear var(--square-outline-delay, 0ms) both;
}

.board-intro-square.is-demo-square-outline-drawing .board-outline-edge-right {
  animation: boardOutlineDrawY 450ms linear calc(var(--square-outline-delay, 0ms) + 450ms) both;
}

.board-intro-square.is-demo-square-outline-drawing .board-outline-edge-bottom {
  animation: boardOutlineDrawX 450ms linear calc(var(--square-outline-delay, 0ms) + 900ms) both;
}

.board-intro-square.is-demo-square-outline-drawing .board-outline-edge-left {
  animation: boardOutlineDrawY 450ms linear calc(var(--square-outline-delay, 0ms) + 1350ms) both;
}

.board-intro-square.is-demo-square-outline-drawn .board-outline-edge-top,
.board-intro-square.is-demo-square-outline-drawn .board-outline-edge-bottom {
  transform: scaleX(1);
}

.board-intro-square.is-demo-square-outline-drawn .board-outline-edge-right,
.board-intro-square.is-demo-square-outline-drawn .board-outline-edge-left {
  transform: scaleY(1);
}

.board-intro-square.is-demo-square-outline-drawn.is-demo-square-outline-breathing .board-square-outline-drawer {
  animation: boardSquareOutlineBreath 900ms ease-in-out 3;
}

.board-intro-square.is-demo-diagonal-outline-drawing .board-outline-edge-top {
  animation: boardOutlineDrawX 450ms linear var(--square-outline-delay, 0ms) both;
}

.board-intro-square.is-demo-diagonal-outline-drawing .board-outline-edge-right {
  animation: boardOutlineDrawY 450ms linear calc(var(--square-outline-delay, 0ms) + 450ms) both;
}

.board-intro-square.is-demo-diagonal-outline-drawing .board-outline-edge-bottom {
  animation: boardOutlineDrawX 450ms linear calc(var(--square-outline-delay, 0ms) + 900ms) both;
}

.board-intro-square.is-demo-diagonal-outline-drawing .board-outline-edge-left {
  animation: boardOutlineDrawY 450ms linear calc(var(--square-outline-delay, 0ms) + 1350ms) both;
}

.board-intro-square.is-demo-diagonal-outline-drawn .board-outline-edge-top,
.board-intro-square.is-demo-diagonal-outline-drawn .board-outline-edge-bottom {
  transform: scaleX(1);
}

.board-intro-square.is-demo-diagonal-outline-drawn .board-outline-edge-right,
.board-intro-square.is-demo-diagonal-outline-drawn .board-outline-edge-left {
  transform: scaleY(1);
}

.board-intro-square.is-demo-line-masked::before {
  animation: boardLineMaskBreath 1200ms ease-in-out infinite;
  background: rgba(255, 246, 214, 0.46);
  content: "";
  inset: 0;
  pointer-events: none;
  position: absolute;
  z-index: 1;
}

.board-intro-square.is-demo-line-masked .board-square-outline-drawer {
  z-index: 2;
}

.board-coordinate-layer {
  font-size: clamp(12px, 1.1vw, 18px);
  font-weight: 1000;
  inset: 0;
  line-height: 1;
  pointer-events: none;
  position: absolute;
  transition: opacity 160ms ease, visibility 160ms ease;
  z-index: 3;
}

.board-coordinate-layer.is-hidden {
  opacity: 0;
  visibility: hidden;
}

.board-coordinate-files,
.board-coordinate-ranks {
  display: grid;
  inset: 0;
  position: absolute;
}

.board-coordinate-files {
  grid-template-columns: repeat(8, minmax(0, 1fr));
}

.board-coordinate-ranks {
  grid-template-rows: repeat(8, minmax(0, 1fr));
}

.board-coordinate-file {
  align-self: end;
  justify-self: end;
  padding: 0 5px 4px 0;
}

.board-coordinate-rank {
  align-self: start;
  justify-self: start;
  padding: 5px 0 0 5px;
}

.board-coordinate-file:nth-child(odd),
.board-coordinate-rank:nth-child(even) {
  color: #fff4d7;
  text-shadow: 0 1px 2px rgba(62, 25, 10, 0.68);
}

.board-coordinate-file:nth-child(even),
.board-coordinate-rank:nth-child(odd) {
  color: #6b2e17;
  text-shadow: 0 1px 1px rgba(255, 248, 226, 0.72);
}

.board-intro-number-overlay,
.board-intro-line-overlay,
.board-intro-region-overlay {
  inset: 0;
  pointer-events: none;
  position: absolute;
  z-index: 2;
}

.board-intro-number-overlay {
  align-items: center;
  color: #123f86;
  display: flex;
  font-size: clamp(180px, calc(var(--board-intro-size) * 0.42), 360px);
  font-weight: 1000;
  justify-content: center;
  opacity: 0;
  text-shadow:
    0 7px 0 rgba(10, 45, 100, 0.28),
    0 0 26px rgba(255, 255, 255, 0.72);
  transform: scale(0.72) rotate(-5deg);
  transition: opacity 260ms ease, transform 360ms cubic-bezier(0.16, 1, 0.3, 1);
}

.board-intro-number-overlay.is-visible {
  animation: boardNumberPop 1100ms ease both;
  opacity: 1;
  transform: scale(1) rotate(0deg);
}

@keyframes boardNumberPop {
  0% {
    transform: scale(0.66) rotate(-7deg);
  }

  55% {
    transform: scale(1.12) rotate(2deg);
  }

  100% {
    transform: scale(1) rotate(0deg);
  }
}

.board-intro-line-overlay::before,
.board-intro-line-overlay::after,
.board-intro-region-overlay::before,
.board-intro-region-overlay::after {
  content: "";
  position: absolute;
}

.board-intro-line-overlay,
.board-intro-region-overlay {
  position: relative;
}

.board-intro-line-overlay[data-line]::before {
  animation: boardLineDraw 1200ms ease both;
  background: var(--board-mark-line);
  border-radius: 999px;
  box-shadow:
    0 0 0 5px rgba(56, 189, 248, 0.22),
    0 0 24px rgba(56, 189, 248, 0.62);
}

.board-intro-line-overlay[data-line="file-line"]::before {
  bottom: 0;
  left: calc(50% - 5px);
  top: 0;
  width: 10px;
}

.board-intro-line-overlay[data-line="rank-line"]::before {
  height: 10px;
  left: 0;
  right: 0;
  top: calc(50% - 5px);
}

.board-intro-line-overlay[data-line="diagonal-line"]::before {
  height: 10px;
  left: -18%;
  top: calc(50% - 5px);
  transform: rotate(45deg);
  transform-origin: center;
  width: 136%;
}

@keyframes boardLineDraw {
  from {
    opacity: 0;
    clip-path: inset(0 100% 0 0);
  }

  to {
    opacity: 1;
    clip-path: inset(0 0 0 0);
  }
}

.board-full-outline-drawer {
  --outline-color: var(--board-outline-board);
  --outline-thickness: 1.25%;
  z-index: 4;
}

.board-file-outline-drawer {
  --outline-color: var(--board-outline-file-line);
  --outline-thickness: 1.25%;
  --outline-x-thickness: 10%;
  --outline-y-thickness: 1.25%;
  height: 100%;
  left: var(--file-line-left, 25%);
  top: 0;
  width: 12.5%;
  z-index: 4;
}

.board-rank-outline-drawer {
  --outline-color: var(--board-outline-rank-line);
  --outline-thickness: 1.25%;
  --outline-x-thickness: 1.25%;
  --outline-y-thickness: 10%;
  height: 12.5%;
  left: 0;
  top: var(--rank-line-top, 25%);
  width: 100%;
  z-index: 4;
}

.board-file-outline-drawer.is-line-mask-breathing::before,
.board-rank-outline-drawer.is-line-mask-breathing::before,
.board-region-outline-drawer.is-line-mask-breathing::before {
  animation: boardLineMaskBreath 1200ms ease-in-out infinite;
  background: rgba(255, 246, 214, 0.46);
  content: "";
  inset: 0;
  pointer-events: none;
  position: absolute;
  z-index: 1;
}

.board-region-outline-drawer {
  --outline-thickness: 1.25%;
  filter: drop-shadow(0 0 10px color-mix(in srgb, var(--outline-color) 70%, transparent));
  z-index: 4;
}

.board-region-outline-center {
  --outline-color: var(--board-outline-center);
  --outline-x-thickness: 5%;
  --outline-y-thickness: 5%;
  height: 25%;
  left: 37.5%;
  top: 37.5%;
  width: 25%;
}

.board-region-outline-back-rank {
  --outline-color: var(--board-outline-back-rank);
  --outline-x-thickness: 1.25%;
  --outline-y-thickness: 10%;
  height: 12.5%;
  left: 0;
  width: 100%;
}

.board-region-outline-back-rank-top {
  top: 0;
}

.board-region-outline-back-rank-bottom {
  top: 87.5%;
}

.board-region-outline-edge-line {
  --outline-color: var(--board-outline-edge-line);
  --outline-x-thickness: 10%;
  --outline-y-thickness: 1.25%;
  height: 100%;
  top: 0;
  width: 12.5%;
}

.board-region-outline-edge-line-left {
  left: 0;
}

.board-region-outline-edge-line-right {
  left: 87.5%;
}

.board-full-outline-drawer.is-outline-drawing,
.board-full-outline-drawer.is-outline-drawn,
.board-file-outline-drawer.is-outline-drawing,
.board-file-outline-drawer.is-outline-drawn,
.board-rank-outline-drawer.is-outline-drawing,
.board-rank-outline-drawer.is-outline-drawn,
.board-region-outline-drawer.is-outline-drawing,
.board-region-outline-drawer.is-outline-drawn {
  opacity: 1;
}

.board-full-outline-drawer.is-outline-drawing .board-outline-edge-top,
.board-file-outline-drawer.is-outline-drawing .board-outline-edge-top,
.board-rank-outline-drawer.is-outline-drawing .board-outline-edge-top,
.board-region-outline-drawer.is-outline-drawing .board-outline-edge-top {
  animation: boardOutlineDrawX 800ms linear both;
}

.board-full-outline-drawer.is-outline-drawing .board-outline-edge-right,
.board-file-outline-drawer.is-outline-drawing .board-outline-edge-right,
.board-rank-outline-drawer.is-outline-drawing .board-outline-edge-right,
.board-region-outline-drawer.is-outline-drawing .board-outline-edge-right {
  animation: boardOutlineDrawY 800ms linear 800ms both;
}

.board-full-outline-drawer.is-outline-drawing .board-outline-edge-bottom,
.board-file-outline-drawer.is-outline-drawing .board-outline-edge-bottom,
.board-rank-outline-drawer.is-outline-drawing .board-outline-edge-bottom,
.board-region-outline-drawer.is-outline-drawing .board-outline-edge-bottom {
  animation: boardOutlineDrawX 800ms linear 1600ms both;
}

.board-full-outline-drawer.is-outline-drawing .board-outline-edge-left,
.board-file-outline-drawer.is-outline-drawing .board-outline-edge-left,
.board-rank-outline-drawer.is-outline-drawing .board-outline-edge-left,
.board-region-outline-drawer.is-outline-drawing .board-outline-edge-left {
  animation: boardOutlineDrawY 800ms linear 2400ms both;
}

.board-full-outline-drawer.is-outline-drawn .board-outline-edge-top,
.board-full-outline-drawer.is-outline-drawn .board-outline-edge-bottom,
.board-file-outline-drawer.is-outline-drawn .board-outline-edge-top,
.board-file-outline-drawer.is-outline-drawn .board-outline-edge-bottom,
.board-rank-outline-drawer.is-outline-drawn .board-outline-edge-top,
.board-rank-outline-drawer.is-outline-drawn .board-outline-edge-bottom,
.board-region-outline-drawer.is-outline-drawn .board-outline-edge-top,
.board-region-outline-drawer.is-outline-drawn .board-outline-edge-bottom {
  transform: scaleX(1);
}

.board-full-outline-drawer.is-outline-drawn .board-outline-edge-right,
.board-full-outline-drawer.is-outline-drawn .board-outline-edge-left,
.board-file-outline-drawer.is-outline-drawn .board-outline-edge-right,
.board-file-outline-drawer.is-outline-drawn .board-outline-edge-left,
.board-rank-outline-drawer.is-outline-drawn .board-outline-edge-right,
.board-rank-outline-drawer.is-outline-drawn .board-outline-edge-left,
.board-region-outline-drawer.is-outline-drawn .board-outline-edge-right,
.board-region-outline-drawer.is-outline-drawn .board-outline-edge-left {
  transform: scaleY(1);
}

.board-full-outline-drawer.is-outline-drawn.is-outline-breathing {
  animation: boardOutlineBreath 900ms ease-in-out 3;
}

@keyframes boardOutlineDrawX {
  from {
    transform: scaleX(0);
  }

  to {
    transform: scaleX(1);
  }
}

@keyframes boardOutlineDrawY {
  from {
    transform: scaleY(0);
  }

  to {
    transform: scaleY(1);
  }
}

@keyframes boardOutlineBreath {
  0%,
  100% {
    filter: drop-shadow(0 0 0 rgba(0, 213, 255, 0));
    opacity: 1;
  }

  50% {
    filter: drop-shadow(0 0 16px rgba(0, 213, 255, 0.95));
    opacity: 0.42;
  }
}

@keyframes boardSquareOutlineBreath {
  0%,
  100% {
    filter: drop-shadow(0 0 0 rgba(29, 233, 182, 0));
    opacity: 1;
  }

  50% {
    filter: drop-shadow(0 0 12px rgba(29, 233, 182, 0.95));
    opacity: 0.42;
  }
}

@keyframes boardLineMaskBreath {
  0%,
  100% {
    opacity: 0.58;
  }

  50% {
    opacity: 0.12;
  }
}

.chess-piece-sprite {
  height: 0;
  position: absolute;
  width: 0;
}

.chess-piece {
  --piece-body-fill: #fdf8e9;
  --piece-detail-stroke: #b87b18;
  --piece-highlight-stroke: rgba(255, 255, 255, 0.88);
  --piece-shadow-fill: rgba(24, 45, 59, 0.28);
  color: #18222d;
  display: block;
  filter: drop-shadow(0 5px 4px rgba(0, 0, 0, 0.28));
  height: var(--board-square-piece-fill);
  overflow: visible;
  transform-origin: 50% 68%;
  transition: filter 160ms ease, opacity 160ms ease, transform 160ms ease;
  width: var(--board-square-piece-fill);
  z-index: 1;
}

/* 通用棋子样式不能覆盖 hidden；备用图层必须完全退出布局和绘制。 */
.chess-piece[hidden] {
  display: none !important;
}

.chess-piece-white {
  --piece-body-fill: #fff8df;
  --piece-detail-stroke: #b87416;
  --piece-highlight-stroke: rgba(255, 255, 255, 0.95);
  --piece-shadow-fill: rgba(93, 91, 76, 0.28);
}

.chess-piece-black {
  --piece-body-fill: #25364b;
  --piece-detail-stroke: #9ad4ff;
  --piece-highlight-stroke: rgba(186, 226, 255, 0.82);
  --piece-shadow-fill: rgba(8, 22, 36, 0.45);
  color: #101820;
}

.piece-body {
  fill: var(--piece-body-fill);
  stroke: var(--piece-detail-stroke);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3.2;
}

.piece-detail {
  fill: none;
  stroke: var(--piece-detail-stroke);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3;
}

.piece-shadow {
  fill: var(--piece-shadow-fill);
  stroke: none;
}

.piece-highlight {
  fill: none;
  opacity: 0.64;
  stroke: var(--piece-highlight-stroke);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.8;
}

.chess-piece-selected {
  filter:
    drop-shadow(0 0 7px rgba(255, 243, 200, 0.9))
    drop-shadow(0 5px 4px rgba(0, 0, 0, 0.24));
  transform: translateY(-4%) scale(1.05);
}

.chess-piece-moving {
  filter:
    drop-shadow(0 0 9px rgba(126, 207, 255, 0.82))
    drop-shadow(0 8px 7px rgba(0, 0, 0, 0.2));
  transform: translateY(-10%) scale(1.04);
}

.chess-piece-capturing {
  filter:
    drop-shadow(0 0 10px rgba(255, 138, 112, 0.9))
    drop-shadow(0 6px 5px rgba(0, 0, 0, 0.26));
  transform: scale(1.1) rotate(-3deg);
}

.chess-piece-captured {
  opacity: 0;
  transform: translateY(18%) scale(0.72);
}

.board-intro-side-panel {
  --board-panel-step-button-height: 48px;
  background: transparent;
  background-image: none;
  border: 0;
  border-radius: 0;
  box-sizing: border-box;
  box-shadow: none;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  height: var(--board-intro-size);
  min-width: 0;
  overflow: hidden;
  padding: 0;
  width: var(--board-intro-panel-width);
}

.board-panel-radio {
  display: none;
}

.board-panel-mode-tabs {
  align-items: flex-end;
  background: transparent;
  border-left: 0;
  border-right: 0;
  border-top: 0;
  border-radius: 0;
  display: flex;
  gap: 0;
  min-height: 56px;
  padding: 0;
}

.board-panel-mode-tab {
  align-items: center;
  background: #f6f4ee;
  border: 1px solid rgba(143, 195, 226, 0.9);
  border-bottom: 0;
  border-radius: 14px 14px 0 0;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 -1px 0 rgba(255, 255, 255, 0.7);
  color: #1661a6;
  cursor: pointer;
  display: inline-flex;
  flex: 1 1 50%;
  font-size: 20px;
  font-weight: 900;
  gap: 10px;
  justify-content: center;
  min-height: 51px;
  min-width: 0;
  padding: 9px 20px 10px;
  position: relative;
  text-align: center;
  transform: translateY(1px);
  transition: background 160ms ease, border-color 160ms ease, box-shadow 160ms ease, color 160ms ease, transform 160ms ease;
  z-index: 1;
}

.board-panel-mode-tab-teacher {
  border-radius: 14px 14px 0 0;
  color: #2b7eb6;
}

.board-panel-mode-tab-student {
  border-radius: 14px 14px 0 0;
  color: #409568;
  margin-left: -1px;
}

.board-panel-mode-icon {
  align-items: center;
  background: transparent;
  border-radius: 11px;
  display: inline-flex;
  font-size: 20px;
  height: 34px;
  justify-content: center;
  width: 34px;
}

.board-panel-mode-icon .function-icon-teaching,
.board-panel-mode-icon .function-icon-interaction {
  height: 27px;
  object-fit: contain;
  width: 27px;
}

.board-panel-mode-tab-teacher .function-icon-teaching {
  filter: invert(40%) sepia(82%) saturate(1020%) hue-rotate(174deg) brightness(94%) contrast(87%) drop-shadow(0 2px 1px rgba(18, 88, 145, 0.28));
}

.board-panel-mode-tab-student .function-icon-interaction {
  filter: invert(48%) sepia(31%) saturate(1041%) hue-rotate(96deg) brightness(91%) contrast(86%) drop-shadow(0 2px 1px rgba(34, 132, 84, 0.26));
}

#board-panel-teacher:checked ~ .board-panel-mode-tabs .board-panel-mode-tab-teacher,
#board-panel-student:checked ~ .board-panel-mode-tabs .board-panel-mode-tab-student {
  background: #fffdf6;
  border-color: #74bce9;
  box-shadow:
    0 -3px 9px rgba(35, 133, 232, 0.12),
    0 2px 0 #fffdf6;
  transform: translateY(1px);
  z-index: 3;
}

#board-panel-teacher:checked ~ .board-panel-mode-tabs .board-panel-mode-tab-teacher {
  color: #0f558b;
}

#board-panel-student:checked ~ .board-panel-mode-tabs .board-panel-mode-tab-student {
  color: #218f59;
}

#board-panel-teacher:checked ~ .board-panel-mode-tabs .board-panel-mode-tab-teacher::after,
#board-panel-student:checked ~ .board-panel-mode-tabs .board-panel-mode-tab-student::after {
  background: #fffdf6;
  bottom: -1px;
  content: "";
  height: 2px;
  left: 0;
  position: absolute;
  right: 0;
}

#board-panel-teacher:checked ~ .board-panel-mode-tabs .board-panel-mode-tab-teacher .board-panel-mode-icon,
#board-panel-student:checked ~ .board-panel-mode-tabs .board-panel-mode-tab-student .board-panel-mode-icon {
  background: transparent;
  color: #2385e8;
}

#board-panel-teacher:checked ~ .board-panel-mode-tabs .board-panel-mode-tab-teacher .function-icon-teaching {
  filter: invert(29%) sepia(86%) saturate(1141%) hue-rotate(175deg) brightness(86%) contrast(91%) drop-shadow(0 3px 2px rgba(12, 73, 122, 0.34));
}

#board-panel-student:checked ~ .board-panel-mode-tabs .board-panel-mode-tab-student .board-panel-mode-icon {
  background: transparent;
  color: #218f59;
}

#board-panel-student:checked ~ .board-panel-mode-tabs .board-panel-mode-tab-student .function-icon-interaction {
  filter: invert(43%) sepia(59%) saturate(687%) hue-rotate(96deg) brightness(90%) contrast(90%) drop-shadow(0 3px 2px rgba(24, 107, 65, 0.34));
}

.board-panel-course {
  background: #fffdf6;
  border-left: 1px solid rgba(116, 188, 233, 0.88);
  border-right: 1px solid rgba(116, 188, 233, 0.88);
  border-top: 0;
  min-height: 0;
  overflow: hidden;
  padding: 18px 18px 16px;
}

.lesson-console-topic-pages {
  margin-top: 0;
  min-height: 0;
  overflow: hidden;
}

.lesson-console-topic-page {
  display: none;
}

.lesson-console-topic-page.is-active {
  display: block;
}

.lesson-console-action-list {
  display: grid;
  gap: 12px;
}

.lesson-console-action {
  align-items: center;
  background: #ffffff;
  border: 2px solid #bfe2f5;
  border-radius: 14px;
  box-shadow:
    0 2px 0 rgba(191, 226, 245, 0.34),
    0 6px 12px rgba(35, 133, 232, 0.06);
  color: #153449;
  cursor: pointer;
  display: flex;
  flex-wrap: wrap;
  font-size: 22px;
  font-weight: 1000;
  gap: 8px;
  justify-content: flex-start;
  min-height: 62px;
  padding: 12px 14px;
  text-align: left;
  transition: border-color 160ms ease, box-shadow 160ms ease, opacity 180ms ease, transform 160ms ease;
}

.lesson-console-action.is-waiting {
  display: none;
}

.lesson-console-action.is-playing {
  cursor: wait;
  filter: saturate(1.18);
}

.lesson-console-action.is-static {
  cursor: default;
}

.lesson-console-action:hover {
  border-color: #ffb83d;
  box-shadow:
    0 2px 0 rgba(255, 184, 61, 0.22),
    0 7px 14px rgba(255, 138, 29, 0.08);
  transform: translateY(-1px);
}

.lesson-console-action.is-static:hover {
  border-color: #bfe2f5;
  box-shadow:
    0 2px 0 rgba(191, 226, 245, 0.34),
    0 6px 12px rgba(35, 133, 232, 0.06);
  transform: none;
}

.lesson-console-action-readonly,
.lesson-console-action[data-readonly-teaching="true"] {
  cursor: default;
  pointer-events: none;
}

.lesson-console-action-readonly:hover,
.lesson-console-action[data-readonly-teaching="true"]:hover {
  border-color: #bfe2f5;
  box-shadow:
    0 2px 0 rgba(191, 226, 245, 0.34),
    0 6px 12px rgba(35, 133, 232, 0.06);
  transform: none;
}

.lesson-console-action-label {
  white-space: nowrap;
}

.lesson-console-answer {
  color: #ff6d2d;
  display: inline-block;
  max-width: 0;
  opacity: 0;
  overflow: hidden;
  transform: translateY(6px);
  transition: max-width 320ms ease, opacity 220ms ease, transform 220ms ease;
  white-space: nowrap;
}

.lesson-console-action.is-revealed .lesson-console-answer {
  max-width: 260px;
  opacity: 1;
  transform: translateY(0);
}

.lesson-console-action[data-effect="count-64"] .lesson-console-answer {
  font-size: 26px;
  margin-left: 0.35em;
}

.lesson-console-action[data-effect="count-64"] {
  column-gap: 0;
}

.lesson-console-answer-count-row {
  align-items: baseline;
  display: inline-flex;
  min-width: 0;
  white-space: nowrap;
}

.lesson-console-answer-count-dark {
  color: #1d3958;
}

.lesson-console-answer-count-light {
  color: #2b6cb0;
}

.lesson-console-answer-count-value {
  color: #123f86;
  font-weight: 1000;
}

.lesson-console-count-breakdown {
  display: grid;
  font-size: 26px;
  font-weight: 1000;
  gap: 5px;
  justify-items: start;
  line-height: 1.12;
  margin: -2px 0 8px 18px;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transform: translateY(-8px);
  transition: max-height 320ms ease, opacity 220ms ease, transform 220ms ease;
}

.lesson-console-action.is-revealed + .lesson-console-count-breakdown {
  max-height: 130px;
  opacity: 1;
  transform: translateY(0);
}

.lesson-console-topic-note {
  color: #2b6cb0;
  font-size: 22px;
  font-weight: 1000;
  line-height: 1.25;
  margin: 4px 0 0;
  text-align: center;
  width: 100%;
}

.lesson-console-palette-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.lesson-console-color-reminder {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 3px;
  justify-content: center;
  margin: 12px 0 0;
  padding: 0;
  text-align: center;
  width: 100%;
}

.lesson-console-color-reminder-title {
  color: #e63946;
  font-size: 30px;
  font-weight: 1000;
  line-height: 1.12;
}

.lesson-console-color-reminder-text {
  color: #f28c28;
  font-size: 28px;
  font-weight: 1000;
  line-height: 1.22;
}

.lesson-console-color-reminder:hover .lesson-console-color-reminder-title,
.lesson-console-color-reminder:focus-visible .lesson-console-color-reminder-title {
  color: #c92d3a;
}

.lesson-console-color-reminder:hover .lesson-console-color-reminder-text,
.lesson-console-color-reminder:focus-visible .lesson-console-color-reminder-text {
  color: #d96d10;
}

.lesson-console-color-reminder:focus-visible {
  outline: 0;
  text-decoration: underline;
}

.lesson-console-mini-board {
  aspect-ratio: 1;
  background: #fffdf6;
  border: 3px solid #bfe2f5;
  border-radius: 12px;
  box-shadow: 0 3px 8px rgba(22, 52, 73, 0.18);
  cursor: pointer;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  grid-template-rows: repeat(8, 1fr);
  overflow: hidden;
  padding: 4px;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.lesson-console-mini-board span {
  background: var(--mini-board-dark);
  min-height: 0;
  min-width: 0;
}

.lesson-console-mini-board span:nth-child(16n + 1),
.lesson-console-mini-board span:nth-child(16n + 3),
.lesson-console-mini-board span:nth-child(16n + 5),
.lesson-console-mini-board span:nth-child(16n + 7),
.lesson-console-mini-board span:nth-child(16n + 10),
.lesson-console-mini-board span:nth-child(16n + 12),
.lesson-console-mini-board span:nth-child(16n + 14),
.lesson-console-mini-board span:nth-child(16n + 16) {
  background: var(--mini-board-light);
}

.lesson-console-mini-board:hover,
.lesson-console-mini-board.is-selected {
  border-color: #ffb83d;
  box-shadow: 0 4px 10px rgba(22, 52, 73, 0.22);
  transform: translateY(-2px) rotate(-1deg);
}

.board-panel-page {
  display: none;
}

#board-panel-teacher:checked ~ .board-panel-course .board-panel-page-teacher,
#board-panel-student:checked ~ .board-panel-course .board-panel-page-student {
  display: block;
}

#board-panel-teacher:checked ~ .board-panel-course .board-panel-page-teacher {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  height: 100%;
  min-height: 0;
}

.interaction-topic-pages {
  height: 100%;
  min-height: 0;
}

.interaction-topic-page {
  display: none;
  min-height: 0;
}

.interaction-topic-page.is-active {
  --interaction-feedback-edge-gap: clamp(8px, 1.6cqb, 14px);
  --interaction-question-frame-size: clamp(68px, min(38cqi, 25cqb), 156px);
  --interaction-topic-text-gap: clamp(8px, 3cqi, 12px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  height: 100%;
  min-height: 100%;
  overflow: hidden;
  row-gap: calc(var(--interaction-feedback-edge-gap) * 2);
}

.interaction-topic-page.is-active:has(.interaction-topic-question-heading) {
  grid-template-rows: auto auto minmax(0, 1fr);
}

.interaction-topic-page.is-active[data-interaction-topic-key="memory_challenge"] {
  grid-template-rows: auto auto minmax(0, 1fr);
}

.interaction-topic-page.is-active > :not(.interaction-feedback-score) {
  min-height: 0;
  overflow: hidden;
}

#board-panel-student:checked ~ .board-panel-course .board-panel-page-student {
  display: grid;
  height: 100%;
  min-height: 0;
}

.board-panel-page-student .board-panel-tools {
  background: transparent;
  border-top: 0;
  container-type: size;
  display: grid;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  padding: 0;
}

.lesson-console-topic-tools-pages {
  height: 100%;
  margin: 0;
  padding: 0;
}

.lesson-console-topic-tool-page {
  display: none;
  gap: 8px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  height: 100%;
}

.lesson-console-topic-tool-page.is-active {
  display: grid;
}

.lesson-console-topic-tool-page.is-empty {
  display: none;
}

.lesson-console-topic-tool-button {
  align-items: center;
  background: #ffffff;
  border: 2px solid #bfe2f5;
  border-radius: 50%;
  box-shadow: 0 3px 7px rgba(35, 133, 232, 0.12);
  color: #153449;
  cursor: pointer;
  display: flex;
  justify-self: center;
  aspect-ratio: 1;
  font-size: 16px;
  justify-content: center;
  line-height: 1.15;
  max-width: var(--board-panel-function-button-size);
  min-height: 0;
  padding: 0;
  position: relative;
  text-align: center;
  width: 100%;
}

.lesson-console-topic-tool-button:hover:not(:disabled) {
  border-color: #ffb83d;
  box-shadow: 0 4px 9px rgba(255, 138, 29, 0.16);
  transform: translateY(-1px);
}

.lesson-console-topic-tool-button:disabled {
  background: #f4f8fa;
  color: #8aa1b1;
  cursor: default;
  opacity: 0.72;
}

.board-panel-page h2 {
  color: #153449;
  font-size: 30px;
  line-height: 1.15;
  margin: 10px 0 12px;
}

.board-panel-page .tag {
  align-items: center;
  background: #e7f6ff;
  border: 1px solid #bfe2f5;
  border-radius: 999px;
  color: #1661a6;
  display: inline-flex;
  font-size: 14px;
  font-weight: 900;
  margin: 0;
  padding: 6px 12px;
}

.board-panel-summary,
.board-panel-page li,
.board-panel-prompt {
  color: #153449;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.45;
}

.board-panel-page ol {
  display: grid;
  gap: 10px;
  margin: 16px 0 0;
  padding-left: 24px;
}

.board-panel-page li {
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(191, 226, 245, 0.82);
  border-radius: 8px;
  padding: 8px 10px;
}

.board-panel-prompt {
  background: #fff9ee;
  border-left: 6px solid #ff8617;
  border-radius: 8px;
  margin-top: 18px;
  padding: 16px;
}

.board-panel-tools {
  background: rgba(231, 246, 255, 0.94);
  border-top: 1px solid #bfe2f5;
  padding: 16px;
}

.interaction-placeholder-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.interaction-placeholder-button {
  aspect-ratio: 1;
  border-radius: 12px;
  font-size: 16px;
  line-height: 1.2;
  min-height: 0;
  padding: 8px;
}

.piece-value-compare-content {
  align-content: stretch;
  display: grid;
  gap: clamp(10px, 2cqi, 18px);
  grid-template-rows: minmax(0, 1fr);
  height: 100%;
  min-height: 0;
}

.piece-value-compare-board-overlay {
  align-items: stretch;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(195, 220, 235, 0.92);
  border-radius: 6px;
  box-shadow: 0 12px 28px rgba(28, 68, 94, 0.2);
  box-sizing: border-box;
  display: grid;
  inset: 5.5%;
  padding: clamp(12px, 2.4vw, 28px);
  position: absolute;
  z-index: 70;
}

.piece-value-compare-board-overlay[hidden] {
  display: none;
}

.piece-value-compare-board-card {
  height: 100%;
  min-height: 0;
  position: relative;
}

.piece-value-compare-board-question {
  align-items: start;
  display: grid;
  gap: clamp(4px, 1.2cqi, 10px);
  grid-template-columns: auto minmax(0, 1fr);
  left: 0;
  min-height: 0;
  position: absolute;
  right: 0;
  top: var(--piece-value-compare-question-top);
  transform: translateY(calc(clamp(32px, 7cqi, 58px) / -2));
}

.piece-value-compare-board-question:nth-child(1) {
  --piece-value-compare-question-top: 29%;
}

.piece-value-compare-board-question:nth-child(2) {
  --piece-value-compare-question-top: 71%;
}

.piece-value-compare-question-number {
  color: #153449;
  align-self: start;
  font-size: clamp(28px, 5cqi, 46px);
  font-weight: 1000;
  line-height: 1;
  padding-top: clamp(2px, 0.4cqi, 5px);
}

.piece-value-compare-workbench {
  align-items: start;
  align-self: stretch;
  display: grid;
  gap: clamp(6px, 1.6cqi, 14px);
  grid-template-columns: minmax(0, 1fr) clamp(36px, 7.5cqi, 68px) minmax(0, 1fr);
  min-height: 0;
}

.piece-value-compare-side {
  align-content: start;
  align-items: start;
  display: grid;
  gap: clamp(4px, 1.1cqi, 10px);
  grid-template-rows: minmax(0, 1fr) auto;
  justify-items: center;
  min-height: 0;
  min-width: 0;
}

.piece-value-compare-piece-row {
  align-items: center;
  display: flex;
  flex-wrap: nowrap;
  gap: clamp(2px, 0.6cqi, 7px);
  justify-content: center;
  min-height: 0;
  min-width: 0;
  width: 100%;
}

.piece-value-compare-board-workbench {
  grid-template-columns: minmax(0, 1fr) clamp(38px, 7.8cqi, 70px) minmax(0, 1fr);
}

.piece-value-compare-piece {
  aspect-ratio: 1;
  display: block;
  flex: 0 0 auto;
  height: clamp(32px, 7cqi, 58px);
  max-width: none;
  width: auto;
}

.piece-value-compare-divider {
  --piece-value-divider-line-bottom: clamp(14px, 2.8cqi, 24px);
  --piece-value-divider-line-height: clamp(4px, 0.7cqb, 7px);
  align-self: start;
  height: clamp(62px, 13cqi, 92px);
  position: relative;
  width: 100%;
}

.piece-value-compare-divider::before {
  background: #d62f2f;
  border-radius: 999px;
  box-shadow: 0 0 0 1px rgba(214, 47, 47, 0.08);
  bottom: var(--piece-value-divider-line-bottom);
  content: "";
  height: var(--piece-value-divider-line-height);
  left: 0;
  position: absolute;
  right: 0;
}

.piece-value-compare-divider-answer {
  bottom: calc(var(--piece-value-divider-line-bottom) + var(--piece-value-divider-line-height) + clamp(2px, 0.5cqi, 5px));
  color: #35b978;
  display: inline-flex;
  font-size: clamp(38px, 8.5cqi, 64px);
  font-weight: 1000;
  justify-content: center;
  left: 50%;
  line-height: 1;
  opacity: 0;
  position: absolute;
  transform: translateX(-50%);
  transition: opacity 140ms ease;
}

.piece-value-compare-divider-answer.is-popping {
  animation: pieceValueCompareAnswerPop 260ms ease-out both;
}

.piece-value-compare-divider-answer.is-pending {
  color: #153449;
}

.piece-value-compare-divider-answer.is-correct {
  color: #35b978;
}

.piece-value-compare-divider-answer.is-wrong {
  color: #d95757;
}

.piece-value-compare-divider-answer.is-revealed {
  opacity: 1;
}

@keyframes pieceValueCompareAnswerPop {
  0% { opacity: 0; transform: translateX(-50%) translateY(8px) scale(0.68); }
  70% { opacity: 1; transform: translateX(-50%) translateY(-2px) scale(1.12); }
  100% { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
}

.piece-value-compare-total {
  font-size: 0;
  line-height: 1.15;
  text-align: center;
}

.piece-value-compare-total-value {
  display: inline-block;
  color: #d62f2f;
  font-size: clamp(30px, 6.5cqi, 50px);
  font-weight: 1000;
  min-width: 1.2ch;
  visibility: hidden;
}

.piece-value-compare-total.is-revealed .piece-value-compare-total-value {
  visibility: visible;
}

.piece-value-compare-choice-grid {
  display: grid;
  gap: clamp(12px, 3cqi, 22px);
  grid-template-columns: repeat(3, minmax(0, 1fr));
  width: 100%;
}

.piece-value-compare-answer-panel {
  align-content: end;
  display: grid;
  gap: clamp(18px, 5cqb, 32px);
  height: 100%;
  min-height: 0;
  padding: 0 clamp(8px, 3cqi, 22px) var(--interaction-feedback-edge-gap);
}

.piece-value-compare-answer-row {
  align-items: center;
  display: grid;
  gap: clamp(8px, 2.4cqi, 16px);
  grid-template-columns: auto auto;
  justify-content: center;
}

.piece-value-compare-answer-row .piece-value-compare-question-number {
  align-self: center;
  padding-top: 0;
}

.piece-value-compare-choice-button {
  align-items: center;
  aspect-ratio: 1;
  appearance: none;
  background: #ffffff !important;
  border: clamp(3px, 0.7cqi, 5px) solid #d68a35 !important;
  border-radius: 50%;
  box-shadow: 0 5px 12px rgba(145, 77, 23, 0.14) !important;
  color: #d62f2f;
  cursor: pointer;
  display: flex;
  justify-content: center;
  justify-self: center;
  max-width: clamp(64px, 21cqi, 92px);
  padding: 0;
  transition: background-color 160ms ease, border-color 160ms ease, box-shadow 160ms ease, color 160ms ease, transform 160ms ease;
  width: 100%;
}

.piece-value-compare-choice-button img {
  display: block;
  height: 68%;
  object-fit: contain;
  width: 68%;
}

.piece-value-compare-choice-button:hover:not(:disabled),
.piece-value-compare-choice-button:focus-visible {
  background: #fff4df !important;
  border-color: #c46c20 !important;
  box-shadow: 0 7px 14px rgba(196, 108, 32, 0.2) !important;
  transform: translateY(-1px);
}

.piece-value-compare-choice-button.is-selected {
  background: #ffe9bd !important;
  border-color: #c46c20 !important;
  box-shadow: 0 7px 16px rgba(196, 108, 32, 0.26) !important;
  outline: 0;
  transform: translateY(-1px);
}

.piece-value-compare-choice-button:disabled {
  background: #fbf7ef !important;
  border-color: #dec4a4 !important;
  box-shadow: none !important;
  cursor: default;
  opacity: 0.72;
}

.piece-value-compare-choice-button.is-selected:disabled {
  background: #ffe9bd !important;
  border-color: #c46c20 !important;
  opacity: 0.82;
}

.piece-value-capture-board-overlay {
  inset: 0;
  pointer-events: none;
  position: absolute;
  z-index: 66;
}

.piece-value-capture-board-overlay[hidden] {
  display: none;
}

.piece-value-capture-piece-layer {
  inset: 0;
  position: absolute;
}

.piece-value-capture-board-piece {
  height: 12.5%;
  object-fit: contain;
  position: absolute;
  transform: translate(-50%, 50%) scale(var(--board-piece-scale));
  transition: left 360ms linear, bottom 360ms linear, opacity 180ms ease, transform 180ms ease;
  width: 12.5%;
  z-index: 2;
}

.piece-value-capture-board-piece.is-white {
  z-index: 4;
}

.piece-value-capture-board-piece.is-captured {
  opacity: 0;
  transform: translate(-50%, 50%) scale(0.42);
}

.piece-value-capture-content {
  align-content: end;
  display: grid;
  gap: clamp(8px, 1.8cqb, 14px);
  height: 100%;
  min-height: 0;
  padding: 0 clamp(10px, 3cqi, 22px) var(--interaction-feedback-edge-gap);
}

.piece-value-capture-choice-grid {
  align-items: end;
  display: grid;
  gap: clamp(18px, 5cqi, 34px);
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.interaction-topic-question.piece-value-interaction-title {
  align-self: stretch;
  color: #d62f2f;
  font-size: 24px;
  font-weight: 600;
  height: 30px;
  line-height: 30px;
  margin: 12px 0 0;
  min-height: 30px;
  overflow: hidden;
  text-align: center;
  white-space: pre-line;
}

.piece-value-capture-feedback[data-tone="correct"] {
  color: #197848;
}

.piece-value-capture-feedback[data-tone="wrong"],
.piece-value-capture-feedback[data-tone="error"] {
  color: #b42318;
}

.piece-value-capture-choice {
  align-items: center;
  display: flex;
  flex-direction: column;
  gap: clamp(4px, 0.9cqb, 8px);
  min-width: 0;
}

.piece-value-capture-choice-value {
  color: #153449;
  font-size: clamp(18px, 3.6cqi, 28px);
  font-weight: 900;
  line-height: 1.1;
  min-height: 1.1em;
  text-align: center;
}

.piece-value-capture-choice-value[hidden] {
  visibility: hidden;
}

.piece-value-capture-choice-button {
  align-items: center;
  aspect-ratio: 1;
  appearance: none;
  background: #ffffff !important;
  border: clamp(3px, 0.7cqi, 5px) solid #d68a35 !important;
  border-radius: 50%;
  box-shadow: 0 5px 12px rgba(145, 77, 23, 0.14) !important;
  color: #d62f2f;
  cursor: pointer;
  display: flex;
  justify-content: center;
  justify-self: center;
  max-width: clamp(92px, 26cqi, 136px);
  padding: 0;
  transition: background-color 160ms ease, border-color 160ms ease, box-shadow 160ms ease, color 160ms ease, transform 160ms ease;
  width: 100%;
}

.piece-value-capture-choice-button:hover:not(:disabled),
.piece-value-capture-choice-button:focus-visible {
  background: #fff4df !important;
  border-color: #c46c20 !important;
  box-shadow: 0 7px 14px rgba(196, 108, 32, 0.2) !important;
  transform: translateY(-1px);
}

.piece-value-capture-choice-button.is-selected {
  background: #ffe9bd !important;
  border-color: #c46c20 !important;
  box-shadow: 0 7px 16px rgba(196, 108, 32, 0.26) !important;
  outline: 0;
  transform: translateY(-1px);
}

.piece-value-capture-choice-button:disabled {
  background: #fbf7ef !important;
  border-color: #dec4a4 !important;
  box-shadow: none !important;
  cursor: default;
  opacity: 0.72;
}

.piece-value-capture-choice-button.is-selected:disabled {
  background: #ffe9bd !important;
  border-color: #c46c20 !important;
  opacity: 0.82;
}

.piece-value-capture-choice-button.is-correct {
  background: #e6f7e9 !important;
  border-color: #35a765 !important;
  box-shadow: 0 7px 16px rgba(53, 167, 101, 0.22) !important;
}

.piece-value-capture-choice-button.is-wrong {
  background: #fff0ef !important;
  border-color: #d95757 !important;
  box-shadow: 0 7px 16px rgba(217, 87, 87, 0.18) !important;
}

.piece-value-capture-choice-button img {
  display: block;
  height: 68%;
  object-fit: contain;
  width: 68%;
}

.silhouette-recognition-panel {
  align-content: start;
  display: grid;
  gap: var(--interaction-topic-text-gap);
  grid-template-rows: auto auto minmax(0, 1fr);
  min-height: 0;
  padding: 0 12px 3px;
}

.interaction-topic-question {
  color: #b42318;
  font-size: 24px;
  font-weight: 800;
  line-height: 1.25;
  margin: 0;
  text-align: center;
  width: 100%;
}

.piece-practice-prompt,
.rook-practice-prompt,
.bishop-practice-prompt,
.queen-practice-prompt,
.king-rebuilt-practice-prompt,
.king-capture-practice-prompt,
.pawn-practice-prompt,
.knight-practice-prompt {
  white-space: pre-line;
}

.interaction-topic-question-frame {
  align-items: center;
  background: #f7fbfe;
  border: 2px solid #93cbe8;
  border-radius: 8px;
  box-sizing: border-box;
  container-type: inline-size;
  display: flex;
  aspect-ratio: 1 / 1;
  height: auto;
  justify-content: center;
  margin: 0 auto;
  min-height: 0;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  padding: clamp(8px, 10%, 16px);
  width: min(100%, var(--interaction-question-frame-size));
}

.interaction-topic-question-frame [hidden] {
  display: none;
}

.interaction-topic-question-frame-content {
  color: #167fc4;
  font-size: clamp(24px, 56cqi, 84px);
  font-weight: 1000;
  line-height: 1;
  margin: 0;
  max-inline-size: 100%;
  min-inline-size: 0;
  overflow-wrap: anywhere;
  text-align: center;
  width: 100%;
}

.silhouette-recognition-number-controls {
  align-self: end;
  display: grid;
  gap: clamp(5px, 2cqi, 9px);
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0 auto;
  margin-top: auto;
  max-width: 100%;
  width: min(100%, clamp(150px, 52cqi, 228px));
}

.silhouette-recognition-number-button {
  align-items: center;
  aspect-ratio: 1 / 1;
  appearance: none;
  background: transparent !important;
  border: 0 !important;
  border-radius: 0;
  box-sizing: border-box;
  box-shadow: none !important;
  cursor: pointer;
  display: flex;
  justify-content: center;
  justify-self: center;
  line-height: 1;
  padding: 0;
  touch-action: manipulation;
  width: 100%;
}

.silhouette-recognition-number-icon {
  display: block;
  height: 100%;
  pointer-events: none;
  transition: filter 160ms ease, transform 160ms ease;
  width: 100%;
}

.silhouette-recognition-number-button:hover:not(:disabled) .silhouette-recognition-number-icon,
.silhouette-recognition-number-button:focus-visible .silhouette-recognition-number-icon {
  filter: drop-shadow(0 3px 3px rgba(24, 73, 112, 0.25));
  transform: scale(1.06);
}

.silhouette-recognition-number-button.is-selected {
  outline: 0;
}

.silhouette-recognition-number-button.is-selected .silhouette-recognition-number-icon,
.silhouette-recognition-number-button.is-selected:hover:not(:disabled) .silhouette-recognition-number-icon,
.silhouette-recognition-number-button.is-selected:focus-visible .silhouette-recognition-number-icon {
  filter: brightness(0) saturate(100%) invert(19%) sepia(95%) saturate(2025%) hue-rotate(345deg) brightness(95%) contrast(88%) drop-shadow(0 3px 3px rgba(180, 35, 24, 0.25));
}

.silhouette-recognition-number-button:disabled {
  cursor: default;
  opacity: 0.42;
}

.silhouette-recognition-number-button.is-selected:disabled {
  opacity: 0.72;
}

.silhouette-recognition-panel + .interaction-feedback-score {
  transform: none;
}

@container (max-height: 600px) {
  .interaction-topic-question {
    font-size: 21px;
  }
}

@container (max-height: 520px) {
  .interaction-topic-page.is-active {
    --interaction-feedback-edge-gap: 7px;
    --interaction-question-frame-size: clamp(56px, min(34cqi, 22cqb), 96px);
  }

  .piece-value-compare-choice-grid {
    width: 180px;
  }

  .silhouette-recognition-panel {
    transform: none;
  }

  .interaction-topic-question {
    font-size: 18px;
    line-height: 1.25;
  }

  .interaction-topic-question-frame {
    padding: 5px;
  }

  .silhouette-recognition-number-controls {
    width: 138px;
  }
}

@container (max-height: 320px) {
  .interaction-topic-page.is-active {
    --interaction-feedback-edge-gap: 4px;
    --interaction-question-frame-size: clamp(42px, min(28cqi, 18cqb), 64px);
  }

  .piece-value-compare-content {
    gap: 4px;
  }

  .piece-value-compare-side {
    gap: 4px;
  }

  .piece-value-compare-piece {
    height: 44px;
  }

  .piece-value-compare-choice-grid {
    gap: 10px;
    width: 160px;
  }

  .piece-value-compare-choice-button {
    font-size: 40px;
  }

  .silhouette-recognition-panel {
    gap: 2px;
    padding: 0;
  }

  .interaction-topic-question {
    font-size: 18px;
    line-height: 1.25;
  }

  .interaction-topic-question-frame {
    padding: 4px;
  }

  .silhouette-recognition-question,
  .coordinate-finder-question {
    font-size: 32px;
  }

  .silhouette-recognition-number-controls {
    gap: 3px;
    width: 96px;
  }

  .memory-challenge-score {
    gap: 4px;
    padding-inline: 24px;
  }

  .interaction-feedback-star {
    width: 36px;
  }
}

.silhouette-recognition-image-frame.is-revealing {
  animation: silhouetteRecognitionReveal 360ms ease-out both;
}

@keyframes silhouetteRecognitionReveal {
  from { opacity: 0; transform: scale(0.86); }
  to { opacity: 1; transform: scale(1); }
}

.silhouette-recognition-overlay {
  align-items: stretch;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(195, 220, 235, 0.92);
  border-radius: 6px;
  box-shadow: 0 12px 28px rgba(28, 68, 94, 0.2);
  box-sizing: border-box;
  display: grid;
  inset: 5.5%;
  padding: clamp(12px, 2.4vw, 28px);
  position: absolute;
  z-index: 70;
}

.silhouette-recognition-overlay[hidden] {
  display: none;
}

.piece-setup-judgment-overlay {
  background: rgba(255, 255, 255, 0.08);
  inset: 0;
  pointer-events: none;
  position: absolute;
  z-index: 64;
}

.piece-setup-judgment-overlay[hidden] {
  display: none;
}

.piece-position-matching-board-overlay {
  inset: 0;
  pointer-events: none;
  position: absolute;
  z-index: 65;
}

.piece-position-matching-board-overlay[hidden] {
  display: none;
}

.piece-position-matching-board-piece-layer {
  inset: 0;
  position: absolute;
}

.piece-position-matching-board-piece {
  height: 12.5%;
  object-fit: contain;
  position: absolute;
  transform: translate(-50%, 50%) scale(.84);
  width: 12.5%;
}

.piece-setup-judgment-piece-layer {
  inset: 0;
  position: absolute;
}

.piece-setup-judgment-piece {
  height: 12.5%;
  object-fit: contain;
  pointer-events: none;
  position: absolute;
  transform: translate(-50%, 50%) scale(.8);
  width: 12.5%;
}

.piece-setup-judgment-content {
  --square-judgment-choice-offset: clamp(24px, calc(5cqb + 8px), 46px);
  align-content: start;
  display: grid;
  gap: clamp(12px, 2.4cqi, 22px);
  grid-template-rows: auto minmax(0, 1fr);
  height: 100%;
  min-height: 0;
}

.piece-setup-judgment-prompt {
  text-align: center;
}

.piece-position-matching-content {
  align-content: start;
  display: grid;
  gap: clamp(12px, 2.4cqi, 22px);
  grid-template-rows: auto minmax(0, 1fr);
  height: 100%;
  min-height: 0;
  padding: 0 8px 4px;
}

.piece-position-observation-prompt {
  text-align: center;
}

.piece-position-matching-choice-area {
  align-items: stretch;
  align-self: end;
  container-type: inline-size;
  display: grid;
  gap: clamp(20px, 5cqi, 34px);
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: clamp(2px, 1cqb, 8px);
  min-height: 0;
  padding: clamp(2px, .6cqi, 6px) clamp(2px, 1cqi, 8px);
  position: relative;
}

.piece-position-matching-choice-column {
  display: grid;
  align-content: start;
  gap: clamp(4px, 1cqi, 8px);
  grid-template-rows: repeat(3, auto);
  min-height: 0;
  position: relative;
  z-index: 2;
}

.piece-position-matching-choice {
  align-items: center;
  aspect-ratio: 1;
  background: #ffffff !important;
  border: 3px solid #167fc4 !important;
  border-radius: 4px;
  box-shadow: 0 3px 0 rgba(22, 127, 196, 0.22), 0 8px 14px rgba(22, 127, 196, 0.12);
  color: #153449;
  cursor: pointer;
  display: flex;
  justify-content: center;
  justify-self: center;
  max-height: 100%;
  max-width: clamp(70px, 22cqi, 118px);
  min-height: 0;
  min-width: 0;
  padding: 8px;
  position: relative;
  transition: background-color 160ms ease, border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
  width: min(100%, clamp(70px, 22cqi, 118px));
}

.piece-position-matching-choice:hover:not(:disabled),
.piece-position-matching-choice:focus-visible {
  background: #d7ecff !important;
  border-color: #0f63b3 !important;
  box-shadow: 0 4px 0 rgba(35, 133, 232, 0.2);
  transform: translateY(-1px);
}

.piece-position-matching-choice:focus-visible {
  outline: 3px solid rgba(255, 184, 61, 0.88);
  outline-offset: 3px;
}

.piece-position-matching-choice:disabled {
  background: #ffffff !important;
  border-color: #167fc4 !important;
  box-shadow: 0 3px 0 rgba(22, 127, 196, 0.22), 0 8px 14px rgba(22, 127, 196, 0.12);
  color: #153449;
  cursor: default;
  filter: none;
  opacity: 1;
  -webkit-text-fill-color: #153449;
}

.piece-position-matching-choice.is-selected {
  background: #d7ecff !important;
  border-color: #167fc4 !important;
  box-shadow: 0 0 0 4px rgba(22, 127, 196, 0.18), 0 8px 16px rgba(22, 127, 196, 0.18);
  color: #153449;
  opacity: 1;
  transform: scale(1.04);
}

.piece-position-matching-choice.is-paired {
  background: #d7ecff !important;
  border-color: #167fc4 !important;
  box-shadow: 0 0 0 4px rgba(22, 127, 196, 0.14), 0 8px 16px rgba(22, 127, 196, 0.16);
  opacity: 1;
}

.piece-position-matching-piece-image {
  display: block;
  height: 100%;
  max-height: 100%;
  max-width: 100%;
  object-fit: contain;
  pointer-events: none;
  width: 100%;
}

.piece-position-matching-coordinate-choice [data-piece-position-matching-choice-content] {
  color: #153449;
  font-size: clamp(22px, 8cqi, 42px);
  font-weight: 1000;
  line-height: 1;
}

.piece-position-matching-coordinate-choice.is-selected [data-piece-position-matching-choice-content] {
  color: #153449;
}

.piece-position-matching-line-layer {
  height: 100%;
  inset: 0;
  overflow: visible;
  pointer-events: none;
  position: absolute;
  width: 100%;
  z-index: 1;
}

.piece-position-matching-line {
  fill: none;
  stroke: #111111;
  stroke-linecap: round;
  stroke-width: 3;
}

.piece-position-matching-line.is-correct {
  stroke: #22a55a;
}

.piece-position-matching-line.is-wrong {
  stroke: #ef4444;
}

.piece-position-matching-line.is-drawing {
  stroke-dasharray: var(--piece-position-matching-line-length) var(--piece-position-matching-line-length);
  stroke-dashoffset: var(--piece-position-matching-line-length);
  animation: piecePositionMatchingLineDraw 520ms ease-out forwards;
}

@keyframes piecePositionMatchingLineDraw {
  to {
    stroke-dashoffset: 0;
  }
}

.piece-setup-judgment-choice-grid .selection-judgment-choice-button[data-piece-setup-judgment-choice="correct"] {
  color: #35b978;
}

.piece-setup-judgment-choice-grid .selection-judgment-choice-button[data-piece-setup-judgment-choice="incorrect"] {
  color: #d95757;
}

.piece-setup-judgment-choice-grid .selection-judgment-choice-button[data-piece-setup-judgment-choice="correct"].is-selected {
  filter: drop-shadow(0 0 0 #ffffff) drop-shadow(0 0 0 #35b978) drop-shadow(0 6px 9px rgba(53, 185, 120, 0.32));
}

.piece-setup-judgment-choice-grid .selection-judgment-choice-button[data-piece-setup-judgment-choice="incorrect"].is-selected {
  filter: drop-shadow(0 0 0 #ffffff) drop-shadow(0 0 0 #d95757) drop-shadow(0 6px 9px rgba(217, 87, 87, 0.3));
}

.piece-setup-judgment-choice-grid .selection-judgment-choice-button.is-selected .square-judgment-choice-circle {
  fill: currentColor;
}

.piece-setup-judgment-choice-grid .selection-judgment-choice-button.is-selected .square-judgment-choice-symbol {
  stroke: #ffffff;
}

.silhouette-recognition-choice-grid {
  display: grid;
  gap: clamp(8px, 1.5vw, 16px);
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: repeat(3, minmax(0, 1fr));
  min-height: 0;
}

.silhouette-recognition-choice {
  align-items: center;
  appearance: none;
  aspect-ratio: 1;
  background: #faf5e8;
  border: 2px solid #eadfca;
  border-radius: 6px;
  color: inherit;
  cursor: pointer;
  display: grid;
  font: inherit;
  grid-template-rows: minmax(0, 1fr) auto;
  justify-content: center;
  min-height: 0;
  min-width: 0;
  outline: 0;
  padding: 7% 8% 4%;
  text-align: inherit;
  touch-action: manipulation;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.silhouette-recognition-choice:disabled {
  cursor: default;
}

.silhouette-recognition-choice.is-selected {
  border-color: #167fc4;
  box-shadow: inset 0 0 0 2px rgba(22, 127, 196, 0.18);
}

.silhouette-recognition-choice.is-correct {
  border-color: #22a55a;
  box-shadow: inset 0 0 0 2px rgba(34, 165, 90, 0.16);
}

.silhouette-recognition-choice.is-wrong {
  border-color: #ef4444;
  box-shadow: inset 0 0 0 2px rgba(239, 68, 68, 0.14);
}

.silhouette-recognition-choice img {
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  width: 100%;
}

.silhouette-recognition-choice-label {
  align-self: end;
  color: #41667e;
  font-size: 24px;
  font-weight: 900;
  line-height: 1;
  text-align: center;
}

.memory-challenge-content {
  align-content: start;
  display: grid;
  gap: clamp(10px, 2cqi, 18px);
  justify-items: center;
  min-height: 0;
  padding-top: 0;
}

.memory-challenge-content[data-memory-challenge-panel] {
  align-items: center;
  display: flex;
  flex-direction: column;
}

.memory-challenge-color-choices {
  display: grid;
  gap: clamp(16px, 3cqi, 24px);
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: clamp(6px, 2.6cqb, 18px);
  margin-top: auto;
  width: min(272px, 82%);
}

.board-panel-tools .memory-challenge-color-choice {
  align-items: center;
  aspect-ratio: 1;
  background: var(--memory-choice-color);
  border: 3px solid transparent;
  border-radius: 8px;
  box-shadow: none;
  color: #fff;
  cursor: pointer;
  display: grid;
  font-size: clamp(18px, 4cqi, 26px);
  font-weight: 900;
  justify-content: center;
  min-height: 0;
  padding: 6px;
  place-items: center;
  text-align: center;
  transition: border-color 160ms ease, transform 160ms ease, filter 160ms ease;
}

.board-panel-tools .memory-challenge-color-choice:hover:not(:disabled),
.board-panel-tools .memory-challenge-color-choice:focus-visible:not(:disabled) {
  border-color: rgba(255, 255, 255, 0.96);
  box-shadow: none;
  filter: brightness(1.05);
  transform: translateY(-2px);
}

.board-panel-tools .memory-challenge-color-choice:disabled {
  cursor: default;
  opacity: 1;
}

.board-panel-tools .memory-challenge-color-choice.is-selected {
  border-color: #fff;
  outline: 3px solid #111;
  outline-offset: 3px;
}

.board-panel-tools .memory-challenge-color-choice.is-correct {
  border-color: #fff;
}

.board-panel-tools .memory-challenge-color-choice.is-wrong {
  border-color: #fff;
}

.memory-challenge-color-red { --memory-choice-color: #ef5350; background-color: #ef5350; }
.memory-challenge-color-green { --memory-choice-color: #26a269; background-color: #26a269; }
.memory-challenge-color-blue { --memory-choice-color: #3984d8; background-color: #3984d8; }

.board-intro-board.is-memory-color-challenge-active .board-intro-square.is-memory-color-option {
  --memory-edge-bottom: transparent;
  --memory-edge-left: transparent;
  --memory-edge-right: transparent;
  --memory-edge-top: transparent;
}

.board-intro-board.is-memory-color-challenge-active .board-intro-square.is-memory-color-option::before {
  --memory-color-edge-width: clamp(3px, 0.45vw, 6px);
  background-color: var(--memory-board-fill);
  background-image:
    linear-gradient(var(--memory-edge-top), var(--memory-edge-top)),
    linear-gradient(var(--memory-edge-right), var(--memory-edge-right)),
    linear-gradient(var(--memory-edge-bottom), var(--memory-edge-bottom)),
    linear-gradient(var(--memory-edge-left), var(--memory-edge-left));
  background-position: top, right, bottom, left;
  background-repeat: no-repeat;
  background-size:
    100% var(--memory-color-edge-width),
    var(--memory-color-edge-width) 100%,
    100% var(--memory-color-edge-width),
    var(--memory-color-edge-width) 100%;
  content: "";
  inset: 0;
  pointer-events: none;
  position: absolute;
  z-index: 2;
}

.board-intro-square.is-memory-color-red {
  --memory-board-edge: rgba(239, 83, 80, 0.96);
  --memory-board-fill: rgba(239, 83, 80, 0.12);
}

.board-intro-square.is-memory-color-green {
  --memory-board-edge: rgba(38, 162, 105, 0.96);
  --memory-board-fill: rgba(38, 162, 105, 0.12);
}

.board-intro-square.is-memory-color-blue {
  --memory-board-edge: rgba(57, 132, 216, 0.96);
  --memory-board-fill: rgba(57, 132, 216, 0.12);
}

.board-intro-board.is-memory-color-challenge-active .board-intro-square.is-memory-color-option.is-memory-color-edge-top {
  --memory-edge-top: var(--memory-board-edge);
}

.board-intro-board.is-memory-color-challenge-active .board-intro-square.is-memory-color-option.is-memory-color-edge-right {
  --memory-edge-right: var(--memory-board-edge);
}

.board-intro-board.is-memory-color-challenge-active .board-intro-square.is-memory-color-option.is-memory-color-edge-bottom {
  --memory-edge-bottom: var(--memory-board-edge);
}

.board-intro-board.is-memory-color-challenge-active .board-intro-square.is-memory-color-option.is-memory-color-edge-left {
  --memory-edge-left: var(--memory-board-edge);
}

.board-intro-board.is-memory-color-challenge-active .board-intro-square.is-memory-color-diagonal-cell::before {
  background: transparent;
  border: var(--memory-color-edge-width) solid var(--memory-board-edge);
  inset: 8%;
}

.coordinate-finder-content {
  gap: var(--interaction-topic-text-gap);
  grid-template-rows: auto minmax(0, 1fr);
  justify-items: stretch;
  padding: 0 12px 3px;
}

.memory-challenge-topic-label {
  align-self: start;
  color: #b42318;
  font-size: clamp(24px, 7cqi, 34px);
  font-weight: 900;
  line-height: 1.2;
  margin: 0;
  text-align: center;
}

.selection-judgment-content {
  --square-judgment-choice-offset: clamp(24px, calc(5cqb + 8px), 46px);
  align-content: start;
  gap: clamp(8px, 1.5cqi, 14px);
  grid-template-rows: auto minmax(0, 1fr);
  justify-items: stretch;
  padding: 0;
}

.selection-judgment-instruction {
  color: #ff6d2d;
  display: grid;
  gap: clamp(20px, 5cqi, 36px);
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: repeat(3, auto);
  justify-items: center;
}

.selection-judgment-coordinate,
.selection-judgment-label,
.selection-judgment-connector {
  color: inherit;
  min-width: 0;
  text-align: center;
}

.selection-judgment-coordinate,
.selection-judgment-label {
  color: #e64a4a;
  font-size: clamp(32px, 9.5cqi, 48px);
  font-weight: 800;
  justify-self: center;
  line-height: 1.08;
  max-width: 100%;
  white-space: nowrap;
}

.selection-judgment-connector {
  color: #153449;
  font-size: clamp(22px, 6.5cqi, 32px);
  font-weight: 700;
  line-height: 1.1;
}

.selection-judgment-coordinate {
  font-size: clamp(22px, 8cqi, 40px);
  grid-row: 1;
}

.selection-judgment-label {
  grid-row: 3;
}

.selection-judgment-choice-grid {
  align-items: center;
  align-self: end;
  display: grid;
  gap: clamp(18px, 5cqi, 34px);
  grid-template-columns: repeat(2, minmax(0, 1fr));
  justify-items: center;
  min-height: 0;
  padding: 0 clamp(24px, 9cqi, 72px);
  padding-bottom: var(--interaction-feedback-edge-gap);
  transform: none;
  width: 100%;
}

.selection-judgment-choice-button {
  align-items: center;
  aspect-ratio: 1;
  background: transparent !important;
  border: 0;
  box-shadow: none !important;
  color: #35b978;
  cursor: pointer;
  display: inline-flex;
  justify-content: center;
  min-height: 0 !important;
  outline: 0;
  padding: 0 !important;
  transition: filter 160ms ease;
  width: clamp(78px, 20cqi, 112px);
}

.selection-judgment-choice-button[data-selection-judgment-choice="correct"] {
  color: #35b978;
}

.selection-judgment-choice-button[data-selection-judgment-choice="incorrect"] {
  color: #d95757;
}

.selection-judgment-choice-button.is-selected {
  filter: drop-shadow(0 5px 8px rgba(35, 133, 232, 0.18));
}

.selection-judgment-choice-button[data-selection-judgment-choice="correct"].is-selected {
  filter: drop-shadow(0 0 0 #ffffff) drop-shadow(0 0 0 #35b978) drop-shadow(0 6px 9px rgba(53, 185, 120, 0.32));
}

.selection-judgment-choice-button[data-selection-judgment-choice="incorrect"].is-selected {
  filter: drop-shadow(0 0 0 #ffffff) drop-shadow(0 0 0 #d95757) drop-shadow(0 6px 9px rgba(217, 87, 87, 0.3));
}

.selection-judgment-choice-button:disabled {
  cursor: default;
  opacity: 0.42;
}

.selection-judgment-choice-button.is-selected:disabled {
  opacity: 0.78;
}

.selection-judgment-choice-button.is-selected .square-judgment-choice-circle {
  fill: currentColor;
}

.selection-judgment-choice-button.is-selected .square-judgment-choice-symbol {
  stroke: #ffffff;
}

.coordinate-star-judgment-content {
  --square-judgment-choice-offset: clamp(24px, calc(5cqb + 8px), 46px);
  align-content: start;
  gap: clamp(12px, 2cqi, 18px);
  grid-template-rows: auto minmax(0, 1fr);
  justify-items: stretch;
  padding: 0;
}

.coordinate-star-judgment-question-frame {
  align-self: start;
  margin-inline: auto;
}

.coordinate-star-judgment-choice-grid {
  align-self: end;
}

.selection-judgment-choice-button[data-coordinate-star-judgment-choice="correct"] {
  color: #35b978;
}

.selection-judgment-choice-button[data-coordinate-star-judgment-choice="incorrect"] {
  color: #d95757;
}

.selection-judgment-choice-button[data-coordinate-star-judgment-choice="correct"].is-selected {
  filter: drop-shadow(0 0 0 #ffffff) drop-shadow(0 0 0 #35b978) drop-shadow(0 6px 9px rgba(53, 185, 120, 0.32));
}

.selection-judgment-choice-button[data-coordinate-star-judgment-choice="incorrect"].is-selected {
  filter: drop-shadow(0 0 0 #ffffff) drop-shadow(0 0 0 #d95757) drop-shadow(0 6px 9px rgba(217, 87, 87, 0.3));
}

.coordinate-star-judgment-marker[hidden] {
  display: none;
}

.coordinate-star-judgment-marker {
  aspect-ratio: 1;
  left: 50%;
  pointer-events: none;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 9.5%;
  z-index: 6;
}

.coordinate-star-judgment-marker .interaction-feedback-star {
  animation: coordinate-star-judgment-breathe 1.15s ease-in-out infinite alternate;
  color: #d19a00;
  filter: drop-shadow(0 0 9px rgba(255, 207, 60, 0.62));
  width: 100%;
}

.coordinate-star-judgment-marker .interaction-feedback-star-default,
.coordinate-star-judgment-marker .interaction-feedback-star .interaction-feedback-star-crosses,
.coordinate-star-judgment-marker .interaction-feedback-star .interaction-feedback-star-mouth-crying {
  opacity: 0;
}

.coordinate-star-judgment-marker .interaction-feedback-star .feedback-star-body-fill,
.coordinate-star-judgment-marker .interaction-feedback-star .feedback-star-body-frame,
.coordinate-star-judgment-marker .interaction-feedback-star .interaction-feedback-star-glasses,
.coordinate-star-judgment-marker .interaction-feedback-star .interaction-feedback-star-mouth-happy {
  opacity: 1;
  transform: scale(1);
}

.coordinate-star-judgment-marker .interaction-feedback-star .interaction-feedback-star-lightning {
  opacity: 0;
}

.coordinate-star-judgment-marker .interaction-feedback-star .feedback-star-body-fill {
  background: #fff2a8;
}

@keyframes coordinate-star-judgment-breathe {
  from {
    transform: scale(0.94);
  }

  to {
    transform: scale(1.08);
  }
}

.board-panel-page .lesson-console-topic-heading {
  color: #153449;
  font-size: clamp(24px, 6cqi, 38px);
  font-weight: 900;
  line-height: 1.3;
  margin: 0;
  text-align: center;
  white-space: nowrap;
}

/* 窄屏配对区按剩余高度分配三行，避免第一行向上遮挡题干。 */
@media (max-width: 640px) {
  .piece-position-matching-choice-area {
    box-sizing: border-box;
    height: 100%;
    max-height: 100%;
  }
  .piece-position-matching-choice-column {
    grid-template-rows: repeat(3, minmax(0, 1fr));
  }
  .board-panel-page-student .piece-position-matching-choice {
    height: 100%;
    max-width: 100%;
    min-height: 0;
    padding: 4px;
    width: auto;
  }
  .piece-position-matching-coordinate-choice [data-piece-position-matching-choice-content] {
    font-size: 22px;
  }
}

/* 攻击与捕获复用棋子的走法互动工作台尺寸，只改变题型内部布局。 */
.attack-capture-board-layer {
  inset: 0;
  pointer-events: none;
  position: absolute;
  z-index: 12;
}
.attack-capture-board-layer [data-attack-capture-scene-piece],
.attack-capture-board-layer [data-undefended-piece],
.attack-capture-board-layer [data-attack-capture-white-piece] {
  height: 12.5%;
  object-fit: contain;
  position: absolute;
  transform: translate(-50%, -50%);
  width: 12.5%;
}
.attack-capture-target-frame,
.attack-capture-selected-frame,
.attack-capture-candidate-frame,
.attack-capture-matching-error-frame {
  border: var(--lesson-frame-width, 4px) solid currentColor;
  height: 12.5%;
  position: absolute;
  transform: translate(-50%, -50%);
  width: 12.5%;
}
.attack-capture-target-frame { color: var(--lesson-danger, #d62f2f); }
.attack-capture-selected-frame { color: var(--lesson-safe, #32a66c); }
.attack-capture-candidate-frame { box-sizing: border-box; border-width: var(--lesson-frame-width, 6px); color: var(--lesson-safe, #32a66c); }
.attack-capture-matching-error-frame { color: var(--lesson-danger, #d62f2f); }
.attack-capture-route-layer { height: 100%; inset: 0; overflow: visible; position: absolute; width: 100%; }
.attack-capture-route-layer line { fill: none; stroke: #d62f2f; stroke-linecap: butt; stroke-width: 12; }
.attack-capture-route-layer marker path { fill: #d62f2f; }
.attack-capture-target-coordinate {
  align-items: center;
  color: #d62f2f;
  display: flex;
  font-size: clamp(24px, 4cqi, 42px);
  font-weight: 900;
  height: 12.5%;
  justify-content: center;
  pointer-events: none;
  position: absolute;
  text-shadow: 0 1px 2px #fff;
  transform: translate(-50%, -50%);
  width: 12.5%;
}
.attack-capture-board-layer .is-attack-capture-moving,
.attack-capture-board-layer .is-knight-moving { z-index: 10; }
.attack-capture-number-layer { inset: 0; position: absolute; }
.attack-capture-number { align-items: center; background: #32a66c; border-radius: 50%; color: #fff; display: flex; font-size: clamp(18px, 4cqi, 30px); font-weight: 800; height: 9%; justify-content: center; position: absolute; transform: translate(-50%, -50%); width: 9%; }
/* 走棋题直接采用对应棋子互动区的共享样式，保留独立的事件属性。 */
.attack-capture-practice-content[hidden],
.attack-capture-practice-content [hidden],
.attack-capture-board-layer [hidden] { display: none !important; }
.attack-capture-target-frame {
  box-sizing: border-box;
  border: var(--lesson-frame-width, 4px) solid var(--lesson-danger, #d62f2f);
  background: transparent;
  pointer-events: none;
  z-index: 20;
}

.interaction-topic-placeholder {
  min-height: 0;
}

.square-judgment-content {
  --square-judgment-choice-offset: clamp(24px, calc(5cqb + 8px), 46px);
  align-content: start;
  display: grid;
  gap: clamp(8px, 1.5cqi, 14px);
  grid-template-rows: auto minmax(0, 1fr);
  height: 100%;
  min-height: 0;
}

.square-judgment-prompt {
  text-align: center;
}

.square-judgment-choice-grid {
  align-items: center;
  align-self: end;
  display: grid;
  gap: clamp(18px, 5cqi, 34px);
  grid-template-columns: repeat(2, minmax(0, 1fr));
  justify-items: center;
  min-height: 0;
  padding: 0 clamp(24px, 9cqi, 72px);
  padding-bottom: var(--interaction-feedback-edge-gap);
  transform: none;
}

.square-judgment-choice-button {
  align-items: center;
  aspect-ratio: 1;
  background: transparent !important;
  border: 0;
  box-shadow: none !important;
  cursor: pointer;
  display: inline-flex;
  justify-content: center;
  max-width: clamp(78px, 20cqi, 112px);
  min-height: 0 !important;
  outline: 0;
  padding: 0 !important;
  transition: filter 160ms ease;
  width: 100%;
}

.square-judgment-choice-icon {
  display: block;
  height: 100%;
  width: 100%;
}

.square-judgment-choice-circle,
.square-judgment-choice-symbol {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.square-judgment-choice-circle {
  stroke-width: 2.4;
}

.square-judgment-choice-symbol {
  stroke-width: 3.2;
}

.square-judgment-choice-button[data-square-judgment-choice="correct"] {
  color: #35b978;
}

.square-judgment-choice-button[data-square-judgment-choice="incorrect"] {
  color: #d95757;
}

.square-judgment-choice-button.is-selected {
  filter: drop-shadow(0 4px 8px rgba(35, 133, 232, 0.2));
}

.square-judgment-choice-button[data-square-judgment-choice="correct"].is-selected {
  filter: drop-shadow(0 0 0 #ffffff) drop-shadow(0 0 0 #35b978) drop-shadow(0 6px 9px rgba(53, 185, 120, 0.32));
}

.square-judgment-choice-button[data-square-judgment-choice="incorrect"].is-selected {
  filter: drop-shadow(0 0 0 #ffffff) drop-shadow(0 0 0 #d95757) drop-shadow(0 6px 9px rgba(217, 87, 87, 0.3));
}

.square-judgment-choice-button.is-selected .square-judgment-choice-circle {
  fill: currentColor;
}

.square-judgment-choice-button.is-selected .square-judgment-choice-symbol {
  stroke: #ffffff;
}

.square-judgment-choice-button:disabled {
  cursor: default;
  opacity: 0.45;
}

.square-judgment-board-overlay {
  align-items: center;
  background: rgba(18, 48, 66, 0.26);
  display: flex;
  inset: 0;
  justify-content: center;
  opacity: 0;
  padding: 0;
  pointer-events: none;
  position: absolute;
  transition: opacity 220ms ease, visibility 220ms ease;
  visibility: hidden;
  z-index: 8;
}

.square-judgment-board-overlay.is-visible {
  opacity: 1;
  visibility: visible;
}

.square-judgment-board-grid {
  aspect-ratio: 1;
  border: clamp(4px, 0.9vw, 9px) solid #fffdf6;
  box-shadow: 0 14px 34px rgba(12, 38, 54, 0.4);
  display: grid;
  grid-auto-columns: minmax(0, 1fr);
  grid-auto-flow: row;
  grid-auto-rows: minmax(0, 1fr);
  grid-template-columns: repeat(8, minmax(0, 1fr));
  grid-template-rows: repeat(8, minmax(0, 1fr));
  max-height: 87.5%;
  max-width: 87.5%;
  min-height: 0;
  min-width: 0;
  width: 87.5%;
}

.square-judgment-board-square {
  background: var(--square-judgment-dark);
  min-height: 0;
  min-width: 0;
}

.square-judgment-board-square--light {
  background: var(--square-judgment-light);
}

.interaction-topic-prompt {
  margin: 0;
  min-height: 0;
  padding: 0;
  white-space: nowrap;
  width: 100%;
}

.memory-challenge-score {
  align-items: start;
  align-self: stretch;
  container-type: inline-size;
  display: grid;
  gap: clamp(12px, 4cqi, 28px);
  grid-template-columns: repeat(3, minmax(0, 1fr));
  justify-content: center;
  margin: 0;
  min-height: 0;
  padding: var(--interaction-feedback-edge-gap) clamp(22px, 10cqi, 54px) 0;
  position: relative;
}

.memory-challenge-score::after {
  background: rgba(11, 79, 125, 0.22);
  bottom: calc(-1 * (var(--interaction-feedback-edge-gap) + 0.5px));
  content: "";
  height: 1px;
  inset-inline: clamp(22px, 10cqi, 54px);
  pointer-events: none;
  position: absolute;
}

.interaction-feedback-star {
  aspect-ratio: 1;
  display: block;
  justify-self: center;
  max-width: 100%;
  position: relative;
  transition: filter 180ms ease, transform 220ms cubic-bezier(0.16, 1, 0.3, 1);
  width: clamp(42px, min(28cqi, 22cqb), 102px);
}

.interaction-feedback-star-default,
.interaction-feedback-star .feedback-star-body-fill,
.interaction-feedback-star .feedback-star-body-frame,
.interaction-feedback-star-layer {
  height: 100%;
  inset: 0;
  pointer-events: none;
  position: absolute;
  width: 100%;
}

.interaction-feedback-star-default {
  filter: grayscale(1);
  opacity: 0.38;
  transform: scale(1.04335);
  transition: opacity 180ms ease, transform 180ms ease;
  z-index: 2;
}

.interaction-feedback-star .feedback-star-body-fill,
.interaction-feedback-star .feedback-star-body-frame,
.interaction-feedback-star-layer {
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 160ms ease, transform 220ms cubic-bezier(0.16, 1, 0.3, 1);
}

.interaction-feedback-star .feedback-star-body-fill {
  z-index: 0;
}

.interaction-feedback-star .feedback-star-body-frame {
  z-index: 1;
}

.interaction-feedback-star-layer {
  z-index: 2;
}

.interaction-feedback-star.is-correct,
.interaction-feedback-star.is-wrong {
  transform: scale(1.04);
}

.interaction-feedback-star.is-correct .interaction-feedback-star-default,
.interaction-feedback-star.is-wrong .interaction-feedback-star-default {
  opacity: 0;
  transform: scale(0.9);
}

.interaction-feedback-star.is-correct {
  color: var(--success);
  filter: drop-shadow(0 6px 8px rgba(53, 185, 120, 0.2));
}

.interaction-feedback-star.is-wrong {
  color: var(--danger);
  filter: drop-shadow(0 6px 8px rgba(217, 87, 87, 0.18));
}

.interaction-feedback-score.is-all-correct-celebrating .interaction-feedback-star {
  animation: interaction-feedback-all-correct-breathe 760ms ease-in-out infinite alternate;
  filter: drop-shadow(0 0 10px rgba(53, 185, 120, 0.44));
  transform-origin: center;
}

@keyframes interaction-feedback-all-correct-breathe {
  from {
    transform: translateY(2%) scale(0.94);
  }

  to {
    transform: translateY(-3%) scale(1.09);
  }
}

.interaction-feedback-star.is-correct .feedback-star-body-fill,
.interaction-feedback-star.is-wrong .feedback-star-body-fill,
.interaction-feedback-star.is-correct .feedback-star-body-frame,
.interaction-feedback-star.is-wrong .feedback-star-body-frame,
.interaction-feedback-star.is-correct .interaction-feedback-star-glasses,
.interaction-feedback-star.is-wrong .interaction-feedback-star-glasses,
.interaction-feedback-star.is-correct .interaction-feedback-star-mouth-happy,
.interaction-feedback-star.is-wrong .interaction-feedback-star-mouth-crying {
  opacity: 1;
  transform: scale(1);
}

.interaction-feedback-star.is-correct .feedback-star-body-fill {
  background: var(--kid-mint-soft);
}

.interaction-feedback-star.is-wrong .feedback-star-body-fill {
  background: var(--kid-ice-pink);
}

.interaction-feedback-star.is-correct .interaction-feedback-star-lightning,
.interaction-feedback-star.is-wrong .interaction-feedback-star-crosses {
  animation: interaction-feedback-symbol-draw-and-pulse 900ms 130ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes interaction-feedback-symbol-draw-and-pulse {
  0% {
    clip-path: inset(0 100% 0 0);
    opacity: 0;
    transform: scale(0.72);
  }

  28% {
    clip-path: inset(0 0 0 0);
    opacity: 1;
    transform: scale(1);
  }

  48% {
    clip-path: inset(0 0 0 0);
    opacity: 0.52;
    transform: scale(0.92);
  }

  66% {
    clip-path: inset(0 0 0 0);
    opacity: 1;
    transform: scale(1.1);
  }

  82% {
    clip-path: inset(0 0 0 0);
    opacity: 0.64;
    transform: scale(0.96);
  }

  100% {
    clip-path: inset(0 0 0 0);
    opacity: 1;
    transform: scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .interaction-feedback-score.is-all-correct-celebrating .interaction-feedback-star,
  .interaction-feedback-star.is-correct .interaction-feedback-star-lightning,
  .interaction-feedback-star.is-wrong .interaction-feedback-star-crosses {
    animation: none;
    clip-path: inset(0 0 0 0);
    opacity: 1;
    transform: scale(1);
  }
}

.board-panel-section-title {
  color: #1661a6;
  font-size: 15px;
  font-weight: 900;
  margin: 0 0 10px;
}

.board-panel-tool-grid,
.board-panel-step-buttons {
  display: grid;
  gap: 8px;
}

.board-panel-tool-grid {
  grid-template-columns: 1fr 1fr;
}

.board-panel-tool-button-wide {
  grid-column: 1 / -1;
}

.board-panel-step-nav {
  background: #fffdf6;
  border: 1px solid rgba(116, 188, 233, 0.88);
  border-radius: 0 0 12px 12px;
  border-top-color: rgba(224, 238, 246, 0.95);
  padding: 12px 14px;
}

.board-panel-step-buttons {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.board-panel-tools button,
.board-panel-step-nav button {
  align-items: center;
  background: #fffdf6;
  border: 0;
  border-radius: 8px;
  box-shadow: 0 8px 16px rgba(35, 133, 232, 0.12);
  color: #153449;
  cursor: pointer;
  display: inline-flex;
  font-size: 17px;
  font-weight: 900;
  gap: 8px;
  justify-content: center;
  min-height: var(--board-panel-step-button-height);
  padding: 10px;
  transition: box-shadow 160ms ease, filter 160ms ease, transform 160ms ease;
}

.board-panel-tools button {
  background: #ffffff;
}

.board-panel-step-nav button {
  background: linear-gradient(180deg, #ffffff 0%, #fff9ea 100%);
  border: 1px solid rgba(180, 217, 236, 0.72);
  border-radius: 13px;
  box-shadow: 0 5px 12px rgba(35, 133, 232, 0.12);
  padding: 6px;
  position: relative;
}

.board-panel-button-icon {
  align-items: center;
  background: #e7f6ff;
  border-radius: 11px;
  color: #2385e8;
  display: inline-flex;
  flex: 0 0 34px;
  font-size: 22px;
  height: 34px;
  justify-content: center;
  width: 34px;
}

.board-panel-button-icon .function-icon {
  height: 34px;
  width: 34px;
}

.board-panel-step-button-prev .board-panel-button-icon {
  background: #e9f7ff;
  color: #1681d7;
}

.board-panel-step-button-return {
  background: linear-gradient(180deg, #fff7d6 0%, #ffd272 100%) !important;
  border-color: rgba(255, 190, 75, 0.72) !important;
  box-shadow: 0 5px 12px rgba(255, 138, 29, 0.16) !important;
}

.board-panel-step-button-return .board-panel-button-icon {
  background: rgba(255, 255, 255, 0.78);
  color: #d66b00;
}

.board-panel-step-button-next .board-panel-button-icon {
  background: #eaf9ef;
  color: #21995e;
}

.board-panel-step-nav button::after {
  background: #17405c;
  border-radius: 999px;
  bottom: calc(100% + 6px);
  color: #fff;
  content: attr(data-tooltip);
  font-size: 12px;
  font-weight: 900;
  left: 50%;
  opacity: 0;
  padding: 6px 9px;
  pointer-events: none;
  position: absolute;
  transform: translateX(-50%) translateY(4px);
  transition: opacity 120ms ease, transform 120ms ease;
  white-space: nowrap;
  z-index: 6;
}

.board-panel-tools button:hover,
.board-panel-step-nav button:hover,
.board-panel-mode-tab:hover {
  box-shadow: 0 12px 22px rgba(35, 133, 232, 0.18);
  filter: brightness(0.99);
  transform: translateY(-1px);
}

.board-panel-step-nav button:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.board-panel-function-zones {
  --board-panel-function-button-size: clamp(30px, 4vw, 50px);
  background: #eef7fc;
  border: 1px solid rgba(116, 188, 233, 0.88);
  border-radius: 0 0 12px 12px;
  border-top-color: #9bd4f4;
  display: grid;
  gap: clamp(12px, 1.5vw, 18px);
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 10px 14px 12px;
}

.board-panel-function-zone {
  min-width: 0;
}

.board-panel-function-zone-topic {
  order: 1;
}

.board-panel-function-zone-course {
  order: 2;
}

.board-panel-course-buttons,
.board-panel-theme-buttons {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.board-panel-theme-placeholder,
.lesson-console-topic-tool-button[data-topic-tool="placeholder"],
.lesson-console-topic-tool-button[data-interaction-topic-tool="placeholder"] {
  pointer-events: none;
  visibility: hidden;
}

.board-panel-course-button {
  align-items: center;
  aspect-ratio: 1;
  background: #ffffff;
  border: 2px solid #bfe2f5;
  border-radius: 50%;
  box-shadow: 0 3px 7px rgba(35, 133, 232, 0.12);
  color: #2385e8;
  cursor: pointer;
  display: flex;
  justify-content: center;
  justify-self: center;
  max-width: var(--board-panel-function-button-size);
  min-height: 0;
  padding: 0;
  position: relative;
  transition: box-shadow 160ms ease, filter 160ms ease, transform 160ms ease;
  width: 100%;
}

.board-panel-function-zones .board-panel-button-icon {
  background: transparent;
  border-radius: 0;
  color: inherit;
  flex: 0 0 auto;
  font-size: clamp(18px, 2vw, 25px);
  height: auto;
  width: auto;
}

.board-panel-function-zones .board-panel-button-icon .function-icon {
  height: var(--board-panel-function-button-size);
  width: var(--board-panel-function-button-size);
}

.board-panel-course-button:has(.function-icon),
.lesson-console-topic-tool-button:has(.function-icon) {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

.board-panel-course-button:has(.function-icon):disabled,
.lesson-console-topic-tool-button:has(.function-icon):disabled {
  background: transparent;
}

.lesson-console-topic-tool-button:first-child {
  background: #eaf7ff;
  border-color: #72bde9;
  color: #167fc4;
}

.lesson-console-topic-tool-button[data-interaction-topic-tool="reset"] {
  background: #fff5d9;
  border-color: #f3bf50;
  color: #d87900;
}

.board-panel-course-button-prev {
  background: #eaf7ff;
  border-color: #72bde9;
  color: #167fc4;
}

.board-panel-course-button-alternative {
  background: #fff5d9;
  border-color: #f3bf50;
  color: #d87900;
}

.board-panel-course-button-next {
  background: #eaf9ef;
  border-color: #72c995;
  color: #218f59;
}

.board-panel-function-zones button:hover:not(:disabled) {
  box-shadow: 0 7px 14px rgba(35, 133, 232, 0.2);
  filter: brightness(0.99);
  transform: translateY(-1px);
}

.board-panel-function-zones button:disabled {
  background: #f4f8fa;
  border-color: #d3e1e8;
  box-shadow: none;
  color: #91a7b5;
  cursor: default;
  opacity: 0.72;
}

.board-panel-function-zones button::after {
  background: #17405c;
  border-radius: 999px;
  bottom: calc(100% + 6px);
  color: #fff;
  content: attr(data-tooltip);
  font-size: 12px;
  font-weight: 900;
  left: 50%;
  opacity: 0;
  padding: 6px 9px;
  pointer-events: none;
  position: absolute;
  transform: translateX(-50%) translateY(4px);
  transition: opacity 120ms ease, transform 120ms ease;
  white-space: nowrap;
  z-index: 6;
}

.board-panel-function-zones button:hover:not(:disabled)::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.board-panel-interaction-function-zones {
  display: none;
}

#board-panel-student:checked ~ .board-panel-function-zones:not(.board-panel-interaction-function-zones) {
  display: none;
}

#board-panel-student:checked ~ .board-panel-interaction-function-zones {
  display: grid;
}

@media (min-width: 1300px) {
  .app-lesson-stage {
    --board-intro-right-edge: clamp(96px, 9vw, 160px);
  }
}

@media (max-width: 1180px) {
  .app-lesson-stage {
    --board-intro-edge: clamp(14px, 2vw, 24px);
    --board-intro-gap: clamp(14px, 1.5vw, 20px);
    --board-intro-panel-width: clamp(320px, 32vw, 380px);
    --board-intro-size: min(
      calc(100vh - var(--topbar-height) - (2 * var(--board-intro-edge))),
      calc(100vw - var(--board-intro-panel-width) - var(--board-intro-gap) - var(--board-intro-edge) - var(--board-intro-right-edge) - var(--board-intro-sidebar-reserve))
    );
  }
}

/* 低分辨率教学大屏仍保留棋盘和教师工作台的双栏课堂结构。 */
@media (max-width: 1100px) {
  .app-lesson-stage {
    --board-intro-edge: clamp(12px, 1.5vw, 18px);
    --board-intro-gap: clamp(10px, 1.25vw, 14px);
    --board-intro-panel-width: clamp(260px, 30vw, 340px);
    --board-intro-sidebar-reserve: 0px;
    --board-intro-size: min(
      calc(100vh - var(--topbar-height) - (2 * var(--board-intro-edge))),
      calc(100vw - var(--board-intro-panel-width) - var(--board-intro-gap) - var(--board-intro-edge) - var(--board-intro-right-edge) - var(--board-intro-sidebar-reserve))
    );
  }

  .board-intro-layout {
    grid-template-columns: minmax(0, 1fr) var(--board-intro-panel-width);
  }

  .board-intro-side-panel {
    --board-panel-step-button-height: 44px;
  }

  .board-panel-mode-tabs {
    min-height: 48px;
  }

  .board-panel-mode-tab {
    font-size: 18px;
    gap: 7px;
    min-height: 44px;
    padding: 7px 10px 8px;
  }

  .board-panel-mode-icon {
    font-size: 18px;
    height: 30px;
    width: 30px;
  }

  .board-panel-course {
    padding: 12px;
  }

  .lesson-console-action-list {
    gap: 9px;
  }

  .lesson-console-action {
    font-size: 18px;
    min-height: 54px;
    padding: 9px 10px;
  }

  .lesson-console-topic-tools-pages {
    margin-top: 10px;
    padding-top: 9px;
  }

  .board-panel-tools,
  .board-panel-step-nav {
    padding: 10px;
  }
}

@media (min-width: 801px) and (max-width: 1100px) {
  .app-lesson-stage:has(.piece-intro-layout[data-lesson-title="棋子价值"]) {
    --board-intro-panel-width: clamp(320px, 33vw, 360px);
  }
}

@media (max-width: 800px) {
  .app-lesson-stage {
    --board-intro-edge: 10px;
    --board-intro-gap: 10px;
    --board-intro-panel-width: 220px;
  }

  .board-panel-mode-tab {
    font-size: 16px;
  }

  .board-panel-mode-icon {
    display: none;
  }

  .lesson-console-action {
    font-size: 16px;
  }
}

@media (max-width: 640px) {
  /* 课程入口放入顶栏空位，避免覆盖大棋盘的左上格。 */
  .app-lesson-stage .lesson-sidebar-toggle {
    border-radius: 6px;
    font-size: 0;
    height: 42px;
    left: 52px;
    min-height: 42px;
    padding: 0;
    top: 10px;
    width: 42px;
  }

  .app-lesson-stage .lesson-sidebar-toggle span {
    font-size: 24px;
  }

  .app-lesson-stage .lesson-sidebar-toggle strong {
    display: none;
  }

  .app-lesson-stage .topbar {
    gap: 6px;
    grid-template-columns: 88px minmax(0, 1fr) auto;
    padding: 0 8px;
  }

  .app-lesson-stage .brand {
    gap: 0;
  }

  .app-lesson-stage .brand span {
    display: none;
  }

  .app-lesson-stage .brand-logo {
    height: 38px;
    width: 38px;
  }

  .app-lesson-stage .topbar-title {
    font-size: 18px;
    grid-column: 2;
    justify-self: stretch;
    left: auto;
    letter-spacing: 0;
    max-width: none;
    position: static;
    transform: none;
  }

  .app-lesson-stage .topbar-home-link {
    font-size: 13px;
    min-height: 28px;
    padding: 4px 7px;
  }

  .app-lesson-stage {
    --board-intro-edge: 12px;
    --board-intro-gap: 12px;
    --board-intro-panel-width: 100%;
    --board-intro-sidebar-reserve: 0px;
    --board-intro-size: min(
      calc(100vw - (2 * var(--board-intro-edge))),
      calc((100vh - var(--topbar-height) - (2 * var(--board-intro-edge))) * 0.5)
    );
  }

  .board-intro-layout {
    align-items: start;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    overflow-y: auto;
  }

  .board-intro-stage {
    height: var(--board-intro-size);
    justify-items: center;
    place-items: center;
  }

  .board-intro-side-panel {
    height: 100%;
    width: 100%;
  }
}

/* 二级课程统一六槽功能区：左侧为模式功能，右侧为主题功能。 */
.lesson-function-zone {
  --lesson-function-button-size: clamp(30px, 4vw, 50px);
  background: #eef7fc;
  border: 1px solid rgba(116, 188, 233, 0.88);
  border-radius: 0 0 12px 12px;
  display: grid;
  gap: clamp(12px, 1.5vw, 18px);
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 10px 14px 12px;
}

.lesson-function-zone-interaction {
  display: none;
}

#board-panel-student:checked ~ .lesson-function-zone:not(.lesson-function-zone-interaction) {
  display: none;
}

#board-panel-student:checked ~ .lesson-function-zone-interaction {
  display: grid;
}

.lesson-function-area {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  min-width: 0;
}

.lesson-function-area .lesson-console-topic-tool-page {
  display: none;
  gap: 8px;
  grid-column: 1 / -1;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.lesson-function-area .lesson-console-topic-tool-page.is-active {
  display: grid;
}

.lesson-function-navigation-page {
  display: none;
  gap: 8px;
  grid-column: 1 / -1;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.lesson-function-navigation-page.is-active {
  display: grid;
}

.lesson-function-button,
.lesson-function-empty-slot {
  align-items: center;
  aspect-ratio: 1;
  display: flex;
  justify-content: center;
  justify-self: center;
  max-width: var(--lesson-function-button-size);
  min-height: 0;
  position: relative;
  width: 100%;
}

.lesson-function-button {
  aspect-ratio: 1;
  background: transparent;
  border: 0;
  color: #2385e8;
  cursor: pointer;
  padding: 0;
  position: relative;
}

.lesson-function-button .board-panel-button-icon,
.lesson-function-button .function-icon,
.lesson-function-button .button-svg-icon {
  height: var(--lesson-function-button-size);
  width: var(--lesson-function-button-size);
}

.lesson-function-button:active:not(:disabled) .button-svg-icon,
.icon-row .icon-tool:active:not(:disabled) .button-svg-icon {
  filter: drop-shadow(0 1px 0 rgba(17, 64, 92, 0.22));
  transform: translateY(2px);
}

.lesson-function-button:disabled {
  cursor: default;
  filter: grayscale(0.55);
  opacity: 0.42;
}

.lesson-function-button:hover:not(:disabled) {
  filter: brightness(0.96) saturate(1.12);
  transform: translateY(-1px);
}

.lesson-function-button [data-interaction-confirm-icon][hidden],
.lesson-function-button [data-interaction-next-icon][hidden] {
  display: none;
}

.lesson-function-button::after {
  background: #17405c;
  border-radius: 999px;
  bottom: calc(100% + 6px);
  color: #fff;
  content: attr(data-tooltip);
  font-size: 12px;
  font-weight: 900;
  left: 50%;
  opacity: 0;
  padding: 6px 9px;
  pointer-events: none;
  position: absolute;
  transform: translateX(-50%) translateY(4px);
  transition: opacity 120ms ease, transform 120ms ease;
  white-space: nowrap;
  z-index: 6;
}

.lesson-function-button:hover:not(:disabled)::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.app-lesson-stage .topbar-title {
  left: calc(100vw - var(--board-intro-right-edge) - var(--board-intro-panel-width) - var(--board-intro-gap) - (var(--board-intro-size) / 2));
  position: absolute;
  transform: translateX(-50%);
}

@media (min-width: 641px) and (max-width: 1100px) {
  .app-lesson-stage .brand {
    gap: 0;
  }

  .app-lesson-stage .brand span {
    display: none;
  }
}

/* 互动反馈素材审查页 */
.feedback-review-page .app-frame {
  grid-template-columns: minmax(0, 1fr);
}

.feedback-review-page .page-shell {
  background: #f5fbff;
  overflow: auto;
  padding: 0;
}

.feedback-review {
  display: grid;
  gap: 48px;
  margin: 0 auto;
  max-width: 1120px;
  min-height: 100%;
  padding: 72px 40px 56px;
}

.feedback-review-intro {
  text-align: center;
}

.feedback-review-kicker {
  color: #2b7eb6;
  font-size: 17px;
  font-weight: 800;
  margin: 0 0 10px;
}

.feedback-review-intro h1 {
  color: #163d59;
  font-size: 36px;
  font-weight: 900;
  line-height: 1.2;
  margin: 0;
}

.feedback-review-section {
  display: grid;
  gap: 22px;
}

.feedback-review-section > h2 {
  color: #24516e;
  font-size: 24px;
  font-weight: 900;
  line-height: 1.2;
  margin: 0;
  text-align: center;
}

.feedback-component-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.feedback-component {
  align-items: center;
  background: #ffffff;
  border: 1px solid #d5e7f1;
  border-radius: 8px;
  display: grid;
  gap: 10px;
  justify-items: center;
  min-height: 166px;
  padding: 18px 10px 14px;
}

.feedback-component img {
  aspect-ratio: 1;
  height: 108px;
  object-fit: contain;
  width: 108px;
}

.feedback-star-default-image {
  object-fit: contain;
  transform: scale(1.04335);
}

.feedback-star-body-variant {
  aspect-ratio: 1;
  position: relative;
  width: 108px;
}

.feedback-star-body-fill,
.feedback-star-body-frame {
  inset: 0;
  pointer-events: none;
  position: absolute;
}

.feedback-star-body-fill {
  -webkit-mask: url("images/interaction-feedback/happy-star-1-fill.svg") center / contain no-repeat;
  mask: url("images/interaction-feedback/happy-star-1-fill.svg") center / contain no-repeat;
  z-index: 0;
}

.feedback-star-body-frame {
  background: currentColor;
  -webkit-mask: url("images/interaction-feedback/happy-star-1-body.svg") center / contain no-repeat;
  mask: url("images/interaction-feedback/happy-star-1-body.svg") center / contain no-repeat;
  z-index: 1;
}

.feedback-star-body-variant-correct,
.feedback-star-composite-correct {
  color: var(--success);
}

.feedback-star-body-variant-correct .feedback-star-body-fill,
.feedback-star-composite-correct .feedback-star-body-fill {
  background: var(--kid-mint-soft);
}

.feedback-star-body-variant-wrong,
.feedback-star-composite-wrong {
  color: var(--danger);
}

.feedback-star-body-variant-wrong .feedback-star-body-fill,
.feedback-star-composite-wrong .feedback-star-body-fill {
  background: var(--kid-ice-pink);
}

.feedback-component h3 {
  color: #45667b;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.2;
  margin: 0;
  text-align: center;
}

.feedback-star-stage {
  align-items: center;
  display: grid;
  gap: 28px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.feedback-star-state {
  align-items: center;
  background: #ffffff;
  border: 1px solid #c8e3f2;
  border-radius: 8px;
  display: grid;
  gap: 22px;
  justify-items: center;
  min-height: 360px;
  padding: 34px 24px 28px;
}

.feedback-star-state-default {
  background: #f8fcff;
}

.feedback-star-state-correct {
  border-color: #a9e5c7;
}

.feedback-star-state-wrong {
  border-color: #f1bcc5;
}

.feedback-star {
  aspect-ratio: 1;
  position: relative;
  width: min(230px, 100%);
}

.feedback-star img {
  height: 100%;
  inset: 0;
  position: absolute;
  width: 100%;
  z-index: 2;
}

.feedback-star-state-default .feedback-star {
  filter: grayscale(1);
  opacity: 0.38;
}

.feedback-star-state-correct .feedback-star {
  filter: drop-shadow(0 12px 14px rgba(53, 185, 120, 0.18));
}

.feedback-star-state-wrong .feedback-star {
  filter: drop-shadow(0 12px 14px rgba(217, 87, 87, 0.16));
}

.feedback-star-state h2 {
  color: #24516e;
  font-size: 22px;
  font-weight: 900;
  line-height: 1.2;
  margin: 0;
}

.feedback-star-state-correct h2 {
  color: var(--success);
}

.feedback-star-state-wrong h2 {
  color: var(--danger);
}

@media (max-width: 720px) {
  .feedback-review {
    gap: 30px;
    padding: 42px 20px;
  }

  .feedback-star-stage {
    grid-template-columns: 1fr;
  }

  .feedback-component-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .feedback-star-state {
    min-height: 310px;
  }
}

@media (max-width: 640px) {
  .app-lesson-stage .topbar-title {
    grid-column: 2;
    justify-self: stretch;
    left: auto;
    max-width: none;
    min-width: 0;
    position: static;
    transform: none;
  }
}
.rook-movement-board-layer {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}

.rook-movement-arrow-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  z-index: 7;
}

.rook-distance-label-layer,
.queen-distance-label-layer {
  inset: 0;
  pointer-events: none;
  position: absolute;
  z-index: 1;
}

.rook-distance-label,
.queen-distance-label {
  align-items: center;
  animation: rook-distance-label-appear 320ms ease-out both;
  background: rgba(11, 79, 125, .9);
  border: 2px solid rgba(255, 255, 255, .88);
  border-radius: 50%;
  box-shadow: 0 3px 8px rgba(8, 45, 73, .28);
  color: #fff;
  display: flex;
  font-size: clamp(16px, 3vw, 34px);
  font-weight: 900;
  height: 7.5%;
  justify-content: center;
  line-height: 1;
  opacity: 0;
  position: absolute;
  transform: translate(-50%, -50%) scale(.72);
  width: 7.5%;
}

.knight-distance-label {
  align-items: center;
  animation: rook-distance-label-appear 320ms ease-out both;
  background: rgba(11, 79, 125, .9);
  border: 2px solid rgba(255, 255, 255, .88);
  border-radius: 50%;
  box-shadow: 0 3px 8px rgba(8, 45, 73, .28);
  color: #fff;
  display: flex;
  font-size: clamp(16px, 3vw, 34px);
  font-weight: 900;
  height: 7.5%;
  justify-content: center;
  line-height: 1;
  opacity: 0;
  position: absolute;
  transform: translate(-50%, -50%) scale(.72);
  width: 7.5%;
}

.rook-movement-arrow-layer line {
  fill: none;
  stroke: #32a66c;
  stroke-width: 14;
  stroke-linecap: butt;
  marker-end: url(#rook-movement-arrowhead);
  opacity: 0;
}

.rook-movement-arrow-layer line[hidden] {
  display: none;
}

.rook-movement-arrow-layer marker path {
  fill: #32a66c;
}

.is-rook-arrow-stage .rook-movement-arrow-layer line {
  opacity: 1;
}

:root {
  --board-intro-piece-size: 38%;
  --board-piece-square-size: 12.5%;
  --board-piece-scale: 0.82;
  --board-square-piece-fill: 82%;
  --board-square-piece-size: 10.25%;
  --interaction-one-overlay-size: 10%;
}

.piece-intro-board-piece {
  height: var(--board-intro-piece-size);
  width: var(--board-intro-piece-size);
}

.rook-movement-board-piece {
  height: var(--board-piece-square-size);
  left: 56.25%;
  object-fit: contain;
  opacity: 0;
  position: absolute;
  top: 56.25%;
  transform: translate(-50%, -50%) scale(var(--board-piece-scale));
  transition: left var(--rook-board-move-duration, var(--piece-move-ms-per-square, 420ms)) linear, top var(--rook-board-move-duration, var(--piece-move-ms-per-square, 420ms)) linear, opacity 220ms ease, transform 220ms ease;
  will-change: left, top;
  width: var(--board-piece-square-size);
  filter: drop-shadow(0 6px 4px rgba(13, 57, 87, .28));
  z-index: 8;
}

.rook-movement-board-piece.is-rook-piece-resetting {
  animation: none;
  opacity: 0;
  transition: none;
}

.rook-movement-board-piece[hidden] {
  animation: none !important;
  display: none !important;
}

.rook-movement-board-layer.is-rook-piece-visible .rook-movement-board-piece {
  animation: rook-board-piece-float-in 560ms cubic-bezier(.16, .8, .24, 1) both;
  opacity: 1;
}

.rook-movement-board-layer.is-rook-piece-visible .rook-movement-board-piece.is-rook-practice-revealing {
  animation: rook-board-piece-float-in 420ms cubic-bezier(.16, .8, .24, 1) both;
}

.rook-movement-blocking-pawn,
.rook-movement-example-blocking-piece,
.rook-movement-capture-piece,
.rook-practice-target-piece,
.rook-practice-blocker-piece {
  height: var(--board-piece-square-size);
  object-fit: contain;
  position: absolute;
  transform: translate(-50%, -50%) scale(var(--board-piece-scale));
  width: var(--board-piece-square-size);
  z-index: 2;
  filter: drop-shadow(0 6px 4px rgba(13, 57, 87, .28));
}

.rook-practice-blocker-piece {
  filter: none;
  height: 11.25%;
  object-fit: fill;
  transform: translate(-50%, -50%);
  transition: left 900ms linear, top 900ms linear, opacity 180ms ease;
  width: 11.25%;
}

.rook-practice-blocker-piece.chess-piece {
  filter: drop-shadow(0 6px 4px rgba(13, 57, 87, .28));
  height: var(--board-piece-square-size);
  object-fit: contain;
  transform: translate(-50%, -50%) scale(var(--board-piece-scale));
  width: var(--board-piece-square-size);
}

.rook-movement-attack-piece {
  height: var(--board-piece-square-size);
  object-fit: contain;
  position: absolute;
  transform: translate(-50%, -50%) scale(var(--board-piece-scale));
  width: var(--board-piece-square-size);
  z-index: 2;
  filter: drop-shadow(0 6px 4px rgba(13, 57, 87, .28));
}

.rook-movement-blocking-pawn {
  left: 18.75%;
  top: 56.25%;
}

.rook-movement-attack-piece {
  transition: left var(--attack-move-duration, var(--piece-move-ms-per-square, 420ms)) linear, top var(--attack-move-duration, var(--piece-move-ms-per-square, 420ms)) linear, opacity 220ms ease;
  will-change: left, top;
}

.rook-movement-attack-piece.is-rook-piece-resetting {
  transition: none;
}

.rook-movement-blocking-pawn[hidden],
.rook-movement-example-blocking-piece[hidden],
.rook-movement-capture-piece[hidden],
.rook-practice-target-piece[hidden],
.rook-practice-blocker-piece[hidden],
.rook-practice-star[hidden],
.rook-movement-attack-piece[hidden] {
  display: none;
}

.rook-practice-star {
  aspect-ratio: 1;
  left: 50%;
  pointer-events: none;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 9.5%;
  z-index: 7;
}

.rook-practice-star.is-rook-practice-revealing,
.rook-practice-target-piece.is-rook-practice-revealing {
  animation: rook-practice-overlay-reveal 360ms ease-out both;
}

.rook-practice-star .interaction-feedback-star {
  animation: rook-practice-star-breathe 1.15s ease-in-out infinite alternate;
  color: #d19a00;
  filter: drop-shadow(0 0 9px rgba(255, 207, 60, .62));
  width: 100%;
}

.rook-practice-star .interaction-feedback-star-default,
.rook-practice-star .interaction-feedback-star .interaction-feedback-star-lightning,
.rook-practice-star .interaction-feedback-star .interaction-feedback-star-crosses,
.rook-practice-star .interaction-feedback-star .interaction-feedback-star-mouth-crying {
  opacity: 0;
}

.rook-practice-star .interaction-feedback-star .feedback-star-body-fill,
.rook-practice-star .interaction-feedback-star .feedback-star-body-frame,
.rook-practice-star .interaction-feedback-star .interaction-feedback-star-glasses,
.rook-practice-star .interaction-feedback-star .interaction-feedback-star-mouth-happy {
  opacity: 1;
  transform: scale(1);
}

.rook-practice-star .interaction-feedback-star .feedback-star-body-fill {
  background: #fff2a8;
}

.rook-plan-target-marker {
  align-items: center;
  color: #111827;
  display: grid;
  font-family: Arial, sans-serif;
  font-size: clamp(28px, 5vw, 52px);
  font-weight: 900;
  height: 11.25%;
  justify-items: center;
  line-height: 1;
  pointer-events: none;
  position: absolute;
  text-shadow: 0 2px 0 rgba(255, 255, 255, .42);
  transform: translate(-50%, -50%);
  width: 11.25%;
  z-index: 5;
}

.rook-plan-target-marker-number {
  background: rgba(17, 24, 39, .92);
  border: 2px solid rgba(255, 255, 255, .72);
  border-radius: 4px;
  box-shadow: 0 5px 10px rgba(17, 24, 39, .28);
  color: #fff;
  font-size: clamp(16px, 2.6vw, 28px);
  height: 7%;
  text-shadow: none;
  width: 7%;
}

.board-intro-square.is-rook-route-target {
  box-shadow: inset 0 0 0 5px #ef4444;
  z-index: 4;
}

.board-intro-square.is-rook-route-target .square-name-label {
  color: #ef4444;
  text-shadow: 0 1px 7px rgba(255, 255, 255, .9);
}

.board-intro-square.is-bishop-route-target {
  box-shadow: inset 0 0 0 5px #ef4444;
  z-index: 4;
}

.board-intro-square.is-bishop-route-target .square-name-label {
  color: #ef4444;
  text-shadow: 0 1px 7px rgba(255, 255, 255, .9);
}

.board-intro-square.is-queen-route-target {
  box-shadow: inset 0 0 0 5px #ef4444;
  z-index: 4;
}

.board-intro-square.is-queen-route-target .square-name-label {
  color: #ef4444;
  text-shadow: 0 1px 7px rgba(255, 255, 255, .9);
}

.board-intro-square.is-king-route-target {
  box-shadow: inset 0 0 0 5px #ef4444;
  z-index: 4;
}

.board-intro-square.is-king-route-target .square-name-label {
  color: #ef4444;
  text-shadow: 0 1px 7px rgba(255, 255, 255, .9);
}

.board-intro-square.is-knight-route-target {
  box-shadow: inset 0 0 0 5px #ef4444;
  z-index: 4;
}

.board-intro-square.is-knight-route-target .square-name-label {
  color: #ef4444;
  text-shadow: 0 1px 7px rgba(255, 255, 255, .9);
}

.queen-plan-target-marker {
  align-items: center;
  color: #111827;
  display: grid;
  font-family: Arial, sans-serif;
  font-size: clamp(28px, 5vw, 52px);
  font-weight: 900;
  height: 11.25%;
  justify-items: center;
  line-height: 1;
  pointer-events: none;
  position: absolute;
  text-shadow: 0 2px 0 rgba(255, 255, 255, .42);
  transform: translate(-50%, -50%);
  width: 11.25%;
  z-index: 5;
}

.queen-plan-target-marker-number {
  background: rgba(17, 24, 39, .92);
  border: 2px solid rgba(255, 255, 255, .72);
  border-radius: 4px;
  box-shadow: 0 5px 10px rgba(17, 24, 39, .28);
  color: #fff;
  font-size: clamp(16px, 2.6vw, 28px);
  height: 7%;
  text-shadow: none;
  width: 7%;
}

.rook-plan-target-marker[hidden],
.queen-plan-target-marker[hidden],
.rook-plan-opponent-piece[hidden] {
  display: none;
}

.rook-plan-opponent-piece {
  filter: drop-shadow(0 6px 4px rgba(13, 57, 87, .28));
  height: var(--board-piece-square-size);
  object-fit: contain;
  position: absolute;
  transform: translate(-50%, -50%) scale(var(--board-piece-scale));
  width: var(--board-piece-square-size);
  z-index: 10;
}

.rook-plan-opponent-piece.is-rook-plan-capturing {
  transition: left var(--plan-capture-duration, 420ms) linear, top var(--plan-capture-duration, 420ms) linear;
  z-index: 40 !important;
}

.rook-plan-opponent-piece.is-rook-plan-capturer {
  filter: drop-shadow(0 8px 8px rgba(92, 18, 18, .36));
  z-index: 40 !important;
}

.rook-movement-board-piece.is-rook-plan-captured {
  opacity: 0;
  transform: translate(-50%, -50%) scale(.64);
  transition: opacity 180ms ease, transform 180ms ease;
  z-index: 7;
}

.bishop-plan-target-marker {
  align-items: center;
  color: #111827;
  display: grid;
  font-family: Arial, sans-serif;
  font-size: clamp(28px, 5vw, 52px);
  font-weight: 900;
  height: 11.25%;
  justify-items: center;
  line-height: 1;
  pointer-events: none;
  position: absolute;
  text-shadow: 0 2px 0 rgba(255, 255, 255, .42);
  transform: translate(-50%, -50%);
  width: 11.25%;
  z-index: 5;
}

.bishop-plan-target-marker-number {
  background: rgba(17, 24, 39, .92);
  border: 2px solid rgba(255, 255, 255, .72);
  border-radius: 4px;
  box-shadow: 0 5px 10px rgba(17, 24, 39, .28);
  color: #fff;
  font-size: clamp(16px, 2.6vw, 28px);
  height: 7%;
  text-shadow: none;
  width: 7%;
}

.bishop-plan-target-marker[hidden],
.bishop-plan-opponent-piece[hidden] {
  display: none;
}

.bishop-plan-opponent-piece {
  filter: drop-shadow(0 6px 4px rgba(13, 57, 87, .28));
  height: 12.5%;
  object-fit: contain;
  position: absolute;
  transform: translate(-50%, -50%) scale(var(--board-piece-scale));
  width: 12.5%;
  z-index: 10;
}

.bishop-plan-opponent-piece.is-bishop-plan-capturing {
  transition: left var(--plan-capture-duration, 420ms) linear, top var(--plan-capture-duration, 420ms) linear;
  z-index: 40 !important;
}

.bishop-plan-opponent-piece.is-bishop-plan-capturer {
  filter: drop-shadow(0 8px 8px rgba(92, 18, 18, .36));
  z-index: 40 !important;
}

.bishop-movement-board-piece.is-bishop-plan-captured {
  opacity: 0;
  transform: translate(-50%, -50%) scale(.64);
  transition: opacity 180ms ease, transform 180ms ease;
  z-index: 7;
}

.rook-retaliation-arrow-layer { inset: 0; pointer-events: none; position: absolute; width: 100%; height: 100%; z-index: 1; }
.rook-retaliation-arrow-layer [data-rook-retaliation-arrow] { fill: none; stroke: var(--lesson-danger, #d62f2f); stroke-width: 14; stroke-linecap: butt; opacity: 1; transition: opacity 260ms ease; }
.rook-retaliation-arrow-layer [hidden] { display: none; }
.rook-practice-route-guidance-layer { inset: 0; pointer-events: none; position: absolute; width: 100%; height: 100%; z-index: 5; }
.rook-practice-route-guidance-layer line { fill: none; stroke: #32a66c; stroke-width: 12; stroke-linecap: butt; filter: drop-shadow(0 2px 1px rgba(255, 255, 255, .88)); }
.rook-practice-route-guidance-layer marker path { fill: #32a66c; }
.rook-practice-route-guidance-layer line[data-rook-practice-route-guidance-color="blue"] { stroke: #2d73c9; }
.rook-practice-route-guidance-layer line[data-rook-practice-route-guidance-color="orange"] { stroke: #e8872e; }
.rook-practice-route-guidance-layer line[data-rook-practice-route-guidance-color="purple"] { stroke: #8756c7; }
.rook-practice-route-guidance-layer #rook-practice-route-guidance-arrowhead-blue path { fill: #2d73c9; }
.rook-practice-route-guidance-layer #rook-practice-route-guidance-arrowhead-orange path { fill: #e8872e; }
.rook-practice-route-guidance-layer #rook-practice-route-guidance-arrowhead-purple path { fill: #8756c7; }
.bishop-practice-route-guidance-layer { inset: 0; pointer-events: none; position: absolute; width: 100%; height: 100%; z-index: 5; }
.bishop-practice-route-guidance-layer line { fill: none; stroke: #32a66c; stroke-width: 12; stroke-linecap: butt; filter: drop-shadow(0 2px 1px rgba(255, 255, 255, .88)); }
.bishop-practice-route-guidance-layer marker path { fill: #32a66c; }
.bishop-practice-route-guidance-layer line[data-bishop-practice-route-guidance-color="blue"] { stroke: #2d73c9; }
.bishop-practice-route-guidance-layer line[data-bishop-practice-route-guidance-color="orange"] { stroke: #e8872e; }
.bishop-practice-route-guidance-layer line[data-bishop-practice-route-guidance-color="purple"] { stroke: #8756c7; }
.bishop-practice-route-guidance-layer #bishop-practice-route-guidance-arrowhead-blue path { fill: #2d73c9; }
.bishop-practice-route-guidance-layer #bishop-practice-route-guidance-arrowhead-orange path { fill: #e8872e; }
.bishop-practice-route-guidance-layer #bishop-practice-route-guidance-arrowhead-purple path { fill: #8756c7; }
.queen-practice-route-guidance-layer { inset: 0; pointer-events: none; position: absolute; width: 100%; height: 100%; z-index: 5; }
.queen-practice-route-guidance-layer line { fill: none; stroke: #32a66c; stroke-width: 12; stroke-linecap: butt; filter: drop-shadow(0 2px 1px rgba(255, 255, 255, .88)); }
.queen-practice-route-guidance-layer marker path { fill: #32a66c; }
.queen-practice-route-guidance-layer line[data-queen-practice-route-guidance-color="blue"] { stroke: #2d73c9; }
.queen-practice-route-guidance-layer line[data-queen-practice-route-guidance-color="orange"] { stroke: #e8872e; }
.queen-practice-route-guidance-layer line[data-queen-practice-route-guidance-color="purple"] { stroke: #8756c7; }
.queen-practice-route-guidance-layer #queen-practice-route-guidance-arrowhead-blue path { fill: #2d73c9; }
.queen-practice-route-guidance-layer #queen-practice-route-guidance-arrowhead-orange path { fill: #e8872e; }
.queen-practice-route-guidance-layer #queen-practice-route-guidance-arrowhead-purple path { fill: #8756c7; }
.king-practice-route-guidance-layer { inset: 0; pointer-events: none; position: absolute; width: 100%; height: 100%; z-index: 5; }
.king-practice-route-guidance-layer line { fill: none; stroke: #32a66c; stroke-width: 12; stroke-linecap: butt; filter: drop-shadow(0 2px 1px rgba(255, 255, 255, .88)); }
.king-practice-route-guidance-layer marker path { fill: #32a66c; }
.king-practice-route-guidance-layer line[data-practice-replay-color="blue"] { stroke: #2d73c9; }
.king-practice-route-guidance-layer line[data-practice-replay-color="orange"] { stroke: #e8872e; }
.king-practice-route-guidance-layer line[data-practice-replay-color="purple"] { stroke: #8756c7; }
.king-practice-route-guidance-layer #king-practice-route-guidance-arrowhead-blue path { fill: #2d73c9; }
.king-practice-route-guidance-layer #king-practice-route-guidance-arrowhead-orange path { fill: #e8872e; }
.king-practice-route-guidance-layer #king-practice-route-guidance-arrowhead-purple path { fill: #8756c7; }
.rook-practice-route-guidance-layer line[data-practice-replay-arrow],
.bishop-practice-route-guidance-layer line[data-practice-replay-arrow],
.queen-practice-route-guidance-layer line[data-practice-replay-arrow],
.king-practice-route-guidance-layer line[data-practice-replay-arrow] {
  fill: none;
  stroke: #32a66c;
  stroke-linecap: butt;
  stroke-width: 12;
  filter: drop-shadow(0 2px 1px rgba(255, 255, 255, .88));
}
.rook-practice-route-guidance-layer line[data-practice-replay-color="blue"],
.bishop-practice-route-guidance-layer line[data-practice-replay-color="blue"],
.queen-practice-route-guidance-layer line[data-practice-replay-color="blue"],
.king-practice-route-guidance-layer line[data-practice-replay-color="blue"] { stroke: #2d73c9; }
.rook-practice-route-guidance-layer line[data-practice-replay-color="orange"],
.bishop-practice-route-guidance-layer line[data-practice-replay-color="orange"],
.queen-practice-route-guidance-layer line[data-practice-replay-color="orange"],
.king-practice-route-guidance-layer line[data-practice-replay-color="orange"] { stroke: #e8872e; }
.rook-practice-route-guidance-layer line[data-practice-replay-color="purple"],
.bishop-practice-route-guidance-layer line[data-practice-replay-color="purple"],
.queen-practice-route-guidance-layer line[data-practice-replay-color="purple"],
.king-practice-route-guidance-layer line[data-practice-replay-color="purple"] { stroke: #8756c7; }
.knight-practice-route-guidance-layer { z-index: 10; }
.knight-practice-route-guidance-layer #knight-practice-route-guidance-arrowhead-blue path { fill: #2d73c9; }
.knight-practice-route-guidance-layer #knight-practice-route-guidance-arrowhead-orange path { fill: #e8872e; }
.knight-practice-route-guidance-layer #knight-practice-route-guidance-arrowhead-purple path { fill: #8756c7; }
.rook-retaliation-arrowhead-layer { inset: 0; pointer-events: none; position: absolute; width: 100%; height: 100%; z-index: 9; }
.rook-retaliation-arrowhead { fill: var(--lesson-danger, #d62f2f); }
.rook-retaliation-arrowhead[hidden] { display: none; }
.rook-attack-arrow-layer { inset: 0; pointer-events: none; position: absolute; width: 100%; height: 100%; z-index: 5; }
.rook-attack-arrow-layer { z-index: 7; }
.rook-attack-arrow-layer line { fill: none; stroke-width: 14; stroke-linecap: butt; opacity: 1; transition: opacity 260ms ease; }
.rook-attack-arrow-layer line.is-rook-attack-arrow-fading { opacity: 0; }
.rook-attack-arrow-layer [hidden] { display: none; }
.rook-attack-arrow-layer line.is-shortest-attack { color: #32a66c; stroke: #32a66c; }
.rook-attack-arrow-layer line.is-detour-attack { color: #e2a400; stroke: #e2a400; }
.rook-attack-risk-frame { border: var(--lesson-frame-width, 5px) solid var(--lesson-danger, #d62f2f); box-sizing: border-box; height: 12.5%; position: absolute; transform: translate(-50%, -50%); width: 12.5%; z-index: 6; animation: rook-attack-risk-pulse 800ms ease-in-out infinite; }
.rook-attack-risk-frame.is-rook-attack-risk { border-color: var(--lesson-danger, #d62f2f); }
.rook-attack-risk-frame.is-rook-attack-protected { border-color: var(--lesson-safe, #25984b); }
@keyframes rook-attack-risk-pulse { 50% { opacity: .35; transform: translate(-50%, -50%) scale(.92); } }
.rook-attack-movable-frame { border: var(--lesson-frame-width, 4px) solid var(--lesson-safe, #2878c8); box-sizing: border-box; height: 12.5%; pointer-events: none; position: absolute; transform: translate(-50%, -50%); width: 12.5%; z-index: 6; }

.board-intro-square.is-rook-reachable::after,
.board-intro-square.is-bishop-reachable::after,
.board-intro-square.is-queen-reachable::after {
  content: "";
  position: absolute;
  inset: 7%;
  border: var(--lesson-frame-width, 3px) solid var(--lesson-safe, #32a66c);
  border-radius: 3px;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, .78) inset;
  animation: rook-reachable-breathe 1.15s ease-in-out infinite alternate;
}

.board-intro-square.is-king-reachable::after {
  content: "";
  position: absolute;
  inset: 7%;
  border: var(--lesson-frame-width, 3px) solid var(--lesson-safe, #32a66c);
  border-radius: 3px;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, .78) inset;
  animation: rook-reachable-breathe 1.15s ease-in-out infinite alternate;
}

.board-intro-square.is-rook-movement-mask::before,
.board-intro-square.is-bishop-movement-mask::before,
.board-intro-square.is-queen-movement-mask::before {
  background: rgba(103, 209, 144, .55);
  content: "";
  inset: 0;
  pointer-events: none;
  position: absolute;
  z-index: 1;
}

.board-intro-square.is-king-movement-mask::before {
  background: rgba(103, 209, 144, .55);
  content: "";
  inset: 0;
  pointer-events: none;
  position: absolute;
  z-index: 1;
}

.board-intro-square.is-bishop-white-movement-mask::before,
.board-intro-square.is-bishop-black-movement-mask::before {
  content: "";
  inset: 0;
  pointer-events: none;
  position: absolute;
  z-index: 1;
}

.board-intro-square.is-bishop-white-movement-mask::before { background: rgba(103, 209, 144, .55); }
.board-intro-square.is-bishop-black-movement-mask::before { background: rgba(82, 188, 231, .58); }
.board-intro-square.is-bishop-white-movement-mask.is-bishop-black-movement-mask::before { background: rgba(103, 209, 144, .55); box-shadow: inset 0 0 0 3px rgba(82, 188, 231, .94); }

.rook-movement-demo {
  container-type: size;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  position: relative;
  padding: 12px 12px 10px;
  overflow: hidden;
}

.board-panel-page-teacher:has(.rook-movement-demo) .lesson-console-topic-pages,
.board-panel-page-teacher:has(.rook-movement-demo) .lesson-console-topic-page.is-active,
.board-panel-page-teacher:has(.bishop-movement-demo) .lesson-console-topic-pages,
.board-panel-page-teacher:has(.bishop-movement-demo) .lesson-console-topic-page.is-active,
.board-panel-page-teacher:has(.queen-movement-demo) .lesson-console-topic-pages,
.board-panel-page-teacher:has(.queen-movement-demo) .lesson-console-topic-page.is-active,
.board-panel-page-teacher:has(.king-movement-demo) .lesson-console-topic-pages,
.board-panel-page-teacher:has(.king-movement-demo) .lesson-console-topic-page.is-active {
  height: 100%;
}

.board-panel-page-teacher:has(.pawn-movement-demo) .lesson-console-topic-pages,
.board-panel-page-teacher:has(.pawn-movement-demo) .lesson-console-topic-page.is-active {
  height: 100%;
}

.rook-movement-heading {
  flex: 0 0 auto;
  margin: 0;
  color: #0b4f7d;
  font-size: 32px;
  font-weight: 900;
  line-height: 1.25;
  letter-spacing: 0;
  text-align: center;
  white-space: nowrap;
}

.rook-capture-demo .rook-capture-message {
  grid-template-rows: repeat(3, minmax(1.25em, auto));
  min-height: calc((3 * 1.25em) + 12px);
}

.rook-practice-content {
  align-items: center;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  padding: 12px 12px 10px;
  position: relative;
  width: 100%;
}

.rook-practice-content .rook-practice-prompt {
  flex: 0 0 auto;
}

.rook-practice-content .rook-movement-direction-multiple {
  display: grid;
}

.rook-practice-content .rook-movement-direction-icon {
  filter: invert(47%) sepia(63%) saturate(1893%) hue-rotate(345deg) brightness(98%) contrast(91%);
}

.rook-practice-workbench-piece {
  cursor: default;
  pointer-events: none;
}

.rook-practice-workbench-piece:hover img,
.rook-practice-workbench-piece:focus-visible img {
  transform: none;
}

.rook-safe-placement-workbench-piece {
  margin-top: auto;
}

/* 互动练习复用授课控制台的网格、车棋子和数字按钮。 */
.rook-practice-movement-grid {
  align-items: center;
  margin-top: auto;
}

.rook-movement-grid {
  align-self: center;
  aspect-ratio: 1;
  display: grid;
  flex: 0 0 auto;
  grid-template-areas:
    ". up ."
    "left center right"
    ". down .";
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  margin: auto auto 8px;
  order: 3;
  width: min(168px, 100%);
}

.rook-movement-workbench-piece {
  align-self: center;
  display: grid;
  grid-area: center;
  height: 100%;
  justify-self: center;
  margin: 0;
  outline: 0;
  place-items: center;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.rook-movement-workbench-piece img {
  width: min(88px, 92%);
  max-height: 92%;
  filter: drop-shadow(0 8px 6px rgba(13, 57, 87, .25));
  transition: transform 180ms ease;
}

.rook-movement-workbench-piece:hover img,
.rook-movement-workbench-piece:focus-visible img {
  transform: translateY(-4px) scale(1.04);
}

.rook-movement-workbench-piece:disabled {
  cursor: not-allowed;
  opacity: .58;
}

.rook-movement-direction {
  align-self: center;
  z-index: 2;
  display: none;
  justify-self: center;
  place-items: center;
  width: 56px;
  height: 56px;
  padding: 0;
  border: 0;
  background: transparent;
  pointer-events: auto;
  position: relative;
  cursor: pointer;
  touch-action: manipulation;
}

/* 反吃棋子必须覆盖本方车；本方车只会在对方抵达目标格后被隐藏。 */
.rook-movement-attack-piece.is-rook-retaliating { z-index: 9; }
.rook-movement-capture-piece.is-rook-retaliating { z-index: 9; }

.rook-movement-direction-icon {
  display: block;
  width: 52px;
  height: 52px;
  filter: invert(43%) sepia(74%) saturate(674%) hue-rotate(106deg) brightness(88%) contrast(93%);
  transition: filter 160ms ease, transform 160ms ease;
}

.rook-movement-direction:hover:not(:disabled),
.rook-movement-direction:focus-visible:not(:disabled) {
  transform: scale(1.1);
  outline: 0;
}

.rook-movement-direction:disabled,
.bishop-movement-direction:disabled,
.queen-movement-direction:disabled {
  cursor: not-allowed;
  opacity: .44;
  pointer-events: none;
}

.rook-practice-content .rook-movement-direction:hover,
.rook-practice-content .rook-movement-direction:focus-visible {
  background: transparent;
  box-shadow: none;
  filter: none;
}

.rook-movement-direction.is-selected {
  transform: scale(1.08);
}

.rook-movement-direction.is-selected .rook-movement-direction-icon {
  opacity: 0;
}

.rook-movement-direction.is-selected::before {
  background: #d62f2f;
  content: "";
  height: 52px;
  left: 2px;
  -webkit-mask: url("/static/classroom/images/direction-arrows/箭头(上1).svg") center / contain no-repeat;
  mask: url("/static/classroom/images/direction-arrows/箭头(上1).svg") center / contain no-repeat;
  pointer-events: none;
  position: absolute;
  width: 52px;
}

.rook-movement-direction.is-selected::before { top: 2px; }

/* 多棋格方向的选中态应保留双箭头含义，授课与互动共用。 */
.rook-movement-direction-multiple.is-selected::before {
  -webkit-mask-image: url("/static/classroom/images/direction-arrows/箭头(上2).svg");
  mask-image: url("/static/classroom/images/direction-arrows/箭头(上2).svg");
}

.rook-movement-direction.is-selected.rook-movement-direction-down::before { transform: rotate(180deg); }

.rook-movement-direction.is-selected.rook-movement-direction-left::before { transform: rotate(-90deg); }

.rook-movement-direction.is-selected.rook-movement-direction-right::before { transform: rotate(90deg); }

.rook-movement-direction-up { grid-area: up; }
.rook-movement-direction-down { grid-area: down; }
.rook-movement-direction-left { grid-area: left; }
.rook-movement-direction-right { grid-area: right; }

.rook-movement-demo[data-rook-stage="3"] .rook-movement-direction-single,
.rook-movement-demo[data-rook-stage="4"] .rook-movement-direction-multiple,
.rook-movement-demo[data-rook-stage="5"] .rook-movement-direction-multiple,
.rook-movement-demo[data-rook-stage="6"] .rook-movement-direction-multiple,
.rook-movement-demo[data-rook-stage="7"] .rook-movement-direction-multiple,
.rook-movement-demo[data-rook-stage="8"] .rook-movement-direction-multiple {
  display: grid;
}

.rook-movement-demo[data-rook-stage="4"] .rook-movement-direction,
.rook-movement-demo[data-rook-stage="5"] .rook-movement-direction,
.rook-movement-demo[data-rook-stage="6"] .rook-movement-direction,
.rook-movement-demo[data-rook-stage="7"] .rook-movement-direction,
.rook-movement-demo[data-rook-stage="8"] .rook-movement-direction {
  filter: none;
}

.rook-movement-demo[data-rook-stage="4"] .rook-movement-direction-icon,
.rook-movement-demo[data-rook-stage="5"] .rook-movement-direction-icon,
.rook-movement-demo[data-rook-stage="6"] .rook-movement-direction-icon,
.rook-movement-demo[data-rook-stage="7"] .rook-movement-direction-icon,
.rook-movement-demo[data-rook-stage="8"] .rook-movement-direction-icon {
  filter: invert(47%) sepia(63%) saturate(1893%) hue-rotate(345deg) brightness(98%) contrast(91%);
}

.rook-movement-distance-controls {
  display: grid;
  align-items: center;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  column-gap: 2px;
  justify-content: center;
  margin: 0 auto 8px;
  order: 4;
  width: min(350px, calc(100% + 2px));
  flex: 0 0 52px;
  visibility: hidden;
  pointer-events: none;
}

.rook-movement-demo[data-rook-stage="3"] .rook-movement-distance-controls,
.rook-movement-demo[data-rook-stage="4"] .rook-movement-distance-controls,
.rook-movement-demo[data-rook-stage="5"] .rook-movement-distance-controls,
.rook-movement-demo[data-rook-stage="6"] .rook-movement-distance-controls,
.rook-movement-demo[data-rook-stage="7"] .rook-movement-distance-controls,
.rook-movement-demo[data-rook-stage="8"] .rook-movement-distance-controls {
  visibility: visible;
  pointer-events: auto;
}

.rook-movement-demo[data-rook-stage="3"] .rook-movement-distance:not([data-rook-distance="1"]) {
  visibility: hidden;
  pointer-events: none;
}

.rook-movement-distance {
  display: grid;
  place-items: center;
  justify-self: center;
  width: 100%;
  max-width: 46px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  cursor: pointer;
  aspect-ratio: 1;
  touch-action: manipulation;
  user-select: none;
}

/* 互动面板的通用按钮皮肤不应覆盖棋子走法的授课控制台样式。 */
.board-panel-page-student .rook-movement-direction,
.board-panel-page-student .rook-movement-distance,
.board-panel-page-student .bishop-movement-direction,
.board-panel-page-student .bishop-movement-distance {
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  min-height: 0;
  padding: 0;
}

.board-panel-page-student .rook-movement-distance,
.board-panel-page-student .bishop-movement-distance {
  display: grid;
}

.rook-movement-distance-icon {
  display: block;
  width: 92%;
  height: 92%;
  transition: filter 160ms ease, transform 160ms ease;
}

.rook-movement-demo[data-rook-stage="3"] .rook-movement-distance-icon {
  filter: invert(24%) sepia(68%) saturate(1874%) hue-rotate(234deg) brightness(90%) contrast(96%);
}

.rook-movement-demo[data-rook-stage="4"] .rook-movement-distance-icon,
.rook-movement-demo[data-rook-stage="5"] .rook-movement-distance-icon,
.rook-movement-demo[data-rook-stage="6"] .rook-movement-distance-icon,
.rook-movement-demo[data-rook-stage="7"] .rook-movement-distance-icon,
.rook-movement-demo[data-rook-stage="8"] .rook-movement-distance-icon {
  filter: invert(24%) sepia(68%) saturate(1874%) hue-rotate(234deg) brightness(90%) contrast(96%);
}

.rook-practice-content .rook-movement-distance-controls {
  pointer-events: auto;
  visibility: visible;
}

.rook-practice-content.is-rook-safe-placement-round .rook-practice-movement-grid,
.rook-practice-content.is-rook-safe-placement-round .rook-movement-distance-controls {
  display: none;
}

.rook-practice-content .rook-movement-distance-icon {
  filter: invert(24%) sepia(68%) saturate(1874%) hue-rotate(234deg) brightness(90%) contrast(96%);
}

.rook-movement-distance:not(:disabled):hover,
.rook-movement-distance:not(:disabled):focus-visible {
  outline: 0;
}

.rook-movement-distance:not(:disabled):hover .rook-movement-distance-icon,
.rook-movement-distance:not(:disabled):focus-visible .rook-movement-distance-icon {
  filter: invert(24%) sepia(68%) saturate(1874%) hue-rotate(234deg) brightness(90%) contrast(96%) drop-shadow(0 2px 2px rgba(67, 56, 202, .26));
  transform: scale(1.08);
}

.rook-movement-distance:disabled {
  cursor: default;
  opacity: .48;
}

.rook-movement-demo[data-rook-stage="3"] .rook-movement-distance[data-rook-distance="1"] {
  opacity: 1;
}

.rook-movement-message-stack {
  display: grid;
  flex: 0 0 auto;
  gap: 6px;
  grid-template-rows: repeat(2, minmax(1.25em, auto));
  margin: 12px auto 0;
  min-height: calc((2 * 1.25em) + 24px);
  order: 2;
  color: #b42318;
  font-size: 24px;
  font-weight: 800;
  line-height: 1.25;
  text-align: center;
  white-space: nowrap;
}

.rook-movement-message-stack p { margin: 0; }
.rook-movement-message-multiline { white-space: normal; }
.rook-movement-message-multiline span { display: block; }
/* 第 8、9 讲义的多行第二段沿用单行第二段的首段间距。 */
.rook-movement-message-stack:has([data-rook-message="example-count"]:not([hidden])),
.rook-movement-message-stack:has([data-rook-message="example-blocked"]:not([hidden])) {
  min-height: calc((3 * 1.25em) + 24px);
}
.rook-movement-message-stack [data-rook-message="straight"] { grid-row: 1; }
.rook-movement-message-stack [data-rook-message="reachable"] { grid-row: 2; }
.rook-movement-message-stack [data-rook-message="single"] { grid-row: 2; }
.rook-movement-message-stack [data-rook-message="multiple"] { grid-row: 2; }
.rook-movement-message-stack [data-rook-message="blocked"] { grid-row: 2; }
.rook-movement-message-stack [data-rook-message="example-initial"] { grid-row: 2; }
.rook-movement-message-stack [data-rook-message="example-count"] { grid-row: 2; }
.rook-movement-message-stack [data-rook-message="example-blocked"] { grid-row: 2; }
@keyframes rook-board-piece-float-in {
  from { opacity: 0; transform: translate(-50%, -50%) scale(.68); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(.82); }
}

@keyframes rook-practice-overlay-reveal {
  from { opacity: 0; transform: translate(-50%, -50%) scale(.72); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(var(--board-piece-scale)); }
}

@keyframes rook-distance-label-appear {
  from { opacity: 0; transform: translate(-50%, -50%) scale(.72); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

@keyframes rook-practice-star-breathe {
  from { transform: scale(.94); }
  to { transform: scale(1.08); }
}

.bishop-movement-board-layer { position: absolute; inset: 0; pointer-events: none; z-index: 3; }
.bishop-retaliation-arrow-layer { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1; }
.bishop-retaliation-arrowhead-layer { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 8; }
.bishop-retaliation-arrowhead { fill: var(--lesson-danger, #d62f2f); }
.bishop-retaliation-arrowhead[hidden] { display: none; }
.bishop-movement-arrow-layer { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 5; }
.bishop-movement-arrow-layer { z-index: 5; }
.bishop-movement-board-piece { z-index: 6; }
.bishop-movement-scene-piece { z-index: 4; }
.bishop-movement-scene-piece.is-bishop-retaliating { z-index: 9; }
.bishop-movement-arrow-layer [data-bishop-arrow] { fill: none; stroke: #32a66c; stroke-width: 14; stroke-linecap: butt; marker-end: url(#bishop-movement-arrowhead); opacity: 0; }
.bishop-movement-arrow-layer marker path { fill: #32a66c; }
.bishop-movement-board-layer.is-bishop-arrow-stage .bishop-movement-arrow-layer [data-bishop-arrow] { opacity: 1; }
.bishop-movement-attack-arrow { fill: none; stroke: #32a66c; stroke-linecap: butt; stroke-width: 14; }
.bishop-movement-attack-arrow.is-warning { stroke: #e6a817; }
#bishop-attack-warning-arrowhead path { fill: #e6a817; }
.bishop-movement-attack-arrow[hidden] { display: none; }
.bishop-retaliation-arrow { fill: none; stroke: var(--lesson-danger, #d62f2f); stroke-linecap: butt; stroke-width: 14; }
.bishop-retaliation-arrow[hidden] { display: none; }
#bishop-retaliation-arrowhead path { fill: var(--lesson-danger, #d62f2f); }
.bishop-attack-risk-frame { animation: bishop-attack-risk-pulse 800ms ease-in-out infinite; border: var(--lesson-frame-width, 5px) solid var(--lesson-danger, #d62f2f); box-sizing: border-box; height: 12.5%; position: absolute; transform: translate(-50%, -50%); width: 12.5%; z-index: 7; }
.bishop-attack-risk-frame.is-settled, .rook-attack-risk-frame.is-settled { animation: none; opacity: 1; transform: translate(-50%, -50%); }
.bishop-attack-risk-frame[hidden] { display: none; }
@keyframes bishop-attack-risk-pulse { 50% { opacity: .35; transform: translate(-50%, -50%) scale(.92); } }
.bishop-movement-board-piece, .bishop-movement-scene-piece, .bishop-practice-target-piece, .bishop-practice-blocker-piece { height: var(--board-piece-square-size); object-fit: contain; position: absolute; transform: translate(-50%, -50%) scale(var(--board-piece-scale)); transition: left var(--bishop-attack-move-duration, var(--piece-move-ms-per-square, 420ms)) linear, top var(--bishop-attack-move-duration, var(--piece-move-ms-per-square, 420ms)) linear, opacity 220ms ease; width: var(--board-piece-square-size); }
.bishop-movement-board-piece.is-bishop-initially-revealing { animation: bishop-initial-piece-reveal 520ms 80ms cubic-bezier(.16, 1, .3, 1) both; }
@keyframes bishop-initial-piece-reveal {
  from { opacity: 0; transform: translate(-50%, -50%) scale(.78); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(var(--board-piece-scale)); }
}
.bishop-movement-board-piece.is-bishop-piece-resetting { transition: none; }
.bishop-movement-board-piece.is-bishop-practice-revealing { animation: bishop-practice-piece-reveal 420ms cubic-bezier(.16, .8, .24, 1) both; }
@keyframes bishop-practice-piece-reveal {
  from { opacity: 0; transform: translate(-50%, -50%) scale(.74); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(var(--board-piece-scale)); }
}
.bishop-practice-blocker-piece { filter: none; height: 11.25%; object-fit: fill; width: 11.25%; z-index: 2; }
.bishop-practice-blocker-piece.chess-piece { filter: drop-shadow(0 6px 4px rgba(13, 57, 87, .28)); height: var(--board-piece-square-size); object-fit: contain; transform: translate(-50%, -50%) scale(var(--board-piece-scale)); width: var(--board-piece-square-size); z-index: 10; }
.bishop-movement-board-piece[hidden], .bishop-movement-scene-piece[hidden], .bishop-practice-target-piece[hidden], .bishop-practice-blocker-piece[hidden], .bishop-practice-star[hidden] { display: none; }
.bishop-distance-label-layer { inset: 0; pointer-events: none; position: absolute; z-index: 1; }
.bishop-distance-label { animation: rook-distance-label-appear 320ms ease-out both; height: 8%; object-fit: contain; opacity: 0; position: absolute; transform: translate(-50%, -50%) scale(.72); width: 8%; }
.bishop-practice-star { aspect-ratio: 1; left: 50%; pointer-events: none; position: absolute; top: 50%; transform: translate(-50%, -50%); width: 9.5%; z-index: 7; }
.bishop-practice-star.is-bishop-practice-revealing,
.bishop-practice-target-piece.is-bishop-practice-revealing { animation: bishop-practice-overlay-reveal 360ms ease-out both; }
@keyframes bishop-practice-overlay-reveal {
  from { opacity: 0; transform: translate(-50%, -50%) scale(.72); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(var(--board-piece-scale)); }
}
.bishop-practice-star .interaction-feedback-star { animation: none; color: #d19a00; filter: drop-shadow(0 0 9px rgba(255,207,60,.62)); width: 100%; }
.bishop-practice-star .interaction-feedback-star-default,
.bishop-practice-star .interaction-feedback-star .interaction-feedback-star-lightning,
.bishop-practice-star .interaction-feedback-star .interaction-feedback-star-crosses,
.bishop-practice-star .interaction-feedback-star .interaction-feedback-star-mouth-crying {
  opacity: 0;
}
.bishop-practice-star .interaction-feedback-star .feedback-star-body-fill,
.bishop-practice-star .interaction-feedback-star .feedback-star-body-frame,
.bishop-practice-star .interaction-feedback-star .interaction-feedback-star-glasses,
.bishop-practice-star .interaction-feedback-star .interaction-feedback-star-mouth-happy {
  opacity: 1;
  transform: scale(1);
}
.bishop-practice-star .interaction-feedback-star .feedback-star-body-fill {
  background: #fff2a8;
}
.bishop-movement-demo { container-type: size; display: flex; flex-direction: column; height: 100%; min-height: 0; overflow: hidden; padding: 12px 12px 10px; position: relative; text-align: center; }
.bishop-movement-heading { flex: 0 0 auto; font-size: clamp(28px, 2.5vw, 38px); margin: 0; }
.bishop-movement-message-stack { color: #b42318; display: grid; flex: 0 0 auto; font-size: 24px; font-weight: 800; gap: 6px; grid-template-rows: repeat(2, minmax(1.25em, auto)); line-height: 1.25; margin: 12px auto 0; min-height: calc((2 * 1.25em) + 24px); order: 2; text-align: center; white-space: nowrap; }
.bishop-movement-message-stack p { margin: 0; }
.bishop-movement-message-multiline { white-space: normal; }
.bishop-movement-message-multiline span { display: block; }
/* 第 8、9 讲义的多行第二段沿用单行第二段的首段间距。 */
.bishop-movement-message-stack:has([data-bishop-message="free"]:not([hidden])),
.bishop-movement-message-stack:has([data-bishop-message="blocked-distance"]:not([hidden])) {
  min-height: calc((3 * 1.25em) + 24px);
}
.bishop-capture-message { grid-row: 1 / span 2; }
.bishop-capture-attack-message { grid-row: 1 / span 2; }
.bishop-movement-message-stack [data-bishop-message="straight"] { grid-row: 1; }
.bishop-movement-message-stack [data-bishop-message="reachable"], .bishop-movement-message-stack [data-bishop-message="single"], .bishop-movement-message-stack [data-bishop-message="multiple"] { grid-row: 2; }
.bishop-movement-message-stack [data-bishop-message="color"] { grid-row: 2; }
.bishop-movement-message-stack [data-bishop-message="free"] { grid-row: 2; }
.bishop-movement-message-stack [data-bishop-message="blocked"] { grid-row: 2; }
.bishop-movement-message-stack [data-bishop-message="blocked-distance"] { grid-row: 2; }
.bishop-movement-grid { align-self: center; aspect-ratio: 1; display: grid; flex: 0 0 auto; grid-template-areas: "up-left . up-right" ". center ." "down-left . down-right"; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); margin: auto auto 8px; order: 3; width: min(168px, 100%); }
.bishop-movement-workbench-piece { align-self: center; background: transparent; border: 0; cursor: pointer; display: grid; grid-area: center; height: 100%; padding: 0; place-items: center; width: 100%; }
.bishop-movement-workbench-piece:disabled { cursor: not-allowed; opacity: .58; }
.bishop-movement-workbench-piece img { max-height: 92%; object-fit: contain; width: min(88px, 92%); }
.bishop-movement-dual-grid { align-items: center; display: none; flex: 0 0 auto; gap: 18px; justify-content: center; margin: auto auto 8px; order: 3; width: min(354px, 100%); }
.bishop-movement-dual-grid[hidden] { display: none !important; }
.bishop-movement-color-grid { margin: 0; width: min(168px, calc((100% - 18px) / 2)); }
.bishop-movement-color-piece { border-radius: 2px; cursor: default; height: 76%; justify-self: center; width: 76%; }
.bishop-movement-color-piece-white { background: #f1d5b1; box-shadow: inset 0 0 0 2px rgba(150, 112, 76, .48); cursor: pointer; }
.bishop-movement-color-piece-black { background: #be6537; box-shadow: inset 0 0 0 2px rgba(104, 52, 29, .64); }
.bishop-movement-color-piece-white:hover, .bishop-movement-color-piece-white:focus-visible { outline: 0; transform: scale(1.05); }
.bishop-movement-color-piece img { max-height: 94%; width: 94%; }
.bishop-movement-demo.is-bishop-color-stage > .bishop-movement-grid { display: none; }
.bishop-movement-demo.is-bishop-color-stage .bishop-movement-dual-grid { display: flex; }
.bishop-movement-direction { align-self: center; background: transparent; border: 0; cursor: pointer; display: grid; height: 56px; justify-self: center; padding: 0; place-items: center; position: relative; touch-action: manipulation; width: 56px; z-index: 2; }
.bishop-movement-direction[hidden] { display: none; }
.bishop-movement-direction-icon { display: block; filter: invert(47%) sepia(63%) saturate(1893%) hue-rotate(345deg) brightness(98%) contrast(91%); height: 52px; transition: filter 160ms ease, transform 160ms ease; width: 52px; }
.bishop-movement-demo.is-bishop-single-stage .bishop-movement-direction-single .bishop-movement-direction-icon { filter: invert(43%) sepia(74%) saturate(674%) hue-rotate(106deg) brightness(88%) contrast(93%); }
.bishop-movement-direction-up-right { grid-area: up-right; }.bishop-movement-direction-down-right { grid-area: down-right; }.bishop-movement-direction-down-left { grid-area: down-left; }.bishop-movement-direction-up-left { grid-area: up-left; }
.bishop-movement-direction:hover:not(:disabled), .bishop-movement-direction:focus-visible:not(:disabled) { outline: 0; transform: scale(1.1); }
.bishop-movement-direction.is-selected { transform: none; }
.bishop-movement-direction.is-selected .bishop-movement-direction-icon { opacity: 0; }
.bishop-movement-direction.is-selected::before { background: #d62f2f; content: ""; height: 52px; left: 2px; -webkit-mask: url("/static/classroom/images/direction-arrows/箭头(上1).svg") center / contain no-repeat; mask: url("/static/classroom/images/direction-arrows/箭头(上1).svg") center / contain no-repeat; pointer-events: none; position: absolute; top: 2px; width: 52px; }
.bishop-movement-direction-multiple.is-selected::before { -webkit-mask-image: url("/static/classroom/images/direction-arrows/箭头(上2).svg"); mask-image: url("/static/classroom/images/direction-arrows/箭头(上2).svg"); }
.bishop-movement-direction.is-selected.bishop-movement-direction-up-right::before { transform: rotate(45deg); }
.bishop-movement-direction.is-selected.bishop-movement-direction-down-right::before { transform: rotate(135deg); }
.bishop-movement-direction.is-selected.bishop-movement-direction-down-left::before { transform: rotate(-135deg); }
.bishop-movement-direction.is-selected.bishop-movement-direction-up-left::before { transform: rotate(-45deg); }
.bishop-movement-distance-controls { align-items: center; column-gap: 2px; display: grid; flex: 0 0 52px; grid-template-columns: repeat(7, minmax(0, 1fr)); margin: 0 auto 8px; order: 4; width: min(350px, calc(100% + 2px)); }
.bishop-movement-distance { aspect-ratio: 1; background: transparent; border: 0; display: grid; max-width: 46px; padding: 0; place-items: center; width: 100%; }.bishop-movement-distance-icon { display: block; filter: invert(24%) sepia(68%) saturate(1874%) hue-rotate(234deg) brightness(90%) contrast(96%); height: 92%; width: 92%; }.bishop-movement-distance:disabled { opacity: .48; }
.bishop-movement-distance.is-demonstrated { opacity: 1; }
.bishop-movement-distance[hidden] { display: none !important; }
/* 象的互动练习继承车的共享布局：统一反馈星星、提示文字、九宫格、方向键和数字尺寸。 */
.bishop-practice-content .bishop-movement-direction:hover,
.bishop-practice-content .bishop-movement-direction:focus-visible,
.bishop-practice-content .bishop-movement-distance:hover,
.bishop-practice-content .bishop-movement-distance:focus-visible {
  background: transparent;
  box-shadow: none;
  filter: none;
  outline: 0;
  transform: none;
}

.bishop-practice-content .bishop-movement-distance:hover .bishop-movement-distance-icon,
.bishop-practice-content .bishop-movement-distance:focus-visible .bishop-movement-distance-icon {
  filter: invert(24%) sepia(68%) saturate(1874%) hue-rotate(234deg) brightness(90%) contrast(96%);
  transform: none;
}

@container (max-height: 600px) {
  .rook-movement-heading {
    font-size: 28px;
  }

  .rook-movement-message-stack {
    font-size: 21px;
    gap: 4px;
    margin-top: 8px;
    min-height: calc((2 * 1.25em) + 16px);
  }

  .rook-movement-message-stack:has([data-rook-message="example-count"]:not([hidden])),
  .rook-movement-message-stack:has([data-rook-message="example-blocked"]:not([hidden])) {
    min-height: calc((3 * 1.25em) + 16px);
  }

  .bishop-movement-message-stack {
    font-size: 21px;
    gap: 4px;
    margin-top: 8px;
    min-height: calc((2 * 1.25em) + 16px);
  }

  .bishop-movement-message-stack:has([data-bishop-message="free"]:not([hidden])),
  .bishop-movement-message-stack:has([data-bishop-message="blocked-distance"]:not([hidden])) {
    min-height: calc((3 * 1.25em) + 16px);
  }

  .rook-capture-demo .rook-capture-message {
    min-height: calc((3 * 1.25em) + 8px);
  }

  .rook-movement-grid {
    margin-bottom: 4px;
    width: min(148px, 100%);
  }

  .rook-movement-workbench-piece img {
    width: min(76px, 92%);
  }

  .rook-movement-direction {
    height: 50px;
    width: 50px;
  }

  .rook-movement-direction-icon,
  .rook-movement-direction.is-selected::before {
    height: 46px;
    width: 46px;
  }

  .rook-movement-distance-controls {
    flex-basis: 46px;
    margin-bottom: 4px;
  }

  .bishop-movement-grid {
    margin-bottom: 4px;
    width: min(148px, 100%);
  }

  .bishop-movement-workbench-piece img {
    width: min(76px, 92%);
  }

  .bishop-movement-direction {
    height: 50px;
    width: 50px;
  }

  .bishop-movement-direction-icon,
  .bishop-movement-direction.is-selected::before {
    height: 46px;
    width: 46px;
  }

  .bishop-movement-distance-controls {
    flex-basis: 46px;
    margin-bottom: 4px;
  }
}

@container (max-height: 520px) {
  .rook-movement-heading {
    font-size: 25px;
  }

  .rook-movement-message-stack {
    font-size: 18px;
    margin-top: 6px;
  }

  .bishop-movement-message-stack {
    font-size: 18px;
    margin-top: 6px;
  }

  .rook-movement-grid {
    width: min(132px, 100%);
  }

  .rook-movement-workbench-piece img {
    width: min(68px, 92%);
  }

  .rook-movement-direction {
    height: 44px;
    width: 44px;
  }

  .rook-movement-direction-icon,
  .rook-movement-direction.is-selected::before {
    height: 40px;
    width: 40px;
  }

  .rook-movement-distance-controls {
    flex-basis: 40px;
  }

  .bishop-movement-grid {
    width: min(132px, 100%);
  }

  .bishop-movement-workbench-piece img {
    width: min(68px, 92%);
  }

  .bishop-movement-direction {
    height: 44px;
    width: 44px;
  }

  .bishop-movement-direction-icon,
  .bishop-movement-direction.is-selected::before {
    height: 40px;
    width: 40px;
  }

  .bishop-movement-distance-controls {
    flex-basis: 40px;
  }
}

@keyframes rook-reachable-breathe {
  from { opacity: .45; transform: scale(.92); }
  to { opacity: 1; transform: scale(1); }
}

/* 后的走法：复用棋子走法工作台的尺寸体系，中心后对应八方向控制。 */
.queen-movement-board-layer {
  inset: 0;
  pointer-events: none;
  position: absolute;
  z-index: 5;
}

.queen-movement-arrow-layer {
  height: 100%;
  inset: 0;
  position: absolute;
  width: 100%;
  z-index: 6;
}

.queen-movement-arrow-layer line {
  fill: none;
  marker-end: url(#queen-movement-arrowhead);
  opacity: 0;
  stroke: #32a66c;
  stroke-linecap: butt;
  stroke-width: 14;
}

.queen-movement-arrow-layer marker path { fill: #32a66c; }
.queen-movement-arrow-layer line[hidden] { display: none; }
.is-queen-arrow-stage .queen-movement-arrow-layer line { opacity: 1; }

/* 通用棋子样式会覆盖 SVG/图片的默认 hidden 行为；后首屏必须彻底隐藏未启用的图层。 */
.queen-movement-arrow-layer [data-queen-arrow][hidden],
.queen-movement-board-piece[hidden],
.queen-movement-scene-piece[hidden],
.queen-practice-star[hidden] {
  display: none !important;
}

.queen-movement-board-piece,
.queen-movement-scene-piece,
.queen-practice-star {
  position: absolute;
  transform: translate(-50%, -50%);
}

.queen-movement-board-piece {
  height: var(--board-piece-square-size);
  object-fit: contain;
  transform: translate(-50%, -50%) scale(var(--board-piece-scale));
  width: var(--board-piece-square-size);
  z-index: 7;
}

.queen-movement-board-piece.is-queen-piece-resetting {
  animation: none;
  opacity: 0;
  transition: none;
}

.queen-movement-board-piece.is-queen-practice-revealing {
  animation: queen-practice-piece-reveal 420ms cubic-bezier(.16, .8, .24, 1) both;
}

@keyframes queen-practice-piece-reveal {
  from { opacity: 0; transform: translate(-50%, -50%) scale(.74); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(var(--board-piece-scale)); }
}

.queen-movement-arrow-layer .queen-attack-arrow {
  marker-end: url(#queen-attack-arrowhead);
  opacity: 1;
  stroke: #32a66c;
}

.queen-movement-arrow-layer .queen-retaliation-arrow {
  marker-end: none;
  opacity: 1;
  stroke: var(--lesson-danger, #d62f2f);
}

#queen-retaliation-arrowhead path { fill: var(--lesson-danger, #d62f2f); }

.queen-movement-board-layer:has(.queen-attack-arrow:not([hidden])) .queen-movement-arrow-layer { z-index: 7; }
.queen-movement-board-layer:has(.queen-retaliation-arrow:not([hidden])) .queen-movement-arrow-layer { z-index: 1; }
.queen-retaliation-arrowhead-layer { height: 100%; inset: 0; pointer-events: none; position: absolute; width: 100%; z-index: 9; }
.queen-retaliation-arrowhead { fill: var(--lesson-danger, #d62f2f); }
.queen-retaliation-arrowhead[hidden] { display: none; }
.queen-movement-board-layer:has(.queen-attack-arrow:not([hidden]), .queen-retaliation-arrow:not([hidden])) .queen-movement-board-piece { z-index: 8; }
.queen-movement-board-layer:has(.queen-attack-arrow:not([hidden]), .queen-retaliation-arrow:not([hidden])) .queen-movement-scene-piece { z-index: 6; }

.queen-movement-board-piece.is-queen-piece-moving {
  transition: left var(--queen-capture-move-duration) linear, top var(--queen-capture-move-duration) linear;
  z-index: 8;
}

.queen-movement-scene-piece.is-queen-retaliating {
  transition: left var(--queen-capture-move-duration) linear, top var(--queen-capture-move-duration) linear;
  z-index: 9;
}

.queen-attack-risk-frame {
  animation: queen-attack-risk-pulse 800ms ease-in-out infinite;
  border: var(--lesson-frame-width, 5px) solid var(--lesson-danger, #d62f2f);
  box-sizing: border-box;
  height: 12.5%;
  position: absolute;
  transform: translate(-50%, -50%);
  width: 12.5%;
  z-index: 9;
}

.queen-attack-risk-frame[hidden] { display: none; }

@keyframes queen-attack-risk-pulse {
  50% { opacity: .35; transform: translate(-50%, -50%) scale(.92); }
}

.queen-movement-board-piece.is-queen-initially-revealing {
  animation: queen-initial-piece-reveal 520ms 80ms cubic-bezier(.16, 1, .3, 1) both;
}

@keyframes queen-initial-piece-reveal {
  from { opacity: 0; transform: translate(-50%, -50%) scale(.78); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(var(--board-piece-scale)); }
}

.queen-movement-scene-piece {
  height: var(--board-piece-square-size);
  object-fit: contain;
  transform: translate(-50%, -50%) scale(var(--board-piece-scale));
  width: var(--board-piece-square-size);
  z-index: 6;
}

.queen-practice-star {
  aspect-ratio: 1;
  pointer-events: none;
  width: 9.5%;
  z-index: 7;
}

.queen-practice-star.is-queen-practice-revealing {
  animation: queen-practice-overlay-reveal 360ms ease-out both;
}

@keyframes queen-practice-overlay-reveal {
  from {
    opacity: 0;
    transform: translate(-50%, -50%) scale(.72);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(var(--board-piece-scale));
  }
}

.queen-practice-star .interaction-feedback-star {
  animation: none;
  color: #d19a00;
  filter: drop-shadow(0 0 9px rgba(255,207,60,.62));
  height: 100%;
  width: 100%;
}

.queen-practice-star .interaction-feedback-star-default,
.queen-practice-star .interaction-feedback-star .interaction-feedback-star-lightning,
.queen-practice-star .interaction-feedback-star .interaction-feedback-star-crosses,
.queen-practice-star .interaction-feedback-star .interaction-feedback-star-mouth-crying {
  opacity: 0;
}

.queen-practice-star .interaction-feedback-star .feedback-star-body-fill,
.queen-practice-star .interaction-feedback-star .feedback-star-body-frame,
.queen-practice-star .interaction-feedback-star .interaction-feedback-star-glasses,
.queen-practice-star .interaction-feedback-star .interaction-feedback-star-mouth-happy {
  opacity: 1;
  transform: scale(1);
}

.queen-practice-star .interaction-feedback-star .feedback-star-body-fill {
  background: #fff2a8;
}

.queen-movement-demo {
  container-type: size;
  height: 100%;
  overflow: hidden;
  padding: 12px 12px 10px;
  position: relative;
}

.queen-movement-demo,
.queen-practice-content {
  align-items: center;
  display: flex;
  flex-direction: column;
  min-height: 0;
  width: 100%;
}

.queen-movement-heading {
  flex: 0 0 auto;
  font-size: clamp(28px, 2.5vw, 38px);
  margin: 0;
  text-align: center;
}

.queen-movement-message-stack {
  color: #b42318;
  display: grid;
  flex: 0 0 auto;
  font-size: 24px;
  font-weight: 800;
  gap: 6px;
  grid-template-rows: repeat(2, minmax(1.25em, auto));
  line-height: 1.25;
  margin: 12px auto 0;
  min-height: calc((2 * 1.25em) + 24px);
  order: 2;
  text-align: center;
  white-space: nowrap;
}

.queen-movement-message-stack p { margin: 0; }
.queen-movement-message-multiline { white-space: normal; }
.queen-movement-message-multiline span { display: block; }
.queen-capture-message { grid-row: 1 / span 2; }
/* 两行的第二段也保留与单行第二段相同的首段间距，内部行距仍由 line-height 控制。 */
.queen-movement-message-stack:has(.queen-movement-message-multiline:not([hidden])) {
  min-height: calc((3 * 1.25em) + 24px);
}
.queen-movement-message-stack [data-queen-message="line"] { grid-row: 1; }
.queen-movement-message-stack [data-queen-message="line-detail"],
.queen-movement-message-stack [data-queen-message="reachable"],
.queen-movement-message-stack [data-queen-message="single"],
.queen-movement-message-stack [data-queen-message="multiple"],
.queen-movement-message-stack [data-queen-message="blocked"],
.queen-movement-message-stack [data-queen-message="color"],
.queen-movement-message-stack [data-queen-message="free"],
.queen-movement-message-stack [data-queen-message="blocked-distance"] { grid-row: 2; }
.queen-rhyme-message span { display: block; }

.queen-movement-grid {
  align-self: center;
  aspect-ratio: 1;
  display: grid;
  flex: 0 0 auto;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  margin: auto auto 8px;
  order: 3;
  width: min(168px, 100%);
}

.queen-movement-direction,
.queen-movement-workbench-piece {
  align-items: center;
  background: transparent;
  border: 0;
  display: grid;
  height: 56px;
  justify-content: center;
  padding: 0;
  position: relative;
  width: 56px;
}

.queen-movement-direction {
  align-self: center;
  cursor: pointer;
  justify-self: center;
  place-items: center;
  position: relative;
  touch-action: manipulation;
  z-index: 2;
}
.queen-movement-direction-icon {
  filter: invert(47%) sepia(63%) saturate(1893%) hue-rotate(345deg) brightness(98%) contrast(91%);
  height: 52px;
  transition: filter 160ms ease, transform 160ms ease;
  width: 52px;
}

.queen-movement-direction-icon-single { display: none; }

/* 第 4 讲义使用单格箭头和车相同的绿色；第 5 讲义恢复多格箭头。 */
.queen-movement-demo[data-queen-stage="3"] .queen-movement-direction-icon-single { display: block; }
.queen-movement-demo[data-queen-stage="3"] .queen-movement-direction-icon-multiple { display: none; }
.queen-movement-demo[data-queen-stage="3"] .queen-movement-direction-icon-single {
  filter: invert(43%) sepia(74%) saturate(674%) hue-rotate(106deg) brightness(88%) contrast(93%);
}

.queen-movement-direction.is-selected {
  transform: scale(1.08);
}

/* 单格和多格方向键均由同一实色蒙版呈现选中状态。 */
.queen-movement-direction.is-selected .queen-movement-direction-icon {
  opacity: 0;
}

.queen-movement-direction.is-selected::before {
  background: #d62f2f;
  content: "";
  height: 52px;
  left: 2px;
  -webkit-mask: url("/static/classroom/images/direction-arrows/箭头(上1).svg") center / contain no-repeat;
  mask: url("/static/classroom/images/direction-arrows/箭头(上1).svg") center / contain no-repeat;
  pointer-events: none;
  position: absolute;
  top: 2px;
  width: 52px;
}

/* 互动练习始终使用多棋格方向，选中后不能被单箭头替换。 */
.queen-practice-movement-grid .queen-movement-direction.is-selected::before,
.queen-movement-demo:not([data-queen-stage="3"]) .queen-movement-direction.is-selected::before {
  -webkit-mask-image: url("/static/classroom/images/direction-arrows/箭头(上2).svg");
  mask-image: url("/static/classroom/images/direction-arrows/箭头(上2).svg");
}

.queen-movement-direction.is-selected.queen-movement-direction-down::before { transform: rotate(180deg); }
.queen-movement-direction.is-selected.queen-movement-direction-left::before { transform: rotate(-90deg); }
.queen-movement-direction.is-selected.queen-movement-direction-right::before { transform: rotate(90deg); }
.queen-movement-direction.is-selected.queen-movement-direction-up-right::before { transform: rotate(45deg); }
.queen-movement-direction.is-selected.queen-movement-direction-down-right::before { transform: rotate(135deg); }
.queen-movement-direction.is-selected.queen-movement-direction-down-left::before { transform: rotate(-135deg); }
.queen-movement-direction.is-selected.queen-movement-direction-up-left::before { transform: rotate(-45deg); }

.queen-movement-direction-up { grid-column: 2; grid-row: 1; }
.queen-movement-direction-up-right { grid-column: 3; grid-row: 1; }
.queen-movement-direction-right { grid-column: 3; grid-row: 2; }
.queen-movement-direction-down-right { grid-column: 3; grid-row: 3; }
.queen-movement-direction-down { grid-column: 2; grid-row: 3; }
.queen-movement-direction-down-left { grid-column: 1; grid-row: 3; }
.queen-movement-direction-left { grid-column: 1; grid-row: 2; }
.queen-movement-direction-up-left { grid-column: 1; grid-row: 1; }

.queen-movement-workbench-piece {
  align-self: center;
  grid-column: 2;
  grid-row: 2;
  justify-self: center;
  outline: 0;
}

button.queen-movement-workbench-piece { cursor: pointer; }
.queen-movement-workbench-piece:disabled { cursor: not-allowed; opacity: .58; }
.queen-movement-workbench-piece img {
  filter: drop-shadow(0 8px 6px rgba(13, 57, 87, .25));
  max-height: 92%;
  object-fit: contain;
  transition: transform 180ms ease;
  width: min(88px, 92%);
}

button.queen-movement-workbench-piece:hover img,
button.queen-movement-workbench-piece:focus-visible img { transform: translateY(-4px) scale(1.04); }

.queen-movement-distance-controls {
  align-items: center;
  column-gap: 2px;
  display: grid;
  flex: 0 0 52px;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  justify-content: center;
  margin: 0 auto 8px;
  order: 4;
  width: min(350px, calc(100% + 2px));
}

.queen-movement-distance {
  aspect-ratio: 1;
  background: transparent;
  border: 0;
  cursor: pointer;
  display: grid;
  justify-self: center;
  max-width: 46px;
  padding: 0;
  place-items: center;
  touch-action: manipulation;
  user-select: none;
  width: 100%;
}

.queen-movement-distance:disabled { cursor: not-allowed; opacity: .4; }
.queen-movement-distance-icon {
  display: block;
  height: 92%;
  transition: filter 160ms ease, transform 160ms ease;
  width: 92%;
}

/* 第 4 至第 9 讲义的数字沿用车工作台的蓝色。 */
.queen-movement-demo[data-queen-stage="3"] .queen-movement-distance-icon,
.queen-movement-demo[data-queen-stage="4"] .queen-movement-distance-icon,
.queen-movement-demo[data-queen-stage="5"] .queen-movement-distance-icon,
.queen-movement-demo[data-queen-stage="6"] .queen-movement-distance-icon,
.queen-movement-demo[data-queen-stage="7"] .queen-movement-distance-icon,
.queen-movement-demo[data-queen-stage="8"] .queen-movement-distance-icon {
  filter: invert(24%) sepia(68%) saturate(1874%) hue-rotate(234deg) brightness(90%) contrast(96%);
}

.queen-movement-demo[data-queen-topic="capture"] .queen-movement-distance-icon {
  filter: invert(24%) sepia(68%) saturate(1874%) hue-rotate(234deg) brightness(90%) contrast(96%);
}
.queen-movement-demo[data-queen-topic="attack"] .queen-movement-distance-icon {
  filter: invert(24%) sepia(68%) saturate(1874%) hue-rotate(234deg) brightness(90%) contrast(96%);
}
.queen-movement-demo[data-queen-topic="rhyme"] .queen-movement-distance-icon {
  filter: invert(24%) sepia(68%) saturate(1874%) hue-rotate(234deg) brightness(90%) contrast(96%);
}

/* 前三讲义只展示中心白后；第 4 段开始单格移动，复用车第 3 段的数字栏呈现。 */
.queen-movement-demo[data-queen-stage="0"] .queen-movement-direction,
.queen-movement-demo[data-queen-stage="1"] .queen-movement-direction,
.queen-movement-demo[data-queen-stage="2"] .queen-movement-direction,
.queen-movement-demo[data-queen-stage="0"] .queen-movement-distance-controls,
.queen-movement-demo[data-queen-stage="1"] .queen-movement-distance-controls,
.queen-movement-demo[data-queen-stage="2"] .queen-movement-distance-controls {
  pointer-events: none;
  visibility: hidden;
}

.queen-movement-demo[data-queen-stage="3"] .queen-movement-distance:not([data-queen-distance="1"]) {
  pointer-events: none;
  visibility: hidden;
}

.queen-movement-demo[data-queen-stage="3"] .queen-movement-distance[data-queen-distance="1"] {
  opacity: 1;
}

.board-panel-page-student .queen-movement-direction,
.board-panel-page-student .queen-movement-distance {
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  min-height: 0;
  padding: 0;
}

.queen-practice-content .queen-movement-grid { margin-top: 8px; }
.queen-practice-prompt { margin: 0 0 2px; text-align: center; }

@container (max-height: 600px) {
  .queen-movement-message-stack {
    font-size: 21px;
    gap: 4px;
    margin-top: 8px;
    min-height: calc((2 * 1.25em) + 16px);
  }
  .queen-movement-message-stack:has(.queen-movement-message-multiline:not([hidden])) {
    min-height: calc((3 * 1.25em) + 16px);
  }
  .queen-movement-grid { margin-bottom: 4px; width: min(148px, 100%); }
  .queen-movement-workbench-piece img { width: min(76px, 92%); }
  .queen-movement-direction,
  .queen-movement-workbench-piece { height: 50px; width: 50px; }
  .queen-movement-direction-icon { height: 46px; width: 46px; }
  .queen-movement-distance-controls { flex-basis: 46px; margin-bottom: 4px; }
}

@container (max-height: 520px) {
  .queen-movement-message-stack { font-size: 18px; margin-top: 6px; }
  .queen-movement-grid { grid-template-columns: repeat(3, 44px); grid-template-rows: repeat(3, 44px); width: min(132px, 100%); }
  .queen-movement-direction,
  .queen-movement-workbench-piece { height: 44px; width: 44px; }
  .queen-movement-direction-icon { height: 40px; width: 40px; }
  .queen-movement-direction.is-selected::before { height: 36px; width: 36px; }
  .queen-movement-workbench-piece img { width: min(68px, 92%); }
  .queen-movement-distance-controls { flex-basis: 40px; }
}

/* 王的授课与互动区复用后的八向中轴布局；王只显示单方向箭头。 */
.king-movement-board-layer {
  inset: 0;
  pointer-events: none;
  position: absolute;
  z-index: 5;
}

.king-movement-arrow-layer {
  height: 100%;
  inset: 0;
  position: absolute;
  width: 100%;
  z-index: 6;
}

.king-movement-arrow-layer line {
  fill: none;
  marker-end: url(#king-movement-arrowhead);
  opacity: 0;
  stroke: #32a66c;
  stroke-linecap: butt;
  stroke-width: 14;
  transition: x2 360ms ease-out, y2 360ms ease-out;
}

.king-movement-arrow-layer marker path { fill: #32a66c; }
.king-movement-arrow-layer line[hidden] { display: none; }
.is-king-arrow-stage .king-movement-arrow-layer [data-king-arrow] { opacity: 1; }
.king-movement-board-layer:has(.king-danger-arrow:not([hidden])) .king-movement-arrow-layer { z-index: 10; }
.king-movement-arrow-layer .king-danger-arrow { marker-end: url(#king-danger-arrowhead); opacity: 1; stroke: var(--lesson-danger, #d62f2f); }
#king-danger-arrowhead path { fill: var(--lesson-danger, #d62f2f); }

.king-movement-board-piece,
.king-rebuilt-practice-star,
.king-practice-blocker-piece {
  position: absolute;
  transform: translate(-50%, -50%);
}

.king-movement-board-piece[hidden],
.king-movement-scene-piece[hidden],
.king-rebuilt-practice-star[hidden],
.king-practice-blocker-piece[hidden] {
  display: none !important;
}

.king-movement-board-piece {
  height: var(--board-piece-square-size);
  object-fit: contain;
  transition: left var(--king-move-duration, 420ms) linear, top var(--king-move-duration, 420ms) linear;
  width: var(--board-piece-square-size);
  transform: translate(-50%, -50%) scale(var(--board-piece-scale));
  z-index: 7;
}

.king-movement-board-piece.is-king-piece-resetting {
  animation: none;
  opacity: 0;
  transition: none;
}

.king-movement-board-piece.is-king-practice-revealing {
  animation: king-practice-piece-reveal 420ms cubic-bezier(.16, .8, .24, 1) both;
}

@keyframes king-practice-piece-reveal {
  from { opacity: 0; transform: translate(-50%, -50%) scale(.74); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(var(--board-piece-scale)); }
}

.king-movement-scene-piece {
  height: var(--board-piece-square-size);
  object-fit: contain;
  position: absolute;
  transform: translate(-50%, -50%) scale(var(--board-piece-scale));
  width: var(--board-piece-square-size);
  z-index: 6;
}

.king-practice-blocker-piece {
  height: var(--board-piece-square-size);
  object-fit: contain;
  width: var(--board-piece-square-size);
  transform: translate(-50%, -50%) scale(var(--board-piece-scale));
  z-index: 6;
}

.king-movement-board-piece.is-king-piece-moving {
  transition: left var(--king-move-duration, 420ms) linear, top var(--king-move-duration, 420ms) linear;
  z-index: 8;
}

.king-danger-frame {
  animation: king-danger-pulse 800ms ease-in-out infinite;
  border: var(--lesson-frame-width, 5px) solid var(--lesson-danger, #d62f2f);
  box-sizing: border-box;
  height: 12.5%;
  left: 56.25%;
  position: absolute;
  top: 43.75%;
  transform: translate(-50%, -50%);
  width: 12.5%;
  z-index: 9;
}

.king-danger-frame[hidden] { display: none; }
@keyframes king-danger-pulse { 50% { opacity: .35; transform: translate(-50%, -50%) scale(.92); } }

.board-intro-square.is-king-danger::before {
  border: var(--lesson-frame-width, 3px) solid var(--lesson-danger, #d62f2f);
  box-sizing: border-box;
  content: "";
  inset: 3px;
  position: absolute;
  animation: king-danger-square-breathe 800ms ease-in-out infinite alternate;
}

@keyframes king-danger-square-breathe { from { opacity: .45; } to { opacity: 1; } }

.king-rebuilt-practice-star {
  aspect-ratio: 1;
  pointer-events: none;
  width: 9.5%;
  z-index: 7;
}

.king-practice-target-marker {
  align-items: center;
  color: #111827;
  display: grid;
  font-family: Arial, sans-serif;
  font-size: clamp(28px, 5vw, 52px);
  font-weight: 900;
  height: 11.25%;
  justify-items: center;
  line-height: 1;
  pointer-events: none;
  position: absolute;
  text-shadow: 0 2px 0 rgba(255, 255, 255, .42);
  transform: translate(-50%, -50%);
  width: 11.25%;
  z-index: 5;
}

.king-practice-target-marker-number {
  background: rgba(17, 24, 39, .92);
  border: 2px solid rgba(255, 255, 255, .72);
  border-radius: 4px;
  box-shadow: 0 5px 10px rgba(17, 24, 39, .28);
  color: #fff;
  font-size: clamp(16px, 2.6vw, 28px);
  height: 7%;
  text-shadow: none;
  width: 7%;
}

.king-practice-target-marker[hidden] { display: none !important; }

/* 王的互动星星与车、象、后的黄色星星共用同一视觉层级。 */
.king-rebuilt-practice-star .interaction-feedback-star {
  animation: none;
  color: #d19a00;
  filter: drop-shadow(0 0 9px rgba(255,207,60,.62));
  height: 100%;
  width: 100%;
}

.king-rebuilt-practice-star .interaction-feedback-star-default,
.king-rebuilt-practice-star .interaction-feedback-star .interaction-feedback-star-lightning,
.king-rebuilt-practice-star .interaction-feedback-star .interaction-feedback-star-crosses,
.king-rebuilt-practice-star .interaction-feedback-star .interaction-feedback-star-mouth-crying {
  opacity: 0;
}

.king-rebuilt-practice-star .interaction-feedback-star .feedback-star-body-fill,
.king-rebuilt-practice-star .interaction-feedback-star .feedback-star-body-frame,
.king-rebuilt-practice-star .interaction-feedback-star .interaction-feedback-star-glasses,
.king-rebuilt-practice-star .interaction-feedback-star .interaction-feedback-star-mouth-happy {
  opacity: 1;
  transform: scale(1);
}

.king-rebuilt-practice-star .interaction-feedback-star .feedback-star-body-fill {
  background: #fff2a8;
}
.king-distance-label-layer { inset: 0; pointer-events: none; position: absolute; z-index: 8; }
.king-distance-label { align-items: center; animation: rook-distance-label-appear 320ms ease-out both; background: rgba(11, 79, 125, .9); border: 2px solid rgba(255, 255, 255, .88); border-radius: 50%; box-shadow: 0 3px 8px rgba(8, 45, 73, .28); color: #fff; display: flex; font-size: clamp(16px, 3vw, 34px); font-weight: 900; height: 7.5%; justify-content: center; line-height: 1; opacity: 0; position: absolute; transform: translate(-50%, -50%) scale(.72); width: 7.5%; }

.king-movement-demo {
  align-items: center;
  container-type: size;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  padding: 12px 12px 10px;
  position: relative;
  width: 100%;
}

.king-movement-heading {
  flex: 0 0 auto;
  font-size: clamp(28px, 2.5vw, 38px);
  margin: 0;
  text-align: center;
}

.king-movement-message-stack {
  color: #b42318;
  display: grid;
  flex: 0 0 auto;
  font-size: 24px;
  font-weight: 800;
  gap: 6px;
  grid-template-rows: repeat(2, minmax(1.25em, auto));
  line-height: 1.25;
  margin: 12px auto 0;
  min-height: calc((2 * 1.25em) + 24px);
  order: 2;
  text-align: center;
  white-space: nowrap;
}

.king-movement-message-stack p { margin: 0; }
.king-movement-message-multiline, .king-rhyme-message { white-space: normal; }
.king-movement-message-multiline span, .king-rhyme-message span { display: block; }
.king-movement-message-stack:has(.king-movement-message-multiline:not([hidden]), .king-rhyme-message:not([hidden])) { min-height: calc((3 * 1.25em) + 24px); }
.king-movement-message-stack [data-king-message="line"] { grid-row: 1; }
.king-movement-message-stack [data-king-message="directions"],
.king-movement-message-stack [data-king-message="single"],
.king-movement-message-stack [data-king-message="reachable"],
.king-movement-message-stack [data-king-message="blocked"],
.king-movement-message-stack [data-king-message="color"],
.king-movement-message-stack [data-king-message="free"],
.king-movement-message-stack [data-king-message="blocked-distance"] { grid-row: 2; }
.king-movement-demo[data-king-stage="1"] .king-movement-message-stack [data-king-message="directions"] { grid-row: 1; }
.king-movement-demo[data-king-stage="1"] .king-movement-message-stack [data-king-message="single"] { grid-row: 2; }

.king-movement-grid {
  align-self: center;
  aspect-ratio: 1;
  display: grid;
  flex: 0 0 auto;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  margin: auto auto 8px;
  order: 3;
  width: min(168px, 100%);
}

.king-movement-direction,
.king-movement-workbench-piece {
  align-items: center;
  background: transparent;
  border: 0;
  display: grid;
  height: 56px;
  justify-content: center;
  padding: 0;
  position: relative;
  width: 56px;
}

.king-movement-direction {
  align-self: center;
  cursor: pointer;
  justify-self: center;
  place-items: center;
  position: relative;
  touch-action: manipulation;
  z-index: 2;
}

.king-movement-direction:disabled { cursor: not-allowed; opacity: .44; }
.king-movement-direction-icon { display: block; filter: invert(47%) sepia(63%) saturate(1893%) hue-rotate(345deg) brightness(98%) contrast(91%); height: 52px; transition: filter 160ms ease, transform 160ms ease; width: 52px; }
.king-movement-direction:hover:not(:disabled), .king-movement-direction:focus-visible:not(:disabled) { outline: 0; transform: scale(1.1); }
.king-movement-direction.is-selected { transform: scale(1.08); }
.king-movement-direction.is-selected .king-movement-direction-icon { opacity: 0; }
.king-movement-direction.is-selected::before { background: #d62f2f; content: ""; height: 52px; left: 2px; -webkit-mask: url("/static/classroom/images/direction-arrows/箭头(上1).svg") center / contain no-repeat; mask: url("/static/classroom/images/direction-arrows/箭头(上1).svg") center / contain no-repeat; pointer-events: none; position: absolute; top: 2px; width: 52px; }

.king-movement-direction-up { grid-column: 2; grid-row: 1; }
.king-movement-direction-up-right { grid-column: 3; grid-row: 1; }
.king-movement-direction-right { grid-column: 3; grid-row: 2; }
.king-movement-direction-down-right { grid-column: 3; grid-row: 3; }
.king-movement-direction-down { grid-column: 2; grid-row: 3; }
.king-movement-direction-down-left { grid-column: 1; grid-row: 3; }
.king-movement-direction-left { grid-column: 1; grid-row: 2; }
.king-movement-direction-up-left { grid-column: 1; grid-row: 1; }
.king-movement-workbench-piece { align-self: center; grid-column: 2; grid-row: 2; justify-self: center; }
.king-movement-workbench-piece img { filter: drop-shadow(0 8px 6px rgba(13, 57, 87, .25)); max-height: 92%; object-fit: contain; width: min(88px, 92%); }
.king-movement-workbench-piece:disabled { cursor: not-allowed; opacity: .58; }
.king-movement-direction.is-selected.king-movement-direction-down::before { transform: rotate(180deg); }
.king-movement-direction.is-selected.king-movement-direction-left::before { transform: rotate(-90deg); }
.king-movement-direction.is-selected.king-movement-direction-right::before { transform: rotate(90deg); }
.king-movement-direction.is-selected.king-movement-direction-up-right::before { transform: rotate(45deg); }
.king-movement-direction.is-selected.king-movement-direction-down-right::before { transform: rotate(135deg); }
.king-movement-direction.is-selected.king-movement-direction-down-left::before { transform: rotate(-135deg); }
.king-movement-direction.is-selected.king-movement-direction-up-left::before { transform: rotate(-45deg); }
.king-movement-demo[data-king-topic="movement"][data-king-stage="0"] .king-movement-direction,
.king-movement-demo[data-king-topic="movement"][data-king-stage="1"] .king-movement-direction,
.king-movement-demo[data-king-topic="movement"][data-king-stage="2"] .king-movement-direction {
  pointer-events: none;
  visibility: hidden;
}

.king-movement-distance-controls {
  align-items: center;
  column-gap: 2px;
  display: grid;
  flex: 0 0 52px;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  justify-content: center;
  margin: 0 auto 8px;
  order: 4;
  width: min(350px, calc(100% + 2px));
}

.king-movement-distance {
  aspect-ratio: 1;
  background: transparent;
  border: 0;
  display: grid;
  justify-self: center;
  max-width: 46px;
  padding: 0;
  place-items: center;
  visibility: hidden;
  width: 100%;
}

.king-movement-distance-icon {
  display: block;
  height: 92%;
  width: 92%;
}

.pawn-movement-demo,
.pawn-practice-content {
  align-items: center;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  padding: 12px 12px 10px;
  position: relative;
  width: 100%;
}

.pawn-movement-heading { flex: 0 0 auto; font-size: clamp(28px, 2.5vw, 38px); margin: 0; text-align: center; }
.pawn-movement-message-stack { color: #b42318; display: grid; flex: 0 0 auto; font-size: 24px; font-weight: 800; gap: 6px; grid-template-rows: repeat(2, minmax(1.25em, auto)); line-height: 1.25; margin: 12px auto 0; min-height: calc((2 * 1.25em) + 24px); order: 2; text-align: center; white-space: nowrap; }
.pawn-movement-message-stack p { margin: 0; }
.pawn-rhyme-message { white-space: normal; }
.pawn-rhyme-message span { display: block; }
.pawn-movement-message-stack:has(.pawn-rhyme-message:not([hidden])) { min-height: calc((3 * 1.25em) + 24px); }
.pawn-movement-grid {
  align-self: center;
  aspect-ratio: 1;
  display: grid;
  flex: 0 0 auto;
  grid-template-columns: repeat(3, 56px);
  grid-template-rows: repeat(3, 56px);
  height: 168px;
  margin: auto auto 8px;
  order: 3;
  width: 168px;
}
.pawn-movement-direction, .pawn-movement-workbench-piece {
  align-items: center;
  background: transparent;
  border: 0;
  display: grid;
  height: 56px;
  justify-content: center;
  padding: 0;
  place-items: center;
  width: 56px;
}
.pawn-movement-direction { cursor: pointer; justify-self: center; position: relative; z-index: 2; }
.pawn-movement-direction:disabled { cursor: not-allowed; opacity: .42; }
.pawn-movement-direction-icon { display: block; filter: invert(47%) sepia(63%) saturate(1893%) hue-rotate(345deg) brightness(98%) contrast(91%); height: 52px; transition: filter 160ms ease, transform 160ms ease; width: 52px; }
.pawn-movement-direction-capture-left .pawn-movement-direction-icon,
.pawn-movement-direction-capture-right .pawn-movement-direction-icon { filter: brightness(0) saturate(100%) invert(19%) sepia(95%) saturate(2025%) hue-rotate(345deg) brightness(95%) contrast(88%); }
.pawn-movement-direction-advance-one .pawn-movement-direction-icon,
.pawn-movement-direction-advance-two .pawn-movement-direction-icon { filter: invert(43%) sepia(74%) saturate(674%) hue-rotate(106deg) brightness(88%) contrast(93%); }
.pawn-movement-direction:hover:not(:disabled), .pawn-movement-direction:focus-visible:not(:disabled) { outline: 0; transform: scale(1.1); }
.pawn-movement-direction:hover:not(:disabled) .pawn-movement-direction-icon, .pawn-movement-direction:focus-visible:not(:disabled) .pawn-movement-direction-icon { transform: scale(1.1); }
.pawn-movement-direction.is-selected { transform: scale(1.08); }
.pawn-movement-direction.is-selected .pawn-movement-direction-icon { opacity: 0; }
.pawn-movement-direction.is-selected::before { background: #d62f2f; content: ""; height: 52px; left: 2px; -webkit-mask: url("/static/classroom/images/direction-arrows/箭头(上1).svg") center / contain no-repeat; mask: url("/static/classroom/images/direction-arrows/箭头(上1).svg") center / contain no-repeat; pointer-events: none; position: absolute; top: 2px; width: 52px; }
.pawn-movement-direction.is-selected.pawn-movement-direction-advance-two::before { -webkit-mask-image: url("/static/classroom/images/direction-arrows/箭头(上2).svg"); mask-image: url("/static/classroom/images/direction-arrows/箭头(上2).svg"); }
.pawn-movement-direction.is-selected.pawn-movement-direction-capture-left::before { -webkit-mask-image: url("/static/classroom/images/direction-arrows/pawn-capture-left.svg"); mask-image: url("/static/classroom/images/direction-arrows/pawn-capture-left.svg"); }
.pawn-movement-direction.is-selected.pawn-movement-direction-capture-right::before { -webkit-mask-image: url("/static/classroom/images/direction-arrows/pawn-capture-right.svg"); mask-image: url("/static/classroom/images/direction-arrows/pawn-capture-right.svg"); }
.pawn-movement-workbench-piece { grid-column: 2; grid-row: 3; }
.pawn-movement-workbench-piece img { filter: drop-shadow(0 8px 6px rgba(13, 57, 87, .25)); max-height: 92%; object-fit: contain; width: min(88px, 92%); }
button.pawn-movement-workbench-piece:disabled { cursor: not-allowed; opacity: .58; }
.pawn-movement-direction-capture-left { grid-column: 1; grid-row: 2; }
.pawn-movement-direction-advance-one { grid-column: 2; grid-row: 2; }
.pawn-movement-direction-capture-right { grid-column: 3; grid-row: 2; }
.pawn-movement-direction-advance-two { grid-column: 2; grid-row: 1; }
.pawn-promotion-choices { align-items: center; display: grid; flex: 0 0 52px; gap: 6px; grid-template-columns: repeat(4, 42px); height: 52px; justify-content: center; margin: 0 auto 8px; order: 4; width: min(350px, calc(100% + 2px)); }
.pawn-promotion-choices button { background: transparent; border: 0; cursor: pointer; height: 42px; padding: 0; width: 42px; }
.pawn-promotion-choices button:disabled { cursor: default; opacity: .42; }
.pawn-promotion-choices img { display: block; filter: drop-shadow(0 4px 4px rgba(13, 57, 87, .2)); height: 100%; object-fit: contain; width: 100%; }
.pawn-promotion-choices button:hover:not(:disabled) img, .pawn-promotion-choices button:focus-visible:not(:disabled) img { transform: translateY(-2px) scale(1.07); }

/* 互动一兵控件只保留方向图形和棋子，不显示浏览器焦点框或按钮底框。 */
.board-panel-page-student .pawn-movement-direction,
.board-panel-page-student .pawn-movement-workbench-piece,
.board-panel-page-student .pawn-promotion-choices button {
  -webkit-tap-highlight-color: transparent;
  background: transparent;
  border: 0;
  box-shadow: none;
  outline: 0;
}
.board-panel-page-student .pawn-movement-direction:focus-visible,
.board-panel-page-student .pawn-movement-workbench-piece:focus-visible,
.board-panel-page-student .pawn-promotion-choices button:focus-visible {
  background: transparent;
  border: 0;
  box-shadow: none;
  outline: 0;
}
.board-panel-page-student .pawn-movement-workbench-piece img,
.board-panel-page-student .pawn-promotion-choices img {
  filter: none;
}
.pawn-movement-board-layer { inset: 0; pointer-events: none; position: absolute; z-index: 5; }
.pawn-movement-arrow-layer { height: 100%; inset: 0; pointer-events: none; position: absolute; width: 100%; z-index: 6; }
.pawn-movement-arrow-layer line { fill: none; marker-end: url(#pawn-movement-arrowhead); opacity: 0; stroke: #32a66c; stroke-linecap: round; stroke-width: 14; }
.pawn-movement-arrow-layer line:not([hidden]) { opacity: 1; }
.pawn-movement-arrow-layer marker path { fill: #32a66c; }
#pawn-movement-arrowhead-red path { fill: var(--lesson-danger, #d62f2f) !important; }
.pawn-movement-arrow-layer line.is-pawn-retaliation-arrow { marker-end: none; stroke: var(--lesson-danger, #d62f2f); }
.pawn-retaliation-arrowhead-layer { height: 100%; inset: 0; pointer-events: none; position: absolute; width: 100%; z-index: 9; }
.pawn-retaliation-arrowhead { fill: var(--lesson-danger, #d62f2f); }
.pawn-retaliation-arrowhead[hidden] { display: none; }
.pawn-movement-board-layer:has(.is-pawn-retaliation-arrow:not([hidden])) .pawn-movement-arrow-layer { z-index: 1; }
.pawn-movement-board-layer:has(.is-pawn-attack-arrow:not(.is-pawn-retaliation-arrow):not([hidden])) .pawn-movement-arrow-layer { z-index: 10; }
.pawn-movement-board-layer:has(.is-pawn-attack-arrow:not([hidden])) .pawn-movement-board-piece { z-index: 8; }
.pawn-movement-board-layer:has(.is-pawn-attack-arrow:not([hidden])) .pawn-movement-scene-piece { z-index: 6; }
.pawn-lecture-piece, .pawn-movement-board-piece, .pawn-movement-scene-piece { height: var(--board-piece-square-size); left: 0; object-fit: contain; position: absolute; top: 0; transform: translate(-50%, -50%) scale(var(--board-piece-scale)); transition: left var(--piece-move-ms-per-square, 420ms) linear, top var(--piece-move-ms-per-square, 420ms) linear; width: var(--board-piece-square-size); }
.pawn-lecture-piece.is-pawn-piece-resetting,
.pawn-movement-board-piece.is-pawn-piece-resetting,
.pawn-movement-scene-piece.is-pawn-piece-resetting { animation: none !important; transition: none !important; }
.pawn-lecture-piece[hidden], .pawn-movement-board-piece[hidden] { display: none !important; }
.pawn-movement-board-piece.is-pawn-piece-moving { transition-duration: var(--pawn-move-duration, var(--piece-move-ms-per-square, 420ms)); }
.pawn-movement-board-piece { z-index: 8; }
.pawn-movement-scene-piece { z-index: 3; }
.pawn-movement-scene-piece.pawn-sequence-crate {
  filter: drop-shadow(0 5px 3px rgba(73, 45, 20, .26));
  height: 10.8%;
  object-fit: contain;
  width: 10.8%;
  z-index: 2;
}
.pawn-movement-scene-piece.pawn-sequence-target-piece {
  z-index: 3;
}
.pawn-movement-scene-piece.is-pawn-scene-piece-moving { filter: drop-shadow(0 0 7px rgba(214, 47, 47, .7)); }
.pawn-movement-scene-piece.is-pawn-retaliating { transition: left var(--pawn-capture-move-duration, 420ms) linear, top var(--pawn-capture-move-duration, 420ms) linear; z-index: 9; }
.pawn-movement-board-piece.is-pawn-promoting-out { animation: pawn-promotion-fade-out 220ms ease both; }
.pawn-movement-board-piece.is-pawn-promoting-in { animation: pawn-promotion-fade-in 360ms ease both; }
.pawn-movement-scene-piece[hidden], .pawn-practice-star[hidden] { display: none !important; }
.pawn-attack-risk-frame { animation: pawn-attack-risk-pulse 800ms ease-in-out infinite; border: var(--lesson-frame-width, 5px) solid var(--lesson-danger, #d62f2f); box-sizing: border-box; height: 12.5%; position: absolute; transform: translate(-50%, -50%); width: 12.5%; z-index: 7; }
.pawn-attack-risk-frame[hidden] { display: none; }
@keyframes pawn-attack-risk-pulse { 50% { opacity: .35; transform: translate(-50%, -50%) scale(.92); } }
.pawn-practice-star { height: 11%; left: 0; position: absolute; top: 0; transform: translate(-50%, -50%); width: 11%; }

/* 互动一的棋盘目标与箱子共用一格的 80% 尺寸，和工作台评分星完全分离。 */
.interaction-one-target-star,
.interaction-one-blocker,
.queen-practice-blocker-piece {
  aspect-ratio: 1;
  display: block;
  height: var(--interaction-one-target-size, var(--interaction-one-overlay-size)) !important;
  left: 50%;
  object-fit: contain;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: var(--interaction-one-target-size, var(--interaction-one-overlay-size)) !important;
}

.knight-movement-scene-piece.is-knight-practice-box {
  height: var(--interaction-one-overlay-size) !important;
  object-fit: contain;
  transform: translate(-50%, -50%);
  width: var(--interaction-one-overlay-size) !important;
}

/* 保持在棋子专题样式之后，避免各专题旧尺寸覆盖统一规则。 */
.interaction-one-target-star,
.interaction-one-blocker,
.queen-practice-blocker-piece {
  height: var(--interaction-one-target-size, var(--interaction-one-overlay-size)) !important;
  width: var(--interaction-one-target-size, var(--interaction-one-overlay-size)) !important;
}

/* 最终覆盖旧专题规则：互动一的木箱和目标星始终以完整棋格的 90% 显示。 */
.knight-movement-blocker-piece.chess-piece.is-knight-practice-box,
.knight-movement-scene-piece.chess-piece.is-knight-practice-box {
  height: var(--interaction-one-target-size, var(--interaction-one-overlay-size)) !important;
  transform: translate(-50%, -50%) scale(1) !important;
  width: var(--interaction-one-target-size, var(--interaction-one-overlay-size)) !important;
}

/* 车、象、后沿用同一目标星揭示节奏，避免旧专题动画缩放比例不一致。 */
.rook-practice-star.is-rook-practice-revealing,
.bishop-practice-star.is-bishop-practice-revealing,
.queen-practice-star.is-queen-practice-revealing {
  animation: interaction-one-target-reveal 360ms ease-out both;
}

@keyframes interaction-one-target-reveal {
  from {
    opacity: 0;
    transform: translate(-50%, -50%) scale(.72);
  }

  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

/* 互动一提示使用同一容器，避免各棋子旧专题布局改变反馈位置或裁切三行文字。 */
.piece-practice-content > [data-interaction-one-prompt] {
  align-self: stretch;
  color: #d62f2f;
  flex: 0 0 30px;
  font-size: 24px;
  font-weight: 600;
  height: 30px;
  line-height: 30px;
  margin: 0;
  min-height: 30px;
  overflow: hidden;
  text-align: center;
  white-space: pre-line;
}

.piece-practice-content > [data-interaction-one-prompt].is-multiline-feedback {
  flex-basis: 90px;
  height: 90px;
  line-height: 30px;
  min-height: 90px;
}

/* 六类互动一复盘线条和层级从同一套视觉令牌读取，路线始终覆盖目标星。 */
:is(
  .rook-practice-route-guidance-layer,
  .bishop-practice-route-guidance-layer,
  .queen-practice-route-guidance-layer,
  .king-practice-route-guidance-layer,
  .pawn-practice-route-guidance-layer,
  .knight-practice-route-guidance-layer
) {
  inset: 0;
  pointer-events: none;
  position: absolute;
  width: 100%;
  height: 100%;
  z-index: 5;
}

:is(
  .rook-practice-route-guidance-layer,
  .bishop-practice-route-guidance-layer,
  .queen-practice-route-guidance-layer,
  .king-practice-route-guidance-layer,
  .pawn-practice-route-guidance-layer,
  .knight-practice-route-guidance-layer
) line[data-practice-replay-arrow] {
  fill: none;
  stroke: #32a66c;
  stroke-linecap: butt;
  stroke-width: 12;
  filter: drop-shadow(0 2px 1px rgba(255, 255, 255, .88));
}

:is(
  .rook-practice-route-guidance-layer,
  .bishop-practice-route-guidance-layer,
  .queen-practice-route-guidance-layer,
  .king-practice-route-guidance-layer,
  .pawn-practice-route-guidance-layer,
  .knight-practice-route-guidance-layer
) line[data-practice-replay-color="blue"] { stroke: #2d73c9; }

:is(
  .rook-practice-route-guidance-layer,
  .bishop-practice-route-guidance-layer,
  .queen-practice-route-guidance-layer,
  .king-practice-route-guidance-layer,
  .pawn-practice-route-guidance-layer,
  .knight-practice-route-guidance-layer
) line[data-practice-replay-color="orange"] { stroke: #e8872e; }

:is(
  .rook-practice-route-guidance-layer,
  .bishop-practice-route-guidance-layer,
  .queen-practice-route-guidance-layer,
  .king-practice-route-guidance-layer,
  .pawn-practice-route-guidance-layer,
  .knight-practice-route-guidance-layer
) line[data-practice-replay-color="purple"] { stroke: #8756c7; }

.pawn-practice-route-guidance-layer marker path { fill: #32a66c; }
.pawn-practice-route-guidance-layer #pawn-practice-route-guidance-arrowhead-blue path { fill: #2d73c9; }
.pawn-practice-route-guidance-layer #pawn-practice-route-guidance-arrowhead-orange path { fill: #e8872e; }
.pawn-practice-route-guidance-layer #pawn-practice-route-guidance-arrowhead-purple path { fill: #8756c7; }

/* 复盘路线及箭头必须覆盖目标星，便于看清最终落点。 */
.interaction-one-target-star {
  z-index: 4 !important;
  overflow: visible;
}

/* 互动一、二均以触屏为主，数字按钮不显示悬停或焦点方框。 */
.board-panel-page-student .rook-movement-distance,
.board-panel-page-student .bishop-movement-distance,
.board-panel-page-student .queen-movement-distance,
.board-panel-page-student .king-movement-distance,
.board-panel-page-student .rook-movement-distance:hover,
.board-panel-page-student .rook-movement-distance:focus-visible,
.board-panel-page-student .bishop-movement-distance:hover,
.board-panel-page-student .bishop-movement-distance:focus-visible,
.board-panel-page-student .queen-movement-distance:hover,
.board-panel-page-student .queen-movement-distance:focus-visible,
.board-panel-page-student .king-movement-distance:hover,
.board-panel-page-student .king-movement-distance:focus-visible {
  background: transparent;
  border: 0;
  box-shadow: none;
  outline: 0;
}

.board-panel-page-student .rook-movement-distance::after,
.board-panel-page-student .bishop-movement-distance::after,
.board-panel-page-student .queen-movement-distance::after,
.board-panel-page-student .king-movement-distance::after {
  content: none;
}

.interaction-one-target-star .interaction-feedback-star {
  animation: none !important;
  color: #d19a00;
  filter: drop-shadow(0 0 9px rgba(255, 207, 60, .62));
  height: 100%;
  min-width: 0;
  transform-origin: center;
  width: 100%;
}

/* 互动一棋盘目标不使用工作台的空心评分星，统一显示黄色笑脸星。 */
.interaction-one-target-star .interaction-feedback-star-default,
.interaction-one-target-star .interaction-feedback-star .interaction-feedback-star-lightning,
.interaction-one-target-star .interaction-feedback-star .interaction-feedback-star-crosses,
.interaction-one-target-star .interaction-feedback-star .interaction-feedback-star-mouth-crying {
  opacity: 0;
}

.interaction-one-target-star .interaction-feedback-star .feedback-star-body-fill,
.interaction-one-target-star .interaction-feedback-star .feedback-star-body-frame,
.interaction-one-target-star .interaction-feedback-star .interaction-feedback-star-glasses,
.interaction-one-target-star .interaction-feedback-star .interaction-feedback-star-mouth-happy {
  opacity: 1;
  transform: scale(1);
}

.interaction-one-target-star .interaction-feedback-star .feedback-star-body-fill {
  background: #fff2a8;
}

.interaction-one-target-star.is-interaction-one-target-breathing .interaction-feedback-star {
  animation: interaction-one-target-breathe 1.15s ease-in-out infinite alternate !important;
}

.interaction-one-target-star[hidden],
.interaction-one-blocker[hidden],
.queen-practice-blocker-piece[hidden] {
  display: none !important;
}

@keyframes interaction-one-target-breathe {
  from { filter: drop-shadow(0 0 4px rgba(255, 207, 60, .46)); opacity: .72; transform: scale(.92); }
  to { filter: drop-shadow(0 0 11px rgba(255, 207, 60, .9)); opacity: 1; transform: scale(1.06); }
}
.board-intro-square.is-pawn-reachable::after { animation: rook-reachable-breathe 1.15s ease-in-out infinite alternate; border: var(--lesson-frame-width, 3px) solid var(--lesson-safe, #32a66c); border-radius: 3px; box-shadow: 0 0 0 2px rgba(255, 255, 255, .78) inset; content: ""; inset: 7%; position: absolute; }
.board-intro-square.is-pawn-movement-mask::before { background: rgba(103, 209, 144, .55); content: ""; inset: 0; pointer-events: none; position: absolute; z-index: 1; }
.board-intro-square.is-pawn-threatened::before { border: var(--lesson-frame-width, 3px) solid var(--lesson-danger, #d62f2f); content: ""; inset: 4px; pointer-events: none; position: absolute; }
.pawn-distance-label-layer { inset: 0; pointer-events: none; position: absolute; z-index: 8; }
.pawn-distance-label { align-items: center; animation: rook-distance-label-appear 320ms ease-out both; background: rgba(11, 79, 125, .9); border: 2px solid rgba(255, 255, 255, .88); border-radius: 50%; box-shadow: 0 3px 8px rgba(8, 45, 73, .28); color: #fff; display: flex; font-size: clamp(16px, 3vw, 34px); font-weight: 900; height: 7.5%; justify-content: center; line-height: 1; position: absolute; transform: translate(-50%, -50%) scale(.72); width: 7.5%; }
.pawn-movement-demo[data-pawn-topic="movement"][data-pawn-stage="0"] .pawn-movement-message-stack,
.pawn-movement-demo[data-pawn-topic="movement"][data-pawn-stage="0"] .pawn-movement-direction,
.pawn-movement-demo[data-pawn-topic="movement"][data-pawn-stage="1"] .pawn-movement-direction,
.pawn-movement-demo[data-pawn-topic="movement"][data-pawn-stage="2"] .pawn-movement-direction,
.pawn-movement-demo[data-pawn-topic="movement"][data-pawn-stage="0"] .pawn-promotion-choices,
.pawn-movement-demo[data-pawn-topic="movement"][data-pawn-stage="1"] .pawn-promotion-choices,
.pawn-movement-demo[data-pawn-topic="movement"][data-pawn-stage="2"] .pawn-promotion-choices { pointer-events: none; visibility: hidden; }
.pawn-movement-demo[data-pawn-topic="movement"][data-pawn-stage="0"] .pawn-movement-message-stack { visibility: hidden; }
.pawn-movement-demo[data-pawn-topic="rhyme"][data-pawn-stage="0"] .pawn-movement-direction,
.pawn-movement-demo[data-pawn-topic="rhyme"][data-pawn-stage="0"] .pawn-promotion-choices { pointer-events: none; visibility: hidden; }
.pawn-movement-demo.is-pawn-black .pawn-movement-workbench-piece { grid-row: 1; }
.pawn-movement-demo.is-pawn-black .pawn-movement-direction-advance-two { grid-row: 3; }
.pawn-practice-content.is-pawn-black .pawn-movement-workbench-piece { grid-row: 1; }
.pawn-practice-content.is-pawn-black .pawn-movement-direction-advance-two { grid-row: 3; }
.pawn-movement-demo.is-pawn-black .pawn-movement-direction-icon,
.pawn-practice-content.is-pawn-black .pawn-movement-direction-icon { transform: none; }
.pawn-movement-demo.is-pawn-black .pawn-movement-direction.is-selected.pawn-movement-direction-advance-one::before,
.pawn-practice-content.is-pawn-black .pawn-movement-direction.is-selected.pawn-movement-direction-advance-one::before {
  -webkit-mask-image: url("/static/classroom/images/direction-arrows/箭头(下1).svg");
  mask-image: url("/static/classroom/images/direction-arrows/箭头(下1).svg");
}
.pawn-movement-demo.is-pawn-black .pawn-movement-direction.is-selected.pawn-movement-direction-advance-two::before,
.pawn-practice-content.is-pawn-black .pawn-movement-direction.is-selected.pawn-movement-direction-advance-two::before {
  -webkit-mask-image: url("/static/classroom/images/direction-arrows/箭头(下2).svg");
  mask-image: url("/static/classroom/images/direction-arrows/箭头(下2).svg");
}
.pawn-practice-content .pawn-movement-message-stack { min-height: 0; }
.pawn-practice-content .pawn-movement-grid { margin-top: auto; }
.pawn-sequence-capture-content .pawn-sequence-control-grid,
.pawn-sequence-capture-content .pawn-sequence-promoted-grid {
  margin-top: auto;
}
.pawn-sequence-capture-content .pawn-sequence-control-grid[hidden],
.pawn-sequence-capture-content .pawn-sequence-promoted-grid[hidden],
.pawn-sequence-capture-content .pawn-sequence-distance-controls[hidden],
.pawn-sequence-capture-content .pawn-promotion-choices[hidden] {
  display: none !important;
}
.pawn-sequence-capture-content .pawn-sequence-distance-controls {
  order: 4;
}
.pawn-sequence-capture-content .pawn-promotion-choices {
  order: 5;
}
.pawn-sequence-capture-content .queen-movement-direction.is-selected .queen-movement-direction-icon-multiple,
.pawn-sequence-capture-content .knight-movement-direction.is-selected .knight-movement-direction-icon {
  transform: scale(1.12);
}

@keyframes pawn-promotion-fade-out {
  from { opacity: 1; transform: translate(-50%, -50%) scale(var(--board-piece-scale)); }
  to { opacity: 0; transform: translate(-50%, -50%) scale(.72); }
}

@keyframes pawn-promotion-fade-in {
  from { opacity: 0; transform: translate(-50%, -50%) scale(.72); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(var(--board-piece-scale)); }
}

@media (max-height: 700px) {
  .pawn-movement-heading { font-size: 28px; }
  .pawn-movement-message-stack { font-size: 21px; gap: 4px; margin-top: 8px; min-height: calc((2 * 1.25em) + 16px); }
  .pawn-movement-message-stack:has(.pawn-rhyme-message:not([hidden])) { min-height: calc((3 * 1.25em) + 16px); }
  .pawn-movement-grid { grid-template-columns: repeat(3, 48px); grid-template-rows: repeat(3, 48px); height: 144px; width: 144px; }
  .pawn-movement-direction, .pawn-movement-workbench-piece { height: 48px; width: 48px; }
  .pawn-movement-direction-icon { height: 44px; width: 44px; }
  .pawn-promotion-choices { grid-template-columns: repeat(4, 38px); height: 42px; }
  .pawn-promotion-choices button { height: 38px; width: 38px; }
}

@container (max-height: 360px) {
  .pawn-movement-demo,
  .pawn-practice-content {
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
  }

  .board-panel-page .pawn-movement-heading {
    font-size: 22px;
    line-height: 1.15;
    margin: 0 0 4px;
  }

  .pawn-movement-message-stack {
    font-size: 16px;
    gap: 2px;
    line-height: 1.25;
    margin-top: 4px;
    min-height: calc((2 * 1.25em) + 8px);
  }

  .pawn-movement-message-stack:has(.pawn-rhyme-message:not([hidden])) {
    min-height: calc((3 * 1.25em) + 8px);
  }

  .pawn-movement-grid {
    grid-template-columns: repeat(3, 40px);
    grid-template-rows: repeat(3, 40px);
    height: 120px;
    margin: 6px auto 4px;
    width: 120px;
  }

  .pawn-movement-direction,
  .pawn-movement-workbench-piece {
    height: 40px;
    width: 40px;
  }

  .pawn-movement-direction-icon,
  .pawn-movement-direction.is-selected::before {
    height: 36px;
    width: 36px;
  }

  .pawn-movement-direction.is-selected::before {
    left: 2px;
    top: 2px;
  }

  .pawn-promotion-choices {
    flex-basis: 40px;
    gap: 4px;
    grid-template-columns: repeat(4, 34px);
    height: 40px;
    margin-bottom: 4px;
  }

  .pawn-promotion-choices button {
    height: 34px;
    width: 34px;
  }
}

.board-panel-page-student .king-movement-direction,
.board-panel-page-student .king-movement-distance {
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  min-height: 0;
  padding: 0;
}

/* 互动方向键沿用授课区的纯图标悬停效果，不显示通用按钮方框或提示层。 */
.board-panel-page-student .king-rebuilt-practice-grid .king-movement-direction:hover:not(:disabled),
.board-panel-page-student .king-rebuilt-practice-grid .king-movement-direction:focus-visible:not(:disabled) {
  box-shadow: none;
  filter: none;
  transform: scale(1.1);
}

.board-panel-page-student .king-rebuilt-practice-grid .king-movement-direction::after {
  content: none;
}

/* 与车、象互动区保持相同的纵向占满与控制区定位。 */
.queen-practice-content {
  height: 100%;
  padding: 12px 12px 10px;
}

.queen-practice-content .queen-movement-grid {
  margin-top: auto;
}

/* 王的授课按后的授课控制盘使用相同尺寸档位。 */
.king-movement-demo {
  container-type: size;
}

.queen-practice-content .queen-movement-distance-icon {
  filter: invert(24%) sepia(68%) saturate(1874%) hue-rotate(234deg) brightness(90%) contrast(96%);
}

@container (max-height: 600px) {
  .king-movement-message-stack { font-size: 21px; gap: 4px; margin-top: 8px; min-height: calc((2 * 1.25em) + 16px); }
  .king-movement-message-stack:has(.king-movement-message-multiline:not([hidden]), .king-rhyme-message:not([hidden])) { min-height: calc((3 * 1.25em) + 16px); }
  .king-movement-grid { margin-bottom: 4px; width: min(148px, 100%); }
  .king-movement-workbench-piece img { width: min(76px, 92%); }
  .king-movement-direction, .king-movement-workbench-piece { height: 50px; width: 50px; }
  .king-movement-direction-icon { height: 46px; width: 46px; }
  .king-movement-distance-controls { flex-basis: 46px; margin-bottom: 4px; }
}

@container (max-height: 520px) {
  .king-movement-grid { grid-template-columns: repeat(3, 44px); grid-template-rows: repeat(3, 44px); width: min(132px, 100%); }
  .king-movement-direction, .king-movement-workbench-piece { height: 44px; width: 44px; }
  .king-movement-direction-icon { height: 40px; width: 40px; }
  .king-movement-direction.is-selected::before { height: 36px; width: 36px; }
  .king-movement-workbench-piece img { width: min(68px, 92%); }
  .king-movement-message-stack { font-size: 18px; margin-top: 6px; }
  .king-movement-distance-controls { flex-basis: 40px; }
}

/* 马的走法：八个 L 形落点围绕中心棋子，底部预留与车/象/王数字区相同的高度。 */
.board-panel-page-teacher:has(.knight-movement-demo) .lesson-console-topic-pages,
.board-panel-page-teacher:has(.knight-movement-demo) .lesson-console-topic-page.is-active {
  height: 100%;
}

.knight-movement-board-layer {
  inset: 0;
  pointer-events: none;
  position: absolute;
  z-index: 3;
}

.knight-movement-arrow-layer {
  height: 100%;
  inset: 0;
  pointer-events: none;
  position: absolute;
  width: 100%;
  z-index: 5;
}

/* 与车、象的攻击箭头一致：轨迹从马身后伸出，箭头尖端覆盖目标棋子。 */
.knight-movement-board-layer:has(.knight-movement-arrow-layer [data-knight-arrow].is-visible) .knight-movement-arrow-layer { z-index: 7; }
.knight-movement-board-layer:has(.knight-movement-arrow-layer [data-knight-arrow].is-visible) .knight-movement-board-piece { z-index: 8; }

.knight-movement-arrow-layer path {
  fill: none;
  marker-end: url(#knight-movement-arrowhead);
  opacity: 0;
  stroke: #32a66c;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 14;
  transition: opacity 180ms ease;
}

.knight-movement-arrow-layer path.is-visible { opacity: 1; }
.knight-movement-arrow-layer marker path { fill: #32a66c; opacity: 1; stroke: none; }

.knight-retaliation-arrow-layer { height: 100%; inset: 0; pointer-events: none; position: absolute; width: 100%; z-index: 1; }
.knight-retaliation-arrow-layer [data-knight-retaliation-arrow] { fill: none; stroke: var(--lesson-danger, #d62f2f); stroke-linecap: butt; stroke-width: 14; }
.knight-retaliation-arrow-layer [hidden],
.knight-retaliation-arrowhead[hidden],
.knight-attack-risk-frame[hidden] { display: none; }
.knight-retaliation-arrowhead-layer { height: 100%; inset: 0; pointer-events: none; position: absolute; width: 100%; z-index: 10; }
.knight-retaliation-arrowhead { fill: var(--lesson-danger, #d62f2f); }
.knight-attack-risk-frame { animation: rook-attack-risk-pulse 800ms ease-in-out infinite; border: var(--lesson-frame-width, 5px) solid var(--lesson-danger, #d62f2f); box-sizing: border-box; height: 12.5%; position: absolute; transform: translate(-50%, -50%); width: 12.5%; z-index: 8; }

.board-intro-square.is-knight-reachable::after {
  animation: rook-reachable-breathe 1.15s ease-in-out infinite alternate;
  border: var(--lesson-frame-width, 3px) solid var(--lesson-safe, #32a66c);
  border-radius: 3px;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, .78) inset;
  content: "";
  inset: 7%;
  position: absolute;
}

.board-intro-square.is-knight-movement-mask::before {
  background: rgba(103, 209, 144, .55);
  content: "";
  inset: 0;
  pointer-events: none;
  position: absolute;
  z-index: 1;
}

.knight-movement-board-piece,
.knight-movement-blocker-piece,
.knight-movement-attack-piece,
.knight-movement-scene-piece,
.knight-practice-target-piece {
  height: var(--board-piece-square-size);
  object-fit: contain;
  position: absolute;
  transform: translate(-50%, -50%) scale(var(--board-piece-scale));
  transition: left 280ms ease, top 280ms ease, opacity 220ms ease, transform 180ms ease, filter 160ms ease;
  width: var(--board-piece-square-size);
  z-index: 7;
}

.knight-movement-scene-piece.is-knight-recapturing { transition: left 420ms linear, top 420ms linear, filter 160ms ease, opacity 160ms ease, transform 160ms ease; z-index: 9; }

.knight-movement-board-piece.is-knight-moving {
  filter: drop-shadow(0 10px 7px rgba(13, 57, 87, .28));
  transition: none;
  z-index: 9;
}

.knight-movement-blocker-piece { z-index: 6; }
.knight-movement-attack-piece { z-index: 6; }
.knight-movement-scene-piece { z-index: 6; }
.knight-movement-blocker-piece.is-knight-practice-box,
.knight-movement-scene-piece.is-knight-practice-box {
  filter: none;
  height: 11.25%;
  object-fit: fill;
  transform: translate(-50%, -50%);
  width: 11.25%;
}

.knight-movement-blocker-piece.chess-piece,
.knight-movement-scene-piece.chess-piece.is-knight-practice-box {
  height: var(--interaction-one-target-size, 11.25%) !important;
  object-fit: contain;
  transform: translate(-50%, -50%) scale(1) !important;
  width: var(--interaction-one-target-size, 11.25%) !important;
}

.knight-movement-scene-piece.chess-piece.is-knight-practice-box {
  height: var(--interaction-one-target-size, 11.25%) !important;
  transform: translate(-50%, -50%) scale(1) !important;
  width: var(--interaction-one-target-size, 11.25%) !important;
}

.pawn-movement-demo {
  container-type: size;
}
.knight-movement-board-piece[hidden],
.knight-movement-blocker-piece[hidden],
.knight-movement-attack-piece[hidden],
.knight-movement-scene-piece[hidden],
.knight-practice-target-piece[hidden],
.knight-practice-star[hidden] { display: none; }
.knight-plan-target-marker[hidden] { display: none; }

.knight-practice-star {
  aspect-ratio: 1;
  left: 50%;
  pointer-events: none;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 9.5%;
  z-index: 8;
}

.knight-practice-star .interaction-feedback-star {
  animation: rook-practice-star-breathe 1.15s ease-in-out infinite alternate;
  color: #d19a00;
  filter: drop-shadow(0 0 9px rgba(255, 207, 60, .62));
  width: 100%;
}

.knight-practice-star .interaction-feedback-star-default,
.knight-practice-star .interaction-feedback-star .interaction-feedback-star-lightning,
.knight-practice-star .interaction-feedback-star .interaction-feedback-star-crosses,
.knight-practice-star .interaction-feedback-star .interaction-feedback-star-mouth-crying {
  opacity: 0;
}

.knight-practice-star .interaction-feedback-star .feedback-star-body-fill,
.knight-practice-star .interaction-feedback-star .feedback-star-body-frame,
.knight-practice-star .interaction-feedback-star .interaction-feedback-star-glasses,
.knight-practice-star .interaction-feedback-star .interaction-feedback-star-mouth-happy {
  opacity: 1;
  transform: scale(1);
}

.knight-practice-star .interaction-feedback-star .feedback-star-body-fill {
  background: #fff2a8;
}

.knight-plan-target-marker {
  align-items: center;
  color: #111827;
  display: grid;
  font-family: Arial, sans-serif;
  font-size: clamp(28px, 5vw, 52px);
  font-weight: 900;
  height: 11.25%;
  justify-items: center;
  left: 50%;
  line-height: 1;
  pointer-events: none;
  position: absolute;
  text-shadow: 0 2px 0 rgba(255, 255, 255, .42);
  top: 50%;
  transform: translate(-50%, -50%);
  width: 11.25%;
  z-index: 5;
}

.knight-plan-target-marker:not(.knight-plan-target-marker-number) {
  color: #7c4a26;
  font-size: clamp(54px, 8vw, 88px);
  text-shadow: 0 2px 0 rgba(255, 224, 184, .55);
}

.knight-plan-target-marker-number {
  background: #1f2937;
  border: 2px solid rgba(17, 24, 39, .82);
  border-radius: 4px;
  box-shadow: 0 7px 12px rgba(17, 24, 39, .32);
  color: #fff;
  font-size: clamp(18px, 2.8vw, 30px);
  height: 7%;
  text-shadow: none;
  width: 7%;
}


.knight-movement-demo,
.knight-practice-content {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  padding: 12px 12px 10px;
  position: relative;
  text-align: center;
}

.knight-movement-heading {
  color: #0b4f7d;
  flex: 0 0 auto;
  font-size: 32px;
  font-weight: 900;
  line-height: 1.25;
  margin: 0;
  white-space: nowrap;
}

.knight-movement-message-stack {
  color: #b42318;
  display: grid;
  flex: 0 0 auto;
  font-size: 24px;
  font-weight: 800;
  gap: 6px;
  grid-template-rows: repeat(2, minmax(1.25em, auto));
  line-height: 1.25;
  margin: 12px auto 0;
  min-height: calc((2 * 1.25em) + 24px);
  order: 2;
  text-align: center;
  white-space: nowrap;
}

.knight-movement-message-stack p { margin: 0; }
.knight-movement-message-multiline { white-space: normal; }
.knight-movement-message-multiline span { display: block; }
/* 多行讲义的首句与第二句使用全局消息栈的段落间距。 */
.knight-movement-message-stack [data-knight-message="jump"].knight-movement-message-multiline span:first-child { margin-bottom: 6px; }
.knight-movement-message-stack:has(.knight-movement-message-multiline:not([hidden])) { min-height: calc((3 * 1.25em) + 24px); }
.knight-movement-message-stack [data-knight-message="jump"] { grid-row: 1; }
.knight-movement-message-stack [data-knight-message="capture"],
.knight-movement-message-stack [data-knight-message="attack"] { grid-row: 1; }
.knight-movement-message-stack [data-knight-message="two"],
.knight-movement-message-stack [data-knight-message="one"],
.knight-movement-message-stack [data-knight-message="eight"],
.knight-movement-message-stack [data-knight-message="over"],
.knight-movement-message-stack [data-knight-message="attack-over"] { grid-row: 2; }

.knight-movement-grid {
  align-self: center;
  aspect-ratio: 1;
  display: grid;
  flex: 0 0 auto;
  grid-template-areas:
    ". up-left-2 . up-right-2 ."
    "up-left-1 . . . up-right-1"
    ". . center . ."
    "down-left-1 . . . down-right-1"
    ". down-left-2 . down-right-2 .";
  grid-template-columns: repeat(5, minmax(0, 1fr));
  grid-template-rows: repeat(5, minmax(0, 1fr));
  margin: auto auto 8px;
  order: 3;
  width: min(210px, 100%);
}

.knight-movement-direction,
.knight-movement-workbench-piece {
  align-self: center;
  background: transparent;
  border: 0;
  display: grid;
  height: 42px;
  justify-self: center;
  padding: 0;
  place-items: center;
  position: relative;
  touch-action: manipulation;
  width: 42px;
}

.knight-movement-direction { cursor: pointer; }
.knight-movement-workbench-piece { cursor: pointer; grid-area: center; }
.knight-movement-workbench-piece img { height: min(88px, 180%); left: 50%; max-height: none; object-fit: contain; position: absolute; top: 50%; transform: translate(-50%, -50%); transition: transform 180ms ease; width: auto; }
.knight-movement-workbench-piece:hover img,
.knight-movement-workbench-piece:focus-visible img { transform: translate(-50%, calc(-50% - 4px)) scale(1.04); }
.knight-movement-direction-icon { display: block; filter: invert(43%) sepia(74%) saturate(674%) hue-rotate(106deg) brightness(88%) contrast(93%); height: 40px; transition: filter 160ms ease, transform 160ms ease; width: 40px; }
.knight-movement-direction:hover:not(:disabled),
.knight-movement-direction:focus-visible:not(:disabled) { outline: 0; transform: scale(1.1); }
.knight-movement-direction.is-selected .knight-movement-direction-icon { filter: invert(18%) sepia(88%) saturate(5238%) hue-rotate(350deg) brightness(87%) contrast(95%); }
.knight-movement-direction:disabled { cursor: not-allowed; opacity: .42; pointer-events: none; }
.knight-movement-direction.is-knight-controls-hidden { visibility: hidden; }
.knight-distance-label-layer { inset: 0; pointer-events: none; position: absolute; z-index: 7; }
.knight-movement-workbench-piece:disabled { cursor: not-allowed; opacity: .58; }
.knight-movement-direction-up-right-1 { grid-area: up-right-1; }
.knight-movement-direction-up-right-2 { grid-area: up-right-2; }
.knight-movement-direction-down-right-1 { grid-area: down-right-1; }
.knight-movement-direction-down-right-2 { grid-area: down-right-2; }
.knight-movement-direction-down-left-1 { grid-area: down-left-1; }
.knight-movement-direction-down-left-2 { grid-area: down-left-2; }
.knight-movement-direction-up-left-1 { grid-area: up-left-1; }
.knight-movement-direction-up-left-2 { grid-area: up-left-2; }

.knight-movement-distance-reserve {
  flex: 0 0 52px;
  margin: 0 auto 8px;
  min-height: 52px;
  order: 4;
  width: min(350px, 100%);
}

.knight-practice-content { height: 100%; }
.knight-practice-content .knight-movement-grid { margin-top: auto; }
.knight-practice-content .knight-practice-prompt { flex: 0 0 auto; margin: 0; }
.knight-practice-workbench-piece { cursor: default; pointer-events: none; }

@container (max-height: 600px) {
  .knight-movement-message-stack { font-size: 21px; gap: 4px; margin-top: 8px; min-height: calc((2 * 1.25em) + 16px); }
  .knight-movement-message-stack [data-knight-message="jump"].knight-movement-message-multiline span:first-child { margin-bottom: 4px; }
  .knight-movement-message-stack:has(.knight-movement-message-multiline:not([hidden])) { min-height: calc((3 * 1.25em) + 16px); }
  .knight-movement-grid { margin-bottom: 4px; width: min(180px, 100%); }
  .knight-movement-direction, .knight-movement-workbench-piece { height: 36px; width: 36px; }
  .knight-movement-direction-icon { height: 34px; width: 34px; }
  .knight-movement-distance-reserve { flex-basis: 46px; margin-bottom: 4px; min-height: 46px; }
}

@container (max-height: 520px) {
  .knight-movement-grid { width: min(160px, 100%); }
  .knight-movement-direction, .knight-movement-workbench-piece { height: 32px; width: 32px; }
  .knight-movement-direction-icon { height: 30px; width: 30px; }
  .knight-movement-heading { font-size: 27px; }
  .knight-movement-message-stack { font-size: 18px; margin-top: 6px; }
  .knight-movement-distance-reserve { flex-basis: 44px; min-height: 44px; }
}

.board-panel-page-student .knight-movement-direction {
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  min-height: 0;
  padding: 0;
}

.knight-movement-demo {
  container-type: size;
}

/* 互动区面向触屏操作，六种棋子的方向键悬停时均不显示按钮方格或位移。 */
.board-panel-page-student .rook-movement-direction:hover:not(:disabled),
.board-panel-page-student .bishop-movement-direction:hover:not(:disabled),
.board-panel-page-student .queen-movement-direction:hover:not(:disabled),
.board-panel-page-student .king-rebuilt-practice-grid .king-movement-direction:hover:not(:disabled),
.board-panel-page-student .pawn-movement-direction:hover:not(:disabled),
.board-panel-page-student .knight-movement-direction:hover:not(:disabled) {
  background: transparent;
  box-shadow: none;
  filter: none;
  transform: none;
}

.board-panel-page-student .pawn-movement-direction:hover:not(:disabled) .pawn-movement-direction-icon {
  transform: none;
}

/* 禁用状态也可能被鼠标悬停，必须覆盖工具栏的通用按钮悬停阴影。 */
.board-panel-page-student .pawn-movement-direction:hover,
.board-panel-page-student .pawn-movement-workbench-piece:hover,
.board-panel-page-student .pawn-promotion-choices button:hover {
  background: transparent;
  box-shadow: none;
  filter: none;
  transform: none;
}

.board-panel-page-student .pawn-movement-direction:hover .pawn-movement-direction-icon {
  transform: none;
}

.board-panel-page-student .rook-movement-direction::after,
.board-panel-page-student .bishop-movement-direction::after,
.board-panel-page-student .queen-movement-direction::after,
.board-panel-page-student .king-movement-direction::after,
.board-panel-page-student .pawn-movement-direction::after,
.board-panel-page-student .knight-movement-direction::after {
  content: none;
}

/* 六种棋子的方向键统一为 44px 点击区域，避免不同讲义的操作手感不一致。 */
.rook-movement-direction,
.bishop-movement-direction,
.queen-movement-direction,
.king-movement-direction,
.pawn-movement-direction,
.knight-movement-direction {
  height: 44px;
  width: 44px;
}

.rook-movement-direction-icon,
.bishop-movement-direction-icon,
.queen-movement-direction-icon,
.king-movement-direction-icon,
.pawn-movement-direction-icon,
.knight-movement-direction-icon {
  height: 40px;
  width: 40px;
}

.rook-movement-direction.is-selected::before,
.bishop-movement-direction.is-selected::before,
.queen-movement-direction.is-selected::before,
.king-movement-direction.is-selected::before,
.pawn-movement-direction.is-selected::before {
  height: 40px;
  width: 40px;
}

/* 马沿用车的棋子缩放比例；五乘五网格为八个 44px 方向键预留完整空间。 */
.knight-movement-grid {
  width: min(220px, 100%);
}

.knight-movement-workbench-piece {
  height: 44px;
  width: 44px;
}

.knight-movement-workbench-piece img {
  height: auto;
  left: auto;
  max-height: 92%;
  position: static;
  top: auto;
  transform: none;
  width: min(88px, 92%);
}

.knight-movement-workbench-piece:hover img,
.knight-movement-workbench-piece:focus-visible img {
  transform: translateY(-4px) scale(1.04);
}

/* 马的八向控制区以车的数字底线为基线，授课和互动使用同一定位方式。 */
.knight-movement-demo,
.knight-practice-content {
  overflow: visible;
  padding-bottom: 0;
}

.knight-movement-distance-reserve {
  display: none;
}

.knight-movement-grid {
  margin-bottom: 12px;
}

/* 六种棋子的授课标题和提示文字使用同一套排版基线。 */
.board-panel-page-teacher :is(
  .rook-movement-heading,
  .bishop-movement-heading,
  .queen-movement-heading,
  .king-movement-heading,
  .pawn-movement-heading,
  .knight-movement-heading
) {
  align-self: center;
  font-weight: 900;
  max-width: 100%;
  text-align: center;
  width: fit-content;
}

.board-panel-page-teacher :is(
  .rook-movement-message-stack,
  .bishop-movement-message-stack,
  .queen-movement-message-stack,
  .king-movement-message-stack,
  .pawn-movement-message-stack,
  .knight-movement-message-stack
) {
  font-size: 18px;
  gap: 4px;
  line-height: 1.25;
  margin: 6px auto 0;
}

/* 六种棋子互动题使用同一条提示基线，避免尺寸容器触发不同字号。 */
.piece-practice-content {
  align-items: center;
  container-type: normal;
  padding-bottom: 10px;
}

/* 马的互动方向区与授课方向区保持同一条垂直基线。 */
.piece-practice-content.knight-practice-content {
  padding-bottom: 0;
}

/* 兵的互动方向键清除工作台通用按钮尺寸，保持 44px 正方形。 */
.board-panel-page-student .pawn-movement-direction {
  min-height: 0;
  padding: 0;
}

.piece-practice-content > .piece-practice-prompt {
  flex: 0 0 30px;
  font-size: 24px;
  height: 30px;
  line-height: 30px;
  margin: 0;
  min-height: 30px;
  overflow: hidden;
}

.piece-practice-content > .piece-practice-prompt.is-multiline-feedback {
  flex-basis: 90px;
  height: 90px;
  line-height: 30px;
  min-height: 90px;
}

/* 手机纵向面板较矮，所有走棋互动共同缩放控制区，保留数字行。 */
@media (max-width: 640px) {
  .piece-practice-content > :is(.rook-movement-grid, .bishop-movement-grid, .queen-movement-grid) {
    zoom: .66;
  }
  .piece-practice-content > .knight-movement-grid {
    zoom: .6;
  }
  .piece-practice-content > :is(.rook-movement-distance-controls, .bishop-movement-distance-controls, .queen-movement-distance-controls) {
    zoom: .8;
  }
  .attack-capture-practice-content > .is-attack-capture-attack-prompt ~ :is(.rook-movement-grid, .bishop-movement-grid, .queen-movement-grid) {
    zoom: .52;
  }
  .attack-capture-practice-content > .is-attack-capture-attack-prompt ~ .knight-movement-grid {
    zoom: .48;
  }
}

.piece-practice-content > .piece-practice-prompt.is-attack-capture-attack-prompt:not(.is-multiline-feedback) {
  flex-basis: 60px;
  height: 60px;
  min-height: 60px;
}

.piece-safe-placement-layer {
  inset: 0;
  pointer-events: none;
  position: absolute;
  z-index: 24;
}

.piece-safe-placement-layer[hidden],
.piece-safe-placement-line-square[hidden],
.piece-safe-placement-selected-piece[hidden],
.piece-safe-placement-correct-piece[hidden],
.piece-safe-placement-scene-piece[hidden],
.piece-safe-placement-wrong-marker[hidden] {
  display: none;
}

.piece-safe-placement-line-square,
.piece-safe-placement-selected-piece,
.piece-safe-placement-correct-piece,
.piece-safe-placement-scene-piece,
.piece-safe-placement-wrong-marker {
  height: 12.5%;
  position: absolute;
  transform: translate(-50%, -50%);
  width: var(--board-piece-square-size);
  z-index: 2;
}

.piece-safe-placement-line-square {
  background: rgba(45, 115, 201, .16);
  box-shadow: inset 0 0 0 4px rgba(45, 115, 201, .78);
  z-index: 1;
}

.board-intro-layout[data-lesson-key="queen_movement"] .piece-safe-placement-line-square {
  animation: none;
}

.piece-safe-placement-selected-piece,
.piece-safe-placement-correct-piece,
.piece-safe-placement-scene-piece {
  height: var(--board-piece-square-size);
  object-fit: contain;
  transform: translate(-50%, -50%) scale(var(--board-piece-scale));
  width: var(--board-piece-square-size);
  z-index: 2;
}

.piece-safe-placement-selected-piece {
  filter: drop-shadow(0 6px 4px rgba(13, 57, 87, .28));
  z-index: 3;
}

.piece-safe-placement-correct-piece {
  animation: piece-safe-placement-answer-breathe 1.15s ease-in-out infinite alternate;
  filter: drop-shadow(0 6px 4px rgba(13, 57, 87, .28));
  z-index: 4;
}

.piece-safe-placement-scene-piece {
  z-index: 2;
}

.piece-safe-placement-wrong-marker {
  align-items: center;
  color: #d62f2f;
  display: grid;
  font-family: Arial, sans-serif;
  font-size: clamp(42px, 7vw, 70px);
  font-weight: 900;
  justify-items: center;
  line-height: 1;
  text-shadow: 0 2px 0 rgba(255, 255, 255, .8);
  z-index: 5;
}

@keyframes piece-safe-placement-answer-breathe {
  from {
    opacity: 1;
    transform: translate(-50%, -50%) scale(var(--board-piece-scale));
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(calc(var(--board-piece-scale) * 1.06));
  }
}

.pawn-plan-target-marker {
  align-items: center;
  color: #111827;
  display: grid;
  font-family: Arial, sans-serif;
  font-size: clamp(28px, 5vw, 52px);
  font-weight: 900;
  height: 11.25%;
  justify-items: center;
  line-height: 1;
  pointer-events: none;
  position: absolute;
  transform: translate(-50%, -50%);
  width: 11.25%;
  z-index: 8;
}

.pawn-plan-target-marker.is-route-target {
  box-shadow: inset 0 0 0 5px #2d73c9;
  color: #2d73c9;
  font-size: clamp(18px, 3vw, 34px);
}

.pawn-plan-target-marker[hidden] {
  display: none;
}

/* 棋子价值讲义一复用五种走法控制台，并保持默认未选择状态。 */
.piece-intro-layout .lesson-console-topic-page.is-active:has(.piece-value-lecture) {
  grid-template-rows: minmax(0, 1fr);
}

.piece-value-lecture .rook-movement-message-stack {
  grid-template-rows: minmax(1.25em, auto);
  min-height: calc((2 * 1.25em) + 12px);
  white-space: normal;
  width: min(100%, 29ch);
}

.piece-value-lecture-copy {
  margin: 0;
  text-align: left;
  text-indent: 2em;
  text-wrap: pretty;
}

.piece-value-exchange-copy-stack {
  min-height: 0;
  width: min(100%, 29ch);
}

.piece-value-exchange-copy {
  font-size: clamp(16px, 6.2cqi, 24px);
}

.piece-value-king-copy-stack {
  align-content: start;
  gap: clamp(10px, 2.8cqi, 18px);
  grid-template-rows: repeat(2, auto);
  min-height: 0;
  white-space: normal;
}

.piece-value-summary-copy-stack {
  align-content: start;
  gap: clamp(8px, 2.2cqi, 14px);
  grid-template-rows: none;
  max-height: 100%;
  min-height: 0;
  overflow-y: auto;
  padding-right: 2px;
  width: 100%;
}

.piece-value-summary-copy-stack .piece-value-exchange-copy {
  font-size: clamp(16px, 5.4cqi, 21px);
}

.piece-value-exchange-heading {
  font-size: clamp(24px, 8cqi, 32px);
  white-space: normal;
}

.piece-value-exchange-heading span {
  display: block;
  letter-spacing: 0;
  text-align: center;
}

.piece-value-exchange-heading span[lang="en"] {
  font-size: 20px;
  line-height: 1.25;
}

.piece-value-exchange-heading-long span[lang="en"] {
  font-size: clamp(14px, 4.6cqi, 17px);
  white-space: nowrap;
}

[data-piece-value-exchange-lecture-content][hidden] {
  display: none;
}

.piece-value-equal-value-copy-stack {
  min-height: calc((3 * 1.25em) + 12px);
}

.piece-value-exchange-side-selector {
  display: grid;
  flex: 0 0 auto;
  gap: clamp(8px, 2.2cqi, 14px);
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: auto auto 6px;
  order: 3;
  width: min(100%, 300px);
}

.piece-value-exchange-side-button {
  background: rgba(255, 255, 255, .82);
  border: 2px solid rgba(11, 79, 125, .28);
  border-radius: 6px;
  color: #0b4f7d;
  cursor: pointer;
  font-size: clamp(16px, 5.2cqi, 20px);
  font-weight: 900;
  min-height: 48px;
  padding: 8px 10px;
  transition: background-color 160ms ease, border-color 160ms ease, box-shadow 160ms ease, color 160ms ease, transform 160ms ease;
  white-space: nowrap;
}

.piece-value-exchange-side-button.is-white:hover:not(:disabled),
.piece-value-exchange-side-button.is-white:focus-visible,
.piece-value-exchange-side-button.is-white.is-selected {
  background: #e7f6ff;
  border-color: #2385e8;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .78), 0 4px 10px rgba(35, 133, 232, .16);
  color: #1267b8;
}

.piece-value-exchange-side-button.is-black:hover:not(:disabled),
.piece-value-exchange-side-button.is-black:focus-visible,
.piece-value-exchange-side-button.is-black.is-selected {
  background: #273746;
  border-color: #17222d;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .18), 0 4px 10px rgba(23, 34, 45, .2);
  color: #fff;
}

.piece-value-exchange-side-button:hover:not(:disabled),
.piece-value-exchange-side-button:focus-visible {
  outline: 0;
  transform: translateY(-1px);
}

.piece-value-exchange-side-button:disabled {
  cursor: default;
  opacity: .58;
}

.piece-value-exchange-results {
  color: #0b4f7d;
  display: grid;
  flex: 0 0 auto;
  font-size: clamp(17px, 5.8cqi, 20px);
  font-weight: 800;
  gap: clamp(10px, 2.2cqi, 16px);
  line-height: 1.25;
  margin-inline: auto;
  margin-top: 1.25em;
  order: 3;
  text-align: left;
  width: 100%;
}

.piece-value-exchange-results p {
  margin: 0;
  min-height: 1.25em;
  overflow-wrap: anywhere;
}

.piece-value-exchange-result-line {
  overflow-wrap: normal;
  white-space: nowrap;
}

.piece-value-exchange-result-line.is-white {
  color: #1267b8;
}

.piece-value-exchange-result-line.is-black {
  color: #273746;
}

.piece-value-exchange-side-label {
  display: inline-block;
  min-width: 3em;
}

.piece-value-selector {
  align-items: center;
  display: grid;
  flex: 0 0 auto;
  gap: clamp(5px, 1.2cqi, 10px);
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin: 8px auto 4px;
  order: 3;
  width: min(360px, 100%);
}

.piece-value-selector-button {
  aspect-ratio: 1;
  background: transparent;
  border: 2px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  display: grid;
  min-width: 0;
  padding: 3px;
  place-items: center;
  transition: background-color 180ms ease, border-color 180ms ease, opacity 180ms ease, transform 180ms ease;
}

.piece-value-selector-button img {
  display: block;
  filter: drop-shadow(0 5px 4px rgba(13, 57, 87, .22));
  height: 100%;
  max-height: 58px;
  object-fit: contain;
  transition: transform 180ms ease;
  width: 100%;
}

.piece-value-selector-button:hover,
.piece-value-selector-button:focus-visible {
  background: rgba(116, 188, 233, .14);
  border-color: rgba(35, 148, 188, .52);
  outline: 0;
  transform: translateY(-2px);
}

.piece-value-selector-button:focus-visible {
  box-shadow: 0 0 0 3px rgba(255, 253, 246, .95), 0 0 0 5px rgba(35, 148, 188, .62);
}

.piece-value-selector-button.is-selected {
  background: rgba(35, 148, 188, .13);
  border-color: #2394bc;
}

.piece-value-selector-button.is-selected img {
  transform: scale(1.06);
}

.piece-value-console {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
  order: 4;
  width: 100%;
}

.piece-value-console[hidden] {
  display: none;
}

.piece-value-console .rook-movement-grid,
.piece-value-console .bishop-movement-grid,
.piece-value-console .queen-movement-grid,
.piece-value-console .knight-movement-grid,
.piece-value-console .pawn-movement-grid {
  margin-top: auto;
}

.piece-value-console .rook-movement-workbench-piece,
.piece-value-console .bishop-movement-workbench-piece,
.piece-value-console .queen-movement-workbench-piece,
.piece-value-console .knight-movement-workbench-piece,
.piece-value-console .pawn-movement-workbench-piece {
  cursor: default;
  pointer-events: none;
}

.piece-value-console .rook-movement-distance:not(:disabled),
.piece-value-console .bishop-movement-distance:not(:disabled),
.piece-value-console .queen-movement-distance:not(:disabled) {
  cursor: pointer;
}

.piece-value-console-rook .rook-movement-direction {
  display: grid;
  filter: none;
}

.piece-value-console-rook .rook-movement-direction-icon {
  filter: invert(47%) sepia(63%) saturate(1893%) hue-rotate(345deg) brightness(98%) contrast(91%);
}

.piece-value-console-rook .rook-movement-distance-controls {
  pointer-events: auto;
  visibility: visible;
}

/* 棋子价值保留按钮自身的方向图形，选中后只改变颜色，不替换成单箭头。 */
.piece-value-console .rook-movement-direction.is-selected .rook-movement-direction-icon,
.piece-value-console .bishop-movement-direction.is-selected .bishop-movement-direction-icon,
.piece-value-console .queen-movement-direction.is-selected .queen-movement-direction-icon,
.piece-value-console .pawn-movement-direction.is-selected .pawn-movement-direction-icon {
  filter: invert(18%) sepia(88%) saturate(5238%) hue-rotate(350deg) brightness(87%) contrast(95%);
  opacity: 1;
}

.piece-value-console .rook-movement-direction.is-selected::before,
.piece-value-console .bishop-movement-direction.is-selected::before,
.piece-value-console .queen-movement-direction.is-selected::before,
.piece-value-console .pawn-movement-direction.is-selected::before {
  content: none;
}

.piece-value-lecture-board-layer {
  inset: 0;
  pointer-events: none;
  position: absolute;
  z-index: 8;
}

.piece-value-lecture-board-layer[hidden] {
  display: none;
}

/* 等价交换使用独立棋盘层，避免与主题一、主题二的授课状态互相污染。 */
.piece-value-exchange-board-layer {
  inset: 0;
  pointer-events: none;
  position: absolute;
  z-index: 8;
}

.piece-value-exchange-board-layer[hidden],
.piece-value-exchange-piece[hidden] {
  display: none;
}

.piece-value-king-danger-arrow-layer {
  inset: 0;
  overflow: visible;
  pointer-events: none;
  position: absolute;
  z-index: 5;
}

.piece-value-king-danger-arrow-layer line {
  fill: none;
  stroke: var(--lesson-danger, #d62f2f);
  stroke-linecap: butt;
  stroke-width: 14;
  vector-effect: non-scaling-stroke;
}

.piece-value-king-danger-arrow-layer marker path {
  fill: var(--lesson-danger, #d62f2f);
}

.piece-value-king-danger-arrow-layer line[hidden] {
  display: none;
}

.piece-value-exchange-board-divider {
  background: #f0441c;
  bottom: 0;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .86), 0 0 8px rgba(141, 35, 18, .24);
  position: absolute;
  top: 0;
  width: clamp(3px, .55cqi, 5px);
  z-index: 2;
}

.piece-value-exchange-board-divider.is-first {
  left: 25%;
}

.piece-value-exchange-board-divider.is-second {
  left: 62.5%;
}

.piece-value-exchange-board-divider.is-middle {
  left: 50%;
}

.piece-value-exchange-piece {
  align-items: center;
  display: grid;
  height: 12.5%;
  justify-items: center;
  left: calc(var(--piece-value-file-index) * 12.5%);
  position: absolute;
  top: calc(var(--piece-value-row-index) * 12.5%);
  width: 12.5%;
  z-index: 3;
}

.piece-value-exchange-piece.is-moving {
  transition: left var(--piece-value-exchange-move-duration, var(--piece-move-ms-per-square, 420ms)) var(--piece-value-exchange-move-timing-function, linear),
    top var(--piece-value-exchange-move-duration, var(--piece-move-ms-per-square, 420ms)) var(--piece-value-exchange-move-timing-function, linear);
  z-index: 4;
}

.piece-value-exchange-piece img {
  display: block;
  filter: drop-shadow(0 8px 6px rgba(13, 57, 87, .3));
  height: var(--board-square-piece-fill);
  object-fit: contain;
  width: var(--board-square-piece-fill);
}

.piece-value-summary-board-item {
  align-items: center;
  display: grid;
  height: 12.5%;
  justify-items: center;
  left: calc(var(--piece-value-file-index) * 12.5%);
  opacity: 0;
  position: absolute;
  top: calc(var(--piece-value-row-index) * 12.5%);
  transform: translateY(5%);
  transition: opacity 260ms ease, transform 260ms ease;
  width: 12.5%;
  z-index: 3;
}

.piece-value-summary-board-item.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.piece-value-summary-board-item.is-pulsing {
  animation: piece-value-summary-row-breathe 680ms ease-in-out 1;
}

.piece-value-summary-board-piece img {
  display: block;
  filter: drop-shadow(0 7px 5px rgba(13, 57, 87, .24));
  height: var(--board-square-piece-fill);
  object-fit: contain;
  width: var(--board-square-piece-fill);
}

.piece-value-summary-board-equals,
.piece-value-summary-board-score {
  color: #0b4f7d;
  font-size: clamp(22px, 4.2cqi, 38px);
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

.piece-value-summary-board-score {
  justify-items: center;
  width: 25%;
}

@keyframes piece-value-summary-row-breathe {
  0%, 100% { filter: brightness(1); opacity: 1; transform: translateY(0); }
  50% { filter: brightness(1.12); opacity: .42; transform: translateY(0); }
}

.piece-value-lecture-board-item {
  align-items: center;
  display: grid;
  height: 12.5%;
  justify-items: center;
  left: calc(var(--piece-value-file-index) * 12.5%);
  position: absolute;
  top: calc(var(--piece-value-row-index) * 12.5%);
  width: 12.5%;
}

.piece-value-lecture-board-item img {
  display: block;
  object-fit: contain;
}

.piece-value-lecture-board-piece {
  z-index: 2;
}

.piece-value-lecture-board-piece.is-moving {
  transition: left var(--piece-value-move-duration, var(--piece-move-ms-per-square, 420ms)) var(--piece-value-move-timing-function, linear),
    top var(--piece-value-move-duration, var(--piece-move-ms-per-square, 420ms)) var(--piece-value-move-timing-function, linear);
  z-index: 3;
}

.piece-value-lecture-board-piece img {
  filter: drop-shadow(0 8px 6px rgba(13, 57, 87, .3));
  height: var(--board-square-piece-fill);
  width: var(--board-square-piece-fill);
}

.piece-value-lecture-board-digit {
  z-index: 1;
}

.piece-value-lecture-board-digit-label {
  align-items: center;
  animation: piece-value-lecture-digit-appear 320ms ease-out both;
  background: rgba(11, 79, 125, .9);
  border: 2px solid rgba(255, 255, 255, .88);
  border-radius: 50%;
  box-shadow: 0 3px 8px rgba(8, 45, 73, .28);
  color: #fff;
  display: flex;
  filter: drop-shadow(0 8px 6px rgba(13, 57, 87, .25));
  font-size: clamp(16px, 3vw, 34px);
  font-weight: 900;
  height: 60%;
  justify-content: center;
  line-height: 1;
  width: 60%;
}

@keyframes piece-value-lecture-digit-appear {
  from { opacity: 0; transform: scale(.72); }
  to { opacity: 1; transform: scale(1); }
}

/* 棋子价值主题二保持课堂工作台的紧凑密度，五行依次承担讲义揭示和动画触发。 */
.piece-value-score-list {
  display: grid;
  flex: 1 1 auto;
  gap: clamp(4px, 1.1cqi, 9px);
  grid-template-rows: repeat(5, minmax(0, 1fr));
  margin: 12px 0 0;
  min-height: 0;
  order: 2;
}

.piece-value-score-row {
  align-items: center;
  background: transparent;
  border: 2px solid transparent;
  border-radius: 6px;
  color: #b42318;
  cursor: pointer;
  display: grid;
  gap: clamp(8px, 2cqi, 14px);
  grid-template-columns: clamp(46px, 13cqi, 64px) minmax(0, 1fr);
  min-height: 0;
  padding: 2px 8px 2px 4px;
  text-align: left;
  transition: background-color 180ms ease, border-color 180ms ease, transform 180ms ease;
  width: 100%;
}

.piece-value-score-row:not(:disabled):hover,
.piece-value-score-row:not(:disabled):focus-visible {
  background: rgba(116, 188, 233, .14);
  border-color: rgba(35, 148, 188, .52);
  outline: 0;
}

.piece-value-score-row:not(:disabled):active {
  transform: scale(.985);
}

.piece-value-score-row:focus-visible {
  box-shadow: 0 0 0 3px rgba(255, 253, 246, .95), 0 0 0 5px rgba(35, 148, 188, .62);
}

.piece-value-score-row.is-selected {
  background: rgba(35, 148, 188, .13);
  border-color: #2394bc;
}

.piece-value-score-row.is-locked {
  cursor: not-allowed;
  opacity: .34;
}

.piece-value-score-row.is-busy {
  cursor: progress;
}

.piece-value-score-row img {
  display: block;
  filter: drop-shadow(0 5px 4px rgba(13, 57, 87, .22));
  height: 100%;
  justify-self: center;
  max-height: 60px;
  max-width: 60px;
  object-fit: contain;
  width: 100%;
}

.piece-value-score-row-copy {
  align-items: center;
  display: flex;
  font-size: 24px;
  font-weight: 800;
  line-height: 1.25;
  min-height: 2.5em;
  opacity: 0;
  overflow-wrap: anywhere;
  transition: opacity 180ms ease;
}

.piece-value-score-row-copy.is-visible {
  opacity: 1;
}

.piece-value-score-board-layer {
  inset: 0;
  pointer-events: none;
  position: absolute;
  z-index: 8;
}

.piece-value-score-board-layer[hidden] {
  display: none;
}

.piece-value-score-board-piece {
  align-items: center;
  display: grid;
  height: 12.5%;
  justify-items: center;
  left: calc(var(--piece-value-file-index) * 12.5%);
  position: absolute;
  top: calc(var(--piece-value-row-index) * 12.5%);
  transform-origin: center;
  width: 12.5%;
  z-index: 3;
}

.piece-value-score-board-piece img {
  display: block;
  filter: drop-shadow(0 8px 6px rgba(13, 57, 87, .3));
  height: var(--board-square-piece-fill);
  object-fit: contain;
  width: var(--board-square-piece-fill);
}

.piece-value-score-board-label {
  align-items: center;
  color: #0b4f7d;
  display: flex;
  font-size: clamp(20px, 3.2vw, 34px);
  font-weight: 900;
  height: 12.5%;
  justify-content: center;
  left: calc(var(--piece-value-file-index) * 12.5%);
  letter-spacing: 0;
  line-height: 1;
  opacity: 0;
  position: absolute;
  text-shadow: 0 1px 1px rgba(255, 255, 255, .72), 0 3px 6px rgba(8, 45, 73, .18);
  top: calc(var(--piece-value-row-index) * 12.5%);
  transform-origin: center;
  visibility: hidden;
  white-space: nowrap;
  width: 25%;
  z-index: 4;
}

.piece-value-score-board-label.is-visible {
  opacity: 1;
  visibility: visible;
}

.piece-value-score-board-piece.is-pulsing,
.piece-value-score-board-label.is-pulsing {
  animation: piece-value-score-breathe 680ms ease-in-out 2;
}

.piece-value-score-stair-line {
  height: 100%;
  inset: 0;
  overflow: visible;
  position: absolute;
  width: 100%;
  z-index: 2;
}

.piece-value-score-stair-line-segments line,
.piece-value-score-stair-line-final {
  fill: none;
  stroke: #f0441c;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 12;
  vector-effect: non-scaling-stroke;
}

.piece-value-score-stair-line-segments {
  opacity: 0;
}

.piece-value-score-stair-line-segments.is-drawing {
  opacity: 1;
}

.piece-value-score-stair-line-segments.is-complete {
  opacity: 0;
}

.piece-value-score-stair-line .piece-value-score-stair-line-final {
  opacity: 0;
  stroke-dasharray: none;
  stroke-dashoffset: 0;
}

.piece-value-score-stair-line .piece-value-score-stair-line-final.is-visible {
  opacity: 1;
}

@keyframes piece-value-score-breathe {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .28; transform: scale(.86); }
}

@media (prefers-reduced-motion: reduce) {
  .piece-value-summary-board-item {
    transition: none;
  }

  .piece-value-summary-board-item.is-pulsing {
    animation: none;
  }

  .piece-value-score-board-piece.is-pulsing,
  .piece-value-score-board-label.is-pulsing {
    animation: none;
  }

  .piece-value-score-stair-line-segments.is-drawing {
    opacity: 0;
  }
}

@container (max-height: 560px) {
  .piece-value-lecture .rook-movement-message-stack {
    min-height: calc((2 * 1.25em) + 4px);
  }

  .piece-value-selector {
    gap: 4px;
    margin-top: 4px;
    width: min(290px, 100%);
  }

  .piece-value-selector-button img {
    max-height: 46px;
  }

  .piece-value-score-list {
    gap: 3px;
    margin-top: 6px;
  }

  .piece-value-score-row {
    grid-template-columns: 42px minmax(0, 1fr);
    padding-block: 1px;
  }

  .piece-value-score-row img {
    max-height: 44px;
    max-width: 44px;
  }

  .piece-value-exchange-copy-stack {
    margin-top: 6px;
  }

  .piece-value-exchange-heading span[lang="en"] {
    font-size: 18px;
  }

  .piece-value-exchange-heading-long span[lang="en"] {
    font-size: clamp(11px, 4.2cqi, 14px);
  }

  .piece-value-exchange-results {
    gap: 4px;
  }

}

/* 后台设置使用与课堂一致的色彩系统，并保留适合高频操作的紧凑信息密度。 */
.app-settings .page-shell {
  overflow: auto;
  padding: 28px;
}

.app-messages {
  margin: 0 auto 16px;
  max-width: 1200px;
}

.app-message {
  background: #eafcf4;
  border: 1px solid #8ed8ae;
  border-radius: 8px;
  color: #176a42;
  font-weight: 700;
  margin: 0;
  padding: 12px 16px;
}

.settings-page {
  margin: 0 auto;
  max-width: 1200px;
  padding-bottom: 28px;
}

.settings-page-heading,
.settings-section-title {
  align-items: flex-start;
  display: flex;
  gap: 20px;
  justify-content: space-between;
}

.settings-page-heading {
  margin: 6px 0 24px;
}

.settings-page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.settings-page-heading h1 {
  color: #153449;
  font-size: 32px;
  line-height: 1.2;
  margin: 4px 0 8px;
}

.settings-page-heading > div > p:last-child {
  color: var(--muted);
  margin: 0;
}

.settings-dashboard-grid {
  align-items: start;
  display: grid;
  gap: 20px;
  grid-template-columns: minmax(280px, 0.42fr) minmax(0, 1fr);
  margin-bottom: 20px;
}

.settings-panel {
  background: var(--surface);
  border: 1px solid #bfe2f5;
  border-radius: 8px;
  padding: 22px;
}

.settings-panel h2 {
  color: #153449;
  font-size: 22px;
  line-height: 1.25;
  margin: 0 0 18px;
}

.account-settings-layout {
  align-items: stretch;
  display: grid;
  gap: 28px;
  grid-template-columns: minmax(0, 0.68fr) minmax(240px, 0.32fr);
}

.account-credentials {
  display: grid;
  gap: 16px;
  max-width: 580px;
}

.account-access-panel {
  background: #f5fbff;
  border-left: 3px solid #79bfee;
  display: grid;
  gap: 18px;
  padding: 18px 20px;
}

.account-access-panel h3 {
  color: #26455b;
  font-size: 17px;
  margin: 0;
}

.account-access-panel p {
  color: #547086;
  font-size: 13px;
  line-height: 1.55;
  margin: 0;
}

.account-access-control {
  display: grid;
  gap: 8px;
}

.account-access-control > label:not(.window-enabled) {
  color: #26455b;
  font-size: 14px;
  font-weight: 800;
}

.account-access-control select {
  background: #fff;
  border: 1px solid #a9cfe6;
  border-radius: 6px;
  color: #173044;
  min-height: 42px;
  padding: 8px 10px;
  width: 100%;
}

.settings-section-title {
  align-items: center;
  margin-bottom: 14px;
}

.settings-section-title h2 {
  margin: 0;
}

.settings-section-title span {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.settings-form,
.settings-user-form {
  display: grid;
  gap: 16px;
}

.settings-user-form {
  gap: 20px;
  grid-template-columns: minmax(0, 1fr);
}

.settings-user-form > *,
.settings-panel {
  min-width: 0;
}

.settings-field {
  display: grid;
  gap: 7px;
}

.settings-field label {
  color: #26455b;
  font-size: 14px;
  font-weight: 800;
}

.settings-field input,
.access-window-row input[type="time"] {
  background: #fff;
  border: 1px solid #a9cfe6;
  border-radius: 6px;
  color: #173044;
  min-height: 42px;
  padding: 8px 10px;
  width: 100%;
}

.settings-field input:focus,
.access-window-row input:focus {
  border-color: var(--primary);
  outline: 3px solid rgba(35, 133, 232, 0.18);
  outline-offset: 1px;
}

.settings-field input[type="checkbox"],
.access-window-row input[type="checkbox"] {
  accent-color: var(--primary);
  min-height: auto;
  padding: 0;
  width: auto;
}

.settings-error {
  color: #b42318;
  font-size: 13px;
  font-weight: 700;
  margin: 0;
}

.settings-table-wrap {
  overflow-x: auto;
}

.settings-table {
  border-collapse: collapse;
  min-width: 0;
  table-layout: fixed;
  width: 100%;
}

.settings-table th,
.settings-table td {
  border-bottom: 1px solid #d9eaf4;
  padding: 12px 10px;
  text-align: left;
}

.settings-table th {
  color: #547086;
  font-size: 13px;
  font-weight: 800;
}

.settings-table td {
  color: #26455b;
  font-size: 14px;
}

.account-role {
  align-items: center;
  border-radius: 999px;
  display: inline-flex;
  font-size: 13px;
  font-weight: 800;
  min-height: 28px;
  padding: 4px 10px;
  white-space: nowrap;
}

.account-role-admin {
  background: #e9f5ff;
  color: #1769aa;
}

.account-role-teacher {
  background: #eef9f1;
  color: #217247;
}

.settings-table th:last-child,
.settings-table td:last-child {
  text-align: right;
  white-space: nowrap;
  width: 64px;
}

.settings-users-panel .settings-table {
  min-width: 640px;
  table-layout: auto;
}

.settings-users-panel .settings-table th:last-child,
.settings-users-panel .settings-table td:last-child {
  width: 164px;
}

.settings-users-panel .settings-table td:first-child {
  overflow-wrap: anywhere;
}

.settings-users-panel .settings-table td:nth-child(3),
.settings-users-panel .settings-table td:nth-child(4) {
  white-space: nowrap;
}

.settings-user-actions {
  align-items: center;
  display: grid;
  gap: 12px;
  grid-template-columns: 44px 56px;
  justify-content: flex-end;
  white-space: nowrap;
}

.settings-user-actions > * {
  text-align: center;
}

.settings-user-actions .text-action,
.settings-delete-form .text-action {
  align-items: center;
  display: inline-flex;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
}

.settings-delete-form {
  display: inline-flex;
  justify-content: center;
  margin: 0;
}

.text-action.text-action-danger {
  appearance: none;
  background: none;
  border: 0;
  color: #b42318;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  padding: 0;
}

.text-action.text-action-danger:hover {
  color: #8f1d14;
  text-decoration: underline;
}

.settings-action-note {
  color: var(--muted);
  font-size: 13px;
}

.text-action {
  color: var(--primary-strong);
  font-weight: 800;
}

.text-action:hover {
  color: var(--primary);
  text-decoration: underline;
}

.access-window-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.access-day-card {
  background: #f8fcff;
  border: 1px solid #d6eaf6;
  border-radius: 8px;
  min-width: 0;
  overflow: hidden;
}

.access-day-heading {
  align-items: center;
  background: #edf8ff;
  display: grid;
  grid-template-columns: 1fr auto;
  padding: 10px 14px;
}

.access-day-heading h3 {
  color: #26455b;
  font-size: 16px;
  margin: 0;
}

.access-day-heading span {
  color: #547086;
  font-size: 13px;
  font-weight: 700;
}

.access-period-grid {
  display: grid;
  gap: 1px;
}

.access-period-row {
  align-items: center;
  background: #fff;
  display: grid;
  gap: 10px;
  grid-template-columns: 42px 72px minmax(0, 1fr);
  padding: 10px 14px;
}

.access-period-row strong {
  color: #26455b;
  font-size: 14px;
}

.window-enabled,
.window-time {
  align-items: center;
  display: flex;
  gap: 7px;
  font-size: 14px;
  font-weight: 700;
}

.window-time span {
  color: var(--muted);
}

.window-time input {
  width: min(140px, 100%);
}

.settings-save-bar {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  justify-content: flex-end;
  margin-top: 20px;
}

@media (max-width: 1280px) {
  .settings-dashboard-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .settings-dashboard-grid {
    grid-template-columns: 1fr;
  }

  .account-settings-layout {
    grid-template-columns: 1fr;
  }

  .account-credentials {
    max-width: none;
  }

  .access-window-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .app-settings .page-shell {
    padding: 16px;
  }

  .app-settings .app-frame {
    grid-template-columns: minmax(0, 1fr);
  }

  .app-settings .classroom-sidebar,
  .app-settings .course-panel-layer {
    display: none;
  }

  .app-settings .topbar {
    gap: 8px;
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 0 10px;
  }

  .app-settings .brand {
    font-size: 16px;
    gap: 8px;
    line-height: 1.15;
    min-width: 0;
  }

  .app-settings .brand-logo {
    height: 38px;
    width: 38px;
  }

  .app-settings .topbar-title {
    display: none;
  }

  .app-settings .topbar-status {
    grid-column: 2;
  }

  .app-settings .topbar-home-link {
    font-size: 13px;
    min-height: 30px;
    padding: 5px 8px;
  }

  .settings-page-heading {
    flex-direction: column;
  }

  .settings-page-actions {
    justify-content: flex-start;
    width: 100%;
  }

  .settings-panel {
    padding: 16px;
  }

  .access-period-row {
    grid-template-columns: 1fr auto;
  }

  .settings-table {
    min-width: 560px;
  }

  .window-time {
    grid-column: 1 / -1;
  }
}

/* 置于文件末尾，确保各棋子遗留规则不能覆盖互动一的统一尺寸。 */
.interaction-one-target-star,
.interaction-one-blocker,
.queen-practice-blocker-piece {
  height: var(--interaction-one-target-size, var(--interaction-one-overlay-size)) !important;
  width: var(--interaction-one-target-size, var(--interaction-one-overlay-size)) !important;
}

/* 置于文件末尾，隔离各专题遗留的棋子缩放：互动一木箱实际恒为单格的 80%。 */
:is(
  .rook-practice-blocker-piece,
  .bishop-practice-blocker-piece,
  .queen-practice-blocker-piece,
  .king-practice-blocker-piece,
  .pawn-movement-scene-piece.pawn-sequence-crate,
  .knight-movement-blocker-piece.is-knight-practice-box,
  .knight-movement-scene-piece.is-knight-practice-box
) {
  height: var(--interaction-one-overlay-size) !important;
  transform: translate(-50%, -50%) scale(1) !important;
  width: var(--interaction-one-overlay-size) !important;
}

/* 木箱始终位于目标星和复盘路线下方，避免旧专题的层级差异影响复盘画面。 */
.interaction-one-blocker,
.queen-practice-blocker-piece,
.pawn-movement-scene-piece.pawn-sequence-crate,
.knight-movement-blocker-piece.is-knight-practice-box,
.knight-movement-scene-piece.is-knight-practice-box {
  z-index: 2 !important;
}
