:root {
  --ink: #18201f;
  --muted: #66706e;
  --line: #d7dfdc;
  --paper: #fff;
  --wash: #f3f6f4;
  --panel: #eaf0ed;
  --accent: #147568;
  --accent-dark: #0d594f;
  --amber: #9b6418;
  --danger: #a23f35;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--wash); }
body { margin: 0; color: var(--ink); background: var(--wash); font-family: "Segoe UI Variable Text", "Segoe UI", "Microsoft YaHei", sans-serif; letter-spacing: 0; }
button, input, textarea, select { font: inherit; letter-spacing: 0; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, a:focus-visible { outline: 3px solid rgba(20,117,104,.24); outline-offset: 2px; }
::selection { color: #fff; background: var(--accent); }
.workspace { min-height: 100vh; }
.topbar { position: sticky; z-index: 20; top: 0; display: flex; align-items: center; justify-content: space-between; min-height: 68px; padding: 0 24px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.96); }
.brand-link { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; }
.brand-link strong, .brand-link small { display: block; }
.brand-link strong { font-size: 15px; }
.brand-link small { margin-top: 2px; color: var(--muted); font-size: 11px; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 6px; color: #fff; background: var(--accent); font-weight: 800; }
.topbar-actions { display: flex; align-items: center; gap: 16px; }
.text-link { color: var(--accent-dark); font-size: 12px; font-weight: 700; text-underline-offset: 3px; }
.status-badge { display: inline-flex; align-items: center; min-height: 24px; padding: 3px 8px; border: 1px solid #c7d2ce; border-radius: 4px; color: #40504c; background: #f7f9f8; font-size: 10px; font-weight: 750; }
.entry-panel { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 440px); gap: 56px; align-items: center; width: min(980px, calc(100% - 40px)); min-height: calc(100vh - 68px); margin: auto; }
.entry-panel h1 { margin: 0 0 10px; font-size: clamp(28px, 4vw, 46px); line-height: 1.08; }
.entry-panel > div > p { max-width: 56ch; margin: 0; color: var(--muted); font-size: 14px; line-height: 1.8; }
.entry-form { display: grid; gap: 10px; padding: 24px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); }
label { color: #3e4a47; font-size: 12px; font-weight: 750; }
input, textarea, select { width: 100%; border: 1px solid #bfcac6; border-radius: 5px; color: var(--ink); background: var(--paper); }
input, select { min-height: 42px; padding: 0 11px; }
textarea { padding: 11px; resize: vertical; line-height: 1.65; }
input:focus, textarea:focus, select:focus { border-color: var(--accent); outline: 0; box-shadow: 0 0 0 2px rgba(20,117,104,.12); }
.inline-form { display: flex; gap: 8px; }
.inline-form button { flex: 0 0 auto; min-width: 92px; padding: 0 14px; white-space: nowrap; }
button { min-height: 38px; border: 1px solid var(--accent); border-radius: 5px; color: #fff; background: var(--accent); font-weight: 700; }
button:hover { background: var(--accent-dark); }
button:disabled { cursor: default; opacity: .5; }
.form-error { min-height: 18px; margin: 0; color: var(--danger); font-size: 11px; line-height: 1.5; }

.task-layout { display: grid; grid-template-columns: 252px minmax(420px, 1fr) 300px; min-height: calc(100vh - 68px); }
.task-nav, .feedback-panel { position: sticky; top: 68px; height: calc(100vh - 68px); overflow-y: auto; background: #f8faf8; }
.task-nav { padding: 18px 14px; border-right: 1px solid var(--line); }
.feedback-panel { padding: 18px 14px; border-left: 1px solid var(--line); }
.nav-heading, .panel-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.nav-heading strong, .panel-heading h2 { margin: 0; font-size: 13px; }
.nav-heading span { color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.nav-unit { margin-bottom: 20px; }
.nav-unit h2 { margin: 0 0 7px; color: #47524f; font-size: 11px; line-height: 1.45; }
.stage-link { display: grid; grid-template-columns: 24px 1fr auto; gap: 7px; align-items: center; width: 100%; min-height: 36px; margin: 3px 0; padding: 5px 7px; border-color: transparent; color: #46514e; background: transparent; text-align: left; font-size: 11px; font-weight: 600; }
.stage-link:hover { color: var(--ink); background: var(--panel); }
.stage-link.active { border-color: #b9c9c4; color: var(--accent-dark); background: #e6efeb; }
.stage-link > span:first-child { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 4px; color: #54615e; background: #e4e9e7; font-size: 10px; }
.stage-link.done > span:first-child { color: #fff; background: var(--accent); }
.stage-link b { color: #7a8582; font-size: 9px; font-weight: 650; }
.boundary-note { padding: 11px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; line-height: 1.65; }
.task-surface { width: min(820px, 100%); margin: 0 auto; padding: 32px clamp(22px, 5vw, 62px) 60px; }
.task-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.task-header p { margin: 0 0 6px; color: var(--accent-dark); font-size: 11px; font-weight: 750; }
.task-header h1 { margin: 0; font-size: 23px; line-height: 1.3; }
.version-label { flex: 0 0 auto; color: var(--muted); font-size: 10px; }
.stage-context { margin-bottom: 28px; }
.core-question { margin: 0 0 18px; padding-bottom: 18px; border-bottom: 1px solid var(--line); font-size: 15px; font-weight: 650; line-height: 1.7; }
.stage-context dl { margin: 0; }
.stage-context dl div { display: grid; grid-template-columns: 92px 1fr; gap: 16px; padding: 8px 0; }
.stage-context dt { color: var(--muted); font-size: 11px; font-weight: 700; }
.stage-context dd { margin: 0; font-size: 12px; line-height: 1.65; }
.evidence-form { display: grid; gap: 9px; }
.mode-control { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-bottom: 12px; padding: 4px; border-radius: 6px; background: #e8eeeb; }
.mode-control button { min-height: 32px; border-color: transparent; color: #52605c; background: transparent; font-size: 10px; }
.mode-control button:hover { background: #dce6e1; }
.mode-control button.active { color: #fff; background: var(--accent); }
.save-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 8px; }
.save-status { color: var(--muted); font-size: 10px; line-height: 1.5; }
.save-row button { padding: 0 15px; }
.panel-heading button, .review-queue header button { min-height: 30px; padding: 0 9px; border-color: #c7d2ce; color: var(--accent-dark); background: var(--paper); font-size: 10px; }
.feedback-list { display: grid; gap: 9px; }
.feedback-item { padding: 11px; border: 1px solid var(--line); border-radius: 6px; background: var(--paper); }
.feedback-item > div:first-child { display: flex; justify-content: space-between; color: var(--muted); font-size: 9px; }
.feedback-item p { margin: 9px 0; font-size: 11px; line-height: 1.6; }
.feedback-actions { display: flex; justify-content: flex-end; }
.feedback-actions button { min-height: 30px; padding: 0 9px; font-size: 10px; }
.empty-state { margin: 28px 10px; color: var(--muted); font-size: 11px; line-height: 1.7; text-align: center; }

.summary-band { display: grid; grid-template-columns: repeat(4, 1fr); border-bottom: 1px solid var(--line); background: var(--paper); }
.summary-band div { display: flex; align-items: baseline; justify-content: space-between; min-height: 76px; padding: 20px 28px; border-right: 1px solid var(--line); }
.summary-band div:last-child { border-right: 0; }
.summary-band span { color: var(--muted); font-size: 11px; }
.summary-band strong { font-size: 24px; font-variant-numeric: tabular-nums; }
.dimension-section { padding: 24px clamp(18px, 4vw, 52px); border-bottom: 1px solid var(--line); background: #f8faf8; }
.dimension-section header { margin-bottom: 12px; }
.dimension-section h2 { margin: 0; font-size: 15px; }
.dimension-section p { margin: 4px 0 0; color: var(--muted); font-size: 10px; }
.dimension-table-wrap { overflow-x: auto; }
.dimension-section table { width: 100%; min-width: 620px; border-collapse: collapse; background: var(--paper); }
.dimension-section th, .dimension-section td { padding: 10px 12px; border: 1px solid var(--line); font-size: 10px; text-align: left; }
.dimension-section thead th { color: #47524f; background: #edf2ef; }
.dimension-section tbody th { font-weight: 750; }
.dimension-value { display: inline-block; min-width: 68px; padding: 4px 6px; border-radius: 4px; font-variant-numeric: tabular-nums; text-align: center; }
.dimension-value.na { color: var(--muted); background: #edf0ef; }
.dimension-value.strong { color: #0c594d; background: #dcece6; }
.dimension-value.developing { color: #6f4b14; background: #f2e8d7; }
.dimension-value.review { color: var(--danger); background: #f3e1df; }
.table-empty { color: var(--muted); text-align: center !important; }
.teacher-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: calc(100vh - 145px); }
.participant-panel { padding: 22px 14px; border-right: 1px solid var(--line); background: #f8faf8; }
.participant-panel h2 { margin: 0 7px 12px; font-size: 13px; }
.participant-link { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 38px; padding: 7px 9px; border-color: transparent; color: #46514e; background: transparent; font-size: 11px; text-align: left; }
.participant-link:hover, .participant-link.active { color: var(--accent-dark); background: var(--panel); }
.participant-link b { color: var(--muted); font-size: 9px; }
.review-queue { padding: 28px clamp(20px, 4vw, 56px) 60px; }
.review-queue > header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 22px; }
.review-queue h1 { margin: 0; font-size: 22px; }
.review-queue header p { margin: 5px 0 0; color: var(--muted); font-size: 11px; }
.review-row { padding: 16px 0; border-bottom: 1px solid var(--line); }
.review-meta { display: flex; flex-wrap: wrap; gap: 6px 12px; color: var(--muted); font-size: 10px; }
.review-meta span:first-child { color: var(--accent-dark); font-weight: 750; }
.review-row > p { max-width: 76ch; margin: 11px 0; font-size: 12px; line-height: 1.7; }
.review-actions { display: flex; align-items: center; justify-content: flex-end; gap: 9px; }
.review-actions button { min-height: 32px; padding: 0 10px; font-size: 10px; }
dialog { width: min(620px, calc(100% - 28px)); max-height: calc(100vh - 40px); padding: 0; overflow: auto; border: 0; border-radius: 8px; box-shadow: 0 18px 55px rgba(20,35,31,.2); }
dialog::backdrop { background: rgba(18,29,26,.42); }
dialog form { display: grid; gap: 9px; padding: 22px; }
.rubric-fields { display: grid; grid-template-columns: 1.2fr 1fr .7fr 1fr; gap: 8px; }
.rubric-fields > div { display: grid; gap: 6px; }
dialog header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 5px; }
dialog h2 { margin: 0; font-size: 18px; }
dialog header button { min-height: 30px; padding: 0; border: 0; color: var(--accent-dark); background: transparent; font-size: 11px; }
.review-target { max-height: 180px; overflow: auto; padding: 11px; background: var(--wash); }
.review-target p { margin: 6px 0 0; font-size: 11px; line-height: 1.6; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.dialog-actions button:first-child { border-color: #bdc8c4; color: var(--ink); background: var(--paper); }

@media (max-width: 1120px) {
  .task-layout { grid-template-columns: 230px minmax(0, 1fr); }
  .feedback-panel { position: static; grid-column: 1 / -1; width: 100%; height: auto; border-top: 1px solid var(--line); border-left: 0; }
  .feedback-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .topbar { min-height: 60px; padding: 0 14px; }
  .brand-link small, .topbar .status-badge { display: none; }
  .entry-panel { display: block; width: calc(100% - 28px); min-height: auto; padding: 56px 0; }
  .entry-panel > div { margin-bottom: 28px; }
  .entry-panel h1 { font-size: 30px; }
  .entry-form { padding: 18px; }
  .inline-form { display: grid; }
  .task-layout, .teacher-layout { display: block; }
  .task-nav { position: static; width: 100%; height: auto; max-height: 330px; border-right: 0; border-bottom: 1px solid var(--line); }
  .task-surface { padding: 24px 15px 44px; }
  .stage-context dl div { grid-template-columns: 76px 1fr; gap: 10px; }
  .mode-control { grid-template-columns: 1fr 1fr; }
  .save-row { align-items: stretch; flex-direction: column; }
  .feedback-list { grid-template-columns: 1fr; }
  .summary-band { grid-template-columns: 1fr 1fr; }
  .summary-band div { min-height: 64px; padding: 14px; border-bottom: 1px solid var(--line); }
  .participant-panel { border-right: 0; border-bottom: 1px solid var(--line); }
  .review-queue { padding: 22px 15px 44px; }
  .rubric-fields { grid-template-columns: 1fr 1fr; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; } }
