:root{--bg: #fafafa;--surface: #ffffff;--surface-hover: #f3f3f5;--surface-subtle: #f1f1f4;--border: #e5e5e8;--border-strong: #d4d4da;--text: #141417;--text-muted: #666671;--text-faint: #8f8f9b;--accent: #b91c1c;--accent-hover: #991b1b;--accent-soft: rgba(185, 28, 28, .09);--accent-text: #b91c1c;--link-soft: rgba(37, 99, 235, .1);--link-text: #1d4ed8;--folder-soft: rgba(217, 119, 6, .12);--folder-text: #b45309;--danger: #dc2626;--danger-soft: rgba(220, 38, 38, .09);--radius: 10px;--radius-sm: 7px;--font-sans: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, sans-serif;--font-mono: ui-monospace, "SFMono-Regular", "JetBrains Mono", Menlo, Consolas, monospace;color-scheme:light}@media(prefers-color-scheme:dark){:root:not([data-theme=light]){--bg: #111113;--surface: #18181b;--surface-hover: #212126;--surface-subtle: #1e1e23;--border: #27272d;--border-strong: #36363f;--text: #f1f1f4;--text-muted: #9898a6;--text-faint: #6c6c79;--accent: #dc2626;--accent-hover: #ef4444;--accent-soft: rgba(239, 68, 68, .16);--accent-text: #f87171;--link-soft: rgba(96, 165, 250, .15);--link-text: #60a5fa;--folder-soft: rgba(251, 191, 36, .14);--folder-text: #fbbf24;--danger: #f87171;--danger-soft: rgba(248, 113, 113, .14);color-scheme:dark}}:root[data-theme=dark]{--bg: #111113;--surface: #18181b;--surface-hover: #212126;--surface-subtle: #1e1e23;--border: #27272d;--border-strong: #36363f;--text: #f1f1f4;--text-muted: #9898a6;--text-faint: #6c6c79;--accent: #dc2626;--accent-hover: #ef4444;--accent-soft: rgba(239, 68, 68, .16);--accent-text: #f87171;--link-soft: rgba(96, 165, 250, .15);--link-text: #60a5fa;--folder-soft: rgba(251, 191, 36, .14);--folder-text: #fbbf24;--danger: #f87171;--danger-soft: rgba(248, 113, 113, .14);color-scheme:dark}*,*:before,*:after{box-sizing:border-box}html,body{margin:0;padding:0;background:var(--bg);color:var(--text);font-family:var(--font-sans);font-size:15px;line-height:1.45;-webkit-font-smoothing:antialiased;-webkit-tap-highlight-color:transparent}a{color:inherit;text-decoration:none}button,input{font:inherit;color:inherit}button{cursor:pointer}.shell{max-width:720px;margin:0 auto;padding:max(14px,env(safe-area-inset-top)) 16px max(48px,env(safe-area-inset-bottom))}.topbar{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:14px}.course-topbar{position:sticky;top:0;z-index:20;background:var(--bg);padding:10px 0 12px;margin:-10px 0 6px}.topbar-left{display:flex;align-items:center;gap:10px;min-width:0}.topbar-title{font-size:17px;font-weight:650;letter-spacing:-.02em}.sync-label{font-size:12px;color:var(--text-faint);white-space:nowrap}.topbar-actions{display:flex;align-items:center;gap:6px;flex-shrink:0}.brand-mark{display:inline-flex;align-items:center;justify-content:center;width:38px;height:38px;border-radius:10px;background:var(--accent);color:#fff;font-weight:750;font-size:19px;letter-spacing:-.04em;flex-shrink:0}.brand-mark.small{width:26px;height:26px;border-radius:7px;font-size:13px}.course-title-wrap{flex:1;min-width:0}.course-heading{min-width:0}.course-heading h1{margin:0;font-size:17px;font-weight:650;letter-spacing:-.02em;line-height:1.25;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}.course-sub{display:block;font-size:12px;color:var(--text-muted);font-family:var(--font-mono);margin-top:2px}.icon-btn{display:inline-flex;align-items:center;justify-content:center;width:34px;height:34px;border-radius:var(--radius-sm);border:1px solid transparent;background:transparent;color:var(--text-muted);transition:background .12s ease,color .12s ease}.icon-btn:hover{background:var(--surface-hover);color:var(--text)}.icon-btn.active-accent{color:var(--accent-text);background:var(--accent-soft)}.back-btn{margin-left:-6px;color:var(--text)}.chip-btn{display:inline-flex;align-items:center;gap:5px;height:32px;padding:0 11px;border-radius:var(--radius-sm);border:1px solid var(--border);background:var(--surface);color:var(--text-muted);font-size:13px;font-weight:500;transition:background .12s ease,color .12s ease,border-color .12s ease}.chip-btn:hover{background:var(--surface-hover);color:var(--text)}.chip-btn.active{background:var(--accent-soft);border-color:transparent;color:var(--accent-text)}.spinning svg{animation:spin .8s linear infinite}@keyframes spin{to{transform:rotate(360deg)}}.search-wrap{position:relative;display:flex;align-items:center;margin-bottom:16px}.search-wrap.compact{flex:1;margin-bottom:0}.search-icon{position:absolute;left:12px;color:var(--text-faint);pointer-events:none}.search-input{width:100%;height:42px;padding:0 36px 0 38px;border-radius:var(--radius);border:1px solid var(--border);background:var(--surface);font-size:15px;outline:none;transition:border-color .12s ease,box-shadow .12s ease}.search-wrap.compact .search-input{height:38px;font-size:14px}.search-input::placeholder{color:var(--text-faint)}.search-input:focus{border-color:var(--border-strong);box-shadow:0 0 0 3px var(--accent-soft)}.search-input::-webkit-search-cancel-button{display:none}.search-clear{position:absolute;right:8px;display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;border:none;border-radius:6px;background:var(--surface-subtle);color:var(--text-muted)}.search-clear:hover{color:var(--text)}.kbd-hint{position:absolute;right:11px;padding:1px 6px;border-radius:5px;border:1px solid var(--border);background:var(--surface-subtle);color:var(--text-faint);font-family:var(--font-mono);font-size:11px;pointer-events:none}@media(pointer:coarse){.kbd-hint{display:none}}.course-toolbar{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin-bottom:18px}.segmented{display:inline-flex;padding:3px;border-radius:var(--radius-sm);background:var(--surface-subtle);border:1px solid var(--border);gap:2px}.segmented.full{display:flex;width:100%}.segmented.full button{flex:1}.segmented button{height:30px;padding:0 11px;border:none;border-radius:5px;background:transparent;color:var(--text-muted);font-size:13px;font-weight:500;white-space:nowrap;transition:background .12s ease,color .12s ease}.segmented button.active{background:var(--surface);color:var(--text);box-shadow:0 1px 2px #0000000f}.content-stack,.sections-stack{display:flex;flex-direction:column;gap:18px}.group-header{font-size:12px;font-weight:600;text-transform:uppercase;letter-spacing:.04em;color:var(--text-faint);margin:0 0 6px 2px}.muted-inline{text-transform:none;font-weight:400;letter-spacing:0}.list{display:flex;flex-direction:column;background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);overflow:hidden}.list-muted{opacity:.82}.row{display:flex;align-items:center;min-height:48px;border-bottom:1px solid var(--border);transition:background .1s ease}.row:last-child{border-bottom:none}.row:hover,.row.highlighted{background:var(--surface-hover)}.row.highlighted{box-shadow:inset 3px 0 0 var(--accent)}.row-main{flex:1;min-width:0;display:flex;align-items:center;gap:11px;padding:11px 14px;text-align:left}.row-btn{border:none;background:transparent;width:100%;text-align:left}.row-text{display:flex;flex-direction:column;min-width:0;gap:1px}.row-title{font-size:14.5px;font-weight:500;color:var(--text);overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;word-break:break-word}.row-meta{font-size:12px;color:var(--text-muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mono-meta{font-family:var(--font-mono);font-size:11.5px}.row-action{margin-right:8px;flex-shrink:0}.row-controls{display:flex;align-items:center;gap:2px;padding-right:8px}.row-chevron{display:inline-flex;color:var(--text-faint);padding-right:12px}.pin-dot{display:inline-block;width:6px;height:6px;border-radius:50%;background:var(--accent);margin-right:7px;vertical-align:middle;transform:translateY(-1px)}.badge{display:inline-flex;align-items:center;justify-content:center;min-width:38px;height:24px;padding:0 6px;border-radius:6px;font-family:var(--font-mono);font-size:10.5px;font-weight:700;letter-spacing:.02em;flex-shrink:0}.badge-pdf{background:var(--accent-soft);color:var(--accent-text)}.badge-file{background:var(--surface-subtle);color:var(--text-muted)}.badge-link{background:var(--link-soft);color:var(--link-text)}.badge-folder{background:var(--folder-soft);color:var(--folder-text)}.badge-page,.badge-activity{background:var(--surface-subtle);color:var(--text-muted)}.course-section{display:flex;flex-direction:column;gap:6px}.section-header{display:flex;align-items:center;gap:7px;padding:4px 2px;border:none;background:transparent;color:var(--text-muted);text-align:left}.section-header:hover{color:var(--text)}.section-title{font-size:13px;font-weight:600;letter-spacing:-.01em}.section-count{font-size:11.5px;font-family:var(--font-mono);color:var(--text-faint)}.chevron{transition:transform .14s ease;flex-shrink:0}.chevron.rotated{transform:rotate(90deg)}.folder-block,.activity-block{border-bottom:1px solid var(--border)}.folder-block:last-child,.activity-block:last-child{border-bottom:none}.folder-header{padding:11px 14px;gap:11px;border-bottom:none}.folder-chevron{margin-left:auto;color:var(--text-faint)}.folder-children{border-top:1px solid var(--border);background:var(--bg);padding-left:16px}.folder-children .row{background:transparent}.folder-children .row:hover{background:var(--surface-hover)}.other-courses{display:flex;flex-direction:column;gap:8px}.toggle-other-btn{display:inline-flex;align-items:center;gap:6px;align-self:flex-start;padding:6px 4px;border:none;background:transparent;color:var(--text-muted);font-size:13px;font-weight:500}.toggle-other-btn:hover{color:var(--text)}.login-shell{min-height:100dvh;display:flex;align-items:center;justify-content:center;padding:20px 16px}.login-card{width:100%;max-width:370px;background:var(--surface);border:1px solid var(--border);border-radius:14px;padding:26px 24px 22px}.login-brand{display:flex;align-items:center;gap:12px;margin-bottom:22px}.login-brand h1{margin:0;font-size:18px;font-weight:650;letter-spacing:-.02em}.muted{margin:0;font-size:13px;color:var(--text-muted)}.login-form{display:flex;flex-direction:column;gap:14px}.field{display:flex;flex-direction:column;gap:5px}.field span{font-size:13px;font-weight:500;color:var(--text-muted)}.field input{height:42px;padding:0 12px;border-radius:var(--radius-sm);border:1px solid var(--border);background:var(--bg);outline:none;transition:border-color .12s ease,box-shadow .12s ease}.field input:focus{border-color:var(--border-strong);box-shadow:0 0 0 3px var(--accent-soft)}.field-hint{font-size:12px!important;font-weight:400!important;color:var(--text-faint)!important}.field-hint a{color:var(--accent-text);text-decoration:underline}.btn-primary{display:inline-flex;align-items:center;justify-content:center;height:42px;padding:0 16px;border:none;border-radius:var(--radius-sm);background:var(--accent);color:#fff;font-weight:600;font-size:14.5px;transition:background .12s ease,opacity .12s ease}.btn-primary:hover{background:var(--accent-hover)}.btn-primary:disabled{opacity:.6;cursor:default}.btn-secondary,.btn-danger{display:inline-flex;align-items:center;justify-content:center;gap:6px;width:100%;height:40px;padding:0 14px;border-radius:var(--radius-sm);font-size:14px;font-weight:500}.btn-secondary{border:1px solid var(--border);background:var(--surface);color:var(--text)}.btn-secondary:hover{background:var(--surface-hover)}.btn-danger{border:1px solid transparent;background:var(--danger-soft);color:var(--danger)}.link-btn{border:none;background:transparent;padding:0;color:var(--accent-text);font-size:13px;font-weight:500}.link-btn:hover{text-decoration:underline}.login-footer{margin-top:18px;padding-top:16px;border-top:1px solid var(--border);display:flex;flex-direction:column;align-items:flex-start;gap:10px}.login-note{margin:0;font-size:12px;color:var(--text-faint);line-height:1.45}.alert-error{padding:10px 12px;border-radius:var(--radius-sm);background:var(--danger-soft);color:var(--danger);font-size:13.5px;margin-bottom:12px}.empty-state{padding:40px 16px;text-align:center;color:var(--text-muted);display:flex;flex-direction:column;align-items:center;gap:8px}.empty-state p{margin:0}.skeleton-list{display:flex;flex-direction:column;gap:10px}.skeleton-row{height:54px;border-radius:var(--radius);background:var(--surface);border:1px solid var(--border);animation:pulse 1.2s ease-in-out infinite}@keyframes pulse{0%,to{opacity:.9}50%{opacity:.45}}.modal-backdrop{position:fixed;inset:0;z-index:50;background:#00000080;display:flex;align-items:center;justify-content:center;padding:16px;backdrop-filter:blur(2px)}.modal-card{width:100%;max-width:440px;max-height:86dvh;display:flex;flex-direction:column;background:var(--surface);border:1px solid var(--border);border-radius:14px;overflow:hidden}.modal-card.modal-wide{max-width:680px}.modal-header{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;padding:16px 18px;border-bottom:1px solid var(--border)}.modal-header h2{margin:0;font-size:16px;font-weight:650}.modal-body{padding:18px;overflow-y:auto;display:flex;flex-direction:column;gap:18px}.setting-group{display:flex;flex-direction:column;gap:8px}.setting-label{font-size:12px;font-weight:600;text-transform:uppercase;letter-spacing:.04em;color:var(--text-faint)}.radio-stack{display:flex;flex-direction:column;gap:6px}.radio-option{display:flex;flex-direction:column;align-items:flex-start;gap:2px;padding:10px 12px;border-radius:var(--radius-sm);border:1px solid var(--border);background:var(--bg);text-align:left;transition:border-color .12s ease,background .12s ease}.radio-option strong{font-size:13.5px;font-weight:600}.radio-option span{font-size:12px;color:var(--text-muted)}.radio-option.active{border-color:var(--accent);background:var(--accent-soft)}.setting-actions{display:flex;flex-direction:column;gap:8px;padding-top:6px;border-top:1px solid var(--border)}.prose{font-size:14.5px;line-height:1.6;word-break:break-word}.prose a{color:var(--link-text);text-decoration:underline}.prose img{max-width:100%;height:auto;border-radius:6px}.prose pre,.prose code{font-family:var(--font-mono);font-size:13px;background:var(--surface-subtle);border-radius:5px}.prose pre{padding:10px 12px;overflow-x:auto}@media(max-width:560px){.shell{padding-left:12px;padding-right:12px}.course-toolbar{flex-direction:column;align-items:stretch}.segmented{display:flex;width:100%}.segmented button{flex:1}}
