:root {
  color-scheme: dark;
  --bg: #111314;
  --panel: #181b1c;
  --panel-2: #202425;
  --panel-3: #252b2a;
  --line: #343a39;
  --line-soft: #28302e;
  --text: #eef2ee;
  --muted: #a6b0aa;
  --faint: #737d78;
  --wood: #d19a55;
  --wood-dark: #7b4b21;
  --accent: #85d9b2;
  --accent-strong: #b8f4d4;
  --danger: #ff9c87;
  --radius: 8px;
  --mono: "SFMono-Regular", "Cascadia Code", "Roboto Mono", monospace;
  --sans: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(180deg, #151817 0%, #101211 60%, #0d0f0e 100%);
  background-size: 24px 24px, auto;
  color: var(--text);
  font-family: var(--sans);
  letter-spacing: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea {
  font: inherit;
}

.app-shell {
  width: min(1320px, calc(100vw - 28px));
  margin: 0 auto;
  padding: 14px 0 28px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  background: rgba(24, 27, 28, 0.94);
  border-radius: var(--radius);
  padding: 10px;
  position: sticky;
  top: 10px;
  z-index: 20;
  backdrop-filter: blur(10px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-mark {
  display: block;
  width: 40px;
  height: 44px;
  object-fit: contain;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 15px;
}

.brand small {
  color: var(--muted);
  font-size: 12px;
  margin-top: 1px;
}

.nav-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.language-picker select {
  appearance: none;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #202524;
  color: var(--text);
  padding: 8px 28px 8px 10px;
  font: inherit;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
}

.language-picker select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.settings-language-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.language-setting { display: grid; gap: 8px; min-height: 76px; border: 1px solid #d6ded9; border-radius: 8px; padding: 14px; background: #fff; color: #283a31; cursor: pointer; text-align: left; }
.language-setting:hover, .language-setting.active { border-color: #3c9073; background: #eef5f1; }
.language-setting b { color: #3c9073; font: 700 11px var(--mono); }
@media (max-width: 760px) { .settings-language-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.nav-actions a,
.nav-button,
.button {
  border: 1px solid var(--line);
  background: #202524;
  color: var(--text);
  border-radius: 7px;
  padding: 8px 10px;
  font-weight: 650;
  font-size: 13px;
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.12s ease, background 0.12s ease;
}

.nav-actions a:hover,
.nav-button:hover,
.button:hover {
  border-color: #506159;
  background: #26302c;
}

.nav-actions a:active,
.nav-button:active,
.button:active {
  transform: translateY(1px);
}

.primary-link,
.button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #0b1712;
}

.nav-button {
  appearance: none;
}

.main-panel {
  margin-top: 12px;
  border: 1px solid #c5d2ca;
  background: #dfe8e2;
  border-radius: var(--radius);
  overflow: hidden;
  min-height: calc(100dvh - 94px);
}

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px 12px;
  border-bottom: 1px solid #bdcbc3;
  background: linear-gradient(180deg, #eef5f0, #dce7e1);
  color: #15211d;
}

.page-head h1 {
  margin: 0;
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1;
  letter-spacing: 0;
}

.page-head p {
  margin: 6px 0 0;
  color: #4b5c55;
  font-size: 13px;
}

.thread-meta,
.time,
.reply-count {
  color: var(--muted);
  font-size: 12px;
}

.badge {
  display: inline-flex;
  align-items: center;
  height: 18px;
  border-radius: 5px;
  padding: 0 6px;
  background: #d7eee2;
  border: 1px solid #a7d5be;
  color: #1b6547;
  font-family: var(--mono);
  font-size: 11px;
  white-space: nowrap;
}

.study-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.study-tabs a {
  border: 1px solid #b8c8c0;
  background: #f4faf7;
  color: #45554f;
  border-radius: 7px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 700;
  transition: background 0.14s ease, border-color 0.14s ease, color 0.14s ease;
}

.study-tabs a:hover,
.study-tabs a.active {
  border-color: #7db596;
  background: #ccebdd;
  color: #103d2c;
}

.problem-layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 10px; padding: 10px; max-width: 1050px; margin: 0 auto; }
.problem-list { display: grid; align-content: start; gap: 5px; }
.problem-item { display: grid; grid-template-columns: 28px 1fr; grid-template-rows: auto auto; gap: 1px 8px; padding: 9px 10px; text-align: left; border: 1px solid #c1d0c8; border-radius: 7px; background: #f4f8f5; color: #20302a; cursor: pointer; }
.problem-item span { grid-row: span 2; color: #638074; font: 12px var(--mono); padding-top: 2px; }
.problem-item strong { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.problem-item small { color: #718078; font-size: 12px; }
.problem-item.active { border-color: #4caa7c; background: #d9f0e3; box-shadow: inset 3px 0 #369666; }
.problem-stage { min-width: 0; border: 1px solid #bdcbc3; border-radius: 8px; background: #f4f8f5; overflow: hidden; }
.problem-toolbar, .problem-actions { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 12px; color: #23342c; font-size: 12px; }
.problem-toolbar { border-bottom: 1px solid #d2ded7; }
.problem-toolbar span { color: #718078; }
.problem-board { width: min(100%, 590px); margin: 12px auto 4px; padding: 0 12px; }
.problem-board-svg { display: block; width: 100%; height: auto; overflow: visible; }
.problem-board-svg rect { fill: #d19a55; }
.problem-board-svg line { stroke: #75491f; stroke-width: 1; }
.problem-board-svg .star { fill: #75491f; }
.problem-stone { stroke: rgba(0,0,0,.2); stroke-width: 1; pointer-events: none; }
.problem-stone.black { fill: #17201d; } .problem-stone.white { fill: #f4f1e8; }
.answer-point { fill: transparent; cursor: pointer; } .answer-point:hover { fill: rgba(255,255,255,.35); }
.answer-mark { fill: none; stroke: #e8fff2; stroke-width: 2.5; pointer-events: none; }
.problem-board .go-board-svg { box-shadow: inset 0 0 18px rgba(81, 42, 12, 0.35); }
.problem-board .answer-point { stroke: none; }
.svg-candidate { cursor: pointer; outline: none; }
.svg-candidate circle { fill: var(--go-board-candidate); stroke: rgba(96,54,36,.55); stroke-width: 1.4; filter: drop-shadow(0 2px 2px rgba(40,24,12,.28)); }
.svg-candidate.best circle { fill: var(--go-board-candidate-best); stroke: #007e91; }
.svg-candidate.selected circle { stroke: #fff57a; stroke-width: 4; }
.svg-candidate text { fill: #2f1c14; font-weight: 850; pointer-events: none; }
.svg-candidate .candidate-rank { font-size: 12px; }
.svg-candidate .candidate-winrate { font-size: 10px; }
.svg-candidate .candidate-score { font-size: 9.5px; }
.svg-candidate.answer-choice { cursor: pointer; }
.svg-candidate.answer-choice .candidate-hit-area { fill: transparent; stroke: none; }
.svg-candidate .candidate-option { fill: #2f6fa8; font: 600 16px var(--mono); pointer-events: none; }
.svg-candidate.answer-choice.selected .candidate-option { font-weight: 850; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.svg-candidate.candidate-detail { pointer-events: auto; }
.svg-candidate.candidate-detail circle { fill: rgba(216, 126, 76, .86); stroke: #bd6031; }
.svg-candidate.candidate-detail.best circle { fill: rgba(66, 182, 196, .9); stroke: #14798a; }
.svg-candidate.candidate-detail.focused circle { stroke: #fff7b0; stroke-width: 4; transform-box: fill-box; transform-origin: center; transform: scale(1.18); }
.svg-candidate.candidate-detail .candidate-rank { fill: #c8333c; font-size: 13px; }
.svg-candidate.candidate-detail .candidate-primary { fill: #1e2e2a; font-family: var(--mono); font-size: 12px; font-weight: 850; }
.svg-preview-stone { pointer-events: none; opacity: .62; }
.svg-preview-stone circle { fill: none; stroke: #25332d; stroke-dasharray: 5 4; stroke-width: 2.2; }
.svg-preview-stone.black circle { fill: rgba(25, 34, 30, .25); }
.svg-preview-stone.white circle { fill: rgba(255, 255, 255, .42); }
.svg-preview-stone text { fill: #24342d; font: 850 12px var(--mono); }
.problem-actions { border-top: 1px solid #d2ded7; background: #edf5f0; }
.problem-actions .button { margin-left: 5px; padding: 6px 10px; }
.answer-feedback { color: #687a70; font-size: 12px; } .answer-feedback.good { color: #187347; font-weight: 700; } .answer-feedback.bad { color: #b34f3e; font-weight: 700; }
.answer-feedback.partial { color: #8a6418; font-weight: 700; }
.compact-empty { padding: 48px 20px; }
@media (max-width: 700px) { .problem-layout { grid-template-columns: 1fr; } .problem-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } .problem-actions { align-items: flex-start; flex-direction: column; } }

/* Dense problem library: navigation and training data stay above the fold. */
.problem-library {
  min-height: calc(100dvh - 94px);
  background: #e7ede8;
  color: #17251f;
}
.library-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 24px;
  padding: 22px 26px 17px;
  border-bottom: 1px solid #b8c6be;
  background:
    radial-gradient(circle at 82% -30%, rgba(121, 161, 139, .24), transparent 36%),
    #eef3ef;
}
.library-eyebrow { color: #426b58; font: 750 11px var(--mono); letter-spacing: .13em; }
.library-head h1 { margin: 2px 0 3px; font-size: clamp(27px, 3vw, 38px); line-height: 1; letter-spacing: -.04em; }
.library-head p { margin: 0; color: #607068; font-size: 12px; }
.library-summary { display: flex; border: 1px solid #bcc9c2; background: rgba(255,255,255,.48); }
.library-summary span { min-width: 92px; padding: 8px 12px; border-left: 1px solid #cbd5cf; color: #66766e; font-size: 11px; }
.library-summary span:first-child { border-left: 0; }
.library-summary b { display: block; color: #20332a; font: 750 18px var(--mono); }
.library-tabs { display: flex; align-items: center; min-height: 39px; padding: 0 20px; border-bottom: 1px solid #bac8c0; background: #dbe4de; }
.library-tabs button { align-self: stretch; border: 0; border-bottom: 2px solid transparent; padding: 0 13px; background: transparent; color: #52645b; font-size: 12px; font-weight: 700; cursor: pointer; }
.library-tabs button:hover:not(:disabled), .library-tabs button.active { border-bottom-color: #28694f; background: rgba(255,255,255,.42); color: #183c2d; }
.library-tabs button:focus-visible, .rank-entry:focus-visible, .training-panel button:focus-visible, .problem-back:focus-visible { outline: 2px solid #277b59; outline-offset: -2px; }
.library-tabs button:disabled { color: #87938d; cursor: default; }
.library-tabs small { margin-left: 3px; font: 11px var(--mono); }
.library-grid { display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 12px; max-width: 1240px; margin: 0 auto; padding: 12px 16px 22px; }
.rank-panel, .today-block, .service-table, .library-note { border: 1px solid #b9c7bf; background: #f4f7f4; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; min-height: 39px; padding: 7px 11px; border-bottom: 1px solid #c9d3cd; background: #eaf0ec; color: #65746d; font-size: 11px; }
.panel-heading div { display: flex; align-items: baseline; gap: 8px; }
.panel-heading strong { color: #203129; font-size: 13px; }
.panel-heading div span { font: 11px var(--mono); letter-spacing: .08em; }
.rank-list { display: grid; }
.rank-entry { position: relative; display: grid; grid-template-columns: 34px 100px 72px minmax(140px, 1fr) 66px 22px; align-items: center; min-height: 72px; border: 0; border-bottom: 1px solid #d4ddd8; padding: 0 12px; background: #f7f9f7; color: #22342b; text-align: left; cursor: pointer; transition: background .15s ease, transform .15s ease; }
.rank-entry:last-child { border-bottom: 0; }
.rank-entry::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 5px; background: #23372d; }
.rank-entry.pine::before { background: #39745a; }
.rank-entry.moss::before { background: #6f8e58; }
.rank-entry.clay::before { background: #a56b45; }
.rank-entry.sand::before { background: #c59b54; }
.rank-entry:hover:not(:disabled) { z-index: 1; background: #e4eee8; transform: translateX(3px); }
.rank-entry:active:not(:disabled) { transform: translateX(5px); }
.rank-entry:disabled { opacity: .48; cursor: default; }
.rank-index { color: #829087; font: 11px var(--mono); }
.rank-entry strong { font-size: 20px; letter-spacing: -.03em; }
.rank-entry b { color: #355345; font: 750 16px var(--mono); }
.rank-entry small { color: #708078; font-size: 12px; }
.rank-count { color: #23382e; font: 750 17px var(--mono); text-align: right; }
.rank-count i { margin-left: 2px; color: #76857d; font: normal 12px var(--sans); }
.rank-arrow { color: #46715c; font-size: 19px; text-align: right; }
.unranked-row { display: grid; grid-template-columns: 110px 1fr auto; gap: 10px; width: 100%; border: 0; border-top: 1px dashed #bcc9c2; padding: 10px 13px; background: #eef3ef; color: #30463b; text-align: left; cursor: pointer; }
.unranked-row:hover { background: #e2ece6; }
.unranked-row small { color: #75837c; }
.unranked-row b { font-size: 12px; }
.training-panel { display: grid; align-content: start; gap: 10px; }
.daily-progress { height: 4px; background: #d7e0db; }
.daily-progress i { display: block; height: 100%; background: #33785a; }
.today-block > button { display: flex; align-items: center; justify-content: space-between; width: 100%; border: 0; padding: 11px 12px; background: #254d3b; color: #eff9f3; text-align: left; cursor: pointer; }
.today-block > button:hover { background: #1e5c43; }
.today-block > button span { display: grid; gap: 2px; }
.today-block > button small { color: #bad1c5; font-size: 11px; }
.today-block > button > strong { font-size: 20px; }
.service-table > button { display: grid; grid-template-columns: 86px 1fr auto; align-items: center; width: 100%; min-height: 44px; border: 0; border-bottom: 1px solid #d6ded9; padding: 6px 10px; background: transparent; color: #283a31; text-align: left; cursor: pointer; }
.service-table > button:last-child { border-bottom: 0; }
.service-table > button:hover:not(:disabled) { background: #e1ece5; }
.service-table > button:disabled { color: #78867f; cursor: default; }
.service-table button span { font-size: 12px; font-weight: 700; }
.service-table button small { color: #77857e; font-size: 11px; }
.service-table button b { color: #38654f; font: 11px var(--mono); }
.library-note { padding: 10px 12px; }
.library-note strong { font-size: 12px; }
.library-note p { margin: 4px 0 0; color: #67766f; font-size: 11px; line-height: 1.55; }

/* Puzzle workspace: board first, controls second. */
.problem-workspace { min-height: calc(100dvh - 94px); background: #dfe8e2; color: #18251f; }
.problem-topline { height: 58px; display: flex; align-items: center; justify-content: space-between; padding: 0 22px; border-bottom: 1px solid #bdcbc3; background: #edf5f0; }
.problem-topline > div { display: flex; align-items: baseline; gap: 8px; }
.problem-back { border: 0; border-right: 1px solid #bdcbc3; padding: 4px 11px 4px 0; background: transparent; color: #41564c; font-size: 12px; font-weight: 750; cursor: pointer; }
.problem-back:hover { color: #146044; }
.problem-kicker { color: #6352aa; font-weight: 750; }
.problem-topline strong { font-size: 13px; font-weight: 650; }
.problem-next { border: 0; border-radius: 999px; padding: 9px 15px; background: #0fa477; color: #fff; font-weight: 800; cursor: pointer; box-shadow: 0 2px 8px rgba(15, 164, 119, .24); }
.problem-next span { margin-left: 6px; font-size: 16px; }
.problem-next:disabled { cursor: default; opacity: .45; }
.problem-top-actions { display: flex; align-items: center; gap: 7px; }
.problem-top-actions .button { padding: 8px 11px; }
.exam-clock { min-width: 72px; margin-left: 8px; border-radius: 6px; padding: 5px 8px; background: #1c2c25; color: #d9fff0; font: 800 17px var(--mono); text-align: center; }
.exam-builder { display: grid; grid-template-columns: minmax(220px, 1fr) auto auto auto; align-items: end; gap: 12px; padding: 11px 22px; border-bottom: 1px solid #bdcbc3; background: #f4f8f5; }
.exam-builder > div { display: grid; gap: 2px; }
.exam-builder > div strong { font-size: 14px; }
.exam-builder > div span { color: #6d7c74; font-size: 12px; }
.exam-builder label { display: grid; grid-template-columns: auto auto; align-items: center; gap: 4px 6px; color: #607168; font-size: 12px; }
.exam-builder select, .exam-builder input { grid-column: 1; width: 108px; height: 32px; border: 1px solid #b8c9c0; border-radius: 5px; background: #fff; color: #24362e; padding: 4px 7px; }
.exam-builder label > span { grid-column: 2; grid-row: 2; }
.problem-workspace .problem-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; max-width: 1370px; padding: 18px 22px 24px; }
.problem-workspace .problem-stage { border: 0; background: transparent; overflow: visible; }
.problem-workspace .problem-board { width: min(100%, 760px); margin: 0 auto; padding: 0; }
.problem-workspace .go-board-svg { border-radius: 12px; box-shadow: 0 5px 0 #a87332, 0 14px 28px rgba(67, 50, 28, .18); }
.problem-rail { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.problem-title, .problem-interaction, .problem-controls, .problem-queue { border: 1px solid #c5d0ca; background: rgba(249, 251, 249, .86); }
.problem-title { padding: 13px 14px 10px; }
.problem-title-line { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.problem-title h1 { margin: 0; color: #1d3127; font-size: 20px; line-height: 1; letter-spacing: -.025em; }
.problem-title-line span { color: #697970; font: 12px var(--mono); white-space: nowrap; }
.problem-previous { display: flex; justify-content: space-between; gap: 8px; margin-top: 10px; padding-top: 9px; border-top: 1px solid #dce4df; color: #7a8981; font-size: 12px; }
.problem-previous strong { overflow: hidden; color: #3b5146; font-weight: 750; text-overflow: ellipsis; white-space: nowrap; }
.problem-progress { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 8px; height: 4px; margin-top: 10px; background: #dce6df; }
.problem-progress i { display: block; height: 100%; background: #28684e; }
.problem-progress span { align-self: center; margin-top: -1px; color: #64746c; font: 11px var(--mono); }
.problem-interaction { padding: 10px; }
.problem-guidance { padding: 0 2px 8px; color: #7a8881; font-size: 12px; }
.answer-feedback { font-size: 12px; } .answer-feedback.good { color: #176d4d; } .answer-feedback.bad { color: #a94c3c; } .answer-feedback.partial { color: #866016; }
.problem-answer { display: grid; grid-template-columns: 86px minmax(0, 1fr); align-items: center; gap: 8px; border: 1px solid #d1dbd5; padding: 9px 10px; background: #fff; }
.problem-answer > div { display: grid; gap: 2px; }
.problem-answer span { color: #77877f; font: 11px var(--mono); letter-spacing: .06em; text-transform: uppercase; }
.problem-answer strong { color: #34483d; font-size: 13px; }
.problem-answer b { overflow: hidden; color: #65766d; font: 12px var(--mono); text-align: right; text-overflow: ellipsis; white-space: nowrap; }
.problem-answer.correct { border-color: #78ba9b; background: #edf8f1; }.problem-answer.correct strong { color: #176c4c; }
.problem-answer.wrong { border-color: #daa295; background: #fff4f0; }.problem-answer.wrong strong { color: #a64b3b; }
.problem-answer.partial { border-color: #d8b36c; background: #fff9ec; }.problem-answer.partial strong { color: #886119; }
.problem-controls { display: grid; gap: 7px; padding: 9px; }
.problem-submit { min-height: 38px; border: 1px solid #1c593f; background: #245d45; color: #f5fbf7; font-size: 13px; font-weight: 800; cursor: pointer; transition: background .15s ease, transform .15s ease; }
.problem-submit:hover:not(:disabled) { background: #176e4c; }.problem-submit:active:not(:disabled) { transform: translateY(1px); }
.problem-submit:disabled { border-color: #d4ddd8; background: #e5eae7; color: #98a49e; cursor: default; }
.problem-mode { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.problem-mode button, .problem-actions button { min-height: 31px; border: 1px solid #cbd6d0; background: transparent; color: #52635a; cursor: pointer; font-size: 12px; font-weight: 750; }
.problem-mode button:disabled { opacity: .5; cursor: default; }
.problem-workspace .problem-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 0; background: transparent; border: 0; }
.problem-actions button:hover:not(:disabled) { border-color: #8ca99b; background: #edf4ef; }.problem-actions button:disabled { opacity: .45; cursor: default; }
.problem-workspace .answer-toggle.active { border-color: #5f9c80; background: #e1f1e7; color: #176c52; }
.candidate-analysis { border: 1px solid rgba(189,203,195,.85); background: rgba(246,250,247,.82); min-height: 0; }
.candidate-analysis-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px 8px; border-bottom: 1px solid #d6e0da; }
.candidate-analysis-head div { display: flex; align-items: baseline; gap: 7px; }
.candidate-analysis-head strong { font-size: 18px; }
.candidate-analysis-head span { color: #728078; font-size: 12px; }
.candidate-analysis-head > b { border-radius: 5px; padding: 4px 7px; background: #d8eee3; color: #146044; font-size: 12px; }
.candidate-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: #d6e0da; border-bottom: 1px solid #d6e0da; }
.candidate-metrics span { display: grid; gap: 2px; padding: 7px 8px; background: #f3f8f5; color: #718078; font-size: 11px; }
.candidate-metrics strong { color: #253a31; font-size: 12px; }
.candidate-pv { display: grid; gap: 4px; padding: 8px 10px; border-bottom: 1px solid #d6e0da; }
.candidate-pv span { color: #718078; font-size: 11px; }
.candidate-pv code { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #33473e; font-size: 11px; }
.candidate-list { display: grid; max-height: 178px; overflow: auto; }
.candidate-row { display: grid; grid-template-columns: 24px 1fr 38px 42px; align-items: center; gap: 5px; border: 0; border-bottom: 1px solid #e0e7e3; padding: 6px 9px; background: transparent; color: #30433a; text-align: left; cursor: pointer; }
.candidate-row:last-child { border-bottom: 0; }
.candidate-row:hover, .candidate-row.active { background: #dcefe5; }
.candidate-row span { color: #76867e; font: 11px var(--mono); }
.candidate-row strong { font-size: 12px; }
.candidate-row b { color: #176b50; font-size: 12px; }
.candidate-row small { color: #697970; font-size: 11px; text-align: right; }
.problem-queue { overflow: hidden; }
.queue-heading { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 38px; border: 0; padding: 0 11px; background: #f4f7f5; color: #2d4237; cursor: pointer; text-align: left; }
.queue-heading:hover { background: #e9f0eb; }.queue-heading span { color: #728078; font: 11px var(--mono); }
.queue-items { max-height: 220px; overflow: auto; padding: 5px 8px 8px; border-top: 1px solid #d6e0da; }
.problem-workspace .problem-item { grid-template-columns: 26px 1fr; margin-top: 5px; padding: 7px 8px; border-color: #d0dcd5; background: rgba(255,255,255,.48); }
.problem-workspace .problem-item.active { border-color: #4caa7c; background: #d9f0e3; }
.problem-workspace .problem-item.answered { box-shadow: inset 3px 0 #2f9d72; }
.exam-summary-page { max-width: 920px; margin: 0 auto; padding: 24px 18px 36px; color: #21332b; }
.exam-summary-head { display: flex; align-items: center; justify-content: space-between; padding: 22px 24px; border: 1px solid #b8c9c0; border-radius: 9px 9px 0 0; background: #f2f8f4; }
.exam-summary-head span { color: #5a6e64; font-size: 12px; font-weight: 750; }
.exam-summary-head h1 { margin: 4px 0; font-size: 32px; }
.exam-summary-head p { margin: 0; color: #697970; font-size: 12px; }
.exam-summary-head > strong { color: #16805a; font-size: 52px; line-height: 1; }
.exam-stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid #b8c9c0; border-top: 0; background: #d3dfd8; gap: 1px; }
.exam-stat-grid div { display: grid; gap: 3px; padding: 12px 16px; background: #f7faf8; }
.exam-stat-grid span { color: #708078; font-size: 12px; }
.exam-stat-grid strong { font-size: 22px; }
.exam-result-list { margin-top: 12px; border: 1px solid #b8c9c0; background: #f7faf8; }
.exam-result-heading { display: flex; justify-content: space-between; padding: 10px 12px; border-bottom: 1px solid #d6e0da; }
.exam-result-heading span { color: #718078; font-size: 12px; }
.exam-result-row { display: grid; grid-template-columns: 34px minmax(120px, 1fr) 100px 100px 52px; align-items: center; gap: 8px; padding: 9px 12px; border-bottom: 1px solid #e0e7e3; }
.exam-result-row:last-child { border-bottom: 0; }
.exam-result-row > span { color: #718078; font: 12px var(--mono); }
.exam-result-row > strong { font-size: 13px; }
.exam-result-row small { color: #697970; font-size: 12px; }
.exam-result-row > b { text-align: right; color: #257455; font-size: 12px; }
.exam-result-row.wrong > b, .exam-result-row.unanswered > b { color: #b25a48; }
.exam-summary-actions { display: flex; justify-content: flex-end; margin-top: 12px; }
@media (max-width: 900px) { .problem-workspace .problem-layout { grid-template-columns: minmax(0, 1fr) 290px; gap: 12px; padding-inline: 12px; } }
@media (max-width: 680px) { .problem-topline { height: auto; min-height: 58px; padding: 8px 12px; } .problem-topline, .problem-topline > div { align-items: center; } .exam-builder { grid-template-columns: 1fr 1fr; padding-inline: 12px; } .exam-builder > div { grid-column: 1 / -1; } .problem-workspace .problem-layout { grid-template-columns: 1fr; } .problem-rail { order: -1; } .problem-queue { max-height: 150px; } .exam-result-row { grid-template-columns: 26px 1fr 50px; } .exam-result-row small { display: none; } .exam-summary-head > strong { font-size: 38px; } }
@media (max-width: 820px) {
  .library-head { grid-template-columns: 1fr; gap: 12px; padding: 17px 16px 13px; }
  .library-summary { width: 100%; }
  .library-summary span { flex: 1; min-width: 0; }
  .library-grid { grid-template-columns: 1fr; padding-inline: 10px; }
  .training-panel { grid-template-columns: 1fr 1fr; }
  .library-note { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .library-tabs { overflow-x: auto; padding: 0 6px; }
  .library-tabs button { flex: 0 0 auto; padding-inline: 10px; }
  .rank-entry { grid-template-columns: 25px 88px 58px 1fr 20px; min-height: 62px; padding-inline: 8px; }
  .rank-entry strong { font-size: 17px; }
  .rank-entry b { font-size: 13px; }
  .rank-entry small { display: none; }
  .rank-count { font-size: 13px; }
  .rank-arrow { font-size: 16px; }
  .training-panel { grid-template-columns: 1fr; }
  .library-note { grid-column: auto; }
  .unranked-row { grid-template-columns: 1fr auto; }
  .unranked-row small { display: none; }
}

.dingshi-library,
.dingshi-detail {
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 48px;
}

.dingshi-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--line);
  padding: 20px 4px 24px;
}

.dingshi-hero h1,
.dingshi-detail-head h1 {
  margin: 5px 0 8px;
  font-size: clamp(32px, 5vw, 58px);
  letter-spacing: -.045em;
}

.dingshi-hero p,
.dingshi-detail-head p {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.eyebrow {
  color: var(--accent);
  font: 700 12px var(--mono);
  letter-spacing: .16em;
}

.dingshi-stone-mark {
  display: flex;
  align-items: center;
  padding: 16px;
}

.dingshi-stone-mark i {
  width: 42px;
  height: 42px;
  margin-left: -9px;
  border: 1px solid #24363a;
  border-radius: 50%;
  background: #11191b;
  box-shadow: 0 7px 14px rgba(20, 34, 37, .18);
}

.dingshi-stone-mark i:nth-child(2) {
  background: #f7faf9;
}

.dingshi-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.dingshi-card {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 14px;
  background: var(--panel);
  color: inherit;
  text-decoration: none;
  transition: border-color .18s ease, transform .18s ease;
}

.dingshi-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.dingshi-card-board {
  align-self: center;
  overflow: hidden;
  border-radius: 6px;
}

.dingshi-card-board .go-board-svg {
  display: block;
  width: 100%;
  height: auto;
}

.dingshi-card-copy {
  min-width: 0;
}

.dingshi-card-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font: 12px var(--mono);
}

.dingshi-card h2 {
  margin: 18px 0 7px;
  font-size: 22px;
}

.dingshi-card p {
  display: -webkit-box;
  overflow: hidden;
  margin: 0 0 16px;
  color: var(--muted);
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.dingshi-card small {
  color: var(--muted);
}

.dingshi-detail-head {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr) auto;
  align-items: end;
  gap: 22px;
  margin-bottom: 22px;
}

.dingshi-detail-head > a {
  align-self: start;
  color: var(--accent);
  text-decoration: none;
}

.dingshi-detail-head dl {
  display: flex;
  gap: 18px;
  margin: 0;
}

.dingshi-detail-head dl div {
  display: grid;
  gap: 3px;
}

.dingshi-detail-head dt {
  color: var(--muted);
  font-size: 12px;
}

.dingshi-detail-head dd {
  margin: 0;
  font-weight: 800;
}

.dingshi-viewer-layout {
  display: grid;
  grid-template-columns: minmax(0, 760px) minmax(260px, 1fr);
  gap: 18px;
  align-items: start;
}

.dingshi-board-stage,
.dingshi-analysis-rail > section,
.dingshi-variation-strip {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.dingshi-board-stage {
  padding: 12px;
}

.dingshi-board-stage .go-board-svg {
  display: block;
  width: 100%;
  height: auto;
}

.dingshi-move-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding-top: 11px;
}

.dingshi-move-controls button,
.dingshi-variation-strip button {
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 7px 10px;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.dingshi-move-controls button:disabled {
  cursor: default;
  opacity: .35;
}

.dingshi-move-controls span {
  min-width: 155px;
  color: var(--muted);
  text-align: center;
  font: 12px var(--mono);
}

.dingshi-analysis-rail {
  display: grid;
  gap: 12px;
}

.dingshi-analysis-rail > section {
  padding: 16px;
}

.dingshi-evaluation > span,
.dingshi-candidates h2 {
  display: block;
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 12px;
}

.dingshi-evaluation > strong {
  display: block;
  color: var(--accent);
  font-size: 25px;
}

.dingshi-evaluation > div {
  display: flex;
  gap: 16px;
  margin-top: 8px;
  color: var(--muted);
  font: 12px var(--mono);
}

.dingshi-candidates .candidate-table {
  margin: 0;
}

.dingshi-variation-strip {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 16px;
  margin-top: 16px;
  padding: 14px;
}

.dingshi-variation-strip > div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.dingshi-variation-strip button.active {
  border-color: var(--accent);
  background: var(--accent);
  color: white;
}

@media (max-width: 920px) {
  .dingshi-card-grid,
  .dingshi-viewer-layout {
    grid-template-columns: 1fr;
  }

  .dingshi-detail-head {
    grid-template-columns: 1fr;
  }

  .dingshi-detail-head dl {
    flex-wrap: wrap;
  }
}

@media (max-width: 620px) {
  .dingshi-card {
    grid-template-columns: 112px minmax(0, 1fr);
  }

  .dingshi-card h2 {
    margin-top: 10px;
    font-size: 18px;
  }

  .dingshi-stone-mark {
    display: none;
  }

  .dingshi-move-controls {
    flex-wrap: wrap;
  }
}

/* Full-screen answering workspace — intentionally separate from the forum shell. */
body.problem-solving {
  background: #f8f6fc;
  color: #24232a;
}
body.problem-solving .app-shell { width: 100%; margin: 0; padding: 0; }
body.problem-solving .topbar { display: none; }
body.problem-solving .main-panel { min-height: 100dvh; margin: 0; border: 0; border-radius: 0; background: transparent; overflow: visible; }
.problem-solving .problem-workspace {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  min-height: 100dvh;
  background: #f8f6fc;
  color: #2b2930;
}
.problem-side-nav {
  display: flex;
  position: sticky;
  top: 0;
  flex-direction: column;
  height: 100dvh;
  border-right: 1px solid #e0dde8;
  padding: 35px 16px 22px;
  background: #fbfaff;
}
.solve-brand { display: grid; gap: 4px; padding: 0 19px 46px; color: #201f25; }
.solve-brand strong { font: 700 28px/1 Georgia, "Songti SC", serif; letter-spacing: -.05em; }
.solve-brand small { color: #77737f; font: 700 11px var(--mono); letter-spacing: .08em; }
.solve-nav-main, .solve-nav-bottom { display: grid; gap: 5px; }
.solve-nav-main a, .solve-nav-main button, .solve-nav-bottom a, .solve-nav-bottom button {
  border: 0;
  border-radius: 4px;
  padding: 13px 18px;
  background: transparent;
  color: #6b6872;
  font-size: 18px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}
.solve-nav-main button.active { background: #f0eef4; color: #1e1c22; box-shadow: inset 3px 0 #242128; }
.solve-nav-main a:hover, .solve-nav-main button:hover:not(.active), .solve-nav-bottom a:hover, .solve-nav-bottom button:hover { background: #f4f1f7; color: #242128; }
.solve-nav-bottom { margin-top: auto; border-top: 1px solid #e4e1e9; padding-top: 14px; }
.problem-solve-shell { min-width: 0; display: grid; grid-template-rows: 76px auto minmax(0, 1fr); }
.problem-solving .problem-topline {
  grid-row: 1;
  height: 76px;
  padding: 0 28px;
  border-bottom: 1px solid #e0dde8;
  background: rgba(253,252,255,.92);
}
.problem-solving .problem-topline > div { gap: 13px; }
.problem-solving .problem-kicker { color: #38333f; font: 700 12px var(--mono); letter-spacing: .06em; }
.problem-solving .problem-topline strong { color: #85818d; font: 700 12px var(--mono); }
.problem-solving .problem-back { border-right: 1px solid #e0dde8; color: #4d4854; }
.problem-solving .problem-top-actions .button { border-color: #d5d1dc; border-radius: 4px; background: #fff; color: #38343d; }
.problem-solving .problem-topline { min-height: 64px; height: auto; }
.problem-solving .problem-back { font-size: 15px; }
.problem-solving .problem-kicker { font-size: 15px; }
.problem-solving .problem-topline strong { font-size: 15px; }
.problem-solving .problem-next { border: 1px solid #28252c; border-radius: 4px; background: #fff; color: #29262d; box-shadow: none; }
.problem-solving .exam-builder { grid-row: 2; padding: 10px 28px; border-bottom: 1px solid #e0dde8; background: #fcfbff; }
.problem-solving .problem-layout {
  grid-row: 3;
  grid-template-columns: minmax(0, 1fr) 390px;
  gap: 0;
  max-width: none;
  min-height: 0;
  padding: 0;
}
.problem-solving .problem-stage {
  display: grid;
  grid-template-rows: minmax(0,1fr) auto;
  min-height: 0;
  border-right: 1px solid #e0dde8;
  background: #f5f3fb;
}
.problem-solving .problem-board { align-self: center; width: min(82vh, calc(100vw - 620px)); max-width: 900px; margin: 0 auto; padding: 12px; }
.problem-solving .go-board-svg { border-radius: 2px; box-shadow: 0 12px 28px rgba(72, 56, 33, .2); }
.board-caption { display: flex; justify-content: center; gap: 7px; padding: 0 0 32px; }
.board-caption span { border: 1px solid #d8d4de; border-radius: 5px; padding: 7px 13px; background: #fff; color: #5c5762; font: 700 11px var(--mono); letter-spacing: .04em; }
.board-caption span:first-child { border-color: #26232a; background: #26232a; color: #fff; }
.problem-solving .problem-rail { gap: 0; overflow-y: auto; background: #fcfbff; }
.problem-solving .problem-title, .problem-solving .problem-interaction, .problem-solving .problem-controls, .problem-solving .problem-queue, .problem-solving .candidate-analysis { border: 0; border-bottom: 1px solid #e0dde8; background: transparent; }
.problem-solving .problem-title { padding: 24px 42px 20px; }
.problem-solving .problem-title-line { display: block; }
.problem-solving .problem-title h1 { color: #1e1b22; font: 650 24px/1.1 var(--sans); letter-spacing: -.02em; }
.problem-solving .problem-title-line span { display: block; margin-top: 8px; color: #706b76; font: 16px var(--mono); letter-spacing: .06em; }
.problem-solving .problem-previous { margin-top: 26px; padding: 0; border: 0; border-radius: 4px; background: #f3f1f6; padding: 12px 13px; color: #77727e; font: 700 12px var(--mono); }
.problem-solving .problem-previous { font-size: 13px; }
.problem-solving .problem-previous strong { color: #514c58; }
.problem-solving .problem-progress { grid-template-columns: minmax(0, 1fr) auto; height: 16px; margin: 10px 0 0; width: 100%; background: transparent; }
.problem-solving .problem-progress i { align-self: end; height: 3px; background: #26232a; }
.problem-solving .problem-progress span { position: static; margin: 0 0 0 8px; color: #5e5964; font-size: 12px; }
.problem-solving .problem-interaction { padding: 25px 42px 22px; min-height: 0; }
.problem-solving .problem-guidance { padding: 0 0 18px; color: #a29da8; font-size: 12px; }
.problem-solving .problem-answer { grid-template-columns: 1fr; gap: 10px; border: 1px dashed #cec9d3; border-radius: 7px; padding: 14px; background: #fff; }
.problem-solving .problem-answer > div { grid-template-columns: auto 1fr; align-items: center; gap: 10px; }
.problem-solving .problem-answer span { color: #252229; font: 800 14px var(--mono); letter-spacing: .1em; }
.problem-solving .problem-answer strong { color: #6d6873; font-size: 14px; }
.problem-solving .problem-answer b { color: #8b8591; text-align: left; }
.problem-solving .problem-answer.correct, .problem-solving .problem-answer.wrong, .problem-solving .problem-answer.partial { border-style: solid; }
.problem-b-choices { border-bottom: 1px solid #e0dde8; padding: 20px 42px 24px; }
.problem-b-choices > div:first-child { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 11px; }.problem-b-choices > div:first-child strong { font: 800 12px var(--mono); letter-spacing: .08em; }.problem-b-choices > div:first-child span { color: #918b97; font-size: 11px; }
.answer-choice-list { display: grid; grid-template-columns: 1fr; gap: 7px; }.answer-choice-row { display: grid; grid-template-columns: 24px 48px 60px minmax(74px, 1fr) minmax(74px, 1fr); align-items: center; column-gap: 8px; row-gap: 3px; border: 1px solid #dad6e0; border-radius: 4px; padding: 9px 11px; background: #fff; color: #514b58; cursor: pointer; text-align: left; }.answer-choice-row:hover:not(:disabled) { border-color: #3e7b60; background: #f1f8f4; }.answer-choice-row.selected { border-color: #176c4c; background: #e7f4ec; box-shadow: inset 3px 0 #176c4c; }.answer-choice-row:disabled { cursor: default; opacity: .86; }.answer-choice-row b { grid-row: span 2; color: #1f6c4c; font: 800 14px var(--mono); }.answer-choice-row strong { font: 700 14px var(--mono); }.answer-choice-row span { color: #59665f; font-size: 14px; white-space: nowrap; }.answer-choice-row small { grid-column: 2 / -1; color: #849087; font: 14px var(--mono); }
.b-candidate-analysis { border-top: 1px solid #e0dde8; }.b-candidate-table { display: grid; gap: 6px; padding: 10px 14px 14px; }.b-candidate-row { display: grid; grid-template-columns: 23px 44px 58px minmax(68px, 1fr) minmax(68px, 1fr); align-items: center; gap: 7px; min-height: 43px; padding: 6px 9px; border: 1px solid #dedbe3; background: #fff; color: #514b58; }.b-candidate-row.best { border-color: #3f9a76; background: #edf8f1; }.b-candidate-row.chosen { box-shadow: inset 3px 0 #176c4c; }.b-candidate-row b { color: #1f6c4c; font: 800 13px var(--mono); }.b-candidate-row strong { font: 800 12px var(--mono); }.b-candidate-row span { font-size: 12px; white-space: nowrap; }.b-candidate-row small { grid-column: 2 / -1; color: #849087; font: 11px var(--mono); }
.problem-solving .problem-controls { padding: 30px 42px; }
.problem-solving .problem-submit { min-height: 48px; border-radius: 4px; background: #1f1d23; color: #fff; font: 700 14px var(--mono); letter-spacing: .02em; }
.problem-solving .problem-submit:hover:not(:disabled) { background: #453d4d; }
.problem-submit-row { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 8px; align-items: stretch; }
.problem-navigation { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.problem-navigation button { min-height: 35px; border: 1px solid #cbd6d0; border-radius: 4px; background: #fff; color: #4f5d55; cursor: pointer; font: 700 13px var(--mono); }
.problem-navigation button:hover { border-color: #8ca99b; background: #edf4ef; }
.problem-solving .problem-submit:disabled { border-color: transparent; background: #d9d6de; color: #fff; }
.problem-solving .problem-mode { gap: 12px; margin-top: 12px; }
.problem-solving .problem-mode button, .problem-solving .problem-actions button { min-height: 43px; border-color: #d9d5df; border-radius: 4px; color: #3f3945; font-size: 13px; }
.problem-solving .problem-actions { margin-top: 13px; }
.problem-solving .problem-actions button { min-height: 29px; border-color: transparent; color: #68626e; }
.problem-solving .problem-actions button:hover:not(:disabled) { background: #f2eff5; }
.problem-solving .candidate-analysis-head { padding: 16px 42px 12px; border-color: #e6e2e9; }.problem-solving .candidate-metrics { margin: 0 42px; }.problem-solving .candidate-pv { padding-inline: 42px; }.problem-solving .candidate-list { margin: 0 32px 16px; }
.problem-solving .problem-queue { margin-top: auto; }
.problem-solving .queue-heading { min-height: 64px; padding: 0 42px; background: transparent; font: 700 14px var(--mono); }.problem-solving .queue-heading:hover { background: #f6f3f8; }
.problem-solving .queue-heading span { font-size: 12px; }.problem-solving .queue-items { max-height: 230px; padding: 5px 32px 18px; border-color: #e0dde8; }
.problem-solving .problem-item { border-radius: 4px; }
@media (max-width: 1020px) {
  .problem-solving .problem-workspace { grid-template-columns: 172px minmax(0,1fr); }
  .problem-solving .problem-layout { grid-template-columns: minmax(0,1fr) 330px; }
  .problem-side-nav { padding-inline: 10px; }.solve-brand { padding-inline: 12px; }.problem-solving .problem-title, .problem-solving .problem-interaction, .problem-solving .problem-controls { padding-inline: 24px; }.problem-solving .queue-heading { padding-inline: 24px; }
  .problem-solving .problem-board { width: min(78vh, calc(100vw - 470px)); max-width: 760px; }
}
@media (max-width: 760px) {
  body.problem-solving .topbar { display: none; }
  .problem-solving .problem-workspace { display: block; }.problem-side-nav { display: none; }.problem-solve-shell { display: block; }.problem-solving .problem-layout { display: block; }.problem-solving .problem-stage { min-height: auto; border-right: 0; }.problem-solving .problem-board { width: min(92vw, 620px); }.problem-solving .problem-rail { overflow: visible; }.problem-solving .problem-title { padding-top: 25px; }
}

.analytics-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.analytics-card, .analytics-panels > article, .analytics-recent { border: 1px solid #d8e0dc; border-radius: 8px; background: #fff; padding: 18px; }
.analytics-card { display: grid; gap: 6px; }
.analytics-card span { color: #687870; font-size: 12px; font-weight: 750; }
.analytics-card strong { color: #203129; font: 800 28px var(--mono); }
.analytics-card small { min-height: 14px; color: #77857e; font-size: 11px; }
.analytics-panels { display: grid; grid-template-columns: minmax(0, 2fr) minmax(220px, 1fr); gap: 14px; margin-bottom: 14px; }
.analytics-panels h2, .analytics-recent h2 { margin: 0 0 14px; font-size: 16px; }
.analytics-panels .analytics-subheading { margin-top: 20px; padding-top: 16px; border-top: 1px solid #edf0ee; }
.analytics-table { overflow-x: auto; }
.analytics-row { display: grid; grid-template-columns: minmax(110px, 1.4fr) repeat(4, minmax(60px, 1fr)); gap: 8px; border-bottom: 1px solid #edf0ee; padding: 9px 4px; color: #586860; font: 12px var(--mono); }
.analytics-row.recent { grid-template-columns: minmax(145px, 1.4fr) .7fr 1.2fr 1fr; }
.analytics-head { color: #273a31; font-weight: 800; }
.analytics-time { display: block; margin-top: 3px; color: #91a098; font-size: 10px; font-weight: 500; }
.analytics-recent { margin-bottom: 24px; }
@media (max-width: 900px) { .analytics-grid { grid-template-columns: repeat(2, 1fr); } .analytics-panels { grid-template-columns: 1fr; } }

/* Workspace appearance preferences. Default preserves the current lavender-gray theme. */
body[data-problem-theme="cyan"].problem-solving { background: #f2f8fa; color: #21323a; }
body[data-problem-theme="cyan"] .problem-workspace { background: #f2f8fa; color: #21323a; }
body[data-problem-theme="cyan"] .problem-side-nav, body[data-problem-theme="cyan"] .problem-rail, body[data-problem-theme="cyan"] .problem-topline, body[data-problem-theme="cyan"] .exam-builder { background: #fbfdfe; }
body[data-problem-theme="cyan"] .problem-side-nav, body[data-problem-theme="cyan"] .problem-topline, body[data-problem-theme="cyan"] .problem-stage, body[data-problem-theme="cyan"] .problem-title, body[data-problem-theme="cyan"] .problem-interaction, body[data-problem-theme="cyan"] .problem-controls, body[data-problem-theme="cyan"] .problem-queue, body[data-problem-theme="cyan"] .candidate-analysis { border-color: #d5e1e6; }
body[data-problem-theme="cyan"] .problem-stage { background: #edf5f8; }
body[data-problem-theme="cyan"] .solve-nav-main button.active { background: #e7f0f4; box-shadow: inset 3px 0 #204c5f; }
body[data-problem-theme="cyan"] .solve-nav-main a:hover, body[data-problem-theme="cyan"] .solve-nav-main button:hover:not(.active), body[data-problem-theme="cyan"] .solve-nav-bottom a:hover, body[data-problem-theme="cyan"] .solve-nav-bottom button:hover, body[data-problem-theme="cyan"] .queue-heading:hover { background: #eef5f7; }
body[data-problem-theme="cyan"] .problem-previous { background: #eef5f7; }
body[data-problem-theme="cyan"] .problem-progress { background: #d4e1e5; } body[data-problem-theme="cyan"] .problem-progress i { background: #204c5f; }
body[data-problem-theme="cyan"] .problem-submit { border-color: #183c4b; background: #183c4b; } body[data-problem-theme="cyan"] .problem-submit:hover:not(:disabled) { background: #285f75; }
body[data-problem-theme="cyan"] .board-caption span:first-child { border-color: #183c4b; background: #183c4b; }
body[data-problem-theme="cyan"] .problem-b-choices { border-color: #d5e1e6; } body[data-problem-theme="cyan"] .svg-candidate .candidate-option, body[data-problem-theme="cyan"] .answer-choice-row b { fill: #204c5f; color: #204c5f; } body[data-problem-theme="cyan"] .answer-choice-row.selected { border-color: #204c5f; background: #e9f4f7; box-shadow: inset 0 -2px #204c5f; }

body[data-problem-theme="gray"].problem-solving { background: #f4f4f3; color: #292927; }
body[data-problem-theme="gray"] .problem-workspace { background: #f4f4f3; color: #292927; }
body[data-problem-theme="gray"] .problem-side-nav, body[data-problem-theme="gray"] .problem-rail, body[data-problem-theme="gray"] .problem-topline, body[data-problem-theme="gray"] .exam-builder { background: #fbfbfa; }
body[data-problem-theme="gray"] .problem-side-nav, body[data-problem-theme="gray"] .problem-topline, body[data-problem-theme="gray"] .problem-stage, body[data-problem-theme="gray"] .problem-title, body[data-problem-theme="gray"] .problem-interaction, body[data-problem-theme="gray"] .problem-controls, body[data-problem-theme="gray"] .problem-queue, body[data-problem-theme="gray"] .candidate-analysis { border-color: #ddddda; }
body[data-problem-theme="gray"] .problem-stage { background: #eeeeec; }
body[data-problem-theme="gray"] .solve-nav-main button.active { background: #ececea; box-shadow: inset 3px 0 #282826; }
body[data-problem-theme="gray"] .solve-nav-main a:hover, body[data-problem-theme="gray"] .solve-nav-main button:hover:not(.active), body[data-problem-theme="gray"] .solve-nav-bottom a:hover, body[data-problem-theme="gray"] .solve-nav-bottom button:hover, body[data-problem-theme="gray"] .queue-heading:hover { background: #f0f0ee; }
body[data-problem-theme="gray"] .problem-previous { background: #f0f0ee; }
body[data-problem-theme="gray"] .problem-progress { background: #d9d9d6; } body[data-problem-theme="gray"] .problem-progress i { background: #282826; }
body[data-problem-theme="gray"] .problem-submit { border-color: #282826; background: #282826; } body[data-problem-theme="gray"] .problem-submit:hover:not(:disabled) { background: #4a4a45; }
body[data-problem-theme="gray"] .board-caption span:first-child { border-color: #282826; background: #282826; }
body[data-problem-theme="gray"] .problem-b-choices { border-color: #ddddda; } body[data-problem-theme="gray"] .svg-candidate .candidate-option, body[data-problem-theme="gray"] .answer-choice-row b { fill: #282826; color: #282826; } body[data-problem-theme="gray"] .answer-choice-row.selected { border-color: #282826; background: #efefed; box-shadow: inset 0 -2px #282826; }

.settings-page { min-height: calc(100dvh - 94px); color: #26342e; background: #e7ede8; }
.theme-settings { max-width: 960px; margin: 18px auto; border: 1px solid #bdcbc3; background: #f7faf8; }
.theme-settings-head { display: flex; align-items: baseline; gap: 9px; padding: 12px 16px; border-bottom: 1px solid #d4ded8; }.theme-settings-head strong { font-size: 15px; }.theme-settings-head span { color: #738078; font: 11px var(--mono); letter-spacing: .08em; }
.theme-choice-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: #d4ded8; }.theme-choice { display: grid; gap: 10px; min-height: 185px; border: 0; padding: 16px; background: #f7faf8; color: #2c4036; text-align: left; cursor: pointer; }.theme-choice:hover { background: #eef5f0; }.theme-choice.active { box-shadow: inset 0 3px #28684e; background: #edf6f0; }.theme-choice strong { font-size: 17px; }.theme-choice small { color: #6f7d75; font-size: 12px; line-height: 1.5; }.theme-choice b { color: #1d6c4b; font-size: 12px; }.theme-swatches { display: flex; height: 38px; overflow: hidden; border: 1px solid #cbd6d0; border-radius: 3px; }.theme-swatches i { flex: 1; }
@media (max-width: 700px) { .theme-settings { margin: 10px; }.theme-choice-grid { grid-template-columns: 1fr; }.theme-choice { min-height: 130px; } }

.community-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 12px;
  padding: 12px;
  max-width: 1250px;
  margin: 0 auto;
}

.study-feed {
  display: grid;
  gap: 0;
  border: 1px solid #bdcbc3;
  border-radius: var(--radius);
  overflow: hidden;
  background: #f4f8f5;
}

.study-card {
  border-bottom: 1px solid #d3ded8;
  background: #f4f8f5;
  transition: background 0.14s ease, box-shadow 0.14s ease;
}

.study-card:last-child {
  border-bottom: 0;
}

.study-card:hover {
  background: #ebf3ee;
  box-shadow: inset 3px 0 0 #54a77d;
}

.study-card:active {
  transform: translateY(0);
}

.study-card-link {
  display: grid;
  grid-template-columns: 40px 58px minmax(0, 1fr) 150px;
  align-items: center;
  gap: 11px;
  min-height: 88px;
  padding: 8px 12px;
}

.study-avatar {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background:
    radial-gradient(circle at 30% 20%, rgba(184, 244, 212, 0.22), transparent 34px),
    linear-gradient(145deg, #26352f, #121715);
  border: 1px solid #40524a;
  color: var(--accent-strong);
  font-weight: 800;
}

.study-thumbnail {
  position: relative;
  width: 56px;
  height: 56px;
  border: 1px solid #95672f;
  border-radius: 6px;
  background:
    linear-gradient(90deg, rgba(85, 53, 19, 0.34) 1px, transparent 1px),
    linear-gradient(0deg, rgba(85, 53, 19, 0.34) 1px, transparent 1px),
    linear-gradient(145deg, #e6b96f, #c9823c);
  background-size: calc(100% / 8) calc(100% / 8), calc(100% / 8) calc(100% / 8), auto;
  background-position: center;
  box-shadow: inset 0 0 10px rgba(77, 42, 15, 0.22);
  overflow: hidden;
}

.mini-stone {
  position: absolute;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}

.mini-stone.black {
  background: radial-gradient(circle at 35% 30%, #626262, #080808 70%);
}

.mini-stone.white {
  background: radial-gradient(circle at 35% 30%, #fff, #d9d9d9 72%);
  border: 1px solid rgba(0, 0, 0, 0.16);
}

.mini-stone.last {
  outline: 1px solid #1c8c61;
  outline-offset: 1px;
}

.study-content {
  min-width: 0;
}

.study-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.study-content h2 {
  margin: 0;
  color: #17251f;
  font-size: 19px;
  line-height: 1.15;
  font-weight: 800;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.study-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
  color: #5c6a64;
  font-size: 12px;
}

.study-meta span + span::before {
  content: "·";
  margin-right: 8px;
  color: var(--faint);
}

.study-tags {
  display: flex;
  flex-wrap: nowrap;
  gap: 5px;
  flex: none;
  max-width: 270px;
  overflow: hidden;
}

.study-excerpt {
  margin: 5px 0 0;
  color: #35443e;
  font-size: 13px;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.study-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  color: #66756f;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.study-stats span {
  display: grid;
  gap: 1px;
}

.study-stats strong {
  color: #1f3029;
  font-size: 14px;
}

.community-sidebar {
  display: grid;
  gap: 10px;
  align-self: start;
  position: sticky;
  top: 76px;
}

.sidebar-card {
  border: 1px solid #bdcbc3;
  background: #f3f8f5;
  border-radius: var(--radius);
  padding: 10px;
}

.sidebar-card h2 {
  margin: 0 0 10px;
  color: #1e2d27;
  font-size: 13px;
}

.category-link {
  display: block;
  border-radius: 6px;
  padding: 6px 7px;
  color: #52625b;
  font-size: 12px;
  transition: background 0.14s ease, color 0.14s ease;
}

.category-link:hover,
.category-link.active {
  background: #d8eee3;
  color: #14563d;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 0;
  border-top: 1px solid #d4ded9;
  color: #52625b;
  font-size: 12px;
}

.stat-row:first-of-type {
  border-top: 0;
}

.stat-row strong {
  color: #1e2d27;
  font-variant-numeric: tabular-nums;
}

.empty-state {
  padding: 36px 14px;
  text-align: center;
  color: var(--muted);
}

.empty-state h2 {
  color: var(--text);
  margin: 0 0 8px;
}

.form-page,
.detail-page {
  padding: 14px;
}

.auth-page {
  display: grid;
  place-items: start center;
}

.auth-form,
.auth-prompt {
  width: min(100%, 420px);
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: var(--radius);
  padding: 14px;
}

.auth-prompt {
  display: grid;
  gap: 10px;
}

.auth-prompt h2,
.auth-prompt p {
  margin: 0;
}

.auth-prompt p {
  color: var(--muted);
  line-height: 1.5;
}

.auth-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.form-message {
  min-height: 20px;
  color: var(--muted);
  font-size: 13px;
}

.form-message.success {
  color: var(--accent-strong);
}

.form-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 14px;
}

.field {
  display: grid;
  gap: 7px;
  margin-bottom: 12px;
}

.field label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.field input,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: #101312;
  color: var(--text);
  border-radius: var(--radius);
  padding: 10px 11px;
  outline: none;
}

.field textarea {
  min-height: 270px;
  resize: vertical;
  line-height: 1.55;
}

.field input:focus,
.field textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(133, 217, 178, 0.12);
}

.helper {
  color: var(--faint);
  font-size: 12px;
}

.side-note,
.post-card,
.reply-card {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: var(--radius);
}

.side-note {
  padding: 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.side-note h3 {
  margin: 0 0 8px;
  color: var(--text);
  font-size: 14px;
}

.error {
  color: var(--danger);
  min-height: 20px;
  font-size: 13px;
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 14px;
}

.detail-layout.tsg-reader-layout {
  grid-template-columns: minmax(620px, 1fr) minmax(280px, 380px);
  align-items: start;
}

.tsg-reader-layout .preview-panel {
  order: 1;
}

.tsg-reader-layout .post-card {
  order: 2;
}

.post-card,
.reply-card {
  padding: 13px;
}

.post-card h1 {
  margin: 0 0 8px;
  font-size: clamp(22px, 3vw, 30px);
  line-height: 1.08;
}

.body-text {
  color: #d9dfdb;
  line-height: 1.62;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.tsg-reader-layout .post-card {
  align-self: start;
}

.tsg-reader-layout .post-card .body-text {
  max-height: 18dvh;
  overflow: auto;
}

.tsg-document {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding-top: 12px;
}

.tsg-document-head {
  display: grid;
  gap: 3px;
}

.tsg-document-head h2 {
  font-size: 17px;
  line-height: 1.2;
  margin: 0;
}

.tsg-document-head span,
.tsg-empty {
  color: var(--muted);
  font-size: 12px;
}

.tsg-analysis-summary,
.tsg-text-block,
.tsg-board-block,
.tsg-ai-block,
.tsg-unsupported {
  border: 1px solid var(--line-soft);
  background: #111615;
  border-radius: 7px;
  padding: 10px;
}

.tsg-analysis-summary h3,
.tsg-text-block h3,
.tsg-board-block h3,
.tsg-ai-block h3 {
  align-items: baseline;
  display: flex;
  gap: 6px;
  margin: 0 0 8px;
  font-size: 13px;
}

.tsg-ai-block h3 span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.analysis-metrics {
  display: grid;
  gap: 6px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.analysis-metrics div {
  background: #18201d;
  border: 1px solid #25342f;
  border-radius: 6px;
  padding: 7px;
}

.analysis-metrics span,
.candidate-table span,
.mistake-list span {
  color: var(--muted);
  display: block;
  font-size: 12px;
}

.analysis-metrics strong {
  color: var(--accent-strong);
  display: block;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  margin-top: 2px;
}

.winrate-sparkline {
  background: #202824;
  border: 1px solid #303d38;
  border-radius: 6px;
  height: 88px;
  margin-top: 8px;
  width: 100%;
}

.winrate-sparkline line {
  stroke: rgba(255, 255, 255, 0.18);
  stroke-dasharray: 4 5;
}

.winrate-sparkline polyline {
  fill: none;
  stroke: var(--accent);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.mistake-list,
.candidate-table {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}

.mistake-list div,
.candidate-table div {
  border-top: 1px solid var(--line-soft);
  padding-top: 6px;
}

.mistake-list strong,
.candidate-table strong {
  display: block;
  font-size: 12px;
}

.tsg-block-list {
  display: grid;
  gap: 9px;
  max-height: 52dvh;
  overflow: auto;
  padding-right: 3px;
}

.tsg-heading {
  border-bottom: 1px solid var(--line-soft);
  font-size: 15px;
  margin: 4px 0 0;
  padding-bottom: 5px;
}

.tsg-text-block p,
.tsg-board-block p,
.tsg-ai-block p {
  color: #d5ddd8;
  font-size: 13px;
  line-height: 1.5;
  margin: 0 0 7px;
}

.tsg-text-block p:last-child,
.tsg-board-block p:last-child,
.tsg-ai-block p:last-child {
  margin-bottom: 0;
}

.tsg-mini-board .go-board-svg {
  margin: 0 auto;
  max-height: 260px;
  max-width: 260px;
}

.pv-line {
  color: var(--accent-strong) !important;
  font-family: var(--mono);
  font-size: 12px !important;
  overflow-wrap: anywhere;
}

.tsg-unsupported {
  color: var(--muted);
  font-size: 12px;
}

.preview-panel {
  border: 1px solid var(--line);
  background: #151817;
  border-radius: var(--radius);
  padding: 12px;
  align-self: start;
  position: sticky;
  top: 76px;
}

.preview-panel h3,
.replies h2 {
  margin: 0 0 10px;
  font-size: 14px;
}

.tsg-reader-layout .preview-panel {
  position: static;
  padding: 14px;
}

.board-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.board-header h3 {
  margin: 0;
}

.board-move-readout {
  color: var(--accent-strong);
  font-family: var(--mono);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.board-wrap {
  display: grid;
  gap: 10px;
}

.go-board {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 7px;
  border: 1px solid var(--wood-dark);
  background:
    linear-gradient(90deg, rgba(75, 43, 15, 0.46) 1px, transparent 1px),
    linear-gradient(0deg, rgba(75, 43, 15, 0.46) 1px, transparent 1px),
    linear-gradient(145deg, #e3ae67, #b97532);
  background-size: calc(100% / 18) calc(100% / 18), calc(100% / 18) calc(100% / 18), auto;
  background-position: center;
  box-shadow: inset 0 0 18px rgba(81, 42, 12, 0.35);
}

.go-board-svg {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 7px;
  box-shadow: inset 0 0 18px rgba(81, 42, 12, 0.35);
}

.tsg-reader-layout .go-board-svg {
  max-height: calc(100dvh - 260px);
  min-height: 540px;
}

.board-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.board-controls .board-nav-button {
  border: 1px solid #3b4944;
  background: #202824;
  color: var(--text);
  border-radius: 6px;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 800;
  height: 32px;
  width: 42px;
  padding: 5px;
}

.board-controls .board-nav-button svg { width: 22px; height: 22px; fill: currentColor; }
.board-controls .board-nav-button:hover:not(:disabled) {
  border-color: var(--accent);
  background: #26342e;
}
.board-controls .board-nav-button:disabled { opacity: .35; cursor: default; }

.go-board-svg rect {
  fill: var(--go-board-wood);
}

.go-board-svg line {
  stroke: var(--go-board-line);
  stroke-width: 1.25;
}

.go-board-svg .star {
  fill: #1d1b18;
}

.go-board-svg .coord {
  fill: #283036;
  font-size: 16px;
  font-weight: 760;
  user-select: none;
}

.go-board-svg .svg-stone circle {
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.36));
}

.go-board-svg .svg-stone.black circle {
  fill: #111719;
  stroke: #000;
  stroke-width: 1;
}

.go-board-svg .svg-stone.white circle {
  fill: #f8faf7;
  stroke: #aeb9b5;
  stroke-width: 1.2;
}

.go-board-svg .svg-stone.black text {
  fill: #ffffff;
}

.go-board-svg .svg-stone.white text {
  fill: #121719;
}

.go-board-svg .svg-stone text {
  font-size: 20px;
  font-weight: 800;
  pointer-events: none;
}

.go-board-svg .svg-stone.last text {
  fill: var(--go-board-last-move);
  font-size: 24px;
}

.stone {
  position: absolute;
  width: 4.7%;
  height: 4.7%;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

.stone.black {
  background: radial-gradient(circle at 35% 30%, #555, #050505 65%);
}

.stone.white {
  background: radial-gradient(circle at 35% 30%, #fff, #c7c7c7 70%);
  border: 1px solid rgba(0, 0, 0, 0.18);
}

.stone.last {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.preview-meta {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
}

.preview-warning {
  color: var(--danger);
}

.download-link {
  display: inline-flex;
  margin-top: 9px;
  color: var(--accent-strong);
  font-size: 13px;
}

.replies {
  margin-top: 14px;
  display: grid;
  gap: 10px;
}

.reply-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 190px;
  gap: 12px;
}

.reply-form {
  margin-top: 14px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.inline-preview {
  min-width: 0;
}

.loading {
  padding: 30px 14px;
  color: var(--muted);
}

@media (max-width: 820px) {
  .app-shell {
    width: min(100vw - 16px, 1180px);
    padding-top: 8px;
  }

  .topbar,
  .page-head {
    align-items: stretch;
    flex-direction: column;
  }

  .nav-actions {
    width: 100%;
  }

  .topbar-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .language-picker {
    flex: 0 0 auto;
  }

  .nav-actions a {
    flex: 1;
    text-align: center;
  }

  .form-grid,
  .reply-card {
    grid-template-columns: 1fr;
  }

  .detail-layout,
  .detail-layout.tsg-reader-layout {
    grid-template-columns: 1fr;
  }

  .preview-panel {
    position: static;
  }

  .tsg-reader-layout .go-board-svg {
    min-height: auto;
    max-height: none;
  }

  .community-layout {
    grid-template-columns: 1fr;
    padding: 10px;
  }

  .community-sidebar {
    position: static;
    grid-template-columns: 1fr 1fr;
  }

  .study-card-link {
    grid-template-columns: 36px 52px minmax(0, 1fr);
    gap: 10px;
    padding: 9px 10px;
  }

  .study-avatar {
    width: 36px;
    height: 36px;
  }

  .study-thumbnail {
    width: 52px;
    height: 52px;
  }

  .study-stats {
    grid-column: 3;
    grid-template-columns: repeat(3, auto);
    justify-content: start;
    text-align: left;
  }
}

@media (max-width: 560px) {
  .community-sidebar {
    display: none;
  }

  .study-card-link {
    grid-template-columns: 36px minmax(0, 1fr);
  }

  .study-thumbnail {
    display: none;
  }

  .study-title-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .study-content h2 {
    font-size: 18px;
    white-space: normal;
  }
}

/* 定式库：沿用答题页的训练工作台视觉。 */
.dingshi-library.problem-library { width: min(1280px, calc(100% - 24px)); margin: 12px auto; padding: 0; }
.dingshi-library-grid { grid-template-columns: minmax(0, 1fr) 310px; }
.dingshi-study-list { display: grid; }
.dingshi-entry { position: relative; display: grid; grid-template-columns: 34px 82px minmax(180px, 1fr) 58px 68px 22px; align-items: center; min-height: 102px; border-bottom: 1px solid #d4ddd8; padding: 8px 12px; background: #f7f9f7; color: #22342b; text-decoration: none; transition: background .15s ease, transform .15s ease; }
.dingshi-entry::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 5px; background: #39745a; }
.dingshi-entry:hover { z-index: 1; background: #e4eee8; transform: translateX(3px); }
.dingshi-entry:last-child { border-bottom: 0; }
.dingshi-entry-index { color: #829087; font: 11px var(--mono); }
.dingshi-entry-board { display: block; overflow: hidden; width: 68px; height: 68px; border: 1px solid #b8a078; background: #d19a55; }
.dingshi-entry-board .go-board-svg { display: block; width: 100%; height: 100%; }
.dingshi-entry-copy { display: grid; align-content: center; gap: 5px; min-width: 0; padding: 0 14px; }
.dingshi-entry-copy strong { overflow: hidden; color: #203129; font-size: 18px; letter-spacing: -.02em; text-overflow: ellipsis; white-space: nowrap; }
.dingshi-entry-copy small { display: -webkit-box; overflow: hidden; color: #687870; font-size: 12px; line-height: 1.45; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.dingshi-entry-copy i, .dingshi-entry-time { color: #859189; font: normal 12px var(--mono); }
.dingshi-entry-count { color: #23382e; font: 750 17px var(--mono); text-align: right; }
.dingshi-entry-count i { margin-left: 2px; color: #76857d; font: normal 12px var(--sans); }
.dingshi-entry-time { text-align: right; }
.dingshi-empty { display: grid; gap: 6px; padding: 42px 18px; color: #687870; text-align: center; }
.dingshi-empty strong { color: #203129; font-size: 17px; }
.dingshi-empty .button { justify-self: center; margin-top: 10px; }
.dingshi-publish-link { margin-left: 6px; white-space: nowrap; }
.dingshi-side-copy { padding: 13px 12px; color: #2c4136; }
.dingshi-side-copy p { margin: 5px 0 0; color: #687870; font-size: 12px; line-height: 1.55; }
.dingshi-side-copy .button { display: inline-flex; margin-top: 13px; }
.dingshi-publish-page .library-head { align-items: flex-start; }
.dingshi-publish-grid { grid-template-columns: minmax(0, 1fr) 310px; align-items: start; }
.dingshi-publish-form { display: grid; gap: 18px; padding: 22px; }
.dingshi-publish-form .panel-heading { margin: -22px -22px 2px; padding: 14px 18px; }
.dingshi-publish-form .field { display: grid; gap: 7px; color: #2e4137; font-size: 12px; font-weight: 750; }
.dingshi-publish-form input, .dingshi-publish-form textarea { width: 100%; border: 1px solid #c9d4ce; border-radius: 4px; box-sizing: border-box; padding: 11px 12px; background: #fff; color: #23332b; font: 13px var(--sans); }
.dingshi-publish-form textarea { min-height: 142px; resize: vertical; line-height: 1.55; }
.dingshi-publish-form input:focus, .dingshi-publish-form textarea:focus { outline: 2px solid #9bc6ae; outline-offset: 1px; border-color: #4e8b6c; }
.dingshi-publish-actions { display: flex; align-items: center; gap: 9px; }
.dingshi-publish-auth { max-width: 610px; margin: 32px auto; }
.dingshi-forum-badge { display: inline-block; margin-top: 10px; color: #698276; font: 11px var(--mono); }
.dingshi-service-row { display: grid; grid-template-columns: 82px minmax(0, 1fr); align-items: center; min-height: 44px; border-bottom: 1px solid #d6ded9; padding: 6px 10px; color: #283a31; }
.dingshi-service-row:last-child { border-bottom: 0; }
.dingshi-service-row span { font-size: 12px; font-weight: 700; }
.dingshi-service-row small { color: #77857e; font-size: 11px; }
.problem-solving .dingshi-solve-shell { grid-template-rows: 76px minmax(0, 1fr); }
.problem-solving .dingshi-solve-shell .problem-layout { grid-row: 2; }
.dingshi-top-meta { display: flex; gap: 7px; }
.dingshi-top-meta span { border: 1px solid #d8d4de; border-radius: 4px; padding: 6px 9px; background: #fff; color: #716c77; font: 11px var(--mono); }
.problem-solving .dingshi-board-stage { display: flex; flex-direction: column; justify-content: flex-start; padding: 0; border: 0; border-right: 1px solid #e0dde8; border-radius: 0; background: #f5f3fb; }
.problem-solving .dingshi-board-stage .problem-board { flex: 0 0 auto; width: min(82vh, calc(100vw - 620px)); padding: 12px; }
.problem-solving .dingshi-board-stage .dingshi-move-controls { flex: 0 0 auto; flex-wrap: wrap; gap: 7px; margin: 0 auto; padding: 2px 12px 14px; width: min(82vh, calc(100vw - 620px)); }
.problem-solving .dingshi-board-stage .dingshi-move-controls .board-nav-button { width: 44px; height: 40px; border-color: #b9c9cd; border-radius: 7px; background: #f9fcfd; color: #1d2c34; }
.problem-solving .dingshi-board-stage .dingshi-move-controls .board-nav-button svg { width: 26px; height: 26px; }
.problem-solving .dingshi-board-stage .dingshi-move-controls .board-nav-button:hover:not(:disabled) { border-color: #7da2ae; background: #edf5f6; }
.problem-solving .dingshi-board-stage .dingshi-move-controls > .board-controls-readout { flex: 1 0 100%; color: #77727e; text-align: center; font: 12px var(--mono); }
.problem-solving .dingshi-board-stage .dingshi-comments { width: min(82vh, calc(100vw - 620px)); margin: 6px auto 28px; border-top: 1px solid #ddd9e3; padding: 20px 12px 0; color: #332f38; }
.dingshi-comments-heading { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; }
.dingshi-comments-heading strong { font-size: 16px; }
.dingshi-comments-heading span { color: #817b87; font: 12px var(--mono); }
.dingshi-comment-list { display: grid; gap: 0; border-top: 1px solid #e3dfe7; }
.dingshi-comment { padding: 13px 0; border-bottom: 1px solid #e3dfe7; }
.dingshi-comment > div { display: flex; align-items: baseline; gap: 9px; }
.dingshi-comment strong { font-size: 13px; }
.dingshi-comment time { color: #89838f; font: 12px var(--mono); }
.dingshi-comment p { margin: 7px 0 0; color: #514b57; font-size: 13px; line-height: 1.65; white-space: pre-wrap; }
.dingshi-comments-empty { margin: 0; padding: 14px 0; color: #89838f; font-size: 13px; }
.dingshi-comment-form { display: grid; gap: 8px; margin-top: 16px; }
.dingshi-comment-form label { color: #625b67; font-size: 12px; }
.dingshi-comment-form textarea { min-height: 88px; resize: vertical; border: 1px solid #cfc9d5; border-radius: 6px; background: #fff; padding: 9px 10px; color: #312d35; font: 13px/1.5 var(--sans); }
.dingshi-comment-form textarea:focus { outline: 2px solid rgba(66, 133, 156, .25); border-color: #47849b; }
.dingshi-comment-form > div { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.dingshi-comment-form .button { min-width: 92px; }
.dingshi-comment-auth { margin-top: 16px; padding: 12px; border: 1px dashed #cfc9d5; border-radius: 6px; color: #6f6874; font-size: 12px; }
.dingshi-comment-auth a { color: #176785; font-weight: 700; }
.dingshi-variation-strip button { border: 1px solid #d5d1dc; border-radius: 4px; padding: 8px 11px; background: #fff; color: #4d4854; cursor: pointer; font: 700 12px var(--mono); }
.dingshi-variation-strip button:hover { border-color: #716a78; background: #f4f1f7; }
.problem-solving .dingshi-analysis-rail { display: flex; gap: 0; overflow-y: auto; background: #fcfbff; }
.problem-solving .dingshi-analysis-rail > section, .problem-solving .dingshi-analysis-rail > nav { border: 0; border-bottom: 1px solid #e0dde8; border-radius: 0; background: transparent; }
.problem-solving .dingshi-title { padding: 24px 32px 20px; }
.problem-solving .dingshi-title p { margin: 12px 0 0; color: #77727e; font-size: 12px; line-height: 1.6; }
.dingshi-evaluation { padding: 20px 32px; }
.dingshi-evaluation > span { color: #918b97; font: 800 11px var(--mono); letter-spacing: .08em; }
.dingshi-evaluation > strong { display: block; margin-top: 7px; color: #28252c; font-size: 25px; }
.dingshi-evaluation > div { display: flex; gap: 16px; margin-top: 7px; color: #77727e; font: 12px var(--mono); }
.dingshi-variation-strip { display: block; margin: 0; padding: 0; }
.dingshi-variation-strip > div:last-child { display: flex; flex-wrap: wrap; gap: 5px; max-height: 168px; overflow-y: auto; padding: 12px 16px 16px; }
.dingshi-variation-strip button { min-width: 35px; padding: 7px 8px; }
.dingshi-variation-strip button.active { border-color: #28252c; background: #28252c; color: #fff; }
.dingshi-candidates { padding: 0; }
.dingshi-candidate-content { padding: 12px 16px 18px; }
.dingshi-candidate-content > p { margin: 0; color: #77727e; font-size: 12px; line-height: 1.55; }
.dingshi-candidate-content .candidate-table { margin: 0; }
.dingshi-candidates .panel-heading { align-items: center; }
.dingshi-display-toggle { display: flex; gap: 4px; }
.dingshi-display-toggle button { border: 1px solid #d2ced8; border-radius: 4px; padding: 5px 8px; background: #fff; color: #6f6976; cursor: pointer; font: 800 12px var(--mono); }
.dingshi-display-toggle button.active { border-color: #2a272f; background: #2a272f; color: #fff; }
.dingshi-candidate-table { display: grid; gap: 0; }
.dingshi-candidate-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 3px 9px; width: 100%; border: 0; border-bottom: 1px solid #e0dde8; padding: 10px 8px; background: transparent; color: #34303a; cursor: pointer; text-align: left; }
.dingshi-candidate-row:last-child { border-bottom: 0; }
.dingshi-candidate-row:hover, .dingshi-candidate-row.focused { background: #eef5f1; box-shadow: inset 3px 0 #3c9073; }
.dingshi-candidate-row strong { font: 800 13px var(--mono); }
.dingshi-candidate-row strong b { color: #b6434b; }
.dingshi-candidate-row > span { align-self: center; color: #667a70; font: 750 12px var(--mono); white-space: nowrap; }
.dingshi-candidate-row small { grid-column: 1 / -1; overflow: hidden; color: #9aa69f; font: 12px var(--mono); text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 900px) {
  .dingshi-library-grid, .dingshi-publish-grid { grid-template-columns: 1fr; }
  .dingshi-entry { grid-template-columns: 30px 72px minmax(150px, 1fr) 54px 22px; }
  .dingshi-entry-time { display: none; }
}

@media (max-width: 760px) {
  .dingshi-entry { grid-template-columns: 25px 58px minmax(0, 1fr) 44px 18px; min-height: 82px; padding-inline: 8px; }
  .dingshi-entry-board { width: 52px; height: 52px; }
  .dingshi-entry-copy small, .dingshi-entry-copy i { display: none; }
  .problem-solving .dingshi-board-stage .problem-board { width: min(92vw, 620px); }
  .problem-solving .dingshi-board-stage .dingshi-comments { width: min(92vw, 620px); }
  .library-summary .dingshi-publish-link { width: 100%; margin: 5px 0 0; justify-content: center; }
}
