/* ============ 免疫学助教 · Editorial greeting（tasteskill v2） ============
   风格：editorial-greeting · shell：tinted frame + white sheet
   规则：无渐变/玻璃/常驻阴影/emoji；色彩只上数据与链接；1px 分隔；色调面板。 */

:root {
  --ground: #ffffff;
  --chrome: #f7f7f6;
  --surface: #f9f9f9;
  --raised: #ffffff;
  --active: #ececea;
  --border: #eaeaea;
  --rule: #f3f3f3;
  --control: #d9d9d6;
  --text: #1f201d;
  --muted: #636361;
  --faint: #6b6b6b;
  --accent: #1b6e66;
  --accent-tint: #eef4f2;
  --primary: #1f201d;
  --positive: #247b50;
  --negative: #b42318;
  --pill-positive-bg: #dcfae5; --pill-positive-ink: #04250e;
  --pill-negative-bg: #fdecea; --pill-negative-ink: #7a1d14;
  --pill-warning-bg: #fffbeb;  --pill-warning-ink: #92400e;
  --pill-neutral-bg: #f3f3f3;  --pill-neutral-ink: #3d3d3a;
  --radius-card: 22px;
  --radius-control: 999px;
  --gap: 16px;
  --pad: 20px;
  --sidebar-width: 232px;
  --font-sans: "Instrument Sans", -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-serif: "Instrument Serif", Georgia, "Songti SC", "STSong", "SimSun", serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font-sans);
  background: var(--chrome);
  color: var(--text);
  display: flex; flex-direction: column; overflow: hidden;
  font-size: 14px; line-height: 1.5;
}

