:root {
  color: #183b34;
  background: #f4f7f5;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Microsoft YaHei", sans-serif;
  font-synthesis: none;
  --ink: #183b34;
  --ink-soft: #48645d;
  --muted: #71847d;
  --line: #dce8e3;
  --line-strong: #c6d8d1;
  --paper: #ffffff;
  --paper-soft: #f8fbf9;
  --green: #19735d;
  --green-dark: #103f34;
  --green-pale: #e5f2ec;
  --amber: #c6812d;
  --red: #a44c4c;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: #f4f7f5; color: var(--ink); }
button, input, select { font: inherit; }
button { cursor: pointer; }
.topbar { min-height: 88px; padding: 16px clamp(18px, 4vw, 60px); display: flex; align-items: center; justify-content: space-between; gap: 24px; color: #fff; background: var(--green-dark); border-bottom: 3px solid #d3a65c; }
.brand { display: flex; align-items: center; gap: 14px; min-width: 0; }
.brand-mark { width: 42px; height: 42px; display: grid; place-items: center; flex: 0 0 auto; border: 1px solid #d8b772; color: #f8dfae; font: 800 13px/1 Inter, sans-serif; letter-spacing: .08em; }
.topbar h1 { margin: 4px 0 2px; font-size: 23px; line-height: 1.2; letter-spacing: .01em; }
.topbar p { margin: 0; color: #bdd2cb; font-size: 12px; }
.eyebrow, .section-kicker { display: block; color: #8db4a8; font-size: 10px; font-weight: 800; letter-spacing: .16em; line-height: 1.4; }
.topbar .eyebrow { color: #c0d9d1; }
.account { display: flex; align-items: center; gap: 11px; white-space: nowrap; font-size: 14px; }
.account-label { color: #91b5aa; font-size: 11px; }
.account button { min-height: 40px; padding: 8px 14px; color: #e8f4f0; background: #ffffff10; border: 1px solid #ffffff31; border-radius: 6px; font-weight: 700; }
.account button:hover { background: #ffffff1d; }
.layout { max-width: 1560px; min-height: calc(100vh - 88px); margin: 0 auto; display: grid; grid-template-columns: 274px minmax(0, 1fr); }
.sidebar { padding: 30px 20px; background: #fbfdfc; border-right: 1px solid var(--line); }
.sidebar-intro { margin-bottom: 18px; }
.side-title { margin: 5px 0 2px; font-size: 18px; font-weight: 850; }
.sidebar-intro p { margin: 0; color: var(--muted); font-size: 12px; }
.class-list { display: grid; gap: 7px; }
.class-item { position: relative; width: 100%; padding: 12px 13px; color: var(--ink); text-align: left; background: transparent; border: 1px solid transparent; border-radius: 7px; transition: background .18s, border-color .18s; }
.class-item:hover { background: var(--paper-soft); border-color: var(--line); }
.class-item.active { background: var(--green-pale); border-color: #acd1c2; }
.class-item.active::before { content: ""; position: absolute; top: 9px; bottom: 9px; left: -1px; width: 3px; background: var(--green); }
.class-item small { display: block; margin-top: 5px; color: var(--muted); font-size: 11px; }
.compact-form { margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--line); }
.compact-form label { display: block; margin-bottom: 8px; color: var(--ink-soft); font-size: 12px; font-weight: 800; }
.create-row { display: flex; gap: 6px; }
.compact-form input, .student-form input, .filters input, .filters select { min-width: 0; padding: 10px 11px; color: var(--ink); background: var(--paper); border: 1px solid var(--line-strong); border-radius: 6px; outline: none; }
.compact-form input:focus, .student-form input:focus, .filters input:focus, .filters select:focus { border-color: var(--green); box-shadow: 0 0 0 3px #19735d18; }
.create-row input { width: 100%; }
.compact-form button, .student-form button, .filters button, .workspace-head button { min-height: 42px; padding: 9px 14px; color: #fff; background: var(--green); border: 1px solid var(--green); border-radius: 6px; font-weight: 800; white-space: nowrap; }
.compact-form button:hover, .student-form button:hover, .filters button:hover, .workspace-head button:hover { background: #125b49; }
.feedback { min-height: 19px; padding-top: 8px; color: var(--red); font-size: 12px; }
.sidebar-note { display: flex; gap: 8px; margin-top: 28px; padding: 11px 10px; color: var(--muted); background: #f1f7f4; border-left: 2px solid #a9cdbd; }
.sidebar-note span { display: grid; place-items: center; width: 17px; height: 17px; flex: 0 0 auto; color: var(--green); border: 1px solid #abd0bf; border-radius: 50%; font-size: 11px; font-weight: 800; }
.sidebar-note p { margin: 0; font-size: 11px; line-height: 1.55; }
.content { min-width: 0; padding: 35px clamp(20px, 4vw, 64px) 56px; }
.workspace-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.workspace-actions { display: flex; align-items: center; gap: 8px; }
.workspace-actions .secondary-action { min-height: 42px; padding: 9px 14px; color: var(--green); background: var(--paper); border: 1px solid var(--line-strong); border-radius: 6px; font-weight: 800; white-space: nowrap; }
.workspace-actions .secondary-action:hover { background: var(--paper-soft); }
.workspace-actions button:disabled { cursor: wait; opacity: .65; }
.workspace-title h2 { margin: 7px 0 8px; color: var(--ink); font-size: clamp(25px, 3vw, 34px); line-height: 1.1; letter-spacing: -.02em; }
.workspace-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.join-code { color: var(--green); font-size: 13px; font-weight: 800; }
.live-dot { color: var(--muted); font-size: 11px; }
.live-dot::before { content: ""; display: inline-block; width: 6px; height: 6px; margin: 0 6px 1px 0; background: #48a36d; border-radius: 50%; }
.primary-action { display: inline-flex; align-items: center; gap: 8px; }
.primary-action span { font-size: 18px; font-weight: 400; line-height: 1; }
.tabs { display: flex; gap: 2px; margin: 22px 0 28px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs button { position: relative; min-height: 44px; padding: 10px 15px; color: var(--muted); background: transparent; border: 0; font-size: 13px; font-weight: 750; white-space: nowrap; }
.tabs button:hover { color: var(--ink); }
.tabs button.active { color: var(--green); }
.tabs button.active::after { content: ""; position: absolute; right: 11px; bottom: -1px; left: 11px; height: 2px; background: var(--green); }
.panel-intro { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 13px; }
.panel-intro h3, .section-head h3 { margin: 4px 0 0; color: var(--ink); font-size: 18px; }
.panel-hint { color: var(--muted); font-size: 12px; }
.metrics { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); border: 1px solid var(--line); background: var(--paper); }
.metric { min-height: 93px; padding: 17px 18px; border-right: 1px solid var(--line); }
.metric:nth-child(6n) { border-right: 0; }
.metric b { display: block; color: var(--green-dark); font-size: 28px; line-height: 1.1; letter-spacing: -.03em; }
.metric span { display: block; margin-top: 9px; color: var(--muted); font-size: 11px; }
.metric:first-child b { color: var(--ink); }
.metrics-error, .metrics-note { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 72px; padding: 14px 18px; color: var(--ink-soft); }
.metrics-error { color: var(--red); }
.metrics-error button { min-height: 38px; padding: 7px 14px; color: var(--green); background: var(--paper); border: 1px solid var(--line-strong); border-radius: 6px; font-weight: 800; }
.metrics-error button:hover { background: var(--green-pale); }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 31px 0 13px; }
.text-action { padding: 4px 0; color: var(--green); background: none; border: 0; font-size: 12px; font-weight: 800; }
.text-action:hover { color: var(--green-dark); }
.record-list { display: grid; gap: 8px; }
.record { display: grid; grid-template-columns: minmax(170px, 1.6fr) .85fr .65fr .85fr auto; align-items: center; gap: 16px; min-height: 62px; padding: 12px 15px; background: var(--paper); border: 1px solid var(--line); border-radius: 6px; }
.record:hover { border-color: #b7d1c5; box-shadow: 0 4px 16px #183b3408; }
.record b { font-size: 13px; }
.record span { color: var(--ink-soft); font-size: 12px; }
.record small, .muted { display: block; color: var(--muted); font-size: 11px; line-height: 1.5; }
.record button { justify-self: end; padding: 7px 8px; color: var(--green); background: transparent; border: 0; font-size: 12px; font-weight: 800; }
.record button:hover { text-decoration: underline; }
.filters { display: flex; align-items: center; gap: 8px; margin-bottom: 15px; }
.search-field { position: relative; display: block; max-width: 300px; flex: 1; }
.search-field span { position: absolute; top: 7px; left: 10px; color: var(--muted); font-size: 18px; }
.search-field input { width: 100%; padding-left: 31px; }
.filters input, .filters select { margin: 0; }
.filters select { min-width: 130px; }
.pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 15px; color: var(--muted); font-size: 12px; }
.pagination-actions { display: flex; gap: 7px; }
.pagination-actions button { min-height: 36px; padding: 7px 11px; color: var(--green); background: var(--paper); border: 1px solid var(--line-strong); border-radius: 6px; font-weight: 750; }
.pagination-actions button:hover:not(:disabled) { background: var(--green-pale); }
.pagination-actions button:disabled { color: #9aaaA4; cursor: not-allowed; background: #f5f8f6; }
.leaderboard { display: grid; gap: 7px; max-width: 840px; }
.rank { display: grid; grid-template-columns: 60px minmax(0, 1fr) 110px 110px; align-items: center; min-height: 60px; padding: 12px 15px; background: var(--paper); border: 1px solid var(--line); border-radius: 6px; }
.rank:first-child { background: #fffaf0; border-color: #e6ce9c; }
.rank:nth-child(2) { background: #f7faf9; }
.rank:nth-child(3) { background: #fbf8f4; }
.rank b { color: var(--amber); font-size: 17px; }
.rank span { color: var(--ink-soft); font-size: 13px; }
.rank strong { color: var(--green-dark); text-align: right; }
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; max-width: 920px; }
.settings-block { position: relative; display: grid; grid-template-columns: auto 1fr; gap: 13px; min-width: 0; padding: 18px; background: var(--paper); border: 1px solid var(--line); border-radius: 6px; }
.settings-block h3 { margin: 0 0 5px; font-size: 15px; }
.settings-block p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.settings-icon { display: grid; place-items: center; width: 30px; height: 30px; color: var(--green); background: var(--green-pale); border: 1px solid #c6e1d3; border-radius: 50%; font-weight: 800; }
.invite-block strong { display: inline-block; margin-top: 12px; color: var(--green-dark); font-size: 24px; letter-spacing: .12em; }
.settings-actions { grid-column: 2; display: flex; gap: 8px; flex-wrap: wrap; margin-top: 5px; }
.settings-actions button { min-height: 38px; padding: 8px 12px; color: var(--green); background: #f2f8f5; border: 1px solid #c7dfd3; border-radius: 6px; font-size: 12px; font-weight: 800; }
.settings-actions .danger-button { color: var(--red); background: #fff8f7; border-color: #ebd0cc; }
.student-form { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr 1.2fr auto; gap: 8px; margin-top: 8px; }
.student-form input { width: 100%; }
.settings-block > .feedback { grid-column: 1 / -1; }
.settings-help { grid-column: 1 / -1; }
.empty { padding: 62px 22px; text-align: center; color: var(--muted); background: var(--paper); border: 1px dashed var(--line-strong); }
.empty-icon { display: grid; place-items: center; width: 38px; height: 38px; margin: 0 auto 14px; color: var(--green); border: 1px solid #b5d6c6; font-size: 22px; }
.empty h2 { margin: 0 0 6px; color: var(--ink); font-size: 20px; }
.empty p { margin: 0 0 18px; font-size: 13px; }
.empty button { min-height: 40px; padding: 8px 14px; color: #fff; background: var(--green); border: 0; border-radius: 6px; font-weight: 800; }
dialog { width: min(920px, calc(100vw - 28px)); max-height: 88vh; padding: 0; color: var(--ink); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 24px 80px #183b3440; }
dialog#detail-dialog[open] { display: flex; flex-direction: column; overflow: hidden; }
dialog::backdrop { background: #103f3452; backdrop-filter: blur(2px); }
dialog > div:first-child, .detail-header { padding: 20px 22px; border-bottom: 1px solid var(--line); }
.detail-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.detail-header > div { min-width: 0; }
.detail-header h2 { overflow-wrap: anywhere; }
dialog h2 { margin: 5px 0 0; font-size: 21px; }
dialog [data-detail-close] { flex: 0 0 auto; min-width: 56px; min-height: 40px; padding: 8px 12px; color: var(--ink-soft); background: var(--paper-soft); border: 1px solid var(--line); border-radius: 6px; white-space: nowrap; }
dialog #detail-body { min-height: 0; flex: 1 1 auto; padding: 22px; overflow: auto; overscroll-behavior: contain; }
dialog #detail-body h3 { margin: 24px 0 10px; font-size: 15px; }
dialog table th, dialog table td { padding: 10px 8px; border-bottom: 1px solid var(--line); font-size: 12px; text-align: left; }
dialog table th { color: var(--muted); font-weight: 800; }
.learning-report { display: grid; gap: 18px; }
.learning-report-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 18px; background: var(--green-dark); color: #fff; border-radius: 7px; }
.learning-report-head .eyebrow { color: #bfd7cf; }
.learning-report-head h3 { margin: 6px 0 3px !important; color: #fff; font-size: 20px !important; }
.learning-report-head p { margin: 0; color: #d1e2dc; font-size: 12px; }
.report-formal-score { display: grid; gap: 4px; flex: 0 0 auto; text-align: right; }
.report-formal-score span, .report-overview span { color: var(--muted); font-size: 11px; }
.report-formal-score span { color: #bfd7cf; }
.report-formal-score strong { color: #f1d79f; font-size: 20px; }
.report-overview { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 7px; overflow: hidden; }
.report-overview > div { min-width: 0; display: grid; align-content: center; gap: 5px; padding: 14px; background: #fff; border-right: 1px solid var(--line); }
.report-overview > div:last-child { border-right: 0; }
.report-overview strong { overflow-wrap: anywhere; font-size: 14px; }
.report-overview small { color: var(--muted); font-size: 11px; }
.report-section { min-width: 0; padding-top: 16px; border-top: 1px solid var(--line); }
.report-section h4, .report-callout > strong { display: block; margin: 0 0 11px; color: var(--ink); font-size: 14px; }
.report-answer-list { display: grid; gap: 8px; }
.report-answer { padding: 11px 13px; background: var(--paper-soft); border: 1px solid var(--line); border-radius: 6px; }
.report-answer-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.report-answer-head strong { font-size: 13px; }
.report-answer p, .report-question p, .report-note p, .report-verdict p, .report-callout p { margin: 5px 0 0; line-height: 1.55; overflow-wrap: anywhere; }
.report-answer small, .report-question small, .report-note small { display: block; margin-top: 5px; color: var(--muted); line-height: 1.5; }
.answer-result { padding: 3px 7px; border-radius: 4px; background: #f4eeee; color: var(--red); font-size: 11px; white-space: nowrap; }
.answer-result.is-correct { background: var(--green-pale); color: var(--green); }
.report-empty { margin: 0; color: var(--muted); font-size: 12px; }
.report-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 6px; }
.report-trials { width: 100%; min-width: 900px; border-collapse: collapse; background: #fff; }
.report-trials th, .report-trials td { padding: 9px 8px; border-right: 1px solid var(--line); vertical-align: top; }
.report-trials th:last-child, .report-trials td:last-child { border-right: 0; }
.report-trials td { color: var(--ink-soft); }
.report-trials td strong, .report-trials td small { display: block; }
.report-trials td small { max-width: 220px; margin-top: 4px; color: var(--muted); line-height: 1.4; }
.report-audit { display: grid; gap: 8px; }
.report-plan { display: grid; gap: 4px; padding: 11px 13px; background: var(--green-pale); border-left: 3px solid var(--green); }
.report-plan span { color: var(--ink-soft); font-size: 12px; }
.report-question { padding: 11px 13px; background: #fff; border: 1px solid var(--line); border-radius: 6px; }
.report-question > strong { font-size: 12px; }
.report-verdict { padding: 13px; background: #fbf7ed; border: 1px solid #eee2c6; border-radius: 6px; }
.report-verdict > strong { color: #76511d; }
.report-verdict span { display: block; margin-top: 5px; font-size: 12px; }
.report-notes { display: grid; gap: 8px; }
.report-note { padding: 11px 13px; border-bottom: 1px solid var(--line); }
.report-note:first-child { border-top: 1px solid var(--line); }
.report-note > strong { font-size: 12px; }
.report-callout { padding: 14px 16px; background: var(--paper-soft); border-left: 3px solid var(--amber); border-radius: 3px; }
.report-callout p { margin-top: 0; }
.report-callout small { display: block; margin-top: 7px; color: var(--muted); line-height: 1.5; }
.legacy-report-note { margin: 0; padding: 10px 12px; background: #fbf7ed; color: #76511d; border: 1px solid #eee2c6; border-radius: 5px; font-size: 12px; }
.raw-records { margin-top: 18px; border: 1px solid var(--line); border-radius: 6px; background: var(--paper-soft); }
.raw-records summary { padding: 12px 14px; color: var(--ink-soft); cursor: pointer; font-size: 12px; font-weight: 750; }
.raw-record-section { padding: 0 14px 12px; }
.raw-record-section h4 { margin: 7px 0; font-size: 12px; }
.raw-record-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 11px; }
.raw-record-row small { grid-column: 1 / -1; color: var(--muted); overflow-wrap: anywhere; }
@media (max-width: 980px) {
  .layout { grid-template-columns: 224px minmax(0, 1fr); }
  .content { padding-right: 26px; padding-left: 26px; }
  .metrics { grid-template-columns: repeat(3, 1fr); }
  .metric:nth-child(3n) { border-right: 0; }
  .metric:nth-child(n+4) { border-top: 1px solid var(--line); }
  .metric:nth-child(4) { border-right: 1px solid var(--line); }
  .settings-grid { grid-template-columns: 1fr; }
  .settings-help { grid-column: auto; }
}
@media (max-width: 720px) {
  .topbar { align-items: flex-start; padding: 14px 17px; }
  .brand-mark { width: 36px; height: 36px; }
  .topbar h1 { font-size: 18px; }
  .topbar p, .account-label { display: none; }
  .account { gap: 7px; font-size: 12px; }
  .account button { min-height: 36px; padding: 7px 9px; }
  .layout { display: block; min-height: 0; }
  .sidebar { padding: 20px 17px 15px; border-right: 0; border-bottom: 1px solid var(--line); }
  .sidebar-intro { margin-bottom: 12px; }
  .class-list { display: flex; margin: 0 -17px; padding: 0 17px 4px; overflow-x: auto; }
  .class-item { min-width: 190px; }
  .compact-form { margin-top: 15px; padding-top: 14px; }
  .sidebar-note { display: none; }
  .content { padding: 24px 17px 42px; }
  .workspace-head { align-items: flex-start; flex-direction: column; gap: 17px; }
  .workspace-head button { width: 100%; justify-content: center; }
  .workspace-actions { width: 100%; }
  .workspace-actions button { width: auto; flex: 1; }
  .tabs { margin-top: 18px; margin-bottom: 22px; }
  .panel-intro { align-items: flex-start; flex-direction: column; gap: 5px; }
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .metric { min-height: 81px; padding: 14px; }
  .metric:nth-child(2) { border-right: 0; }
  .metric:nth-child(3) { border-top: 1px solid var(--line); border-right: 1px solid var(--line); }
  .metric:nth-child(4) { border-right: 0; }
  .metric:nth-child(5) { border-top: 1px solid var(--line); border-right: 1px solid var(--line); }
  .metric:nth-child(6) { grid-column: 1 / -1; border-top: 1px solid var(--line); border-right: 0; }
  .metric b { font-size: 24px; }
  .section-head { align-items: flex-start; }
  .record { grid-template-columns: minmax(0, 1fr) auto; gap: 5px 12px; padding: 13px; }
  .record > :nth-child(2), .record > :nth-child(3), .record > :nth-child(4) { font-size: 11px; }
  .record button { grid-column: 2; grid-row: 1 / span 2; }
  .filters { align-items: stretch; flex-wrap: wrap; }
  .search-field { max-width: none; flex-basis: 100%; }
  .filters select, .filters button { flex: 1; }
  .pagination { align-items: flex-start; flex-direction: column; }
  .pagination-actions { width: 100%; }
  .pagination-actions button { flex: 1; }
  .rank { grid-template-columns: 45px minmax(0, 1fr) 70px; gap: 8px; }
  .rank strong { grid-column: 3; grid-row: 1; font-size: 12px; }
  .rank span { font-size: 12px; }
  .student-form { grid-template-columns: 1fr; }
  .student-form button { width: 100%; }
  .settings-actions { grid-column: 1 / -1; }
  dialog { width: calc(100vw - 16px); max-height: 94vh; }
  dialog #detail-body { padding: 14px; }
  .learning-report-head { flex-direction: column; padding: 15px; }
  .report-formal-score { text-align: left; }
  .report-overview { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .report-overview > div { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
  .report-overview > div:nth-child(2n) { border-right: 0; }
  .report-overview > div:last-child { grid-column: 1 / -1; border-bottom: 0; }
}
