/* ===== Theme tokens ===== */
:root,
[data-theme="light"] {
  --bg: #f3f7f4;
  --bg-glow-a: #dff5e8;
  --bg-glow-b: #fff2cc;
  --ink: #1d2a24;
  --muted: #5b6b63;
  --card: #ffffff;
  --card-soft: #f8fbf9;
  --line: #d5e2da;
  --primary: #1f7a4d;
  --primary-dark: #155c39;
  --accent: #e8a317;
  --danger: #c0392b;
  --ok: #1f7a4d;
  --warn: #b7791f;
  --topbar-bg: rgba(255, 255, 255, 0.92);
  --btn-bg: #e7eee9;
  --progress-track: #e8efea;
  --status-bg: #eef8f1;
  --notice-bg: #fff8e6;
  --notice-line: #f0d48a;
  --pass-bg: #eefaf3;
  --pass-line: #7dcea0;
  --fail-bg: #fff5f4;
  --fail-line: #f0b4ad;
  --danger-btn-bg: #f8e0dd;
  --me-bg: #e8f7ee;
  --me-line: #9fd4b3;
  --points-bg: #fff1d6;
  --points-ink: #8a5a00;
  --pre-bg: #1d2a24;
  --pre-ink: #e8fff2;
  --table-head: #f3f8f5;
  --url-bg: #1d2a24;
  --url-ink: #b8ffd5;
  --badge-pass-bg: #dff5e8;
  --badge-todo-bg: #fff1d6;
  --zone-goal: #1f7a4d;
  --zone-input: #2b6cb0;
  --zone-output: #6b46c1;
  --zone-sample: #c05621;
  --zone-hint: #dd6b20;
  --shadow: 0 8px 24px rgba(29, 42, 36, 0.08);
  --radius: 12px;
  --font: "Noto Sans TC", "Microsoft JhengHei", "PingFang TC", sans-serif;
  --topbar-h: 52px;
}

[data-theme="dark"] {
  --bg: #121a16;
  --bg-glow-a: #1a3328;
  --bg-glow-b: #2a2418;
  --ink: #e8f2ec;
  --muted: #9aafa3;
  --card: #1b2620;
  --card-soft: #222e28;
  --line: #314038;
  --primary: #3dba78;
  --primary-dark: #2f9e68;
  --accent: #e8a317;
  --danger: #f08078;
  --ok: #3dba78;
  --warn: #e0b04a;
  --topbar-bg: rgba(18, 26, 22, 0.94);
  --btn-bg: #2a3830;
  --progress-track: #2a3830;
  --status-bg: #1e3228;
  --notice-bg: #3a3018;
  --notice-line: #8a7030;
  --pass-bg: #1a3328;
  --pass-line: #3dba78;
  --fail-bg: #33201e;
  --fail-line: #c07068;
  --danger-btn-bg: #3a2826;
  --me-bg: #1e3a2c;
  --me-line: #3dba78;
  --points-bg: #3a3018;
  --points-ink: #f0c060;
  --pre-bg: #0e1411;
  --pre-ink: #d8ffe8;
  --table-head: #222e28;
  --url-bg: #0e1411;
  --url-ink: #b8ffd5;
  --badge-pass-bg: #1e3a2c;
  --badge-todo-bg: #3a3018;
  --zone-goal: #3dba78;
  --zone-input: #63b3ed;
  --zone-output: #b794f4;
  --zone-sample: #f6ad55;
  --zone-hint: #ed8936;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 0%, var(--bg-glow-a) 0%, transparent 40%),
    radial-gradient(circle at 90% 10%, var(--bg-glow-b) 0%, transparent 35%),
    var(--bg);
  min-height: 100vh;
}

body.page-fill {
  overflow: hidden;
  height: 100vh;
}

a {
  color: var(--primary-dark);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  height: var(--topbar-h);
  padding: 0 1.1rem;
  background: var(--topbar-bg);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  backdrop-filter: blur(8px);
  z-index: 10;
}

.brand {
  min-width: 0;
  flex: 1 1 auto;
}

.brand a {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--ink);
  text-decoration: none;
}

.nav {
  display: flex;
  gap: 0.7rem;
  align-items: center;
  flex-wrap: wrap;
}

.who {
  color: var(--muted);
  font-size: 0.9rem;
}

.theme-toggle {
  border: 1px solid var(--line);
  background: var(--btn-bg);
  color: var(--ink);
  border-radius: 999px;
  padding: 0.28rem 0.75rem;
  font: inherit;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
}

.theme-toggle:hover {
  border-color: var(--primary);
}

.container {
  width: min(1760px, 96vw);
  margin: 0.75rem auto 1.5rem;
}

