:root{
  --bg:#ffffff; --panel:#ffffff; --border:#e9e9e9;
  --text:#191919; --muted:#8b8b8b; --accent:#2563eb;
  --accent-soft:#eef3ff; --chip:#f4f4f4;
  --green:#0f7a45; --red:#c0392b;
}
[data-theme="dark"]{
  --bg:#101216; --panel:#15181d; --border:#262a30;
  --text:#e9e9e9; --muted:#8a9099; --accent:#81a6ff;
  --accent-soft:#1a2230; --chip:#1d2127;
  --green:#4ade80; --red:#f87171;
}
*{box-sizing:border-box;}
[hidden]{display:none !important;}
body{margin:0; background:var(--bg); color:var(--text);
  font:15px/1.8 -apple-system,"Segoe UI","Microsoft YaHei","PingFang SC",sans-serif;}
button{font-family:inherit;}

/* 顶栏 */
.topbar{position:sticky; top:0; z-index:20; background:var(--bg); border-bottom:1px solid var(--border);}
.topbar-inner{max-width:1120px; margin:0 auto; padding:0 20px; height:54px; display:flex; align-items:center; gap:2px;}
.logo{font-size:14.5px; font-weight:600; letter-spacing:.5px;}
.count{font-size:12px; color:var(--muted); margin-left:10px; font-variant-numeric:tabular-nums;}
.spacer{flex:1;}
.tab{padding:5px 10px; border:none; background:none; color:var(--muted); font-size:13px; cursor:pointer; border-radius:6px;}
.tab:hover{color:var(--text);}
.tab.on{color:var(--text); background:var(--chip);}
.tbtn{padding:5px 9px; border:none; background:none; color:var(--muted); font-size:13px; cursor:pointer; border-radius:6px;}
.tbtn:hover{color:var(--text); background:var(--chip);}
.tbtn.primary{color:var(--bg); background:var(--text); padding:6px 13px;}
.tbtn.primary:hover{opacity:.85; color:var(--bg);}

/* 主体：左侧个人空间 + 右侧主栏 */
.layout{max-width:1120px; margin:0 auto; padding:22px 20px 90px; display:flex; justify-content:center; gap:26px;}
.wrap{flex:1; min-width:0; max-width:820px;}
.search{width:100%; padding:9px 13px; border:1px solid var(--border); border-radius:8px;
  background:transparent; color:var(--text); font-size:14px; outline:none;}
.search:focus{border-color:var(--accent);}
.filters{display:flex; align-items:center; gap:14px; flex-wrap:wrap; margin-top:10px;}
.filters select{border:none; border-bottom:1px solid var(--border); border-radius:0;
  background:transparent; color:var(--muted); font-size:12.5px; padding:3px 0; outline:none; cursor:pointer; max-width:220px;}
.filters select:focus{border-color:var(--accent);}
.linkbtn{border:none; background:none; color:var(--muted); font-size:12.5px; cursor:pointer; padding:0;}
.linkbtn:hover{color:var(--accent);}

/* 找题面板：筛选卡（章节/小节/知识点/其它，同维度并集，跨维度交集） */
.fpanel{margin-top:12px; display:flex; flex-direction:column; gap:10px;
  border:1px solid var(--border); border-radius:10px; padding:12px 14px;}
.frow{display:flex; align-items:center; gap:10px;}
.frow-tag{flex:none; width:48px; font-size:12px; color:var(--muted); letter-spacing:1px;}
.frow .chips{flex:1; min-width:0;}
.frow-foot{margin-top:2px;}
.f-hit{font-variant-numeric:tabular-nums;}

/* 找题面板：章节/小节/知识点/其它 四栏，点栏目名上下拉收放；初始收起只看栏目名 */
.fgroup{display:flex; flex-direction:column;}
.fgroup.sub{margin-left:22px;}
.fhead{display:flex; align-items:center; gap:8px; padding:4px 0; cursor:pointer; user-select:none;}
.fhead:hover .frow-tag{color:var(--accent);}
.ffold{flex:none; width:14px; font-size:11px; color:var(--muted); text-align:center;}
.f-sum{flex:1; min-width:0; font-size:12px; color:var(--muted); overflow:hidden; text-overflow:ellipsis; white-space:nowrap;}
.fbody{padding:2px 0 8px 22px;}
.fgroup.sub .fbody{padding-left:14px;}
.fbody[hidden]{display:none;}

