/* 手机 App 壳：一屏一件事，底部四个入口。
   设计目标不是「功能多」，而是打开就知道下一步做什么：
   · 首屏只保留 倒计时 / 今日计划 / 四个高频动作 / 老师的一句话；
   · 复杂设置全部收进「我的」，不再和学习内容抢位置；
   · 安全区、44px 点击区、下拉不误触、standalone 下无浏览器栏。 */
:root{
  --ink:#10322e; --ink-2:#1c4a43; --accent:#0f7a6c; --accent-2:#0b5f56;
  --accent-soft:#e2f2ee; --lime:#d9eb95; --bg:#f4f7f5; --card:#fff;
  --line:#e3ebe7; --muted:#6b807a; --warn:#a1620a; --warn-bg:#fdf4e3;
  --danger:#b23a2f; --radius:18px;
  color-scheme:light;
  font-family:-apple-system,BlinkMacSystemFont,"PingFang SC","HarmonyOS Sans SC","Microsoft YaHei",system-ui,sans-serif;
}
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
html,body{margin:0;background:var(--bg);color:var(--ink)}
body{min-height:100dvh;overscroll-behavior-y:contain}
button,input,select,textarea{font:inherit;color:inherit}
button{cursor:pointer;border:0;background:none}
a{color:inherit;text-decoration:none}
[hidden]{display:none!important}
:focus-visible{outline:3px solid var(--accent);outline-offset:2px}

/* ---------- 骨架 ---------- */
.shell{display:flex;min-height:100dvh;align-items:stretch}
.content{flex:1;min-width:0;display:flex;flex-direction:column}
.rail{display:none}
.appbar{
  position:sticky;top:0;z-index:20;
  padding:calc(env(safe-area-inset-top) + 10px) 16px 10px;
  display:flex;align-items:center;gap:10px;
  background:rgba(244,247,245,.88);backdrop-filter:blur(14px);
  border-bottom:1px solid transparent;transition:border-color .2s;
}
.appbar.scrolled{border-bottom-color:var(--line)}
.goal-chip{
  display:flex;align-items:center;gap:8px;min-height:40px;padding:6px 12px;
  background:var(--card);border:1px solid var(--line);border-radius:999px;
  max-width:100%;overflow:hidden;
}
.goal-chip b{font-size:14px;font-weight:650;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:42vw}
.goal-chip span{font-size:12px;color:var(--accent);background:var(--accent-soft);padding:3px 7px;border-radius:999px;white-space:nowrap}
.appbar .spacer{flex:1}
.icon-btn{
  width:40px;height:40px;border-radius:50%;display:grid;place-items:center;
  background:var(--card);border:1px solid var(--line);color:var(--muted);
}
.icon-btn svg{width:19px;height:19px}

main{padding:6px 16px calc(96px + env(safe-area-inset-bottom));max-width:720px;margin:0 auto;width:100%}
.screen{animation:rise .22s ease}
@keyframes rise{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}
@media(prefers-reduced-motion:reduce){.screen{animation:none}}

h1{font-size:26px;line-height:1.28;margin:2px 0 6px;letter-spacing:-.3px}
h2{font-size:17px;margin:0 0 10px}
h3{font-size:15px;margin:0 0 6px}
p{margin:0;line-height:1.65}
.eyebrow{font-size:11px;letter-spacing:1.6px;color:var(--muted);text-transform:uppercase;margin:0 0 4px}
.muted{color:var(--muted);font-size:13px;line-height:1.6}
.small{font-size:12px}

.card{background:var(--card);border:1px solid var(--line);border-radius:var(--radius);padding:16px;margin-top:12px}
.card.tight{padding:14px}
.section-head{display:flex;align-items:baseline;justify-content:space-between;gap:10px;margin:22px 0 2px}
.section-head h2{margin:0}
.section-head .link{font-size:13px;color:var(--accent);font-weight:600}

/* ---------- 首页：卡片工作台 ---------- */
.page-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin:10px 0 2px}
.desk-greet{min-width:0}
.desk-greet h1{font-size:22px;margin:0}
.page-sub{font-size:12.5px;color:var(--muted);margin-top:5px;line-height:1.5}