.container.container-fill {
  width: min(1860px, 98vw);
  margin: 0.45rem auto 0;
  height: calc(100vh - var(--topbar-h) - 0.45rem);
  max-height: calc(100vh - var(--topbar-h) - 0.45rem);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.container.container-home {
  width: min(1760px, 96vw);
  margin: 0.5rem auto 0;
  height: calc(100vh - var(--topbar-h) - 2rem);
  max-height: calc(100vh - var(--topbar-h) - 2rem);
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  overflow: hidden;
}

.footer {
  text-align: center;
  color: var(--muted);
  padding: 0.9rem;
  font-size: 0.85rem;
}

.footer.footer-hidden {
  display: none;
}

.dev-credit {
  position: fixed;
  right: 0.55rem;
  bottom: 0.35rem;
  margin: 0;
  z-index: 5;
  font-size: 0.68rem;
  line-height: 1.2;
  letter-spacing: 0.01em;
  color: #9aa3ad;
  opacity: 0.55;
  pointer-events: none;
  user-select: none;
  white-space: nowrap;
}

[data-theme="dark"] .dev-credit {
  color: #6b7380;
  opacity: 0.45;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 0.85rem 1rem;
}

.card.narrow {
  width: min(460px, 100%);
  margin: 2rem auto;
}

.card.tight {
  padding: 0.65rem 0.8rem;
}

h1,
h2,
h3 {
  margin-top: 0;
  line-height: 1.25;
}

h1 {
  font-size: 1.35rem;
  margin-bottom: 0.4rem;
}

h2 {
  font-size: 1.1rem;
  margin-bottom: 0.45rem;
}

h3 {
  font-size: 0.98rem;
  margin-bottom: 0.35rem;
}

.lead {
  color: var(--muted);
  font-size: 0.95rem;
  margin: 0.35rem 0 0;
}

.notice {
  background: var(--notice-bg);
  border: 1px solid var(--notice-line);
  padding: 0.7rem 0.9rem;
  border-radius: 10px;
}

.error {
  color: var(--danger);
  font-weight: 700;
}

.ok {
  color: var(--ok);
  font-weight: 700;
}

.muted {
  color: var(--muted);
}

.form {
  display: grid;
  gap: 0.9rem;
}

label {
  display: grid;
  gap: 0.35rem;
  font-weight: 600;
}

input,
select,
textarea {
  font: inherit;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  color: var(--ink);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: none;
  border-radius: 999px;
  padding: 0.55rem 1.05rem;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  background: var(--btn-bg);
  color: var(--ink);
}

.btn.primary {
  background: var(--primary);
  color: #fff;
}

.btn.primary:hover {
  background: var(--primary-dark);
}

.btn.danger {
  background: var(--danger-btn-bg);
  color: var(--danger);
}

.btn.small {
  padding: 0.35rem 0.7rem;
  font-size: 0.88rem;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.7rem;
}

.track-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.7rem;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.7rem;
}

@media (max-width: 1100px) {
  .track-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {

  .grid-3,
  .grid-2 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .track-grid {
    grid-template-columns: 1fr;
  }
}

.track-card {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  min-height: 0;
  padding: 0.75rem 0.9rem;
  border-left: 5px solid var(--track-accent, var(--primary));
  background:
    linear-gradient(145deg, var(--track-wash, transparent) 0%, transparent 58%),
    var(--card);
}

.track-card h2 {
  margin: 0;
  font-size: 1.15rem;
  color: var(--track-ink, var(--ink));
}

.track-card .muted {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 0.88rem;
  margin: 0;
}

.track-chip {
  align-self: flex-start;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  color: #fff;
  background: var(--track-accent, var(--primary));
}

.track-card .progress-bar>span {
  background: linear-gradient(90deg, var(--track-accent, var(--primary)), var(--track-accent-2, var(--accent)));
}

/* 輸出與輸入：青藍 */
.track-card--io,
.track-hero--io {
  --track-accent: #1f7a8c;
  --track-accent-2: #3eb5c9;
  --track-wash: rgba(31, 122, 140, 0.14);
  --track-ink: #155e6d;
}

/* 龜圖：葉綠 */
.track-card--turtle,
.track-hero--turtle {
  --track-accent: #2f7d32;
  --track-accent-2: #6fbf73;
  --track-wash: rgba(47, 125, 50, 0.14);
  --track-ink: #1f5a22;
}

/* 簡單運算：琥珀橘 */
.track-card--math,
.track-hero--math {
  --track-accent: #c45c16;
  --track-accent-2: #e89a3c;
  --track-wash: rgba(196, 92, 22, 0.14);
  --track-ink: #8f3f0c;
}

[data-theme="dark"] .track-card--io,
[data-theme="dark"] .track-hero--io {
  --track-wash: rgba(62, 181, 201, 0.16);
  --track-ink: #9ad8e4;
}

[data-theme="dark"] .track-card--turtle,
[data-theme="dark"] .track-hero--turtle {
  --track-wash: rgba(111, 191, 115, 0.16);
  --track-ink: #b7e0b9;
}

[data-theme="dark"] .track-card--math,
[data-theme="dark"] .track-hero--math {
  --track-wash: rgba(232, 154, 60, 0.16);
  --track-ink: #f0c08a;
}

/* 初階解題：挑戰紫 */
.track-card--solve,
.track-hero--solve {
  --track-accent: #6d28d9;
  --track-accent-2: #a78bfa;
  --track-wash: rgba(109, 40, 217, 0.14);
  --track-ink: #4c1d95;
}

[data-theme="dark"] .track-card--solve,
[data-theme="dark"] .track-hero--solve {
  --track-wash: rgba(167, 139, 250, 0.18);
  --track-ink: #ddd6fe;
}

.track-hero {
  border-left: 6px solid var(--track-accent, var(--primary));
  background:
    linear-gradient(120deg, var(--track-wash, transparent) 0%, transparent 55%),
    var(--card);
}

.track-hero h1 {
  color: var(--track-ink, var(--ink));
}

.progress-bar {
  height: 10px;
  background: var(--progress-track);
  border-radius: 999px;
  overflow: hidden;
}

.progress-bar>span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
}

.badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
}

.badge.pass {
  background: var(--badge-pass-bg);
  color: var(--ok);
}

.badge.todo {
  background: var(--badge-todo-bg);
  color: var(--warn);
}

.badge.learn-has {
  background: #ffe8c8;
  color: #9a4d00;
  margin-right: 0.25rem;
  vertical-align: middle;
}

.badge.learn-done {
  background: #d9eef8;
  color: #0b6e99;
}

.badge.learn-todo {
  background: #efe8ff;
  color: #5b4bb3;
}

[data-theme="dark"] .badge.learn-has {
  background: #4a3218;
  color: #f0c08a;
}

[data-theme="dark"] .badge.learn-done {
  background: #163447;
  color: #8fd3f4;
}

[data-theme="dark"] .badge.learn-todo {
  background: #2a2448;
  color: #c5b8ff;
}

.level-list li.has-learn a {
  border-left: 3px solid #e89a3c;
}

.level-title {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.15rem;
  min-width: 0;
}

.level-meta {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  justify-content: flex-end;
  align-items: center;
}

.track-learn-summary {
  margin: 0.35rem 0 0;
}

/* ===== Home one-screen ===== */
.home-dash {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 0.55rem;
  height: 100%;
  min-height: 0;
}

.home-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem 1rem;
  padding: 0.55rem 0.85rem;
}

.home-hero .status-bar {
  flex: 1 1 100%;
}

.home-hero h1 {
  margin: 0;
  font-size: 1.2rem;
}

.home-hero .lead {
  margin: 0;
}

.home-side {
  min-height: 0;
  height: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.7rem;
}

.home-side.with-classmate {
  grid-template-columns: 1fr 1.05fr 0.95fr;
}

@media (max-width: 1100px) {
  .home-side.with-classmate {
    grid-template-columns: 1fr 1fr;
  }
}

.home-side>.card {
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.home-side .activity-list,
.home-side .leaderboard,
.home-side .classmate-panel {
  flex: 1;
  max-height: none;
  min-height: 0;
}

.classmate-panel {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  min-height: 0;
}

.classmate-h {
  margin: 0 0 0.3rem;
  font-size: 0.88rem;
  color: var(--muted);
}

.classmate-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.28rem;
}

.classmate-list li {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
  padding: 0.22rem 0.45rem;
  border-radius: 8px;
  background: var(--card-soft);
  border: 1px solid var(--line);
  font-size: 0.82rem;
  min-width: 0;
  overflow: hidden;
}

.classmate-list .who {
  font-weight: 700;
  flex: 0 0 auto;
  white-space: nowrap;
  color: var(--ink);
}

.classmate-list .doing {
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.25;
  flex: 1 1 auto;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: keep-all;
}

.classmate-list .doing .badge {
  vertical-align: middle;
  margin-left: 0.15rem;
}

.classmate-list.highlights li {
  border-left: 3px solid var(--accent);
}

.muted.tiny {
  font-size: 0.82rem;
  margin: 0.2rem 0;
}

/* ===== Problem cockpit ===== */
.cockpit {
  display: grid;
  grid-template-columns: minmax(260px, 0.95fr) minmax(420px, 1.55fr) minmax(240px, 0.85fr);
  gap: 0.55rem;
  height: 100%;
  min-height: 0;
  flex: 1;
}

@media (max-width: 1200px) {
  .cockpit {
    grid-template-columns: 1fr 1.2fr;
    grid-template-rows: 1fr auto;
  }

  .cockpit-right {
    grid-column: 1 / -1;
    max-height: 220px;
  }
}

@media (max-width: 860px) {
  body.page-fill {
    overflow: auto;
    height: auto;
  }

  .container.container-fill {
    height: auto;
    max-height: none;
    overflow: visible;
  }

  .cockpit {
    grid-template-columns: 1fr;
    height: auto;
  }

  .cockpit-right {
    max-height: none;
  }
}

.cockpit-col {
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  overflow: hidden;
}

.cockpit-col>.card {
  min-height: 0;
}

.cockpit-scroll {
  overflow: auto;
  flex: 1;
  min-height: 0;
}

.cockpit-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.7rem;
  align-items: center;
  font-size: 0.88rem;
  margin-bottom: 0.35rem;
}

.cockpit-meta a {
  font-weight: 700;
}