/* AI 找题：独立卡片，和普通筛子分开 */
.fcard{margin-top:10px; display:flex; align-items:center; gap:10px; flex-wrap:wrap;
  background:var(--chip); border:1px solid var(--border); border-radius:10px; padding:10px 14px;}
.ai-input{flex:1; min-width:200px; max-width:420px; padding:7px 11px;
  border:1px solid var(--border); border-radius:7px;
  background:var(--panel); color:var(--text); font-size:13.5px; outline:none;}
.ai-input:focus{border-color:var(--accent);}

/* 更多操作小菜单 */
.f-more-wrap{position:relative;}
.f-more-menu{position:absolute; right:0; top:calc(100% + 6px); z-index:15;
  background:var(--panel); border:1px solid var(--border); border-radius:10px;
  box-shadow:0 8px 24px rgba(0,0,0,.10); padding:9px 13px; min-width:148px;
  display:flex; flex-direction:column; align-items:flex-start; gap:11px;}
.f-more-menu .linkbtn{font-size:13px;}

/* 知识点目录（找资料的主入口） */
.find-head{display:flex; align-items:center; gap:12px; padding:4px 0 12px; border-bottom:1px solid var(--border);}
.find-title{font-size:15.5px; font-weight:600;}
/* 知识点目录按 章 → 节 分组 */
.know-chapter-title{font-size:15px; margin:18px 0 2px; padding-bottom:5px; border-bottom:1px solid var(--border);}
.know-sec-title{font-size:13px; color:var(--muted); margin:12px 0 0;}
.know-grid{}
.know-card{padding:16px 0; border-bottom:1px solid var(--border); cursor:pointer;}
.know-card:hover{background:var(--accent-soft);}
.know-head{display:flex; gap:8px; align-items:baseline; flex-wrap:wrap;}
.know-name{font-size:14.5px; font-weight:600; line-height:1.7;}
.know-kind{flex:none; font-size:11px; color:var(--muted); background:var(--chip); padding:1px 7px; border-radius:5px;}
.know-sum{font-size:13px; line-height:2; margin-top:3px;}
.know-fml{font-size:13px; line-height:2.1; margin-top:2px;}
.know-foot{margin-top:8px;}
.know-drill{border:none; background:var(--accent-soft); color:var(--accent); font-size:12px;
  padding:3px 11px; border-radius:6px; cursor:pointer;}
.know-drill:hover{opacity:.85;}

/* 题目 */
.q{padding:22px 0; border-bottom:1px solid var(--border); scroll-margin-top:70px;}
.q.flash{animation:flash 1.8s ease-out;}
@keyframes flash{from{background:var(--accent-soft);} to{background:transparent;}}
.q-title{font-size:15.5px; line-height:2.2; white-space:pre-wrap;}
.q-meta{display:flex; align-items:center; gap:8px; flex-wrap:wrap; margin-top:7px; font-size:12.5px; color:var(--muted);}
.q-meta .dot{opacity:.45;}
.q-date{font-variant-numeric:tabular-nums;}
.q-toggle{border:none; background:none; color:var(--muted); font-size:12.5px; cursor:pointer; padding:0;}
.q-toggle:hover{color:var(--accent);}
.q-body{margin-top:16px;}
.block{margin-bottom:18px;}
.block-label{font-size:12px; color:var(--muted); margin-bottom:5px; letter-spacing:.5px;}
.answer{border-left:2px solid var(--green); padding-left:12px;}
.sol{margin-bottom:16px;}
.sol-name{font-size:13.5px; font-weight:600; margin-bottom:3px;}
.sol-text{white-space:pre-wrap; word-break:break-word; line-height:2.3;}
.chips{display:flex; flex-wrap:wrap; gap:6px;}
.chip{border:none; background:var(--chip); color:var(--muted); font-size:13px;
  padding:2px 9px; border-radius:5px; cursor:pointer; line-height:1.7;}
