:root{
  --bg:#f6f7fb;
  --surface:#ffffff;
  --surface-2:#f3f4fa;
  --surface-3:#eceefa;
  --ink:#171922;
  --muted:#727786;
  --line:#e4e7ef;
  --accent:#6d5dfc;
  --accent-2:#eeecff;
  --accent-3:#dcd7ff;
  --green:#2b9a68;
  --green-bg:#ebf8f2;
  --red:#d94f5c;
  --red-bg:#fff0f2;
  --amber:#c6821f;
  --amber-bg:#fff6e8;
  --blue:#3777db;
  --blue-bg:#eef5ff;
  --shadow:0 18px 45px rgba(27,31,55,.08);
  --radius:18px;
  --radius-sm:12px;
  --sidebar:226px;
  --hand:"Kaiti TC","DFKai-SB","STKaiti",serif;
}
*{box-sizing:border-box}
html,body{margin:0;min-height:100%;background:var(--bg);color:var(--ink);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans TC","PingFang TC",sans-serif}
body{font-size:15px}
button,input,textarea,select{font:inherit}
button{color:inherit}
button:focus-visible,input:focus-visible,textarea:focus-visible,select:focus-visible{outline:3px solid rgba(109,93,252,.2);outline-offset:2px}
.hidden-input{display:none}
.app-shell{min-height:100vh;display:grid;grid-template-columns:var(--sidebar) 1fr}
.sidebar{position:sticky;top:0;height:100vh;background:#fbfbfd;border-right:1px solid var(--line);padding:18px 13px;display:flex;flex-direction:column;z-index:30}
.brand{display:flex;align-items:center;gap:10px;padding:3px 8px 18px}
.brand-mark{width:36px;height:36px;border-radius:13px;background:linear-gradient(145deg,#7c6dff,#5b4de9);display:grid;place-items:center;color:#fff;font-weight:900;box-shadow:0 9px 22px rgba(109,93,252,.26)}
.brand h1{font-size:18px;line-height:1.15;margin:0}
.brand small{font-size:11px;color:var(--muted)}
.capture-btn{margin:0 2px 18px;border:0;background:var(--accent);color:#fff;border-radius:12px;padding:12px 14px;font-weight:800;cursor:pointer;box-shadow:0 9px 24px rgba(109,93,252,.24)}
.nav{display:grid;gap:3px;overflow:auto;padding-bottom:6px}
.nav-btn{border:0;background:transparent;border-radius:11px;padding:10px 11px;display:flex;align-items:center;gap:10px;cursor:pointer;text-align:left;color:#444957}
.nav-btn svg{width:18px;height:18px}
.nav-btn:hover{background:#f2f1fc}
.nav-btn.active{background:var(--accent-2);color:#5145d3;font-weight:750}
.sidebar-section-title{font-size:10px;letter-spacing:.12em;text-transform:uppercase;color:#a0a4b0;padding:15px 10px 6px}
.sidebar-subjects{display:grid;gap:2px}
.subject-mini{border:0;background:transparent;border-radius:9px;padding:8px 9px;display:grid;grid-template-columns:24px 1fr auto;align-items:center;gap:7px;text-align:left;cursor:pointer;color:#515664}
.subject-mini:hover{background:#f5f4fc}
.subject-mini.active{background:#f0efff;color:#5345d7}
.subject-mini .dot{width:22px;height:22px;border-radius:7px;display:grid;place-items:center;font-size:12px;font-weight:800;background:var(--subject-bg,#f2f3f7);color:var(--subject-color,#535866)}
.subject-mini .count{font-size:11px;color:var(--muted)}
.profile-card{margin-top:auto;border:1px solid var(--line);background:#fff;border-radius:14px;padding:11px}
.profile-row{display:flex;align-items:center;gap:9px}
.avatar{width:34px;height:34px;border-radius:50%;background:#1f2330;color:#fff;display:grid;place-items:center;font-weight:800}
.profile-card strong{font-size:13px}
.profile-card small{display:block;font-size:11px;color:var(--muted);margin-top:2px}
.profile-streak{margin-top:9px;color:#5c50d4;font-size:12px;font-weight:750}
.main{min-width:0}
.topbar{height:68px;background:rgba(255,255,255,.88);backdrop-filter:blur(18px);border-bottom:1px solid var(--line);position:sticky;top:0;z-index:20;display:flex;align-items:center;justify-content:space-between;padding:0 26px}
.topbar-left{display:flex;align-items:center;gap:12px;min-width:0}.crumb{font-size:13px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.topbar-actions{display:flex;align-items:center;gap:8px}
.icon-btn,.ghost-btn,.soft-btn,.primary-btn,.danger-btn,.text-btn{border:1px solid var(--line);background:#fff;border-radius:10px;padding:9px 12px;cursor:pointer;display:inline-flex;align-items:center;justify-content:center;gap:7px;min-height:38px}
.icon-btn{width:38px;padding:0}.icon-btn svg,.ghost-btn svg,.soft-btn svg,.primary-btn svg{width:17px;height:17px}
.soft-btn{background:var(--surface-2);border-color:transparent}.primary-btn{background:var(--accent);border-color:var(--accent);color:#fff;font-weight:800}.danger-btn{background:var(--red-bg);border-color:#ffd3d8;color:var(--red)}.text-btn{border:0;background:transparent;color:var(--accent);padding:6px 8px}.ghost-btn:hover,.soft-btn:hover,.icon-btn:hover{background:#f5f5fb}
.mobile-menu-btn{display:none}
.content{max-width:1540px;margin:0 auto;padding:24px 28px 72px}
.page-head{display:flex;align-items:flex-end;justify-content:space-between;gap:16px;margin-bottom:18px}.page-head h2{font-size:25px;margin:0 0 4px}.page-head p{margin:0;color:var(--muted);line-height:1.55}.page-actions{display:flex;gap:8px;flex-wrap:wrap}
.ai-status{display:inline-flex;align-items:center;gap:7px;font-size:12px;color:var(--muted)}.ai-dot{width:8px;height:8px;border-radius:50%;background:var(--green);box-shadow:0 0 0 4px var(--green-bg)}.ai-dot.loading{background:var(--amber);box-shadow:0 0 0 4px var(--amber-bg);animation:pulse 1s infinite}
.panel{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);box-shadow:0 1px 0 rgba(0,0,0,.01)}
.panel-head{padding:14px 16px;border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;gap:12px}.panel-head h3{font-size:14px;margin:0}.meta{font-size:12px;color:var(--muted)}
.stack{display:grid;gap:16px}.grid-2{display:grid;grid-template-columns:1fr 1fr;gap:16px}.grid-3{display:grid;grid-template-columns:repeat(3,1fr);gap:16px}.grid-4{display:grid;grid-template-columns:repeat(4,1fr);gap:14px}
.hero-grid{display:grid;grid-template-columns:minmax(0,1.4fr) minmax(320px,.6fr);gap:16px}.workspace-grid{display:grid;grid-template-columns:minmax(520px,1.55fr) minmax(320px,.85fr);gap:16px}.split-grid{display:grid;grid-template-columns:280px minmax(0,1fr);gap:16px}
.stat-strip{display:grid;grid-template-columns:repeat(4,1fr);gap:10px;padding:14px}.stat-card{background:var(--surface-2);border-radius:13px;padding:13px 14px}.stat-card strong{font-size:22px;display:block}.stat-card span{font-size:11px;color:var(--muted);margin-top:2px;display:block}
.subject-tabs{display:flex;gap:8px;overflow:auto;padding-bottom:4px;scrollbar-width:none}.subject-tabs::-webkit-scrollbar{display:none}.subject-tab{border:1px solid var(--line);background:#fff;border-radius:11px;padding:9px 12px;white-space:nowrap;cursor:pointer;display:flex;align-items:center;gap:8px}.subject-tab.active{border-color:#b6aefc;background:var(--accent-2);color:#5144d2;font-weight:800}.subject-tab .subject-symbol{width:24px;height:24px;border-radius:8px;background:var(--subject-bg);color:var(--subject-color);display:grid;place-items:center;font-size:12px;font-weight:900}
.subject-grid{display:grid;grid-template-columns:repeat(5,1fr);gap:12px}.subject-card{border:1px solid var(--line);background:#fff;border-radius:14px;padding:14px;cursor:pointer;text-align:left;transition:.18s ease}.subject-card:hover{transform:translateY(-2px);box-shadow:0 10px 25px rgba(30,35,60,.08)}.subject-card.active{border-color:#b7affe;background:#fbfaff}.subject-card-top{display:flex;justify-content:space-between;gap:10px;align-items:center}.subject-badge{width:34px;height:34px;border-radius:11px;background:var(--subject-bg);color:var(--subject-color);display:grid;place-items:center;font-weight:900}.subject-card strong{font-size:15px}.subject-card .progress{height:6px;background:#eceef3;border-radius:99px;overflow:hidden;margin-top:12px}.subject-card .progress span{display:block;height:100%;background:var(--subject-color);border-radius:99px}.subject-card small{display:block;color:var(--muted);margin-top:7px}
.section-title{display:flex;align-items:center;justify-content:space-between;margin:3px 0 10px}.section-title h3{font-size:15px;margin:0}.section-title small{color:var(--muted)}
.list{display:grid}.list-row{display:grid;grid-template-columns:42px 1fr auto;gap:10px;align-items:center;padding:12px 15px;border-top:1px solid var(--line);cursor:pointer}.list-row:first-child{border-top:0}.list-row:hover{background:#fbfbfe}.list-row .subject-icon{width:38px;height:38px;border-radius:11px;background:var(--subject-bg);color:var(--subject-color);display:grid;place-items:center;font-weight:850}.list-row strong{font-size:13px}.list-row small{display:block;color:var(--muted);font-size:11px;margin-top:3px}.due{font-size:11px;color:#5e53cf;background:var(--accent-2);padding:5px 7px;border-radius:8px;white-space:nowrap}.due.red{color:var(--red);background:var(--red-bg)}.due.green{color:var(--green);background:var(--green-bg)}
.weakness-bars{padding:8px 15px 14px}.bar-row{display:grid;grid-template-columns:115px 1fr 42px;gap:9px;align-items:center;margin:11px 0;font-size:12px}.bar{height:7px;background:#eceef3;border-radius:99px;overflow:hidden}.bar span{height:100%;display:block;background:var(--subject-color,var(--accent));border-radius:99px}
.callout{padding:13px 14px;border-radius:12px;background:#f2f0ff;color:#5145bb;line-height:1.6;font-size:13px}.callout.success{background:var(--green-bg);color:#257d57}.callout.warn{background:var(--amber-bg);color:#9d6416}.callout.danger{background:var(--red-bg);color:var(--red)}