.pane-tabs {
  display: flex;
  gap: 0.3rem;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}

.pane-tab {
  border: 1px solid var(--line);
  background: var(--card-soft);
  color: var(--ink);
  border-radius: 999px;
  padding: 0.25rem 0.7rem;
  font: inherit;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
}

.pane-tab.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.pane-panel {
  display: none;
}

.pane-panel.active {
  display: block;
}

.block {
  background: var(--card-soft);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.65rem 0.75rem;
  margin-bottom: 0.45rem;
  border-left: 4px solid var(--line);
}

.block h3 {
  margin: 0 0 0.3rem;
  font-size: 0.92rem;
}

.block.block-goal {
  border-left-color: var(--zone-goal);
}

.block.block-input {
  border-left-color: var(--zone-input);
}

.block.block-output {
  border-left-color: var(--zone-output);
}

.block.block-sample {
  border-left-color: var(--zone-sample);
}

.block.block-hint {
  border-left-color: var(--zone-hint);
}

.block pre,
.code-out {
  white-space: pre-wrap;
  word-break: break-word;
  background: var(--pre-bg);
  color: var(--pre-ink);
  padding: 0.55rem 0.65rem;
  border-radius: 8px;
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.86rem;
  margin: 0.25rem 0;
}

.hint-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.hint-list details {
  margin: 0.3rem 0;
}

.hint-list summary {
  cursor: pointer;
  font-weight: 700;
}

.hint-list pre {
  background: var(--card);
  color: var(--ink);
  border: 1px dashed var(--line);
}

.editor-card {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.editor-card form {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

#editor-wrap {
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  flex: 1;
  min-height: 180px;
  background: var(--card);
  position: relative;
}

#editor-wrap .CodeMirror {
  height: 100% !important;
  font-size: 0.95rem;
  font-family: Consolas, "Courier New", monospace;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-top: 0.45rem;
  flex-shrink: 0;
}

.result-area-wrap {
  flex-shrink: 0;
  max-height: 28vh;
  overflow: auto;
  margin-top: 0.35rem;
}

.result-box {
  border-radius: 10px;
  padding: 0.7rem 0.8rem;
  border: 2px solid var(--line);
  margin-top: 0.2rem;
}

.result-box.pass {
  border-color: var(--pass-line);
  background: var(--pass-bg);
}

.result-box.fail {
  border-color: var(--fail-line);
  background: var(--fail-bg);
}

.compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  margin-top: 0.45rem;
}

.compare img {
  width: 100%;
  max-width: 240px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.side-section {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.side-section+.side-section {
  margin-top: 0.4rem;
}

.side-section>summary,
.side-head {
  list-style: none;
  cursor: pointer;
  font-weight: 800;
  font-size: 0.9rem;
  padding: 0.45rem 0.65rem;
  background: var(--card-soft);
  border-bottom: 1px solid var(--line);
  user-select: none;
}

.side-section>summary::-webkit-details-marker {
  display: none;
}

.side-body {
  padding: 0.45rem 0.55rem;
  overflow: auto;
  flex: 1;
  min-height: 0;
  max-height: 28vh;
}

.side-section[open] .side-body {
  max-height: 32vh;
}

.level-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.3rem;
}

.level-list li a {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.4rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card-soft);
  text-decoration: none;
  color: inherit;
  font-size: 0.86rem;
}

.level-list li a:hover {
  border-color: var(--primary);
}

.level-list li.suggested a {
  box-shadow: 0 0 0 2px rgba(232, 163, 23, 0.35);
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
  color: var(--ink);
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 0.55rem 0.45rem;
  text-align: left;
  vertical-align: top;
}

th {
  background: var(--table-head);
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-bottom: 0.8rem;
}

.url-box {
  font-size: 1.1rem;
  font-weight: 800;
  background: var(--url-bg);
  color: var(--url-ink);
  padding: 0.7rem 0.9rem;
  border-radius: 10px;
  word-break: break-all;
}

.status-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.85rem;
  margin: 0;
  padding: 0.35rem 0.7rem;
  background: var(--status-bg);
  border: 1px solid var(--line);
  border-radius: 999px;
  align-items: center;
}

.status-item {
  font-size: 0.88rem;
}

.rank-path {
  flex: 1 1 100%;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
}

.rank-badge {
  flex: 0 0 auto;
  width: 1.8rem;
  height: 1.8rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--badge-pass-bg);
  border: 2px solid var(--pass-line);
  font-size: 1rem;
  line-height: 1;
}

.rank-badge-next {
  background: var(--badge-todo-bg);
  border-color: var(--notice-line);
}

.rank-track {
  flex: 1 1 auto;
  height: 1rem;
  border-radius: 999px;
  background:
    radial-gradient(circle, var(--line) 1px, transparent 1.2px) 0 50% / 10px 10px,
    var(--progress-track);
  border: 2px solid var(--line);
  overflow: hidden;
}