.chip:hover{color:var(--text);}
.chip.on{background:var(--accent-soft); color:var(--accent);}
/* 特殊标签（考研/竞赛）：置顶的高亮 chip 和题卡里的高亮字 */
.chip.hot{background:var(--accent-soft); color:var(--accent); font-weight:600;}
.chip.hot.on{background:var(--accent); color:#fff;}
.tag-hot{color:var(--accent); font-weight:600;}
.chips .cnt{font-size:11px; opacity:.55; margin-left:3px; font-style:normal; font-variant-numeric:tabular-nums;}
.rel-q{display:flex; gap:8px; align-items:baseline; padding:2px 0; font-size:13px;}
.rel-q button{border:none; background:none; color:var(--accent); font-size:12.5px; cursor:pointer; padding:0; font-variant-numeric:tabular-nums;}
.rel-q span{color:var(--muted); font-size:12.5px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;}
.q-foot{margin-top:6px; display:flex; gap:14px;}
/* 批注 */
.ann{display:flex; gap:8px; align-items:baseline; padding:5px 0; border-bottom:1px dashed var(--border);}
.ann:last-of-type{border-bottom:none;}
.ann-by{flex:none; font-size:11px; color:var(--accent); background:var(--accent-soft);
  padding:1px 7px; border-radius:5px; line-height:1.8;}
.ann-by.ai{color:var(--green); background:var(--chip);}
.ann-text{flex:1; min-width:0; font-size:13px; line-height:2;}
.ann-ops{display:flex; gap:12px; margin-top:6px;}
.ann-ops .q-toggle{font-size:12px;}
.ann-draft textarea{margin-top:4px;}
.empty{padding:60px 0; color:var(--muted); font-size:13.5px; line-height:2;}

/* 公式速查 */
.f-sec{font-size:13px; font-weight:600; margin:16px 0 5px;}
.f-sec:first-child{margin-top:0;}
.f-item{padding:3px 0; font-size:14px;}
.fno{display:inline-block; min-width:26px; color:var(--accent);}
.katex-display{overflow-x:auto; overflow-y:hidden; margin:.7em 0; padding:3px 0;}
/* 行内公式按 inline-block 参与行高：公式再高也只把「它所在的那一行」撑高，
   不会像纯行内那样溢出到下一行把文字压住（行内 \frac 实测 55px，行高只有 34.5px）。 */
.katex{display:inline-block; vertical-align:baseline; max-width:100%;}
.katex{font-size:1.03em;}

/* Markdown（对话气泡 / 题目详情） */
.md-h{font-size:15px; font-weight:600; margin:12px 0 4px; line-height:1.6;}
.md-h:first-child{margin-top:0;}
.md-gap{height:10px;}
.md-list{margin:5px 0 5px 20px; padding:0;}
.md-list li{margin:2px 0;}
.md-code{margin:8px 0; padding:10px 12px; background:var(--panel); border:1px solid var(--border);
  border-radius:7px; overflow-x:auto; font-size:12.5px; line-height:1.6;}
.md-code code{font-family:Consolas,"Courier New",monospace; white-space:pre; color:var(--text);}
.md-inline{padding:1px 4px; background:var(--chip); border-radius:4px;
  font-family:Consolas,"Courier New",monospace; font-size:.92em;}

/* 试卷 */
.paper{padding:16px 0; border-bottom:1px solid var(--border);}
.paper-title{font-size:15.5px; font-weight:600; line-height:1.6;}
.paper-meta{font-size:12.5px; color:var(--muted); margin-top:4px;}
.paper-ops{display:flex; gap:14px; margin-top:8px;}
.paper-ops button{border:none; background:none; color:var(--accent); font-size:12.5px; cursor:pointer; padding:0;}
.paper-ops button.danger{color:var(--muted);}
.paper-ops button.danger:hover{color:var(--red);}
.paper-head{padding:4px 0 12px; border-bottom:1px solid var(--border);}
.paper-head h1{font-size:17px; font-weight:600; margin:10px 0 4px; line-height:1.5;}
.paper-thumbs{display:flex; gap:8px; overflow-x:auto; padding:8px 0 2px;}
.paper-thumbs img{height:96px; border:1px solid var(--border); border-radius:6px; display:block;}
.pq{padding:18px 0; border-bottom:1px solid var(--border);}
.pq-head{display:flex; gap:8px; align-items:center; flex-wrap:wrap; font-size:12.5px;
  color:var(--muted); margin-bottom:5px;}
.pq-no{font-weight:600; color:var(--text);}
.pq-input{width:100%; margin-top:12px; padding:8px 10px; border:1px solid var(--border); border-radius:7px;
  background:transparent; color:var(--text); font:inherit; font-size:13.5px; line-height:1.7; resize:vertical; outline:none;}
.pq-input:focus{border-color:var(--accent);}
.pq-mine{margin-top:12px; padding-left:12px; border-left:2px solid var(--accent); font-size:13.5px; line-height:2;}
.paper-foot{position:sticky; bottom:0; display:flex; gap:10px; align-items:center; flex-wrap:wrap;
  padding:12px 0 14px; background:var(--bg); border-top:1px solid var(--border);}
.paper-foot .hint{flex:1; min-width:180px;}
/* 限时训练：判分结果徽章 + 倒计时 */
.verdict{flex:none; font-size:12px; padding:2px 9px; border-radius:5px; background:var(--chip); font-weight:600;}
.verdict.ok{color:var(--green);}
.verdict.half{color:#b45309;}
.verdict.bad{color:var(--red);}
[data-theme="dark"] .verdict.half{color:#fbbf24;}
.f-hit.danger{color:var(--red);}

/* 试卷导入 */
.import-pages{display:flex; flex-wrap:wrap; gap:12px; margin-top:12px;}
.import-pages .pg{position:relative; line-height:0;}
.import-pages img{height:92px; border:1px solid var(--border); border-radius:6px; display:block;}
.import-pages .pg-no{position:absolute; left:5px; bottom:5px; background:rgba(0,0,0,.62); color:#fff;
  font-size:11px; padding:0 5px; border-radius:4px; line-height:1.6;}
.import-pages .pg-x{position:absolute; top:-7px; right:-7px; width:20px; height:20px; padding:0;
  border:1px solid var(--border); border-radius:50%; background:var(--panel); color:var(--muted);
  font-size:12px; line-height:1; cursor:pointer;}
.import-pages .pg-x:hover{color:var(--red); border-color:var(--red);}
.iq{border:1px solid var(--border); border-radius:8px; padding:10px 12px; margin-bottom:10px;}
.iq-head{display:flex; gap:8px; align-items:center; flex-wrap:wrap; margin-bottom:6px;}
.iq-head input{padding:4px 7px; border:1px solid var(--border); border-radius:5px;
  background:transparent; color:var(--text); font:inherit; font-size:12.5px; outline:none;}
.iq-head .iq-no{width:96px;}
.iq-head .iq-type{width:78px;}
.iq-dup{font-size:11.5px; color:var(--red); background:var(--chip); padding:1px 7px; border-radius:5px;}
.iq-act{margin-left:auto; font-size:12px; padding:3px 6px; border:1px solid var(--border);
  border-radius:5px; background:transparent; color:var(--text); cursor:pointer;}
.iq-title{width:100%; padding:7px 9px; border:1px solid var(--border); border-radius:6px;
  background:transparent; color:var(--text); font:inherit; font-size:13px; line-height:1.75; resize:vertical; outline:none;}
.iq-title:focus{border-color:var(--accent);}
.import-summary{font-size:12.5px; color:var(--muted); padding:10px 0 8px; border-top:1px solid var(--border); margin-top:16px;}

/* 弹窗 */
.mask{position:fixed; inset:0; z-index:60; background:rgba(0,0,0,.3);
  display:flex; justify-content:center; align-items:flex-start; padding:36px 16px; overflow-y:auto;}
.sheet{width:100%; max-width:700px; background:var(--panel); border:1px solid var(--border); border-radius:10px;}
.sheet-head{display:flex; align-items:center; justify-content:space-between; padding:13px 20px; border-bottom:1px solid var(--border);}
.sheet-head h2{font-size:14px; font-weight:600; margin:0; letter-spacing:.5px;}
.sheet-body{padding:18px 20px;}
.sheet-foot{display:flex; gap:8px; align-items:center; padding:12px 20px; border-top:1px solid var(--border); flex-wrap:wrap;}
.sheet-close{border:none; background:none; color:var(--muted); font-size:14px; cursor:pointer; padding:0;}
.sheet-close:hover{color:var(--text);}

/* 表单 */
.field{margin-bottom:14px;}
.field > label{display:block; font-size:12.5px; color:var(--muted); margin-bottom:5px;}
.field input,.field textarea,.field select{width:100%; padding:8px 10px; border:1px solid var(--border);
  border-radius:7px; background:transparent; color:var(--text); font-size:13.5px; font-family:inherit; outline:none;}
.field input:focus,.field textarea:focus,.field select:focus{border-color:var(--accent);}
.field textarea{resize:vertical; line-height:1.7;}
.field-row{display:flex; gap:12px;}
.field-row > .field{flex:1;}
.inline{display:flex; gap:8px; align-items:center; flex-wrap:wrap;}
.hint{font-size:12px; color:var(--muted); line-height:1.7; word-break:break-all;}
.btn{padding:7px 13px; border:1px solid var(--border); border-radius:7px;
  background:transparent; color:var(--text); font-size:13px; cursor:pointer;}
.btn:hover{border-color:var(--accent); color:var(--accent);}
.btn.primary{background:var(--text); border-color:var(--text); color:var(--bg);}
.btn.primary:hover{opacity:.85; color:var(--bg);}
.btn:disabled{opacity:.4; cursor:not-allowed;}
.btn.tiny{padding:2px 8px; font-size:12px;}
.btn.danger:hover{border-color:var(--red); color:var(--red);}
.status{font-size:12.5px; color:var(--muted); white-space:pre-wrap; line-height:1.7; word-break:break-word;}
#cfg-status{flex-basis:100%;}
.status.ok{color:var(--green);}
.status.err{color:var(--red);}
.err-box{margin-top:12px; padding:10px 12px; border-left:2px solid var(--red); background:var(--chip);
  font-size:12.5px; white-space:pre-wrap; word-break:break-word;}
.drop{border:1px dashed var(--border); border-radius:8px; padding:24px 14px;
  text-align:center; color:var(--muted); font-size:13px; cursor:pointer;}
.drop:hover,.drop.over{border-color:var(--accent); color:var(--accent);}
#preview{max-width:100%; max-height:260px; border-radius:7px; border:1px solid var(--border); display:block;}
.preview-ops{display:flex; gap:10px; align-items:center; margin-top:8px; font-size:12px; color:var(--muted);}
.sol-row{border:1px solid var(--border); border-radius:8px; padding:10px 12px; margin-bottom:10px;}
.sol-row-head{display:flex; gap:8px; margin-bottom:6px;}
.sol-row-head input{flex:1;}
.picks{display:flex; flex-wrap:wrap; gap:6px; margin-top:6px; max-height:96px; overflow-y:auto;}

/* 对话 */
.chat{display:flex; flex-direction:column; gap:14px; padding-top:8px;}
.msg{display:flex;}
.msg.user{justify-content:flex-end;}
.msg.ai{justify-content:flex-start;}
.msg > div{max-width:88%; min-width:0;}
.bubble{padding:11px 15px; border-radius:12px; font-size:14.5px; line-height:2.3;
  word-break:break-word;}
.msg.user .bubble{background:var(--accent-soft); color:var(--text); border-bottom-right-radius:4px;}
.msg.ai .bubble{background:var(--chip); border-bottom-left-radius:4px;}
.msg.error .bubble{border-left:2px solid var(--red);}
.msg-img{display:block; max-width:100%; max-height:220px; border-radius:8px; margin-bottom:7px;}
.think{padding:8px 10px; margin-bottom:9px; background:var(--bg); border:1px solid var(--border);
  border-radius:8px; max-height:180px; overflow-y:auto; font-size:12.5px; color:var(--muted); line-height:1.75;}
.think-label{font-size:11.5px; color:var(--muted); margin-bottom:3px; letter-spacing:.4px; cursor:pointer; list-style:none;}
.think-text{white-space:pre-wrap; word-break:break-word;}
.answer-text{white-space:pre-wrap; word-break:break-word; line-height:2.3;}
.msg-actions{display:flex; gap:12px; align-items:center; flex-wrap:wrap; margin:7px 0 0 2px;}
.chat-hints{display:flex; gap:8px; flex-wrap:wrap; margin-top:18px;}
.chat-hint{border:1px solid var(--border); background:none; color:var(--muted);
  font-size:12.5px; padding:6px 11px; border-radius:999px; cursor:pointer;}
.chat-hint:hover{border-color:var(--accent); color:var(--accent);}
.composer{position:sticky; bottom:0; display:flex; align-items:flex-end; gap:8px;
  padding:12px 0 16px; background:var(--bg);}
.compose-btn{width:34px; height:34px; border-radius:50%; border:1px solid var(--border);
  background:var(--panel); color:var(--muted); font-size:17px; line-height:1; cursor:pointer; flex:none;}
.compose-btn:hover{border-color:var(--accent); color:var(--accent);}
.compose-main{flex:1; min-width:0; border:1px solid var(--border); border-radius:14px;
  background:var(--panel); padding:9px 12px;}
.compose-main:focus-within{border-color:var(--accent);}
#chat-input{width:100%; border:none; background:none; color:var(--text);
  font:inherit; font-size:14px; line-height:1.7; resize:none; outline:none; max-height:150px; padding:0;}
.chat-imgs{display:flex; flex-wrap:wrap; gap:10px; margin-bottom:8px;}
.chat-imgs .thumb{position:relative; line-height:0;}
.chat-imgs .thumb img{max-height:84px; max-width:140px; border-radius:8px; border:1px solid var(--border);
  display:block; box-shadow:0 1px 2px rgba(0,0,0,.05);}
.chat-imgs .thumb-x{position:absolute; top:-7px; right:-7px; width:20px; height:20px; padding:0;
  border:1px solid var(--border); border-radius:50%; background:var(--panel); color:var(--muted);
  font-size:12px; line-height:17px; text-align:center; cursor:pointer;}
.chat-imgs .thumb-x:hover{color:var(--red); border-color:var(--red);}
#view-chat.dropping{outline:2px dashed var(--accent); outline-offset:-8px; border-radius:10px;}
.send-btn{width:34px; height:34px; border-radius:50%; border:none; background:var(--text);
  color:var(--bg); font-size:16px; cursor:pointer; flex:none;}
.send-btn:hover{opacity:.85;}
.send-btn:disabled{opacity:.4; cursor:not-allowed;}

#toast{position:fixed; left:50%; bottom:34px; transform:translateX(-50%) translateY(12px);
  background:var(--text); color:var(--bg); padding:7px 16px; border-radius:999px;
  font-size:12.5px; opacity:0; pointer-events:none; transition:.2s; z-index:99;}
#toast.show{opacity:1; transform:translateX(-50%) translateY(0);}

/* 撤销上次入库：常驻左下角，点一下就把刚存的那道题撤掉 */
#undo-bar{position:fixed; left:20px; bottom:22px; z-index:70; display:flex; align-items:center; gap:12px;
  padding:9px 14px; background:var(--panel); border:1px solid var(--border); border-radius:10px;
  box-shadow:0 2px 10px rgba(0,0,0,.08); font-size:12.5px; color:var(--muted); max-width:430px;}
