/* 学生端：在 kit.css 之上的页面样式。工作区是整屏 IDE 布局，其它页面用 kit 的侧栏外壳。 */

/* ---------- 登录 ---------- */
.s-login{min-height:100vh;display:grid;place-items:center;padding:24px}
.s-login-box{width:min(400px,100%);display:flex;flex-direction:column;gap:18px;padding:30px 30px 26px;
  background:var(--surface);border:1px solid var(--line);border-radius:20px;box-shadow:var(--shadow)}
.s-login-box h1{font-size:22px}
.s-login-box .lead{color:var(--muted);font-size:13.5px;margin-top:6px}
.s-login-box form{display:flex;flex-direction:column;gap:14px}
.s-login-box .btn.primary{height:38px;justify-content:center}
.s-login-msg{min-height:20px;font-size:13px;color:var(--bad-ink)}
.s-login-foot{font-size:12.5px;color:var(--muted);border-top:1px solid var(--line);padding-top:14px}

/* ---------- 通用页面 ---------- */
.s-cols{display:grid;grid-template-columns:minmax(0,1fr) 340px;gap:20px;align-items:start}
.s-aside{display:flex;flex-direction:column;gap:20px;min-width:0}
.s-row-main{flex:1 1 auto;min-width:0;display:flex;flex-direction:column;gap:3px}
.s-row-main .title{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.s-row-side{display:flex;align-items:center;gap:12px;flex:none;color:var(--muted);font-size:12.5px}
.s-due{font-variant-numeric:tabular-nums;white-space:nowrap}
.s-due.soon{color:var(--warn-ink)}
.s-due.late{color:var(--bad-ink)}
.s-cmd{font-family:var(--mono);font-size:12.5px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}
.s-dev{font-size:12px;color:var(--muted);white-space:nowrap}
.s-num{font-variant-numeric:tabular-nums}
.s-meter{display:flex;flex-direction:column;gap:6px}
.s-meter .row{justify-content:space-between;font-size:13px}
.s-meter b{font-weight:600;font-variant-numeric:tabular-nums}
.s-loading{padding:40px 0;text-align:center;color:var(--muted)}
.s-error{padding:28px 0;text-align:center;color:var(--bad-ink)}
.s-section-title{font-size:13px;font-weight:600;color:var(--muted);margin-bottom:8px}

/* 首页的问候和今日数字：一行小字，不做卡片 */
.s-strip{display:flex;gap:28px;flex-wrap:wrap;font-size:13px;color:var(--muted)}
.s-strip b{display:block;font-size:20px;font-weight:600;color:var(--text);font-variant-numeric:tabular-nums;line-height:1.2}

/* ---------- 作业详情 ---------- */
.s-assign-head{display:flex;flex-direction:column;gap:8px;min-width:0}
.s-assign-head h1{font-size:24px;overflow-wrap:anywhere}
.s-assign-meta{display:flex;gap:14px;flex-wrap:wrap;align-items:center;font-size:13px;color:var(--muted)}
.s-md{font-size:14.5px;line-height:1.75;overflow-wrap:anywhere}
.s-md h2{font-size:16px;margin:18px 0 6px}
.s-md h3{font-size:15px;margin:14px 0 4px}
.s-md h2:first-child,.s-md h3:first-child{margin-top:0}
.s-md p{margin:6px 0}
.s-md ul,.s-md ol{margin:6px 0;padding-left:22px}
.s-md li{margin:2px 0}
.s-md code{background:#f4f1fb;border-radius:5px;padding:1px 5px}
.s-md pre{background:#f7f5fb;border-radius:10px;padding:10px 12px;overflow:auto}
.s-md pre code{background:none;padding:0}
.s-side-block{display:flex;flex-direction:column;gap:10px;padding:0 0 18px;border-bottom:1px solid var(--line)}
.s-side-block:last-child{border-bottom:0}
.s-side-block h3{font-size:13px;color:var(--muted);font-weight:600}
.s-pkgs{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:4px;font-size:13px}
.s-pkgs li{overflow-wrap:anywhere}
.s-digest{font-family:var(--mono);font-size:12px;color:var(--muted)}
.s-files{display:flex;flex-direction:column;gap:2px}
.s-files div{display:flex;justify-content:space-between;gap:10px;font-size:13px}
.s-files span:first-child{font-family:var(--mono);font-size:12.5px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.s-feedback{display:flex;flex-direction:column;gap:12px}
.s-score{display:flex;align-items:baseline;gap:6px}
.s-score b{font-size:30px;font-weight:600;font-variant-numeric:tabular-nums}
.s-score span{color:var(--muted)}
.s-items{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:6px 18px;font-size:13.5px;max-width:420px}
.s-items .num{text-align:right;font-variant-numeric:tabular-nums}

/* ---------- 任务列表 ---------- */
.s-filters{display:flex;gap:4px;flex-wrap:wrap}
.s-chip{appearance:none;border:1px solid var(--line-strong);background:#fff;color:var(--muted);font:inherit;font-size:12.5px;height:28px;padding:0 12px;
  border-radius:999px;cursor:pointer;white-space:nowrap}
.s-chip[aria-pressed="true"]{border-color:var(--accent);color:var(--accent);background:var(--accent-soft)}
.s-jobrow td{vertical-align:top}
.s-jobrow .s-cmd{max-width:420px}
.s-joblog{background:#1e1b3a;color:#e8e7f5;border-radius:10px;padding:12px 14px;margin:4px 0 8px;max-height:320px;overflow:auto;
  font-family:var(--mono);font-size:12px;line-height:1.55;white-space:pre-wrap;word-break:break-word}
.s-detail-row td{background:#fcfbfe}
.s-narrow-detail{padding:4px 0 12px;border-bottom:1px solid var(--line)}
.list-row.click{cursor:pointer}

/* ---------- 我的账号 ---------- */
.s-cmdbox{display:flex;align-items:stretch;gap:8px;min-width:0}
.s-cmdbox pre{flex:1 1 auto;min-width:0;margin:0;background:#1e1b3a;color:#e8e7f5;border-radius:10px;padding:12px 14px;overflow:auto;
  white-space:pre-wrap;word-break:break-all;font-size:12.5px}

/* ---------- 工作区（整屏 IDE） ---------- */
body.s-ws-on{overflow:hidden}
.ws{position:fixed;inset:0;display:grid;grid-template-rows:52px minmax(0,1fr) 26px;background:var(--bg)}
.ws-top{display:flex;align-items:center;gap:10px;padding:0 14px;min-width:0;
  background:var(--glass);backdrop-filter:blur(var(--blur)) saturate(1.4);-webkit-backdrop-filter:blur(var(--blur)) saturate(1.4);
  border-bottom:1px solid var(--line)}
.ws-back{appearance:none;border:0;background:none;color:var(--muted);display:grid;place-items:center;width:30px;height:30px;border-radius:8px;cursor:pointer;flex:none}
.ws-back:hover{background:rgba(255,255,255,.7);color:var(--text)}
.ws-back svg{width:18px;height:18px;stroke:currentColor;fill:none;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.ws-title{display:flex;flex-direction:column;min-width:0;flex:0 1 auto}
.ws-title .crumb{font-size:11.5px;color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ws-title b{font-size:14.5px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ws-badges{display:flex;gap:6px;align-items:center;min-width:0;overflow:hidden}
.ws-badges .pill{flex:none}
.ws-actions{display:flex;gap:8px;align-items:center;margin-left:auto;flex:none}

.ws-body{display:grid;grid-template-columns:240px minmax(0,1fr) 380px;min-height:0}
.ws-pane{min-width:0;min-height:0;display:flex;flex-direction:column}
.ws-files{border-right:1px solid var(--line);background:rgba(255,255,255,.62)}
.ws-right{border-left:1px solid var(--line);background:rgba(255,255,255,.78)}
.ws-center{background:#fff}
.ws-h{display:flex;align-items:center;gap:6px;height:36px;padding:0 8px 0 12px;border-bottom:1px solid var(--line);flex:none;min-width:0;
  font-size:12px;font-weight:600;color:var(--muted);letter-spacing:.02em}
.ws-h .grow{flex:1 1 auto}
.ws-ib{appearance:none;border:0;background:none;color:var(--muted);width:26px;height:26px;border-radius:7px;display:grid;place-items:center;cursor:pointer;flex:none}
.ws-ib:hover{background:var(--accent-soft);color:var(--accent)}
.ws-ib svg{width:15px;height:15px;stroke:currentColor;fill:none;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}

/* 文件树 */
.ws-tree{flex:1 1 auto;overflow:auto;padding:6px 0 12px;font-size:13px}
.ws-node{display:flex;align-items:center;gap:6px;height:26px;padding:0 10px;cursor:pointer;white-space:nowrap;color:var(--text);min-width:0}
.ws-node:hover{background:rgba(123,92,255,.06)}
.ws-node.on{background:rgba(123,92,255,.12)}
.ws-node svg.chev{width:12px;height:12px;flex:none;stroke:var(--faint);stroke-width:2.4;transition:transform .12s}
.ws-node.open svg.chev{transform:rotate(90deg)}
.ws-node .chev-sp{width:12px;flex:none}
.ws-node svg{width:15px;height:15px;flex:none;stroke:var(--muted);fill:none;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}
.ws-node .nm{overflow:hidden;text-overflow:ellipsis}
.ws-node.dirty .nm::after{content:"";display:inline-block;width:6px;height:6px;border-radius:50%;background:var(--accent);margin-left:6px;vertical-align:middle}
.ws-kids{display:flex;flex-direction:column}
.ws-tree .empty{padding:8px 12px;text-align:left}
.ws-tree-sp{border-top:1px solid var(--line);margin-top:8px;padding-top:6px}
.ws-space-tag{margin-left:auto;flex:none;font-size:11px;line-height:18px;padding:0 6px;border-radius:9px;background:var(--accent-soft);color:var(--accent)}

/* 编辑器 */
.ws-tabs{display:flex;align-items:stretch;height:36px;border-bottom:1px solid var(--line);overflow-x:auto;flex:none;background:#fbfafd}
.ws-tab{display:flex;align-items:center;gap:8px;padding:0 10px 0 14px;border-right:1px solid var(--line);font-size:12.5px;color:var(--muted);cursor:pointer;white-space:nowrap;max-width:220px}
.ws-tab .nm{overflow:hidden;text-overflow:ellipsis}
.ws-tab.on{background:#fff;color:var(--text);box-shadow:inset 0 -2px 0 var(--accent)}
.ws-tab .x{appearance:none;border:0;background:none;color:var(--faint);font-size:14px;line-height:1;width:18px;height:18px;border-radius:4px;cursor:pointer;padding:0}
.ws-tab .x:hover{background:var(--accent-soft);color:var(--text)}
.ws-tab.dirty .nm::after{content:"";display:inline-block;width:6px;height:6px;border-radius:50%;background:var(--accent);margin-left:6px;vertical-align:middle}
.ws-tabs .grow{flex:1 1 auto}
.ws-tabs .ws-save{align-self:center;margin-right:8px}
.ws-editor{position:relative;flex:1 1 auto;min-height:80px}
.ws-editor .CodeMirror{position:absolute;inset:0;height:auto;font-family:var(--mono);font-size:13px;line-height:1.55}
.ws-editor .CodeMirror-gutters{background:#fbfafd;border-right:1px solid var(--line)}
.ws-editor .CodeMirror-linenumber{color:#b4adc4}
.ws-editor-empty{position:absolute;inset:0;display:grid;place-items:center;color:var(--muted);font-size:13.5px;text-align:center;padding:20px}
.ws-split{height:6px;flex:none;cursor:row-resize;background:linear-gradient(var(--line),var(--line)) center/100% 1px no-repeat}
.ws-split:hover,.ws-split.drag{background:rgba(123,92,255,.25)}
.ws-termwrap{flex:none;display:flex;flex-direction:column;background:#1e1b3a;min-height:90px}
.ws-termwrap .ws-h{background:#26224a;border-bottom-color:rgba(255,255,255,.06);color:#bdb6dd}
.ws-termwrap .ws-ib{color:#bdb6dd}
.ws-termwrap .ws-ib:hover{background:rgba(255,255,255,.08);color:#fff}
.ws-term{flex:1 1 auto;min-height:0;padding:4px 0 0 8px}
.ws-term .xterm{height:100%}
.ws-term-hint{margin-left:10px;font-weight:400;letter-spacing:0;color:#9a92c4}
.ws-term-note{padding:12px 14px;color:#bdb6dd;font-family:var(--mono);font-size:12px;line-height:1.6}

/* 右侧：标签页 */
.ws-right .tabs{padding:0 6px;flex:none;background:rgba(255,255,255,.5)}
.ws-right .tabs button{padding:10px 10px}
.ws-panel{flex:1 1 auto;min-height:0;display:flex;flex-direction:column}
.ws-scroll{flex:1 1 auto;min-height:0;overflow:auto;padding:14px 16px}
.ws-foot{flex:none;border-top:1px solid var(--line);padding:10px 12px;background:#fff;display:flex;flex-direction:column;gap:8px}

/* AI 助手：对话 */
.chat{display:flex;flex-direction:column;gap:14px}
.chat-stats{font-size:12px;color:var(--muted)}
.msg{display:flex;flex-direction:column;gap:4px;min-width:0}
.msg .who{font-size:12px;font-weight:600;color:var(--muted)}
.msg .txt{font-size:13.5px;line-height:1.65;overflow-wrap:anywhere}
.msg.user .txt{background:#f3f0fb;border-radius:12px;padding:8px 12px;white-space:pre-wrap}
.msg.ai .txt p{margin:4px 0}
.msg.ai .txt code{background:#f4f1fb;border-radius:5px;padding:1px 4px;font-size:12px}
.msg.ai .txt pre{background:#f7f5fb;border-radius:8px;padding:8px 10px;overflow:auto}
.tool{border-left:2px solid var(--line-strong);padding:2px 0 2px 10px;font-size:12.5px;color:var(--muted);min-width:0}
.tool summary{cursor:pointer;list-style:none;display:flex;gap:6px;min-width:0}
.tool summary b{flex:none;white-space:nowrap;color:var(--text);font-weight:600}
.tool summary::-webkit-details-marker{display:none}
.tool summary .ellipsis{flex:1 1 auto}
.tool pre{margin:6px 0 0;background:#f7f5fb;border-radius:8px;padding:8px 10px;max-height:200px;overflow:auto;white-space:pre-wrap;word-break:break-word;color:var(--text)}
.ask textarea{min-height:64px;max-height:180px;font-size:13.5px}
.ask .row{gap:8px;flex-wrap:nowrap}
.ask .select{flex:0 1 150px;width:auto;min-width:0;height:30px;padding:3px 10px;font-size:12.5px;border-radius:999px}
.ask .btn{flex:none}
.ask-state{font-size:12px;color:var(--muted);min-height:16px}

/* 计算 */
.cform{display:flex;flex-direction:column;gap:10px}
.cform .row{flex-wrap:wrap;gap:8px}
.cform .select{flex:1 1 160px;width:auto;min-width:0}
.cform .input.n{width:auto}
.cform-foot{display:flex;align-items:flex-end;gap:12px}
.cform-foot #c-quota{flex:1 1 auto;min-width:0}
.cform-foot .btn{flex:none}
.cform .input.n{width:84px}
.jobs-mini .list-row{padding:10px 0;cursor:pointer;align-items:flex-start}
.jobs-mini .list-row:hover{background:rgba(123,92,255,.04)}
.jobs-mini .list-row.on{background:rgba(123,92,255,.08)}
.job-detail{display:flex;flex-direction:column;gap:8px;margin-top:4px}

/* 过程 */
.p-sum{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px 8px;padding-bottom:14px;border-bottom:1px solid var(--line);margin-bottom:12px}
.p-sum div{font-size:12px;color:var(--muted)}
.p-sum b{display:block;font-size:18px;color:var(--text);font-weight:600;font-variant-numeric:tabular-nums}
.p-filter{display:flex;gap:4px;flex-wrap:wrap;margin-bottom:12px}

/* 时间线的日期分隔行 */
.tl li.day{padding-bottom:8px}
.tl li.day::after{display:none}
.tl li.day .tl-t{font-weight:600;color:var(--text)}

/* 提交 */
.verdict{font-size:14px;font-weight:600;display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.verdict .muted{font-weight:400;font-size:12.5px}
.chk{display:flex;flex-direction:column;gap:3px;padding:9px 0;border-bottom:1px solid var(--line)}
.chk:last-child{border-bottom:0}
.chk-h{display:flex;align-items:center;justify-content:space-between;gap:10px}
.chk-h b{font-size:13px}
.chk-d{font-size:12.5px;color:var(--muted);overflow-wrap:anywhere}
.out{background:#1e1b3a;color:#e8e7f5;border-radius:10px;padding:10px 12px;max-height:220px;overflow:auto;white-space:pre-wrap;word-break:break-word;font-size:12px;margin:0}
.sub-hist .list-row{padding:9px 0}

/* 状态栏 */
.ws-status{display:flex;align-items:center;gap:16px;padding:0 14px;font-size:11.5px;color:var(--muted);border-top:1px solid var(--line);
  background:rgba(255,255,255,.72);white-space:nowrap;overflow:hidden;min-width:0}
.ws-status .grow{flex:1 1 auto}
.ws-status span{overflow:hidden;text-overflow:ellipsis}
.ws-status .dot{display:inline-block;width:7px;height:7px;border-radius:50%;background:#2aa36b;margin-right:6px;vertical-align:middle}
.ws-status .dot.off{background:#c9c3d6}

.ws-loading{position:fixed;inset:0;display:grid;place-items:center;background:var(--bg)}
.ws-loading > div{display:flex;flex-direction:column;gap:10px;align-items:center;color:var(--muted);font-size:13.5px;text-align:center;padding:24px}
.ws-loading b{color:var(--text);font-size:15px}

/* 工作区里提示放到顶栏下面，别挡住右下角的提交按钮 */
body.s-ws-on .kz-toasts{bottom:auto;top:62px}

@media (max-width: 1280px){
  .ws-body{grid-template-columns:210px minmax(0,1fr) 330px}
}
@media (max-width: 1080px){
  .ws-badges .net{display:none}
}

/* ---------- 窄屏 ---------- */
.s-narrow-only{display:none}
@media (max-width: 860px){
  .kz-app{grid-template-columns:minmax(0,1fr);grid-template-rows:auto minmax(0,1fr)}
  .kz-side{min-width:0;max-width:100vw}
  .s-wide-only{display:none !important}
  .s-narrow-only{display:block !important}
  .kz-brand{flex:none;white-space:nowrap}
  .kz-nav a.course{display:none}
  .list-row{flex-wrap:wrap;row-gap:6px}
  .list-row > .s-row-main{flex:1 1 100%}
  .list-row > .s-row-side{flex:1 1 100%;justify-content:flex-start}
  .kz-main{min-width:0}
  .s-cols{grid-template-columns:minmax(0,1fr)}
  .s-assign-head h1{font-size:21px}
  .s-row-side .hide-narrow{display:none}
  .s-strip{gap:18px}
  table.kz.s-narrow-list thead{display:none}
  table.kz.s-narrow-list,table.kz.s-narrow-list tbody,table.kz.s-narrow-list tr,table.kz.s-narrow-list td{display:block;width:100%}
  table.kz.s-narrow-list tr{padding:10px 0;border-bottom:1px solid var(--line)}
  table.kz.s-narrow-list td{border:0;padding:2px 0}
  table.kz.s-narrow-list td.num{text-align:left}
  table.kz.s-narrow-list td[data-l]::before{content:attr(data-l) "　";color:var(--muted);font-size:12px}
  .s-jobrow .s-cmd{max-width:none}
  .s-cmdbox{flex-direction:column}
}