.rank-track>span {
  display: block;
  height: 100%;
  min-width: 0.8rem;
  border-radius: inherit;
  background: linear-gradient(90deg, #6bcb97, #f6d365 62%, #f7a8c9);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.rank-hint {
  flex: 1 1 100%;
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
}

.level-up {
  margin: 0.55rem 0;
  padding: 0.75rem 0.85rem 0.65rem;
  border-radius: 18px;
  text-align: center;
  background: linear-gradient(135deg, #fff7fb 0%, #fff4d6 48%, #e9fff3 100%);
  border: 2px solid #f0c070;
  animation: level-pop 0.55s ease;
}

.level-up-kicker {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #c47b16;
}

.level-up-title {
  margin: 0.15rem 0 0.45rem;
  font-size: 1.15rem;
  font-weight: 800;
}

.level-up .rank-hint {
  text-align: center;
}

[data-theme="dark"] .level-up {
  background: linear-gradient(135deg, #2c2433 0%, #3a3018 52%, #1a3328 100%);
  border-color: var(--accent);
}

[data-theme="dark"] .level-up-kicker {
  color: var(--warn);
}

@media (prefers-reduced-motion: reduce) {
  .level-up {
    animation: none;
  }
}

@keyframes level-pop {
  0% {
    transform: scale(0.94);
  }

  55% {
    transform: scale(1.04);
  }

  100% {
    transform: scale(1);
  }
}

.top-status {
  background: var(--status-bg);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.2rem 0.65rem;
  font-size: 0.82rem;
  color: var(--ink);
  white-space: nowrap;
}

.scope-tabs {
  display: flex;
  gap: 0.35rem;
  margin-bottom: 0.45rem;
}

.scope-btn {
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  border-radius: 999px;
  padding: 0.22rem 0.7rem;
  font: inherit;
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
}

.scope-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.activity-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.3rem;
  max-height: 280px;
  overflow: auto;
}

.activity-list.compact {
  max-height: 180px;
}

.activity-list li {
  padding: 0.35rem 0.5rem;
  border-radius: 8px;
  background: var(--card-soft);
  border: 1px solid var(--line);
  font-size: 0.85rem;
}

.activity-list li.ok {
  border-left: 4px solid var(--ok);
}

.activity-list li.fail {
  border-left: 4px solid #e0a090;
}

/* 新動態／小亮點：滑入 + 紅／暖色閃後淡出 */
@keyframes feed-slide-in {
  0% {
    opacity: 0.4;
    transform: translateY(-12px);
    background: rgba(220, 80, 60, 0.42);
    box-shadow: inset 0 0 0 1px rgba(220, 80, 60, 0.55);
  }

  22% {
    opacity: 1;
    transform: translateY(0);
    background: rgba(232, 163, 23, 0.36);
    box-shadow: inset 0 0 0 1px rgba(232, 163, 23, 0.45);
  }

  100% {
    opacity: 1;
    transform: translateY(0);
    background: var(--card-soft);
    box-shadow: none;
  }
}

.activity-list li.feed-new,
.classmate-list li.feed-new {
  animation: feed-slide-in 2.2s ease-out both;
  z-index: 1;
}

.activity-list li.ok.feed-new,
.classmate-list.highlights li.feed-new {
  border-left-color: #e85a45;
}

@media (prefers-reduced-motion: reduce) {

  .activity-list li.feed-new,
  .classmate-list li.feed-new {
    animation: none;
    background: rgba(232, 163, 23, 0.28);
    transition: background 1.6s ease;
  }
}

.leaderboard {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.28rem;
}

.leaderboard li {
  display: grid;
  grid-template-columns: 1.6rem 1fr auto;
  gap: 0.3rem 0.45rem;
  align-items: center;
  padding: 0.3rem 0.45rem;
  border-radius: 8px;
  background: var(--card-soft);
  border: 1px solid var(--line);
  font-size: 0.86rem;
}

.leaderboard li .title {
  grid-column: 2 / -1;
  font-size: 0.78rem;
}

.leaderboard li.me {
  background: var(--me-bg);
  border-color: var(--me-line);
}

.leaderboard .rank {
  font-weight: 800;
  color: var(--primary-dark);
}

.leaderboard .pts {
  font-weight: 700;
}

.leaderboard.compact li {
  grid-template-columns: 1.6rem 1fr;
}

/* 題目側欄最佳成績：窄欄兩列排版，避免直排拆字 */
.leaderboard.board-list li {
  grid-template-columns: 1.5rem minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-items: start;
  gap: 0.15rem 0.4rem;
  padding: 0.4rem 0.5rem;
}

.leaderboard.board-list li.empty {
  grid-template-columns: 1fr;
}

.leaderboard.board-list .rank {
  grid-row: 1 / 3;
  align-self: center;
}

.leaderboard.board-list .name {
  grid-column: 2;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
}

.leaderboard.board-list .stats {
  grid-column: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 0.45rem;
  font-size: 0.78rem;
  line-height: 1.3;
  word-break: keep-all;
  overflow-wrap: normal;
}

.leaderboard.board-list .stats>span {
  white-space: nowrap;
}

.my-best {
  margin: 0.45rem 0 0;
  font-weight: 600;
  font-size: 0.82rem;
  line-height: 1.35;
  word-break: keep-all;
}

.points-chip {
  display: inline-block;
  background: var(--points-bg);
  color: var(--points-ink);
  font-weight: 800;
  border-radius: 999px;
  padding: 0.05rem 0.4rem;
  font-size: 0.8rem;
}

.points-gain {
  color: var(--points-ink);
  font-weight: 700;
  margin: 0.3rem 0;
}

/* ===== 本關積分色塊 ===== */
.problem-points {
  margin: 0.55rem 0 0.7rem;
  padding: 0.65rem 0.75rem;
  border-radius: 12px;
  border: 1px solid transparent;
  background: linear-gradient(135deg, #fff6e8 0%, #ffe8c4 100%);
  border-color: #f0c070;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.problem-points--empty {
  background: linear-gradient(135deg, #f3f5f7 0%, #e8ecf0 100%);
  border-color: #c5ced6;
}

.problem-points--mid {
  background: linear-gradient(135deg, #fff4df 0%, #ffd9a0 100%);
  border-color: #e0a84a;
}

.problem-points--high {
  background: linear-gradient(135deg, #e8f7ef 0%, #c8ebd6 100%);
  border-color: #5aaa78;
}

.problem-points--full {
  background: linear-gradient(135deg, #dff3ea 0%, #9fd9b8 100%);
  border-color: #2f9e6a;
}

.problem-points-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  margin-bottom: 0.2rem;
}

.problem-points-label {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #6b4a12;
}

.problem-points--empty .problem-points-label {
  color: #4a5560;
}

.problem-points--high .problem-points-label,
.problem-points--full .problem-points-label {
  color: #1f5a3a;
}

.problem-points-tag {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.08rem 0.45rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.65);
  color: inherit;
}

.problem-points-score {
  display: flex;
  align-items: baseline;
  gap: 0.2rem;
  line-height: 1;
  margin: 0.15rem 0 0.35rem;
}

.problem-points-now {
  font-size: 1.85rem;
  font-weight: 900;
  color: #8a4b00;
}

.problem-points--empty .problem-points-now {
  color: #5a6570;
}

.problem-points--high .problem-points-now,
.problem-points--full .problem-points-now {
  color: #176b42;
}

.problem-points-sep {
  font-size: 1.1rem;
  font-weight: 700;
  opacity: 0.55;
}

.problem-points-max {
  font-size: 1.15rem;
  font-weight: 800;
  opacity: 0.75;
}

.problem-points-bar {
  height: 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.08);
  overflow: hidden;
}

.problem-points-bar>span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #e89a3c, #f0c060);
}

.problem-points--high .problem-points-bar>span,
.problem-points--full .problem-points-bar>span {
  background: linear-gradient(90deg, #2f9e6a, #6fbf73);
}

.problem-points-hint {
  margin: 0.4rem 0 0.35rem;
  font-size: 0.8rem;
  line-height: 1.35;
  color: rgba(0, 0, 0, 0.72);
}

.problem-points-items {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.18rem;
}

.problem-points-items li {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.12rem 0.35rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.45);
}

.problem-points-items li.got {
  color: #176b42;
}

.problem-points-items li.miss {
  color: rgba(0, 0, 0, 0.45);
}

[data-theme="dark"] .problem-points {
  background: linear-gradient(135deg, #3a3018 0%, #2c2414 100%);
  border-color: #8a6a30;
  box-shadow: none;
}

[data-theme="dark"] .problem-points--empty {
  background: linear-gradient(135deg, #2a3038 0%, #1f252c 100%);
  border-color: #4a5560;
}

[data-theme="dark"] .problem-points--high,
[data-theme="dark"] .problem-points--full {
  background: linear-gradient(135deg, #1a3428 0%, #143528 100%);
  border-color: #3d8f68;
}

[data-theme="dark"] .problem-points-label,
[data-theme="dark"] .problem-points-now,
[data-theme="dark"] .problem-points-hint,
[data-theme="dark"] .problem-points-items li.miss {
  color: #f0d9a8;
}

[data-theme="dark"] .problem-points--high .problem-points-label,
[data-theme="dark"] .problem-points--full .problem-points-label,
[data-theme="dark"] .problem-points--high .problem-points-now,
[data-theme="dark"] .problem-points--full .problem-points-now,
[data-theme="dark"] .problem-points-items li.got {
  color: #9fd9b8;
}

[data-theme="dark"] .problem-points-tag,
[data-theme="dark"] .problem-points-items li {
  background: rgba(0, 0, 0, 0.25);
}

[data-theme="dark"] .problem-points-bar {
  background: rgba(255, 255, 255, 0.12);
}

.check-row {
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
}

.check-row input {
  width: auto;
}

.zone-label {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 0.05rem 0.4rem;
  border-radius: 999px;
  margin-right: 0.25rem;
  color: #fff;
}

.zone-label.goal {
  background: var(--zone-goal);
}

.zone-label.input {
  background: var(--zone-input);
}

.zone-label.output {
  background: var(--zone-output);
}

.zone-label.sample {
  background: var(--zone-sample);
}

.zone-label.hint {
  background: var(--zone-hint);
}

.zone-label.learn {
  background: #e67a2e;
}

.learn-cta-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin: 0.35rem 0 0.7rem;
}

.btn.learn-cta {
  background: linear-gradient(135deg, #f09030, #e25a1c);
  color: #fff;
  border: none;
  font-weight: 800;
  box-shadow: 0 2px 0 #c44a12;
  padding: 0.45rem 0.95rem;
}

.btn.learn-cta:hover {
  filter: brightness(1.05);
}

.btn.submit-locked {
  background: #9aa3ad;
  color: #f4f6f8;
  border: 1px solid #8a939c;
  cursor: pointer;
  font-weight: 700;
}

.btn.submit-locked:hover {
  background: #8b949e;
}

.learn-submit-hint {
  margin: 0.35rem 0 0;
  font-size: 0.85rem;
}

.learn-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem;
  background: rgba(20, 24, 30, 0.55);
}

.learn-modal[hidden] {
  display: none !important;
}

.learn-modal-card {
  width: min(820px, 94vw);
  max-height: min(88vh, 960px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0;
  background: var(--card);
  color: var(--ink);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
  transition: width 0.18s ease, max-height 0.18s ease;
}

.learn-modal-card.is-expanded {
  width: min(1240px, 96vw);
  max-height: 94vh;
  height: 94vh;
}

.learn-modal-card.skip-learn-card {
  width: min(440px, 92vw);
  max-height: none;
  height: auto;
  overflow: auto;
}

.learn-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--line);
  background: var(--card-soft);
  flex: 0 0 auto;
}

.learn-dialog-actions {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.learn-dialog-head h2 {
  margin: 0;
  font-size: 1.05rem;
}

.learn-dialog-body {
  padding: 0.85rem 1rem 1.1rem;
  overflow: auto;
  flex: 1 1 auto;
  min-height: 0;
}

.learn-video-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.learn-video-list li a {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
}

.learn-video-list li a:hover {
  border-color: #e67a2e;
  text-decoration: none;
}

.skip-learn-form {
  padding: 1rem 1.1rem 1.15rem;
}

.skip-learn-form h2 {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
}

.skip-learn-form .error {
  color: var(--danger, #c0392b);
  font-weight: 700;
  margin: 0.35rem 0 0;
}

.learn-panel {
  font-size: 0.92rem;
}

.learn-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.learn-step {
  background: var(--card-soft);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.65rem 0.75rem;
  border-left: 4px solid #5b8def;
}

.learn-step h3 {
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
}

.learn-body {
  white-space: pre-wrap;
  line-height: 1.45;
  margin: 0.2rem 0;
}

.learn-code {
  white-space: pre-wrap;
  word-break: break-word;
  background: var(--pre-bg);
  color: var(--pre-ink);
  padding: 0.55rem 0.65rem;
  border-radius: 8px;
  margin: 0.25rem 0;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.85rem;
}

.learn-video {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  margin: 0.4rem 0;
  border-radius: 8px;
  overflow: hidden;
  background: #000;
}

.learn-video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.quiz-item {
  margin: 0.55rem 0;
  padding-bottom: 0.4rem;
  border-bottom: 1px dashed var(--line);
}

.quiz-item:last-of-type {
  border-bottom: 0;
}

.quiz-q {
  margin: 0 0 0.35rem;
  font-weight: 700;
}

.quiz-choices {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.quiz-choice {
  text-align: left;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  border-radius: 8px;
  padding: 0.35rem 0.55rem;
  font: inherit;
  cursor: pointer;
}

.quiz-choice:hover {
  border-color: var(--primary);
}

.quiz-choice.correct {
  border-color: var(--ok);
  background: var(--badge-pass-bg);
}

.quiz-choice.wrong {
  border-color: var(--danger, #c0392b);
  background: #fdecea;
}

[data-theme="dark"] .quiz-choice.wrong {
  background: #3a1f1f;
}

.drill-form {
  display: flex;
  gap: 0.4rem;
  align-items: center;
  margin-top: 0.35rem;
  flex-wrap: wrap;
}

.drill-form--multi {
  align-items: flex-end;
}

.drill-input {
  flex: 1;
  min-width: 8rem;
  font: inherit;
  padding: 0.35rem 0.5rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
}

textarea.drill-input {
  resize: vertical;
  line-height: 1.45;
  min-height: 3.2rem;
  font-family: Consolas, "Courier New", monospace;
}

.learn-done-banner {
  background: var(--badge-pass-bg);
  color: var(--ok);
  border-radius: 8px;
  padding: 0.45rem 0.6rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
}

.learn-reminder {
  background: var(--badge-todo-bg);
  color: var(--warn);
  border-radius: 8px;
  padding: 0.4rem 0.55rem;
  margin: 0.4rem 0;
  font-weight: 600;
}

.quiz-feedback.ok,
.drill-feedback.ok,
.learn-award {
  color: var(--ok);
  font-weight: 600;
}

.quiz-feedback.error,
.drill-feedback.error {
  color: var(--danger, #c0392b);
  font-weight: 600;
}

.class-card-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.class-card {
  display: block;
  min-width: 11rem;
  flex: 1 1 11rem;
  max-width: 16rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card-soft);
  color: inherit;
  text-decoration: none;
}

.class-card p {
  margin: 0.35rem 0;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin: 0.2rem 0 0.4rem;
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.level-scroll {
  overflow-x: auto;
  margin-top: 0.6rem;
}

.level-grid {
  border-collapse: separate;
  border-spacing: 0;
  width: max-content;
  min-width: 100%;
}

.level-grid th,
.level-grid td {
  padding: 0.28rem 0.2rem;
  text-align: center;
  background: var(--card);
}

.level-name {
  position: sticky;
  left: 0;
  z-index: 2;
  text-align: left;
  min-width: 7.5rem;
  max-width: 11rem;
  padding-right: 0.6rem;
  box-shadow: 1px 0 0 var(--line);
}

.level-grid thead .level-name {
  z-index: 3;
}

.track-head {
  border-bottom: 1px solid var(--line);
  font-size: 0.85rem;
}

.level-num {
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 600;
}

.track-start {
  border-left: 2px solid var(--line);
}

.level-dot {
  position: relative;
  display: inline-block;
  width: 0.95rem;
  height: 0.95rem;
  border-radius: 50%;
  box-sizing: border-box;
  vertical-align: middle;
}

.level-dot.empty {
  background: transparent;
  border: 2px solid #b7c4bc;
}

.level-dot.half {
  background: linear-gradient(90deg, var(--ok) 50%, transparent 50%);
  border: 2px solid var(--ok);
}

.level-dot.done {
  background: var(--ok);
  border: 2px solid var(--ok);
}

.level-float {
  position: fixed;
  z-index: 30;
  max-width: 18rem;
  padding: 0.45rem 0.6rem;
  border-radius: 8px;
  background: var(--pre-bg);
  color: var(--pre-ink);
  font-size: 0.82rem;
  line-height: 1.45;
  pointer-events: none;
  box-shadow: var(--shadow);
}

.lock-tag {
  display: inline-block;
  margin-left: 0.25rem;
  color: var(--danger);
  font-size: 0.75rem;
  font-weight: 700;
}

.curve-summary {
  margin: 0.4rem 0 0.8rem;
}

.curve-scroll {
  overflow-x: auto;
  padding-bottom: 0.2rem;
}

.curve-plot {
  display: flex;
  align-items: flex-end;
  gap: 0.45rem;
  width: max-content;
  min-width: 100%;
  min-height: 10.5rem;
}

.curve-col {
  flex: 0 0 2.7rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
}

.curve-students {
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.2;
}

.curve-track {
  height: 7.5rem;
  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.curve-bar {
  position: relative;
  width: 1.15rem;
  min-height: 3px;
  overflow: hidden;
  background: var(--badge-todo-bg);
  border-radius: 4px 4px 0 0;
}

.curve-pass {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--ok);
  border-radius: 0 0 0 0;
}

.curve-bar .curve-pass {
  border-radius: 0;
}

.curve-time {
  margin-top: 0.28rem;
  font-size: 0.68rem;
  color: var(--muted);
  white-space: nowrap;
}

a.scope-btn {
  display: inline-block;
  text-decoration: none;
}

.teacher-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.8rem;
}

.sort-link {
  color: inherit;
  text-decoration: none;
}

.sort-link.active {
  color: var(--primary);
}

.pager {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.8rem;
}

.sub-list {
  display: grid;
  gap: 0.45rem;
}

.sub-item {
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.35rem;
}

.sub-item summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.8rem;
  align-items: baseline;
  cursor: pointer;
}

.sub-time {
  color: var(--muted);
  font-size: 0.85rem;
}

.sub-title {
  font-weight: 700;
}

.sub-body {
  margin: 0.45rem 0 0.2rem 1.1rem;
}
/* Read-only judge feedback, shared by student and teaching results. */
.learning-feedback{border-left:4px solid var(--accent);padding:8px 12px;margin-bottom:12px;background:var(--card);border-radius:6px}.learning-feedback h3{margin:0 0 6px}.feedback-diff-wrap{overflow-x:auto}.feedback-diff{width:100%;table-layout:fixed;border-collapse:collapse}.feedback-diff th:first-child{width:3em}.feedback-diff th,.feedback-diff td{border:1px solid var(--line);padding:6px;text-align:left;vertical-align:top}.feedback-diff code{white-space:pre-wrap;overflow-wrap:anywhere}
@media(max-width:860px){.result-area-wrap:has(.learning-feedback){max-height:none;overflow:visible}}

.progress-filters,.progress-paging{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin:12px 0}.progress-filters label{display:flex;align-items:center;gap:6px}.progress-filters input,.progress-filters select{max-width:100%;min-width:0}.progress-paging{font-size:14px}.progress-paging .btn{min-height:40px}@media(max-width:600px){.progress-filters label{width:100%}.progress-filters input{flex:1}}
