:root {
  --bg: #f4f1ea;
  --panel: #fffdf8;
  --panel-soft: #fbf7ef;
  --green: #2f8f55;
  --green-light: #e8f5ee;
  --orange: #d4862f;
  --orange-light: #fdf0e0;
  --red: #c0392b;
  --red-light: #fdecea;
  --blue: #2980b9;
  --blue-light: #e8f4fd;
  --brown: #9b5c2e;
  --line: #e8dfd1;
  --text: #3d2b1f;
  --muted: #9b8b7a;
  --shadow: 0 18px 45px rgba(61, 43, 31, 0.08);
  --shadow-soft: 0 8px 22px rgba(61, 43, 31, 0.05);
  --radius: 18px;
  --sidebar: 236px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; background: radial-gradient(circle at 20% 0%, #fff8ec 0, var(--bg) 320px); color: var(--text); min-height: 100vh; }
body.app-booting .landing-page,
body.app-booting .app { visibility: hidden; }

/* Layout */
.app { display: flex; min-height: 100vh; }
.app.is-hidden { display: none; }
.landing-page { min-height: 100vh; padding: 28px; background: linear-gradient(180deg, #fffdf8 0%, var(--bg) 100%); }
.landing-shell { width: min(1120px, 100%); min-height: calc(100vh - 56px); margin: 0 auto; display: grid; grid-template-rows: auto 1fr auto; gap: 34px; }
.landing-shell.auth-mode { grid-template-rows: auto 1fr; }
.landing-shell.auth-mode .landing-main,
.landing-shell.auth-mode .landing-foot { display: none; }
.landing-top { display: flex; align-items: center; justify-content: space-between; gap: 18px; position: relative; z-index: 10; }
#landing-account-area { position: relative; z-index: 12; pointer-events: auto; }
.landing-brand { display: inline-flex; align-items: center; gap: 10px; font-size: 16px; font-weight: 900; color: var(--green); cursor: pointer; }
.landing-brand-mark { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--green-light); border: 1px solid #cdebd8; }
.landing-auth { display: inline-flex; align-items: center; overflow: hidden; border-radius: 999px; background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow-soft); position: relative; z-index: 13; pointer-events: auto; }
.landing-auth-btn { height: 42px; min-width: 74px; border: none; padding: 0 18px; font-size: 14px; font-weight: 900; cursor: pointer; color: var(--text); background: transparent; }
.landing-auth-btn.login { background: var(--panel-soft); color: var(--text); }
.landing-auth-btn.register { background: transparent; color: var(--text); border-radius: 0 999px 999px 0; }
.landing-auth-btn:hover { filter: brightness(0.98); }
.landing-user { position: relative; }
.landing-user-pill { height: 42px; display: inline-flex; align-items: center; gap: 8px; border: none; border-radius: 999px; background: var(--panel-soft); padding: 5px 12px 5px 5px; color: var(--text); font-size: 14px; font-weight: 900; cursor: pointer; }
.landing-user-avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--green); color: white; font-size: 15px; font-weight: 950; }
.landing-user-arrow { color: var(--muted); font-size: 13px; }
.landing-user-menu { position: absolute; right: 0; top: calc(100% + 8px); width: 150px; padding: 8px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); box-shadow: var(--shadow-soft); display: none; z-index: 20; }
.landing-user-menu.show { display: block; }
.landing-user-menu button { width: 100%; height: 36px; border: none; border-radius: 10px; background: transparent; text-align: left; padding: 0 10px; color: var(--text); font-size: 13px; font-weight: 800; cursor: pointer; }
.landing-user-menu button:hover { background: var(--panel-soft); }
.landing-main { max-width: 820px; margin: 0 auto; align-self: center; padding: 28px 0 40px; text-align: center; }
.landing-kicker { color: var(--green); font-size: 14px; font-weight: 900; margin-bottom: 18px; }
.landing-title { font-size: clamp(32px, 4.6vw, 52px); line-height: 1.12; letter-spacing: 0; font-weight: 950; color: var(--text); margin-bottom: 50px; }
.landing-copy { max-width: 660px; margin: 0 auto 30px; color: var(--muted); font-size: 17px; line-height: 1.8; }
.landing-actions { display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; }
.landing-enter { min-width: 178px; height: 48px; font-size: 16px; border-radius: 14px; }
.landing-auth-btn.active { background: var(--green); color: white; }
.landing-auth-stage { display: none; align-self: stretch; min-height: 0; pointer-events: none; }
.landing-auth-stage.show { display: grid; pointer-events: auto; }
.auth-showcase { height: min(640px, calc(100vh - 128px)); min-height: 560px; display: grid; grid-template-columns: 1.15fr 0.85fr; border: 1px solid var(--line); border-radius: 26px; background: rgba(255,253,248,0.76); overflow: hidden; box-shadow: var(--shadow); }
.auth-visual { position: relative; padding: 46px; background: linear-gradient(135deg, #f7fbf5 0%, #fffdf8 62%); border-right: 1px solid var(--line); min-height: 100%; }
.auth-slogan { color: var(--green); font-size: 18px; font-weight: 950; margin-bottom: 72px; }
.auth-orbit { position: absolute; width: 460px; height: 460px; left: 70px; top: 112px; border: 1px solid #dfeadc; border-radius: 50%; }
.auth-orbit::before, .auth-orbit::after { content: ""; position: absolute; border: 1px dashed #dfeadc; border-radius: 50%; inset: 66px; }
.auth-orbit::after { inset: 136px; }
.auth-bubble { position: absolute; border-radius: 50%; background: linear-gradient(145deg, var(--green-light), #aee6c5); box-shadow: 0 18px 40px rgba(47,143,85,0.16); animation: auth-breathe 7s ease-in-out infinite; will-change: transform, opacity; }
.auth-bubble.one { width: 124px; height: 124px; left: 102px; top: 310px; animation-duration: 7.6s; }
.auth-bubble.two { width: 92px; height: 92px; right: 120px; top: 252px; background: linear-gradient(145deg, #e7f2ff, #9bcdf0); animation-duration: 8.4s; animation-delay: -1.8s; }
.auth-bubble.three { width: 58px; height: 58px; left: 330px; top: 456px; background: linear-gradient(145deg, #fff4dc, #f5c273); animation-duration: 6.8s; animation-delay: -3s; }
@keyframes auth-breathe {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); opacity: 0.92; }
  50% { transform: translate3d(0, -18px, 0) scale(1.055); opacity: 1; }
}
.auth-form-wrap { display: grid; place-items: center; padding: 22px 44px; background: rgba(255,255,255,0.46); min-height: 0; overflow: visible; }
.auth-form { width: min(360px, 100%); min-height: 0; display: flex; flex-direction: column; justify-content: center; padding: 0; }
.auth-form-title { font-size: 30px; font-weight: 950; text-align: center; margin-bottom: 16px; }
.auth-field { margin-bottom: 8px; }
.auth-label { display: block; font-size: 14px; font-weight: 900; margin-bottom: 6px; color: var(--text); }
.auth-input { width: 100%; height: 40px; border: 1px solid transparent; border-radius: 12px; background: #f1f0ed; padding: 0 14px; font-size: 14px; outline: none; color: var(--text); }
.auth-input:focus { border-color: var(--green); background: var(--panel); box-shadow: 0 0 0 3px rgba(47,143,85,0.1); }
.auth-password-wrap { height: 40px; display: grid; grid-template-columns: 1fr 52px; border: 1px solid transparent; border-radius: 12px; background: #f1f0ed; overflow: hidden; }
.auth-password-wrap:focus-within { border-color: var(--green); background: var(--panel); box-shadow: 0 0 0 3px rgba(47,143,85,0.1); }
.auth-password-wrap .auth-input { height: 100%; border: none; border-radius: 0; background: transparent; box-shadow: none; padding-right: 14px; }
.auth-password-wrap .auth-input:focus { border: none; background: transparent; box-shadow: none; }
.auth-eye-btn { width: 52px; height: 100%; border: none; border-left: 1px solid #cdebd8; background: var(--green-light); color: var(--green); cursor: pointer; display: grid; place-items: center; }
.auth-eye-btn svg { width: 19px; height: 19px; stroke: currentColor; stroke-width: 2.6; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.auth-eye-btn.is-hidden { background: var(--panel-soft); color: var(--muted); border-left-color: var(--line); }
.auth-input-row { display: grid; grid-template-columns: 1fr 112px; gap: 10px; align-items: center; }
.auth-code-btn { height: 40px; border: 1px solid var(--green); border-radius: 12px; background: var(--panel); color: var(--green); font-size: 13px; font-weight: 900; cursor: pointer; }
.auth-code-btn:hover { background: var(--green-light); }
.auth-check { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; margin: 8px 0; }
.auth-submit { width: 100%; margin-top: 2px; }
.auth-switch { text-align: center; color: var(--muted); font-size: 14px; margin-top: 14px; }
.auth-switch a { color: var(--green); font-weight: 900; cursor: pointer; text-decoration: none; }
.landing-foot { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; padding-top: 18px; border-top: 1px solid var(--line); }
.landing-step { min-height: 118px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,253,248,0.72); padding: 22px 18px; color: var(--muted); font-size: 13px; line-height: 1.7; }
.landing-step strong { display: block; color: var(--text); font-size: 15px; margin-bottom: 5px; }
.sidebar { width: var(--sidebar); min-height: 100vh; background: rgba(255, 253, 248, 0.92); border-right: 1px solid var(--line); position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; backdrop-filter: blur(18px); }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { background: rgba(255, 253, 248, 0.88); border-bottom: 1px solid var(--line); padding: 14px 28px; display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 10; backdrop-filter: blur(18px); }
.content { padding: 28px; flex: 1; }

/* Sidebar */
.sidebar-header { padding: 22px 18px 18px; border-bottom: 1px solid var(--line); }
.sidebar-logo { font-size: 17px; font-weight: 700; color: var(--green); display: flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; text-align: center; }
.sidebar-sub { font-size: 12px; color: var(--muted); margin-top: 4px; }
.sidebar-nav { padding: 12px 10px; flex: 1; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; cursor: pointer; font-size: 14px; color: var(--muted); transition: all 0.15s; margin-bottom: 2px; }
.nav-item:hover { background: var(--bg); color: var(--text); }
.nav-item.active { background: var(--green-light); color: var(--green); font-weight: 600; box-shadow: inset 3px 0 0 var(--green); }
.nav-icon { font-size: 18px; width: 24px; text-align: center; }
.sidebar-footer { padding: 14px 18px; border-top: 1px solid var(--line); }
.teacher-info { display: flex; align-items: center; gap: 10px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--green); color: white; display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 600; flex-shrink: 0; }
.teacher-name { font-size: 14px; font-weight: 600; }
.teacher-class { font-size: 12px; color: var(--muted); }

/* Topbar */
.topbar-title { font-size: 18px; font-weight: 700; color: var(--text); }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.topbar-date { font-size: 13px; color: var(--muted); }
.credit-pill { display: inline-flex; align-items: center; gap: 7px; min-height: 32px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); color: var(--text); font-size: 13px; font-weight: 800; cursor: pointer; box-shadow: var(--shadow-soft); }
.credit-pill.low { background: var(--orange-light); color: var(--orange); border-color: #f1c796; }
.credit-icon { color: var(--orange); font-size: 15px; line-height: 1; }
.credit-cost { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: 12px; font-weight: 600; margin-top: 8px; }
.credit-drawer-mask { position: fixed; inset: 0; background: rgba(61,43,31,0.16); z-index: 80; opacity: 0; pointer-events: none; transition: opacity 0.18s; }
.credit-drawer-mask.show { opacity: 1; pointer-events: auto; }
.credit-drawer { position: fixed; top: 0; right: 0; width: min(380px, 92vw); height: 100vh; background: var(--panel); border-left: 1px solid var(--line); z-index: 90; padding: 22px; box-shadow: -20px 0 45px rgba(61,43,31,0.12); transform: translateX(100%); transition: transform 0.2s; overflow-y: auto; }
.credit-drawer.show { transform: translateX(0); }
.credit-balance { font-size: 34px; font-weight: 900; line-height: 1; margin: 12px 0 6px; }
.credit-stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 16px 0; }
.credit-stat { background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.credit-record { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.credit-record:last-child { border-bottom: none; }
.credit-record-title { font-size: 13px; font-weight: 700; }
.credit-record-meta { font-size: 12px; color: var(--muted); margin-top: 4px; }
.credit-record-cost { color: var(--red); font-size: 13px; font-weight: 800; white-space: nowrap; }
.modal-mask { position: fixed; inset: 0; background: rgba(61,43,31,0.24); z-index: 100; opacity: 0; pointer-events: none; transition: opacity 0.18s; display: grid; place-items: center; padding: 18px; }
.modal-mask.show { opacity: 1; pointer-events: auto; }
.modal-panel { width: min(420px, 94vw); background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 22px 60px rgba(61,43,31,0.18); padding: 22px 22px 18px; }
.modal-panel.history-modal-panel { width: min(720px, 94vw); max-height: 82vh; overflow-y: auto; }
.history-modal-content { min-height: 420px; }
.modal-title { font-size: 20px; font-weight: 900; margin-bottom: 8px; color: var(--text); }
.modal-desc { font-size: 14px; color: var(--muted); line-height: 1.55; margin-bottom: 14px; }
.modal-link { color: var(--blue); font-size: 14px; font-weight: 800; cursor: pointer; display: inline-block; margin-bottom: 14px; }
.modal-field { width: 100%; border: 1px solid var(--line); border-radius: 6px; background: white; padding: 10px 12px; font-size: 14px; outline: none; margin-bottom: 10px; }
.modal-field:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(47,143,85,0.1); }
.modal-radio-row { display: flex; gap: 14px; margin-bottom: 14px; color: var(--text); font-size: 14px; }
.modal-radio-row label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }
.modal-tabs { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--panel-soft); margin-bottom: 14px; }
.modal-tab { border: none; background: transparent; padding: 8px 12px; font-size: 13px; font-weight: 800; color: var(--muted); cursor: pointer; }
.modal-tab.active { background: var(--green-light); color: var(--green); }
.feishu-auth-card { border: 1px solid var(--line); border-radius: 12px; background: var(--panel-soft); padding: 14px; margin-bottom: 14px; }
.feishu-auth-row { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 9px; font-size: 13px; color: var(--text); line-height: 1.55; }
.feishu-auth-dot { width: 18px; height: 18px; border-radius: 50%; background: var(--green-light); color: var(--green); display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 900; flex-shrink: 0; margin-top: 1px; }
.advanced-link { border: none; background: transparent; color: var(--muted); font-size: 13px; font-weight: 800; cursor: pointer; padding: 0; }
.advanced-link:hover { color: var(--green); }
.advanced-panel { display: none; border-top: 1px solid var(--line); margin-top: 14px; padding-top: 14px; }
.advanced-panel.show { display: block; }

/* Cards */
.card { background: rgba(255, 253, 248, 0.94); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-soft); }
.card-title { font-size: 15px; font-weight: 700; margin-bottom: 14px; color: var(--text); }
.card-sub { font-size: 13px; color: var(--muted); margin-bottom: 14px; }

/* KPI Cards */
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.kpi-card { background: linear-gradient(180deg, #fffefa, var(--panel-soft)); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; display: flex; align-items: center; gap: 18px; box-shadow: var(--shadow-soft); }
.kpi-icon { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; }
.kpi-icon.green { background: #4caf7d; }
.kpi-icon.orange { background: #f5a623; }
.kpi-icon.blue { background: #4a90d9; }
.kpi-icon.red { background: #e8705a; }
.kpi-label { font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.kpi-value { font-size: 28px; font-weight: 800; line-height: 1.1; color: var(--text); }
.kpi-value span { font-size: 15px; font-weight: 600; margin-left: 2px; }
.kpi-change { font-size: 12px; margin-top: 6px; color: var(--muted); }
.kpi-change .up { color: #4caf7d; font-weight: 600; }

/* Status Pills */
.pill { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.pill.red { background: var(--red-light); color: var(--red); }
.pill.orange { background: var(--orange-light); color: var(--orange); }
.pill.blue { background: var(--blue-light); color: var(--blue); }
.pill.green { background: var(--green-light); color: var(--green); }
.pill.gray { background: #f0ece6; color: var(--muted); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 18px; border-radius: 10px; font-size: 14px; font-weight: 600; cursor: pointer; border: none; transition: all 0.15s; min-height: 38px; }
.btn-primary { background: var(--green); color: white; }
.btn-primary:hover { background: #267a49; transform: translateY(-1px); box-shadow: 0 8px 16px rgba(47, 143, 85, 0.18); }
.btn-secondary { background: var(--panel); color: var(--text); border: 1px solid var(--line); }
.btn-secondary:hover { background: var(--bg); }
.btn-orange { background: var(--orange); color: white; }
.btn-orange:hover { background: #c07828; }
.btn-danger { background: var(--red); color: white; }
.btn-danger:hover { background: #a93226; transform: translateY(-1px); box-shadow: 0 8px 16px rgba(192, 57, 43, 0.16); }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.active-diff, .btn.active-count { background: var(--green); color: white; border-color: var(--green); }

/* Tables */
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.table td { padding: 12px; border-bottom: 1px solid var(--line); font-size: 14px; }
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: var(--bg); }
.table td a { color: var(--green); cursor: pointer; text-decoration: none; font-weight: 600; }
.table td a:hover { text-decoration: underline; }
.math-rich-text { line-height: 1.8; white-space: normal; word-break: break-word; }
.math-frac { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; vertical-align: middle; font-size: 0.95em; line-height: 1; margin: 0 0.08em; min-width: 1.6em; }
.math-frac.math-frac-wide { width: max-content; max-width: none; font-size: 0.9em; margin: 0.1em 0.18em; }
.math-frac-num, .math-frac-den { display: block; padding: 0 0.16em; }
.math-frac-wide .math-frac-num, .math-frac-wide .math-frac-den { white-space: nowrap; line-height: 1.35; text-align: center; }
.math-frac-bar { width: 100%; border-top: 1.5px solid currentColor; margin: 0.08em 0; }
.math-frac-wide .math-frac-wide { font-size: 0.94em; margin-top: 0.02em; margin-bottom: 0.02em; }
.math-frac-wide .math-frac:not(.math-frac-wide) { font-size: 0.94em; }
.math-gap-op { display: inline-block; line-height: 1; vertical-align: middle; transform: translateY(0.34em); margin: 0 0.08em; }
.math-inline-op { display: inline-block; line-height: 1; vertical-align: middle; transform: translateY(0.08em); margin: 0 0.04em; }
.math-area-sub { font-size: 0.72em; vertical-align: sub; line-height: 0; margin-left: 0.03em; }
.math-scripted { display: inline-flex; align-items: center; vertical-align: middle; line-height: 1; margin: 0 0.03em; }
.math-script-base { display: inline-block; line-height: 1; }
.math-script-stack { display: inline-flex; flex-direction: column; justify-content: center; align-items: flex-start; line-height: 0.82; margin-left: 0.03em; transform: translateY(-0.02em); }
.math-script-sup, .math-script-sub { display: block; font-size: 0.62em; line-height: 0.9; }
.math-fractional-part { display: inline-flex; align-items: center; white-space: nowrap; vertical-align: middle; line-height: 1; margin: 0 0.03em; }
.math-fractional-brace { line-height: 1; padding: 0 0.02em; }
.math-integer-part { display: inline-flex; align-items: center; white-space: nowrap; vertical-align: middle; line-height: 1; margin: 0 0.03em; }
.math-integer-bracket { line-height: 1; padding: 0 0.02em; }
.math-mixed { display: inline-flex; align-items: center; gap: 0.08em; vertical-align: middle; }
.math-cfrac { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; vertical-align: middle; line-height: 1.08; margin: 0.06em 0.16em; }
.math-cfrac-num { display: block; padding: 0 0.45em 0.08em; text-align: center; }
.math-cfrac-bar { width: 100%; min-width: 2.4em; border-top: 1.5px solid currentColor; }
.math-cfrac-den { display: inline-flex; align-items: center; justify-content: center; gap: 0.12em; padding: 0.1em 0.45em 0; text-align: center; }
.math-cfrac .math-cfrac { font-size: 0.92em; margin-left: 0.1em; }
.math-cases { display: inline-flex; align-items: stretch; vertical-align: middle; margin: 0 0.18em; line-height: 1.25; }
.math-cases-brace { display: flex; align-items: center; font-family: "Times New Roman", serif; font-size: 2.8em; line-height: 1; transform: scaleX(0.72); transform-origin: center; margin-right: 0.04em; }
.math-cases-rows { display: inline-flex; flex-direction: column; justify-content: center; gap: 0.12em; }
.math-cases-row { display: block; white-space: nowrap; }
.math-ml { font-size: 1.28em; vertical-align: middle; math-style: normal; }
.math-ml-tall { vertical-align: top; }
.math-ml mfrac { line-height: 1; math-style: normal; }
.math-ml mrow, .math-ml mn, .math-ml mo, .math-ml mi, .math-ml mtext { math-style: normal; }
.math-ml mtext { font-family: inherit; }
.math-repeat-digit { position: relative; display: inline-block; line-height: 1; padding-top: 0.35em; }
.math-repeat-dot { position: absolute; left: 50%; top: -0.08em; width: 0.22em; height: 0.22em; border-radius: 50%; background: currentColor; transform: translateX(-50%); }
.math-underbrace { display: inline-grid; grid-template-rows: auto 0.36em auto; justify-items: center; vertical-align: text-top; line-height: 1; margin: 0; padding: 0 0.08em; }
.math-underbrace-main { display: block; line-height: 1; white-space: nowrap; }
.math-underbrace-brace { display: block; width: 100%; min-width: 1.8em; height: 0.36em; margin-top: -0.01em; overflow: visible; }
.math-underbrace-brace path { fill: none; stroke: currentColor; stroke-width: 1; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.math-underbrace-label { display: block; font-size: 0.54em; color: currentColor; white-space: nowrap; line-height: 1; margin-top: -0.02em; }
.math-box-placeholder { display: inline-block; box-sizing: border-box; width: 0.66em; height: 0.66em; border: 1.2px solid var(--text); line-height: 1; vertical-align: -0.02em; margin: 0 0.04em 0 0.01em; color: transparent; }
.question-render-preview { margin-top: 8px; padding: 8px 10px; border-radius: 10px; background: var(--panel-soft); border: 1px solid var(--line); color: var(--text); }

/* Grid layouts */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; }
.homework-generate-layout { display: grid; grid-template-columns: minmax(280px, 3fr) minmax(0, 7fr); gap: 20px; align-items: start; }
.gap-16 { gap: 16px; }

/* Tabs content */
.tab-content { display: none; }
.tab-content.active { display: block; }

/* Student list + detail layout */
.student-layout { display: grid; grid-template-columns: 280px 1fr; gap: 20px; }
.student-list-panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.student-list-header { padding: 16px; border-bottom: 1px solid var(--line); }
.student-list-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.student-list-title { font-size: 14px; font-weight: 900; }
.student-list-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.student-delete-toggle.active { background: var(--red-light); color: var(--red); border-color: #f3b8ae; }
.search-input { width: 100%; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; background: var(--bg); color: var(--text); outline: none; }
.search-input:focus { border-color: var(--green); }
.student-item { height: 62px; display: flex; align-items: center; gap: 10px; padding: 10px 16px; cursor: pointer; border-bottom: 1px solid var(--line); transition: background 0.1s; overflow: hidden; }
.student-item:last-child { border-bottom: none; }
.student-item:hover { background: var(--bg); }
.student-item.active { background: var(--green-light); }
.student-item.placeholder { visibility: hidden; pointer-events: none; }
.student-item.empty { cursor: default; color: var(--muted); }
.student-item.empty:hover { background: transparent; }
.student-avatar { width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; color: white; flex-shrink: 0; }
.student-info { flex: 1; min-width: 0; }
.student-name { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.student-delete-x { width: 20px; height: 20px; border: none; border-radius: 50%; background: var(--red-light); color: var(--red); font-size: 14px; font-weight: 900; line-height: 20px; cursor: pointer; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; }
.student-delete-x:hover { background: var(--red); color: white; }
.student-list-tools { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-top: 10px; }
.student-filter-btn { justify-content: center; padding: 7px 8px; min-height: 34px; font-size: 12px; background: var(--panel); color: var(--muted); border: 1px solid var(--line); }
.student-filter-btn.active { background: var(--green-light); color: var(--green); border-color: var(--green); }
#student-list-items { height: 434px; flex: 0 0 434px; overflow: hidden; }
.student-list-pagination { height: 54px; flex: 0 0 54px; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 14px; border-top: 1px solid var(--line); }
.student-page-info { font-size: 12px; color: var(--muted); font-weight: 700; }
.student-page-btn { border: 1px solid var(--line); background: var(--panel); color: var(--muted); border-radius: 8px; padding: 6px 9px; font-size: 12px; font-weight: 800; cursor: pointer; }
.student-page-btn:hover:not(:disabled) { border-color: var(--green); color: var(--green); background: var(--green-light); }
.student-page-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.student-item-main { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.student-name-status { display: flex; align-items: center; gap: 7px; min-width: 0; white-space: nowrap; overflow: hidden; }
.student-rate { font-size: 12px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.student-rate.low { color: var(--red); }
.student-weakline { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.student-list-empty { padding: 22px 16px; color: var(--muted); font-size: 13px; text-align: center; }
.student-profile-stack [id^="student-sediment-"] { min-height: 334px; margin-bottom: 0; }
.student-summary { background: linear-gradient(135deg, #fffefa 0%, #f7efe3 100%); }
.student-summary-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.student-identity { display: flex; align-items: center; gap: 14px; min-width: 0; }
.student-title { font-size: 22px; font-weight: 800; margin-bottom: 4px; }
.student-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.student-actions .btn { width: 82px; height: 38px; min-height: 38px; padding: 0; line-height: 1; flex: 0 0 82px; }
.student-overview-body { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; padding-top: 14px; border-top: 1px solid rgba(232,223,209,0.82); align-items: stretch; }
.student-weak-left-stack { display: grid; grid-template-rows: 1fr 1fr; gap: 10px; min-height: 184px; }
.student-weak-count-card { border: 1px solid var(--line); border-radius: 12px; background: rgba(255,253,248,0.78); padding: 12px 14px; display: flex; flex-direction: column; min-height: 0; }
.student-weak-count-card .sediment-label { font-size: 13px; }
.student-weak-count-card .sediment-value { flex: 1; display: grid; place-items: center; font-size: 38px; }
.student-new-weak-card { border: 1px solid var(--line); border-radius: 12px; background: rgba(255,253,248,0.78); padding: 12px 14px; min-height: 0; }
.student-new-weak-card .sediment-label { font-size: 13px; margin-bottom: 8px; }
.student-weak-distribution { border: 1px solid var(--line); border-radius: 12px; background: rgba(255,253,248,0.78); padding: 14px 16px; min-height: 184px; }
.student-weak-distribution .note-label { font-size: 13px; }
.student-donut-wrap { display: flex; align-items: center; gap: 18px; }
.student-donut-chart { width: 104px; height: 104px; border-radius: 50%; position: relative; flex-shrink: 0; background: conic-gradient(var(--red) 0deg 360deg); }
.student-donut-chart::after { content: ""; position: absolute; inset: 27px; border-radius: 50%; background: var(--panel); box-shadow: inset 0 0 0 1px var(--line); }
.student-donut-legend { flex: 1; min-width: 0; }
.cause-list { display: flex; flex-direction: column; gap: 10px; }
.cause-row { display: grid; grid-template-columns: minmax(82px, 110px) minmax(0, 1fr) 42px; gap: 10px; align-items: center; font-size: 13px; }
.cause-name { color: var(--text); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cause-track { height: 8px; background: var(--line); border-radius: 999px; overflow: hidden; }
.cause-fill { height: 100%; border-radius: 999px; background: var(--orange); }
.cause-fill.is-top { background: var(--red); }
.cause-value { color: var(--muted); font-variant-numeric: tabular-nums; text-align: right; }
.recent-error-list { display: flex; flex-direction: column; gap: 8px; }
.recent-error-item { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font-size: 13px; line-height: 1.55; }
.sediment-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.sediment-grid { display: grid; grid-template-columns: 0.85fr 1.15fr; gap: 14px; }
.sediment-compact-grid { display: grid; grid-template-columns: minmax(280px, 0.78fr) minmax(320px, 1.22fr); gap: 18px; align-items: start; }
.sediment-metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.sediment-metric { border: 1px solid var(--line); border-radius: 12px; background: rgba(255,253,248,0.78); padding: 10px 12px; min-width: 0; }
.sediment-metric-main { display: flex; flex-direction: column; gap: 7px; }
.sediment-value { font-size: 28px; font-weight: 900; line-height: 1; font-variant-numeric: tabular-nums; }
.sediment-label { font-size: 12px; color: var(--muted); font-weight: 700; text-align: left; }
.sediment-metric-main .sediment-value { text-align: center; }
.sediment-metric-link { margin-top: 8px; border: none; background: transparent; color: var(--green); padding: 0; font-size: 12px; font-weight: 800; cursor: pointer; }
.sediment-metric-link:hover { text-decoration: underline; }
.sediment-kp-list { display: flex; flex-direction: column; gap: 9px; }
.sediment-kp-row { display: grid; grid-template-columns: minmax(90px, 1fr) 100px auto; align-items: center; gap: 10px; font-size: 13px; }
.sediment-kp-name { font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sediment-track { height: 8px; background: var(--line); border-radius: 999px; overflow: hidden; }
.sediment-fill { height: 100%; background: var(--red); border-radius: 999px; }
.sediment-count { color: var(--muted); font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sediment-empty { border: 1px dashed var(--line); background: var(--bg); border-radius: 12px; padding: 18px; color: var(--muted); font-size: 13px; line-height: 1.7; }
.sediment-records { margin-top: 12px; display: grid; gap: 8px; }
.sediment-record { display: grid; grid-template-columns: 86px 1fr; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); font-size: 13px; line-height: 1.55; }
.sediment-record.with-action { grid-template-columns: 86px 1fr auto; align-items: center; }
.sediment-date { color: var(--green); font-weight: 800; font-size: 12px; }
.sediment-question { color: var(--text); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.sediment-record-action { border: 1px solid var(--line); background: var(--panel); color: var(--green); border-radius: 8px; padding: 5px 8px; font-size: 12px; font-weight: 800; cursor: pointer; white-space: nowrap; }
.sediment-record-action:hover { border-color: var(--green); background: var(--green-light); }
.sediment-record-action.danger { color: var(--red); border-color: #f3b8ae; background: var(--red-light); }
.sediment-record-action.danger:hover { border-color: var(--red); background: #f9d8d3; }
.sediment-trend { margin-top: 12px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.sediment-trend-card { border: 1px solid var(--line); border-radius: 12px; background: var(--panel-soft); padding: 12px; min-width: 0; }
.sediment-trend-title { font-size: 12px; color: var(--muted); font-weight: 800; margin-bottom: 8px; }
.sediment-trend-main { font-size: 18px; font-weight: 900; line-height: 1.2; }
.sediment-trend-main.up { color: var(--red); }
.sediment-trend-main.down { color: var(--green); }
.sediment-mini-list { display: flex; flex-direction: column; gap: 7px; margin-top: 10px; }
.sediment-mini-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 12px; color: var(--muted); }
.sediment-mini-name { color: var(--text); font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sediment-delta { font-weight: 900; white-space: nowrap; }
.sediment-delta.up { color: var(--red); }
.sediment-delta.down { color: var(--green); }

/* Note blocks */
.note-block { background: var(--bg); border-radius: 10px; padding: 12px 14px; margin-bottom: 10px; }
.note-label { font-size: 11px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 6px; }
.note-content { font-size: 14px; line-height: 1.6; }

/* Weak point tags */
.tag { display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 6px; font-size: 12px; font-weight: 600; margin: 3px; }
.tag.weak { background: var(--red-light); color: var(--red); }
.tag.medium { background: var(--orange-light); color: var(--orange); }
.tag.ok { background: var(--green-light); color: var(--green); }
.tag.neutral { background: #f0ece6; color: var(--muted); }
.library-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.library-stat { border: 1px solid var(--line); border-radius: 14px; background: rgba(255,253,248,0.78); padding: 14px 16px; }
.library-stat-label { font-size: 12px; color: var(--muted); font-weight: 700; margin-bottom: 8px; }
.library-stat-value { font-size: 24px; font-weight: 900; line-height: 1; }
.library-filter-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.library-select { min-width: 140px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); color: var(--text); font-size: 13px; font-weight: 700; }
.library-coverage { display: grid; grid-template-columns: 320px 58px; justify-content: center; align-items: center; gap: 10px; min-width: 0; }
.library-track { height: 7px; flex: 1; background: var(--line); border-radius: 999px; overflow: hidden; }
.library-fill { height: 100%; background: var(--green); border-radius: 999px; }
.library-file-name { font-weight: 800; margin-bottom: 3px; line-height: 1.35; }
.library-file-name-input { width: 100%; min-width: 0; border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--text); font-size: 14px; font-weight: 800; line-height: 1.35; padding: 7px 8px; outline: none; }
.library-file-name-input:hover { border-color: var(--line); background: var(--panel-soft); }
.library-file-name-input:focus { border-color: var(--green); background: var(--panel); box-shadow: 0 0 0 3px rgba(47,143,85,0.1); }
.library-file-meta { font-size: 12px; color: var(--muted); }
.library-file-table { table-layout: fixed; }
.library-file-table th { text-align: center; padding-left: 18px; padding-right: 18px; }
.library-file-table td { vertical-align: middle; }
.library-file-table th:nth-child(1), .library-file-table td:nth-child(1) { width: 15%; text-align: left; }
.library-file-table th:nth-child(2), .library-file-table td:nth-child(2) { width: 18%; text-align: center; }
.library-file-table th:nth-child(3), .library-file-table td:nth-child(3) { width: 42%; text-align: center; }
.library-file-table th:nth-child(4), .library-file-table td:nth-child(4) { width: 14%; text-align: center; }
.library-file-table th:nth-child(5), .library-file-table td:nth-child(5) { width: 11%; text-align: center; }
.library-file-table .library-coverage { margin: 0 auto; width: 388px; }
.question-edit-input, .question-edit-select { width: 100%; border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--text); font-size: 13px; line-height: 1.5; padding: 7px 8px; outline: none; }
.question-edit-input:hover, .question-edit-select:hover { border-color: var(--line); background: var(--panel-soft); }
.question-edit-input:focus, .question-edit-select:focus { border-color: var(--green); background: var(--panel); box-shadow: 0 0 0 3px rgba(47,143,85,0.1); }
.question-edit-input.question-content { min-width: 200px; }
.question-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.question-table-wrap .question-detail-table { min-width: 900px; }
.question-detail-table { table-layout: fixed; }
.question-insert-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0 0 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel-soft); }
.question-insert-label { color: var(--text); font-size: 13px; font-weight: 900; }
.question-insert-input { width: 76px; height: 36px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel); color: var(--text); font-size: 14px; font-weight: 900; text-align: center; outline: none; }
.question-insert-input:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(47,143,85,0.1); }
.question-detail-table th { padding: 10px 12px; vertical-align: middle; white-space: nowrap; background: rgba(255,253,248,0.96); text-align: center; }
.question-detail-table td { padding: 14px 12px; vertical-align: top; text-align: left; }
.question-detail-table .question-index-col { width: 52px; }
.question-index-cell { text-align: center !important; color: var(--muted); font-size: 13px !important; font-weight: 900; font-variant-numeric: tabular-nums; vertical-align: top !important; padding-top: 24px !important; line-height: 1.4; }
.question-detail-table .question-answer-col { width: 116px; }
.question-detail-table .question-category-col { width: 128px; }
.question-detail-table .question-kp-col { width: 178px; }
.question-detail-table .question-progress-col { width: 156px; }
.question-detail-table .question-action-col { width: 80px; }
.question-detail-table .question-edit-input, .question-detail-table .question-edit-select { min-height: 38px; padding: 8px 10px; font-size: 13px; border-color: var(--line); background: var(--panel); }
.question-detail-table .question-edit-select { appearance: auto; }
.question-cell { min-width: 0; }
.question-file-head { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.question-answer-cell, .question-category-cell, .question-kp-cell, .question-progress-cell, .question-action-cell { vertical-align: middle !important; }
.question-detail-table th:nth-child(3), .question-detail-table th:nth-child(4), .question-detail-table th:nth-child(5),
.question-detail-table .question-answer-cell, .question-detail-table .question-category-cell, .question-detail-table .question-kp-cell { text-align: center; }
.question-answer-cell .question-edit-input { width: 100%; text-align: center; font-weight: 800; }
.question-category-cell .question-edit-select, .question-kp-cell .question-edit-select { width: 100%; min-width: 0; padding-left: 16px; padding-right: 22px; text-align: center; text-align-last: center; }
.question-category-edit-trigger { cursor: pointer; font-family: inherit; }
.question-category-edit-trigger:hover { border-color: var(--green); background: var(--green-light); color: var(--green); }
.question-category-edit-trigger:focus-visible { outline: 3px solid rgba(47,143,85,0.14); outline-offset: 2px; border-color: var(--green); }
.recognition-progress { width: 100%; min-width: 0; }
.recognition-progress-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 7px; color: var(--muted); font-size: 12px; font-weight: 900; line-height: 1; }
.recognition-progress.done .recognition-progress-head { color: var(--green); }
.recognition-progress.pending .recognition-progress-head { color: var(--orange); }
.recognition-check { width: 18px; height: 18px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; border: 1px solid var(--line); color: var(--muted); background: var(--panel-soft); font-size: 12px; font-weight: 950; }
.recognition-progress.done .recognition-check { background: var(--green); border-color: var(--green); color: white; }
.recognition-progress.pending .recognition-check { background: var(--orange-light); border-color: #f1c796; color: var(--orange); }
.recognition-track { height: 7px; border-radius: 999px; background: var(--line); overflow: hidden; }
.recognition-fill { height: 100%; width: var(--progress); border-radius: inherit; background: var(--green); transition: width 0.25s ease; }
.recognition-progress.pending .recognition-fill { background: var(--orange); }
.recognition-progress.running .recognition-fill { background: linear-gradient(90deg, var(--green), #7ecf9e); transition: width 0.45s ease; }
.import-progress { margin: 0 0 14px; padding: 13px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel-soft); }
.import-progress-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 13px; font-weight: 900; margin-bottom: 9px; }
.import-progress-status { color: var(--text); }
.import-progress-track { height: 9px; border-radius: 999px; background: var(--line); overflow: hidden; }
.import-progress-fill { height: 100%; width: var(--progress); border-radius: inherit; background: linear-gradient(90deg, var(--green), #7ecf9e); transition: width 0.35s ease; }
.import-progress.done .import-progress-status, .import-progress.done .import-progress-count { color: var(--green); }
.import-progress.done .import-progress-fill { background: var(--green); }
.import-progress.pending .import-progress-status, .import-progress.pending .import-progress-count { color: var(--orange); }
.import-progress.pending .import-progress-fill { background: var(--orange); }
.question-edit-textarea { width: 100%; min-width: 0; min-height: 54px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--text); font-size: 13px; line-height: 1.6; padding: 7px 8px; outline: none; resize: vertical; font-family: inherit; overflow: hidden; word-break: break-word; display: block; }
.question-edit-textarea:hover { border-color: var(--line); background: var(--panel-soft); }
.question-edit-textarea:focus { border-color: var(--green); background: var(--panel); box-shadow: 0 0 0 3px rgba(47,143,85,0.1); overflow: auto; }
.question-math-preview { width: 100%; min-height: 54px; border: 1px solid transparent; border-radius: 8px; color: var(--text); font-size: 13px; line-height: 1.75; padding: 7px 8px; word-break: break-word; cursor: text; }
.question-math-preview:hover { border-color: var(--line); background: var(--panel-soft); }
.question-math-preview.editing { display: none; }
.question-edit-textarea.is-hidden { display: none; }
.question-source-image-editor { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 8px; max-width: min(100%, 540px); margin: 8px 8px 0; padding: 8px; border: 1px dashed var(--line); border-radius: 8px; background: var(--panel-soft); }
.question-source-image-editor.empty { min-width: 150px; }
.question-source-image { display: inline-block; max-width: 100%; border: 1px solid var(--line); border-radius: 8px; background: white; overflow: hidden; }
.question-source-image img { display: block; max-width: 100%; height: auto; }
.question-source-placeholder { min-width: 120px; min-height: 44px; display: grid; place-items: center; border: 1px dashed var(--line); border-radius: 8px; background: white; color: var(--muted); font-size: 12px; font-weight: 800; }
.question-image-actions { display: flex; align-items: center; gap: 8px; }
.question-image-input { display: none; }
.question-pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-top: 14px; margin-top: 14px; border-top: 1px solid var(--line); }
.pagination-controls { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pagination-page { min-width: 34px; height: 34px; padding: 0 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel); color: var(--text); font-size: 13px; font-weight: 800; cursor: pointer; }
.pagination-page.active { background: var(--green); color: white; border-color: var(--green); }
.pagination-page:disabled { opacity: 0.45; cursor: not-allowed; }
.kp-picker { position: relative; display: inline-block; width: 158px; text-align: left; }
.kp-picker-btn { width: 100%; min-height: 36px; display: inline-flex; align-items: center; justify-content: space-between; gap: 6px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--text); font-size: 13px; line-height: 1.35; padding: 7px 10px; cursor: pointer; text-align: left; }
.kp-picker-btn:hover, .kp-picker.open .kp-picker-btn { border-color: var(--line); background: var(--panel-soft); }
.kp-picker-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.kp-picker-menu { position: absolute; left: 0; width: max(190px, 100%); top: calc(100% + 4px); z-index: 40; display: none; max-height: 220px; overflow-y: auto; padding: 6px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); box-shadow: var(--shadow); }
.kp-picker.open .kp-picker-menu { display: block; }
.kp-picker-option { width: 100%; border: none; background: transparent; color: var(--text); border-radius: 7px; padding: 8px 9px; text-align: left; font-size: 13px; line-height: 1.35; cursor: pointer; }
.kp-picker-option:hover { background: var(--green-light); color: var(--green); }
.kp-picker-option.active { background: var(--green-light); color: var(--green); font-weight: 800; }
.kp-picker-group { padding: 8px 9px 5px; color: var(--muted); font-size: 12px; font-weight: 900; position: sticky; top: -6px; background: var(--panel); }
.question-category-pill { display: inline-flex; align-items: center; justify-content: center; width: 100%; min-height: 34px; max-width: 100%; padding: 6px 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel-soft); color: var(--text); font-size: 12px; font-weight: 900; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.question-category-pill.pending { color: var(--orange); background: var(--orange-light); border-color: #f1c796; }
.filter-picker { position: relative; min-width: 200px; }
.filter-picker-btn { width: 100%; min-height: 42px; display: flex; align-items: center; justify-content: space-between; gap: 8px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); color: var(--text); font-size: 13px; font-weight: 800; line-height: 1.35; padding: 9px 12px; cursor: pointer; text-align: left; }
.filter-picker-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.filter-picker-menu { position: absolute; left: 0; right: 0; top: calc(100% + 5px); z-index: 50; display: none; max-height: 220px; overflow-y: auto; padding: 6px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); box-shadow: var(--shadow); }
.filter-picker.open .filter-picker-menu { display: block; }
.filter-picker-option { width: 100%; border: none; background: transparent; color: var(--text); border-radius: 8px; padding: 8px 9px; text-align: left; font-size: 13px; line-height: 1.35; cursor: pointer; }
.filter-picker-option:hover { background: var(--green-light); color: var(--green); }
.filter-picker-option.active { background: var(--green-light); color: var(--green); font-weight: 800; }
.question-action-cell { min-width: 56px; white-space: nowrap; text-align: center !important; }

/* Upload zone */
.upload-zone { border: 2px dashed var(--line); border-radius: var(--radius); padding: 40px; text-align: center; cursor: pointer; transition: all 0.15s; background: rgba(255, 253, 248, 0.75); }
.upload-zone:hover { border-color: var(--green); background: var(--green-light); transform: translateY(-1px); }
.upload-icon { font-size: 40px; margin-bottom: 12px; }
.upload-text { font-size: 15px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.upload-sub { font-size: 13px; color: var(--muted); }

/* Kanban */
.kanban { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.kanban-col { background: rgba(255, 253, 248, 0.5); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; min-height: 300px; }
.kanban-col-header { font-size: 13px; font-weight: 700; color: var(--muted); margin-bottom: 12px; display: flex; align-items: center; justify-content: space-between; }
.kanban-count { background: var(--line); color: var(--muted); border-radius: 20px; padding: 2px 8px; font-size: 12px; }
.kanban-card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin-bottom: 10px; box-shadow: 0 5px 15px rgba(61,43,31,0.04); }
.kanban-card-title { font-size: 13px; font-weight: 600; margin-bottom: 6px; line-height: 1.4; }
.kanban-card-meta { font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.kanban-card-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }

/* Fake chart */
.chart-bars { display: flex; align-items: flex-end; gap: 8px; height: 120px; padding: 0 4px; }
.chart-bar-wrap { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.chart-bar { width: 100%; background: var(--green); border-radius: 4px 4px 0 0; transition: height 0.3s; min-height: 4px; }
.chart-bar.orange { background: var(--orange); }
.chart-bar.red { background: var(--red); }
.chart-label { font-size: 11px; color: var(--muted); text-align: center; }
.chart-value { font-size: 12px; font-weight: 700; color: var(--text); }

/* Worksheet */
.worksheet { background: white; border: 1px solid #ddd; border-radius: 8px; padding: 32px; font-family: "SimSun", "宋体", serif; }
.worksheet-header { text-align: center; margin-bottom: 24px; border-bottom: 2px solid #333; padding-bottom: 16px; }
.worksheet-title { font-size: 20px; font-weight: 700; margin-bottom: 8px; }
.worksheet-info { font-size: 13px; color: #666; display: flex; justify-content: space-between; }
.worksheet-q { margin-bottom: 18px; }
.worksheet-q-num { font-weight: 700; margin-right: 6px; }
.worksheet-editable { display: inline; min-width: 80%; outline: none; border-bottom: 1px dashed transparent; padding: 2px 3px; line-height: 1.7; }
.worksheet-editable:focus { border-bottom-color: var(--green); background: var(--green-light); border-radius: 4px; }
.worksheet-meta-edit { outline: none; border: 1px dashed var(--line); border-radius: 8px; padding: 6px 8px; background: var(--panel); font-size: 12px; line-height: 1.5; margin: 6px 0 8px; }
.worksheet-source-image { margin: 8px 0 10px 28px; display: flex; justify-content: flex-end; }
.worksheet-source-image img { display: block; max-width: 260px; max-height: 150px; object-fit: contain; }
.worksheet-answer-space { height: 88px; }
.worksheet-q.long-answer .worksheet-answer-space,
.worksheet-q.has-image .worksheet-answer-space { height: 128px; }
.worksheet-tools { display: flex; justify-content: flex-end; gap: 6px; margin-bottom: 6px; }
.worksheet-tool-btn { border: 1px solid var(--line); background: var(--panel); color: var(--muted); border-radius: 8px; padding: 4px 8px; font-size: 12px; cursor: pointer; }
.worksheet-tool-btn:hover { border-color: var(--green); color: var(--green); }
.homework-preview-mode .edit-only, .homework-preview-mode .worksheet-meta-edit, .homework-preview-mode .hw-answer-line { display: none !important; }
.homework-mode-toggle { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--panel); }
.homework-mode-toggle button { border: none; background: transparent; padding: 7px 12px; cursor: pointer; font-size: 13px; font-weight: 700; color: var(--muted); }
.homework-mode-toggle button.active { background: var(--green-light); color: var(--green); }
.homework-record-list { display: flex; flex-direction: column; gap: 8px; }
.homework-record-item { border: 1px solid var(--line); border-radius: 12px; padding: 11px 12px; background: var(--panel); cursor: pointer; transition: all 0.15s; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.homework-record-item:hover { border-color: var(--green); background: var(--green-light); }
.homework-record-main { min-width: 0; flex: 1; }
.homework-record-title { font-size: 13px; font-weight: 800; margin-bottom: 4px; }
.homework-record-meta { font-size: 12px; color: var(--muted); }
.homework-record-delete { border: 1px solid #f3b8ae; background: var(--red-light); color: var(--red); border-radius: 8px; padding: 6px 9px; font-size: 12px; font-weight: 800; cursor: pointer; flex-shrink: 0; }
.homework-record-delete:hover { background: var(--red); color: white; border-color: var(--red); }
.homework-record-pagination { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.homework-page-info { font-size: 12px; color: var(--muted); font-weight: 800; }
.mistake-item { border: 2px solid var(--line); background: white; border-radius: 12px; padding: 13px 14px; margin-bottom: 10px; transition: all 0.15s; display: flex; align-items: center; gap: 12px; min-width: 0; max-width: 100%; }
.mistake-item.correct { border-color: #cdebd8; background: var(--green-light); }
.mistake-item.wrong { border-color: var(--red); background: var(--red-light); }
.mistake-edit { flex: 1 1 auto; min-width: 0; min-height: 40px; padding: 8px 10px; border: 1px dashed var(--line); border-radius: 10px; background: var(--panel); font-size: 14px; line-height: 1.55; outline: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mistake-edit * { max-width: 100%; }
.mistake-edit:focus { border-color: var(--green); background: var(--green-light); }
.mistake-actions { display: inline-flex; align-items: center; gap: 4px; flex-shrink: 0; padding: 4px; margin-top: 2px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel-soft); box-shadow: inset 0 1px 0 rgba(255,255,255,0.72); }
.mistake-mark-btn { width: 38px; height: 32px; border-radius: 10px; border: 1px solid transparent; background: transparent; display: inline-flex; align-items: center; justify-content: center; color: var(--muted); cursor: pointer; transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.15s, box-shadow 0.15s; }
.mistake-mark-btn svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 2.6; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.mistake-mark-btn:hover { background: var(--panel); transform: translateY(-1px); }
.mistake-mark-btn.correct:hover { color: var(--green); border-color: #cdebd8; }
.mistake-mark-btn.wrong:hover { color: var(--red); border-color: #f3b8ae; }
.mistake-mark-btn.correct.active { background: var(--green); border-color: var(--green); color: white; box-shadow: 0 6px 14px rgba(47,143,85,0.2); }
.mistake-mark-btn.wrong.active { background: var(--red); border-color: var(--red); color: white; box-shadow: 0 6px 14px rgba(192,57,43,0.18); }
.mistake-kp-list { display: grid; gap: 8px; }
.mistake-kp-row { display: grid; grid-template-columns: 82px 1fr auto auto; align-items: center; gap: 10px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255,255,255,0.72); }
.mistake-kp-category { font-size: 12px; font-weight: 800; color: var(--green); text-align: center; padding: 4px 7px; border: 1px solid #cdebd8; border-radius: 999px; background: var(--green-light); white-space: nowrap; }
.mistake-kp-category.pending { color: var(--orange); border-color: #f4c58f; background: #fff7ed; }
.mistake-kp-name { font-size: 13px; font-weight: 800; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mistake-kp-count { min-width: 50px; text-align: right; font-size: 13px; font-weight: 800; color: var(--red); }
.mistake-kp-badge { font-size: 11px; font-weight: 800; padding: 3px 7px; border-radius: 999px; background: var(--panel); color: var(--muted); border: 1px solid var(--line); }
.mistake-kp-badge.new { background: var(--red-light); color: var(--red); border-color: #f3b8ae; }
.mistake-review-list { display: grid; gap: 10px; }
.mistake-review-card { border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,0.74); padding: 12px; }
.mistake-review-question { font-size: 13px; line-height: 1.6; margin-bottom: 10px; color: var(--text); }
.mistake-review-grid { display: grid; grid-template-columns: minmax(78px, 96px) minmax(150px, 220px) 1fr; gap: 12px; align-items: start; }
.mistake-review-fixed { min-height: 38px; display: flex; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); color: var(--text); font-size: 13px; font-weight: 800; padding: 8px 10px; }
.mistake-review-fixed.pending { color: var(--orange); background: #fff7ed; border-color: #f4c58f; }
.mistake-review-select { width: 100%; min-height: 38px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); padding: 8px 10px; color: var(--text); font-size: 13px; font-weight: 700; }
.mistake-cause-checks { display: flex; flex-wrap: wrap; gap: 7px; }
.mistake-cause-check { display: inline-flex; align-items: center; gap: 5px; min-height: 30px; padding: 5px 9px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); font-size: 12px; font-weight: 700; color: var(--muted); cursor: pointer; }
.mistake-cause-check.active { background: var(--red-light); color: var(--red); border-color: #f3b8ae; }

/* Toast */
.toast { position: fixed; bottom: 28px; right: 28px; background: #333; color: white; padding: 12px 20px; border-radius: 10px; font-size: 14px; z-index: 9999; opacity: 0; transform: translateY(10px); transition: all 0.2s; pointer-events: none; }
.toast.show { opacity: 1; transform: translateY(0); }

/* Empty state */
.empty-state { text-align: center; padding: 48px 24px; color: var(--muted); border: 2px dashed var(--line); border-radius: var(--radius); }
.empty-icon { font-size: 36px; margin-bottom: 12px; }
.empty-text { font-size: 15px; }

/* Loading spinner */
.loading-wrap { display: flex; align-items: center; gap: 10px; padding: 16px; color: var(--muted); font-size: 14px; }
.spinner { width: 18px; height: 18px; border: 2px solid var(--line); border-top-color: var(--green); border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Misc */
.section-title { font-size: 16px; font-weight: 700; margin-bottom: 16px; color: var(--text); }
.divider { border: none; border-top: 1px solid var(--line); margin: 20px 0; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.mb-16 { margin-bottom: 16px; }
.mb-20 { margin-bottom: 20px; }
.mb-24 { margin-bottom: 24px; }
.text-muted { color: var(--muted); font-size: 13px; }
.text-sm { font-size: 13px; }
.font-bold { font-weight: 700; }
.w-full { width: 100%; }

/* Textarea */
textarea { width: 100%; padding: 12px; border: 1px solid var(--line); border-radius: 10px; font-size: 14px; font-family: inherit; background: var(--bg); color: var(--text); resize: vertical; outline: none; line-height: 1.6; }
textarea:focus { border-color: var(--green); }
select { padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px; background: var(--panel); color: var(--text); outline: none; cursor: pointer; }
select:focus { border-color: var(--green); }

/* Error cause tags */
.cause-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.cause-tag { padding: 6px 14px; border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer; border: 2px solid transparent; transition: all 0.15s; }
.cause-tag.calc { background: var(--blue-light); color: var(--blue); }
.cause-tag.read { background: var(--orange-light); color: var(--orange); }
.cause-tag.concept { background: #f3e8ff; color: #7c3aed; }
.cause-tag.model { background: var(--red-light); color: var(--red); }
.cause-tag.habit { background: #f0ece6; color: var(--muted); }
.cause-tag.selected { border-color: currentColor; }

/* Feedback status */
.feedback-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.feedback-row:last-child { border-bottom: none; }

/* Progress bar */
.progress-bar { height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 3px; background: var(--green); }
.progress-fill.orange { background: var(--orange); }
.progress-fill.red { background: var(--red); }

/* Donut chart */
.donut-card { min-height: 250px; }
.donut-wrap { display: flex; align-items: center; gap: 24px; }
.donut-chart { width: 126px; height: 126px; border-radius: 50%; position: relative; flex-shrink: 0; background: conic-gradient(var(--blue) 0deg 180deg, var(--green) 180deg 234deg, var(--orange) 234deg 277deg, var(--red) 277deg 328deg, #d8d2c5 328deg 360deg); }
.donut-chart::after { content: ""; position: absolute; inset: 31px; border-radius: 50%; background: var(--panel); box-shadow: inset 0 0 0 1px var(--line); }
.donut-legend { flex: 1; min-width: 0; }
.donut-row { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto auto; gap: 8px; align-items: center; font-size: 13px; padding: 5px 0; color: var(--muted); }
.donut-dot { width: 8px; height: 8px; border-radius: 2px; }
.donut-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.donut-percent { font-variant-numeric: tabular-nums; color: var(--muted); }
.donut-count { font-variant-numeric: tabular-nums; color: var(--muted); }
.dashboard-kpi { grid-template-columns: repeat(3, 1fr); }
.follow-table .table th { padding: 8px 10px; }
.follow-table .table td { padding: 10px; }
.todo-item { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; line-height: 1.55; padding: 7px 0; border-bottom: 1px solid var(--line); }
.todo-check { width: 14px; height: 14px; border: 1px solid var(--line); border-radius: 4px; background: white; flex-shrink: 0; margin-top: 3px; }

@media print {
  @page { margin: 0; }
  body {
    background: #fff !important;
  }
  body * {
    visibility: hidden !important;
  }
  #worksheet-print,
  #worksheet-print * {
    visibility: visible !important;
  }
  #worksheet-print {
    position: absolute !important;
    inset: 0 auto auto 0 !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 14mm !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background: #fff !important;
  }
  #worksheet-print .no-print,
  #worksheet-print .no-print *,
  #worksheet-print .edit-only,
  #worksheet-print .edit-only *,
  #worksheet-print .worksheet-tools,
  #worksheet-print .worksheet-tools *,
  #worksheet-print .worksheet-meta-edit,
  #worksheet-print .worksheet-meta-edit *,
  #worksheet-print .hw-answer-line,
  #worksheet-print .hw-answer-line * {
    display: none !important;
    visibility: hidden !important;
  }
  .worksheet {
    break-inside: auto;
  }
  .worksheet-q {
    break-inside: avoid;
  }
}

/* Knowledge Map */
.km-layout { display: grid; grid-template-columns: 260px 1fr; gap: 20px; }
.km-sidebar { display: flex; flex-direction: column; gap: 10px; }
.km-student-card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; cursor: pointer; transition: all 0.15s; }
.km-student-card:hover { border-color: var(--green); }
.km-student-card.active { border-color: var(--green); background: var(--green-light); }
.km-student-name { font-size: 14px; font-weight: 700; margin-bottom: 6px; }
.km-student-weak { display: flex; flex-wrap: wrap; gap: 4px; }

.km-main { }
.km-domain { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 16px; overflow: hidden; }
.km-domain-header { display: flex; align-items: center; gap: 10px; padding: 14px 18px; cursor: pointer; user-select: none; }
.km-domain-icon { font-size: 20px; }
.km-domain-label { font-size: 16px; font-weight: 700; flex: 1; }
.km-domain-stats { font-size: 12px; color: var(--muted); }
.km-domain-toggle { font-size: 12px; color: var(--muted); transition: transform 0.2s; }
.km-domain-toggle.open { transform: rotate(90deg); }
.km-domain-body { padding: 0 18px 16px; display: none; }
.km-domain-body.open { display: block; }

.km-category { margin-bottom: 14px; }
.km-category-label { font-size: 13px; font-weight: 700; color: var(--muted); margin-bottom: 8px; padding-left: 4px; }
.km-nodes { display: flex; flex-wrap: wrap; gap: 8px; }
.km-node { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 10px; font-size: 13px; font-weight: 600; cursor: pointer; border: 2px solid transparent; transition: all 0.15s; position: relative; }
.km-node.mastered { background: var(--green-light); color: var(--green); border-color: var(--green); }
.km-node.weak { background: var(--red-light); color: var(--red); border-color: var(--red); }
.km-node.partial { background: var(--orange-light); color: var(--orange); border-color: var(--orange); }
.km-node.untested { background: #f0ece6; color: var(--muted); border-color: var(--line); }
.km-node.selected { box-shadow: 0 0 0 3px rgba(47, 143, 85, 0.16); border-color: var(--green); }
.km-node:hover { filter: brightness(0.95); }
.km-node-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.km-node-count { font-size: 11px; opacity: 0.8; }

.km-legend { display: flex; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.km-legend-item { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.km-legend-dot { width: 10px; height: 10px; border-radius: 3px; }

.km-node-tooltip { position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%); background: #333; color: white; font-size: 12px; padding: 6px 10px; border-radius: 6px; white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity 0.15s; z-index: 100; }
.km-node:hover .km-node-tooltip { opacity: 1; }

.km-action-bar { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; padding: 14px 18px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-soft); }
.km-summary { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.km-summary-node { display: inline-flex; align-items: center; gap: 7px; padding: 8px 11px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel-soft); color: var(--text); cursor: pointer; font-size: 13px; font-weight: 700; transition: all 0.15s; }
.km-summary-node:hover { border-color: var(--green); transform: translateY(-1px); }
.km-summary-node.active { background: var(--green-light); border-color: var(--green); color: var(--green); }
.km-summary-status { font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 999px; background: #f0ece6; color: var(--muted); }
.km-summary-status.weak { background: var(--red-light); color: var(--red); }
.km-summary-status.partial { background: var(--orange-light); color: var(--orange); }
.km-summary-status.mastered { background: var(--green-light); color: var(--green); }
.km-full-map { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.km-focus-panel { margin-top: 14px; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel-soft); }
.km-focus-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 12px; }
.km-focus-title { font-size: 16px; font-weight: 800; margin-bottom: 4px; }
.km-focus-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.km-focus-box { background: rgba(255, 253, 248, 0.82); border: 1px solid var(--line); border-radius: 12px; padding: 12px; min-width: 0; }
.km-focus-list { margin: 0; padding-left: 18px; font-size: 13px; line-height: 1.65; color: var(--text); }
.km-focus-list li { margin-bottom: 4px; }

@media (max-width: 1180px) {
  .kpi-grid, .grid-3, .kanban { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .library-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2, .student-layout, .km-layout, .homework-generate-layout { grid-template-columns: 1fr; }
  .student-overview-body, .sediment-grid, .sediment-compact-grid { grid-template-columns: 1fr; }
  .km-focus-grid { grid-template-columns: 1fr; }
}

@media (max-width: 1320px) {
  .sediment-compact-grid { grid-template-columns: 1fr; }
}

@media (max-width: 980px) {
  .sediment-metrics { grid-template-columns: 1fr !important; }
  .student-weak-left-stack { min-height: auto; }
}

@media (max-width: 760px) {
  .landing-page { padding: 20px; }
  .landing-shell { min-height: calc(100vh - 40px); gap: 28px; }
  .landing-top { align-items: flex-start; }
  .landing-main { padding: 52px 0 28px; }
  .landing-copy { font-size: 15px; }
  .landing-foot { grid-template-columns: 1fr; }
  .auth-showcase { height: auto; min-height: auto; grid-template-columns: 1fr; border-radius: 18px; }
  .auth-visual { display: none; }
  .auth-form-wrap { padding: 28px 20px; overflow-y: visible; }
  .auth-form { min-height: 0; padding: 0; }
  .auth-form-title { font-size: 24px; }
  .app { display: block; }
  .app.is-hidden { display: none; }
  .sidebar { position: static; width: 100%; min-height: auto; height: auto; border-right: none; border-bottom: 1px solid var(--line); }
  .sidebar-nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; }
  .sidebar-footer { display: none; }
  .topbar { padding: 12px 16px; }
  .content { padding: 16px; }
  .kpi-grid, .grid-3, .grid-2, .kanban { grid-template-columns: 1fr; }
  .library-stats { grid-template-columns: 1fr; }
  .student-summary-head { flex-direction: column; }
  .student-actions { width: 100%; justify-content: flex-start; }
}
