/* ══════════════════════════════════════════════════════════
   学生学习反馈系统 — 明亮、安静、面向教师的工作台
   显示字体: Space Grotesk · 正文: Inter/Noto Sans SC · 数据: JetBrains Mono
   ══════════════════════════════════════════════════════════ */

* { margin: 0; padding: 0; box-sizing: border-box; }

html {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Assignment planner: one weekly goal board fed by reusable learning resources. */
.assignment-planner-page .container { max-width: 1360px; }
.assignment-planner-shell { padding-bottom: 96px; }
.assignment-planner-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 28px;
    margin-bottom: 28px;
}
.assignment-planner-heading > div > span,
.assignment-resource-library > header span,
.assignment-feedback-inbox > header span {
    color: #628074;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .14em;
}
.assignment-planner-heading h1 { margin: 8px 0 10px; color: #263a3d; font-size: clamp(38px, 5vw, 58px); }
.assignment-planner-heading p { margin: 0; color: #718086; font-size: 15px; }
.assignment-create-tutor {
    flex: 0 0 auto;
    padding: 11px 15px;
    border: 1px solid #d7dfda;
    border-radius: 12px;
    background: rgba(255,255,255,.82);
    color: #315d57;
    font-weight: 700;
    text-decoration: none;
}
.assignment-planner-toolbar {
    display: grid;
    grid-template-columns: minmax(190px, .8fr) minmax(360px, 1.6fr) minmax(160px, .7fr) auto;
    gap: 16px;
    align-items: end;
    margin-bottom: 20px;
    padding: 16px 18px;
    border: 1px solid #dce2df;
    border-radius: 16px;
    background: rgba(255,255,255,.84);
}
.assignment-planner-toolbar > label { display: grid; gap: 7px; }
.assignment-planner-toolbar > label > span,
.assignment-feedback-indicator > span { color: #71817e; font-size: 11px; font-weight: 700; }
.assignment-planner-toolbar select,
.assignment-planner-toolbar input,
.assignment-resource-search input {
    width: 100%;
    min-height: 40px;
    border: 1px solid #d5ddd8;
    border-radius: 10px;
    background: #fff;
    color: #2b3d40;
    font: inherit;
}
.assignment-planner-toolbar select,
.assignment-planner-toolbar input { padding: 0 11px; }
.assignment-feedback-indicator {
    display: grid;
    min-width: 94px;
    min-height: 58px;
    place-items: center;
    align-content: center;
    border-left: 1px solid #dfe5e1;
}
.assignment-feedback-indicator strong { color: #526b65; font: 700 20px/1 var(--mono); }
.assignment-feedback-indicator.has-items strong { color: #a94e55; }
.assignment-planner-board { margin-top: 0; }
.assignment-planner-board .assignment-week-board { min-height: 332px; }
.assignment-drop-day {
    position: relative;
    transition: border-color .16s ease, background .16s ease, transform .16s ease;
}
.assignment-drop-day.is-drag-over {
    border-color: #3f8d7c;
    background: #eef8f4;
    transform: translateY(-2px);
}
.assignment-planner-card { cursor: grab; }
.assignment-planner-card:active { cursor: grabbing; }
.assignment-planner-card.has-unread-feedback {
    border-color: rgba(176, 75, 82, .34);
    border-left-color: #b04b52;
    background: #fffafa;
}
.assignment-planner-card > div { align-items: center; justify-content: space-between; }
.assignment-drag-hint { color: #93a09d; font-size: 9px; }
.assignment-place-selected {
    width: 100%;
    margin-top: 10px;
    padding: 8px;
    border: 1px dashed #65a293;
    border-radius: 9px;
    background: #f0f8f5;
    color: #2f685d;
    font-size: 11px;
    font-weight: 700;
}
.assignment-unscheduled-tray { margin-top: 18px; padding-top: 15px; border-top: 1px solid #e0e5e2; }
.assignment-unscheduled-tray > header { display: flex; gap: 10px; align-items: baseline; margin-bottom: 10px; }
.assignment-unscheduled-tray > header strong { color: #34494a; }
.assignment-unscheduled-tray > header span { color: #82908d; font-size: 11px; }
.assignment-unscheduled-tray > div { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.assignment-resource-library,
.assignment-feedback-inbox {
    margin-top: 26px;
    padding: 24px;
    border: 1px solid #dce2df;
    border-radius: 20px;
    background: rgba(255,255,255,.84);
}
.assignment-resource-library > header {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    align-items: end;
}
.assignment-resource-library h2,
.assignment-feedback-inbox h2 { margin: 7px 0 4px; color: #263a3d; font-size: 24px; }
.assignment-resource-library > header p { margin: 0; color: #758489; font-size: 12px; }
.assignment-resource-search { width: min(360px, 100%); }
.assignment-resource-search input { padding: 0 14px; }
.assignment-resource-filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0; }
.assignment-resource-filters button {
    padding: 7px 12px;
    border: 1px solid #d7dfda;
    border-radius: 999px;
    background: #fff;
    color: #657772;
    font-size: 11px;
}
.assignment-resource-filters button.is-active { border-color: #466f66; background: #466f66; color: #fff; }
.assignment-library-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    max-height: 520px;
    overflow: auto;
    padding: 2px;
}
.assignment-resource-card {
    display: grid;
    gap: 8px;
    min-height: 156px;
    padding: 16px;
    border: 1px solid #dfe5e1;
    border-left: 3px solid #75938b;
    border-radius: 14px;
    background: #fff;
    cursor: grab;
    outline: none;
    transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}
.assignment-library-grid .assignment-resource-card[hidden] {
    display: none !important;
}
.assignment-resource-card.type-tutor { border-left-color: #6b7fb2; }
.assignment-resource-card:hover,
.assignment-resource-card:focus-visible { border-color: #6d958a; box-shadow: 0 10px 28px rgba(43, 67, 62, .08); transform: translateY(-1px); }
.assignment-resource-card.is-selected { border-color: #397b6d; box-shadow: 0 0 0 3px rgba(57,123,109,.12); }
.assignment-resource-card > span { color: #698078; font-size: 10px; font-weight: 800; letter-spacing: .06em; }
.assignment-resource-card > strong { color: #263a3d; font-size: 16px; line-height: 1.4; }
.assignment-resource-card > p { margin: 0; color: #78868a; font-size: 11px; line-height: 1.6; }
.assignment-resource-card > footer { display: flex; justify-content: space-between; gap: 8px; align-self: end; }
.assignment-resource-card > footer b { color: #3b6f64; font-size: 10px; }
.assignment-resource-card > footer small { color: #909b98; font-size: 10px; }
.assignment-resource-empty,
.assignment-resource-no-results { grid-column: 1 / -1; padding: 34px; color: #82908d; text-align: center; }
.assignment-resource-empty p { margin-bottom: 0; }
.assignment-feedback-inbox > div { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.assignment-feedback-inbox a {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 5px 12px;
    padding: 15px;
    border: 1px solid #ead7d9;
    border-radius: 13px;
    background: #fffafa;
    color: inherit;
    text-decoration: none;
}
.assignment-feedback-inbox a span { grid-column: 1 / -1; color: #8c6669; font-size: 10px; }
.assignment-feedback-inbox a strong { color: #3a3334; }
.assignment-feedback-inbox a em { color: #9f4f55; font-size: 11px; font-style: normal; }
.assignment-planner-status {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 60;
    max-width: min(360px, calc(100vw - 40px));
    padding: 11px 15px;
    border-radius: 11px;
    background: #2f514c;
    color: #fff;
    box-shadow: 0 12px 34px rgba(35,54,52,.2);
    font-size: 12px;
    opacity: 0;
    pointer-events: none;
    transform: translateY(8px);
    transition: opacity .16s ease, transform .16s ease;
}
.assignment-planner-status:not(:empty) { opacity: 1; transform: translateY(0); }
.assignment-planner-status[data-kind="error"] { background: #8d4349; }
.assignment-planner.is-busy { cursor: progress; }
.assignment-planner.is-busy .assignment-resource-card,
.assignment-planner.is-busy .assignment-planner-card { pointer-events: none; opacity: .72; }

@media (max-width: 980px) {
    .assignment-planner-toolbar { grid-template-columns: 1fr 1fr; align-items: end; }
    .assignment-feedback-indicator { border-left: 0; border-top: 1px solid #dfe5e1; }
    .assignment-library-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .assignment-unscheduled-tray > div { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 680px) {
    .assignment-planner-heading,
    .assignment-resource-library > header { align-items: stretch; flex-direction: column; }
    .assignment-planner-toolbar { grid-template-columns: 1fr; }
    .assignment-planner-toolbar .assignment-week-nav { order: 3; }
    .assignment-feedback-indicator { min-height: 44px; grid-template-columns: 1fr auto; justify-content: stretch; padding-top: 10px; }
    .assignment-resource-library,
    .assignment-feedback-inbox { padding: 18px 14px; border-radius: 16px; }
    .assignment-library-grid,
    .assignment-feedback-inbox > div,
    .assignment-unscheduled-tray > div { grid-template-columns: 1fr; }
    .assignment-library-grid { max-height: 560px; }
    .assignment-planner-status { right: 16px; bottom: 16px; }
}
html::-webkit-scrollbar { width: 0; }

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

:root {
    /* 教师工作台：纸白底、雾灰分区、深蓝主操作 */
    color-scheme: light;
    --bg:          #f4f7fb;
    --surface:     #ffffff;
    --surface-2:   #f7f9fc;
    --surface-3:   #edf2f8;

    --line:        rgba(30,41,59,.10);
    --line-2:      rgba(30,41,59,.17);

    --accent:      #3568d4;
    --accent-hi:   #244fae;
    --accent-dim:  rgba(53,104,212,.095);
    --accent-line: rgba(53,104,212,.28);
    --glow:        rgba(53,104,212,.20);

    --text:        #172033;
    --text-2:      #46536b;
    --muted:       #6e7a91;
    --danger:      #c33f4d;

    --radius:      16px;
    --radius-sm:   10px;
    --shadow-sm:   0 1px 2px rgba(22,34,58,.04), 0 8px 24px rgba(38,55,88,.055);
    --shadow-md:   0 2px 4px rgba(22,34,58,.04), 0 18px 50px rgba(38,55,88,.09);
    --shadow-float: 0 12px 34px rgba(35,61,112,.16);

    --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
    --display: "Space Grotesk", "Noto Sans SC", system-ui, sans-serif;
    --body: "Inter", "Noto Sans SC", -apple-system, BlinkMacSystemFont,
            "Segoe UI", "PingFang SC", sans-serif;
}

body {
    font-family: var(--body);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    letter-spacing: 0;
}

/* ── 环境层：纸面底色 + 克制的冷色光晕 ───────────── */
.ambient {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(900px 520px at 8% -8%, rgba(76,124,226,.10), transparent 68%),
        radial-gradient(720px 420px at 94% 4%, rgba(119,91,220,.075), transparent 70%),
        radial-gradient(620px 420px at 52% 100%, rgba(39,155,169,.045), transparent 72%),
        linear-gradient(180deg, rgba(255,255,255,.58), transparent 36%);
    opacity: 1;
}

.container { max-width: 1280px; margin: 0 auto; padding: 0 28px; width: 100%; }
main.container { margin-bottom: 50px; }

h1 { font-family: var(--display); font-weight: 600; letter-spacing: -.01em; }

/* ── Flash 消息 ─────────────────────────────────── */
.flash-messages { margin: 20px 0 0; }
.flash {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    font-size: 14px;
    border: 1px solid var(--line-2);
    border-left: 2px solid var(--muted);
    background: var(--surface-2);
    color: var(--text-2);
    opacity: 1;
    transform: translateY(0);
    transition: opacity .2s ease, transform .2s ease;
}
.flash.is-dismissing { opacity: 0; transform: translateY(-5px); }
.flash-success { border-left-color: var(--accent); }
.flash-error   { border-left-color: var(--danger); color: #9f2636; background: #fff3f4; }

/* ── 画廊页头 ───────────────────────────────────── */
.gallery-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 16px;
    padding: 44px 0 22px;
}
.workspace-entry-copy { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.gallery-header h1 { font-size: 2rem; letter-spacing: -.025em; }
.gallery-actions { display: flex; align-items: center; gap: 18px; }
.paper-count {
    font-family: var(--mono);
    color: var(--muted);
    font-size: 12px;
    letter-spacing: .02em;
}

/* ── 学科 Tab ───────────────────────────────────── */
.subject-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    padding: 9px 0 18px;
    border-bottom: 1px solid var(--line);
    margin-bottom: 26px;
}
.tab-btn {
    padding: 7px 16px;
    border: 1px solid var(--line-2);
    border-radius: 999px;
    background: var(--surface);
    font-size: 12.5px;
    letter-spacing: .02em;
    color: var(--text-2);
    text-decoration: none;
    box-shadow: 0 1px 2px rgba(22,34,58,.03);
    transition: transform .16s, color .16s, border-color .16s, background .16s, box-shadow .16s;
    cursor: pointer;
}
.tab-btn:hover { border-color: var(--accent-line); color: var(--text); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.tab-btn.active {
    background: var(--accent-dim);
    color: var(--accent-hi);
    border-color: var(--accent-line);
    box-shadow: 0 0 0 1px rgba(53,104,212,.08), 0 8px 22px -14px var(--glow);
}

/* ── 空状态 ─────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 96px 20px;
    color: var(--muted);
}
.empty-state h2 {
    font-family: var(--display);
    font-size: 1.35rem;
    font-weight: 500;
    margin-bottom: 10px;
    color: var(--text-2);
}
.empty-state p { font-size: 14px; }

/* ── 按上传日期分组的试卷列表 ───────────────────── */
.paper-date-list {
    display: grid;
    gap: 34px;
    padding-bottom: 56px;
}
.paper-date-group { min-width: 0; }
.paper-date-heading {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}
.paper-date-heading::after {
    content: "";
    height: 1px;
    flex: 1;
    background: var(--line);
}
.paper-date-heading h2 {
    font-family: var(--display);
    font-size: 15px;
    font-weight: 550;
    letter-spacing: .02em;
    color: var(--text-2);
}
.paper-date-heading span {
    order: 2;
    font-family: var(--mono);
    font-size: 11px;
    color: var(--muted);
}

/* ── 组卡片网格 ─────────────────────────────────── */
.group-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(268px, 1fr));
    gap: 22px;
}

.group-card {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: transform .22s cubic-bezier(.22,1,.36,1),
                border-color .22s, box-shadow .22s;
}
/* HUD 取景括号 — 签名元素 */
.group-card::before,
.group-card::after {
    content: "";
    position: absolute;
    width: 15px; height: 15px;
    z-index: 3;
    pointer-events: none;
    display: none;
    transition: opacity .22s, width .22s, height .22s, border-color .22s;
}
.group-card::before {
    top: 9px; left: 9px;
    border-left: 1.5px solid var(--text-2);
    border-top: 1.5px solid var(--text-2);
}
.group-card::after {
    bottom: 9px; right: 9px;
    border-right: 1.5px solid var(--text-2);
    border-bottom: 1.5px solid var(--text-2);
}
.group-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent-line);
    box-shadow: var(--shadow-md), 0 0 0 1px rgba(53,104,212,.10);
}
.group-card:hover::before,
.group-card:hover::after {
    opacity: 1;
    width: 19px; height: 19px;
    border-color: var(--accent);
}

.group-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 13px;
    border-bottom: 1px solid var(--line);
    font-size: 14px;
}
.group-sequence {
    font-family: var(--mono);
    font-size: 12.5px;
    font-weight: 500;
    letter-spacing: .02em;
    color: var(--text);
    flex-grow: 1;
}
.btn-delete-group {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: 0;
    color: var(--muted);
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    opacity: 0;
    transition: opacity .16s, color .16s, background .16s;
}
.group-card:hover .btn-delete-group { opacity: .8; }
.btn-delete-group:hover { opacity: 1 !important; background: rgba(255,106,106,.12); color: var(--danger); }

.group-thumbs {
    display: grid;
    gap: 4px;
    padding: 5px;
    background: var(--surface-2);
}
.group-thumbs.grid-2x2 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
.group-thumbs.grid-1x2 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr; }

.group-thumb {
    position: relative;
    display: block;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    border-radius: 6px;
    background: var(--surface-3);
}
.group-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    filter: saturate(.92) contrast(1.02);
    transition: transform .35s cubic-bezier(.22,1,.36,1), filter .35s;
}
.group-thumb:hover img { transform: scale(1.05); filter: saturate(1) contrast(1); }
.thumb-label {
    position: absolute;
    bottom: 4px; left: 4px; right: 4px;
    padding: 3px 7px;
    background: linear-gradient(transparent, rgba(0,0,0,.72));
    color: rgba(255,255,255,.92);
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: .01em;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    pointer-events: none;
}

.group-card-footer {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 13px;
    border-top: 1px solid var(--line);
    background: var(--surface);
    font-size: 12px;
    color: var(--muted);
}
.group-card-footer .group-date {
    font-family: var(--mono);
    margin-left: auto;
    letter-spacing: .03em;
}

/* ── 类型徽章 ───────────────────────────────────── */
.type-badge {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 5px;
    font-family: var(--mono);
    font-weight: 500;
    font-size: 10.5px;
    letter-spacing: .02em;
    border: 1px solid var(--line-2);
    color: var(--text-2);
    background: var(--surface-2);
}
.type-with_sheet    { border-color: var(--accent-line); color: var(--accent-hi); }
.type-inline_answers{ border-color: rgba(79,70,229,.30); color: #5146b8; }

/* ── 科目标签：统一石墨芯片 + 学科色点 ───────────── */
.tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px 3px 8px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 500;
    letter-spacing: .02em;
    white-space: nowrap;
    color: var(--text-2);
    background: var(--surface-2);
    border: 1px solid var(--line-2);
}
.tag::before {
    content: "";
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--muted);
    box-shadow: 0 0 8px currentColor;
    flex-shrink: 0;
}
.tag-语文::before { background: #6fb2ff; }
.tag-数学::before { background: #ff8a9b; }
.tag-英语::before { background: #b79bff; }
.tag-物理::before { background: #5fd6a6; }
.tag-化学::before { background: #ffb454; }
.tag-生物::before { background: #4fd6cf; }
.tag-历史::before { background: #ff9d6b; }
.tag-地理::before { background: #8aa0ff; }
.tag-政治::before { background: #ff86cf; }
.tag-其他::before { background: #a9b1c2; }

/* ── 按钮 ───────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 40px;
    padding: 9px 19px;
    border-radius: var(--radius-sm);
    font-family: var(--display);
    font-size: 13.5px;
    font-weight: 500;
    letter-spacing: .02em;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid transparent;
    transition: transform .18s, background .18s, border-color .18s, color .18s, box-shadow .18s;
}
.btn-primary {
    background: linear-gradient(135deg, #477be4, var(--accent));
    color: #fff;
    box-shadow: 0 1px 0 rgba(255,255,255,.22) inset, 0 10px 22px -12px rgba(37,75,160,.72);
}
.btn-primary:hover { background: linear-gradient(135deg, #3b70dc, var(--accent-hi)); transform: translateY(-1px); box-shadow: var(--shadow-float); }
.btn-primary:disabled { background: var(--surface-3); color: var(--muted); box-shadow: none; cursor: not-allowed; border-color: var(--line-2); }
.btn-secondary {
    background: rgba(255,255,255,.76);
    color: var(--text-2);
    border-color: var(--line-2);
}
.btn-secondary:hover { color: var(--accent-hi); border-color: var(--accent-line); background: var(--surface); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.btn-danger-ghost {
    color: var(--danger);
    background: transparent;
    border-color: rgba(255,106,106,.25);
}
.btn-danger-ghost:hover { background: rgba(255,106,106,.1); border-color: var(--danger); }
.btn-compact { padding: 6px 11px; font-size: 12px; }
.btn-block { width: 100%; padding: 13px; font-size: 15px; margin-top: 20px; }
.btn-link {
    color: var(--muted);
    text-decoration: none;
    display: inline-block;
    margin-top: 16px;
    font-size: 13px;
    letter-spacing: .02em;
    transition: color .16s;
}
.btn-link:hover { color: var(--accent-hi); }
.btn-back { display: block; text-align: center; }

/* ── 上传页 ─────────────────────────────────────── */
.upload-container { max-width: 720px; margin: 0 auto; padding: 40px 0 56px; }
.upload-container h1 { font-size: 1.7rem; margin-bottom: 10px; }
.upload-desc { color: var(--muted); font-size: 13.5px; margin-bottom: 28px; }
.upload-form {
    background: var(--surface);
    padding: 24px;
    border-radius: var(--radius);
    border: 1px solid var(--line);
}

.form-section { border: 0; padding: 0; margin: 0 0 26px; }
.form-section legend {
    font-family: var(--mono);
    font-weight: 500;
    font-size: 12px;
    letter-spacing: .08em;
    text-transform: uppercase;
    margin-bottom: 14px;
    color: var(--accent);
    padding: 0;
}
.form-hint { color: var(--muted); font-size: 13px; margin-bottom: 14px; }
.batch-image-drop {
    display: grid;
    place-items: center;
    min-height: 150px;
    padding: 24px;
    border: 1px dashed var(--accent-line);
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    color: var(--accent);
    font: 500 14px/1.4 var(--display);
    cursor: pointer;
}
.batch-image-drop:hover { border-style: solid; background: var(--accent-dim); }
.batch-image-drop input { position: absolute; opacity: 0; pointer-events: none; }

/* ── 类型 Radio 卡片 ────────────────────────────── */
.radio-cards { display: grid; gap: 10px; grid-template-columns: 1fr 1fr; }
@media (max-width: 560px) { .radio-cards { grid-template-columns: 1fr; } }

.radio-card {
    display: block;
    border: 1px solid var(--line-2);
    border-radius: var(--radius-sm);
    padding: 15px;
    cursor: pointer;
    transition: all .16s;
    background: var(--surface-2);
}
.radio-card:hover { border-color: var(--line-2); background: var(--surface-3); }
.radio-card input[type="radio"] { position: absolute; opacity: 0; pointer-events: none; }
.radio-card:has(input:checked) {
    border-color: var(--accent-line);
    background: var(--accent-dim);
    box-shadow: 0 0 0 1px var(--accent-line), 0 0 20px -6px var(--glow);
}
.radio-card-body { display: flex; flex-direction: column; gap: 5px; }
.radio-card-title { font-family: var(--display); font-weight: 500; font-size: 15px; color: var(--text); }
.radio-card-desc { font-size: 13px; color: var(--muted); }
.radio-card-meta { font-family: var(--mono); font-size: 11px; color: var(--accent); letter-spacing: .02em; }

/* ── 下拉选择 ───────────────────────────────────── */
.select {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid var(--line-2);
    border-radius: var(--radius-sm);
    font-family: var(--body);
    font-size: 15px;
    color: var(--text);
    background: var(--surface-2);
    cursor: pointer;
    transition: border-color .16s, box-shadow .16s;
}
.select option { background: var(--surface-2); color: var(--text); }
.select:focus {
    outline: none;
    border-color: var(--accent-line);
    box-shadow: 0 0 0 3px var(--accent-dim);
}

/* ── 槽位 Slot ──────────────────────────────────── */
.slots { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
@media (max-width: 560px) { .slots { grid-template-columns: 1fr; } }

.slot {
    border: 1px dashed var(--line-2);
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    overflow: hidden;
    transition: all .16s;
    position: relative;
}
.slot.empty {
    padding: 20px;
    cursor: pointer;
    text-align: center;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.slot.empty:hover, .slot.empty.drag-over {
    border-color: var(--accent-line);
    border-style: solid;
    background: var(--accent-dim);
}
.slot-icon {
    font-family: var(--display);
    font-size: 2.2rem;
    font-weight: 300;
    line-height: 1;
    color: var(--muted);
    margin-bottom: 10px;
    transition: color .16s;
}
.slot.empty:hover .slot-icon, .slot.empty.drag-over .slot-icon { color: var(--accent); }
.slot-text { color: var(--muted); font-size: 12.5px; }
.slot input[type="file"] { display: none; }
.slot.filled { border-style: solid; border-color: var(--line-2); padding: 0; background: var(--surface); }

.slot-preview { position: relative; }
.slot-preview img {
    display: block;
    width: 100%;
    aspect-ratio: 3/4;
    object-fit: cover;
    background: var(--surface-3);
}
.slot-actions { position: absolute; top: 7px; right: 7px; display: flex; gap: 5px; }
.slot-actions button {
    background: rgba(10,10,13,.7);
    backdrop-filter: blur(4px);
    color: #fff;
    border: 1px solid var(--line-2);
    width: 27px; height: 27px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 13px;
    line-height: 1;
    transition: all .15s;
}
.slot-actions button:hover { background: rgba(10,10,13,.9); border-color: var(--line-2); }
.slot-actions .slot-clear:hover { background: rgba(255,106,106,.9); border-color: transparent; }

.slot-meta { padding: 9px 10px; border-top: 1px solid var(--line); background: var(--surface); }
.slot-label-input {
    width: 100%;
    padding: 7px 9px;
    border: 1px solid var(--line-2);
    border-radius: 6px;
    font-family: var(--mono);
    font-size: 12px;
    color: var(--text);
    background: var(--surface-2);
}
.slot-label-input:focus { outline: none; border-color: var(--accent-line); box-shadow: 0 0 0 3px var(--accent-dim); }
.slot-order {
    display: inline-block;
    padding: 1px 8px;
    background: var(--accent-dim);
    color: var(--accent-hi);
    border: 1px solid var(--accent-line);
    border-radius: 10px;
    font-family: var(--mono);
    font-size: 10px;
    font-weight: 500;
    margin-right: 6px;
    vertical-align: middle;
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-2);
    padding: 5px 9px;
    border-radius: 6px;
    font-size: 15px;
    cursor: pointer;
    transition: all .15s;
}
.btn-icon:hover { background: var(--surface-3); color: var(--text); border-color: var(--line-2); }
/* ── 焦点可见性 ─────────────────────────────────── */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ── 响应式 ─────────────────────────────────────── */
@media (max-width: 600px) {
    .container { padding: 0 16px; }
    .gallery-header { padding: 28px 0 14px; }
    .gallery-header h1 { font-size: 1.5rem; }
    .home-page .gallery-actions { width: 100%; flex-wrap: wrap; gap: 8px; }
    .home-page .gallery-actions .paper-count { width: 100%; }
    .home-page .gallery-actions .btn { flex: 1; padding-inline: 12px; }
}

/* ══════════════════════════════════════════════════════════
   学生管理 / 试卷详情 / AI 分析 — 追加样式
   ══════════════════════════════════════════════════════════ */

/* ── 文本输入 ───────────────────────────────────── */
.input {
    padding: 11px 14px;
    border: 1px solid var(--line-2);
    border-radius: var(--radius-sm);
    font-family: var(--body);
    font-size: 15px;
    color: var(--text);
    background: var(--surface-2);
    transition: border-color .16s, box-shadow .16s;
}
.input:focus {
    outline: none;
    border-color: var(--accent-line);
    box-shadow: 0 0 0 3px var(--accent-dim);
}

/* ── 新建学生表单 ───────────────────────────────── */
.student-form {
    margin: 0 0 24px;
    padding: 18px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}
.student-form-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}
.student-form-row .input { flex: 1 1 160px; }

/* ── 学生卡片网格 ───────────────────────────────── */
.student-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 18px;
    margin-top: 8px;
}
.student-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 96px;
    padding: 21px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: border-color .18s, transform .18s, background .18s, box-shadow .18s;
}
.student-card::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 3px;
    background: linear-gradient(180deg, #7da5ff, var(--accent));
    opacity: .78;
}
.student-card:hover {
    border-color: var(--accent-line);
    background: var(--surface);
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}
.student-avatar {
    flex: 0 0 auto;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-family: var(--display);
    font-size: 20px;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, var(--accent-hi), var(--accent));
    box-shadow: 0 8px 20px rgba(53,104,212,.22), 0 0 0 5px var(--accent-dim);
}
.student-card-unassigned .student-avatar {
    background: var(--surface-3);
    color: var(--muted);
    box-shadow: 0 0 0 5px rgba(110,122,145,.08);
}
.student-card-unassigned::before { background: var(--line-2); }
.student-info { flex: 1 1 auto; min-width: 0; }
.student-name {
    font-family: var(--display);
    font-size: 17px;
    font-weight: 600;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.student-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 12px;
    color: var(--muted);
}
.student-meta-lg { font-size: 13px; margin-top: 6px; }
.student-grade {
    color: var(--accent);
    font-family: var(--mono);
}
.student-id { font-family: var(--mono); color: var(--muted); }
.report-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 12px;
    border: 1px solid var(--accent-line);
    border-radius: 999px;
    background: var(--accent-dim);
    color: var(--accent-hi);
    font-size: 12.5px;
    letter-spacing: .02em;
    text-decoration: none;
    transition: all .16s;
}
.report-pill:hover {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent-line), 0 0 14px var(--glow);
}
.student-stat {
    flex: 0 0 auto;
    text-align: center;
    display: flex;
    flex-direction: column;
    padding-right: 8px;
}
.student-stat .stat-num {
    font-family: var(--mono);
    font-size: 22px;
    font-weight: 600;
    color: var(--text);
    line-height: 1;
}
.student-stat .stat-label { font-size: 11px; color: var(--muted); }
.btn-delete-student {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 26px;
    height: 26px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    opacity: 0;
    transition: opacity .16s, color .16s, background .16s;
}
.student-card:hover .btn-delete-student { opacity: 1; }
.btn-delete-student:hover { color: var(--danger); background: var(--surface-3); }

/* ── 首页：学习工作区总览 ───────────────────────── */
.home-page {
    background: #f2f3ef;
}
.home-page .ambient {
    background:
        radial-gradient(780px 520px at 0 0, rgba(87,126,111,.10), transparent 72%),
        radial-gradient(720px 500px at 100% 8%, rgba(180,160,112,.075), transparent 72%),
        linear-gradient(180deg, rgba(255,255,255,.78), transparent 44%);
}
.home-page main.container {
    max-width: 1420px;
    margin-bottom: 64px;
    padding-inline: clamp(18px, 3.3vw, 52px);
}
.home-shell { display: grid; gap: 42px; padding-top: 28px; }
.home-hero {
    position: relative;
    display: grid;
    min-height: 390px;
    grid-template-columns: minmax(0, 1.18fr) minmax(360px, .82fr);
    align-items: center;
    gap: clamp(34px, 5vw, 76px);
    overflow: hidden;
    padding: clamp(36px, 5vw, 70px);
    border: 1px solid rgba(61,78,70,.13);
    border-radius: 30px;
    background:
        radial-gradient(circle at 9% -12%, rgba(83,126,109,.13), transparent 39%),
        radial-gradient(circle at 100% 104%, rgba(190,169,116,.10), transparent 35%),
        linear-gradient(135deg, rgba(255,255,255,.96), rgba(247,247,241,.94));
    box-shadow: 0 24px 70px rgba(52,65,57,.095);
    color: #23302b;
}
.home-hero::after {
    position: absolute;
    width: 420px;
    height: 420px;
    right: -210px;
    bottom: -270px;
    border: 1px solid rgba(72,111,96,.13);
    border-radius: 50%;
    content: "";
    box-shadow: 0 0 0 62px rgba(72,111,96,.028), 0 0 0 126px rgba(72,111,96,.018);
}
.home-hero-copy,
.home-overview { position: relative; z-index: 2; }
.home-hero-copy { display: grid; align-content: center; justify-items: start; }
.home-hero-kicker {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: #6e7c75;
    font: 600 9px/1 var(--mono);
    letter-spacing: .15em;
}
.home-hero-kicker i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #4c8879;
    box-shadow: 0 0 0 5px rgba(76,136,121,.10);
}
.home-hero h1 {
    display: grid;
    max-width: 720px;
    gap: 7px;
    margin-top: 24px;
    color: #202b27;
    font: 600 clamp(30px, 3.5vw, 50px)/1.12 var(--display);
    letter-spacing: -.045em;
}
.home-hero h1 span {
    color: #4c756a;
    font-size: .46em;
    letter-spacing: .03em;
}
.home-hero-copy > p {
    max-width: 610px;
    margin-top: 20px;
    color: #66716b;
    font-size: clamp(12px, 1.1vw, 14px);
    line-height: 1.85;
}
.home-hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 30px; }
.home-hero-actions .btn {
    display: inline-flex;
    min-height: 46px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 18px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}
.home-primary-action {
    border: 1px solid #315f54;
    background: #315f54;
    color: #fff;
    box-shadow: 0 11px 24px rgba(49,95,84,.20);
}
.home-primary-action:hover { background: #274f46; transform: translateY(-2px); box-shadow: 0 15px 30px rgba(49,95,84,.26); }
.home-primary-action > span { font-size: 17px; font-weight: 400; line-height: 1; }
.home-tutor-action {
    border: 1px solid rgba(49,95,84,.24);
    background: rgba(224,235,229,.72);
    color: #315f54;
    text-decoration: none;
}
.home-tutor-action:hover {
    border-color: rgba(49,95,84,.42);
    background: #dce9e2;
    transform: translateY(-2px);
}
.home-tutor-action > span { color: #4c756a; font-size: 15px; transition: transform .16s; }
.home-tutor-action:hover > span { transform: translateX(2px); }
.home-secondary-action {
    border: 1px solid rgba(53,67,61,.14);
    background: rgba(255,255,255,.72);
    color: #3f4c46;
}
.home-secondary-action:hover { border-color: rgba(49,95,84,.28); background: #fff; color: #315f54; transform: translateY(-2px); }
.home-hero-orbit { position: absolute; z-index: 1; border: 1px solid rgba(72,111,96,.10); border-radius: 50%; pointer-events: none; }
.home-hero-orbit-one { width: 210px; height: 210px; top: -104px; left: 42%; }
.home-hero-orbit-two { width: 110px; height: 110px; top: 54px; left: 47%; box-shadow: 0 0 60px rgba(72,111,96,.07); }
.home-overview {
    display: grid;
    gap: 14px;
    padding: 18px;
    border: 1px solid rgba(53,67,61,.13);
    border-radius: 22px;
    background: rgba(255,255,255,.75);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.70), 0 18px 42px rgba(52,65,57,.08);
    backdrop-filter: blur(18px);
}
.home-overview-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 2px 2px; }
.home-overview-header > span { color: #77837d; font: 600 7.5px/1 var(--mono); letter-spacing: .14em; }
.home-overview-header > b { display: inline-flex; align-items: center; gap: 6px; color: #7c8882; font-size: 8px; font-weight: 500; }
.home-overview-header i { width: 6px; height: 6px; border-radius: 50%; background: #4c8879; box-shadow: 0 0 0 4px rgba(76,136,121,.10); }
.home-metric-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.home-metric {
    display: grid;
    min-width: 0;
    min-height: 126px;
    align-content: end;
    gap: 3px;
    padding: 15px;
    border: 1px solid rgba(53,67,61,.09);
    border-radius: 16px;
    background: rgba(246,246,241,.88);
}
.home-metric-primary {
    background: #e4eee8;
}
.home-metric small { align-self: start; margin-bottom: auto; color: #748079; font-size: 8px; }
.home-metric strong { overflow: hidden; color: #25312c; font: 600 clamp(25px, 3vw, 37px)/1 var(--display); text-overflow: ellipsis; }
.home-metric span { color: #7b8680; font-size: 8px; }
.home-attention {
    display: flex;
    min-height: 48px;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 10px 13px;
    border: 1px solid rgba(171,120,48,.16);
    border-radius: 13px;
    background: rgba(216,174,105,.11);
    color: #775c31;
    text-decoration: none;
}
.home-attention > span { display: inline-flex; align-items: center; gap: 8px; }
.home-attention i { width: 7px; height: 7px; border-radius: 50%; background: #edb45d; box-shadow: 0 0 0 5px rgba(237,180,93,.10); }
.home-attention b { font-size: 9px; font-weight: 600; }
.home-attention small { color: #8b795c; font-size: 8px; white-space: nowrap; }
a.home-attention:hover { border-color: rgba(171,120,48,.26); background: rgba(216,174,105,.16); }
.home-attention.is-clear { border-color: rgba(76,136,121,.14); background: rgba(222,236,229,.68); color: #3e6c61; }
.home-attention.is-clear i { background: #4c8879; box-shadow: 0 0 0 5px rgba(76,136,121,.10); }
.home-attention.is-clear small { color: #67877e; }
.home-student-form {
    display: grid;
    grid-template-columns: minmax(210px, .45fr) minmax(0, 1.55fr);
    align-items: center;
    gap: 24px;
    margin: -20px 24px 0;
    padding: 20px 22px;
    border-color: rgba(49,95,84,.16);
    box-shadow: 0 14px 42px rgba(52,65,57,.08);
}
.home-student-form[hidden] { display: none; }
.home-student-form-header { display: grid; gap: 6px; }
.home-student-form-header > span { color: #4c756a; font: 600 7px/1 var(--mono); letter-spacing: .14em; }
.home-student-form-header > div { display: grid; gap: 2px; }
.home-student-form-header strong { font: 600 15px/1.3 var(--display); }
.home-student-form-header small { color: var(--muted); font-size: 9px; line-height: 1.5; }
.home-students { display: grid; gap: 22px; }
.home-section-header { display: flex; align-items: end; justify-content: space-between; gap: 28px; padding: 0 4px; }
.home-section-header > div:first-child { display: grid; gap: 5px; }
.home-section-kicker { color: #4c756a; font: 600 7.5px/1 var(--mono); letter-spacing: .15em; }
.home-section-header h2 { color: var(--text); font: 600 clamp(21px, 2vw, 28px)/1.25 var(--display); letter-spacing: -.025em; }
.home-section-header p { color: var(--muted); font-size: 10px; }
.home-section-count { display: flex; flex: 0 0 auto; align-items: baseline; gap: 7px; padding: 9px 13px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.60); }
.home-section-count strong { color: var(--text); font: 600 18px/1 var(--display); }
.home-section-count span { color: var(--muted); font-size: 8px; }
.home-page .student-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 0; }
.home-page .student-card {
    --student-card-accent: #547bd8;
    display: grid;
    min-height: 238px;
    align-content: stretch;
    gap: 20px;
    padding: 19px;
    border-color: rgba(30,41,59,.085);
    border-radius: 21px;
    background:
        radial-gradient(circle at 100% 0, color-mix(in srgb, var(--student-card-accent) 11%, transparent), transparent 40%),
        rgba(255,255,255,.88);
    box-shadow: 0 10px 34px rgba(38,55,88,.065);
}
.home-page .student-card:nth-child(3n+2) { --student-card-accent: #3c9d9a; }
.home-page .student-card:nth-child(3n+3) { --student-card-accent: #7966c6; }
.home-page .student-card::before {
    inset: auto 19px 0;
    width: auto;
    height: 3px;
    border-radius: 99px 99px 0 0;
    background: var(--student-card-accent);
    opacity: .58;
}
.home-page .student-card:hover { transform: translateY(-5px); border-color: color-mix(in srgb, var(--student-card-accent) 36%, transparent); box-shadow: 0 20px 46px rgba(38,55,88,.12); }
.student-card-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.student-card-order { color: #98a3b4; font: 600 7px/1 var(--mono); letter-spacing: .12em; }
.student-card-open { display: grid; width: 27px; height: 27px; place-items: center; border: 1px solid var(--line); border-radius: 9px; background: rgba(255,255,255,.68); color: var(--muted); font-size: 12px; transition: color .16s, border-color .16s, transform .16s; }
.student-card:hover .student-card-open { border-color: color-mix(in srgb, var(--student-card-accent) 28%, transparent); color: var(--student-card-accent); transform: translate(1px,-1px); }
.student-card-profile { display: flex; min-width: 0; align-items: center; gap: 15px; }
.home-page .student-avatar {
    width: 58px;
    height: 58px;
    border-radius: 18px;
    background: linear-gradient(145deg, color-mix(in srgb, var(--student-card-accent) 82%, #1b2841), var(--student-card-accent));
    box-shadow: 0 11px 25px color-mix(in srgb, var(--student-card-accent) 23%, transparent), 0 0 0 5px color-mix(in srgb, var(--student-card-accent) 8%, transparent);
}
.home-page .student-name { margin: 0 0 6px; font-size: 20px; }
.home-page .student-meta { gap: 6px; font-size: 9px; }
.home-page .student-grade,
.home-page .student-school { padding: 4px 7px; border-radius: 999px; background: var(--surface-3); }
.home-page .student-grade { color: var(--student-card-accent); }
.student-card-footer { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-top: auto; padding-top: 15px; border-top: 1px solid var(--line); }
.home-page .student-stat { align-items: flex-start; padding: 0; text-align: left; }
.home-page .student-stat .stat-num { font-size: 25px; }
.home-page .student-stat .stat-label { margin-top: 4px; font-size: 8px; }
.student-card-cta { display: inline-flex; align-items: center; gap: 8px; color: var(--student-card-accent); font-size: 9px; font-weight: 600; }
.student-card-cta > span { font-size: 13px; transition: transform .16s; }
.student-card:hover .student-card-cta > span { transform: translateX(3px); }
.home-page .btn-delete-student { top: 15px; right: 51px; width: 28px; height: 28px; border-radius: 8px; }
.home-page .student-card:hover .btn-delete-student,
.home-page .student-card:focus-within .btn-delete-student { opacity: 1; }
.home-page .student-card-unassigned { --student-card-accent: #8a94a5; border-style: dashed; }
.home-page .student-card-unassigned .student-avatar { border-radius: 18px; background: #e7ebf1; color: #7d8798; box-shadow: 0 0 0 5px rgba(110,122,145,.07); }
.home-empty-state { display: grid; justify-items: center; gap: 8px; padding: 72px 20px; border: 1px dashed var(--line-2); border-radius: 22px; background: rgba(255,255,255,.55); }
.home-empty-state h2 { padding: 0; border: 0; background: transparent; font: 600 19px/1.3 var(--display); }
.home-empty-state p { font-size: 10px; }
.home-empty-mark { display: grid; width: 46px; height: 46px; margin-bottom: 5px; place-items: center; border-radius: 15px; background: var(--accent-dim); color: var(--accent); font-size: 24px; }

@media (max-width: 1050px) {
    .home-hero { grid-template-columns: 1fr; gap: 38px; }
    .home-overview { width: min(680px, 100%); }
    .home-page .student-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 680px) {
    .home-page main.container { padding-inline: 13px; }
    .home-shell { gap: 32px; padding-top: 13px; }
    .home-hero { min-height: 0; gap: 30px; padding: 29px 22px 22px; border-radius: 23px; }
    .home-hero h1 { margin-top: 19px; font-size: clamp(28px, 9vw, 38px); }
    .home-hero-copy > p { margin-top: 15px; font-size: 11px; }
    .home-hero-actions { width: 100%; margin-top: 23px; }
    .home-hero-actions .btn { flex: 1 1 150px; padding-inline: 12px; }
    .home-overview { padding: 12px; border-radius: 17px; }
    .home-overview-header { align-items: flex-start; flex-direction: column; gap: 8px; }
    .home-metric-grid { gap: 6px; }
    .home-metric { min-height: 104px; padding: 11px; border-radius: 13px; }
    .home-metric strong { font-size: 25px; }
    .home-attention { align-items: flex-start; }
    .home-student-form { grid-template-columns: 1fr; gap: 15px; margin: -15px 8px 0; padding: 17px; }
    .home-student-form .student-form-row { align-items: stretch; flex-direction: column; }
    .home-student-form .student-form-row .input { flex-basis: auto; }
    .home-section-header { align-items: flex-start; flex-direction: column; gap: 13px; }
    .home-section-header p { line-height: 1.6; }
    .home-section-count { align-self: stretch; justify-content: space-between; }
    .home-page .student-grid { grid-template-columns: 1fr; }
    .home-page .student-card { min-height: 220px; }
}

/* ── 面包屑 ─────────────────────────────────────── */
.detail-breadcrumb {
    display: flex;
    gap: 8px;
    align-items: center;
    font-size: 13px;
    color: var(--muted);
    padding: 20px 0 4px;
}
.detail-breadcrumb a { color: var(--text-2); text-decoration: none; }
.detail-breadcrumb a:hover { color: var(--accent-hi); }
.crumb-sep { color: var(--line-2); }
.breadcrumb-subject-switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    max-width: min(300px, 52vw);
}
.breadcrumb-subject-switch::after {
    content: "";
    position: absolute;
    right: 9px;
    width: 6px;
    height: 6px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    color: var(--muted);
    pointer-events: none;
    transform: translateY(-2px) rotate(45deg);
}
.breadcrumb-subject-switch select {
    width: 100%;
    min-height: 30px;
    padding: 4px 27px 4px 10px;
    border: 1px solid var(--line-2);
    border-radius: 8px;
    outline: 0;
    appearance: none;
    -webkit-appearance: none;
    background: rgba(255,255,255,.72);
    color: var(--text-2);
    font: 500 11px/1.4 var(--body);
    cursor: pointer;
    transition: color .16s, border-color .16s, box-shadow .16s, background .16s;
}
.breadcrumb-subject-switch select:hover {
    border-color: var(--accent-line);
    background: var(--surface);
    color: var(--accent-hi);
}
.breadcrumb-subject-switch select:focus {
    border-color: var(--accent-line);
    background: var(--surface);
    box-shadow: 0 0 0 3px var(--accent-dim);
}

/* ── 学科 Tab 计数 ──────────────────────────────── */
.tab-count {
    font-family: var(--mono);
    font-size: 10px;
    color: var(--accent);
    opacity: .85;
}

/* ── 学科能力档案入口 ───────────────────────────── */
.subject-profile-entry {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin: -10px 0 24px;
    padding: 11px 13px 11px 16px;
    border: 1px solid var(--line);
    border-left-color: var(--accent-line);
    border-radius: var(--radius-sm);
    background: linear-gradient(90deg, var(--accent-dim), transparent 56%);
    color: var(--muted);
    font-size: 12.5px;
}
.btn-capability {
    padding: 7px 13px;
    color: var(--accent-hi);
    border-color: var(--accent-line);
    background: var(--accent-dim);
    white-space: nowrap;
}
.btn-capability:hover { background: var(--accent-dim); border-color: var(--accent); }
.subject-profile-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* ══════════════════════════════════════════════════════════
   学科知识点与元能力档案
   ══════════════════════════════════════════════════════════ */
.capability-page-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    padding: 28px 0 18px;
}
.capability-page-header h1 { margin: 4px 0 7px; font-size: 1.9rem; }
.capability-page-header p { max-width: 720px; color: var(--muted); font-size: 13px; }
.capability-eyebrow,
.capability-index {
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: .12em;
    color: var(--accent);
}
.capability-subject-tabs { margin-bottom: 20px; }

.capability-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 20px;
}
.capability-summary article {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: baseline;
    gap: 3px 12px;
    padding: 15px 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface);
}
.capability-summary span { color: var(--text-2); font-size: 12px; }
.capability-summary strong {
    grid-row: 1 / 3;
    grid-column: 2;
    font-family: var(--mono);
    font-size: 24px;
    line-height: 1;
    color: var(--accent-hi);
}
.capability-summary small { color: var(--muted); font-size: 10px; }

.capability-columns {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: start;
    gap: 20px;
    padding-bottom: 60px;
}
.capability-panel {
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    overflow: hidden;
}
.capability-panel-header {
    padding: 18px 20px;
    border-bottom: 1px solid var(--line);
    background: linear-gradient(135deg, var(--accent-dim), transparent 58%);
}
.capability-panel-header h2 {
    display: inline;
    margin-left: 8px;
    font-family: var(--display);
    font-size: 18px;
}
.capability-panel-header p { margin-top: 5px; color: var(--muted); font-size: 12px; }

.capability-add-form {
    display: grid;
    gap: 12px;
    padding: 18px 20px;
    border-bottom: 1px solid var(--line);
    background: var(--surface-2);
}
.capability-form-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr) 142px;
    gap: 10px;
}
.capability-add-ability .capability-form-row,
.ability-edit-row { grid-template-columns: minmax(0, 1fr) 142px; }
.capability-add-form label,
.capability-item label {
    display: grid;
    align-content: start;
    gap: 5px;
    min-width: 0;
}
.capability-add-form label > span,
.capability-item label > span {
    font-size: 10.5px;
    letter-spacing: .03em;
    color: var(--muted);
}
.capability-add-form .input,
.capability-add-form .select,
.capability-item .input,
.capability-item .select { min-width: 0; padding: 9px 10px; font-size: 12.5px; }
.capability-add-form textarea,
.capability-item textarea {
    width: 100%;
    min-height: 72px;
    resize: vertical;
    padding: 10px 11px;
    border: 1px solid var(--line-2);
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    color: var(--text);
    font: 12.5px/1.55 var(--body);
}
.capability-add-form textarea:focus,
.capability-item textarea:focus {
    outline: none;
    border-color: var(--accent-line);
    box-shadow: 0 0 0 3px var(--accent-dim);
}
.capability-add-form > .btn { justify-self: start; }

.capability-item-list { display: grid; }
.capability-item {
    display: grid;
    gap: 12px;
    padding: 18px 20px;
    border-bottom: 1px solid var(--line);
}
.capability-item:last-child { border-bottom: 0; }
.capability-item-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}
.capability-item-heading > div { min-width: 0; }
.capability-item-heading strong {
    display: block;
    font-family: var(--display);
    font-size: 15px;
    color: var(--text);
}
.capability-item-heading p { margin-top: 3px; color: var(--muted); font-size: 11px; line-height: 1.45; }
.capability-unit {
    display: block;
    margin-bottom: 2px;
    font-family: var(--mono);
    font-size: 9.5px;
    color: var(--accent);
}
.level-chip {
    flex: 0 0 auto;
    padding: 3px 8px;
    border: 1px solid var(--line-2);
    border-radius: 999px;
    font-family: var(--mono);
    font-size: 9.5px;
    color: var(--muted);
    background: var(--surface-2);
}
.level-chip.level-2 { color: #9a6718; border-color: rgba(154,103,24,.30); }
.level-chip.level-3 { color: #23845b; border-color: rgba(35,132,91,.30); }
.level-chip.level-4 { color: #2e66a5; border-color: rgba(46,102,165,.32); }
.capability-item-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}
.capability-item-actions small {
    margin-right: auto;
    font-family: var(--mono);
    font-size: 9.5px;
    color: var(--muted);
}
.capability-empty { padding: 42px 24px; text-align: center; color: var(--muted); }
.capability-empty strong { color: var(--text-2); font-size: 14px; }
.capability-empty p { margin-top: 5px; font-size: 12px; }

/* ── 安徽数学课标目录 ───────────────────────────── */
.curriculum-import-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 20px;
    padding: 18px 20px;
    border: 1px solid var(--accent-line);
    border-radius: var(--radius);
    background: linear-gradient(135deg, var(--accent-dim), var(--surface) 62%);
}
.curriculum-import-copy { max-width: 680px; }
.curriculum-import-copy h2 { margin: 4px 0 5px; font-size: 18px; }
.curriculum-import-copy p { color: var(--muted); font-size: 12px; line-height: 1.6; }
.curriculum-import-copy a {
    display: inline-block;
    margin-top: 7px;
    color: var(--accent-hi);
    font-size: 12px;
    text-decoration: none;
}
.curriculum-import-copy a:hover { text-decoration: underline; }
.curriculum-import-actions {
    display: grid;
    flex: 0 0 238px;
    gap: 8px;
}
.curriculum-import-actions .btn {
    display: flex;
    width: 100%;
    justify-content: space-between;
    gap: 16px;
}
.curriculum-import-actions .btn span {
    font-family: var(--mono);
    font-size: 10px;
    color: var(--accent);
}
.curriculum-source-chip {
    display: inline-block;
    margin-top: 5px;
    padding: 2px 7px;
    border: 1px solid var(--accent-line);
    border-radius: 999px;
    color: var(--accent);
    background: var(--accent-dim);
    font: 9px/1.4 var(--mono);
}

.catalog-page-header { padding: 30px 0 18px; }
.catalog-page-header h1 { margin: 5px 0 8px; font-size: 2rem; }
.catalog-page-header p { max-width: 760px; color: var(--muted); font-size: 13px; }
.catalog-policy-note {
    display: grid;
    grid-template-columns: 100px minmax(0, 1fr);
    gap: 14px;
    margin-bottom: 14px;
    padding: 14px 16px;
    border: 1px solid var(--accent-line);
    border-radius: var(--radius-sm);
    background: var(--accent-dim);
}
.catalog-policy-note strong { color: var(--accent-hi); font-size: 12px; }
.catalog-policy-note p { color: var(--text-2); font-size: 12px; line-height: 1.65; }
.catalog-jump-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}
.catalog-jump-nav a {
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--text-2);
    background: var(--surface);
    font-size: 11px;
    text-decoration: none;
}
.catalog-jump-nav a:hover { color: var(--accent-hi); border-color: var(--accent-line); }
.catalog-list { display: grid; gap: 24px; padding-bottom: 60px; }
.catalog-block {
    scroll-margin-top: 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    overflow: hidden;
}
.catalog-block-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 24px;
    padding: 22px 24px;
    border-bottom: 1px solid var(--line);
    background: linear-gradient(135deg, var(--accent-dim), transparent 58%);
}
.catalog-block-header > div > span {
    color: var(--accent);
    font: 10px/1.4 var(--mono);
    letter-spacing: .08em;
}
.catalog-block-header h2 { margin: 4px 0 7px; font-size: 22px; }
.catalog-block-header p { max-width: 800px; color: var(--muted); font-size: 12px; line-height: 1.65; }
.catalog-block-header > strong {
    color: var(--accent-hi);
    font: 30px/1 var(--mono);
}
.catalog-block-header > strong small { margin-left: 3px; color: var(--muted); font-size: 10px; }
.catalog-import-form {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 24px;
    border-bottom: 1px solid var(--line);
    background: var(--surface-2);
}
.catalog-import-form span { color: var(--text-2); font-size: 12px; }
.catalog-sections {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    padding: 20px 24px 24px;
}
.catalog-section {
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    overflow: hidden;
}
.catalog-section header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 11px 13px;
    border-bottom: 1px solid var(--line);
}
.catalog-section h3 { font-size: 13px; color: var(--text); }
.catalog-section header span { color: var(--accent); font: 9.5px/1 var(--mono); }
.catalog-section ol { padding: 10px 14px 12px 34px; }
.catalog-section li {
    padding: 4px 0 4px 3px;
    color: var(--text-2);
    font-size: 11.5px;
    line-height: 1.55;
}
.catalog-section li p { margin: 5px 0 0; color: var(--muted); font-size: 10.5px; white-space: pre-line; }
.catalog-section li::marker { color: var(--muted); font: 9px var(--mono); }
.catalog-sources {
    display: flex;
    flex-wrap: wrap;
    gap: 7px 14px;
    padding: 14px 24px;
    border-top: 1px solid var(--line);
    background: var(--surface-2);
    font-size: 10.5px;
}
.catalog-sources span { width: 100%; color: var(--muted); font-family: var(--mono); }
.catalog-sources a { color: var(--accent); text-decoration: none; }
.catalog-sources a:hover { text-decoration: underline; }

@media (max-width: 1100px) {
    .capability-columns { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
    .capability-page-header { align-items: flex-start; flex-direction: column; }
    .capability-summary { grid-template-columns: 1fr 1fr; }
    .capability-form-row,
    .capability-add-ability .capability-form-row,
    .ability-edit-row { grid-template-columns: 1fr; }
    .subject-profile-entry { align-items: flex-start; flex-direction: column; }
    .curriculum-import-panel { align-items: stretch; flex-direction: column; }
    .curriculum-import-actions { flex-basis: auto; }
    .catalog-sections { grid-template-columns: 1fr; padding: 14px; }
    .catalog-block-header { padding: 18px; }
    .catalog-import-form { align-items: flex-start; flex-direction: column; padding: 12px 18px; }
    .catalog-policy-note { grid-template-columns: 1fr; gap: 5px; }
}
@media (max-width: 460px) {
    .capability-summary { grid-template-columns: 1fr; }
    .capability-item-actions { flex-wrap: wrap; }
    .capability-item-actions small { width: 100%; margin-bottom: 2px; }
}

/* ══════════════════════════════════════════════════════════
   知识点反馈树
   ══════════════════════════════════════════════════════════ */
.feedback-page-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    padding: 28px 0 18px;
}
.feedback-page-header h1 { margin: 4px 0 7px; font-size: 1.9rem; }
.feedback-page-header p { max-width: 760px; color: var(--muted); font-size: 13px; }
.feedback-header-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.feedback-cycle-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 18px;
}
.feedback-cycle-link {
    display: grid;
    gap: 1px;
    min-width: 126px;
    padding: 8px 11px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text-2);
    text-decoration: none;
}
.feedback-cycle-link span { font-size: 11.5px; }
.feedback-cycle-link small { color: var(--muted); font: 9px/1.4 var(--mono); }
.feedback-cycle-link:hover,
.feedback-cycle-link.active {
    border-color: var(--accent-line);
    color: var(--accent-hi);
    background: var(--accent-dim);
}

.feedback-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 24px;
}
.feedback-summary article {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: baseline;
    gap: 4px 14px;
    padding: 16px 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface);
}
.feedback-summary span { color: var(--text-2); font-size: 12px; }
.feedback-summary strong {
    grid-column: 2;
    grid-row: 1 / 3;
    color: var(--accent-hi);
    font: 24px/1 var(--mono);
}
.feedback-summary small { color: var(--muted); font-size: 10px; }

.feedback-control-section {
    margin-bottom: 24px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    overflow: hidden;
}
.feedback-control-count { color: var(--muted); font: 9.5px/1.4 var(--mono); }
.feedback-control-cycle-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 18px;
    border-bottom: 1px solid var(--line);
}
.feedback-control-cycle-head span { color: var(--muted); font: 9px/1.4 var(--mono); }
.feedback-control-cycle-head h3 { margin-top: 3px; font-family: var(--display); font-size: 17px; }
.feedback-control-status {
    flex: 0 0 auto;
    padding: 3px 8px;
    border: 1px solid var(--line-2);
    border-radius: 999px;
    color: var(--text-2);
    font: 9px/1.4 var(--mono);
}
.feedback-control-status.status-running { color: var(--accent-hi); border-color: var(--accent-line); }
.feedback-control-status.status-reviewed { color: #23845b; border-color: rgba(35,132,91,.32); }
.feedback-control-flow {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 24px minmax(0, 1fr) 24px minmax(0, 1fr) 24px minmax(0, 1fr);
    align-items: stretch;
    gap: 6px;
    padding: 18px;
    border-bottom: 1px solid var(--line);
    background: var(--surface-2);
}
.feedback-control-stage {
    min-width: 0;
    padding: 13px;
    border: 1px solid var(--line);
    border-top: 2px solid var(--line-2);
    border-radius: var(--radius-sm);
    background: var(--surface);
}
.feedback-control-stage.input-stage { border-top-color: #7eb7ff; }
.feedback-control-stage.blackbox-stage { border-top-color: var(--accent); }
.feedback-control-stage.output-stage { border-top-color: #23845b; }
.feedback-control-stage.adjust-stage { border-top-color: #c39bff; }
.feedback-control-stage-index { color: var(--muted); font: 8.5px/1.4 var(--mono); }
.feedback-control-stage h3 { margin: 5px 0 8px; font-family: var(--display); font-size: 12.5px; }
.feedback-control-stage > strong { display: block; margin-bottom: 3px; color: var(--accent-hi); font: 20px/1.2 var(--mono); }
.feedback-control-stage p { color: var(--text-2); font-size: 10.5px; line-height: 1.55; }
.feedback-control-stage small { display: block; margin-top: 5px; color: var(--muted); font-size: 9px; line-height: 1.5; }
.feedback-control-stage a { display: inline-block; margin-bottom: 6px; color: var(--accent); font-size: 9.5px; text-decoration: none; }
.feedback-control-stage a:hover { text-decoration: underline; }
.feedback-control-arrow { align-self: center; color: var(--accent); font: 18px/1 var(--mono); text-align: center; }

.feedback-control-actions { padding: 18px; }
.feedback-control-actions > header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}
.feedback-control-actions > header > div { display: flex; align-items: baseline; gap: 8px; }
.feedback-control-actions > header h3 { font-family: var(--display); font-size: 14px; }
.feedback-control-actions > header > span { color: var(--muted); font: 9.5px/1 var(--mono); }
.feedback-control-action-list { display: grid; gap: 9px; }
.feedback-control-action {
    padding: 13px 14px;
    border: 1px solid var(--line);
    border-left: 2px solid var(--line-2);
    border-radius: var(--radius-sm);
    background: var(--surface-2);
}
.feedback-control-action.status-in_progress { border-left-color: var(--accent); }
.feedback-control-action.status-done { border-left-color: #23845b; }
.feedback-control-action.status-blocked { border-left-color: var(--danger); }
.feedback-control-action > header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}
.feedback-control-action > header span { color: var(--muted); font: 8.5px/1.4 var(--mono); }
.feedback-control-action > header h4 { margin-top: 2px; color: var(--text); font-size: 12.5px; font-weight: 500; }
.feedback-control-action > header > strong { flex: 0 0 auto; color: var(--accent-hi); font: 9px/1.4 var(--mono); }
.feedback-control-action > p { margin-top: 7px; color: var(--text-2); font-size: 11px; line-height: 1.6; }
.feedback-control-action dl { display: grid; gap: 4px; margin-top: 8px; }
.feedback-control-action dl > div { display: grid; grid-template-columns: 42px minmax(0, 1fr); gap: 8px; }
.feedback-control-action dt { color: var(--muted); font-size: 9px; }
.feedback-control-action dd { color: var(--text-2); font-size: 9.5px; }
.feedback-control-output-record {
    position: relative;
    display: grid;
    gap: 4px;
    margin-top: 10px;
    padding: 10px 12px;
    border-left: 2px solid #23845b;
    background: rgba(35,132,91,.07);
}
.feedback-control-output-record p { padding-right: 70px; color: var(--text-2); font-size: 9.5px; }
.feedback-control-output-record b { color: var(--muted); font-weight: 500; }
.feedback-control-output-record > span { position: absolute; top: 9px; right: 10px; color: #23845b; font: 8.5px/1.4 var(--mono); }

.feedback-control-editor,
.feedback-control-create,
.feedback-control-review,
.feedback-control-history {
    margin-top: 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface);
}
.feedback-control-editor summary,
.feedback-control-create summary,
.feedback-control-review summary,
.feedback-control-history summary {
    padding: 9px 11px;
    color: var(--accent);
    font-size: 10px;
    cursor: pointer;
}
.feedback-control-editor form,
.feedback-control-create form,
.feedback-control-review form {
    display: grid;
    gap: 9px;
    padding: 12px;
    border-top: 1px solid var(--line);
}
.feedback-control-editor label,
.feedback-control-create label,
.feedback-control-review label {
    display: grid;
    gap: 4px;
    color: var(--muted);
    font-size: 9.5px;
}
.feedback-control-editor input,
.feedback-control-editor select,
.feedback-control-editor textarea,
.feedback-control-create input,
.feedback-control-create select,
.feedback-control-create textarea,
.feedback-control-review input,
.feedback-control-review select,
.feedback-control-review textarea {
    width: 100%;
    min-width: 0;
    padding: 8px 9px;
    border: 1px solid var(--line-2);
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    color: var(--text);
    font: 11px/1.5 var(--body);
}
.feedback-control-editor textarea,
.feedback-control-create textarea,
.feedback-control-review textarea { min-height: 64px; resize: vertical; }
.feedback-control-form-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.feedback-control-editor .btn,
.feedback-control-create .btn,
.feedback-control-review .btn { justify-self: start; }
.feedback-control-review { border-color: var(--accent-line); background: var(--accent-dim); }
.feedback-control-review summary { color: var(--accent-hi); }
.feedback-control-new-cycle { margin: 0 18px 18px; }
.feedback-control-empty { padding: 22px; color: var(--muted); font-size: 11px; text-align: center; }
.feedback-control-empty-state { padding: 34px 18px 22px; text-align: center; }
.feedback-control-empty-state h3 { font-family: var(--display); font-size: 15px; }
.feedback-control-empty-state p { margin-top: 4px; color: var(--muted); font-size: 10.5px; }
.feedback-control-history { margin: 0 18px 18px; }
.feedback-control-history > div { display: grid; border-top: 1px solid var(--line); }
.feedback-control-history article { padding: 12px 14px; border-bottom: 1px solid var(--line); }
.feedback-control-history article:last-child { border-bottom: 0; }
.feedback-control-history article header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.feedback-control-history article span { color: var(--muted); font: 8.5px/1.4 var(--mono); }
.feedback-control-history article h3 { margin-top: 2px; font-size: 11.5px; }
.feedback-control-history article header > strong { color: var(--accent-hi); font: 10px/1.4 var(--mono); }
.feedback-control-history article p { margin-top: 5px; color: var(--text-2); font-size: 9.5px; line-height: 1.55; }
.feedback-control-history article b { color: var(--muted); font-weight: 500; }

.feedback-tree-section,
.feedback-detail-section,
.feedback-trend-section {
    margin-bottom: 24px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--surface);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}
.feedback-section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 17px 20px;
    border-bottom: 1px solid var(--line);
    background: linear-gradient(125deg, rgba(53,104,212,.115), rgba(255,255,255,.78) 64%);
}
.feedback-section-heading > div { display: flex; align-items: baseline; gap: 9px; }
.feedback-section-heading h2 { font-family: var(--display); font-size: 16px; }
.feedback-section-heading > small { color: var(--muted); font-size: 10.5px; }
.feedback-legend { display: flex; flex-wrap: wrap; gap: 12px; }
.feedback-legend span { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 9.5px; }
.feedback-legend-dot { width: 7px; height: 7px; border-radius: 50%; }
.feedback-legend-dot.high { background: var(--danger); }
.feedback-legend-dot.mid { background: var(--accent); }
.feedback-legend-dot.low { background: #23845b; }

.feedback-tree-root {
    position: relative;
    width: min(340px, calc(100% - 36px));
    margin: 20px auto 44px;
    padding: 15px 18px;
    border: 1px solid var(--accent-line);
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(53,104,212,.14), rgba(255,255,255,.94));
    box-shadow: 0 12px 30px rgba(53,104,212,.10);
}
.feedback-tree-root::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    width: 1px;
    height: 45px;
    background: var(--accent-line);
}
.feedback-tree-root > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.feedback-tree-root span { font-family: var(--display); font-weight: 600; }
.feedback-tree-root strong { color: var(--accent-hi); font: 22px/1 var(--mono); }
.feedback-tree-root small { display: block; margin-top: 3px; color: var(--muted); font-size: 9.5px; }

.feedback-domain-grid {
    position: relative;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    padding: 0 20px 22px;
}
.feedback-domain-grid::before {
    content: '';
    position: absolute;
    top: -22px;
    left: 16.5%;
    right: 16.5%;
    height: 1px;
    background: var(--line-2);
}
.feedback-domain-card {
    position: relative;
    min-width: 0;
    border: 1px solid var(--line);
    border-top: 2px solid var(--line-2);
    border-radius: 14px;
    background: var(--surface);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}
.feedback-domain-card::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    width: 1px;
    height: 23px;
    background: var(--line-2);
}
.feedback-domain-card.status-high { border-top-color: rgba(195,63,77,.68); }
.feedback-domain-card.status-mid { border-top-color: var(--accent-line); }
.feedback-domain-card.status-low { border-top-color: rgba(35,132,91,.56); }
.feedback-domain-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    min-height: 68px;
    padding: 13px 14px;
    border-bottom: 1px solid var(--line);
}
.feedback-domain-header span { display: block; color: var(--muted); font: 9px/1.4 var(--mono); }
.feedback-domain-header h3 {
    max-width: 230px;
    margin-top: 3px;
    overflow: hidden;
    font-family: var(--display);
    font-size: 13.5px;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.feedback-domain-header > strong { color: var(--text-2); font: 17px/1 var(--mono); }
.feedback-point-list {
    display: grid;
    grid-template-rows: repeat(7, 48px);
    height: 352px;
    padding: 9px;
    background: linear-gradient(180deg, rgba(247,249,252,.72), rgba(255,255,255,.92));
}
.feedback-point-node {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    width: 100%;
    height: 48px;
    padding: 8px 9px 8px 12px;
    border: 0;
    border-left: 2px solid var(--line-2);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    background: transparent;
    color: var(--text);
    text-align: left;
    cursor: pointer;
}
.feedback-point-node[hidden] { display: none; }
.feedback-point-node:hover { background: rgba(53,104,212,.065); }
.feedback-point-node.selected { background: var(--accent-dim); box-shadow: inset 0 0 0 1px var(--accent-line), 0 4px 12px rgba(53,104,212,.06); }
.feedback-point-node.status-high { border-left-color: rgba(195,63,77,.72); }
.feedback-point-node.status-mid { border-left-color: var(--accent-line); }
.feedback-point-node.status-low { border-left-color: rgba(35,132,91,.62); }
.feedback-point-node > span { min-width: 0; }
.feedback-point-node strong {
    display: block;
    overflow: hidden;
    color: var(--text-2);
    font-size: 11.5px;
    font-weight: 500;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.feedback-point-node small { display: block; margin-top: 1px; color: var(--muted); font-size: 8.5px; }
.feedback-point-node b { color: var(--text-2); font: 11px/1 var(--mono); }
.feedback-domain-pagination {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) 34px;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    padding: 4px 8px;
    border-top: 1px solid var(--line);
}
.feedback-domain-pagination > span {
    color: var(--text-2);
    font: 9.5px/1.4 var(--mono);
    text-align: center;
}
.feedback-domain-pagination > span b { color: var(--accent-hi); font-weight: 500; }
.feedback-domain-pagination > span small { margin-left: 5px; color: var(--muted); font-size: 8.5px; }
.feedback-domain-pagination button {
    display: grid;
    width: 30px;
    height: 30px;
    place-items: center;
    border: 1px solid var(--line-2);
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-2);
    cursor: pointer;
}
.feedback-domain-pagination button:hover:not(:disabled) {
    border-color: var(--accent-line);
    background: var(--accent-dim);
    color: var(--accent-hi);
}
.feedback-domain-pagination button:disabled { opacity: .28; cursor: not-allowed; }
.feedback-domain-pagination svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.7;
}

.feedback-selected-status {
    padding: 3px 8px;
    border: 1px solid var(--line-2);
    border-radius: 999px;
    color: var(--muted);
    font: 9.5px/1.4 var(--mono);
}
.feedback-selected-status.status-high { color: var(--danger); border-color: rgba(195,63,77,.32); }
.feedback-selected-status.status-mid { color: var(--accent-hi); border-color: var(--accent-line); }
.feedback-selected-status.status-low { color: #23845b; border-color: rgba(35,132,91,.32); }
.feedback-detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(300px, .75fr);
    align-items: stretch;
}
.feedback-node-diagnosis { padding: 20px; }
.feedback-detail-unit { color: var(--accent); font: 9.5px/1.4 var(--mono); }
.feedback-node-diagnosis h3 { margin: 3px 0 14px; font-family: var(--display); font-size: 20px; }
.feedback-node-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 18px;
}
.feedback-node-metrics span {
    display: grid;
    gap: 2px;
    padding: 9px 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    color: var(--muted);
    font-size: 9.5px;
}
.feedback-node-metrics strong { color: var(--text-2); font: 14px/1.4 var(--mono); }
.feedback-diagnosis-copy { display: grid; gap: 12px; }
.feedback-diagnosis-copy > div {
    padding: 12px 14px;
    border-left: 2px solid var(--line-2);
    background: var(--surface-2);
}
.feedback-diagnosis-copy span { color: var(--muted); font-size: 9.5px; }
.feedback-diagnosis-copy p { margin-top: 3px; color: var(--text-2); font-size: 12px; line-height: 1.65; }
.feedback-diagnosis-copy .feedback-next-action { border-left-color: var(--accent); background: var(--accent-dim); }

.feedback-evidence-panel { border-left: 1px solid var(--line); background: var(--surface-2); }
.feedback-evidence-panel > header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
}
.feedback-evidence-panel h3 { font-size: 12.5px; }
.feedback-evidence-panel header span { color: var(--muted); font: 9.5px/1 var(--mono); }
.feedback-evidence-list { display: grid; max-height: 380px; overflow-y: auto; }
.feedback-evidence-row { padding: 11px 16px; border-bottom: 1px solid var(--line); }
.feedback-evidence-row > div { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.feedback-evidence-row a { color: var(--text-2); font-size: 10.5px; text-decoration: none; }
.feedback-evidence-row a:hover { color: var(--accent-hi); }
.feedback-evidence-row strong { flex: 0 0 auto; color: var(--muted); font: 9px/1.4 var(--mono); }
.feedback-evidence-row.result-correct strong { color: #23845b; }
.feedback-evidence-row.result-partial strong { color: var(--accent-hi); }
.feedback-evidence-row.result-wrong strong { color: var(--danger); }
.feedback-evidence-row p { margin-top: 3px; color: var(--muted); font-size: 9px; }
.feedback-evidence-row .feedback-evidence-reason { color: var(--text-2); font-size: 10px; line-height: 1.5; }
.feedback-evidence-empty { padding: 36px 18px; color: var(--muted); font-size: 11px; text-align: center; }

.feedback-trend-chart { padding: 16px 18px 12px; }
.feedback-trend-chart svg { display: block; width: 100%; height: auto; max-height: 220px; }
.feedback-chart-grid { stroke: var(--line-2); stroke-width: 1; }
.feedback-chart-line { fill: none; stroke: var(--accent); stroke-width: 2.5; }
.feedback-chart-point { fill: var(--surface); stroke: var(--accent); stroke-width: 2; }
.feedback-chart-point.current { fill: var(--accent); }
.feedback-chart-axis-label { fill: var(--muted); font: 9px var(--mono); }
.feedback-chart-value { fill: var(--text-2); font: 9.5px var(--mono); }
.feedback-formula-note {
    margin-bottom: 60px;
    padding: 12px 15px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface);
}
.feedback-formula-note summary { color: var(--text-2); font-size: 11px; cursor: pointer; }
.feedback-formula-note p { margin-top: 8px; color: var(--muted); font-size: 10.5px; line-height: 1.65; }

@media (max-width: 980px) {
    .feedback-control-flow { grid-template-columns: 1fr 20px 1fr; }
    .feedback-control-flow .feedback-control-arrow:nth-of-type(2) { display: none; }
    .feedback-control-flow .output-stage,
    .feedback-control-flow .adjust-stage { margin-top: 4px; }
    .feedback-domain-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .feedback-domain-grid::before,
    .feedback-domain-card::before { display: none; }
    .feedback-tree-root { margin-bottom: 20px; }
    .feedback-tree-root::after { display: none; }
    .feedback-detail-layout { grid-template-columns: 1fr; }
    .feedback-evidence-panel { border-top: 1px solid var(--line); border-left: 0; }
}
@media (max-width: 700px) {
    .feedback-page-header { align-items: flex-start; flex-direction: column; }
    .feedback-summary { grid-template-columns: 1fr; }
    .feedback-domain-grid { grid-template-columns: 1fr; }
    .feedback-control-flow { grid-template-columns: 1fr; }
    .feedback-control-arrow { transform: rotate(90deg); }
    .feedback-control-flow .feedback-control-arrow:nth-of-type(2) { display: block; }
    .feedback-control-form-row { grid-template-columns: 1fr; }
    .feedback-control-action > header { flex-direction: column; }
    .feedback-node-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .feedback-section-heading { align-items: flex-start; flex-direction: column; }
}
@media (max-width: 440px) {
    .feedback-cycle-link { flex: 1 1 120px; }
    .feedback-header-actions { width: 100%; }
    .feedback-header-actions .btn { flex: 1; }
    .feedback-domain-grid { padding-inline: 10px; }
}

/* ── 试卷卡片 AI 徽标 ───────────────────────────── */
.analysis-badge {
    margin-left: auto;
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 999px;
    color: var(--accent-hi);
    background: var(--accent-dim);
    border: 1px solid var(--accent-line);
}
.analysis-badge.badge-processing {
    color: var(--text-2);
    background: var(--surface-3);
    border-color: var(--line-2);
}

/* ── 试卷详情布局 ───────────────────────────────── */
.section-title {
    font-family: var(--display);
    font-size: 15px;
    font-weight: 600;
    color: var(--text-2);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--line);
}

/* ── 标题 + 右侧动作按钮 —— flex 行 ──────────── */
.section-header-with-action {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--line);
}
.section-header-with-action .section-title {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: 0;
    flex: 1 1 auto;
}
.section-header-with-action #resummaryBtn {
    flex: 0 0 auto;
    font-size: 12px;
    padding: 6px 12px;
}

/* ── 重新总结中的 narrative 半透蒙层 ─────────── */
.narrative-loading {
    position: relative;
    pointer-events: none;
    opacity: .55;
}
.narrative-loading::after {
    content: '正在重新总结…';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,.84);
    color: var(--text);
    font-size: 12px;
    font-family: var(--mono);
    border-radius: 8px;
    border: 1px solid var(--line);
    backdrop-filter: blur(3px);
}

/* ── 顶部试卷缩略图 ─────────────────────────────── */
.page-thumbs-section { margin-top: 12px; }
.page-thumbs {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 8px;
}
.page-thumb {
    flex: 0 0 auto;
    width: 92px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface);
    cursor: pointer;
    overflow: hidden;
    transition: border-color .16s, box-shadow .16s;
}
.page-thumb:hover {
    border-color: var(--accent-line);
    box-shadow: 0 0 0 1px var(--accent-line), 0 0 12px var(--glow);
}
.page-thumb img {
    width: 100%;
    height: 116px;
    object-fit: cover;
    display: block;
}
.page-thumb-label {
    display: block;
    padding: 4px 6px;
    font-size: 11px;
    color: var(--muted);
    font-family: var(--mono);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── 试卷图片放大 Lightbox ──────────────────────── */
.lightbox-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,.82);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.lightbox-backdrop[hidden] { display: none; }
.lightbox-figure {
    margin: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}
.lightbox-figure img {
    max-width: 90vw;
    max-height: 82vh;
    object-fit: contain;
    border-radius: var(--radius-sm);
    box-shadow: 0 8px 40px rgba(0,0,0,.5);
    transition: transform .2s ease;
}
.lightbox-figure figcaption {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255,255,255,.88);
    font-family: var(--mono);
    font-size: 13px;
}
.lightbox-close {
    position: absolute;
    top: 18px; right: 22px;
    width: 40px; height: 40px;
    border: 1px solid var(--line-2);
    border-radius: 50%;
    background: rgba(20,20,26,.7);
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    transition: all .16s;
}
.lightbox-close:hover { border-color: rgba(255,255,255,.55); color: #fff; background: rgba(53,104,212,.88); }
.lightbox-rotate {
    position: absolute;
    top: 18px; right: 72px;
    width: 40px; height: 40px;
    border: 1px solid var(--line-2);
    border-radius: 50%;
    background: rgba(20,20,26,.7);
    color: #fff;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    transition: all .16s;
}
.lightbox-rotate:hover { border-color: rgba(255,255,255,.55); color: #fff; background: rgba(53,104,212,.88); }
.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px; height: 48px;
    border: 1px solid var(--line-2);
    border-radius: 50%;
    background: rgba(20,20,26,.7);
    color: #fff;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    transition: all .16s;
}
.lightbox-nav:hover { border-color: rgba(255,255,255,.55); color: #fff; background: rgba(53,104,212,.88); }
.lightbox-nav[hidden] { display: none; }
.lightbox-prev { left: 22px; }
.lightbox-next { right: 22px; }

.detail-analysis {
    position: sticky;
    top: 76px;
}
.detail-analysis-full {
    position: static;
    margin-top: 20px;
}

/* ── 分析面板状态 ───────────────────────────────── */
.analysis-empty, .analysis-processing, .analysis-error {
    padding: 20px;
    border-radius: var(--radius);
    background: var(--surface);
    border: 1px solid var(--line);
    font-size: 14px;
    color: var(--text-2);
}
.analysis-error { color: var(--danger); border-color: rgba(255,106,106,.35); }
.analysis-processing { display: flex; align-items: center; gap: 10px; }
.analysis-actions {
    margin-top: 12px;
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}
.analysis-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #1f2937;
    color: #fff;
    padding: 10px 18px;
    border-radius: var(--radius);
    font-size: 14px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 1000;
    animation: toast-in 0.2s ease-out;
}
@keyframes toast-in {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}
.spinner {
    width: 16px; height: 16px;
    border: 2px solid var(--line-2);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── 分析汇总 ───────────────────────────────────── */
.analysis-summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 16px;
}
.sum-item {
    text-align: center;
    padding: 12px 4px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
}
.sum-num {
    display: block;
    font-family: var(--mono);
    font-size: 22px;
    font-weight: 600;
    line-height: 1.1;
}
.sum-label { font-size: 11px; color: var(--muted); }
.sum-correct .sum-num { color: #23845b; }
.sum-wrong .sum-num { color: var(--danger); }

/* ── 分析表格 ───────────────────────────────────── */
.analysis-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
}
.analysis-table th, .analysis-table td {
    padding: 9px 10px;
    text-align: left;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
}
.analysis-table th {
    font-family: var(--display);
    font-weight: 500;
    font-size: 12px;
    color: var(--text-2);
    background: var(--surface-2);
}
.analysis-table tr:last-child td { border-bottom: 0; }
.analysis-table .q-num { font-family: var(--mono); white-space: nowrap; }
.analysis-table .q-mark { text-align: center; font-size: 15px; font-weight: 700; }
.row-correct .q-mark { color: #23845b; }
.row-wrong .q-mark { color: var(--danger); }
.row-wrong { background: rgba(255,106,106,.05); }
.row-pending .q-mark { color: var(--muted); }
.row-pending { background: rgba(30,41,59,.025); }
.q-mark-pending { color: var(--muted); font-weight: 600; }
.q-note { color: var(--muted); font-size: 12px; }

/* ── 内联字段:难度 / 知识点 / 错因 ─────────────── */
.diff-badge {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 7px;
    border-radius: 999px;
    font-family: var(--display);
    font-size: 10.5px;
    line-height: 1.5;
    letter-spacing: .02em;
    border: 1px solid transparent;
    vertical-align: middle;
}
.diff-easy { color: #23845b; background: rgba(35,132,91,.09); border-color: rgba(35,132,91,.30); }
.diff-mid  { color: #926113; background: rgba(146,97,19,.09); border-color: rgba(146,97,19,.30); }
.diff-hard { color: var(--danger); background: rgba(255,106,106,.12); border-color: rgba(255,106,106,.4); }
.q-skills {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 6px;
}
.skill-chip {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 999px;
    background: var(--surface-2);
    border: 1px solid var(--line-2);
    color: var(--text-2);
    font-size: 11px;
    letter-spacing: .02em;
}
.q-err {
    margin-top: 5px;
    color: var(--danger);
    font-size: 11.5px;
    line-height: 1.4;
}

/* ── mark_type 边角痕迹 + 部分对扣分 ─────────────── */
.q-mark-extras {
    margin-top: 4px;
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    justify-content: center;
}
.mark-extra {
    display: inline-block;
    min-width: 18px;
    padding: 1px 5px;
    border-radius: 999px;
    background: var(--surface-2);
    border: 1px solid var(--line-2);
    color: var(--text-2);
    font-size: 10.5px;
    line-height: 1.4;
    font-family: var(--mono);
}
.q-mark-meta {
    margin-top: 4px;
    font-size: 11px;
}
.partial-badge {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 4px;
    background: rgba(230,193,95,.18);
    color: var(--accent);
    border: 1px solid rgba(230,193,95,.4);
    font-family: var(--mono);
}

/* ── 作答步骤折叠面板 ───────────────────────────── */
.q-steps {
    margin-top: 8px;
    font-size: 11.5px;
    color: var(--text-2);
}
.q-steps > summary {
    cursor: pointer;
    user-select: none;
    color: var(--muted);
    font-size: 11px;
    list-style: none;
    padding: 2px 0;
}
.q-steps > summary::-webkit-details-marker { display: none; }
.q-steps > summary::before {
    content: "▸ ";
    display: inline-block;
    transition: transform .15s;
}
.q-steps[open] > summary::before { content: "▾ "; }
.q-steps-list {
    margin: 6px 0 0;
    padding-left: 18px;
    list-style: decimal;
}
.q-steps-list li {
    margin-bottom: 2px;
    line-height: 1.45;
}
.q-step-done { color: var(--text-2); }
.q-step-done .q-step-glyph { color: var(--muted); margin-right: 4px; }
.q-step-stuck { color: var(--danger); }
.q-step-stuck .q-step-glyph {
    color: var(--danger);
    margin-right: 4px;
    font-weight: 700;
}

/* ── 汇总:部分对格 ─────────────────────────────── */
.sum-partial .sum-num { color: var(--accent); }
.analysis-summary:has(.sum-partial) { grid-template-columns: repeat(5, 1fr); }

/* ── 小问行(number 含 "-N" 后缀) ─────────────────── */
.analysis-table tr.q-sub td { background: rgba(30,41,59,.035); }
.analysis-table tr.q-sub .q-num {
    padding-left: 18px;
    color: var(--muted);
    position: relative;
}
.analysis-table tr.q-sub .q-num::before {
    content: "└";
    position: absolute;
    left: 4px;
    color: var(--line);
}

/* ── 分块进度条 + 增量结果标签 ─────────────────────── */
.analysis-progress {
    margin: 8px 0 14px;
}
.progress-bar {
    height: 6px;
    background: var(--surface-2);
    border-radius: 999px;
    overflow: hidden;
    border: 1px solid var(--line);
}
.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #23845b, #3568d4);
    transition: width .4s ease;
}
.progress-text {
    margin-top: 6px;
    font-size: 12px;
    color: var(--muted);
    font-family: var(--mono);
}
.partial-tag {
    display: inline-block;
    margin-bottom: 8px;
    padding: 3px 10px;
    border-radius: 999px;
    background: rgba(78,163,216,.12);
    color: #4ea3d8;
    font-size: 12px;
    font-family: var(--mono);
}
.analysis-meta {
    margin-top: 10px;
    font-size: 11px;
    color: var(--muted);
    font-family: var(--mono);
}
.analysis-history-section {
    display: grid;
    gap: 12px;
    margin-top: 30px;
    padding-top: 22px;
    border-top: 1px solid var(--line);
}
.analysis-history-section > header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
}
.analysis-history-section > header h3 { margin: 0; color: var(--text-2); font-size: 14px; }
.analysis-history-section > header p { margin: 4px 0 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.analysis-history-section > header > span { flex: 0 0 auto; color: var(--muted); font: 10px/1 var(--mono); }
#analysisHistoryPanel { display: grid; gap: 10px; }
.analysis-history-empty {
    padding: 25px 18px;
    border: 1px dashed var(--line-2);
    border-radius: 10px;
    color: var(--muted);
    font-size: 11px;
    text-align: center;
}
.analysis-history-card {
    display: grid;
    gap: 9px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface-2);
}
.analysis-history-card > header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}
.analysis-history-card > header > div:first-child { min-width: 0; }
.analysis-history-card > header span { color: var(--muted); font: 9px/1.4 var(--mono); }
.analysis-history-card > header h4 { margin: 3px 0 0; color: var(--text-2); font-size: 12px; }
.analysis-history-actions { display: flex; flex: 0 0 auto; gap: 9px; }
.analysis-history-actions button,
.analysis-history-editor button {
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--accent-hi);
    font-size: 10px;
    cursor: pointer;
}
.analysis-history-actions button:hover,
.analysis-history-editor button:hover { text-decoration: underline; }
.analysis-history-actions .danger { color: var(--danger); }
.analysis-history-actions button:disabled,
.analysis-history-editor button:disabled { opacity: .48; cursor: wait; }
.analysis-history-pages {
    padding: 7px 9px;
    border-radius: 7px;
    background: var(--accent-dim);
    color: var(--text-2);
    font-size: 10px;
    line-height: 1.55;
}
.analysis-history-metrics { color: var(--muted); font-size: 9px; }
.analysis-history-text {
    max-height: 320px;
    margin: 0;
    padding: 12px;
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: var(--surface);
    color: var(--text-2);
    font: 11px/1.7 var(--body);
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}
.analysis-history-text[hidden],
.analysis-history-editor[hidden] { display: none; }
.analysis-history-editor { display: grid; gap: 9px; }
.analysis-history-editor textarea {
    width: 100%;
    min-height: 230px;
    padding: 12px;
    resize: vertical;
    border: 1px solid var(--accent-line);
    border-radius: 9px;
    outline: 0;
    background: var(--surface);
    color: var(--text);
    font: 11px/1.7 var(--body);
}
.analysis-history-editor textarea:focus { box-shadow: 0 0 0 3px var(--accent-dim); }
.analysis-history-editor > div { display: flex; justify-content: flex-end; gap: 12px; }
.analysis-history-editor .primary { font-weight: 600; }

/* ── 单卷 narrative(整体总结 + 学生画像预测) ───────── */
.analysis-narrative {
    margin-top: 12px;
    padding: 12px 14px;
    background: var(--surface-2, #f8fafc);
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 8px;
}
.analysis-narrative + .analysis-narrative { margin-top: 8px; }
.analysis-narrative + table,
.analysis-narrative + .analysis-empty { margin-top: 10px; }
.material-understanding {
    margin-bottom: 14px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: linear-gradient(145deg, var(--surface), var(--surface-2));
}
.material-heading { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.material-heading h3 { margin: 0; color: var(--text); font-size: 15px; }
.material-kind {
    padding: 4px 8px;
    border: 1px solid var(--accent-line);
    border-radius: 999px;
    background: var(--accent-dim);
    color: var(--accent-hi);
    font: 10px/1 var(--mono);
}
.material-summary { margin: 11px 0 0; color: var(--text-2); font-size: 13px; line-height: 1.75; white-space: pre-wrap; }
.material-observations { display: grid; gap: 6px; margin: 12px 0 0; padding-left: 19px; color: var(--text-2); font-size: 12px; line-height: 1.6; }
.material-excerpt,
.material-images { margin-top: 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.material-excerpt summary,
.material-images summary { padding: 10px 0 2px; color: var(--text-2); cursor: pointer; }
.material-excerpt p { margin: 7px 0 0; color: var(--text-2); line-height: 1.7; white-space: pre-wrap; }
.material-images ol { display: grid; gap: 7px; margin: 8px 0 0; padding-left: 22px; }
.material-images li strong,
.material-images li span { display: block; }
.material-images li span { margin-top: 2px; color: var(--text-2); line-height: 1.55; }
.narrative-title {
    margin: 0 0 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text, #1f2937);
}
.narrative-text {
    margin: 0;
    font-size: 13px;
    line-height: 1.7;
    color: var(--text, #374151);
    white-space: pre-wrap;
    word-break: break-word;
}
.narrative-empty {
    margin: 0;
    font-size: 12px;
    color: var(--muted);
    font-style: italic;
}

/* ── 减少动效 ───────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    * { animation: none !important; transition: none !important; }
    .group-card:hover { transform: none; }
    .student-card:hover { transform: none; }
}

/* ── 学情报告 ────────────────────────────────────── */
.report-page { padding: 1rem 0; }

.report-doc {
    max-width: 880px;
    margin: 0 auto;
    background: var(--surface, #fff);
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 12px;
    padding: 2rem 2.5rem;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.report-header { margin-bottom: 1.5rem; padding-bottom: 1rem; border-bottom: 1px solid var(--border, #e5e7eb); }
.report-header-top { display: flex; align-items: baseline; gap: 1rem; flex-wrap: wrap; margin-bottom: 0.5rem; }
.report-title { font-size: 1.6rem; font-weight: 600; margin: 0; }
.report-tag { padding: 0.2rem 0.6rem; border-radius: 6px; font-size: 0.85rem; font-weight: 500; }
.report-student-meta { color: var(--muted); font-size: 0.9rem; }
.report-student-meta span + span::before { content: " · "; color: var(--muted); }

.report-meta-grid { display: flex; gap: 1.5rem; margin-top: 0.5rem; flex-wrap: wrap; }
.meta-item { display: flex; flex-direction: column; font-size: 0.85rem; }
.meta-label { color: var(--muted); font-size: 0.75rem; }
.meta-value { font-weight: 500; }

.report-toolbar { display: flex; gap: 1rem; align-items: center; margin-top: 1rem; padding-top: 1rem; border-top: 1px dashed var(--border); }
.inline-form { display: inline; }
.btn-link.btn-danger { color: #dc2626; }
.report-edit-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 2rem;
    margin: 1.2rem 0 1rem;
}
.report-edit-heading > div { display: grid; gap: .35rem; }
.report-edit-heading span { color: var(--accent-hi); font: 700 .68rem/1 var(--mono); letter-spacing: .14em; }
.report-edit-heading h1 { margin: 0; font-size: 1.85rem; }
.report-edit-heading p { margin: 0; color: var(--muted); font-size: .86rem; }
.report-edit-form {
    display: grid;
    gap: 1rem;
    margin-bottom: 3rem;
    padding: 1.4rem;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}
.report-edit-meta { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: .85rem; }
.report-edit-form label { display: grid; gap: .42rem; color: var(--text-2); font-size: .78rem; }
.report-edit-form textarea {
    width: 100%;
    min-height: 90px;
    padding: .8rem .9rem;
    resize: vertical;
    border: 1px solid var(--border);
    border-radius: 9px;
    outline: 0;
    background: var(--surface);
    color: var(--text);
    font: .86rem/1.65 var(--body);
}
.report-edit-form textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }
.report-edit-form .report-edit-markdown { min-height: 480px; font-family: var(--mono); }
.report-edit-form label > small { color: var(--muted); font-size: .7rem; }
.report-edit-actions { display: flex; align-items: center; justify-content: flex-end; gap: .75rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.report-edit-actions > div { display: grid; margin-right: auto; gap: .2rem; }
.report-edit-actions strong { font-size: .76rem; }
.report-edit-actions small { color: var(--muted); font-size: .68rem; }

@media (max-width: 900px) {
    .report-edit-meta { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
    .report-edit-heading { align-items: flex-start; flex-direction: column; }
    .report-edit-meta { grid-template-columns: 1fr; }
    .report-edit-actions { align-items: stretch; flex-direction: column; }
    .report-edit-actions > div { margin-right: 0; }
}

.agent-report-document { display: grid; gap: 2rem; }
.agent-report-markdown { color: var(--text-2, #374151); font-size: 0.98rem; line-height: 1.82; }
.agent-report-markdown h1,
.agent-report-markdown h2,
.agent-report-markdown h3,
.agent-report-markdown h4 { color: var(--text, #111827); line-height: 1.35; }
.agent-report-markdown h1 { margin: 0 0 1.4rem; font-size: 1.65rem; }
.agent-report-markdown h2 { margin: 2rem 0 0.8rem; padding-bottom: 0.45rem; border-bottom: 1px solid var(--border, #e5e7eb); font-size: 1.25rem; }
.agent-report-markdown h3 { margin: 1.5rem 0 0.6rem; font-size: 1.08rem; }
.agent-report-markdown h4 { margin: 1.2rem 0 0.5rem; font-size: 1rem; }
.agent-report-markdown p { margin: 0.75rem 0; }
.agent-report-markdown ul,
.agent-report-markdown ol { display: grid; gap: 0.45rem; margin: 0.8rem 0; padding-left: 1.4rem; }
.agent-report-markdown blockquote { margin: 1rem 0; padding: 0.8rem 1rem; border-left: 3px solid var(--accent, #4f46e5); border-radius: 4px; background: rgba(79,70,229,.05); color: var(--text-2, #374151); }
.agent-report-markdown code { padding: 0.12rem 0.35rem; border-radius: 4px; background: rgba(15,23,42,.07); font-size: 0.9em; }
.agent-report-markdown a { color: var(--accent, #4f46e5); }
.agent-report-sources { display: grid; gap: 0.35rem; padding: 1rem 1.1rem; border: 1px solid var(--border, #e5e7eb); border-radius: 10px; background: rgba(15,23,42,.025); }
.agent-report-sources span { color: var(--muted); font-size: 0.72rem; letter-spacing: .08em; text-transform: uppercase; }
.agent-report-sources strong { font-size: 0.9rem; }
.agent-report-sources small { color: var(--muted); line-height: 1.55; }

/* ── 整体画像(稳定度卡片) ─────────────────────────── */
.stability-card {
    margin-top: 0.8rem;
    padding: 0.8rem 1rem;
    background: rgba(79, 70, 229, 0.04);
    border-radius: 8px;
    border: 1px solid rgba(79, 70, 229, 0.12);
}
.stability-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}
.stability-row:last-child { margin-bottom: 0; }
.stability-label { color: var(--muted); font-size: 0.9rem; }
.stability-value { font-weight: 600; font-size: 1rem; font-variant-numeric: tabular-nums; }
.stability-value-muted { color: var(--muted); font-size: 0.9rem; font-variant-numeric: tabular-nums; }
.stability-bar {
    flex: 1;
    min-width: 120px;
    height: 8px;
    background: rgba(0, 0, 0, 0.06);
    border-radius: 999px;
    overflow: hidden;
}
.stability-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #4f46e5, #818cf8);
    border-radius: 999px;
    transition: width 0.3s ease;
}
.trend-chip {
    display: inline-block;
    padding: 0.15rem 0.6rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
}
.trend-improving { background: #dcfce7; color: #15803d; }
.trend-stable { background: #e0e7ff; color: #4338ca; }
.trend-declining { background: #fee2e2; color: #b91c1c; }

/* ── 知识地图(父技能分组行) ─────────────────────────── */
.kp-group td {
    background: rgba(0, 0, 0, 0.04);
    font-weight: 600;
    color: var(--muted);
    font-size: 0.85rem;
    padding-top: 0.6rem;
    padding-bottom: 0.4rem;
}

/* ── 错法画像(频次条) ─────────────────────────────── */
.error-clusters {
    display: grid;
    gap: 0.6rem;
    margin-top: 0.6rem;
}
.error-cluster-row {
    display: grid;
    grid-template-columns: minmax(120px, 0.6fr) 1.4fr auto;
    align-items: center;
    gap: 0.7rem;
    padding: 0.5rem 0.8rem;
    background: rgba(0, 0, 0, 0.02);
    border-radius: 6px;
    border: 1px solid var(--border);
}
.error-cluster-reason {
    font-weight: 500;
    font-size: 0.95rem;
    color: #b91c1c;
}
.error-cluster-bar {
    height: 8px;
    background: rgba(220, 38, 38, 0.08);
    border-radius: 999px;
    overflow: hidden;
}
.error-cluster-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #dc2626, #f87171);
    border-radius: 999px;
    transition: width 0.3s ease;
}
.error-cluster-meta {
    display: flex;
    gap: 0.7rem;
    font-size: 0.8rem;
    color: var(--muted);
    flex-wrap: wrap;
}
.error-cluster-freq { font-weight: 600; color: #b91c1c; }
.error-cluster-questions,
.error-cluster-papers { font-variant-numeric: tabular-nums; }

/* ── 思维习惯画像 ──────────────────────────────────── */
.cognitive-habits {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 0.6rem;
}
.cognitive-habits li {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    padding: 0.7rem 0.9rem;
    background: linear-gradient(90deg, rgba(79, 70, 229, 0.04), rgba(79, 70, 229, 0.01));
    border-left: 3px solid var(--accent, #4f46e5);
    border-radius: 4px;
    line-height: 1.6;
}
.habit-icon { flex-shrink: 0; }

/* ── Report picker ─────────────────────────────── */
.subject-cards { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.subject-card { flex: 0 0 auto; min-width: 120px; }

.subject-papers { display: grid; gap: 0.6rem; }
.paper-pick {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.7rem 0.9rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
.paper-pick:hover { background: rgba(0,0,0,0.02); border-color: var(--accent, #4f46e5); }
.paper-pick input[type="checkbox"] { width: 18px; height: 18px; cursor: pointer; }
.paper-pick-body { flex: 1; }
.paper-pick-title { font-weight: 500; display: flex; align-items: center; gap: 0.5rem; }
.paper-pick-meta { font-size: 0.85rem; color: var(--muted); margin-top: 0.2rem; }

.form-actions-inline { margin-top: 0.6rem; display: flex; align-items: center; gap: 0.5rem; font-size: 0.9rem; color: var(--muted); }
.paper-selected-count { margin-left: auto; color: var(--accent); font-weight: 500; }

/* ── Report list ───────────────────────────────── */
.report-list { display: grid; gap: 0.6rem; max-width: 880px; margin: 0 auto; }
.report-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.8rem 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    color: inherit;
    text-decoration: none;
    transition: border-color 0.15s, background 0.15s;
}
.report-row:hover { border-color: var(--accent); background: rgba(79,70,229,0.03); }
.report-row-left { display: flex; align-items: center; gap: 0.8rem; }
.report-row-info { display: flex; flex-direction: column; }
.report-row-title { font-weight: 500; }
.report-row-meta { font-size: 0.85rem; color: var(--muted); }

.status-pill {
    display: inline-block;
    padding: 0.2rem 0.7rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 500;
}
.status-done { background: #dcfce7; color: #15803d; }
.status-processing { background: #dbeafe; color: #1d4ed8; }
.status-error { background: #fee2e2; color: #b91c1c; }

/* ── 打印样式 ─────────────────────────────────── */
@media print {
    .no-print, .detail-breadcrumb, .report-toolbar { display: none !important; }
    body { padding-top: 0; background: white !important; }
    .report-doc { border: none; box-shadow: none; padding: 0; max-width: none; }
    .container { max-width: none; padding: 0; }
    .report-page { padding: 0; }
}

/* ── Prompt 编辑模态 ─────────────────────────── */
.prompt-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(6,6,9,.72);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.prompt-modal-backdrop[hidden] { display: none; }
.prompt-modal-shell {
    width: min(720px, 100%);
    max-height: calc(100vh - 48px);
    background: var(--surface);
    border: 1px solid var(--line-2);
    border-radius: 14px;
    box-shadow: 0 40px 120px -30px rgba(0,0,0,.95), 0 0 0 1px var(--line);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.prompt-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    background: var(--surface-2);
    border-bottom: 1px solid var(--line);
}
.prompt-modal-header h2 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 600;
}
.prompt-modal-close {
    background: transparent;
    border: 0;
    color: var(--muted);
    font-size: 18px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
}
.prompt-modal-close:hover { background: var(--surface-3); color: var(--text); }
.prompt-modal-body {
    flex: 1;
    padding: 16px 18px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.prompt-modal-hint {
    margin: 0;
    color: var(--muted);
    font-size: 0.85rem;
    line-height: 1.5;
}
.prompt-modal-textarea {
    flex: 1;
    min-height: 280px;
    background: var(--surface-2);
    color: var(--text);
    border: 1px solid var(--line-2);
    border-radius: 8px;
    padding: 12px 14px;
    font-family: 'JetBrains Mono', 'SF Mono', Menlo, Consolas, monospace;
    font-size: 13px;
    line-height: 1.55;
    resize: vertical;
    outline: none;
    tab-size: 2;
}
.prompt-modal-textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }
.prompt-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 18px;
    background: var(--surface-2);
    border-top: 1px solid var(--line);
}
.prompt-modal-footer .btn-secondary { margin-right: auto; }
.analysis-prompt-modal-shell { width: min(860px, 100%); }
.analysis-prompt-modal-shell .prompt-modal-body { overflow-y: auto; }
.analysis-prompt-modal-shell .prompt-modal-textarea {
    min-height: 170px;
    flex: 0 0 190px;
}
.analysis-page-picker {
    display: grid;
    gap: 10px;
    min-width: 0;
    margin: 0;
    padding: 12px;
    border: 1px solid var(--line-2);
    border-radius: 10px;
    background: var(--surface-2);
}
.analysis-page-picker-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}
.analysis-page-picker-header > div:first-child { display: grid; gap: 3px; }
.analysis-page-picker-header legend {
    padding: 0;
    color: var(--text-2);
    font-size: 12px;
    font-weight: 600;
}
.analysis-page-picker-header span { color: var(--muted); font-size: 10px; }
.analysis-page-picker-header > div:last-child { display: flex; gap: 8px; }
.analysis-page-picker-header button {
    padding: 4px 7px;
    border: 0;
    background: transparent;
    color: var(--accent-hi);
    font-size: 10px;
    cursor: pointer;
}
.analysis-page-picker-header button:hover { text-decoration: underline; }
.analysis-page-picker-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 7px;
    max-height: 190px;
    overflow-y: auto;
}
.analysis-page-picker-item {
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    min-width: 0;
    padding: 7px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: var(--surface);
}
.analysis-page-picker-item:has(input:checked) {
    border-color: var(--accent-line);
    background: var(--accent-dim);
    box-shadow: inset 0 0 0 1px rgba(53,104,212,.07);
}
.analysis-page-picker-item > label {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 7px;
    cursor: pointer;
}
.analysis-page-picker-grid input {
    flex: 0 0 auto;
    width: 15px;
    height: 15px;
    accent-color: var(--accent);
}
.analysis-page-picker-thumb {
    position: relative;
    display: block;
    width: 46px;
    height: 56px;
    padding: 0;
    overflow: hidden;
    border: 0;
    border-radius: 6px;
    background: var(--surface-3);
    cursor: zoom-in;
}
.analysis-page-picker-thumb img { width: 100%; height: 100%; object-fit: cover; }
.analysis-page-picker-thumb b {
    position: absolute;
    right: 3px;
    bottom: 3px;
    display: grid;
    min-width: 16px;
    height: 16px;
    place-items: center;
    padding: 0 4px;
    border-radius: 999px;
    background: rgba(15,23,42,.78);
    color: #fff;
    font: 9px/1 var(--mono);
}
.analysis-page-picker-thumb i {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    background: rgba(15,23,42,.55);
    color: #fff;
    font: 9px/1 var(--body);
    font-style: normal;
    opacity: 0;
    transition: opacity .15s ease;
}
.analysis-page-picker-thumb:hover i,
.analysis-page-picker-thumb:focus-visible i { opacity: 1; }
.analysis-page-picker-thumb:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}
.analysis-page-picker-item > label > span { display: grid; min-width: 0; gap: 3px; }
.analysis-page-picker-grid strong,
.analysis-page-picker-grid small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.analysis-page-picker-grid strong { color: var(--text-2); font-size: 10px; }
.analysis-page-picker-grid small { color: var(--muted); font-size: 8px; }

@media (max-width: 680px) {
    .analysis-page-picker-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .analysis-page-picker-header { align-items: flex-start; flex-direction: column; }
}
.analysis-page-preview-backdrop {
    position: fixed;
    z-index: 140;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 22px;
    background: rgba(6,9,15,.86);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}
.analysis-page-preview-backdrop[hidden] { display: none; }
.analysis-page-preview-dialog {
    display: flex;
    width: min(1180px, 100%);
    height: min(900px, calc(100vh - 44px));
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,.14);
    border-radius: 16px;
    background: #111722;
    box-shadow: 0 35px 120px rgba(0,0,0,.55);
}
.analysis-page-preview-dialog > header,
.analysis-page-preview-dialog > footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 12px 15px;
    background: rgba(20,27,39,.96);
    color: #e8edf6;
}
.analysis-page-preview-dialog > header { border-bottom: 1px solid rgba(255,255,255,.10); }
.analysis-page-preview-dialog > footer { border-top: 1px solid rgba(255,255,255,.10); }
.analysis-page-preview-dialog > header > div { display: grid; min-width: 0; gap: 4px; }
.analysis-page-preview-dialog > header span {
    color: #8996aa;
    font: 8px/1 var(--mono);
    letter-spacing: .12em;
}
.analysis-page-preview-dialog > header h2 {
    overflow: hidden;
    margin: 0;
    font-size: 15px;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.analysis-page-preview-dialog > header button,
.analysis-page-preview-dialog > footer button {
    flex: 0 0 auto;
    border: 0;
    color: #e8edf6;
    cursor: pointer;
}
.analysis-page-preview-dialog > header button {
    display: grid;
    width: 32px;
    height: 32px;
    place-items: center;
    border-radius: 50%;
    background: rgba(255,255,255,.09);
}
.analysis-page-preview-dialog > footer span { color: #9ba7b9; font-size: 10px; }
.analysis-page-preview-dialog > footer button {
    padding: 7px 11px;
    border-radius: 7px;
    background: rgba(255,255,255,.10);
    font-size: 10px;
}
.analysis-page-preview-dialog button:hover { background: rgba(255,255,255,.17); }
.analysis-page-preview-canvas {
    display: grid;
    min-height: 0;
    flex: 1;
    place-items: center;
    padding: 18px;
    overflow: auto;
}
.analysis-page-preview-canvas img {
    display: block;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    box-shadow: 0 12px 48px rgba(0,0,0,.32);
}

@media (max-width: 680px) {
    .analysis-page-preview-backdrop { padding: 8px; }
    .analysis-page-preview-dialog {
        height: calc(100vh - 16px);
        border-radius: 12px;
    }
    .analysis-page-preview-dialog > footer span { display: none; }
}

/* ── AI 对错单元格:可点击编辑 ── */
.analysis-table td.q-mark-editable {
    cursor: pointer;
    transition: background-color 0.15s ease, transform 0.05s ease;
    user-select: none;
}

.analysis-table td.q-mark-editable:hover {
    background-color: rgba(80, 130, 200, 0.12);
}

.analysis-table td.q-mark-editable:active {
    transform: scale(0.92);
    background-color: rgba(80, 130, 200, 0.2);
}

.analysis-table td.q-mark-editable:focus {
    outline: 2px solid rgba(80, 130, 200, 0.55);
    outline-offset: -2px;
}

/* ── 学生作答单元格:可点击编辑 ── */
.analysis-table td.q-ans-editable {
    cursor: text;
    position: relative;
    transition: background-color 0.15s ease;
    white-space: pre-wrap;
    word-break: break-word;
    min-width: 120px;
}

.analysis-table td.q-ans-editable:hover {
    background-color: rgba(80, 130, 200, 0.10);
}

.analysis-table td.q-ans-editable:focus {
    outline: 2px solid rgba(80, 130, 200, 0.55);
    outline-offset: -2px;
}

.analysis-table td.q-ans-editable:empty::before {
    content: '(空)';
    color: var(--muted);
    font-style: italic;
}

/* ── 学生作答:无感编辑 ────────────────────
 * 单元格的展示文本与编辑态共用字体 / 行高 / 内边距,
 * textarea 通过全部透明化做到"原地打字、原地显示"的错觉 */
.q-ans-edit {
    display: block;
    width: 100%;
    min-height: 1.2em;
    box-sizing: border-box;
    /* 完全透明的输入框:无边框、无背景、无内边距(用单元格本身的内边距) */
    background: transparent;
    border: 0;
    outline: none;
    padding: 0;
    margin: 0;
    resize: none;
    /* 与展示文本同款 */
    font-family: inherit;
    font-size: inherit;
    font-weight: inherit;
    line-height: inherit;
    color: inherit;
    /* 拼写/语法检查的红线与本工具无关,关掉避免视觉干扰 */
    spellcheck: false;
}

.q-ans-edit::placeholder {
    color: var(--muted);
    font-style: italic;
}

/* 编辑态给单元格一个极轻的背景提示(不出框不出线,仅 4% 不透明度的蓝) */
.analysis-table td.q-ans-editing {
    background-color: rgba(80, 130, 200, 0.04);
}

/* ══════════════════════════════════════════════════════════
   分屏双栏:试卷图 + AI 分析表(改答案时眼不离图)
   ══════════════════════════════════════════════════════════ */

.edit-split {
    display: grid;
    grid-template-columns: minmax(320px, 44%) 1fr;
    gap: 20px;
    align-items: start;
    margin-top: 16px;
}

.edit-split-paper {
    position: sticky;
    top: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 14px;
    /* 防止内部图片旋转/缩放时撑破容器 */
    overflow: hidden;
}

.paper-viewer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.paper-viewer-header .section-title { margin: 0; }

.paper-viewer-actions {
    display: flex;
    gap: 6px;
}

.paper-viewer-actions .btn-icon {
    width: 32px;
    height: 32px;
    padding: 0;
    border: 1px solid var(--line-2);
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    color: var(--text);
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    transition: border-color .16s, color .16s;
}
.paper-viewer-actions .btn-icon:hover {
    border-color: var(--accent-line);
    color: var(--accent-hi);
}

.paper-viewer {
    position: relative;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 380px;
}

.paper-figure {
    margin: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    /* 旋转 90/270 时给图片留垂直空间 */
    padding: 8px;
    box-sizing: border-box;
}

.paper-figure img {
    max-width: 100%;
    max-height: 64vh;
    object-fit: contain;
    display: block;
    transition: transform .2s ease;
    cursor: zoom-in;
    /* 旋转时不溢出 figure */
    transform-origin: center center;
}

.paper-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--line-2);
    background: rgba(20, 20, 26, .75);
    color: #fff;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    z-index: 2;
    transition: border-color .16s, color .16s;
}
.paper-nav:hover { border-color: rgba(255,255,255,.55); color: #fff; background: rgba(53,104,212,.88); }
.paper-nav[hidden] { display: none; }
.paper-nav-prev { left: 8px; }
.paper-nav-next { right: 8px; }

.paper-viewer-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-size: 12px;
    color: var(--muted);
    font-family: var(--mono);
    padding: 0 2px;
}
.paper-viewer-hint { color: var(--muted); opacity: .7; }

.edit-split-paper.has-image-extractions {
    position: static;
    top: auto;
}

.image-extractions-panel {
    min-width: 0;
    padding-top: 8px;
    border-top: 1px solid var(--line);
}

.image-extractions-panel[hidden] {
    display: none;
}

.image-extractions-panel .image-extractions {
    margin: 0;
}

.image-extractions-panel .image-extractions-heading h3 {
    font-size: 1rem;
}

.image-extractions-panel .image-extraction-item-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
}

.image-extractions-panel .image-extraction-item-heading span {
    color: var(--text-muted, #6b7280);
    font-size: 0.82rem;
    text-align: right;
}

.image-extractions-panel .image-question-table {
    min-width: 440px;
    font-size: 0.82rem;
}

/* 缩略图改为 viewer 内悬浮条:默认只露当前页(右下角小角标),
   鼠标 hover viewer 时展开为完整缩略图条 */
.paper-viewer .page-thumbs {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    padding: 5px 7px;
    background: rgba(0, 0, 0, .58);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: var(--radius-sm);
    z-index: 3;
    /* 默认只显示当前页 thumb 的宽度,其他 width:0 自然不占位 */
    transition: gap .2s ease;
}

.paper-viewer .page-thumb {
    position: relative;
    flex: 0 0 auto;
    width: 0;                /* 收起态:非激活的宽度为 0 */
    height: 52px;
    padding: 0;
    margin: 0;
    border: 1px solid transparent;
    border-radius: 4px;
    background: rgba(255, 255, 255, .04);
    cursor: pointer;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transition: width .22s ease, opacity .18s ease, margin .22s ease,
                border-color .16s ease, box-shadow .16s ease;
}

.paper-viewer .page-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    opacity: .9;
}

/* 收起态:只有当前页可见 */
.paper-viewer .page-thumb.page-thumb-active {
    width: 44px;
    opacity: 1;
    pointer-events: auto;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent);
}
.paper-viewer .page-thumb.page-thumb-active + .page-thumb,
.paper-viewer .page-thumb:has(+ .page-thumb.page-thumb-active) {
    /* 让当前页左右的非激活缩略图也保持隐藏,避免突然出现 */
}

/* 悬浮展开:显示全部缩略图 */
.paper-viewer:hover .page-thumbs { gap: 6px; }
.paper-viewer:hover .page-thumb {
    width: 44px;
    opacity: 1;
    pointer-events: auto;
    margin: 0 1px;
}
.paper-viewer:hover .page-thumb:not(.page-thumb-active) {
    border-color: rgba(255, 255, 255, .18);
}
.paper-viewer:hover .page-thumb:hover {
    border-color: var(--accent-line);
    box-shadow: 0 0 0 1px var(--accent-line), 0 0 8px var(--glow);
}

/* 数字角标:始终可见,标在缩略图右下角 */
.paper-thumb-num,
.paper-viewer .page-thumb-num {
    position: absolute;
    right: 2px;
    bottom: 2px;
    min-width: 14px;
    height: 14px;
    padding: 0 3px;
    border-radius: 7px;
    background: rgba(0, 0, 0, .72);
    color: #fff;
    font-size: 10px;
    font-family: var(--mono);
    line-height: 14px;
    text-align: center;
    pointer-events: none;
}

/* 右栏:仅取消 sticky(原来 detail-analysis-full 是 sticky 的,现在不需要) */
.edit-split-table.detail-analysis {
    position: static;
    top: auto;
}

/* 证据库内嵌模式：保留完整试卷交互，移除重复的全局页面外壳。 */
body.embedded-group-detail {
    min-height: 100vh;
    padding-top: 0;
    display: block;
    background: #f4f7fb;
}
body.embedded-group-detail > .ambient { display: none; }
body.embedded-group-detail > main.container {
    max-width: none;
    margin: 0;
    padding: 0 20px 24px;
}
.embedded-group-detail .embedded-detail-hidden { display: none; }
.embedded-group-detail .gallery-header { padding: 17px 0 11px; }
.embedded-group-detail .gallery-header h1 { font-size: 1.35rem; }
.embedded-group-detail .gallery-actions .btn { padding: 8px 12px; font-size: 12px; }
.embedded-group-detail .edit-split { grid-template-columns: minmax(300px, 42%) minmax(0, 1fr); gap: 14px; margin-top: 10px; }
.embedded-group-detail .edit-split-paper { top: 12px; padding: 11px; }
.embedded-group-detail .paper-viewer { min-height: 360px; }
.embedded-group-detail .detail-analysis { padding: 14px; }
.embedded-group-detail .analysis-table { font-size: 11px; }

/* 窄屏 (≤960px):折叠为上下堆叠,放弃分屏(小屏上双栏太挤) */
@media (max-width: 960px) {
    .edit-split {
        grid-template-columns: 1fr;
    }
    .edit-split-paper {
        position: static;
        top: auto;
    }
    .paper-figure img { max-height: 50vh; }
}

/* ── Longitudinal multimodal learning evidence ───────────── */
.evidence-page-header { align-items: flex-start; }

.evidence-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin: 18px 0 28px;
}

.evidence-summary article {
    display: grid;
    gap: 5px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface);
}

.evidence-summary article > span,
.evidence-summary small { color: var(--text-2); }
.evidence-summary strong { font-size: 1.8rem; }

.evidence-capture {
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--surface);
}

.evidence-capture > header,
.evidence-capture > header > div,
.evidence-timeline-section .feedback-section-heading,
.evidence-month > header,
.evidence-event-body > header,
.evidence-event-body > footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.evidence-capture > header { align-items: flex-end; margin-bottom: 20px; }
.evidence-capture > header > div { justify-content: flex-start; }
.evidence-capture > header h2,
.evidence-month h3,
.evidence-event-body h3 { margin: 0; }
.evidence-capture > header p { max-width: 520px; margin: 0; color: var(--text-2); }

.evidence-capture-form { display: grid; gap: 16px; }
.evidence-capture-form label { display: grid; gap: 7px; }
.evidence-capture-form label > span { font-weight: 600; }
.evidence-capture-form label > small { color: var(--text-2); }
.evidence-capture-form input,
.evidence-capture-form select,
.evidence-capture-form textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--line-2);
    border-radius: 9px;
    background: var(--surface-2);
    color: var(--text);
    font: inherit;
}
.evidence-capture-form textarea { min-height: 88px; resize: vertical; }
.evidence-capture-form > label > textarea { min-height: 130px; }

.evidence-form-grid {
    display: grid;
    grid-template-columns: minmax(0, 2fr) repeat(2, minmax(150px, 1fr));
    gap: 14px;
}
.evidence-form-grid-four { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.evidence-artifact-row {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr);
    gap: 18px;
    align-items: end;
}
.evidence-process-check {
    display: flex !important;
    align-items: center;
    padding-bottom: 10px;
}
.evidence-process-check input { width: auto; }

.evidence-timeline-section { margin-top: 32px; }
.evidence-timeline-section .feedback-section-heading { margin-bottom: 18px; }
.evidence-month-list { display: grid; gap: 26px; }
.evidence-month > header {
    padding-bottom: 10px;
    border-bottom: 1px solid var(--line);
}
.evidence-month > header span { color: var(--text-2); }
.evidence-event-list { display: grid; }

.evidence-event {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 18px;
    padding: 18px 0;
    border-bottom: 1px solid var(--line);
}
.evidence-event-time { display: grid; align-content: start; justify-items: center; }
.evidence-event-time strong { font-size: 1.55rem; }
.evidence-event-time span,
.evidence-event-body > header span,
.evidence-event-body > footer { color: var(--text-2); }
.evidence-event-body { min-width: 0; }
.evidence-event-body > header { align-items: flex-start; }
.evidence-event-body > header > div { min-width: 0; }
.evidence-event-body > header h3 { margin-top: 4px; }
.evidence-event-body > p { white-space: pre-wrap; }

.evidence-result {
    flex: 0 0 auto;
    padding: 5px 9px;
    border-radius: 999px;
    background: var(--surface-2);
}
.evidence-result.result-mastered { color: #23845b; }
.evidence-result.result-not_mastered { color: var(--danger); }
.evidence-result.result-partial { color: var(--accent-hi); }

.evidence-links { display: flex; flex-wrap: wrap; gap: 7px; margin: 12px 0; }
.evidence-links span {
    padding: 4px 8px;
    border-radius: 999px;
    background: var(--surface-2);
    color: var(--text-2);
    font-size: .84rem;
}
.evidence-artifact { margin: 12px 0; }
.evidence-artifact img {
    display: block;
    width: min(260px, 100%);
    max-height: 220px;
    object-fit: cover;
    border-radius: 10px;
}
.evidence-artifact audio { width: min(520px, 100%); }
.evidence-event-body > footer { margin-top: 12px; font-size: .86rem; }
.evidence-event.is-void { opacity: .62; }
.evidence-event.is-void .evidence-event-body > p { text-decoration: line-through; }

@media (max-width: 980px) {
    .evidence-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .evidence-form-grid-four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .evidence-form-grid { grid-template-columns: 1fr 1fr; }
    .evidence-form-grid > :first-child { grid-column: 1 / -1; }
}

@media (max-width: 640px) {
    .evidence-summary,
    .evidence-form-grid,
    .evidence-form-grid-four,
    .evidence-artifact-row { grid-template-columns: 1fr; }
    .evidence-form-grid > :first-child { grid-column: auto; }
    .evidence-capture { padding: 18px; }
    .evidence-capture > header,
    .evidence-event-body > header,
    .evidence-event-body > footer { align-items: flex-start; flex-direction: column; }
    .evidence-event { grid-template-columns: 42px minmax(0, 1fr); gap: 10px; }
    .evidence-event-time strong { font-size: 1.25rem; }
}

/* ── Teacher-first subject workspace ─────────────────────── */
.teacher-workspace-header {
    position: relative;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-top: 16px;
    padding: 30px 32px;
    overflow: hidden;
    border: 1px solid rgba(53,104,212,.16);
    border-radius: 22px;
    background:
        radial-gradient(420px 220px at 92% 5%, rgba(116,91,216,.10), transparent 70%),
        linear-gradient(125deg, rgba(53,104,212,.11), rgba(255,255,255,.92) 58%);
    box-shadow: var(--shadow-md);
}
.teacher-workspace-header::after {
    content: "";
    position: absolute;
    width: 210px;
    height: 210px;
    right: -96px;
    top: -116px;
    border: 34px solid rgba(53,104,212,.055);
    border-radius: 50%;
}
.teacher-workspace-header > * { position: relative; z-index: 1; }
.teacher-workspace-header h1 { margin: 6px 0 7px; font-size: 2.15rem; letter-spacing: -.035em; }
.teacher-workspace-header p { color: var(--text-2); }

/* ── Multimodal workspace composer ─────────────────────── */
.teacher-composer {
    margin: 4px 0 22px;
    padding: 20px;
    border: 1px solid rgba(53,104,212,.20);
    border-radius: 22px;
    background: rgba(255,255,255,.92);
    box-shadow: var(--shadow-md);
}
.teacher-composer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 14px;
}
.teacher-composer-header > div:first-child {
    display: flex;
    align-items: center;
    gap: 11px;
    min-width: 0;
}
.composer-spark {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    flex: 0 0 auto;
    border-radius: 11px;
    background: linear-gradient(135deg, var(--accent-hi), #7459d8);
    color: #fff;
    box-shadow: 0 8px 20px rgba(53,104,212,.22);
}
.teacher-composer h2 { margin: 0; font-size: 1rem; letter-spacing: -.01em; }
.teacher-composer-header p { margin: 1px 0 0; color: var(--muted); font-size: 11px; }
.composer-tabs {
    display: flex;
    flex: 0 0 auto;
    gap: 3px;
    padding: 3px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface-2);
}
.composer-tab {
    padding: 6px 11px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--muted);
    font: 500 11px/1.4 var(--body);
    cursor: pointer;
}
.composer-tab:hover { color: var(--text); }
.composer-tab.active {
    background: var(--surface);
    color: var(--accent-hi);
    box-shadow: 0 1px 5px rgba(38,55,88,.10);
}
.composer-input-shell {
    overflow: hidden;
    border: 1px solid var(--line-2);
    border-radius: 16px;
    background: #fbfcfe;
    transition: border-color .16s, box-shadow .16s, background .16s;
}
.composer-input-shell:focus-within {
    border-color: rgba(53,104,212,.48);
    background: var(--surface);
    box-shadow: 0 0 0 4px rgba(53,104,212,.075);
}
.composer-input-shell textarea {
    display: block;
    width: 100%;
    min-height: 96px;
    padding: 17px 18px 8px;
    border: 0;
    outline: 0;
    resize: vertical;
    background: transparent;
    color: var(--text);
    font: 14px/1.7 var(--body);
}
.composer-input-shell textarea::placeholder { color: #8b95a8; }
.composer-toolbar {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 8px 9px 9px;
}
.composer-attach,
.composer-select {
    display: inline-flex;
    align-items: center;
    min-width: 0;
    height: 32px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: var(--surface);
    color: var(--text-2);
}
.composer-attach {
    gap: 6px;
    max-width: 210px;
    padding: 0 9px;
    font-size: 10.5px;
    cursor: pointer;
}
.composer-attach:hover,
.composer-select:hover { border-color: var(--accent-line); color: var(--accent-hi); }
.composer-attach input { display: none; }
.composer-attach svg {
    width: 15px;
    height: 15px;
    flex: 0 0 auto;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.composer-attach span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.composer-select select {
    height: 100%;
    padding: 0 26px 0 9px;
    border: 0;
    outline: 0;
    background: transparent;
    color: inherit;
    font: 10.5px/1 var(--body);
    cursor: pointer;
}
.composer-spacer { flex: 1; }
.composer-send {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 34px;
    padding: 0 9px 0 13px;
    border: 0;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--accent), var(--accent-hi));
    color: #fff;
    font: 600 11px/1 var(--body);
    box-shadow: 0 7px 16px rgba(53,104,212,.22);
    cursor: pointer;
}
.composer-send:hover { filter: brightness(1.04); transform: translateY(-1px); }
.composer-send:disabled { opacity: .42; box-shadow: none; cursor: not-allowed; transform: none; }
.composer-send svg {
    width: 19px;
    height: 19px;
    padding: 3px;
    border-radius: 6px;
    background: rgba(255,255,255,.14);
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.composer-options {
    margin-top: 8px;
    padding: 0 4px;
}
.composer-options > summary {
    width: max-content;
    color: var(--muted);
    font-size: 10px;
    cursor: pointer;
}
.composer-options[open] > summary { margin-bottom: 10px; }
.composer-option-grid {
    display: grid;
    grid-template-columns: 1.6fr 1.15fr 1fr .55fr;
    gap: 10px;
}
.composer-option-grid label { display: grid; gap: 5px; }
.composer-option-grid label > span { color: var(--muted); font-size: 9.5px; }
.composer-option-grid input,
.composer-option-grid select {
    width: 100%;
    min-height: 36px;
    padding: 7px 9px;
    border: 1px solid var(--line);
    border-radius: 8px;
    outline: 0;
    background: var(--surface-2);
    color: var(--text);
    font: 10.5px/1.4 var(--body);
}

.composer-paper-form { display: grid; gap: 12px; }
.composer-form[hidden] { display: none; }
.paper-type-switch {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}
.paper-type-switch label { cursor: pointer; }
.paper-type-switch input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.paper-type-switch label > span {
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding: 9px 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface-2);
    color: var(--text-2);
}
.paper-type-switch small { color: var(--muted); }
.paper-type-switch input:checked + span {
    border-color: var(--accent-line);
    background: var(--accent-dim);
    color: var(--accent-hi);
    box-shadow: inset 0 0 0 1px rgba(53,104,212,.05);
}
.paper-dropzone {
    display: grid;
    justify-items: center;
    gap: 4px;
    padding: 25px 18px;
    border: 1px dashed rgba(53,104,212,.34);
    border-radius: 15px;
    background: linear-gradient(180deg, rgba(53,104,212,.035), rgba(53,104,212,.015));
    color: var(--text-2);
    text-align: center;
    cursor: pointer;
    transition: border-color .16s, background .16s, transform .16s;
}
.paper-dropzone:hover,
.paper-dropzone.is-dragging {
    border-color: var(--accent);
    background: var(--accent-dim);
    transform: translateY(-1px);
}
.paper-dropzone input { display: none; }
.paper-dropzone-icon {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    margin-bottom: 3px;
    border-radius: 10px;
    background: var(--surface);
    color: var(--accent-hi);
    box-shadow: var(--shadow-sm);
}
.paper-dropzone-icon svg {
    width: 19px;
    height: 19px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.paper-dropzone strong { font-size: 12px; }
.paper-dropzone small { color: var(--muted); font-size: 9.5px; }
.paper-file-list { display: flex; flex-wrap: wrap; gap: 6px; }
.paper-file-list:empty { display: none; }
.paper-file-list span {
    overflow: hidden;
    max-width: 240px;
    padding: 5px 8px;
    border-radius: 7px;
    background: var(--surface-2);
    color: var(--text-2);
    font-size: 9.5px;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.paper-file-list span::before { content: "▧"; margin-right: 5px; color: var(--accent); }
.paper-composer-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
}
.paper-composer-actions > span { color: var(--muted); font-size: 10px; }

.teacher-next-step { margin-top: 0; }

.teacher-workflow {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    list-style: none;
    margin: 20px 0 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}
.teacher-workflow li {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 15px 18px;
    border-right: 1px solid var(--line);
}
.teacher-workflow li:last-child { border-right: 0; }
.teacher-workflow li > span {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(53,104,212,.14), rgba(53,104,212,.06));
    color: var(--accent-hi);
    font: 11px/1 var(--mono);
}
.teacher-workflow li div { display: grid; gap: 1px; }
.teacher-workflow li strong { font-size: 12px; }
.teacher-workflow li small { color: var(--muted); font-size: 10px; }

.teacher-next-step {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
    padding: 26px 28px 26px 32px;
    overflow: hidden;
    border: 1px solid rgba(53,104,212,.22);
    border-radius: 18px;
    background: linear-gradient(120deg, rgba(53,104,212,.13), rgba(255,255,255,.96) 66%);
    box-shadow: var(--shadow-sm);
}
.teacher-next-step::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 5px;
    background: linear-gradient(180deg, #7da5ff, var(--accent-hi));
}
.teacher-next-step > div { max-width: 780px; }
.teacher-next-step span {
    color: var(--accent-hi);
    font: 10px/1.4 var(--mono);
    letter-spacing: .12em;
    text-transform: uppercase;
}
.teacher-next-step h2 { margin: 7px 0 5px; font-size: 1.4rem; letter-spacing: -.02em; }
.teacher-next-step p { margin: 0; color: var(--text-2); }
.teacher-next-step > .btn { flex: 0 0 auto; }

.teacher-status-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin: 18px 0 32px;
}
.teacher-status-strip article {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 4px 14px;
    padding: 17px 19px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(255,255,255,.80);
    box-shadow: var(--shadow-sm);
}
.teacher-status-strip span { color: var(--text-2); font-size: 11px; }
.teacher-status-strip strong {
    grid-column: 2;
    grid-row: 1 / 3;
    color: var(--accent-hi);
    font: 24px/1 var(--mono);
}
.teacher-status-strip small { min-width: 0; color: var(--muted); font-size: 9.5px; }

.teacher-workspace-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 330px;
    gap: 30px;
    align-items: start;
}
.teacher-workspace-main { display: grid; gap: 34px; min-width: 0; }
.teacher-panel { min-width: 0; }
.teacher-panel > header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 16px;
    padding-bottom: 11px;
    border-bottom: 1px solid var(--line);
}
.teacher-panel > header > div { display: flex; align-items: center; gap: 10px; }
.teacher-panel > header h2 { margin: 0; font-size: 1.05rem; }
.teacher-panel > header p { margin: 0; color: var(--muted); font-size: 11px; }
.teacher-panel > header a { color: var(--accent-hi); font-size: 11px; text-decoration: none; }

.teacher-quick-feedback {
    position: relative;
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--surface);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}
.teacher-quick-feedback::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), #8067dc, transparent 82%);
}
.teacher-feedback-form { display: grid; gap: 14px; }
.teacher-feedback-form label { display: grid; gap: 6px; }
.teacher-feedback-form label > span { color: var(--text-2); font-size: 11px; }
.teacher-feedback-form input,
.teacher-feedback-form select,
.teacher-feedback-form textarea {
    width: 100%;
    padding: 10px 11px;
    border: 1px solid var(--line-2);
    border-radius: var(--radius-sm);
    background: #fbfcfe;
    color: var(--text);
    font: inherit;
    transition: border-color .16s, box-shadow .16s, background .16s;
}
.teacher-feedback-form input:hover,
.teacher-feedback-form select:hover,
.teacher-feedback-form textarea:hover { border-color: rgba(53,104,212,.24); }
.teacher-feedback-form input:focus,
.teacher-feedback-form select:focus,
.teacher-feedback-form textarea:focus {
    outline: none;
    border-color: var(--accent-line);
    background: var(--surface);
    box-shadow: 0 0 0 3px var(--accent-dim);
}
.teacher-feedback-form textarea { min-height: 112px; resize: vertical; }
.teacher-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.teacher-form-row-three { grid-template-columns: 1.5fr 1fr 1fr; }
.teacher-feedback-more {
    padding: 10px 12px;
    border: 1px dashed var(--line-2);
    border-radius: var(--radius-sm);
}
.teacher-feedback-more summary { color: var(--text-2); cursor: pointer; font-size: 11px; }
.teacher-feedback-more[open] summary { margin-bottom: 12px; }
.teacher-check {
    display: flex !important;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
}
.teacher-check input { width: auto; }

.teacher-risk-list { display: grid; }
.teacher-risk-list article {
    display: grid;
    grid-template-columns: minmax(170px, 1.1fr) minmax(220px, 2fr) auto;
    gap: 18px;
    align-items: center;
    margin-bottom: 8px;
    padding: 15px 16px 15px 18px;
    border: 1px solid var(--line);
    border-left: 3px solid rgba(195,63,77,.42);
    border-radius: 12px;
    background: rgba(255,255,255,.70);
    box-shadow: 0 4px 14px rgba(38,55,88,.035);
    transition: transform .16s, border-color .16s, box-shadow .16s;
}
.teacher-risk-list article:hover { transform: translateX(2px); border-color: rgba(195,63,77,.24); border-left-color: var(--danger); box-shadow: var(--shadow-sm); }
.teacher-risk-list article > div:first-child { display: grid; gap: 2px; }
.teacher-risk-list article > div:first-child span { color: var(--danger); font-size: 9.5px; }
.teacher-risk-list article > p { margin: 0; color: var(--text-2); font-size: 11px; }
.teacher-risk-list dl { display: flex; gap: 12px; }
.teacher-risk-list dl div { display: grid; justify-items: end; }
.teacher-risk-list dt { color: var(--muted); font-size: 8.5px; }
.teacher-risk-list dd { font: 11px/1.4 var(--mono); }

.teacher-recent-list { display: grid; }
.teacher-recent-list article {
    display: grid;
    grid-template-columns: 110px minmax(0, 1fr) auto;
    gap: 14px;
    align-items: start;
    padding: 13px 0;
    border-bottom: 1px solid var(--line);
}
.teacher-recent-list time { color: var(--muted); font: 9.5px/1.5 var(--mono); }
.teacher-recent-list article > div { min-width: 0; }
.teacher-recent-list article p { margin: 2px 0 0; color: var(--text-2); font-size: 11px; }
.teacher-recent-list article > span { color: var(--accent-hi); font-size: 9.5px; }
.teacher-empty { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.7; }

.teacher-workspace-side { display: grid; gap: 14px; }
.teacher-side-panel {
    padding: 19px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}
.teacher-side-panel > header {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 13px;
    padding-bottom: 9px;
    border-bottom: 1px solid var(--line);
}
.teacher-side-panel > header h2 { margin: 0; font-size: 13px; }
.teacher-side-panel > p { margin: 7px 0; color: var(--text-2); font-size: 10.5px; }
.teacher-cycle-title {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}
.teacher-cycle-title span { color: var(--muted); font-size: 9px; white-space: nowrap; }
.teacher-action-list { display: grid; gap: 12px; margin: 14px 0; list-style: none; }
.teacher-action-list li { display: grid; grid-template-columns: 20px 1fr; gap: 9px; }
.teacher-action-list li > span {
    display: grid;
    place-items: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent-dim);
    color: var(--accent-hi);
    font: 8px/1 var(--mono);
}
.teacher-action-list p { margin: 2px 0; color: var(--text-2); font-size: 10px; }
.teacher-action-list small { color: var(--muted); font-size: 8.5px; }
.teacher-data-health dl { display: grid; gap: 8px; }
.teacher-data-health dl div { display: flex; justify-content: space-between; gap: 12px; }
.teacher-data-health dt { color: var(--text-2); font-size: 10px; }
.teacher-data-health dd { font: 10px/1.5 var(--mono); }

.teacher-paper-library {
    margin-top: 34px;
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(255,255,255,.72);
    box-shadow: var(--shadow-sm);
}
.teacher-paper-library > header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 23px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--line);
}
.teacher-paper-library > header > div {
    display: flex;
    align-items: center;
    gap: 11px;
}
.teacher-paper-library > header h2 { margin: 0; font-size: 1.2rem; }
.teacher-paper-library > header p { margin: 1px 0 0; color: var(--muted); font-size: 10px; }
.teacher-paper-library .paper-date-list { gap: 28px; padding-bottom: 0; }
.teacher-paper-library .paper-date-heading h3 {
    font-family: var(--display);
    font-size: 15px;
    font-weight: 550;
    letter-spacing: .02em;
    color: var(--text-2);
}
.teacher-paper-empty {
    display: grid;
    justify-items: center;
    gap: 7px;
    padding: 50px 20px;
    color: var(--muted);
    text-align: center;
}
.teacher-paper-empty > span {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 13px;
    background: var(--surface-2);
    color: var(--accent);
    font-size: 20px;
}
.teacher-paper-empty strong { color: var(--text-2); font-size: 13px; }
.teacher-paper-empty p { margin: 0 0 6px; font-size: 10.5px; }

.teacher-tools {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 18px;
    margin-top: 30px;
    padding: 15px 18px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(255,255,255,.62);
    box-shadow: var(--shadow-sm);
}
.teacher-tools span { color: var(--muted); font-size: 10px; }
.teacher-tools a { color: var(--text-2); font-size: 10px; text-decoration: none; }
.teacher-tools a:hover { color: var(--accent-hi); }

@media (max-width: 980px) {
    .teacher-workspace-grid { grid-template-columns: 1fr; }
    .teacher-workspace-side { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .composer-option-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .teacher-risk-list article { grid-template-columns: minmax(150px, 1fr) minmax(0, 2fr); }
    .teacher-risk-list dl { grid-column: 1 / -1; }
    .teacher-risk-list dl div { justify-items: start; }
}

@media (max-width: 700px) {
    .teacher-workspace-header,
    .teacher-next-step { align-items: flex-start; flex-direction: column; }
    .teacher-workflow,
    .teacher-status-strip,
    .teacher-workspace-side { grid-template-columns: 1fr; }
    .teacher-workflow li { border-right: 0; border-bottom: 1px solid var(--line); }
    .teacher-workflow li:last-child { border-bottom: 0; }
    .teacher-workspace-header { padding: 24px 22px; }
    .teacher-composer { padding: 15px; border-radius: 17px; }
    .teacher-composer-header { align-items: flex-start; flex-direction: column; }
    .composer-tabs { width: 100%; }
    .composer-tab { flex: 1; }
    .composer-toolbar { flex-wrap: wrap; }
    .composer-spacer { display: none; }
    .composer-send { margin-left: auto; }
    .composer-option-grid,
    .paper-type-switch { grid-template-columns: 1fr; }
    .paper-type-switch label > span { justify-content: space-between; }
    .teacher-paper-library { padding: 17px; }
    .teacher-paper-library > header { align-items: flex-start; }
    .teacher-form-row,
    .teacher-form-row-three { grid-template-columns: 1fr; }
    .teacher-risk-list article,
    .teacher-recent-list article { grid-template-columns: 1fr; gap: 6px; }
    .teacher-risk-list dl { grid-column: auto; }
}

@media (max-width: 480px) {
    .composer-attach { max-width: 46px; padding-inline: 14px; }
    .composer-attach span { display: none; }
    .composer-select { flex: 1 1 105px; }
    .composer-select select { width: 100%; }
    .composer-send span { display: none; }
    .composer-send { padding: 0 8px; }
    .paper-composer-actions { align-items: stretch; flex-direction: column; }
    .paper-composer-actions .composer-send { width: 100%; margin-left: 0; }
    .teacher-paper-library > header { flex-direction: column; }
}

/* ══════════════════════════════════════════════════════════
   Focused subject workspace: overview / capture / plan
   ══════════════════════════════════════════════════════════ */
.workspace-compact-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 28px;
    padding: 25px 2px 18px;
}
.workspace-compact-header h1 {
    margin: 4px 0 3px;
    font-size: 2rem;
    letter-spacing: -.035em;
}
.workspace-compact-header p { margin: 0; color: var(--muted); font-size: 12px; }
.workspace-context-stats {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 7px;
}
.workspace-context-stats span {
    padding: 7px 10px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: rgba(255,255,255,.68);
    color: var(--muted);
    font-size: 9.5px;
    white-space: nowrap;
}
.workspace-context-stats b { color: var(--text-2); font: 600 11px/1 var(--mono); }

.workspace-mode-nav {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
    margin: 0 0 30px;
    padding: 6px;
    border: 1px solid var(--line);
    border-radius: 17px;
    background: rgba(235,240,248,.72);
    box-shadow: inset 0 1px 2px rgba(30,41,59,.025);
}
.workspace-mode {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    padding: 14px 16px;
    border: 1px solid transparent;
    border-radius: 12px;
    background: transparent;
    color: var(--muted);
    text-align: left;
    cursor: pointer;
    transition: color .18s, border-color .18s, background .18s, box-shadow .18s, transform .18s;
}
.workspace-mode:hover { color: var(--text); background: rgba(255,255,255,.48); }
.workspace-mode.active {
    border-color: rgba(53,104,212,.18);
    background: var(--surface);
    color: var(--text);
    box-shadow: 0 7px 22px rgba(38,55,88,.09);
    transform: translateY(-1px);
}
.workspace-mode.active::after {
    content: "";
    position: absolute;
    right: 16px;
    bottom: 10px;
    width: 20px;
    height: 3px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--accent), #765bd7);
}
.workspace-mode-number {
    display: grid;
    place-items: center;
    width: 31px;
    height: 31px;
    flex: 0 0 auto;
    border-radius: 9px;
    background: rgba(110,122,145,.08);
    color: var(--muted);
    font: 9px/1 var(--mono);
}
.workspace-mode.active .workspace-mode-number { background: var(--accent-dim); color: var(--accent-hi); }
.workspace-mode > span:last-child { display: grid; min-width: 0; }
.workspace-mode strong { color: inherit; font-size: 12.5px; }
.workspace-mode small {
    overflow: hidden;
    color: var(--muted);
    font-size: 9.5px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.workspace-view-panel { min-width: 0; animation: workspace-view-in .22s ease both; }
.workspace-view-panel[hidden] { display: none !important; }
@keyframes workspace-view-in {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}
.workspace-view-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 19px;
}
.workspace-view-heading > div > span {
    color: var(--accent);
    font: 9px/1.3 var(--mono);
    letter-spacing: .14em;
}
.workspace-view-heading h2 { margin: 4px 0 0; font-size: 1.38rem; letter-spacing: -.025em; }
.workspace-view-heading > p { max-width: 520px; margin: 0; color: var(--muted); font-size: 11px; text-align: right; }
.workspace-status-strip { margin: 0 0 18px; }

.workspace-overview-grid,
.workspace-planning-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.8fr) minmax(280px, .72fr);
    gap: 16px;
    align-items: stretch;
}
.workspace-focus-card {
    min-width: 0;
    padding: 21px;
    border: 1px solid var(--line);
    border-radius: 17px;
    background: rgba(255,255,255,.84);
    box-shadow: var(--shadow-sm);
}
.workspace-focus-card > header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 17px;
    padding-bottom: 11px;
    border-bottom: 1px solid var(--line);
}
.workspace-focus-card > header > div { display: flex; align-items: center; gap: 9px; min-width: 0; }
.workspace-focus-card > header h3,
.workspace-focus-card > header > h3 { margin: 0; font-size: 13px; }
.workspace-focus-card > header > a { color: var(--accent-hi); font-size: 10px; text-decoration: none; white-space: nowrap; }

.knowledge-visual-list { display: grid; gap: 5px; }
.knowledge-visual-list article {
    display: grid;
    grid-template-columns: minmax(150px, .9fr) minmax(120px, 1.25fr) 42px;
    gap: 9px 16px;
    align-items: center;
    padding: 10px 11px;
    border-radius: 10px;
    transition: background .16s;
}
.knowledge-visual-list article:hover { background: var(--surface-2); }
.knowledge-visual-name { display: grid; min-width: 0; }
.knowledge-visual-name span { color: var(--danger); font-size: 8.5px; }
.knowledge-visual-name strong { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.knowledge-loss-track {
    height: 6px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(195,63,77,.08);
}
.knowledge-loss-track span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #e5a263, var(--danger));
}
.knowledge-visual-value { display: grid; justify-items: end; }
.knowledge-visual-value b { font: 600 11px/1.2 var(--mono); }
.knowledge-visual-value small { color: var(--muted); font: 7px/1.2 var(--mono); }
.knowledge-visual-list article > p {
    grid-column: 1 / -1;
    overflow: hidden;
    margin: -4px 0 0;
    color: var(--muted);
    font-size: 9px;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.knowledge-visual-card > footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 14px;
    padding-top: 13px;
    border-top: 1px solid var(--line);
}
.knowledge-visual-card > footer > a:first-child { color: var(--muted); font-size: 9.5px; text-decoration: none; }

.report-snapshot-card { display: flex; flex-direction: column; }
.report-snapshot-card > header { justify-content: flex-start; }
.report-snapshot-main { display: grid; gap: 4px; padding: 4px 0 16px; }
.report-snapshot-main > span { color: var(--accent-hi); font: 9px/1.4 var(--mono); }
.report-snapshot-main > strong { font-size: 17px; }
.report-snapshot-main > p { margin: 0; color: var(--muted); font-size: 9.5px; }
.report-freshness {
    display: flex;
    align-items: baseline;
    gap: 7px;
    margin: auto 0 13px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface-2);
    color: var(--muted);
}
.report-freshness.has-new { border-color: rgba(53,104,212,.18); background: var(--accent-dim); color: var(--accent-hi); }
.report-freshness b { font: 600 21px/1 var(--mono); }
.report-freshness span { font-size: 9.5px; }
.report-history-link { align-self: center; margin-top: 12px; color: var(--muted); font-size: 9.5px; text-decoration: none; }

.workspace-empty-compact { display: grid; gap: 5px; padding: 18px 4px; }
.workspace-empty-compact strong { font-size: 12px; }
.workspace-empty-compact p { margin: 0; color: var(--muted); font-size: 10px; }

.workspace-fold {
    margin-top: 14px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(255,255,255,.64);
}
.workspace-fold > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 14px 17px;
    color: var(--text-2);
    cursor: pointer;
    list-style: none;
}
.workspace-fold > summary::-webkit-details-marker { display: none; }
.workspace-fold > summary::after {
    content: "+";
    display: grid;
    place-items: center;
    width: 23px;
    height: 23px;
    flex: 0 0 auto;
    border-radius: 7px;
    background: var(--surface-2);
    color: var(--muted);
    font: 13px/1 var(--mono);
}
.workspace-fold[open] > summary::after { content: "−"; }
.workspace-fold > summary > span:first-child { display: grid; margin-right: auto; }
.workspace-fold > summary b { font-size: 11px; }
.workspace-fold > summary small,
.workspace-fold > summary > span:nth-child(2) { color: var(--muted); font-size: 9px; }
.workspace-fold-content { padding: 4px 17px 18px; border-top: 1px solid var(--line); }
.overview-evidence-fold {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 230px;
    gap: 26px;
    padding-top: 17px;
}
.overview-evidence-fold h3 { margin: 0 0 8px; font-size: 11px; }
.overview-data-list { display: grid; align-content: start; gap: 8px; }
.overview-data-list div { display: flex; justify-content: space-between; gap: 16px; padding-bottom: 7px; border-bottom: 1px solid var(--line); }
.overview-data-list dt { color: var(--muted); font-size: 9.5px; }
.overview-data-list dd { font: 10px/1.4 var(--mono); }

#workspaceViewCapture .teacher-composer { margin: 0; }
.workspace-library-fold { margin-top: 16px; }
.workspace-embedded-library {
    margin: 0;
    padding: 17px 0 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}
.workspace-embedded-library > header { margin-bottom: 18px; }
.workspace-inline-link { display: inline-block; margin-top: 13px; color: var(--accent-hi); font-size: 10px; text-decoration: none; }

.planning-command { margin-bottom: 16px; }
.workspace-planning-grid { grid-template-columns: minmax(0, 1.45fr) minmax(300px, .75fr); }
.current-plan-card > header > span { color: var(--muted); font: 9px/1.3 var(--mono); white-space: nowrap; }
.current-cycle-name { display: block; margin-bottom: 14px; font-size: 13px; }
.planning-action-list { margin-top: 0; }
.planning-action-list li { grid-template-columns: 23px 1fr; padding: 7px 0; border-bottom: 1px solid var(--line); }
.planning-action-list li > span { width: 23px; height: 23px; }
.planning-action-list p { font-size: 10.5px; }
.report-command-card > header { justify-content: flex-start; }
.report-command-card > p { margin: 13px 0; color: var(--text-2); font-size: 10px; }
.report-input-counts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.report-input-counts div {
    display: grid;
    justify-items: center;
    gap: 1px;
    padding: 11px 5px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: var(--surface-2);
}
.report-input-counts b { color: var(--accent-hi); font: 600 18px/1 var(--mono); }
.report-input-counts span { color: var(--muted); font-size: 8.5px; }
.latest-report-compact {
    display: grid;
    gap: 2px;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
}
.latest-report-compact span { color: var(--muted); font-size: 8.5px; }
.latest-report-compact strong { font-size: 10.5px; }
.latest-report-compact a { margin-top: 4px; color: var(--accent-hi); font-size: 9.5px; text-decoration: none; }
.workspace-tool-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    padding: 16px;
    border-top: 1px solid var(--line);
}
.workspace-tool-grid a {
    display: grid;
    gap: 2px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
    color: var(--text-2);
    text-decoration: none;
}
.workspace-tool-grid a:hover { border-color: var(--accent-line); color: var(--accent-hi); }
.workspace-tool-grid b { font-size: 10.5px; }
.workspace-tool-grid small { color: var(--muted); font-size: 8.5px; }

@media (max-width: 900px) {
    .workspace-overview-grid,
    .workspace-planning-grid { grid-template-columns: 1fr; }
    .report-snapshot-card { min-height: 0; }
    .overview-evidence-fold { grid-template-columns: 1fr; }
    .workspace-tool-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 700px) {
    .workspace-compact-header { align-items: flex-start; flex-direction: column; gap: 13px; }
    .workspace-context-stats { justify-content: flex-start; }
    .workspace-mode { gap: 7px; padding: 11px 9px; }
    .workspace-mode-number { display: none; }
    .workspace-mode.active::after { right: 9px; bottom: 7px; width: 15px; }
    .workspace-mode strong { font-size: 11px; }
    .workspace-mode small { font-size: 8px; }
    .workspace-view-heading { align-items: flex-start; flex-direction: column; gap: 5px; }
    .workspace-view-heading > p { text-align: left; }
    .knowledge-visual-list article { grid-template-columns: minmax(120px, 1fr) 42px; }
    .knowledge-loss-track { grid-column: 1 / -1; grid-row: 2; }
    .knowledge-visual-list article > p { grid-row: 3; }
    .knowledge-visual-card > footer { align-items: flex-start; flex-direction: column; }
    .workspace-fold > summary { align-items: flex-start; gap: 10px; }
    .workspace-fold > summary > span:nth-child(2) { display: none; }
}

@media (max-width: 480px) {
    .workspace-compact-header h1 { font-size: 1.65rem; }
    .workspace-context-stats { gap: 4px; }
    .workspace-context-stats span { padding: 6px 7px; font-size: 8.5px; }
    .workspace-mode-nav { gap: 4px; padding: 4px; border-radius: 13px; }
    .workspace-mode { justify-content: center; padding: 10px 5px; text-align: center; }
    .workspace-mode small { display: none; }
    .workspace-mode.active::after { left: 50%; right: auto; bottom: 4px; transform: translateX(-50%); }
    .workspace-focus-card { padding: 16px; }
    .workspace-status-strip article { padding: 14px; }
    .workspace-fold > summary { padding: 13px; }
    .workspace-fold-content { padding-inline: 13px; }
    .workspace-tool-grid { grid-template-columns: 1fr; padding: 13px; }
    .report-input-counts b { font-size: 16px; }
}

/* ── Subject workspace visual polish ───────────────────── */
html[data-workspace-active-view="overview"] {
    --workspace-accent: #3968d9;
    --workspace-accent-2: #7359d8;
    --workspace-soft: rgba(57,104,217,.10);
    --workspace-line: rgba(57,104,217,.23);
}
html[data-workspace-active-view="capture"] {
    --workspace-accent: #6b55d5;
    --workspace-accent-2: #9b5fc5;
    --workspace-soft: rgba(107,85,213,.10);
    --workspace-line: rgba(107,85,213,.24);
}
html[data-workspace-active-view="plan"] {
    --workspace-accent: #168878;
    --workspace-accent-2: #3e78c5;
    --workspace-soft: rgba(22,136,120,.10);
    --workspace-line: rgba(22,136,120,.24);
}

.workspace-compact-header {
    position: relative;
    min-height: 154px;
    margin-top: 12px;
    padding: 32px 34px 38px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 24px;
    background:
        radial-gradient(440px 210px at 88% 8%, rgba(102,126,210,.28), transparent 72%),
        radial-gradient(330px 220px at 68% 120%, rgba(98,66,169,.22), transparent 70%),
        linear-gradient(126deg, #111a2d 0%, #182640 56%, #1b2c4a 100%);
    color: #f7f9ff;
    box-shadow: 0 22px 55px rgba(24,38,68,.20);
}
.workspace-compact-header::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(255,255,255,.022) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.022) 1px, transparent 1px);
    background-size: 30px 30px;
    mask-image: linear-gradient(90deg, transparent, #000 45%, #000);
}
.workspace-compact-header > div { position: relative; z-index: 2; }
.workspace-compact-header .capability-eyebrow { color: #91b5ff; font-size: 10px; }
.workspace-compact-header h1 {
    margin: 6px 0 5px;
    color: #fff;
    font-size: 2.28rem;
    font-weight: 600;
    letter-spacing: -.045em;
}
.workspace-compact-header p { color: rgba(225,232,247,.70); font-size: 12.5px; }
.workspace-context-stats { position: relative; z-index: 3; }
.workspace-context-stats span {
    padding: 8px 11px;
    border-color: rgba(255,255,255,.13);
    background: rgba(255,255,255,.075);
    color: rgba(222,230,246,.70);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.workspace-context-stats b { color: #fff; font-size: 12px; }
.workspace-hero-subject-mark {
    position: absolute;
    z-index: 1;
    right: 30px;
    bottom: -36px;
    color: rgba(255,255,255,.055);
    font-family: "Noto Sans SC", sans-serif;
    font-size: 9rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -.1em;
    pointer-events: none;
    user-select: none;
}

.workspace-mode-nav {
    position: relative;
    z-index: 5;
    margin: -22px 22px 34px;
    padding: 7px;
    border-color: rgba(30,41,59,.08);
    border-radius: 18px;
    background: rgba(250,252,255,.94);
    box-shadow: 0 16px 38px rgba(35,52,87,.13), 0 2px 5px rgba(35,52,87,.06);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}
.workspace-mode {
    min-height: 64px;
    padding: 13px 17px;
    border-radius: 12px;
}
.workspace-mode:hover { background: #fff; transform: translateY(-1px); }
.workspace-mode.active {
    border-color: var(--workspace-line, rgba(57,104,217,.23));
    background: linear-gradient(135deg, var(--workspace-soft, rgba(57,104,217,.10)), rgba(255,255,255,.96) 52%);
    box-shadow: 0 8px 22px rgba(38,55,88,.09), inset 0 0 0 1px rgba(255,255,255,.72);
}
.workspace-mode.active::after {
    height: 4px;
    background: linear-gradient(90deg, var(--workspace-accent, #3968d9), var(--workspace-accent-2, #7359d8));
    box-shadow: 0 4px 12px var(--workspace-soft, rgba(57,104,217,.10));
}
.workspace-mode-number {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    font-size: 9.5px;
}
.workspace-mode.active .workspace-mode-number {
    background: var(--workspace-soft, rgba(57,104,217,.10));
    color: var(--workspace-accent, #3968d9);
}
.workspace-mode strong { font-size: 14px; letter-spacing: -.01em; }
.workspace-mode small { margin-top: 1px; font-size: 10.5px; }

.workspace-view-heading { margin-bottom: 22px; padding: 0 2px; }
.workspace-view-heading > div > span { color: var(--workspace-accent, var(--accent)); font-size: 10px; }
.workspace-view-heading h2 { margin-top: 5px; font-size: 1.65rem; font-weight: 600; }
.workspace-view-heading > p { color: var(--text-2); font-size: 12px; line-height: 1.7; }

.workspace-status-strip { gap: 14px; margin-bottom: 20px; }
.workspace-status-strip article {
    position: relative;
    padding: 20px 21px;
    overflow: hidden;
    border-color: rgba(30,41,59,.08);
    border-radius: 16px;
    background: rgba(255,255,255,.90);
    box-shadow: 0 10px 28px rgba(38,55,88,.075);
}
.workspace-status-strip article::after {
    content: "";
    position: absolute;
    right: -22px;
    bottom: -31px;
    width: 86px;
    height: 86px;
    border: 18px solid var(--workspace-soft, var(--accent-dim));
    border-radius: 50%;
}
.workspace-status-strip span { color: var(--text-2); font-size: 12px; font-weight: 500; }
.workspace-status-strip strong { position: relative; z-index: 1; color: var(--workspace-accent, var(--accent-hi)); font-size: 28px; }
.workspace-status-strip small { color: var(--muted); font-size: 10px; }

.workspace-overview-grid,
.workspace-planning-grid { gap: 18px; }
.workspace-focus-card {
    padding: 23px;
    border-color: rgba(30,41,59,.085);
    border-radius: 19px;
    background: rgba(255,255,255,.92);
    box-shadow: 0 14px 38px rgba(38,55,88,.085);
}
.workspace-focus-card > header { margin-bottom: 19px; padding-bottom: 13px; }
.workspace-focus-card > header h3,
.workspace-focus-card > header > h3 { font-size: 15px; letter-spacing: -.015em; }
.workspace-focus-card > header > a { color: var(--workspace-accent, var(--accent-hi)); font-size: 11px; }
.workspace-focus-card .capability-index { color: var(--workspace-accent, var(--accent)); }

.knowledge-visual-card {
    background:
        radial-gradient(360px 150px at 10% 0%, var(--workspace-soft, rgba(57,104,217,.08)), transparent 72%),
        rgba(255,255,255,.95);
}
.knowledge-visual-list { gap: 7px; }
.knowledge-visual-list article {
    padding: 12px 13px;
    border: 1px solid transparent;
    border-radius: 12px;
}
.knowledge-visual-list article:hover {
    border-color: rgba(30,41,59,.07);
    background: rgba(255,255,255,.80);
    box-shadow: 0 6px 18px rgba(38,55,88,.05);
}
.knowledge-visual-name span { font-size: 9.5px; font-weight: 500; }
.knowledge-visual-name strong { font-size: 12.5px; }
.knowledge-loss-track { height: 7px; background: rgba(195,63,77,.075); }
.knowledge-loss-track span { background: linear-gradient(90deg, #eab068, #cf5865); }
.knowledge-visual-value b { font-size: 12px; }
.knowledge-visual-list article > p { margin-top: -2px; font-size: 10px; }

.report-snapshot-card {
    position: relative;
    overflow: hidden;
    border-color: var(--workspace-line, rgba(57,104,217,.18));
    background:
        radial-gradient(220px 160px at 110% 0%, var(--workspace-soft, rgba(57,104,217,.10)), transparent 72%),
        linear-gradient(160deg, #fff, #f8faff);
}
.report-snapshot-main > span { color: var(--workspace-accent, var(--accent-hi)); font-size: 10px; }
.report-snapshot-main > strong { font-size: 20px; letter-spacing: -.02em; }
.report-snapshot-main > p { font-size: 10.5px; }
.report-freshness { padding: 13px; border-radius: 11px; }
.report-freshness.has-new { border-color: var(--workspace-line); background: var(--workspace-soft); color: var(--workspace-accent); }
.report-history-link { font-size: 10.5px; }

.workspace-fold {
    margin-top: 16px;
    border-color: rgba(30,41,59,.085);
    border-radius: 15px;
    background: rgba(255,255,255,.72);
    box-shadow: 0 7px 22px rgba(38,55,88,.045);
    transition: border-color .18s, box-shadow .18s, background .18s;
}
.workspace-fold:hover { border-color: var(--workspace-line, var(--accent-line)); background: rgba(255,255,255,.88); }
.workspace-fold[open] { background: rgba(255,255,255,.94); box-shadow: 0 12px 30px rgba(38,55,88,.07); }
.workspace-fold > summary { padding: 16px 18px; }
.workspace-fold > summary b { font-size: 12.5px; }
.workspace-fold > summary small,
.workspace-fold > summary > span:nth-child(2) { font-size: 10px; }
.workspace-fold > summary::after { background: var(--workspace-soft, var(--surface-2)); color: var(--workspace-accent, var(--muted)); }

#workspaceViewCapture .teacher-composer {
    padding: 24px;
    border-color: var(--workspace-line, rgba(107,85,213,.22));
    border-radius: 21px;
    background:
        radial-gradient(380px 140px at 8% 0%, var(--workspace-soft, rgba(107,85,213,.08)), transparent 76%),
        rgba(255,255,255,.96);
    box-shadow: 0 18px 50px rgba(55,47,105,.11);
}
#workspaceViewCapture .teacher-composer-header { margin-bottom: 18px; }
#workspaceViewCapture .teacher-composer h2 { font-size: 1.1rem; }
#workspaceViewCapture .teacher-composer-header p { font-size: 11.5px; }
#workspaceViewCapture .composer-spark {
    background: linear-gradient(135deg, var(--workspace-accent, #6b55d5), var(--workspace-accent-2, #9b5fc5));
    box-shadow: 0 9px 24px var(--workspace-soft, rgba(107,85,213,.16));
}
.composer-input-shell { border-radius: 17px; background: rgba(250,251,254,.90); }
.composer-input-shell:focus-within { border-color: var(--workspace-line); box-shadow: 0 0 0 4px var(--workspace-soft); }
.composer-input-shell textarea { min-height: 112px; padding: 19px 20px 10px; font-size: 14.5px; }
.composer-tab.active { color: var(--workspace-accent, var(--accent-hi)); }
.composer-send,
.workspace-view-panel .btn-primary {
    background: linear-gradient(135deg, var(--workspace-accent, var(--accent)), var(--workspace-accent-2, var(--accent-hi)));
    box-shadow: 0 8px 20px var(--workspace-soft, rgba(53,104,212,.20));
}
.paper-dropzone { border-color: var(--workspace-line); background: linear-gradient(180deg, var(--workspace-soft), rgba(255,255,255,.35)); }
.paper-dropzone:hover,
.paper-dropzone.is-dragging { border-color: var(--workspace-accent); background: var(--workspace-soft); }
.paper-dropzone-icon { color: var(--workspace-accent, var(--accent-hi)); }

.planning-command {
    border-color: var(--workspace-line, rgba(22,136,120,.22));
    border-radius: 20px;
    background:
        radial-gradient(360px 180px at 96% 12%, var(--workspace-soft, rgba(22,136,120,.11)), transparent 72%),
        linear-gradient(120deg, rgba(255,255,255,.98), rgba(246,251,250,.96));
    box-shadow: 0 16px 40px rgba(31,78,77,.10);
}
.planning-command::before { width: 6px; background: linear-gradient(180deg, var(--workspace-accent, #168878), var(--workspace-accent-2, #3e78c5)); }
.planning-command span { color: var(--workspace-accent, #168878); }
.planning-command h2 { font-size: 1.55rem; }
.current-plan-card { background: linear-gradient(160deg, #fff, #fbfcff); }
.planning-action-list li { padding: 9px 0; }
.planning-action-list li > span { background: var(--workspace-soft); color: var(--workspace-accent); }
.planning-action-list p { font-size: 11px; line-height: 1.6; }
.report-command-card {
    border-color: var(--workspace-line, rgba(22,136,120,.20));
    background:
        radial-gradient(260px 180px at 100% 0%, var(--workspace-soft, rgba(22,136,120,.10)), transparent 70%),
        #fff;
}
.report-input-counts div { padding: 13px 5px; border-color: rgba(30,41,59,.075); background: rgba(247,250,251,.88); }
.report-input-counts b { color: var(--workspace-accent, #168878); font-size: 20px; }
.report-command-card > p { font-size: 11px; line-height: 1.65; }

@media (max-width: 700px) {
    .workspace-compact-header {
        min-height: 0;
        margin-top: 10px;
        padding: 26px 23px 37px;
        border-radius: 20px;
    }
    .workspace-compact-header h1 { font-size: 1.95rem; }
    .workspace-hero-subject-mark { right: 18px; bottom: -22px; font-size: 6.5rem; }
    .workspace-mode-nav { margin: -18px 10px 28px; }
    .workspace-mode { min-height: 58px; }
    .workspace-view-heading h2 { font-size: 1.45rem; }
    .workspace-status-strip article { padding: 17px; }
    .workspace-focus-card { padding: 19px; }
}

@media (max-width: 480px) {
    .workspace-compact-header { padding: 23px 21px 35px; }
    .workspace-compact-header h1 { font-size: 1.72rem; }
    .workspace-compact-header p { max-width: 260px; font-size: 11px; }
    .workspace-context-stats span { border-color: rgba(255,255,255,.11); background: rgba(255,255,255,.065); }
    .workspace-mode-nav { margin-inline: 7px; border-radius: 15px; }
    .workspace-mode { min-height: 48px; }
    .workspace-mode strong { font-size: 11.5px; }
    .workspace-mode.active::after { bottom: 3px; }
    .workspace-view-heading { margin-bottom: 17px; }
    .workspace-view-heading h2 { font-size: 1.35rem; }
    .workspace-view-heading > p { font-size: 10.5px; }
    #workspaceViewCapture .teacher-composer { padding: 16px; border-radius: 17px; }
    .composer-input-shell textarea { min-height: 100px; padding: 16px; font-size: 13.5px; }
    .planning-command { border-radius: 17px; }
    .planning-command h2 { font-size: 1.3rem; }
}
.image-extractions {
    margin: 18px 0;
    display: grid;
    gap: 10px;
}

.image-extractions-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}

.image-extractions-heading h3 {
    margin: 0;
}

.image-extractions-heading span,
.image-extraction-item summary span,
.image-extraction-item-heading span {
    color: var(--text-muted, #6b7280);
    font-size: 0.86rem;
}

.image-extraction-item {
    border: 1px solid var(--border, #dfe3e8);
    border-radius: 12px;
    background: var(--surface, #fff);
    overflow: hidden;
}

.image-extraction-item summary {
    cursor: pointer;
    padding: 12px 14px;
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.image-extraction-item-heading {
    padding: 12px 14px;
}

.image-extraction-item p {
    margin: 0;
    padding: 0 14px 12px;
}

.image-extraction-summary {
    color: var(--text-muted, #6b7280);
    line-height: 1.65;
}

.image-extraction-questions {
    margin: 0 14px 14px;
}

.image-extraction-questions-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.image-extraction-questions-heading h4,
.image-extracted-text-label {
    margin: 0;
    font-size: 0.92rem;
}

.image-extraction-questions-heading span {
    color: var(--text-muted, #6b7280);
    font-size: 0.82rem;
}

.image-question-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border, #dfe3e8);
    border-radius: 10px;
}

.image-question-table {
    width: 100%;
    min-width: 520px;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.image-question-table th,
.image-question-table td {
    padding: 9px 11px;
    border-bottom: 1px solid var(--border, #e5e7eb);
    text-align: left;
    vertical-align: top;
}

.image-question-table th {
    color: var(--text-muted, #6b7280);
    background: #f7f8fa;
    font-weight: 600;
}

.image-question-table tbody tr:last-child td {
    border-bottom: 0;
}

.image-question-number {
    width: 64px;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}

.image-question-answer {
    width: 30%;
    white-space: pre-wrap;
}

.image-extracted-text-label {
    margin: 0 14px 8px;
}

.image-extracted-text {
    margin: 0 14px 14px;
    padding: 12px;
    max-height: 360px;
    overflow: auto;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    border-radius: 10px;
    background: #f7f8fa;
    font: inherit;
    line-height: 1.65;
}

.image-extraction-empty {
    color: var(--text-muted, #6b7280);
}

.grading-source {
    display: block;
    width: max-content;
    margin: 5px auto 0;
    padding: 1px 6px;
    border-radius: 999px;
    font-size: 10px;
    line-height: 1.5;
    color: var(--muted);
    background: var(--surface-3);
}

.grading-source-ai {
    color: #244fae;
    background: rgba(53, 104, 212, .11);
}

.q-grading-reason,
.q-reference-answer {
    margin-top: 6px;
    color: var(--text-2);
    font-size: 12px;
    line-height: 1.5;
}

.q-reference-answer {
    color: var(--muted);
}

.q-grading-reason strong,
.q-reference-answer strong {
    color: inherit;
    font-weight: 650;
}
/* Local account and role portals */
.account-bar {
    position: fixed;
    z-index: 180;
    left: 16px;
    left: max(16px, env(safe-area-inset-left));
    bottom: 16px;
    bottom: max(16px, env(safe-area-inset-bottom));
    width: auto;
    margin: 0;
    padding: 0;
    color: var(--text);
}
.account-bar__menu {
    position: relative;
}
.account-bar__trigger {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 4px;
    list-style: none;
    border: 1px solid rgba(255, 255, 255, .82);
    border-radius: 14px;
    background: rgba(255, 255, 255, .88);
    box-shadow: 0 8px 22px rgba(35, 61, 112, .14);
    cursor: pointer;
    backdrop-filter: blur(14px) saturate(130%);
    -webkit-backdrop-filter: blur(14px) saturate(130%);
    transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.account-bar__trigger::-webkit-details-marker {
    display: none;
}
.account-bar__trigger::marker {
    content: "";
}
.account-bar__trigger::after {
    content: "";
    position: absolute;
    right: 6px;
    bottom: 6px;
    width: 7px;
    height: 7px;
    border: 1.5px solid #fff;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 1px rgba(53, 104, 212, .20);
}
.account-bar__trigger:hover,
.account-bar__menu[open] .account-bar__trigger {
    border-color: rgba(53, 104, 212, .28);
    box-shadow: 0 10px 26px rgba(35, 61, 112, .18);
}
.account-bar__trigger:active {
    transform: translateY(1px);
}
.account-bar__trigger:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}
.account-bar__panel {
    position: absolute;
    left: 0;
    bottom: calc(100% + 10px);
    display: grid;
    gap: 10px;
    width: min(235px, calc(100vw - 32px));
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, .9);
    border-radius: 14px;
    background: rgba(255, 255, 255, .98);
    box-shadow: 0 16px 42px rgba(38, 55, 88, .16);
    backdrop-filter: blur(16px) saturate(135%);
    -webkit-backdrop-filter: blur(16px) saturate(135%);
    transform-origin: bottom left;
    animation: account-panel-in .16s ease-out;
}
.account-bar__identity {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
}
.account-bar__avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    border: 1px solid rgba(255, 255, 255, .45);
    border-radius: 12px;
    background: var(--accent);
    box-shadow: 0 5px 12px rgba(36, 79, 174, .18);
    color: #fff;
    font: 600 13px/1 var(--display);
}
.account-bar__trigger .account-bar__avatar {
    flex-basis: 34px;
    width: 34px;
    height: 34px;
    border-radius: 11px;
}
.account-bar__user {
    display: grid;
    gap: 1px;
    min-width: 0;
    line-height: 1.2;
}
.account-bar__user b {
    max-width: 150px;
    overflow: hidden;
    color: var(--text);
    font-size: 12px;
    font-weight: 650;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.account-bar__user small {
    color: var(--muted);
    font-size: 10px;
}
.account-bar__links {
    display: grid;
    gap: 4px;
    padding-top: 9px;
    border-top: 1px solid var(--line);
}
.account-bar__link,
.account-bar__logout {
    display: flex;
    align-items: center;
    min-height: 34px;
    width: 100%;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--text-2);
    font: 600 12px/1 var(--body);
    text-decoration: none;
    cursor: pointer;
    transition: color .18s ease, background-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.account-bar__link {
    padding: 0 10px;
    white-space: nowrap;
}
.account-bar__link:hover {
    background: var(--surface-3);
    color: var(--text);
}
.account-bar__link.is-active {
    background: var(--accent-dim);
    box-shadow: inset 0 0 0 1px rgba(53, 104, 212, .08);
    color: var(--accent-hi);
}
.account-bar__link:focus-visible,
.account-bar__logout:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}
.account-bar__form {
    margin: 4px 0 0;
    padding-top: 7px;
    border-top: 1px solid var(--line);
}
.account-bar__logout {
    gap: 5px;
    justify-content: flex-start;
    padding: 0 10px;
}
.account-bar__logout svg {
    width: 16px;
    height: 16px;
}
.account-bar__logout:hover {
    background: rgba(195, 63, 77, .08);
    color: var(--danger);
}
.account-bar__logout:active,
.account-bar__link:active {
    transform: translateY(1px);
}
@keyframes account-panel-in {
    from {
        opacity: 0;
        transform: translateY(6px) scale(.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}
.auth-page .container, .admin-simple-page .container { max-width: 1180px; }
.auth-shell {
    min-height: 78vh;
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(320px, .75fr);
    align-items: center;
    gap: 70px;
}
.auth-brand > span, .admin-simple-heading span { color: #718876; font-size: 12px; font-weight: 700; letter-spacing: .14em; }
.auth-brand h1 { margin: 14px 0; font-size: clamp(40px, 6vw, 72px); line-height: 1; color: #1f3136; }
.auth-brand p, .admin-simple-heading p { color: #68777d; font-size: 17px; line-height: 1.7; }
.auth-card, .admin-create-card {
    padding: 30px;
    border: 1px solid rgba(34, 59, 61, .12);
    border-radius: 24px;
    background: rgba(255,255,255,.88);
    box-shadow: 0 24px 70px rgba(38, 56, 58, .12);
}
.auth-card label, .admin-create-card label { display: grid; gap: 8px; margin-bottom: 18px; color: #53646a; font-weight: 600; }
.auth-card input, .admin-create-card input, .admin-create-card select, .admin-record-list input {
    width: 100%; box-sizing: border-box; border: 1px solid #d7dedb; border-radius: 12px; background: #fff; padding: 12px 14px; font: inherit;
}
.auth-card button, .admin-create-card button, .admin-record-list button {
    border: 0; border-radius: 12px; background: #244c49; color: #fff; padding: 12px 18px; font-weight: 700; cursor: pointer;
}
.admin-simple-shell { padding: 54px 0 90px; }
.admin-simple-heading { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 28px; }
.admin-simple-heading h1 { margin: 8px 0; color: #1f3136; font-size: 42px; }
.admin-simple-heading a { color: #42625f; text-decoration: none; }
.admin-create-card { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) auto; align-items: end; gap: 14px; }
.admin-create-card h2 { grid-column: 1 / -1; margin: 0 0 8px; }
.admin-create-card label { margin: 0; }
.admin-record-list { display: grid; gap: 12px; margin-top: 24px; }
.admin-record-list article { display: grid; grid-template-columns: minmax(180px, 1fr) auto minmax(250px, .8fr) auto; gap: 16px; align-items: center; padding: 18px 20px; border: 1px solid #dce2df; border-radius: 16px; background: rgba(255,255,255,.82); }
.admin-record-list article > div { display: grid; gap: 4px; }
.admin-record-list article > div span { color: #748086; }
.admin-record-list form { display: flex; gap: 8px; margin: 0; }
.admin-record-list em { font-style: normal; font-size: 12px; font-weight: 700; }
.admin-record-list .status-on { color: #397157; }
.admin-record-list .status-off { color: #9a5a50; }
@media (max-width: 800px) {
    .account-bar {
        left: 12px;
        left: max(12px, env(safe-area-inset-left));
        bottom: 12px;
        bottom: max(12px, env(safe-area-inset-bottom));
    }
    .auth-shell { grid-template-columns: 1fr; gap: 30px; padding: 36px 0; }
    .admin-create-card { grid-template-columns: 1fr; }
    .admin-record-list article { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
    .account-bar__panel {
        width: min(220px, calc(100vw - 24px));
    }
}
.assignment-create-card { grid-template-columns: 1.2fr 1.2fr 1fr .8fr; }
.assignment-create-card .assignment-note { grid-column: 1 / -2; }
.assignment-board-panel,
.assignment-admin-review {
    margin-top: 30px;
}
.assignment-board-panel {
    padding: 24px;
    border: 1px solid #dce2df;
    border-radius: 18px;
    background: rgba(255, 255, 255, .82);
    box-shadow: 0 18px 52px rgba(46, 61, 58, .07);
}
.assignment-board-panel > header,
.student-board-hero {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 22px;
}
.assignment-board-panel > header > div,
.student-board-hero > div {
    min-width: 0;
}
.assignment-board-panel > header span,
.assignment-admin-review > header span,
.student-board-hero > div > span {
    color: #628074;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .14em;
}
.assignment-board-panel h2,
.assignment-admin-review h2 {
    margin: 7px 0 4px;
    color: #263a3d;
    font-size: 24px;
}
.assignment-board-panel p {
    margin: 0;
    color: #758489;
    font-size: 12px;
}
.assignment-week-nav {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}
.assignment-week-nav a,
.assignment-week-nav strong {
    display: inline-flex;
    min-height: 34px;
    align-items: center;
    padding: 0 11px;
    border: 1px solid #d9dfda;
    border-radius: 10px;
    background: #fff;
    color: #486962;
    font-size: 12px;
    text-decoration: none;
}
.assignment-week-nav strong {
    color: #263a3d;
    font-weight: 700;
}
.assignment-week-nav .is-muted {
    color: #7b898d;
    background: #f3f5f2;
}
.assignment-week-board {
    display: grid;
    grid-template-columns: repeat(7, minmax(128px, 1fr));
    gap: 10px;
    margin-top: 20px;
    overflow-x: auto;
    padding-bottom: 4px;
}
.assignment-day-column {
    display: grid;
    align-content: start;
    min-width: 128px;
    min-height: 280px;
    padding: 12px;
    border: 1px solid #dfe5e1;
    border-radius: 16px;
    background: #f9faf8;
}
.assignment-day-column.is-today {
    border-color: rgba(53, 104, 212, .28);
    background: #f5f8ff;
    box-shadow: inset 0 0 0 1px rgba(53, 104, 212, .06);
}
.assignment-day-column > header {
    display: flex;
    align-items: center;
    gap: 7px;
    min-height: 34px;
    margin-bottom: 10px;
}
.assignment-day-column > header span {
    color: #71827d;
    font-size: 11px;
    font-weight: 700;
}
.assignment-day-column > header strong {
    color: #263a3d;
    font: 700 13px/1 var(--mono);
}
.assignment-day-column > header em {
    display: inline-grid;
    min-width: 22px;
    height: 22px;
    margin-left: auto;
    place-items: center;
    border-radius: 999px;
    background: #edf1ef;
    color: #526b65;
    font: 700 10px/1 var(--mono);
    font-style: normal;
}
.assignment-day-stack,
.assignment-spillover-stack {
    display: grid;
    gap: 9px;
}
.assignment-board-card {
    display: grid;
    gap: 7px;
    min-height: 118px;
    padding: 12px;
    overflow: hidden;
    border: 1px solid #e2e7e4;
    border-left: 3px solid #8a9893;
    border-radius: 12px;
    background: #fff;
    color: inherit;
    text-decoration: none;
    box-shadow: 0 8px 22px rgba(46, 61, 58, .055);
}
.assignment-board-card.status-assigned { border-left-color: #6b8bd9; }
.assignment-board-card.status-in_progress { border-left-color: #3d9a86; }
.assignment-board-card.status-submitted { border-left-color: #c08a38; }
.assignment-board-card.status-needs_revision { border-left-color: #c85d63; }
.assignment-board-card.status-completed { border-left-color: #6f8f72; opacity: .82; }
.assignment-board-card > span {
    color: #70817d;
    font-size: 10px;
    font-weight: 700;
}
.assignment-board-card > strong {
    color: #233638;
    font-size: 14px;
    line-height: 1.32;
}
.assignment-board-card > small,
.assignment-board-card > p {
    color: #78868a;
    font-size: 10px;
    line-height: 1.5;
}
.assignment-board-card > p {
    display: -webkit-box;
    overflow: hidden;
    margin: 0;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}
.assignment-board-card > b,
.assignment-board-card > div a {
    color: #315d57;
    font-size: 11px;
    font-weight: 800;
    text-decoration: none;
}
.assignment-board-card > div {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-self: end;
}
.assignment-day-empty {
    margin: 8px 0 0;
    padding: 20px 8px;
    border: 1px dashed #d4ddd8;
    border-radius: 12px;
    color: #8a979a;
    font-size: 11px;
    text-align: center;
}
.assignment-spillover-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin-top: 24px;
}
.assignment-spillover-grid > div {
    padding: 18px;
    border: 1px solid #dce2df;
    border-radius: 16px;
    background: rgba(255, 255, 255, .78);
}
.assignment-spillover-grid h2,
.assignment-spillover-grid h3 {
    margin: 0 0 12px;
    color: #263a3d;
    font-size: 18px;
}
.assignment-admin-list { display: grid; gap: 14px; margin-top: 24px; }
.assignment-admin-list > article { display: grid; grid-template-columns: minmax(240px, 1fr) auto auto auto; gap: 18px; align-items: center; padding: 20px; border: 1px solid #dce2df; border-radius: 18px; background: rgba(255,255,255,.84); }
.assignment-admin-copy { display: grid; gap: 5px; }
.assignment-admin-copy span, .assignment-admin-copy small { color: #728087; }
.assignment-admin-copy strong { color: #263a3d; font-size: 18px; }
.assignment-status { padding: 6px 10px; border-radius: 999px; background: #edf1ef; color: #527069; font-size: 12px; }
.assignment-admin-links { display: flex; gap: 10px; color: #718087; }
.assignment-admin-links a { color: #315f59; }
.assignment-admin-list form { display: flex; gap: 8px; }
.assignment-admin-list select { border: 1px solid #d7dedb; border-radius: 10px; padding: 9px; background: #fff; }
.assignment-admin-list button { border: 0; border-radius: 10px; padding: 9px 12px; background: #345e59; color: #fff; }
.assignment-admin-list details { grid-column: 1 / -1; border-top: 1px solid #e3e7e5; padding-top: 12px; }
.assignment-feedback-entry {
    padding: 12px 0;
    border-bottom: 1px solid #e7ece8;
}
.assignment-feedback-entry:last-child { border-bottom: 0; }
.assignment-feedback-entry span { color: #78858a; font-size: 12px; }
.assignment-feedback-entry p { margin: 5px 0; color: #405154; }
.assignment-feedback-artifacts {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}
.assignment-feedback-artifacts a {
    padding: 5px 8px;
    border: 1px solid #d8e0dc;
    border-radius: 999px;
    color: #315d57;
    font-size: 11px;
    text-decoration: none;
}
.student-portal-page { background: #f3f1ea; color: #233638; }
.student-portal-page .container { max-width: 1120px; }
.student-portal-shell { padding: 56px 0 100px; }
.student-board-hero {
    margin-bottom: 30px;
}
.student-board-hero h1 {
    margin: 10px 0 12px;
    font-size: clamp(34px, 5vw, 56px);
    line-height: 1.05;
}
.student-board-hero p,
.assignment-student-heading p { color: #69787c; font-size: 17px; line-height: 1.7; }
.assignment-student-heading > span { color: #628074; font-size: 12px; font-weight: 800; letter-spacing: .14em; }
.assignment-student-heading h1 { margin: 10px 0 12px; font-size: clamp(38px, 6vw, 64px); line-height: 1.05; }
.student-current > header, .student-history > header { display: flex; justify-content: space-between; align-items: center; }
.student-task-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.student-task-card { display: grid; gap: 14px; min-height: 170px; padding: 24px; border: 1px solid #d9dfda; border-radius: 22px; background: #fff; color: inherit; text-decoration: none; box-shadow: 0 18px 50px rgba(46, 61, 58, .08); }
.student-task-card > span { color: #638076; font-size: 12px; font-weight: 700; }
.student-task-card > strong { font-size: 24px; }
.student-task-card > small { color: #798589; }
.student-task-card > b { color: #315d57; align-self: end; }
.student-empty-card { grid-column: 1 / -1; padding: 34px; border: 1px dashed #cbd4cf; border-radius: 20px; text-align: center; }
.student-history { margin-top: 48px; }
.student-history > a { display: grid; grid-template-columns: 100px 1fr auto; gap: 18px; padding: 17px 4px; border-bottom: 1px solid #d8dfdb; color: inherit; text-decoration: none; }
.student-history span, .student-history em { color: #748187; font-style: normal; }
.student-back { color: #486962; text-decoration: none; }
.assignment-student-heading { max-width: 780px; margin: 34px 0; }
.assignment-student-heading small { color: #788489; }
.student-primary-button, .student-feedback-card button { border: 0; border-radius: 14px; padding: 14px 22px; background: #28554f; color: #fff; font-size: 16px; font-weight: 700; cursor: pointer; }
.assignment-resource-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin: 34px 0; }
.assignment-resource-grid article { display: grid; gap: 12px; min-height: 190px; padding: 25px; border: 1px solid #d7ded9; border-radius: 22px; background: #fff; }
.assignment-resource-grid article > span { color: #799087; font-size: 11px; font-weight: 800; letter-spacing: .12em; }
.assignment-resource-grid article > strong { font-size: 23px; }
.assignment-resource-grid article > p { color: #6d7a7e; line-height: 1.6; }
.assignment-resource-grid article > a { align-self: end; color: #2c5d56; font-weight: 700; text-decoration: none; }
.assignment-resource-grid .is-tutor { background: #244c49; color: #fff; }
.assignment-resource-grid .is-tutor p, .assignment-resource-grid .is-tutor span { color: #c8d8d2; }
.assignment-resource-grid .is-tutor a { color: #fff; }
.assignment-feedback-shell {
    --sw-ink: #202124;
    --sw-muted: #777b83;
    --sw-line: #e6e6e2;
    --sw-soft: #f7f7f5;
    --sw-blue: #3158b8;
    --sw-blue-soft: #f1f4fb;
    margin-top: 34px;
}
.assignment-feedback-shell [hidden] {
    display: none !important;
}
.assignment-feedback-shell .assignment-feedback-composer {
    padding: 28px;
    border: 1px solid #d9dfda;
    border-radius: 20px;
    background: #fff;
}
.assignment-feedback-submit-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 9px; }
.assignment-feedback-submit-actions .feedback-submit.is-secondary { border: 1px solid #d5ddd8; background: #fff; color: #526964; }
.assignment-admin-preview-note {
    display: inline-flex;
    margin-top: 24px;
    padding: 7px 10px;
    border: 1px solid #d7dfda;
    border-radius: 999px;
    background: rgba(255,255,255,.76);
    color: #687a76;
    font-size: 11px;
}
.assignment-feedback-entry.actor-admin {
    margin: 8px 0;
    padding: 14px 16px;
    border-left: 3px solid #b56a55;
    background: #fff8f4;
}
.assignment-feedback-entry.kind-completion { border-left-color: #4d8a75; }
.assignment-admin-actions {
    display: grid;
    gap: 16px;
    margin-top: 34px;
    padding: 22px;
    border: 1px solid #d9dfda;
    border-radius: 18px;
    background: rgba(255,255,255,.8);
}
.assignment-admin-actions form:first-child { display: grid; gap: 10px; }
.assignment-admin-actions label { color: #405154; font-weight: 700; }
.assignment-admin-actions textarea { width: 100%; padding: 13px; border: 1px solid #d5ddd8; border-radius: 11px; resize: vertical; font: inherit; }
.assignment-admin-actions button { width: fit-content; padding: 10px 15px; border: 0; border-radius: 10px; background: #345e59; color: #fff; font-weight: 700; }
.assignment-admin-actions button.is-secondary { background: #f1ecea; color: #8a4c50; }
.student-feedback-card { margin-top: 34px; padding: 28px; border-radius: 24px; background: #fff; border: 1px solid #d9dfda; }
.student-feedback-card h2 { margin: 7px 0; }
.student-feedback-card header p { color: #748085; }
.student-feedback-card textarea { width: 100%; box-sizing: border-box; margin: 16px 0; padding: 15px; border: 1px solid #d7deda; border-radius: 14px; resize: vertical; font: inherit; }
.student-feedback-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; margin-bottom: 18px; }
.student-feedback-options label { display: flex; align-items: center; gap: 8px; color: #657479; }
.student-feedback-history { margin-top: 32px; }
.student-feedback-history h2 {
    margin-bottom: 8px;
    color: #263a3d;
}
@media (max-width: 800px) {
    .assignment-create-card, .assignment-admin-list > article { grid-template-columns: 1fr; }
    .assignment-create-card .assignment-note, .assignment-admin-list details { grid-column: auto; }
    .student-task-grid, .assignment-resource-grid, .student-feedback-options, .assignment-spillover-grid { grid-template-columns: 1fr; }
    .assignment-board-panel > header,
    .student-board-hero { align-items: flex-start; flex-direction: column; }
    .assignment-week-board { grid-template-columns: repeat(7, minmax(172px, 172px)); }
    .assignment-feedback-shell .assignment-feedback-composer { padding: 20px 16px; }
    .student-history > a { grid-template-columns: 1fr; gap: 5px; }
}

/* Student task board: one calm day at a time, bounded to the current week. */
.student-today-page .container { max-width: 1040px; }
.student-today-page .student-board-shell { padding-top: 70px; }
.student-today-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 48px;
    margin-bottom: 38px;
}
.student-today-hero > div:first-child { max-width: 720px; }
.student-today-hero h1 {
    max-width: 680px;
    margin: 10px 0 14px;
    color: #203330;
    font-size: clamp(38px, 6vw, 62px);
    font-weight: 600;
    letter-spacing: -.045em;
}
.student-today-hero h1 > span { white-space: nowrap; }
.student-today-hero p { max-width: 640px; margin: 0; color: #687572; font-size: 16px; line-height: 1.8; }
.student-week-summary {
    display: grid;
    min-width: 138px;
    padding-left: 25px;
    border-left: 1px solid #cfd6d1;
}
.student-week-summary > span { color: #72817c; font: 600 11px/1.4 var(--mono); letter-spacing: .05em; }
.student-week-summary > strong { margin-top: 11px; color: #274d46; font: 600 42px/1 var(--mono); }
.student-week-summary > small { margin-top: 4px; color: #7a8783; font-size: 11px; }
.student-week-rail {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 6px;
    margin-bottom: 12px;
    padding: 6px;
    border: 1px solid #d9dfda;
    border-radius: 16px;
    background: rgba(255, 255, 255, .58);
    scrollbar-width: none;
}
.student-week-rail::-webkit-scrollbar { display: none; }
.student-week-day {
    position: relative;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 4px 8px;
    min-width: 0;
    min-height: 62px;
    padding: 10px 12px;
    border: 0;
    border-radius: 11px;
    background: transparent;
    color: #66736f;
    text-align: left;
    cursor: pointer;
    transition: background .2s ease, color .2s ease, box-shadow .2s ease;
}
.student-week-day > span { grid-column: 1 / -1; font-size: 10px; font-weight: 700; letter-spacing: .04em; }
.student-week-day > strong { color: inherit; font: 600 16px/1 var(--mono); }
.student-week-day > i {
    min-width: 20px;
    color: #87918e;
    font: 600 10px/1.4 var(--mono);
    font-style: normal;
    text-align: right;
}
.student-week-day.is-today::after {
    position: absolute;
    right: 10px;
    top: 8px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #47766b;
    content: "";
}
.student-week-day:hover { background: rgba(234, 239, 235, .8); }
.student-week-day.is-active {
    background: #315d55;
    color: #fff;
    box-shadow: 0 5px 14px rgba(39, 78, 70, .16);
}
.student-week-day.is-active > i { color: #cfe0da; }
.student-week-day.is-active.is-today::after { background: #dce9e4; }
.student-week-day:focus-visible { outline: 3px solid rgba(49, 93, 85, .2); outline-offset: 2px; }
.student-day-carousel {
    overflow: hidden;
    border: 1px solid #d6ddd8;
    border-radius: 24px;
    background: rgba(255, 255, 255, .9);
    box-shadow: 0 22px 64px rgba(57, 72, 65, .07);
}
.student-day-carousel__viewport { overflow: hidden; touch-action: pan-y; }
.student-day-carousel__track {
    display: flex;
    align-items: flex-start;
    transform: translate3d(calc(var(--student-carousel-index) * -100%), 0, 0);
}
.is-carousel-ready .student-day-carousel__track { transition: transform .32s cubic-bezier(.22, .75, .28, 1); }
.student-day-slide {
    flex: 0 0 100%;
    min-width: 0;
    min-height: 390px;
    padding: 38px 42px 42px;
}
.student-day-slide__heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 30px;
    padding-bottom: 22px;
    border-bottom: 1px solid #e0e5e1;
}
.student-day-slide__heading > div:first-child > span {
    color: #54776e;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .14em;
}
.student-day-slide__heading h2 { margin: 7px 0 0; color: #233733; font-size: clamp(24px, 4vw, 34px); font-weight: 600; }
.student-day-progress { display: grid; min-width: 74px; text-align: right; }
.student-day-progress strong { color: #315d55; font: 600 27px/1 var(--mono); }
.student-day-progress strong i { color: #8a9692; font-size: 13px; font-style: normal; }
.student-day-progress > span { margin-top: 5px; color: #83908c; font-size: 10px; }
.student-day-task-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.student-focus-card {
    min-height: 176px;
    gap: 12px;
    padding: 20px;
    border: 1px solid #dfe5e1;
    border-left: 1px solid #dfe5e1;
    border-radius: 15px;
    box-shadow: none;
    transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.student-focus-card:hover {
    border-color: #aebfb9;
    box-shadow: 0 12px 30px rgba(47, 70, 64, .08);
    transform: translateY(-2px);
}
.student-focus-card.status-needs_revision { border-top: 3px solid #b96a67; }
.student-focus-card.status-in_progress { border-top: 3px solid #528578; }
.student-focus-card.status-assigned { border-top: 3px solid #7d8eb0; }
.student-focus-card.status-completed { border-top: 3px solid #7a947b; opacity: .76; }
.student-focus-card__meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.student-focus-card__meta > span { color: #50736a; font-size: 11px; font-weight: 700; }
.student-focus-card__meta > em { color: #7c8985; font-size: 10px; font-style: normal; }
.student-focus-card > strong { color: #263935; font-size: 18px; line-height: 1.45; }
.student-focus-card > p { margin: 0; color: #74817d; font-size: 12px; line-height: 1.65; }
.student-focus-card > footer { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin-top: auto; }
.student-focus-card > footer small { color: #83908c; font-size: 10px; line-height: 1.5; }
.student-focus-card > footer b { flex: 0 0 auto; color: #315d55; font-size: 11px; }
.student-day-rest {
    grid-column: 1 / -1;
    display: grid;
    justify-items: center;
    min-height: 190px;
    align-content: center;
    color: #7b8984;
    text-align: center;
}
.student-day-rest > span {
    display: grid;
    width: 36px;
    height: 36px;
    margin-bottom: 14px;
    place-items: center;
    border: 1px solid #cbd6d0;
    border-radius: 50%;
    color: #52776d;
}
.student-day-rest > strong { color: #41534f; font-size: 18px; font-weight: 600; }
.student-day-rest > p { margin: 8px 0 0; font-size: 12px; }
.student-carousel-controls {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 16px;
    min-height: 67px;
    padding: 11px 18px;
    border-top: 1px solid #e0e5e1;
    background: #fafbf9;
}
.student-carousel-controls button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    width: fit-content;
    max-width: 100%;
    padding: 9px 11px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: #496b63;
    cursor: pointer;
}
.student-carousel-controls button:last-child { justify-self: end; }
.student-carousel-controls button:hover:not(:disabled) { background: #edf2ee; }
.student-carousel-controls button:disabled { color: #a8b0ad; cursor: default; }
.student-carousel-controls button > small { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.student-carousel-controls > p { margin: 0; color: #7b8783; font: 600 10px/1.4 var(--mono); }
.student-board-note { margin: 14px 4px 0; color: #7a8783; font-size: 11px; }

/* Admin task board: all-time overview first, weekly scheduling one click away. */
.assignment-planner[data-board-view="all"] .assignment-planner-toolbar {
    grid-template-columns: minmax(200px, 1fr) minmax(270px, 1.2fr) auto;
}
.assignment-planner[data-board-view="week"] .assignment-planner-toolbar {
    grid-template-columns: minmax(170px, .8fr) minmax(200px, .7fr) minmax(330px, 1.4fr) minmax(150px, .7fr) auto;
}
.assignment-view-switch {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
    padding: 4px;
    border: 1px solid #d7ded9;
    border-radius: 12px;
    background: #f3f6f3;
}
.assignment-view-switch a {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 34px;
    padding: 0 13px;
    border-radius: 8px;
    color: #6d7b77;
    font-size: 11px;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}
.assignment-view-switch a.is-active { background: #fff; color: #315d55; box-shadow: 0 2px 8px rgba(43, 68, 61, .08); }
.assignment-view-switch b { font: 700 10px/1 var(--mono); }
.assignment-all-panel {
    padding: 26px;
    border: 1px solid #dce2df;
    border-radius: 20px;
    background: rgba(255, 255, 255, .84);
}
.assignment-all-panel > header {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 24px;
    padding-bottom: 22px;
    border-bottom: 1px solid #e2e7e4;
}
.assignment-all-panel > header > div > span { color: #628074; font-size: 10px; font-weight: 800; letter-spacing: .14em; }
.assignment-all-panel h2 { margin: 7px 0 5px; color: #263a3d; font-size: 26px; }
.assignment-all-panel > header p { margin: 0; color: #758489; font-size: 12px; }
.assignment-all-summary { display: flex; gap: 22px; margin: 0; }
.assignment-all-summary > div { display: grid; gap: 5px; min-width: 54px; }
.assignment-all-summary dt { color: #82908c; font-size: 10px; }
.assignment-all-summary dd { margin: 0; color: #365e56; font: 700 22px/1 var(--mono); }
.assignment-all-board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-top: 22px; }
.assignment-overview-column { min-width: 0; }
.assignment-overview-column > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.assignment-overview-column > header > div { display: flex; align-items: baseline; gap: 9px; }
.assignment-overview-column > header span { color: #94a09c; font: 600 9px/1 var(--mono); }
.assignment-overview-column > header h3 { margin: 0; color: #344a46; font-size: 16px; }
.assignment-overview-column > header em {
    display: grid;
    min-width: 25px;
    height: 25px;
    place-items: center;
    border-radius: 50%;
    background: #edf1ef;
    color: #587069;
    font: 700 10px/1 var(--mono);
    font-style: normal;
}
.assignment-overview-column > p { margin: 7px 0 13px; color: #8a9692; font-size: 10px; }
.assignment-overview-column > div { display: grid; gap: 9px; }
.assignment-overview-card {
    display: grid;
    gap: 9px;
    min-height: 154px;
    padding: 15px;
    border: 1px solid #e0e5e2;
    border-radius: 13px;
    background: #fff;
    color: inherit;
    text-decoration: none;
    transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}
.assignment-overview-card:hover { border-color: #b8c7c1; box-shadow: 0 10px 26px rgba(48, 69, 63, .07); transform: translateY(-1px); }
.assignment-overview-card.has-unread-feedback { border-color: #dfc9cb; background: #fffbfb; }
.assignment-overview-card > header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.assignment-overview-card > header span { color: #6f807b; font-size: 9px; font-weight: 700; letter-spacing: .03em; }
.assignment-overview-card > header em { flex: 0 0 auto; color: #87938f; font: 600 9px/1 var(--mono); font-style: normal; }
.assignment-overview-card > strong { color: #293c39; font-size: 15px; line-height: 1.45; }
.assignment-overview-card > p { display: -webkit-box; overflow: hidden; margin: 0; color: #7b8985; font-size: 10px; line-height: 1.55; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.assignment-overview-card > footer { display: flex; align-items: end; justify-content: space-between; gap: 10px; margin-top: auto; }
.assignment-overview-card > footer span { color: #778681; font-size: 10px; }
.assignment-overview-card > footer b { color: #315d55; font-size: 10px; }
.assignment-overview-card > footer i { font-style: normal; }
.assignment-overview-column.is-attention .assignment-overview-card { border-left: 3px solid #b56c70; }
.assignment-overview-column.is-completed .assignment-overview-card { opacity: .76; }
.assignment-overview-empty {
    padding: 32px 14px;
    border: 1px dashed #d8dfdb;
    border-radius: 13px;
    color: #8b9793;
    font-size: 11px;
    text-align: center;
}

@media (max-width: 980px) {
    .student-today-hero { gap: 28px; }
    .assignment-planner[data-board-view="all"] .assignment-planner-toolbar { grid-template-columns: 1fr 1fr; }
    .assignment-planner[data-board-view="week"] .assignment-planner-toolbar { grid-template-columns: 1fr 1fr; }
    .assignment-all-board { grid-template-columns: 1fr 1fr; }
    .assignment-overview-column.is-completed { grid-column: 1 / -1; }
}

@media (max-width: 720px) {
    .student-today-page .student-board-shell { padding-top: 42px; }
    .student-today-hero { display: grid; grid-template-columns: 1fr; gap: 22px; margin-bottom: 26px; }
    .student-today-hero h1 { font-size: clamp(34px, 11vw, 48px); }
    .student-week-summary { grid-template-columns: 1fr auto; align-items: center; min-width: 0; padding: 13px 0 0; border-top: 1px solid #cfd6d1; border-left: 0; }
    .student-week-summary > span { grid-column: 1 / -1; }
    .student-week-summary > strong { margin-top: 8px; font-size: 28px; }
    .student-week-summary > small { align-self: end; justify-self: start; margin: 0 0 4px 8px; }
    .student-week-rail { grid-template-columns: repeat(7, minmax(72px, 1fr)); overflow-x: auto; }
    .student-week-day { min-height: 58px; padding: 9px 10px; }
    .student-day-carousel { border-radius: 18px; }
    .student-day-slide { min-height: 420px; padding: 26px 20px 30px; }
    .student-day-slide__heading { margin-bottom: 22px; padding-bottom: 18px; }
    .student-day-task-grid { grid-template-columns: 1fr; }
    .student-carousel-controls { grid-template-columns: 1fr 1fr; gap: 6px; padding: 9px 10px; }
    .student-carousel-controls > p { display: none; }
    .student-focus-card { min-height: 164px; }
    .assignment-planner[data-board-view="all"] .assignment-planner-toolbar { grid-template-columns: 1fr; }
    .assignment-planner[data-board-view="week"] .assignment-planner-toolbar { grid-template-columns: 1fr; }
    .assignment-all-panel { padding: 20px 15px; }
    .assignment-all-panel > header { align-items: stretch; flex-direction: column; }
    .assignment-all-summary { justify-content: space-between; }
    .assignment-all-board { grid-template-columns: 1fr; }
    .assignment-overview-column.is-completed { grid-column: auto; }
}

@media (prefers-reduced-motion: reduce) {
    .is-carousel-ready .student-day-carousel__track,
    .student-focus-card,
    .assignment-overview-card { transition: none; }
}
