:root {
  --paper: #f5f0e6;
  --paper-deep: #e9dfce;
  --ink: #17211c;
  --muted: #647067;
  --forest: #173d2b;
  --forest-soft: #dfe9df;
  --gold: #b77a2a;
  --line: rgba(23, 33, 28, 0.16);
  --light-square: #adbed1;
  --dark-square: #273d5c;
  --danger: #9b3d31;
  --success: #24623f;
  --shadow: 0 18px 50px rgba(31, 43, 36, 0.1);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background:
    radial-gradient(circle at 15% 0%, rgba(183, 122, 42, 0.12), transparent 34rem),
    var(--paper);
  color: var(--ink);
  font-family: ui-serif, "Songti SC", "Noto Serif CJK SC", Georgia, serif;
  line-height: 1.72;
}

button, textarea { font: inherit; }

a { color: inherit; }

.chess-notation {
  position: relative;
  z-index: 1;
  display: inline;
  padding: 0;
  border: 0;
  border-bottom: 1.5px dashed currentColor;
  border-radius: 0;
  background: transparent;
  color: inherit;
  cursor: help;
  font: inherit;
  font-weight: 700;
  line-height: inherit;
  text-decoration: none;
}
.chess-notation:hover,
.chess-notation:focus-visible,
.chess-notation.open {
  color: var(--forest);
  outline: none;
}
.notation-tooltip-popover {
  position: fixed;
  z-index: 10000;
  width: max-content;
  max-width: min(270px, calc(100vw - 20px));
  padding: 9px 11px;
  border-radius: 9px;
  background: #14283f;
  box-shadow: 0 8px 20px rgba(7, 20, 36, .25);
  color: #fff;
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity .16s ease, transform .16s ease;
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.5;
  text-align: left;
  white-space: normal;
}
.notation-tooltip-popover.show {
  opacity: 1;
  transform: translateY(0);
}

.site-header {
  border-bottom: 1px solid var(--line);
  background: rgba(245, 240, 230, 0.92);
}

.header-inner, .page, .site-footer {
  width: min(100% - 32px, 980px);
  margin-inline: auto;
}

.header-inner {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  text-decoration: none;
  font-weight: 700;
  letter-spacing: 0.08em;
}
.brand span {
  margin-left: 5px;
  color: var(--muted);
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.issue-mark {
  color: var(--muted);
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 13px;
}

.page { padding: 54px 0 76px; }

.article-header {
  max-width: 760px;
  margin: 0 auto 38px;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
  color: var(--gold);
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  width: 28px;
  height: 1px;
  background: currentColor;
}

h1, h2, h3 { line-height: 1.2; }

h1 {
  margin: 0;
  font-size: clamp(34px, 7vw, 62px);
  letter-spacing: -0.045em;
  font-weight: 700;
}

.dek {
  max-width: 680px;
  margin: 20px 0 18px;
  color: #435047;
  font-size: clamp(17px, 2.4vw, 21px);
}

.meta {
  color: var(--muted);
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 13px;
}

.story {
  max-width: 720px;
  margin: 0 auto 36px;
  font-size: 18px;
}

.culture-note {
  margin: 28px 0;
  padding: 20px 22px;
  border-left: 3px solid var(--gold);
  background: rgba(255,255,255,0.3);
}

.culture-note strong {
  display: block;
  margin-bottom: 4px;
  color: var(--gold);
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 13px;
  letter-spacing: .08em;
}

.challenge {
  max-width: 900px;
  margin: 42px auto;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255,255,255,0.42);
  box-shadow: var(--shadow);
}

.challenge-head {
  padding: 24px 26px 20px;
  border-bottom: 1px solid var(--line);
}

.challenge-kicker {
  margin: 0 0 6px;
  color: var(--gold);
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .12em;
}

.challenge-head h2 { margin: 0 0 8px; font-size: 25px; }
.challenge-head p { margin: 0; color: var(--muted); }

.challenge-body {
  display: grid;
  grid-template-columns: minmax(300px, 1.08fr) minmax(280px, .92fr);
}

.board-wrap {
  padding: 26px;
  background: rgba(22, 45, 74, .07);
}

.position-panel {
  max-width: 520px;
  margin: 0 auto 13px;
  padding: 13px 14px 11px;
  border: 1px solid rgba(12, 32, 57, .14);
  border-radius: 12px;
  background: rgba(255, 255, 255, .64);
  color: #172539;
  font-family: ui-sans-serif, system-ui, sans-serif;
}

.material-line,
.odds-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.material-side {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
}