/* 顶部统计条：四个小块，一眼看到今天的量 */
.stat-strip{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin-top:14px}
.strip-item{
  display:flex;align-items:center;gap:9px;padding:10px 12px;min-width:0;
  background:var(--card);border:1px solid var(--line);border-radius:16px;
}
.strip-item>div{display:grid;gap:1px;min-width:0}
.strip-item b{font:400 18px/1.15 Georgia,serif;letter-spacing:-.3px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.strip-item span{font-size:11px;color:var(--muted);white-space:nowrap}
.si{
  width:30px;height:30px;border-radius:10px;display:grid;place-items:center;
  font-size:13.5px;font-style:normal;flex:0 0 auto;
}
.si-green{background:#e4f3e6;color:#2e7d43}
.si-blue{background:#e4eefb;color:#2b62a8}
.si-amber{background:#fdf0dc;color:#9a6415}
.si-purple{background:#eee8fb;color:#6544a8}
@media(min-width:720px){.stat-strip{grid-template-columns:repeat(4,minmax(0,1fr))}}
.desk-edit{
  display:inline-flex;align-items:center;gap:5px;flex:0 0 auto;
  min-height:34px;padding:0 11px;border-radius:999px;font-size:12.5px;font-weight:600;
  background:var(--card);border:1px solid var(--line);color:var(--muted);
}
.desk-edit svg{width:14px;height:14px}
.desk-edit[aria-pressed="true"]{background:var(--accent);border-color:var(--accent);color:#fff}

.bento{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin-top:14px;align-items:stretch}
.tile{
  position:relative;background:var(--card);border:1px solid var(--line);border-radius:20px;
  padding:16px;display:flex;flex-direction:column;gap:10px;min-width:0;
  box-shadow:0 2px 10px rgba(16,50,46,.04);
}
.tile[data-card="hero"]{grid-column:span 2;padding:18px}
.tile[data-card="stats"],.tile[data-card="plan"],.tile[data-card="teacher"],.tile[data-card="quick"]{grid-column:span 2}
.tile-label{font-size:11.5px;letter-spacing:1.2px;color:var(--muted);text-transform:uppercase}
.tile-sub{font-size:12px;color:var(--muted);line-height:1.5}
.tile-head{display:flex;align-items:center;justify-content:space-between;gap:10px}
.tile-head .link{font-size:12.5px;color:var(--accent);font-weight:600}

/* 编辑态 */
.tile-tools{display:none;position:absolute;top:8px;right:8px;gap:4px;z-index:3}
.bento.editing .tile-tools{display:flex}
.bento.editing .tile{border-style:dashed;border-color:#c9d8d2}
.bento.editing .tile.off{opacity:.42;filter:grayscale(.7)}
.tool{
  width:30px;height:30px;border-radius:10px;display:grid;place-items:center;
  background:#fff;border:1px solid var(--line);color:var(--muted);font-size:14px;line-height:1;
  box-shadow:0 1px 4px rgba(16,50,46,.08);
}
.bento.editing .tile-head .link{opacity:0;pointer-events:none}
.tile.off .tool[data-hide]{background:var(--accent-soft);color:var(--accent-2);border-color:var(--accent-soft)}
.desk-tip{
  position:fixed;left:12px;right:12px;bottom:calc(76px + env(safe-area-inset-bottom));z-index:26;
  padding:14px;border-radius:18px;background:rgba(226,242,238,.97);
  border:1px solid #cfe4dd;
  display:flex;flex-direction:column;gap:8px;align-items:flex-start;
  box-shadow:0 12px 34px rgba(16,50,46,.18);backdrop-filter:blur(10px);
}
/* 编辑时给底部工具条留位置，别把最后一张卡压住 */
main:has(.bento.editing){padding-bottom:calc(250px + env(safe-area-inset-bottom))}
.desk-tip b{font-size:13px;color:var(--accent-2)}
.desk-tip p{font-size:12px;color:var(--ink-2);line-height:1.6}
.desk-tip-head{display:flex;align-items:baseline;gap:8px;width:100%}
.desk-tip-head span{font-size:11.5px;color:var(--muted)}
.desk-tip-actions{display:flex;gap:8px;width:100%}
.desk-tip-actions .btn{flex:1;min-height:40px;padding:0 14px;font-size:13px}

/* 倒计时卡 */
.hero-tile{
  background:linear-gradient(150deg,#123c36 0%,#0f5b50 58%,#0f7a6c 100%);
  color:#fff;border:0;border-radius:24px;overflow:hidden;
  box-shadow:0 14px 34px rgba(15,64,56,.22);gap:8px;
}.hero-tile::after{content:"";position:absolute;right:-46px;top:-56px;width:180px;height:180px;border-radius:50%;background:rgba(217,235,149,.16);pointer-events:none}
.hero-tile>*{position:relative;z-index:1}
/* hero 里所有子元素都被设成 relative，编辑按钮需要单独拉回绝对定位 */
.hero-tile>.tile-tools{position:absolute;z-index:3}
.hero-eyebrow{font-size:11px;letter-spacing:1.6px;color:rgba(255,255,255,.6);text-transform:uppercase}
.count{display:flex;align-items:flex-end;gap:10px;cursor:pointer}
.count strong{font:400 52px/0.86 Georgia,"Times New Roman",serif;letter-spacing:-2px;color:var(--lime)}
.count .unit{display:grid;gap:2px;padding-bottom:2px}
.count .unit b{font-size:13px;font-weight:600}
.count .unit span{font-size:11px;color:rgba(255,255,255,.62)}
.hero-goal{font-size:12.5px;color:rgba(255,255,255,.7);line-height:1.5;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
/* 日程提示在深色卡里要换成通透款，否则浅绿底压在深绿上很刺眼 */
.hero-tile .agenda-line{margin:2px 0 0;background:rgba(255,255,255,.13);color:#eaf6f2;border:1px solid rgba(255,255,255,.16)}
.hero-tile .agenda-line .dot{background:var(--lime)}
.hero-tile .agenda-line.soon{background:rgba(253,244,227,.95);color:#7a5109;border-color:transparent}
.hero-tile .agenda-line.today,.hero-tile .agenda-line.overdue{background:rgba(253,236,234,.96);color:#8d2a20;border-color:transparent}
.hero-plan{margin-top:auto;display:grid;gap:7px}
.hero-segs{display:flex;gap:5px}
.hero-segs i{height:5px;flex:1;border-radius:99px;background:rgba(255,255,255,.2)}
.hero-segs i.done{background:var(--lime)}
.hero-plan-note{font-size:11.5px;color:rgba(255,255,255,.6)}
.hero-actions{display:flex;gap:10px;margin-top:6px}
.hero-actions .btn{min-height:42px;padding:0 16px;font-size:14px}

/* 进度环 */
.ring{position:relative;width:100%;max-width:112px;margin:0 auto;aspect-ratio:1}
.ring svg{width:100%;height:100%;transform:rotate(-90deg)}
.ring circle{fill:none;stroke-width:11;stroke-linecap:round}
.ring-bg{stroke:#eaf0ed}
.ring-fg{stroke:var(--accent);stroke-dasharray:326.7;stroke-dashoffset:326.7;transition:stroke-dashoffset .5s ease}
.ring-mid{position:absolute;inset:0;display:grid;place-content:center;text-align:center}
.ring-mid b{font:400 26px/1 Georgia,serif;color:var(--ink)}
.ring-mid i{font-size:10px;color:var(--muted);font-style:normal}

/* 番茄钟 */
.pomo-tile{background:#f2f7e2;border-color:#e4eec6}
.pomo-time{font:400 30px/1 Georgia,serif;letter-spacing:-.5px;color:var(--ink-2);font-variant-numeric:tabular-nums}
.pomo-tile.running .pomo-time{color:var(--accent)}
.pomo-actions{display:flex;gap:6px;margin-top:auto}
.pomo-btn{
  flex:1;min-height:32px;border-radius:10px;font-size:12.5px;font-weight:600;
  background:var(--accent);color:#fff;
}
.pomo-btn.line{background:#fff;color:var(--ink-2);border:1px solid #dfe8cb;flex:0 0 auto;padding:0 10px}

/* 数据 */
.stats-tile{display:grid;grid-template-columns:repeat(2,1fr);gap:12px 8px}
.stats-tile .tile-label{grid-column:1/-1}
.stat{display:flex;flex-direction:column;gap:2px;min-width:0}
.stat b{font:400 21px/1.1 Georgia,serif;color:var(--ink);letter-spacing:-.3px}
.stat span{font-size:11.5px;color:var(--muted)}
.stat b.warn{color:var(--warn)}

/* 计划 */
.plan-tile .bar{margin:0}
.plan-list-empty{font-size:12.5px;color:var(--muted);line-height:1.7}

/* 老师 */
.teacher-tile{background:var(--warn-bg);border-color:#f0e2c6;gap:8px;justify-content:flex-start}
.teacher-tile .avatar{background:#f2dcae;color:#7a5109;width:34px;height:34px;border-radius:11px;font-size:15px}
.note-body{display:flex;gap:10px;align-items:flex-start;margin-block:auto}
.note-body p{font-size:13px;line-height:1.62;color:#6c5426}

/* 快捷 */
.quick-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:8px}
.quick{
  background:#f7faf8;border:1px solid var(--line);border-radius:14px;padding:11px 12px;
  display:grid;gap:2px;text-align:left;min-width:0;
}
.quick b{font-size:13.5px}
.quick span{font-size:11px;color:var(--muted)}

.btn{
  display:inline-flex;align-items:center;justify-content:center;gap:6px;
  min-height:46px;padding:0 18px;border-radius:14px;font-size:15px;font-weight:650;
  background:var(--accent);color:#fff;
}
.btn:active{transform:scale(.985)}
.btn.ghost{background:rgba(255,255,255,.14);color:#fff;border:1px solid rgba(255,255,255,.26)}
.btn.soft{background:var(--accent-soft);color:var(--accent-2)}
.btn.line{border:1px solid var(--line);background:var(--card);color:var(--ink)}
.btn.block{width:100%}
.btn[disabled]{opacity:.55}

.quick-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:12px}
.quick{
  background:var(--card);border:1px solid var(--line);border-radius:16px;padding:14px;
  display:grid;gap:4px;text-align:left;
}
.quick b{font-size:15px}
.quick span{font-size:12px;color:var(--muted)}
.quick .dot{width:8px;height:8px;border-radius:50%;background:var(--accent);margin-bottom:2px}

/* 今日日程：竖向时间轴 */
.timeline{position:relative;margin-top:2px}
.tl-row{
  position:relative;display:grid;grid-template-columns:44px minmax(0,1fr) auto;gap:0 12px;
  padding:10px 0 10px 24px;align-items:start;
}
.tl-row::before{content:"";position:absolute;left:5.5px;top:0;bottom:0;width:1.5px;background:var(--line)}
.tl-row:first-child::before{top:15px}
.tl-row:last-child::before{bottom:calc(100% - 22px)}
.tl-node{
  position:absolute;left:1px;top:15px;width:11px;height:11px;border-radius:50%;
  background:#fff;border:2px solid #cbd8d3;z-index:1;
}
.tl-row.done .tl-node{background:var(--accent);border-color:var(--accent)}
.tl-time{font:600 12px/1.5 Georgia,serif;color:var(--accent-2);letter-spacing:.3px;padding-top:1px}
.tl-time i{display:block;font:400 10px/1.4 -apple-system,sans-serif;font-style:normal;color:#9aa9a4;letter-spacing:0}
.tl-row.done .tl-time{color:var(--muted)}
.tl-body{min-width:0}
.tl-body b{font-size:14px;font-weight:600;display:block;line-height:1.42}
.tl-row.done .tl-body b{color:var(--muted);text-decoration:line-through;text-decoration-thickness:1px}
.tl-meta{font-size:11.5px;color:var(--muted);margin-top:2px;line-height:1.5}
.tl-reason{
  font-size:11.5px;color:#5c6f69;margin-top:5px;background:#f5f9f6;
  border-radius:8px;padding:4px 9px;display:inline-block;line-height:1.45;
}
.tl-row.done .tl-reason{background:transparent;padding:0;color:#93a39e}
.tl-tick{
  width:20px;height:20px;border-radius:50%;border:1.5px solid var(--line);
  display:grid;place-items:center;font-size:11px;color:transparent;margin-top:1px;flex:0 0 auto;
}
.tl-row.done .tl-tick{background:var(--accent);border-color:var(--accent);color:#fff}
.bar{height:5px;border-radius:99px;background:#e8eeeb;overflow:hidden;margin:10px 0 4px}
.bar i{display:block;height:100%;background:var(--accent);border-radius:99px;transition:width .3s}

.teacher-note{display:flex;gap:12px;align-items:flex-start;background:var(--warn-bg);border-color:#f0e2c6}
.teacher-note .avatar{background:#f2dcae;color:#7a5109}
.teacher-note p{font-size:13.5px;line-height:1.66}

/* ---------- 老师 ---------- */
.avatar{width:42px;height:42px;border-radius:14px;background:var(--accent-soft);color:var(--accent-2);display:grid;place-items:center;font-size:19px;font-weight:700;flex:0 0 auto}
.coach-head{display:flex;align-items:center;gap:12px;margin:6px 0 2px}
.coach-head h1{font-size:20px;margin:0}
.coach-head .muted{font-size:12px}
.chat{display:grid;gap:12px;margin:18px 0 12px;min-height:30vh;flex:1;align-content:start}
[data-screen="coach"]{display:flex;flex-direction:column;min-height:calc(100dvh - 158px - env(safe-area-inset-bottom))}
.msg{max-width:86%;padding:12px 14px;border-radius:16px;font-size:14.5px;line-height:1.7;white-space:pre-wrap;word-break:break-word}
.msg.me{justify-self:end;background:var(--accent);color:#fff;border-bottom-right-radius:6px}
.msg.ai{justify-self:start;background:var(--card);border:1px solid var(--line);border-bottom-left-radius:6px}
.msg.ai.local{background:#fbfaf4;border-color:#efe8d2}
.msg .tag{display:inline-block;font-size:11px;color:var(--muted);margin-top:8px}
.msg b{font-weight:700}
.typing{display:inline-flex;gap:4px;padding:14px}
.typing i{width:6px;height:6px;border-radius:50%;background:var(--muted);animation:blink 1.2s infinite}
.typing i:nth-child(2){animation-delay:.2s}.typing i:nth-child(3){animation-delay:.4s}
@keyframes blink{0%,60%,100%{opacity:.25}30%{opacity:1}}
.chips{display:flex;gap:8px;overflow-x:auto;padding:2px 0 10px;scrollbar-width:none}
.chips::-webkit-scrollbar{display:none}
.chip{white-space:nowrap;font-size:12.5px;padding:8px 12px;border-radius:999px;background:var(--card);border:1px solid var(--line);color:var(--ink-2)}
.chip.on{background:var(--accent);border-color:var(--accent);color:#fff}
.composer{position:sticky;bottom:calc(74px + env(safe-area-inset-bottom));background:var(--bg);padding:6px 0 8px;display:flex;gap:8px;align-items:flex-end}
.composer textarea{
  flex:1;min-height:46px;max-height:130px;resize:none;padding:12px 14px;border-radius:14px;
  border:1px solid var(--line);background:var(--card);font-size:15px;line-height:1.4;
}
.composer .send{width:46px;height:46px;border-radius:14px;background:var(--accent);color:#fff;display:grid;place-items:center;flex:0 0 auto}
.composer .send svg{width:19px;height:19px}
.notice{background:var(--warn-bg);border:1px solid #f0e2c6;color:#7a5109;padding:10px 12px;border-radius:12px;font-size:12.5px;margin-top:10px}

/* ---------- 知识库 ---------- */
.field{display:flex;align-items:center;gap:8px;background:var(--card);border:1px solid var(--line);border-radius:13px;padding:0 12px;margin-top:12px}
.field svg{width:17px;height:17px;color:var(--muted);flex:0 0 auto}
.field input{flex:1;border:0;background:none;min-height:46px;font-size:15px;outline:none;min-width:0}
.subject{margin-top:12px}
.subject-head{display:flex;justify-content:space-between;align-items:baseline;margin-bottom:8px}
.subject-head b{font-size:15px}
.subject-head span{font-size:12px;color:var(--muted)}
.chapter{display:flex;align-items:center;gap:10px;padding:10px 0;border-top:1px solid var(--line)}
.chapter .grow{flex:1;min-width:0}
.chapter b{font-size:13.5px;font-weight:550;display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.chapter .mini{font-size:11.5px;color:var(--muted);margin-top:2px}
.chapter .pct{font:600 12px Georgia,serif;color:var(--accent)}
.chapter .progress{font:600 12px Georgia,serif;color:var(--accent);white-space:nowrap}
.point{display:flex;gap:10px;align-items:center;padding:10px 0;border-top:1px solid var(--line)}
.point .grow{flex:1;min-width:0}
.point b{font-size:13px;font-weight:550;display:block}
.point .mini{font-size:11.5px;color:var(--muted);margin-top:2px}
.ask-mini{font-size:12px;color:var(--accent);border:1px solid var(--accent-soft);background:var(--accent-soft);padding:7px 10px;border-radius:10px;white-space:nowrap}

/* 两类内容并列：有题目的章节 / 只有卡片的主题。窄屏一列，宽屏才并排。 */
.lib-two{display:grid;gap:0;margin-top:4px}
.lib-col{min-width:0}
.lib-col-head{display:flex;justify-content:space-between;align-items:baseline;font-size:12px;font-weight:600;color:var(--muted);letter-spacing:.4px;margin-top:16px}
.lib-actions{display:flex;gap:12px}
.card-item{cursor:pointer}
.card-item.read{border-color:var(--accent-soft)}
.card-item-head{display:flex;justify-content:space-between;align-items:baseline;gap:10px}
.card-item-head b{font-size:14.5px;font-weight:600;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.card-item-head .mini{font-size:11.5px;color:var(--muted);white-space:nowrap}
.card-excerpt{font-size:12.5px;color:var(--muted);line-height:1.6;margin-top:8px}
.card-item .mini{font-size:11.5px;color:var(--muted);margin-top:6px}
/* 卡片自测题（M11）：卡片详情里的一小段列表，默认收着——先看卡片正文，需要时再看题。 */
#cardQuestions:empty{display:none}
.card-questions{margin:14px 0 4px;border-top:1px solid var(--line);padding-top:12px}
.card-questions>summary{cursor:pointer;font-size:13px;font-weight:650;color:var(--ink);list-style:none;display:flex;justify-content:space-between;align-items:center;gap:8px}
.card-questions>summary::-webkit-details-marker{display:none}
.card-questions>summary::after{content:"展开";font-size:11px;font-weight:600;color:var(--accent);background:var(--accent-soft);border-radius:999px;padding:3px 8px}
.card-questions[open]>summary::after{content:"收起"}
.qitem{border:1px solid var(--line);border-radius:12px;padding:10px 11px;margin-top:9px;background:var(--card)}
.qitem .qstem{font-size:13px;line-height:1.6;font-weight:600}
.qitem .qopt{font-size:12px;color:var(--muted);line-height:1.55;margin-top:2px}
.qitem .qopt b{color:var(--ink-2);font-weight:600}
.qitem .qmeta{display:flex;justify-content:space-between;align-items:center;gap:8px;margin-top:8px;font-size:11.5px;color:var(--muted)}
.qitem .qactions{display:flex;gap:6px;flex-wrap:wrap}
.qbtn{border:1px solid var(--line);background:var(--card);border-radius:9px;padding:6px 10px;font-size:12px;font-weight:650;color:var(--ink-2)}
.qbtn.on{border-color:var(--accent);background:var(--accent-soft);color:var(--accent-2)}
.qbtn:disabled{cursor:default;opacity:.75}
.qbtn.drop{color:var(--danger)}
.qstate{font-size:11px;font-weight:650;border-radius:999px;padding:2px 7px;background:#eef2f0;color:var(--muted)}
.qstate.adopted{background:var(--accent-soft);color:var(--accent-2)}
.tag{display:inline-block;font-style:normal;font-size:11px;color:var(--accent);background:var(--accent-soft);border-radius:999px;padding:2px 7px;margin-right:6px}
.topic{cursor:pointer}
.topic .mini{font-size:11.5px;color:var(--muted);line-height:1.6;margin-top:4px}
@media(min-width:760px){
  .lib-two{grid-template-columns:1fr 1fr;gap:20px}
}

/* ---------- 我的 ---------- */
.goal-row{display:flex;align-items:center;gap:10px;padding:12px 0;border-top:1px solid var(--line)}
.goal-row:first-of-type{border-top:0}
.goal-row .grow{flex:1;min-width:0}
.goal-row b{font-size:14.5px;font-weight:600}
.goal-row .mini{font-size:12px;color:var(--muted);margin-top:2px}
.goal-row.active b::after{content:"当前";font-size:10px;font-weight:600;color:var(--accent);background:var(--accent-soft);padding:2px 6px;border-radius:999px;margin-left:6px;vertical-align:1px}
.row{display:flex;align-items:center;gap:10px;min-height:50px;padding:4px 0;border-top:1px solid var(--line);width:100%;text-align:left}
.row:first-of-type{border-top:0}
.row .grow{flex:1;min-width:0}
.row .grow b{font-size:14.5px;font-weight:550;display:block}
.row .grow span{font-size:12px;color:var(--muted)}
.row .val{font-size:13px;color:var(--muted)}
/* 按模型拆分（0.26.0）：比上面四行略小一号，缩进一格，看得出它是明细而不是又一条汇总 */
.usage-split-title{font-size:12px;color:var(--muted);padding:10px 0 2px;border-top:1px solid var(--line);margin-top:4px}
.usage-ver{display:flex;align-items:center;gap:10px;padding:7px 0 7px 10px;min-width:0}
.usage-ver .grow{flex:1;min-width:0}
.usage-ver b{font-size:13.5px;font-weight:550;display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.usage-ver span{font-size:11.5px;color:var(--muted);display:block}
.usage-ver .val{font-size:12.5px;color:var(--muted);flex:0 0 auto}
.chev{width:16px;height:16px;color:var(--muted);flex:0 0 auto}

/* ---------- 弹层 ---------- */
dialog{
  border:0;padding:0;border-radius:22px 22px 0 0;width:100%;max-width:560px;
  margin:auto auto 0;background:var(--card);color:var(--ink);
}
dialog::backdrop{background:rgba(9,31,28,.42);backdrop-filter:blur(2px)}
.sheet{padding:10px 18px calc(20px + env(safe-area-inset-bottom));max-height:88dvh;overflow:auto}
.grab{width:38px;height:4px;border-radius:99px;background:#dbe4df;margin:6px auto 14px}
.sheet h2{font-size:18px;margin-bottom:12px}
.sheet label{display:grid;gap:6px;font-size:13px;color:var(--muted);margin-top:12px}
.sheet input,.sheet select,.sheet textarea{
  border:1px solid var(--line);border-radius:12px;padding:12px;min-height:46px;font-size:15px;background:#fbfdfc;color:var(--ink);width:100%;
}
.sheet textarea{min-height:74px;resize:vertical;line-height:1.5}
.sheet .actions{display:flex;gap:10px;margin-top:16px}
.sheet .actions .btn{flex:1}
.danger{color:var(--danger)}

/* ---------- 底部导航 ---------- */
.tabbar{
  position:fixed;left:0;right:0;bottom:0;z-index:30;
  display:grid;grid-template-columns:repeat(5,1fr);
  padding:6px 6px calc(6px + env(safe-area-inset-bottom));
  background:rgba(255,255,255,.92);backdrop-filter:blur(16px);
  border-top:1px solid var(--line);
}
.tabbar button,.tabbar a{
  display:grid;justify-items:center;gap:3px;padding:6px 2px;border-radius:12px;
  font-size:10.5px;color:var(--muted);font-weight:550;
}
.tabbar svg{width:22px;height:22px}
.tabbar .on{color:var(--accent)}
.tabbar .on svg{stroke-width:2.2}
.empty{text-align:center;color:var(--muted);font-size:13px;padding:22px 8px;line-height:1.7}
.toast{
  position:fixed;left:50%;transform:translateX(-50%);bottom:calc(88px + env(safe-area-inset-bottom));
  background:rgba(16,50,46,.94);color:#fff;font-size:13px;padding:10px 16px;border-radius:999px;
  z-index:50;opacity:0;transition:opacity .2s;pointer-events:none;max-width:88vw;text-align:center;
}
.toast.show{opacity:1}
@media(min-width:760px){
  main{padding-left:24px;padding-right:24px;max-width:1080px}
  .bento{grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;align-items:start;grid-auto-flow:row dense}
  /* 左宽右窄：倒计时和日程占两格，右侧留一格给进度环/老师 */
  .tile[data-card="hero"]{grid-column:span 2}
  .tile[data-card="stats"]{grid-column:span 3}
  /* 日程跨两行，右栏由「老师提醒 + 专注」填满，避免大片空白 */
  .tile[data-card="plan"]{grid-column:span 2;grid-row:span 2}
  /* 老师卡收成一格，落在日程右侧，和参考图的窄右栏一致 */
  .tile[data-card="teacher"]{grid-column:span 1}
  .tile[data-card="quick"]{grid-column:span 3}
  .stats-tile{grid-template-columns:repeat(4,minmax(0,1fr))}
  .ring-tile{justify-content:center;text-align:center}
  .teacher-tile .note-body{flex-direction:column;gap:8px;margin-block:0}
  .teacher-tile .note-body p{font-size:12.5px}
  .quick-grid{grid-template-columns:repeat(4,1fr)}
  .desk-greet h1{font-size:26px}
  .ring{max-width:124px}
}

/* ---------- 宽屏：左侧导航栏 ---------- */
@media(min-width:1024px){
  .rail{
    display:flex;flex-direction:column;gap:6px;
    width:212px;flex:0 0 212px;height:100dvh;position:sticky;top:0;z-index:20;
    padding:22px 14px 18px;background:#fff;border-right:1px solid var(--line);
  }
  .rail-brand{display:flex;align-items:center;gap:10px;padding:0 8px 18px}
  .rail-mark{
    width:36px;height:36px;border-radius:12px;display:grid;place-items:center;flex:0 0 auto;
    background:linear-gradient(150deg,#123c36,#0f7a6c);color:var(--lime);font-size:16px;font-weight:700;
  }
  .rail-brand-text{display:grid;gap:1px;min-width:0}
  .rail-brand-text b{font-size:14px;font-weight:650}
  .rail-brand-text span{font-size:11px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .rail-nav{display:grid;gap:3px}
  .rail-nav button,.rail-nav a{
    display:flex;align-items:center;gap:10px;width:100%;padding:8px 10px;
    border-radius:12px;font-size:13.5px;font-weight:550;color:var(--ink-2);text-align:left;
  }
  .rail-nav button:hover,.rail-nav a:hover{background:#f3f8f5}
  .rail-nav .on{background:var(--accent-soft);color:var(--accent-2);font-weight:650}
  .ri{width:28px;height:28px;border-radius:9px;display:grid;place-items:center;flex:0 0 auto}
  .ri svg{width:16px;height:16px}
  .ri-green{background:#e4f3e6;color:#2e7d43}
  .ri-blue{background:#e4eefb;color:#2b62a8}
  .ri-purple{background:#eee8fb;color:#6544a8}
  .ri-amber{background:#fdf0dc;color:#9a6415}
  .ri-slate{background:#eceff0;color:#556b66}
  .rail-foot{
    margin-top:auto;padding:12px 10px;border-radius:14px;background:#f7faf8;
    display:flex;flex-direction:column;gap:1px;
  }
  .rail-foot span{font-size:11px;color:var(--muted);letter-spacing:.6px}
  .rail-foot b{font:400 25px/1.1 Georgia,serif;color:var(--accent-2)}
  .tabbar{display:none}
  main{max-width:1180px;padding:8px 28px 56px}
  .appbar{padding-left:28px;padding-right:28px}
  .composer{bottom:0}
  .toast{bottom:28px}
  .desk-tip{left:calc(212px + 24px);right:24px;bottom:24px;max-width:600px;margin:0 auto}
  main:has(.bento.editing){padding-bottom:140px}
}

/* ---------- 考试日程与提醒 ---------- */
.agenda-line{
  display:flex;align-items:center;gap:8px;width:100%;margin:0 0 12px;
  padding:9px 12px;border-radius:12px;background:var(--accent-soft);
  color:var(--accent-2);font-size:13px;text-align:left;line-height:1.4;
}
.agenda-line b{font-weight:650;white-space:nowrap}
.agenda-line .dot{width:7px;height:7px;border-radius:50%;background:currentColor;flex:0 0 auto}
.agenda-line .grow{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.agenda-line.soon{background:var(--warn-bg);color:var(--warn)}
.agenda-line.overdue{background:#fdecea;color:var(--danger)}
.agenda-line.today{background:#fdecea;color:var(--danger)}
.agenda-line svg{width:15px;height:15px;flex:0 0 auto;opacity:.7}

.agenda-item{display:flex;align-items:flex-start;gap:10px;padding:12px 0;border-top:1px solid var(--line)}
.agenda-item:first-child{border-top:0;padding-top:2px}
.agenda-item.done{opacity:.55}
.agenda-item .grow{min-width:0}
.agenda-item b{font-size:14px;font-weight:600}
.agenda-item .mini{font-size:12px;color:var(--muted);margin-top:2px;line-height:1.5}
.agenda-item .when{font-size:12px;font-weight:600;white-space:nowrap;color:var(--muted)}
.agenda-item.soon .when,.agenda-item.today .when{color:var(--danger)}
.agenda-item.overdue .when{color:var(--danger)}
.agenda-item.done .when{color:var(--muted)}
.tickbox{
  width:24px;height:24px;border-radius:50%;border:1.5px solid var(--line);flex:0 0 auto;
  display:grid;place-items:center;font-size:12px;color:transparent;margin-top:1px;background:#fff;
}
.tickbox.on{background:var(--accent);border-color:var(--accent);color:#fff}
.agenda-del{font-size:12px;color:var(--muted);padding:4px 2px;flex:0 0 auto}
.agenda-foot{display:flex;gap:8px;margin-top:10px}
.agenda-foot .btn{flex:1;min-height:40px;font-size:13px}

/* ---------- 学习路线 ---------- */
.roadmap-head{display:flex;align-items:baseline;justify-content:space-between;gap:8px}
.roadmap-head b{font-size:15px}
.roadmap-head span{font-size:12px;color:var(--muted)}
.roadmap-bar{height:6px;border-radius:999px;background:var(--line);margin:12px 0 4px;overflow:hidden}
.roadmap-bar i{display:block;height:100%;background:var(--accent);border-radius:999px;transition:width .3s}
.stage{display:flex;gap:10px;padding:12px 0;border-top:1px solid var(--line)}
.stage:first-of-type{border-top:0}
.stage .no{
  width:24px;height:24px;flex:0 0 auto;border-radius:8px;display:grid;place-items:center;
  font-size:12px;font-weight:700;background:var(--accent-soft);color:var(--accent);margin-top:1px;
}
.stage.now .no{background:var(--accent);color:#fff}
.stage.done .no{background:var(--line);color:var(--muted)}
.stage.done .stage-title{color:var(--muted);text-decoration:line-through}
.stage .grow{min-width:0}
.stage-title{font-size:14px;font-weight:600}
.stage-meta{font-size:12px;color:var(--muted);margin-top:2px;line-height:1.5}
.stage-actions{margin:8px 0 0;padding-left:16px;font-size:12.5px;color:var(--ink-2);line-height:1.65}
.stage-actions li{margin-bottom:2px}
.stage-check{font-size:12px;color:var(--muted);margin-top:6px}
.stage .stage-done{font-size:12px;color:var(--accent);font-weight:600;white-space:nowrap;flex:0 0 auto;padding:2px 0}
.stage-more{font-size:12px;color:var(--accent);margin-top:6px;font-weight:600}
.next-box{margin-top:12px;padding:12px;border-radius:12px;background:var(--accent-soft);font-size:13px;line-height:1.6;color:var(--accent-2)}
.next-box b{display:block;margin-bottom:4px}
.next-box ul{margin:6px 0 0;padding-left:16px}
.next-box li{margin-bottom:2px}
.roadmap-note{font-size:11.5px;color:var(--muted);margin-top:10px;line-height:1.6}

/* ---------- 专注计时（今日屏顶部，0.21.0 从旧学习页迁进来） ---------- */
.focus-top{display:flex;align-items:center;justify-content:space-between;gap:14px;background:var(--card);border:1px solid var(--line);border-radius:var(--radius);padding:14px 16px;margin-top:14px}
.focus-top .tile-label{margin:0}
.focus-top-clock b{display:block;font:400 30px/1.15 Georgia,serif;letter-spacing:-.5px;font-variant-numeric:tabular-nums;color:var(--ink-2)}
.focus-top.running .focus-top-clock b{color:var(--accent)}
.focus-top-side{min-width:0;text-align:right}
.focus-top-side .mini{margin:0 0 8px;font-size:11.5px;line-height:1.5;color:var(--muted)}
.focus-top-actions{display:flex;gap:8px;justify-content:flex-end}
.focus-top-actions .btn{min-height:38px;padding:0 14px;font-size:13px}

/* ---------- 课程视频 ---------- */
.video-item{margin-top:10px}
.video-actions{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin-top:10px}
.video-actions .btn{min-height:38px;padding:0 12px;font-size:13px}
.video-actions .mini{margin:0}
.small-chip{font-size:12.5px}
.video-practice{display:flex;flex-wrap:wrap;gap:8px;margin-top:12px}
dialog video{width:100%;max-height:46vh;border-radius:12px;background:#0f2a30}

/* ---------- 学习记录 / 掌握度 ---------- */
.report-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:10px;margin:4px 0 8px}
.report-stat{background:var(--accent-soft);border-radius:12px;padding:10px}
.report-stat small{display:block;font-size:11px;line-height:1.4;color:var(--muted)}
.report-stat strong{display:block;margin-top:4px;font:400 20px/1.2 Georgia,serif;color:var(--ink-2)}
.mastery-row{display:block;margin-top:10px}
@media(max-width:520px){
  .report-grid{grid-template-columns:1fr 1fr}
  .focus-top{flex-direction:column;align-items:stretch}
  .focus-top-side{text-align:left}
  .focus-top-actions{justify-content:flex-start}
}

/* ---------- 老师的记忆（0.23.0） ---------- */
.mem-item{padding:12px 0;border-bottom:1px solid var(--line)}
.mem-item:last-child{border-bottom:0;padding-bottom:2px}
.mem-head{display:flex;align-items:center;gap:8px}
.mem-kind{font-size:11px;font-weight:650;border-radius:999px;padding:2px 8px;background:var(--accent-soft);color:var(--accent-2)}
.mem-kind.confusion{background:#fdf0e6;color:#a2561b}
.mem-kind.preference{background:#e9f2fb;color:#1b5a8a}
.mem-state{font-size:11px;color:var(--muted);margin-left:auto}
.mem-state.draft{color:var(--danger)}
.mem-body{margin-top:8px;font-size:13.5px;line-height:1.65;color:var(--ink-2)}
.mem-actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:10px}
.mem-actions-bar{display:flex;gap:8px;margin-top:10px;max-width:520px}
.mem-actions-bar .btn{flex:1}

/* 一类题（M13 前半）：簇列表。手机上按钮换行但不挤压，簇与簇之间只用分隔线。 */
.mistake-item{padding:12px 0;border-top:1px solid var(--line)}
.mistake-item:first-child{border-top:0;padding-top:2px}
.mistake-item details{margin:6px 0 2px}
.mistake-item summary{cursor:pointer;color:var(--accent-2)}
.row-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:8px}
.row-actions .btn{min-height:38px;padding:0 14px;font-size:13px}

/* 让老师讲讲（0.25.0）：就地展开的解读块，手机上不弹窗（弹窗会盖住上面的数字）。 */
.teacher-say{margin-top:10px;padding:12px 14px;border:1px solid var(--line);border-radius:12px;background:var(--card)}
.teacher-say-head{display:flex;justify-content:space-between;align-items:baseline;gap:8px;flex-wrap:wrap;margin-bottom:6px}
.explain-text{margin:0;white-space:pre-line;line-height:1.75;font-size:14px;overflow-wrap:anywhere}
.teacher-say details{margin-top:8px}
.teacher-say summary{cursor:pointer;color:var(--accent-2);font-size:13px}

.explain-preview{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:6;overflow:hidden;white-space:pre-line;line-height:1.75;color:var(--text)}
.explain-fold[open] .explain-preview,.explain-fold[open] .explain-open,.explain-fold:not([open]) .explain-close{display:none}
.explain-fold summary{list-style:none}
