:root, [data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b101b; --surface: #121a29; --surface-2: #182234; --fg: #edf2fa;
  --fg-dim: #b2bfd2; --muted: #91a0b7; --line: #253149; --line-strong: #354563;
  --blue: #7399ff; --cyan: #55d5d5; --green: #48d2a0; --orange: #efbd6a;
  --purple: #b39af9; --pink: #f18aa3; --red: #f18aa3; --num: #f6f8ff;
  --radius: 12px; --radius-sm: 8px; --tblr-body-bg: var(--bg); --tblr-body-color: var(--fg);
}
[data-theme="light"] {
  color-scheme: light;
  --bg: #f2f7fd; --surface: #fff; --surface-2: #f0f6fd; --fg: #163354;
  --fg-dim: #475874; --muted: #63748e; --line: #e3e8f0; --line-strong: #c6d1e2;
  --blue: #1764b4; --cyan: #087d8a; --green: #087e58; --orange: #96600b;
  --purple: #7551bc; --pink: #b73a61; --red: #b73a61; --num: #17243b;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 14px/1.65 "Segoe UI", "Microsoft YaHei", sans-serif; }
[hidden] { display: none !important; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--blue); }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { color: var(--fg); font-weight: 600; }
button, input, select, textarea { font: inherit; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
.layout { display: flex; min-height: 100vh; }
.sidebar { position: sticky; top: 0; width: 236px; flex: 0 0 236px; height: 100vh; padding: 28px 16px 16px; display: flex; flex-direction: column; background: var(--surface); border-right: 1px solid var(--line); z-index: 60; }
.brand { display: flex; align-items: center; gap: 11px; padding: 0 8px 24px; color: var(--fg); font-size: 15px; font-weight: 650; }
.brand small { display: block; font-size: 9px; letter-spacing: 2px; color: var(--muted); margin-top: 2px; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 36px; border-radius: 10px; color: #fff; background: var(--blue); font-size: 24px; font-weight: 800; }
.nav { display: flex; flex-direction: column; flex-wrap: nowrap; gap: 4px; flex: 1; overflow-y: auto; }
.nav-label { padding: 17px 14px 7px; font-size: 10px; letter-spacing: 2px; color: var(--muted); }
.nav a { display: flex; align-items: center; gap: 12px; padding: 10px 14px; color: var(--fg-dim); border-radius: 8px; font-size: 13px; }
.nav a:hover, .nav a.on { background: color-mix(in srgb, var(--blue) 12%, transparent); color: var(--blue); }
.nav a.on { box-shadow: inset 3px 0 var(--blue); }
.ic { width: 18px; height: 18px; flex: 0 0 18px; }
.side-foot { display: flex; align-items: center; gap: 10px; padding: 20px 5px 0; margin-top: 14px; border-top: 1px solid var(--line); }
.me { display: flex; flex: 1; flex-direction: column; font-size: 12px; gap: 3px; }
.me .tag { padding: 0; background: none; border: 0; font-size: 10px; color: var(--muted); }
.member-avatar { width: 32px; height: 32px; display: grid; place-items: center; flex: 0 0 32px; border-radius: 9px; background: color-mix(in srgb, var(--blue) 16%, transparent); color: var(--blue); font-size: 12px; }
.quit, .context-label { color: var(--muted); font-size: 12px; }
.workspace { flex: 1; min-width: 0; }
.workspace-topbar { min-height: 73px; padding: 0 32px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); background: var(--bg); }
.topbar-context, .topbar-actions { display: flex; gap: 12px; align-items: center; }
.topbar-context strong { font-size: 12px; font-weight: 500; }
.theme-btn { width: 31px; height: 31px; background: var(--surface); color: var(--fg-dim); border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.workspace-topbar .menu-toggle, .sidebar-backdrop { display: none; }
.main { max-width: 1580px; margin: 0 auto; padding: 30px 32px 64px; }
.plain-workspace { width: 100%; }
.shell { width: 100%; padding: 32px; }
.page-head { margin-bottom: 28px; }
.kicker { color: var(--blue); font-size: 10px; letter-spacing: 2px; margin-bottom: 8px; }
.page-title { font-size: 27px; letter-spacing: -.6px; margin: 0; }
.page-sub { font-size: 12px; color: var(--muted); margin: 8px 0 0; }
.dashboard-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.dashboard-heading .page-head { margin: 0; }
.dashboard-hero { position: relative; padding: 26px 28px; margin-bottom: 24px; border: 1px solid var(--line); border-radius: 14px; background: linear-gradient(110deg, var(--surface), color-mix(in srgb, var(--blue) 8%, var(--surface))); overflow: hidden; }
.dashboard-hero::after { content: ""; position: absolute; right: 150px; top: -90px; width: 240px; height: 240px; border: 1px solid color-mix(in srgb, var(--blue) 14%, transparent); border-radius: 50%; pointer-events: none; }
.card, .stat, .auth-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: none; color: var(--fg); }
.card { display: block; padding: 22px; margin-bottom: 20px; min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.card-head h3 { font-size: 14px; margin: 0; }
.cols, .chart-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.chart-row { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 20px; }
.chart-row .chart-card { margin-bottom: 0; }
.chart-row:has(#chart-bar) { grid-template-columns: 1.4fr 1fr; }
.chart-card { min-height: 285px; }
.chart-box { position: relative; height: 225px; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat { position: relative; padding: 20px; overflow: hidden; }
.stat::after { content: ""; position: absolute; width: 5px; height: 5px; border-radius: 50%; background: var(--c); top: 27px; right: 21px; box-shadow: 0 0 0 5px color-mix(in srgb, var(--c) 10%, transparent); }
.stat-label, .stat-hint { font-size: 11px; color: var(--muted); }
.stat-num { font-size: 34px; letter-spacing: -1px; line-height: 1.8; color: var(--num); font-weight: 650; font-variant-numeric: tabular-nums; }
.stat-hint .link { font-size: 11px; }
.table { width: 100%; border-collapse: collapse; margin: 0; font-variant-numeric: tabular-nums; --tblr-table-color: var(--fg-dim); --tblr-table-bg: transparent; }
.table th { text-align: left; font-size: 11px; color: var(--muted); font-weight: 500; background: var(--surface-2); padding: 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 14px 12px; border-bottom: 1px solid var(--line); font-size: 12px; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--surface-2); }
.table.small td, .table.small th { padding: 10px; }
.table select { width: auto; min-width: 90px; }
tr.dim { opacity: .6; }
.bar { position: relative; min-width: 100px; height: 20px; border-radius: 5px; background: var(--surface-2); overflow: hidden; }
.bar i { position: absolute; inset: 0 auto 0 0; background: color-mix(in srgb, var(--blue) 35%, transparent); }
.bar span { position: relative; display: block; color: var(--fg); font-size: 10px; text-align: center; }
.rows { list-style: none; padding: 0; margin: 0; }
.row { display: flex; align-items: center; justify-content: space-between; flex-wrap: nowrap; gap: 14px; padding: 13px 0; margin: 0; border-bottom: 1px solid var(--line); }
.row > * { width: auto; padding: 0; flex-shrink: 1; }
.row:last-child { border-bottom: 0; }
.row-main { min-width: 0; }
.row-title { font-size: 13px; overflow-wrap: anywhere; }
.row-meta { color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
.row-actions, .btn-row { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.task-list { display: flex; flex-direction: column; gap: 16px; }
.task-card { margin-bottom: 0; }
.review-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 310px), 1fr)); gap: 20px; }
.collection-count { font-size: 24px; font-weight: 650; color: var(--blue); margin: 18px 0 8px; }
.collection-count .muted { font-size: 12px; font-weight: 400; }
.collection-progress { width: 100%; height: 8px; accent-color: var(--blue); }
.review-metrics { display: flex; flex-wrap: wrap; gap: 12px 20px; font-size: 12px; color: var(--fg-dim); margin: 18px 0; }
.review-back { margin-bottom: 20px; }
.collection-members { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 270px), 1fr)); gap: 10px; }
.collection-member { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px; background: var(--surface-2); border-radius: 8px; font-size: 12px; }
.collection-member small { display: block; }
.submission-card { scroll-margin-top: 20px; }
.submission-card summary { cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.submission-card summary strong::before { content: '▸ '; color: var(--blue); }
.submission-card[open] summary strong::before { content: '▾ '; }
.submission-card summary small { display: block; margin-top: 5px; }
.submission-body { border-top: 1px solid var(--line); margin-top: 18px; padding-top: 18px; }
.homework-preview { width: 100%; height: 480px; border: 1px solid var(--line); border-radius: 8px; background: #fff; margin: 16px 0; }
.document-preview { padding: 24px; }
.document-preview h1 { font-size: 18px; overflow-wrap: anywhere; }
.document-preview h2 { font-size: 15px; margin-top: 24px; }
.document-text { white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; background: var(--surface); padding: 18px; border: 1px solid var(--line); border-radius: 8px; }
.document-table { overflow-x: auto; background: var(--surface); }
.task-head { display: flex; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.task-head h3 { font-size: 15px; margin-bottom: 5px; }
.task-desc { color: var(--fg-dim); white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; }
.st-border-pending { border-left: 3px solid var(--muted); }
.st-border-doing { border-left: 3px solid var(--blue); }
.st-border-submitted { border-left: 3px solid var(--cyan); }
.st-border-passed, .st-border-approved { border-left: 3px solid var(--green); }
.st-border-rejected { border-left: 3px solid var(--pink); }
.pill, .tag, .pin { display: inline-flex; align-items: center; width: fit-content; white-space: nowrap; border-radius: 5px; padding: 3px 8px; font-size: 10px; color: var(--muted); background: var(--surface-2); }
.st-pending, .st-leave { color: var(--muted); }
.st-doing, .tag-newbie { color: var(--blue); background: color-mix(in srgb, var(--blue) 10%, transparent); }
.st-submitted, .tag-admin, .tag-teacher { color: var(--cyan); background: color-mix(in srgb, var(--cyan) 10%, transparent); }
.st-passed, .st-normal, .st-approved { color: var(--green); background: color-mix(in srgb, var(--green) 10%, transparent); }
.st-rejected { color: var(--pink); background: color-mix(in srgb, var(--pink) 10%, transparent); }
.st-late, .pin { color: var(--orange); background: color-mix(in srgb, var(--orange) 10%, transparent); }
.st-makeup, .tag-senior, .tag-manager { color: var(--purple); background: color-mix(in srgb, var(--purple) 10%, transparent); }
.form { display: flex; flex-direction: column; gap: 16px; }
.form.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-full { grid-column: 1 / -1; }
.form label { display: flex; flex-direction: column; gap: 7px; color: var(--fg-dim); font-size: 12px; }
input, select, textarea { width: 100%; color: var(--fg); background: var(--bg); padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); min-width: 0; }
input::placeholder, textarea::placeholder { color: var(--muted); }
input:focus, select:focus, textarea:focus { border-color: var(--blue); outline: 2px solid color-mix(in srgb, var(--blue) 20%, transparent); }
input[type="checkbox"], input[type="radio"] { width: auto; accent-color: var(--blue); }
textarea { resize: vertical; }
select option { background: var(--surface); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; background: var(--surface-2); border: 1px solid var(--line-strong); color: var(--fg-dim); border-radius: 7px; padding: 9px 15px; font-size: 12px; cursor: pointer; box-shadow: none; }
.btn:hover { background: color-mix(in srgb, var(--blue) 12%, var(--surface)); color: var(--fg); border-color: var(--blue); }
.btn-primary { color: #fff; background: var(--blue); border-color: var(--blue); }
.btn-primary:hover { background: #125394; color: #fff; }
.btn-danger { color: var(--pink); border-color: color-mix(in srgb, var(--pink) 35%, var(--line)); }
.btn-mini { padding: 5px 10px; font-size: 11px; }
.link { color: var(--blue); font-size: 12px; }
.link.danger { background: none; border: 0; padding: 0; color: var(--pink); cursor: pointer; }
.muted, .muted-link { color: var(--muted); font-size: 12px; }
.c-green { color: var(--green); }.c-blue { color: var(--blue); }.c-cyan { color: var(--cyan); }.c-purple { color: var(--purple); }
.inline-form { display: inline-flex; align-items: center; gap: 6px; margin: 3px 0; }
.inline-form input, .inline-form select { width: auto; max-width: 180px; padding: 5px; font-size: 12px; }
.inline-form button { white-space: nowrap; }
.reset-form { padding-left: 10px; border-left: 1px solid var(--line); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chip span { display: inline-flex; gap: 6px; align-items: center; border: 1px solid var(--line-strong); padding: 8px 12px; border-radius: 6px; cursor: pointer; }
.chip i { font-style: normal; font-size: 10px; color: var(--muted); }
.chip input:checked + span { color: var(--blue); border-color: var(--blue); background: color-mix(in srgb, var(--blue) 10%, transparent); }
.chip input:focus-visible + span { outline: 2px solid var(--blue); outline-offset: 2px; }
.form .chk { flex-direction: row; align-items: center; }
.sub-form { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.flashes { margin-bottom: 20px; }
.flash, .notice-warn, .notice-ok { padding: 12px 16px; margin-bottom: 10px; border-radius: 8px; font-size: 12px; }
.flash-ok, .notice-ok { color: var(--green); background: color-mix(in srgb, var(--green) 10%, transparent); }
.flash-error, .notice-warn { color: var(--pink); background: color-mix(in srgb, var(--pink) 10%, transparent); }
.empty-card { border: 1px dashed var(--line-strong); background: var(--surface); border-radius: 12px; padding: 48px 24px; text-align: center; }
.empty-card p { margin: 0; }
.kv { list-style: none; padding: 0; }
.kv li { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.kv span { color: var(--muted); }
.replies { border-left: 2px solid var(--line-strong); padding-left: 16px; margin: 16px 0; }
.reply { margin-bottom: 12px; color: var(--fg-dim); font-size: 13px; }
.reply-form { flex-direction: row; }
.who-read summary { color: var(--blue); cursor: pointer; font-size: 12px; }
.auth-page { min-height: 100vh; display: grid; align-items: center; background: radial-gradient(ellipse at 20% 10%, color-mix(in srgb, var(--blue) 14%, transparent) 0, transparent 50%), var(--bg); }
.auth-wrap { display: grid; grid-template-columns: 1.1fr 1fr; align-items: center; gap: 80px; max-width: 980px; margin: auto; }
.auth-wrap.single { display: block; max-width: 440px; }
.auth-card { padding: 36px; }
.auth-title { font-size: 25px; margin: 10px 0; }
.auth-sub, .auth-foot { color: var(--muted); font-size: 12px; margin: 12px 0 26px; }
.auth-foot { margin: 24px 0 0; }
.auth-intro h2 { font-size: 42px; line-height: 1.35; letter-spacing: -1px; margin: 20px 0; }
.auth-intro p { color: var(--fg-dim); font-size: 14px; line-height: 2; }
.auth-intro .brand { padding: 0; }
.auth-intro .auth-features { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.track-dept-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin-top: 16px; }
.track-dept, .mini-card { padding: 18px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; }
.track-dept-name { border-bottom: 1px solid var(--line); padding-bottom: 12px; margin-bottom: 12px; }
.track-dept .btn-row { margin-top: 14px; }
.pwd-rules { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; font-size: 11px; color: var(--muted); }
.pwd-rules .rule::before { content: '○ '; }.pwd-rules .rule.ok { color: var(--green); }.pwd-rules .rule.ok::before { content: '✓ '; }
.switch, .filter-toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.create-panel summary { cursor: pointer; font-size: 14px; font-weight: 600; color: var(--blue); }
.create-panel summary .muted { margin-left: 12px; font-weight: 400; }
.create-panel[open] summary { margin-bottom: 22px; }
.notice-ticker { display: flex; align-items: center; gap: 16px; background: var(--surface); border: 1px solid var(--line); padding: 13px 18px; margin-bottom: 20px; border-radius: 9px; overflow: hidden; }
.ticker-label { flex-shrink: 0; color: var(--cyan); font-size: 11px; }
.ticker-viewport { overflow: hidden; min-width: 0; }
.ticker-track { display: flex; gap: 20px; white-space: nowrap; }
.ticker-sep { display: none; }
.ticker-item { color: var(--fg-dim); font-size: 12px; text-overflow: ellipsis; overflow: hidden; }
.notice-modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; background: #050914aa; padding: 20px; }
.notice-modal-card { width: min(600px, 100%); max-height: 80vh; overflow: auto; padding: 28px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); }
.notice-modal-card h3 { font-size: 18px; }.notice-modal-card p { white-space: pre-wrap; margin: 20px 0 0; }
.notice-modal-close { float: right; background: none; border: 0; color: var(--muted); font-size: 24px; cursor: pointer; }
@media (max-width: 1200px) { .main { padding: 24px; }.chart-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }.chart-row > :last-child:nth-child(3) { grid-column: 1 / -1; } }
@media (max-width: 900px) {
  .sidebar { position: fixed; transform: translateX(-100%); transition: transform .2s; width: 250px; }
  .sidebar-open .sidebar { transform: translateX(0); }
  .sidebar-backdrop:not([hidden]) { display: block; position: fixed; inset: 0; z-index: 50; border: 0; background: #030712aa; }
  .workspace-topbar .menu-toggle { display: inline-flex; }.workspace-topbar { padding: 0 18px; min-height: 64px; }
  .context-label { display: none; }.main { padding: 22px 16px 48px; }
  .auth-wrap { gap: 32px; }.auth-intro h2 { font-size: 30px; }
  .table { display: block; overflow-x: auto; white-space: nowrap; }
  .dashboard-hero { padding: 22px; }.dashboard-heading { align-items: flex-start; }
}
@media (max-width: 600px) {
  .cols, .chart-row, .chart-row:has(#chart-bar), .form.grid2, .auth-wrap { grid-template-columns: minmax(0, 1fr); }
  .chart-row > :last-child:nth-child(3) { grid-column: auto; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }.stat { padding: 16px; }.stat-num { font-size: 28px; }
  .card { padding: 18px 14px; }.page-title { font-size: 23px; }.dashboard-heading { flex-direction: column; gap: 20px; }
  .dashboard-hero::after { display: none; }.shell { padding: 20px; }.auth-card { padding: 26px 22px; }
  .auth-intro h2 { display: none; }.auth-intro p, .auth-features { display: none !important; }.auth-wrap { gap: 24px; }
  .topbar-actions { gap: 8px; }.row, .task-head { gap: 10px; }.task-head { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; } }