#undo-bar b{color:var(--text); font-weight:600;}
#undo-bar #undo-text{flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;}
#undo-bar button{border:none; background:none; color:var(--accent); font-size:12.5px; cursor:pointer;
  padding:0; white-space:nowrap; flex:none;}
#undo-bar button.x{color:var(--muted); font-size:14px;}

/* 对话工具条 */
.chat-tools{display:flex; justify-content:flex-end; padding:2px 0 6px;}

/* 导入页的识别状态 */
.import-pages .pg-state{position:absolute; right:5px; bottom:5px; font-size:10.5px; padding:0 5px;
  border-radius:4px; line-height:1.7; background:rgba(0,0,0,.55); color:#fff;}
.import-pages .pg-state.ok{background:var(--green);}
.import-pages .pg-state.bad{background:var(--red);}
.import-pages .pg.bad img{border-color:var(--red); opacity:.72;}

/* 做题时给题目标「不会 / 待复习」 */
.pq-flags{display:inline-flex; gap:6px; margin-left:auto;}
.pq-flags .chip{padding:1px 8px; font-size:11.5px;}
.paper-flag-filter{border:none; border-bottom:1px solid var(--border); border-radius:0; background:transparent;
  color:var(--muted); font-size:12.5px; padding:2px 0; outline:none; cursor:pointer;}

/* 个人空间：左侧侧栏（宽屏固定，窄屏收进 me-chip 弹层） */
.personal{width:252px; flex:none; align-self:flex-start; position:sticky; top:70px;
  max-height:calc(100vh - 92px); overflow-y:auto;}
.p-card{padding:2px 0 13px; border-bottom:1px solid var(--border);}
.p-name{font-size:15px; font-weight:600; line-height:1.6;}
.p-sub{font-size:12px; color:var(--muted); margin-top:2px; font-variant-numeric:tabular-nums;}
.p-sec{padding:13px 0; border-bottom:1px solid var(--border);}
.p-sec:last-child{border-bottom:none;}
.p-sec-title{font-size:12px; color:var(--muted); letter-spacing:.5px; margin-bottom:8px;}
.p-item{display:flex; align-items:baseline; gap:8px; width:100%; text-align:left; border:none; background:none; color:var(--text);
  font-size:12.5px; padding:4px 0; cursor:pointer; line-height:1.7;}
.p-item:hover{color:var(--accent);}
.p-hint{margin-left:auto; color:var(--muted); font-size:11px; flex:none;}
.p-more{border:none; background:none; color:var(--accent); font-size:12px; padding:5px 0 0; cursor:pointer;}
.p-empty{font-size:12px; color:var(--muted); padding:2px 0; line-height:1.8;}

@media (max-width:1120px){
  .personal{display:none;}
}

@media (max-width:760px){
  .layout{padding:18px 14px 80px;}
  .topbar-inner{padding:0 12px; gap:0;}
  .field-row{flex-direction:column; gap:0;}
  .mask{padding:12px 8px;}
  .sheet-body{padding:14px;}
  .f-more-menu{right:0;}
}

/* ---------- 多用户：登录、分层、审核徽标 ---------- */
.login-mask{align-items:center; padding:20px; background:rgba(0,0,0,.42);}
.login-box{width:100%; max-width:360px; background:var(--panel); border:1px solid var(--border);
  border-radius:12px; padding:24px 22px 20px; box-shadow:0 8px 30px rgba(0,0,0,.16);}
.login-title{font-size:17px; font-weight:600; letter-spacing:.5px;}
.login-sub{font-size:12.5px; color:var(--muted); margin:6px 0 18px; line-height:1.8;}
#me-chip{font-variant-numeric:tabular-nums;}
#review-btn{color:var(--red);}

/* 我的 / 公共 / 全部 */
.layer-tabs{display:flex; gap:4px; margin-bottom:10px;}
.layer-tab{border:none; background:none; color:var(--muted); font-size:13px; cursor:pointer;
  padding:4px 11px; border-radius:7px;}
.layer-tab:hover{color:var(--text); background:var(--chip);}
.layer-tab.on{color:var(--text); background:var(--chip); font-weight:600;}
.layer-tab .lc{opacity:.55; font-size:11.5px; margin-left:2px; font-variant-numeric:tabular-nums;}

/* 就这道题追问：把题干/答案/解法当上下文带进对话，不用重新截图 */
.chat-ctx{display:flex; align-items:center; gap:8px; margin-bottom:6px; padding:6px 9px;
  background:var(--accent-soft); border-radius:7px; font-size:12px; color:var(--accent);}
.chat-ctx .ctx-text{flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;}
.chat-ctx button{border:none; background:none; color:var(--muted); font-size:13px; cursor:pointer; padding:0;}

/* 提供者 / 审核状态 */
.prov{color:var(--accent);}
.badge{font-size:11.5px; padding:1px 7px; border-radius:5px; background:var(--chip); color:var(--muted);}
.badge.ok{color:var(--green);}
.badge.bad{color:var(--red);}
.badge.wait{color:var(--muted);}
.q-reason{font-size:12px; color:var(--red); line-height:1.7; margin-top:4px;}
.rv-row{padding:12px 0; border-bottom:1px solid var(--border);}
.rv-row:last-child{border-bottom:none;}
.rv-title{font-size:13.5px; line-height:1.8;}
.rv-meta{font-size:12px; color:var(--muted); margin-top:3px;}
.rv-ops{display:flex; gap:14px; margin-top:7px;}
.rv-ops button{border:none; background:none; color:var(--accent); font-size:12.5px; cursor:pointer; padding:0;}
.rv-ops button.danger{color:var(--muted);}
.rv-ops button.danger:hover{color:var(--red);}