.material-side-black { text-align: right; }
.material-side strong { display: block; font-size: 12px; }
.material-side small {
  display: block;
  margin-top: 2px;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.side-dot {
  width: 13px;
  height: 13px;
  flex: 0 0 auto;
  border: 2px solid #172539;
  border-radius: 50%;
}
.white-dot { background: #fffaf0; }
.black-dot { background: #172539; }

.odds-head {
  margin-top: 11px;
  font-size: 10px;
}
.odds-head strong { font-size: 11px; }
.odds-head span { color: var(--muted); }

.odds-bar {
  height: 9px;
  margin-top: 6px;
  display: flex;
  overflow: hidden;
  border-radius: 999px;
  background: #d4dae0;
  box-shadow: inset 0 0 0 1px rgba(12, 32, 57, .12);
}
.odds-bar span { min-width: 0; transition: width .28s ease; }
.odds-white { background: #f7f1e6; }
.odds-draw { background: #aeb7c1; }
.odds-black { background: #172539; }

.odds-note {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 9px;
  text-align: right;
}

.board {
  position: relative;
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  overflow: hidden;
  border: 7px solid #0c2039;
  border-radius: 4px;
  box-shadow: 0 14px 30px rgba(12, 32, 57, .25);
  touch-action: manipulation;
}

.square {
  position: relative;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: var(--light-square);
  cursor: grab;
  line-height: 1;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
}

.square:active { cursor: grabbing; }
.square.dark { background: var(--dark-square); }
.square.selected { box-shadow: inset 0 0 0 5px #2ad8df; }
.square.target::after {
  content: "";
  width: 24%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: rgba(23, 61, 43, .58);
}
.square.target.capture::after {
  position: absolute;
  inset: 7%;
  width: auto;
  border: 4px solid rgba(23, 61, 43, .58);
  background: transparent;
}
.square.target .piece { position: absolute; }
.square.last-move { background-image: linear-gradient(rgba(236, 190, 65, .42), rgba(236, 190, 65, .42)); }
.square:focus-visible { z-index: 2; outline: 3px solid #1677c8; outline-offset: -3px; }

.move-feedback {
  z-index: 6;
  overflow: visible;
}
.move-feedback-ring {
  position: absolute;
  z-index: 8;
  inset: 7%;
  border: 4px solid;
  border-radius: 50%;
  pointer-events: none;
}
.move-feedback-wrong .move-feedback-ring {
  border-color: #e84e4e;
  box-shadow: 0 0 0 3px rgba(232, 78, 78, .2), 0 0 16px rgba(232, 78, 78, .45);
  animation: wrong-ring .62s ease-out 2;
}
.move-feedback-wrong .piece {
  animation: wrong-piece-shake .1s linear 6;
}
.move-feedback-correct .move-feedback-ring {
  border-color: #32b56b;
  box-shadow: 0 0 0 3px rgba(50, 181, 107, .2), 0 0 16px rgba(50, 181, 107, .42);
  animation: correct-ring .72s cubic-bezier(.18, .84, .3, 1) 1;
}
.move-feedback-correct .piece {
  animation: correct-piece-pop .48s cubic-bezier(.2, 1.35, .35, 1);
}
/* alternatives：合理但非最优的候选着，用琥珀色区别于「错」(红)与「正确」(绿)。 */
.move-feedback-alt .move-feedback-ring {
  border-color: #e6a817;
  box-shadow: 0 0 0 3px rgba(230, 168, 23, .2), 0 0 16px rgba(230, 168, 23, .42);
  animation: alt-ring .72s cubic-bezier(.18, .84, .3, 1) 1;
}
@keyframes alt-ring {
  0% { opacity: 0; transform: scale(.72); }
  35%, 75% { opacity: 1; transform: scale(1); }
  100% { opacity: .55; transform: scale(1.05); }
}

@keyframes wrong-ring {
  0% { opacity: 0; transform: scale(.72); }
  35%, 75% { opacity: 1; transform: scale(1); }
  100% { opacity: .55; transform: scale(1.05); }
}
@keyframes wrong-piece-shake {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(3px); }
}
@keyframes correct-ring {
  0% { opacity: 0; transform: scale(.62); }
  55% { opacity: 1; transform: scale(1.08); }
  100% { opacity: 1; transform: scale(1); }
}
@keyframes correct-piece-pop {
  0% { transform: scale(.82); }
  70% { transform: scale(1.08); }
  100% { transform: scale(1); }
}

.king-checked {
  z-index: 3;
  animation: check-cell-pulse .72s ease-in-out 2;
}
.king-checked .piece {
  animation: king-tremble .12s linear 8;
}
.king-checked::before,
.king-mated::before {
  content: "";
  position: absolute;
  z-index: 0;
  inset: 8%;
  border: 3px solid rgba(196, 51, 43, .86);
  border-radius: 50%;
  animation: danger-ring .72s ease-out 2;
}

.king-mated {
  z-index: 4;
  overflow: visible;
}
.king-shattered {
  animation: king-original-vanish .22s .12s ease-out forwards;
}
.king-fragment {
  z-index: 5;
  animation-duration: .78s;
  animation-delay: .08s;
  animation-fill-mode: forwards;
  animation-timing-function: cubic-bezier(.18, .72, .27, 1);
}
.fragment-north-west {
  clip-path: polygon(0 0, 55% 0, 48% 52%, 0 44%);
  animation-name: shatter-north-west;
}
.fragment-north-east {
  clip-path: polygon(55% 0, 100% 0, 100% 48%, 48% 52%);
  animation-name: shatter-north-east;
}
.fragment-south-west {
  clip-path: polygon(0 44%, 48% 52%, 56% 100%, 0 100%);
  animation-name: shatter-south-west;
}
.fragment-south-east {
  clip-path: polygon(48% 52%, 100% 48%, 100% 100%, 56% 100%);
  animation-name: shatter-south-east;
}

.board-celebration {
  position: absolute;
  z-index: 20;
  top: 50%;
  left: 50%;
  width: min(82%, 330px);
  padding: 17px 16px 15px;
  border: 2px solid #dcebdc;
  border-radius: 16px;
  background: rgba(24, 82, 51, .96);
  box-shadow: 0 15px 35px rgba(4, 24, 15, .35);
  color: #fff;
  font-family: ui-sans-serif, system-ui, sans-serif;
  text-align: center;
  pointer-events: none;
  transform: translate(-50%, -50%);
  animation: celebration-pop .42s cubic-bezier(.2, 1.4, .4, 1);
}
.board-celebration.mate { background: rgba(20, 46, 77, .97); }
.board-celebration.leaving {
  opacity: 0;
  transform: translate(-50%, -58%) scale(.96);
  transition: opacity .4s ease, transform .4s ease;
}
.celebration-check {
  width: 34px;
  height: 34px;
  margin: 0 auto 7px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #dcf06c;
  color: #173d2b;
  font-size: 22px;
  font-weight: 900;
}
.board-celebration strong,
.board-celebration small { display: block; }
.board-celebration strong { font-size: 20px; }
.board-celebration small { margin-top: 3px; color: rgba(255,255,255,.82); font-size: 11px; }

@keyframes king-tremble {
  0%, 100% { transform: translateX(0) rotate(0); }
  25% { transform: translateX(-3px) rotate(-2deg); }
  75% { transform: translateX(3px) rotate(2deg); }
}
@keyframes check-cell-pulse {
  0%, 100% { background-color: transparent; }
  50% { background-color: rgba(196, 51, 43, .42); }
}
@keyframes danger-ring {
  from { opacity: .95; transform: scale(.72); }
  to { opacity: 0; transform: scale(1.22); }
}
@keyframes king-original-vanish {
  to { opacity: 0; transform: scale(.76); }
}
@keyframes shatter-north-west {
  to { opacity: 0; transform: translate(-19px, -24px) rotate(-25deg) scale(.74); }
}
@keyframes shatter-north-east {
  to { opacity: 0; transform: translate(20px, -22px) rotate(28deg) scale(.72); }
}
@keyframes shatter-south-west {
  to { opacity: 0; transform: translate(-22px, 25px) rotate(22deg) scale(.7); }
}
@keyframes shatter-south-east {
  to { opacity: 0; transform: translate(22px, 26px) rotate(-27deg) scale(.72); }
}
@keyframes celebration-pop {
  from { opacity: 0; transform: translate(-50%, -45%) scale(.68); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

.piece {
  position: absolute;
  z-index: 1;
  left: var(--piece-left);
  top: var(--piece-top);
  width: var(--piece-canvas-size);
  height: var(--piece-canvas-size);
  max-width: none;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
  filter: drop-shadow(0 2px 2px rgba(7, 20, 36, .22));
}

/* Placeholder shown while piece PNGs are still decoding over a slow network.
   Shares the same footprint as .piece so the swap is visually seamless. */
.piece-placeholder {
  position: absolute;
  z-index: 1;
  left: var(--piece-left);
  top: var(--piece-top);
  width: var(--piece-canvas-size);
  height: var(--piece-canvas-size);
  border-radius: 50%;
  background: radial-gradient(circle at 50% 40%, rgba(23, 33, 28, .22), rgba(23, 33, 28, .08) 70%, transparent);
  pointer-events: none;
  animation: piece-pulse .9s ease-in-out infinite;
}

@keyframes piece-pulse {
  0%, 100% { opacity: .4; }
  50% { opacity: .7; }
}

.drag-ghost {
  position: fixed;
  z-index: 9999;
  top: 0;
  left: 0;
  pointer-events: none;
  will-change: transform;
}

.drag-ghost .piece {
  filter: drop-shadow(0 7px 5px rgba(7, 20, 36, .32));
  transform: scale(1.08);
}

.is-dragging-piece,
.is-dragging-piece * {
  cursor: grabbing !important;
  user-select: none;
}

.rank, .file {
  position: absolute;
  color: rgba(23, 33, 28, .62);
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 9px;
  font-weight: 700;
}
.rank { top: 2px; left: 3px; }
.file { right: 3px; bottom: 1px; }
.square.dark .rank,
.square.dark .file { color: rgba(238, 247, 255, .72); }

.coach {
  min-height: 100%;
  padding: 26px;
  display: flex;
  flex-direction: column;
}

.progress {
  display: flex;
  gap: 7px;
  margin-bottom: 20px;
}

.progress span {
  height: 5px;
  flex: 1;
  border-radius: 99px;
  background: var(--paper-deep);
}
.progress span.done { background: var(--forest); }

.status {
  min-height: 116px;
  padding: 18px;
  border-radius: 14px;
  background: var(--forest-soft);
}
.status.error { background: #f0ded8; color: #682b25; }
.status.success { background: #dceadd; color: #16472c; }
.status.alt { background: #f6ecd2; color: #6b4a12; }
.status-label {
  display: block;
  margin-bottom: 4px;
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
}
.status p { margin: 0; }

.coach-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 16px 0 18px;
}

.btn {
  min-height: 42px;
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  text-decoration: none;
}
.btn:hover { background: rgba(23,61,43,.08); }
.btn-primary { border-color: var(--forest); background: var(--forest); color: #fff; }
.btn-primary:hover { background: #245239; }
.ask-row .btn-primary {
  min-width: 88px;
  flex: 0 0 auto;
  white-space: nowrap;
}

.ask-box {
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.ask-box label {
  display: block;
  margin-bottom: 8px;
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 13px;
  font-weight: 700;
}
.quick-questions {
  margin: 0 0 9px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.quick-question {
  min-height: 30px;
  padding: 5px 10px;
  border: 1px solid rgba(23, 61, 43, .24);
  border-radius: 999px;
  background: rgba(255, 255, 255, .42);
  color: var(--forest);
  cursor: pointer;
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 11px;
  white-space: nowrap;
}
.quick-question:hover { background: rgba(23, 61, 43, .08); }

.ask-row { display: flex; gap: 8px; }
.ask-row textarea {
  width: 100%;
  min-width: 0;
  flex: 1 1 auto;
  min-height: 48px;
  max-height: 110px;
  resize: vertical;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255,255,255,.5);
  color: var(--ink);
}
.ai-answer {
  display: none;
  margin-top: 12px;
  padding: 14px 16px;
  border-left: 3px solid var(--forest);
  background: rgba(255,255,255,.42);
}
.ai-answer.show { display: block; }
.ai-answer strong { color: var(--forest); }
.ai-answer .ai-loading {
  display: inline-block;
  min-width: 1em;
  color: var(--muted);
}
.ai-answer .ai-loading::after {
  content: "";
  display: inline-block;
  width: 0.7em;
  height: 0.7em;
  margin-left: 4px;
  border: 2px solid var(--muted);
  border-top-color: transparent;
  border-radius: 50%;
  vertical-align: middle;
  animation: ai-spin 0.8s linear infinite;
}
.ai-answer.loading .ai-loading { color: var(--muted); }
.ai-answer .ai-fallback-note {
  display: block;
  margin-bottom: 4px;
  font-size: 11px;
  color: var(--muted);
  font-weight: 400;
}
@keyframes ai-spin { to { transform: rotate(360deg); } }

/* ask-box 标签行：label 与「AI 设置」入口并排 */
.ask-label-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
}
.coach-settings-toggle {
  font-size: 11px;
  color: var(--muted);
  text-decoration: underline;
}
.coach-settings-toggle:hover { color: var(--forest); }

/* AI 设置面板（全局，默认折叠）*/
.coach-settings-panel { display: none; }
.coach-settings-panel.open {
  display: block;
  position: fixed;
  z-index: 100;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(92vw, 420px);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(7,20,36,.28);
}
.coach-settings-panel.open::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: rgba(7,20,36,.32);
}
.coach-settings-inner { padding: 22px 24px; }
.coach-settings-inner h3 { margin: 0 0 6px; font-size: 17px; }
.coach-settings-hint { margin: 0 0 14px; font-size: 12px; color: var(--muted); line-height: 1.5; }
.coach-settings-panel label {
  display: block;
  margin-bottom: 10px;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
}
.coach-settings-panel input,
.coach-settings-panel select {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  font-size: 13px;
  box-sizing: border-box;
  background: #fff;
  color: var(--ink);
}
.coach-settings-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
}
.coach-settings-actions .btn { min-height: 36px; }
.coach-saved { font-size: 12px; color: var(--forest); }

.lesson {
  max-width: 720px;
  margin: 46px auto;
}
.lesson h2 { font-size: 28px; }
.lesson-steps { padding-left: 22px; }
.lesson-steps li { margin: 12px 0; padding-left: 6px; }
.principle {
  margin-top: 28px;
  padding: 24px;
  background: var(--forest);
  color: #fff;
  border-radius: 16px;
  font-size: 20px;
}

.archive {
  max-width: 900px;
  margin: 66px auto 0;
  padding-top: 40px;
  border-top: 1px solid var(--line);
}
.archive-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; }
.archive h2 { margin: 0; font-size: 30px; }
.archive-grid {
  margin-top: 22px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.archive-card {
  min-height: 180px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255,255,255,.3);
  text-decoration: none;
  transition: transform .18s ease, background .18s ease;
}
.archive-card:hover { transform: translateY(-3px); background: rgba(255,255,255,.62); }
.archive-card time { color: var(--gold); font-family: ui-sans-serif, system-ui, sans-serif; font-size: 12px; }
.archive-card h3 { margin: 14px 0 8px; font-size: 20px; }
.archive-card p { margin: 0; color: var(--muted); font-size: 14px; }
.archive-card .tag { margin-top: auto; padding-top: 16px; color: var(--forest); font-family: ui-sans-serif, system-ui, sans-serif; font-size: 12px; font-weight: 700; }
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 10px; margin-top: 6px; }
.tag-chip {
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--forest-soft);
  color: var(--forest);
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.7;
}

/* 先修课程提示，放在正文叙事之前。 */
.prereq {
  margin: 0 0 18px;
  padding: 10px 14px;
  border-left: 3px solid var(--gold);
  background: rgba(183, 122, 42, .08);
  border-radius: 0 8px 8px 0;
  color: var(--forest);
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 13px;
}
.prereq a { color: var(--gold); font-weight: 600; text-decoration: none; }
.prereq a:hover { text-decoration: underline; }

.site-footer {
  padding: 28px 0 50px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 12px;
  text-align: center;
}

.site-footer .footer-report {
  color: var(--forest);
  text-decoration: underline;
}

.site-footer .footer-report:hover {
  color: #245239;
}

/* 赞赏入口与弹窗样式独立在 assets/donation.css（buy-me-coffee 统一规范） */

@media (max-width: 760px) {
  .page { padding-top: 34px; }
  .challenge { border-radius: 18px; margin-inline: -6px; }
  .challenge-body { grid-template-columns: 1fr; }
  .board-wrap { padding: 16px; }
  .coach { padding: 22px 18px; }
  .archive-grid { grid-template-columns: 1fr; }
  .archive-card { min-height: 0; }
}

@media (max-width: 420px) {
  .header-inner, .page, .site-footer { width: min(100% - 22px, 980px); }
  .header-inner { min-height: 58px; }
  .issue-mark { display: none; }
  .story { font-size: 17px; }
  .challenge-head { padding: 20px 18px 17px; }
  .position-panel { padding-inline: 11px; }
  .material-side small { max-width: 125px; }
  .board { border-width: 5px; }
  .ask-row { align-items: stretch; flex-direction: column; }
  .ask-row .btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
  .king-checked,
  .king-checked .piece,
  .king-checked::before,
  .king-mated::before,
  .king-shattered,
  .king-fragment,
  .move-feedback-ring,
  .move-feedback .piece,
  .piece-placeholder,
  .ai-answer .ai-loading::after,
  .board-celebration { animation-duration: .01ms !important; animation-delay: 0ms !important; }
}
