:root { color-scheme: light; --bg: oklch(98.6% .004 238); --surface: oklch(96% .007 235); --white: oklch(100% 0 0); --ink: oklch(21% .015 240); --text: oklch(36% .016 240); --muted: oklch(47% .014 240); --line: oklch(85% .01 240); --accent: oklch(39% .145 27); --accent-hover: oklch(33% .12 27); --success: oklch(40% .09 155); --success-bg: oklch(96% .025 155); --error-bg: oklch(96% .02 27); --wood: oklch(82% .072 77); --grid: oklch(37% .04 70); --cyan: oklch(48% .075 210); --ease: cubic-bezier(.16,1,.3,1); --s1: .25rem; --s2: .5rem; --s3: .75rem; --s4: 1rem; --s6: 1.5rem; --s8: 2rem; --s12: 3rem; --s16: 4rem; --radius: .5rem; font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif; }
* { box-sizing: border-box; } body { margin: 0; min-width: 320px; background: var(--bg); color: var(--ink); line-height: 1.65; } button,input,select { font: inherit; } button,a,select,input { -webkit-tap-highlight-color: transparent; } a { color: inherit; text-underline-offset: .25em; } button { min-height: 44px; padding: .6rem 1rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); color: var(--ink); font-weight: 600; cursor: pointer; transition: background 180ms var(--ease), border-color 180ms var(--ease), transform 180ms var(--ease); } button:hover:not(:disabled) { border-color: var(--accent); background: var(--surface); } button:active:not(:disabled) { transform: translateY(1px); } button:disabled { opacity: .45; cursor: not-allowed; } :focus-visible { outline: 3px solid var(--cyan); outline-offset: 3px; } h1,h2,h3,p { margin: 0; } h1,h2,h3 { line-height: 1.25; text-wrap: balance; } h1 { font-size: 2.25rem; letter-spacing: -.03em; } h2 { font-size: 1.5rem; } h3 { font-size: 1.125rem; } p { max-width: 70ch; color: var(--text); } p + p { margin-top: var(--s4); } small,.muted { color: var(--muted); } .skip { position: fixed; top: var(--s4); left: var(--s4); z-index: 30; transform: translateY(-200%); background: var(--white); padding: var(--s3); } .skip:focus { transform: none; }
.header { padding: var(--s4) max(var(--s4),calc((100% - 1400px)/2)); background: var(--bg); border-bottom: 1px solid var(--line); } .brand { display: inline-flex; gap: var(--s3); align-items: baseline; text-decoration: none; font-weight: 700; font-size: 1.25rem; } .brand span { color: var(--muted); font-size: .875rem; font-weight: 400; } nav { display: flex; gap: var(--s2); overflow: auto; margin-top: var(--s3); padding-bottom: var(--s1); } nav button { border-color: transparent; background: transparent; white-space: nowrap; font-size: .875rem; padding-inline: var(--s3); } nav button[aria-current="page"] { color: var(--accent); background: var(--surface); border-color: var(--line); }
main { max-width: 1400px; margin: auto; padding: var(--s8) var(--s4) var(--s16); min-height: 70vh; } main:focus { outline: none; } footer { display: flex; flex-wrap: wrap; gap: var(--s3) var(--s6); padding: var(--s6) max(var(--s4),calc((100% - 1400px)/2)); border-top: 1px solid var(--line); color: var(--muted); font-size: .875rem; } .primary { background: var(--accent); color: var(--white); border-color: transparent; } .primary:hover:not(:disabled) { background: var(--accent-hover); color: var(--white); } .actions { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: var(--s6); } .page-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: var(--s4); margin-bottom: var(--s8); } .page-head p { margin-top: var(--s3); } .label { color: var(--accent); font-size: .875rem; font-weight: 700; margin-bottom: var(--s3); }
.home { display: grid; gap: var(--s12); align-items: center; } .home-copy h1 { font-size: 3rem; } .home-copy h1 span { color: var(--accent); display: block; } .home-copy > p { margin-top: var(--s6); } .home-board { position: relative; } .home-board figcaption { text-align: center; color: var(--muted); margin-top: var(--s4); font-size: .875rem; } figure { margin: 0; } .stats { display: flex; flex-wrap: wrap; gap: var(--s4) var(--s8); padding-block: var(--s6); margin-top: var(--s8); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); } .stats div { display: grid; gap: var(--s1); } .stats dt { color: var(--muted); font-size: .875rem; } .stats dd { margin: 0; font-size: 1.25rem; font-weight: 700; font-variant-numeric: tabular-nums; } .path-list { margin-top: var(--s12); border-top: 1px solid var(--line); } .path-item { width: 100%; display: flex; justify-content: space-between; text-align: left; gap: var(--s4); padding: var(--s6) 0; border: 0; border-radius: 0; background: transparent; border-bottom: 1px solid var(--line); } .path-item span { color: var(--muted); font-weight: 400; } .path-item:hover:not(:disabled) { background: var(--surface); }
.course-list { display: grid; gap: var(--s4); } .course-row { display: grid; grid-template-columns: 2.5rem minmax(0,1fr) auto; gap: var(--s4); align-items: center; border-bottom: 1px solid var(--line); padding: var(--s4) 0; } .course-row p { margin-top: var(--s2); } .course-number { color: var(--accent); font-size: 1.25rem; font-variant-numeric: tabular-nums; } .course-row .actions { margin: 0; } .chapter { margin-bottom: var(--s8); } .chapter h2 { margin-bottom: var(--s4); } .exercise-row { display: flex; gap: var(--s4); justify-content: space-between; align-items: center; padding-block: var(--s4); border-bottom: 1px solid var(--line); } .stars { color: var(--accent); letter-spacing: .12em; white-space: nowrap; } .tag { color: var(--success); font-size: .875rem; }
.workspace { display: grid; gap: var(--s6); align-items: start; } .lesson-panel { padding-bottom: var(--s6); border-bottom: 1px solid var(--line); } .lesson-panel h2 { margin-block: var(--s3) var(--s4); } .stepper { display: flex; gap: var(--s3); color: var(--muted); font-size: .875rem; margin-bottom: var(--s6); } .stepper strong { color: var(--accent); } .lesson-panel ol { padding-left: var(--s6); color: var(--text); } .lesson-panel li + li { margin-top: var(--s3); } .board-column { min-width: 0; } .board-wrap { width: 100%; max-width: 640px; margin-inline: auto; } .board-toolbar { display: flex; justify-content: space-between; gap: var(--s3); margin-bottom: var(--s3); color: var(--text); font-size: .875rem; } .board-help { font-size: .875rem; margin-top: var(--s3); } .status-panel { min-width: 0; background: var(--surface); padding: var(--s6); border-radius: var(--radius); } .status-panel h3 { margin-bottom: var(--s4); } .feedback { padding: var(--s4); border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); margin-block: var(--s4); } .feedback p { margin-top: var(--s2); } .feedback.success { border-color: var(--success); background: var(--success-bg); } .feedback.success strong { color: var(--success); } .feedback.error { background: var(--error-bg); border-color: var(--accent); animation: nudge 180ms ease-out; } .feedback.error strong { color: var(--accent); } .feedback p,.status-panel small { font-size: .875rem; } .status-panel .actions { gap: var(--s3); } .status-panel .actions button { flex: 1 1 auto; } .hints { margin-top: var(--s6); padding-top: var(--s4); border-top: 1px solid var(--line); } .hints p { margin-top: var(--s3); font-size: .875rem; } .completion { margin-block: var(--s6); } .completion .stars { display: block; font-size: 2rem; animation: reward 250ms var(--ease); } .completion p { margin-top: var(--s2); } .group-info { margin-block: var(--s4); font-size: .875rem; } .count-answers { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: var(--s4); } .count-answers button { min-width: 44px; } .controls { display: grid; gap: var(--s4); } label { display: grid; gap: var(--s2); font-size: .875rem; color: var(--text); } select,input[type="number"] { width: 100%; min-height: 44px; padding: var(--s2); border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); color: var(--ink); } label.check { display: flex; align-items: center; min-height: 44px; gap: var(--s3); cursor: pointer; } input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--accent); } .history { max-height: 220px; overflow: auto; padding-left: var(--s6); color: var(--text); font-size: .875rem; } .review-controls { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: var(--s4); } .score { width: 100%; border-collapse: collapse; font-size: .875rem; margin-block: var(--s4); } .score th,.score td { text-align: right; padding: var(--s2); border-bottom: 1px solid var(--line); } .score th:first-child { text-align: left; } .rules { max-width: 70ch; } .rules section { margin-bottom: var(--s8); } .rules h2 { margin-bottom: var(--s4); } .storage-warning { background: var(--error-bg); padding: var(--s3); color: var(--accent); font-size: .875rem; margin-bottom: var(--s4); }
.go-board { display: block; width: 100%; height: auto; background: var(--wood); border-radius: var(--radius); touch-action: manipulation; box-shadow: 0 4px 6px oklch(25% .03 70 / .15); user-select: none; } .go-board .grid-line { stroke: var(--grid); stroke-width: 1.25; } .go-board .coordinate { fill: var(--grid); font-family: inherit; font-size: 13px; } .go-board .star-point { fill: var(--grid); } .go-board .hit { fill: transparent; cursor: crosshair; } .go-board .hit:focus-visible { outline: none; stroke: var(--accent); stroke-width: 3px; fill: oklch(100% 0 0 / .25); } .stone { filter: drop-shadow(0 2px 1px oklch(22% .015 70 / .22)); pointer-events: none; } .stone.new { transform-box: fill-box; transform-origin: center; animation: place 180ms var(--ease); } .stone.captured { animation: capture 240ms ease-out forwards; } .last-mark { pointer-events: none; fill: none; stroke: var(--accent); stroke-width: 2.5; } .highlight { pointer-events: none; fill: none; stroke: var(--cyan); stroke-width: 3px; } .liberty-dot { pointer-events: none; fill: var(--cyan); stroke: var(--white); stroke-width: 1.5px; } .answer-ring { pointer-events: none; fill: oklch(100% 0 0 / .25); stroke: var(--accent); stroke-width: 2.5px; } .candidate { pointer-events: none; fill: oklch(100% 0 0 / .2); } .preview { opacity: .5; pointer-events: none; } .atari-ring { stroke: var(--accent); }
@keyframes place { from { transform: scale(0); } to { transform: scale(1); } } @keyframes capture { to { opacity: 0; } } @keyframes nudge { 33% { transform: translateX(-2px); } 66% { transform: translateX(2px); } } @keyframes reward { from { opacity: .4; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media(min-width:768px) { main { padding: var(--s12) var(--s8) var(--s16); } .header { display: flex; justify-content: space-between; align-items: center; gap: var(--s8); } nav { margin-top: 0; } .home { grid-template-columns: 1.1fr 1fr; gap: var(--s16); } .home-board { max-width: 460px; justify-self: end; } .workspace { grid-template-columns: minmax(0,1.7fr) minmax(240px,1fr); } .lesson-panel { grid-column: 1/-1; } .course-list { max-width: 1000px; } }
@media(min-width:1200px) { .workspace { grid-template-columns: minmax(220px,.85fr) minmax(0,2fr) minmax(250px,.95fr); gap: var(--s8); } .lesson-panel { grid-column: auto; border: 0; padding-bottom: 0; } }
@media(max-width:520px) { h1 { font-size: 1.75rem; } .home-copy h1 { font-size: 2.5rem; } .course-row { grid-template-columns: 2rem minmax(0,1fr); } .course-row .actions { grid-column: 2; } .exercise-row { flex-wrap: wrap; } .status-panel { padding: var(--s4); } .path-item { display: grid; } }
@media(prefers-reduced-motion:reduce) { *,*::before,*::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } .stone.captured { opacity: 0; } }

/* Essential teaching copy stays at body size; board coordinates use SVG user-space units. */
:root { --layer-skip: 30; }
body { font-size: 1rem; }
button { padding: var(--s2) var(--s4); }
.skip { z-index: var(--layer-skip); }
.feedback p,.hints p,.group-info,.board-help { font-size: 1rem; }
.board-wrap { overflow: auto; padding-bottom: var(--s1); }
.board-wrap.zoomed .go-board { width: max(100%,var(--board-zoom-width)); max-width: none; }
.precision { margin-top: var(--s4); }
.precision summary, details summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; }
.precision summary::before,details summary::before { content: '+ '; margin-right: var(--s2); color: var(--accent); }
details[open] > summary::before { content: '− '; }
.coordinate-controls { display: flex; align-items: end; flex-wrap: wrap; gap: var(--s3); margin-block: var(--s4); }
.coordinate-controls label { min-width: 4rem; flex: 1; }
.status-panel:focus { outline-offset: 3px; }
.home-board { width: 100%; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.score { font-variant-numeric: tabular-nums; }
.status-panel .feedback { border-width: 0; border-radius: 0; padding-inline: 0; background: transparent; }
.status-panel .feedback.success,.status-panel .feedback.error { padding-inline: var(--s3); }
footer a { min-height: 44px; display: inline-flex; align-items: center; }
@media(min-width:768px) { .header { max-width: 1400px; margin: auto; padding-inline: var(--s8); } }
.confirm-dialog { width: min(420px,calc(100% - 2rem)); padding: var(--s6); border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); color: var(--ink); }
.confirm-dialog::backdrop { background: oklch(21% .015 240 / .45); }
.confirm-dialog p { margin-top: var(--s4); }