/* ---------- 顶栏（chrome，48px） ---------- */
.topbar {
  height: 48px; flex: none;
  display: flex; align-items: center; gap: 10px;
  padding: 0 14px 0 16px;
}
.topbar-title { font-size: 14px; font-weight: 600; flex: 1; min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.icon-btn {
  display: none; border: none; background: transparent;
  width: 36px; height: 36px; border-radius: var(--radius-control); color: var(--text); cursor: pointer;
  align-items: center; justify-content: center;
}
.icon-btn:hover { background: var(--active); }
.btn-primary {
  border: none; cursor: pointer; font-family: inherit;
  background: transparent; color: var(--text);
  font-size: 13px; font-weight: 500; padding: 0 14px; height: 32px;
}
#newChatBtn { background: var(--primary); color: var(--ground); }
#newChatBtn:hover { opacity: .88; }
#loginBtn { background: var(--primary); color: var(--ground); height: 38px; padding: 0 18px; }
#loginBtn:hover { opacity: .88; }

/* 用户角标 */
.user-chip { display: flex; }
.user-chip[hidden] { display: none; }
.user-chip {
  align-items: center; gap: 7px; cursor: pointer;
  border: 1px solid var(--border); border-radius: var(--radius-control);
  padding: 3px 11px 3px 4px; transition: background .12s; max-width: 150px;
  background: var(--raised);
}
.user-chip:hover { background: var(--active); }
.user-avatar {
  width: 24px; height: 24px; border-radius: 50%; flex: none;
  background: var(--active); color: var(--text);
  font-size: 12px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
}
.user-name { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 用户菜单（浮动，允许小阴影） */
.user-menu {
  position: fixed; top: 52px; right: 12px; z-index: 60;
  min-width: 160px; background: var(--raised); border: 1px solid var(--border);
  border-radius: 12px; box-shadow: 0 8px 24px rgba(0, 0, 0, .07);
  padding: 6px; animation: fadeIn .12s ease;
}
.um-item {
  width: 100%; text-align: left; border: none; background: transparent; cursor: pointer;
  color: var(--text); font-size: 13px; padding: 8px 10px; border-radius: 8px; font-family: inherit;
}
.um-item:hover { background: var(--active); }

/* ---------- 布局 ---------- */
.layout { flex: 1; display: flex; min-height: 0; }

/* ---------- 侧栏 ---------- */
.sidebar { width: var(--sidebar-width); flex: none; display: flex; }
.sidebar-panel {
  width: 100%; display: flex; flex-direction: column; min-height: 0;
}
.sidebar-mask { display: none; }
.side-brand { display: flex; align-items: center; gap: 10px; padding: 6px 16px 14px; }
.mark { width: 30px; height: 30px; flex: none; color: var(--accent); }
.side-brand-name { font-size: 14px; font-weight: 600; }
.side-brand-scope { font-size: 12px; color: var(--muted); margin-top: 1px; }
.side-tabs { display: flex; gap: 14px; padding: 6px 14px 0; border-bottom: 1px solid var(--border); }
.side-tab {
  border: none; background: transparent; cursor: pointer; font-family: inherit;
  font-size: 13px; font-weight: 500; color: var(--muted);
  padding: 8px 2px; border-bottom: 2px solid transparent; transition: color .12s;
}
.side-tab.active { color: var(--text); border-bottom-color: var(--accent); }
.tab-page { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.tab-page[hidden] { display: none; }
.chapter-list { flex: 1; overflow-y: auto; padding: 8px 12px 12px; }
.group-title { font-size: 12px; color: var(--muted); padding: 14px 8px 5px; }
.chapter-item {
  display: block; width: 100%; text-align: left; border: none; cursor: pointer;
  background: transparent; color: var(--text);
  font-size: 13.5px; line-height: 1.4; padding: 7px 10px; border-radius: 8px;
  transition: background .1s; font-family: inherit;
}
.chapter-item:hover { background: var(--active); }
.chapter-item .no { color: var(--muted); margin-right: 6px; font-size: 12.5px; }

.history-item {
  position: relative; display: flex; align-items: baseline; gap: 8px; width: 100%; text-align: left; cursor: pointer;
  border: none; background: transparent; font-family: inherit; color: var(--text);
  padding: 9px 10px; border-radius: 8px; transition: background .1s;
}
.history-item:hover { background: var(--active); }
.history-item.active { background: var(--active); }
.history-item .h-name {
  flex: 1; min-width: 0; font-size: 13.5px; font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.history-item.active .h-name { color: var(--accent); }
.history-item .h-time { font-size: 12px; color: var(--muted); flex: none; }
.h-del {
  flex: none; border: none; background: transparent; cursor: pointer; color: var(--muted);
  font-size: 12px; padding: 3px 6px; border-radius: 6px; opacity: 0; transition: opacity .12s;
  font-family: inherit;
}
.history-item:hover .h-del { opacity: 1; }
.h-del:hover { color: var(--negative); }
.loading-note { padding: 20px 14px; color: var(--muted); font-size: 13px; line-height: 1.8; }
.sidebar-foot {
  border-top: 1px solid var(--border); padding: 12px 16px;
  font-size: 12px; color: var(--muted);
}
.foot-row { display: flex; align-items: center; gap: 6px; padding: 2px 0; }
.foot-row.dim { color: var(--muted); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--control); flex: none; }
.dot.ok { background: var(--positive); }
.dot.bad { background: var(--negative); }

/* ---------- 白纸 ---------- */
.sheet {
  flex: 1; min-width: 0; display: flex; flex-direction: column;
  background: var(--ground);
  border: 1px solid var(--border); border-radius: 16px;
  margin: 0 8px 8px 0;
  overflow: hidden;
}
.chat-scroll { flex: 1; overflow-y: auto; scroll-behavior: smooth; position: relative; }

/* ---------- 主页 ---------- */
.home { max-width: 1100px; margin: 0 auto; padding: 64px 32px 40px; }
.home-head { margin-bottom: 44px; }
.greeting {
  font-family: var(--font-serif);
  font-size: 46px; font-weight: 700; line-height: 1.1; letter-spacing: -0.01em;
}
.home-sub { font-size: 14px; color: var(--muted); margin-top: 12px; }

/* 登录面板 */
.login-panel {
  background: var(--surface); border-radius: var(--radius-card);
  padding: 24px; margin-bottom: 24px;
}
.login-title { font-size: 16px; font-weight: 600; }
.login-desc { font-size: 13px; color: var(--muted); margin-top: 6px; max-width: 560px; line-height: 1.6; }
.login-fields { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.login-input {
  border: 1px solid var(--control); border-radius: 10px; background: var(--raised);
  padding: 9px 13px; font-size: 14px; font-family: inherit; outline: none;
  color: var(--text); width: 220px; transition: border-color .12s;
}
.login-input:focus { border-color: var(--accent); }
.login-err { color: var(--negative); font-size: 12.5px; margin-top: 10px; }
.login-input::placeholder { color: var(--faint); }

/* 计数磁贴 */
.tiles {
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: var(--surface); border-radius: var(--radius-card);
  margin-bottom: 16px;
}
.tile { padding: 20px 16px; min-height: 128px; }
.tile + .tile { border-left: 1px solid var(--border); }
.tile-label { font-size: 12px; color: var(--muted); }
.tile-value { font-size: 32px; font-weight: 400; font-variant-numeric: tabular-nums; margin-top: 14px; }
.tile-cap { font-size: 12px; color: var(--muted); margin-top: 8px; }

/* 面板 */
.panels { display: grid; grid-template-columns: 3fr 1fr; gap: var(--gap); align-items: start; }
.panel { background: var(--surface); border-radius: var(--radius-card); padding: var(--pad); }
.span9 { grid-column: span 9; } .span3 { grid-column: span 3; }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 10px; }
.panel-title { font-size: 14px; font-weight: 600; }
.panel-hint { font-size: 12px; color: var(--muted); }
.row-list { display: flex; flex-direction: column; gap: 8px; }
.row-card {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 63px; padding: 10px 16px; cursor: pointer; text-align: left;
  background: var(--raised); border: 1px solid var(--border); border-radius: 12px;
  font-family: inherit; color: var(--text); transition: border-color .12s;
}
.row-card:hover { border-color: var(--accent); }
.row-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.row-name { font-size: 14px; font-weight: 500; }
.row-sub { font-size: 12.5px; color: var(--muted); }
.row-action { flex: none; font-size: 12.5px; color: var(--accent); }

.kv-list { display: flex; flex-direction: column; }
.kv-row {
  display: flex; justify-content: space-between; align-items: center;
  min-height: 40px; font-size: 13.5px;
  border-top: 1px solid var(--rule);
}
.kv-row:first-child { border-top: none; }
.kv-val { color: var(--muted); font-size: 12.5px; }

/* 免疫应答交互地图 */
.map-panel, .gallery-panel { margin-top: var(--gap); }
.flow { display: flex; align-items: flex-start; margin: 8px 0 14px; overflow-x: auto; padding-bottom: 4px; }
.flow-node {
  flex: none; display: flex; flex-direction: column; align-items: center; gap: 8px;
  border: none; background: transparent; cursor: pointer; font-family: inherit;
  width: 96px; padding: 6px 2px;
}
.flow-dot {
  width: 34px; height: 34px; border-radius: 50%;
  border: 1.5px solid var(--control); background: var(--raised);
  transition: border-color .12s, background .12s;
}
.flow-node:hover .flow-dot { border-color: var(--accent); }
.flow-node.active .flow-dot { background: var(--accent); border-color: var(--accent); }
.flow-name { font-size: 12.5px; color: var(--muted); text-align: center; line-height: 1.3; }
.flow-node.active .flow-name { color: var(--accent); font-weight: 600; }
.flow-line { flex: 1 1 24px; min-width: 14px; height: 1.5px; background: var(--control); margin-top: 23px; }
.flow-detail {
  background: var(--raised); border: 1px solid var(--border); border-radius: 12px;
  padding: 16px 18px; min-height: 96px;
}
.fd-title { font-size: 14px; font-weight: 600; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.fd-ch { font-size: 12px; color: var(--accent); font-weight: 500; }
.fd-desc { font-size: 13.5px; color: var(--muted); line-height: 1.7; margin: 8px 0 12px; max-width: 720px; }
.fd-empty { font-size: 13px; color: var(--muted); }
.fd-ask {
  border: 1px solid var(--control); background: var(--raised); color: var(--text);
  cursor: pointer; font-family: inherit; font-size: 13px; font-weight: 500;
  padding: 7px 14px; border-radius: var(--radius-control); transition: border-color .12s, color .12s;
}
.fd-ask:hover { border-color: var(--accent); color: var(--accent); }

/* 教材图集 */
.gallery {
  display: flex; gap: 12px; overflow-x: auto; padding: 2px 2px 10px;
  scroll-snap-type: x proximity;
}
.gcard {
  flex: none; width: 172px; cursor: pointer; text-align: left;
  border: 1px solid var(--border); border-radius: 12px; background: var(--raised);
  padding: 8px; font-family: inherit; scroll-snap-align: start;
  display: flex; flex-direction: column; gap: 6px; transition: border-color .12s;
}
.gcard:hover { border-color: var(--accent); }
.gcard img { width: 100%; height: 190px; object-fit: cover; object-position: top; border-radius: 6px; }
.gcard-fig { font-size: 11.5px; color: var(--accent); font-weight: 600; }
.gcard-title { font-size: 12.5px; color: var(--text); line-height: 1.4; }
.gallery-credit { font-size: 12px; color: var(--muted); margin-top: 6px; }

/* 页码直达 */
.page-jump { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); }
.page-jump-input {
  width: 72px; border: 1px solid var(--control); border-radius: 8px; background: var(--raised);
  color: var(--text); padding: 6px 8px; font-family: inherit; font-size: 13px; text-align: center;
  outline: none;
}
.page-jump-input:focus { border-color: var(--accent); }
.page-jump-btn {
  border: 1px solid var(--control); background: var(--raised); color: var(--text);
  font-family: inherit; font-size: 12.5px; padding: 6px 12px; border-radius: 8px; cursor: pointer;
}
.page-jump-btn:hover { border-color: var(--accent); color: var(--accent); }
.page-jump-hint { font-size: 12px; color: var(--muted); }

/* 教材页阅读器：矢量缩放 */
.page-viewer {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(12, 10, 18, .93);
  display: flex; flex-direction: column;
}
.page-viewer[hidden] { display: none; }
.pv-toolbar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 10px 16px; background: #17131f; border-bottom: 1px solid #2b2540; flex: none;
}
.pv-btn {
  border: 1px solid #2b2540; background: transparent; color: var(--text);
  font-family: inherit; font-size: 13px; padding: 6px 12px;
  border-radius: var(--radius-control); cursor: pointer; white-space: nowrap;
}
.pv-btn:hover { border-color: var(--accent); color: var(--accent); }
.pv-page-wrap { font-size: 13px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.pv-page-input {
  width: 64px; border: 1px solid var(--control); border-radius: 8px;
  background: transparent; color: var(--text); padding: 5px 8px;
  font-family: inherit; font-size: 13px; text-align: center;
}
.pv-zoom-label { font-size: 12.5px; color: var(--muted); min-width: 44px; text-align: center;
  font-variant-numeric: tabular-nums; }
.pv-sep { width: 1px; height: 20px; background: #2b2540; }
.pv-flex { flex: 1; }
.pv-ask { border-color: var(--accent); color: var(--accent); }
.pv-close:hover { border-color: var(--negative); color: var(--negative); }
.pv-canvas {
  flex: 1; overflow: auto; padding: 16px;
  cursor: grab; position: relative;
}
.pv-canvas:active { cursor: grabbing; }
.pv-canvas img {
  display: block; height: auto; max-width: none;
  border: 1px solid #2b2540; background: #fff;
  box-shadow: 0 10px 40px rgba(0, 0, 0, .4);
}
.pv-loading {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
  background: #17131f; border: 1px solid #2b2540; color: var(--text);
  font-size: 13px; padding: 10px 18px; border-radius: var(--radius-control);
}

/* ---------- 消息 ---------- */
.messages { max-width: 860px; margin: 0 auto; padding: 28px 24px 12px; }
.msg { margin-bottom: 26px; }
.msg.user { display: flex; justify-content: flex-end; }
.msg.user .bubble {
  max-width: 78%; background: var(--accent-tint);
  border-radius: 16px; padding: 11px 15px; font-size: 14.5px; line-height: 1.65;
  white-space: pre-wrap; overflow-wrap: break-word;
}
.msg.bot .bot-head { margin-bottom: 6px; }
.bot-who { font-size: 12px; color: var(--muted); }
.msg.bot .bubble { font-size: 14.5px; line-height: 1.75; overflow-wrap: break-word; }
.faint { color: var(--muted); }

/* markdown */
.bubble h1, .bubble h2, .bubble h3 { margin: 14px 0 8px; line-height: 1.4; font-size: 16px; }
.bubble p { margin: 7px 0; }
.bubble ul, .bubble ol { padding-left: 22px; margin: 7px 0; }
.bubble li { margin: 3px 0; }
.bubble a { color: var(--accent); text-decoration: none; word-break: break-all; }
.bubble a:hover { text-decoration: underline; }
.bubble code { background: var(--surface); border: 1px solid var(--rule); border-radius: 4px; padding: 1px 5px; font-size: 13px; }
.bubble pre { background: var(--surface); border: 1px solid var(--rule); padding: 12px 14px; border-radius: 10px; overflow-x: auto; margin: 9px 0; }
.bubble pre code { background: transparent; border: none; padding: 0; }
.bubble table { border-collapse: collapse; margin: 10px 0; width: 100%; font-size: 13.5px; }
.bubble th, .bubble td { border-top: 1px solid var(--rule); padding: 7px 10px; text-align: left; }
.bubble tr:first-child th, .bubble tr:first-child td { border-top: none; }
.bubble th { font-weight: 600; font-size: 12px; color: var(--muted); }
.bubble blockquote { border-left: 3px solid var(--control); padding: 2px 14px; color: var(--muted); margin: 8px 0; }
.bubble hr { border: none; border-top: 1px solid var(--rule); margin: 12px 0; }

/* 工具标签 */
.tool-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.tool-tag {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; border-radius: var(--radius-control); padding: 3px 10px;
  background: var(--pill-neutral-bg); color: var(--pill-neutral-ink);
}
.tool-tag.spin::after {
  content: ''; width: 9px; height: 9px;
  border: 1.5px solid var(--muted); border-top-color: transparent;
  border-radius: 50%; animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* 光标与思考中 */
.cursor-blink {
  display: inline-block; width: 7px; height: 15px; margin-left: 2px;
  background: var(--accent); vertical-align: -2px;
  animation: blinkCaret .9s steps(2) infinite;
}
@keyframes blinkCaret { 0%,49% { opacity: 1; } 50%,100% { opacity: 0; } }
.typing { display: inline-flex; gap: 4px; padding: 4px 0; }
.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%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }

/* 自检徽章 */
.verify-badge {
  display: inline-block; margin-top: 10px; font-size: 12px;
  padding: 4px 10px; border-radius: var(--radius-control);
}
.verify-badge.pass { background: var(--pill-positive-bg); color: var(--pill-positive-ink); }
.verify-badge.warn { background: var(--pill-warning-bg); color: var(--pill-warning-ink); }

/* 错误 / 提示 */
.errbar { color: var(--negative); font-size: 13.5px; margin-bottom: 10px; }
.notebar {
  display: inline-block; font-size: 13px; color: var(--muted);
  background: var(--surface); border: 1px dashed var(--control);
  padding: 8px 12px; border-radius: 8px;
}

/* 轮次 */
.turn-badge { text-align: center; font-size: 12px; color: var(--muted); padding: 0 0 8px; }

/* 思维导图 */
.mindmap-box {
  position: relative; border: 1px solid var(--border);
  border-radius: 12px; overflow: hidden; background: var(--raised);
}
.mm-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 8px 10px; border-bottom: 1px solid var(--rule);
}
.mm-btn {
  border: 1px solid var(--control); background: var(--raised); color: var(--text);
  font-family: inherit; font-size: 12px; padding: 4px 10px;
  border-radius: var(--radius-control); cursor: pointer;
}
.mm-btn:hover { border-color: var(--accent); color: var(--accent); }
.mm-hint { font-size: 11.5px; color: var(--faint); }
.mm-stage { height: 440px; background: var(--raised); }
.mm-stage svg { width: 100%; height: 100%; display: block; touch-action: none; }
.mm-stage .mm-outline {
  margin: 0; padding: 16px 20px; font-family: var(--font-sans);
  font-size: 13.5px; line-height: 1.9; color: var(--text);
  white-space: pre-wrap; height: 100%; overflow: auto; box-sizing: border-box;
}
.mm-link { fill: none; stroke: var(--control); stroke-width: 1.5; }
.mm-link.d0 { stroke: var(--accent); stroke-width: 2; }
.mm-node rect { fill: var(--raised); stroke: var(--control); }
.mm-node.d0 rect { fill: var(--accent); stroke: none; }
.mm-node.d0 text { fill: #ffffff; font-weight: 600; }
.mm-node.d1 rect { stroke: var(--accent); }
.mm-node text { font-size: 12.5px; fill: var(--text); font-family: var(--font-sans); }
.mm-wait { color: var(--muted); font-size: 13px; padding: 18px; text-align: center; }

/* ---------- 输入区 ---------- */
.composer-wrap { flex: none; padding: 4px 24px 20px; }
.composer {
  display: flex; align-items: flex-end; gap: 10px;
  background: var(--raised); border: 1px solid var(--control); border-radius: var(--radius-control);
  padding: 8px 8px 8px 20px;
  transition: border-color .12s;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .05);
}
.composer:focus-within { border-color: var(--accent); }
#input {
  flex: 1; border: none; outline: none; resize: none; background: transparent;
  font-size: 14.5px; line-height: 1.6; max-height: 132px; font-family: inherit; color: var(--text);
  padding: 6px 0;
}
.send-btn {
  width: 36px; height: 36px; flex: none; border: none; cursor: pointer;
  background: var(--primary); color: var(--ground);
  border-radius: var(--radius-control);
  display: flex; align-items: center; justify-content: center; transition: opacity .12s;
}
.send-btn:hover { opacity: .85; }
.send-btn:disabled { opacity: .4; cursor: not-allowed; }
.composer-hint { text-align: center; font-size: 12px; color: var(--muted); padding-top: 8px; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .cursor-blink, .typing i, .tool-tag.spin::after { animation: none !important; }
}

/* ---------- 移动端 ---------- */
@media (max-width: 860px) {
  /* 手机回归文档滚动：输入条在页面末尾，发送后自动滚底即达 */
  html, body { overflow: visible; height: auto; }
  body { display: block; }
  .layout { display: block; }
  .main { display: block; }
  .sheet { margin: 0; border: none; border-radius: 0; overflow: visible; display: block; }
  .chat-scroll { overflow: visible; height: auto; }
  .composer-wrap {
    background: var(--ground);
    border-top: 1px solid var(--border);
    padding: 10px 16px 14px;
  }
  .composer-hint { display: none; }
  .icon-btn { display: flex; }
  .topbar { padding: 0 8px 0 6px; }
  .topbar-title { font-size: 14px; }
  .home { padding: 20px 16px 24px; }
  .greeting { font-size: 28px; }
  .home-head { margin-bottom: 28px; }
  .tiles { grid-template-columns: repeat(2, 1fr); }
  .tile:nth-child(3) { border-left: none; }
  .tile:nth-child(n+3) { border-top: 1px solid var(--border); }
  .tile { min-height: 104px; }
  .panels { grid-template-columns: 1fr; }
  .flow { flex-direction: column; align-items: stretch; }
  .flow-line { display: none; }
  .flow-node { flex-direction: row; width: 100%; justify-content: flex-start; gap: 10px; padding: 8px 6px; }
  .messages { padding: 20px 14px 8px; }
  .msg.user .bubble { max-width: 88%; }
  .composer-wrap { padding: 4px 16px 16px; }
  .login-fields .login-input { width: 100%; }
  .sidebar { position: fixed; inset: 0; z-index: 50; width: auto; visibility: hidden; }
  .sidebar.open { visibility: visible; }
  .sidebar-mask { display: block; position: absolute; inset: 0; background: rgba(0, 0, 0, .4); opacity: 0; transition: opacity .2s; }
  .sidebar.open .sidebar-mask { opacity: 1; }
  .sidebar-panel {
    position: absolute; left: 0; top: 0; bottom: 0; width: 292px;
    background: var(--chrome);
    transform: translateX(-100%); transition: transform .22s ease;
    box-shadow: 8px 0 24px rgba(0, 0, 0, .10);
  }
  .sidebar.open .sidebar-panel { transform: none; }
}

/* ---------- 自测练习入口卡（/quiz/） ---------- */
.quiz-entry {
  margin-top: var(--gap);
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 22px var(--pad);
  text-decoration: none;
  color: inherit;
  border-left: 4px solid var(--accent);
  transition: border-color .15s, background .15s;
}
.quiz-entry:hover { border-left-width: 6px; background: var(--accent-tint); }
.quiz-entry-icon {
  flex: none;
  width: 54px;
  height: 54px;
  border-radius: 14px;
  background: var(--accent-tint);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .18s;
}
.quiz-entry:hover .quiz-entry-icon { transform: scale(1.06); }
.quiz-entry-main { flex: 1; min-width: 0; }
.quiz-entry-title {
  font-size: 17px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.quiz-entry-pill {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-tint);
  border: 1px solid #d5e4e0;
  border-radius: var(--radius-control);
  padding: 2px 12px;
  font-variant-numeric: tabular-nums;
}
.quiz-entry-pill b { font-weight: 700; }
.quiz-entry-sub { font-size: 12.5px; color: var(--muted); margin-top: 5px; line-height: 1.6; }
.quiz-entry-go {
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent-tint);
  color: var(--accent);
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, color .15s, transform .15s;
}
.quiz-entry:hover .quiz-entry-go { background: var(--accent); color: #fff; transform: translateX(3px); }

/* ---------- 主观题直达三卡 ---------- */
.subj-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gap);
  margin-top: var(--gap);
}
.subj-card {
  position: relative;
  background: var(--ground);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 20px 18px 16px;
  text-decoration: none;
  color: inherit;
  overflow: hidden;
  transition: border-color .15s, transform .15s, box-shadow .15s;
}
.subj-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--card-color, var(--accent));
  opacity: .85;
  transition: width .15s;
}
.subj-card:hover { border-color: var(--card-color, var(--accent)); transform: translateY(-3px); }
.subj-card:hover::before { width: 6px; }
.subj-card b { display: block; font-size: 16px; font-weight: 650; color: var(--card-color, var(--accent)); }
.subj-card span { display: block; font-size: 12.5px; color: var(--muted); margin-top: 6px; line-height: 1.55; }
.subj-card em {
  display: block;
  font-style: normal;
  font-size: 12px;
  color: var(--muted);
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid var(--rule);
}
.subj-card em i { font-style: normal; font-weight: 700; color: var(--card-color, var(--accent)); font-variant-numeric: tabular-nums; }
.subj-term  { --card-color: #1b6e66; }
.subj-short { --card-color: #9a6b2f; }
.subj-essay { --card-color: #6b5b95; }
.subj-card:hover { box-shadow: 0 6px 18px rgba(31, 32, 29, .08); }

