/* ==========================================================================
   CloudLab · 界面增强层 polish.css
   加载顺序：所有页面级 CSS 与 chrome.css 之后（</head> 前最后引入）。
   职责（只增强，不改页面几何与品牌识别）：
     1) 主题切换 320ms 平滑过渡（尊重 prefers-reduced-motion）
     2) z-index 语义层级归拢 —— 消除浮层/页头/工具条相互压盖
     3) 表面三级分层 + 统一描边/阴影 —— 分界清晰
     4) 滚动条 / 选区 / 焦点 / 微交互 —— 现代化手感
   兼容 app.css（--cl-*）与 ide.css（--bg/--panel/--accent）两套令牌。
   ========================================================================== */

/* ---------- 0. 层级语义令牌 ---------- */
:root{
  --cl-z-content:1;        /* 普通内容 */
  --cl-z-raised:20;        /* 卡片内浮起的小件 */
  --cl-z-sticky:90;        /* 吸顶页头 / 工位条（沿用现有 90） */
  --cl-z-dock:120;         /* 底部 Dock / 工具条 */
  --cl-z-pop:200;          /* 下拉、气泡、命令面板 */
  --cl-z-overlay:300;      /* 遮罩层（搜索 / 查看器共用底） */
  --cl-z-viewer:310;       /* 内联查看器（高于搜索遮罩） */
  --cl-z-modal:330;        /* 模态对话框 */
  --cl-z-toast:400;        /* 全局提示 */
  --cl-z-skip:500;         /* 跳到主内容（最顶，键盘可达） */
}

/* ---------- 1. 主题切换平滑过渡 ----------
   shell.js 在切换瞬间给 <html> 加 .cl-theme-anim，~340ms 后移除。
   只在这个窗口内启用全局颜色过渡，避免长期驻留拖慢渲染。 */
html.cl-theme-anim,
html.cl-theme-anim *,
html.cl-theme-anim *::before,
html.cl-theme-anim *::after{
  transition:
    background-color .32s ease,
    background .32s ease,
    color .32s ease,
    border-color .32s ease,
    box-shadow .32s ease,
    fill .32s ease,
    stroke .32s ease,
    outline-color .32s ease !important;
}
/* 切换期间禁用指针，避免过渡中误触 */
html.cl-theme-anim body{ pointer-events:none; }
@media (prefers-reduced-motion: reduce){
  html.cl-theme-anim,
  html.cl-theme-anim *,
  html.cl-theme-anim *::before,
  html.cl-theme-anim *::after{ transition:none !important; }
  html.cl-theme-anim body{ pointer-events:auto; }
}

/* ---------- 2. 浮层层级归拢（只覆盖已知浮层，不动内容布局） ---------- */
body .cl-skip-link{ z-index:var(--cl-z-skip); }
/* 全站搜索遮罩 */
body #cl-search-mask{ z-index:var(--cl-z-overlay); }
/* 内联文件查看器（应在搜索之上，便于从搜索结果直接预览） */
body #cl-viewer{ z-index:var(--cl-z-viewer); }
/* 全局提示条（最顶浮层之一，绝不被模态压住） */
body .cl-toast-box{ z-index:var(--cl-z-toast); }
/* 模态打开时锁定滚动，避免双层滚动条穿插 */
body.cl-modal-open,
body.cl-scroll-locked{ overflow:hidden; }

/* ---------- 3. 表面分层与分界（统一描边 + 阴影语言） ---------- */
/* 卡片：统一为「细描边 + 浅投影」，hover 时投影略升，分界更清晰 */
body .cl-card{
  border-color:var(--cl-line);
  box-shadow:var(--cl-shadow-sm);
  transition:box-shadow .2s ease, border-color .2s ease, transform .2s ease;
}
body .cl-card:hover{ border-color:color-mix(in srgb,var(--cl-brand) 22%,var(--cl-line)); }

/* 浮层（搜索/查看器/模态）：更强的表面 + 更明显的边界阴影，与底层拉开层次 */
body #cl-search-mask .cl-search-box,
body #cl-viewer .cl-viewer-box,
body .cl-modal{
  background:var(--cl-surface);
  border:1px solid var(--cl-line);
  box-shadow:var(--cl-shadow), 0 0 0 1px color-mix(in srgb,var(--cl-brand) 6%,transparent);
}
/* 整页预览：不再是「与底层拉开层次」的浮层，去掉小窗描边与投影 */
body #cl-viewer .cl-viewer-box{border:0;border-radius:0;box-shadow:none}

/* IDE 面板分界（--panel 体系）：面板之间用描边而非纯色差，窄屏也清楚 */
body.ide-page .ide-sidebar,
body.ide-page .ide-panel{
  border-color:var(--line);
}

/* ---------- 4. 滚动条现代化（webkit + firefox） ---------- */
*{ scrollbar-width:thin; scrollbar-color:var(--cl-line) transparent; }
html[data-theme="dark"] *{ scrollbar-color:#2a4038 transparent; }
::-webkit-scrollbar{ width:10px; height:10px; }
::-webkit-scrollbar-track{ background:transparent; }
::-webkit-scrollbar-thumb{
  background:var(--cl-line);
  border:3px solid transparent;
  border-radius:8px;
  background-clip:padding-box;
}
::-webkit-scrollbar-thumb:hover{ background:var(--cl-mut); background-clip:padding-box; }
html[data-theme="dark"] ::-webkit-scrollbar-thumb{ background:#2a4038; background-clip:padding-box; }
html[data-theme="dark"] ::-webkit-scrollbar-thumb:hover{ background:#3d5a4f; background-clip:padding-box; }

/* ---------- 5. 焦点与微交互（键盘可达 + 手感） ---------- */
:focus-visible{
  outline:2px solid var(--cl-brand);
  outline-offset:2px;
  border-radius:4px;
}
html[data-theme="dark"] :focus-visible{ outline-color:var(--cl-brand-2); }

/* 链接/按钮的 hover 微移，统一节奏 */
body .cl-btn,
body .cl-iconbtn,
body .hp-icon-btn,
body .hp-btn{ will-change:transform; }

/* 平滑滚动（reduced-motion 时关闭） */
@media (prefers-reduced-motion: no-preference){
  html{ scroll-behavior:smooth; }
}

/* ---------- 6. 选区 / 图片渲染 ---------- */
::selection{ background:var(--cl-accent); color:var(--cl-accent-ink); }
img{ image-rendering:auto; }

/* ---------- 7. 打印：强制浅色、去浮层，保证资料可读 ---------- */
@media print{
  html,body{ background:#fff !important; color:#000 !important; }
  .cl-top,.hp-nav,.ide-titlebar,.cl-toast-box,#cl-search-mask,#cl-viewer{ display:none !important; }
}

/* ==========================================================================
   8. 加载态与空态精致化（统一视觉反馈，不改各页面逻辑）
   关键：aria-busy 标注在「父容器」上（tree-wrap/bd-grid），
   加载态用「后代选择器」[aria-busy="true"] .x-empty；
   空态图标只挂在「专用空态类」上，避免与加载 spinner 抢同一个 ::before。
   ========================================================================== */

/* --- 8.1 加载态：spinner 圆环（::before） + 骨架屏 shimmer 背景 --- */
@keyframes cl-spin{ to{ transform:rotate(360deg); } }
@keyframes cl-shimmer{ 0%{ background-position:-460px 0; } 100%{ background-position:460px 0; } }

[aria-busy="true"] .cl-empty,
[aria-busy="true"] .bd-empty,
[aria-busy="true"] .rm-empty{
  position:relative;
  background:
    linear-gradient(90deg, transparent, color-mix(in srgb,var(--cl-brand) 7%,transparent), transparent),
    var(--cl-surface-2);
  background-size:460px 100%, 100% 100%;
  background-repeat:no-repeat;
  border:1px dashed var(--cl-line);
  border-radius:12px;
  animation:cl-shimmer 1.5s ease-in-out infinite;
}
[aria-busy="true"] .cl-empty::before,
[aria-busy="true"] .bd-empty::before,
[aria-busy="true"] .rm-empty::before{
  content:""; display:block; margin:0 auto 10px;
  width:22px; height:22px; border-radius:50%;
  border:2px solid var(--cl-line);
  border-top-color:var(--cl-brand);
  animation:cl-spin .8s linear infinite;
}

/* --- 8.2 空态：柔和虚线框 + 层次（不抢 spinner 的 ::before） --- */
.rm-empty,
.cl-empty,
.bd-empty,
.rm-records-empty{
  border:1px dashed var(--cl-line);
  border-radius:12px;
  background:var(--cl-surface-2);
}
/* 空态小图标仅挂在「专用空态类」rm-records-empty 上（records 页，确定无加载歧义） */
.rm-records-empty::before{
  content:""; display:block; margin:0 auto 10px;
  width:34px; height:34px; border-radius:10px;
  background:
    radial-gradient(circle at 50% 42%, var(--cl-brand) 0 3px, transparent 3.5px),
    var(--cl-brand-soft);
  opacity:.9;
}

/* reduced-motion：关闭旋转与扫光，保留静态视觉 */
@media (prefers-reduced-motion: reduce){
  [aria-busy="true"] .cl-empty,
  [aria-busy="true"] .bd-empty,
  [aria-busy="true"] .rm-empty{ animation:none; }
  [aria-busy="true"] .cl-empty::before,
  [aria-busy="true"] .bd-empty::before,
  [aria-busy="true"] .rm-empty::before{ animation:none; border-top-color:var(--cl-line); }
}

/* ==========================================================================
   9. 拖拽式实验操作（取试剂 → 拖入反应区，贴合真实实验手感）
   材料项在抽屉里可拖；实验盘的放置区在拖入时高亮吸附。
   ========================================================================== */

/* --- 9.1 可拖材料项：拿起时的手感 --- */
.cl-item[draggable="true"]{ cursor:grab; }
.cl-item[draggable="true"]:active{ cursor:grabbing; }
.cl-item.cl-dragging{
  opacity:.45;
  transform:scale(.97);
  transition:opacity .15s ease, transform .15s ease;
}

/* --- 9.2 放置区（drop zone）：实验盘内的虚线放置槽 --- */
.cl-dropzone{
  display:flex; align-items:center; justify-content:center; gap:10px;
  min-height:76px; margin:0 0 14px; padding:14px 16px;
  border:2px dashed var(--cl-line); border-radius:var(--cl-r);
  background:var(--cl-surface-2);
  color:var(--cl-mut); font-size:12.5px; font-weight:550;
  text-align:center;
  transition:border-color .18s ease, background .18s ease, box-shadow .18s ease, transform .18s ease;
}
.cl-dropzone .cl-dz-ico{
  display:grid; place-items:center; width:30px; height:30px; flex:none;
  border-radius:9px; background:var(--cl-brand-soft); color:var(--cl-brand);
  font-size:15px;
}
.cl-dropzone small{ display:block; font-weight:400; color:var(--cl-mut); font-size:11px; margin-top:2px; }

/* 拖拽进行中：兼容的放置区进入"待放置"提示态 */
body.cl-drag-active .cl-dropzone[data-accept]{
  border-color:color-mix(in srgb,var(--cl-brand) 45%,var(--cl-line));
}

/* 拖拽悬停在放置区上方：吸附高亮（真实"倒入"反馈） */
.cl-dropzone.cl-drag-over{
  border-color:var(--cl-brand);
  border-style:solid;
  background:var(--cl-brand-soft);
  color:var(--cl-brand-ink);
  box-shadow:0 0 0 4px color-mix(in srgb,var(--cl-brand) 14%,transparent), var(--cl-shadow);
  transform:translateY(-2px);
}
html[data-theme="dark"] .cl-dropzone.cl-drag-over{ color:#a7f3e8; }
.cl-dropzone.cl-drag-over .cl-dz-ico{
  background:var(--cl-brand); color:#fff;
  animation:cl-dz-pop .3s ease;
}
@keyframes cl-dz-pop{ 0%{ transform:scale(.7); } 60%{ transform:scale(1.12); } 100%{ transform:scale(1); } }

/* 不兼容目标的放置区在拖拽时保持安静（不误导） */
body.cl-drag-active .cl-dropzone:not([data-accept]){ opacity:.5; }

/* --- 9.3 拖拽跟随幻影（可选增强，浏览器默认拖拽图之外的品牌提示） --- */
.cl-drag-ghost{
  position:fixed; z-index:var(--cl-z-toast); pointer-events:none;
  padding:7px 12px; border-radius:10px;
  background:var(--cl-brand); color:#fff; font-size:12px; font-weight:600;
  box-shadow:var(--cl-shadow);
  transform:translate(-50%,-140%);
}

/* --- 9.4 设备适配文案：触屏（无 hover）显示点选提示，桌面显示拖拽提示 --- */
.cl-dropzone .dz-when-touch{ display:none; }
.cl-dropzone .dz-when-touch b{ display:block; color:var(--cl-ink-2); font-size:12.5px; }
@media (hover:none){
  .cl-dropzone .dz-when-hover{ display:none; }
  .cl-dropzone .dz-when-touch{ display:block; }
  /* 触屏无拖拽，放置槽保持点选入口的静态样式 */
  .cl-dropzone{ cursor:pointer; }
}

/* reduced-motion：拖拽吸附不做位移动画 */
@media (prefers-reduced-motion: reduce){
  .cl-dropzone{ transition:none; }
  .cl-dropzone.cl-drag-over{ transform:none; }
  .cl-dropzone.cl-drag-over .cl-dz-ico{ animation:none; }
}

/* ==========================================================================
   10. 视觉质感升级（精致化卡片 / 按钮 / 层次，去除模板感）
   原则：高级感来自细节——细腻描边、柔和多层阴影、克制的光泽与 hover 浮起。
   不改几何布局，只提升质感；reduced-motion 关闭位移动画。
   ========================================================================== */

/* --- 10.1 卡片质感：细腻描边 + 柔和阴影 + 顶部光泽 --- */
body .cl-card,
body .rm-card,
body .cl-start-card,
body .rm-bench-grid{
  position:relative;
  border-color:color-mix(in srgb,var(--cl-line) 88%,var(--cl-brand));
  box-shadow:
    0 1px 2px color-mix(in srgb,var(--cl-ink) 4%,transparent),
    0 6px 20px -12px color-mix(in srgb,var(--cl-ink) 14%,transparent);
  transition:box-shadow .28s ease, border-color .28s ease, transform .28s ease, background .28s ease;
}
/* 顶部细腻光泽线（卡片精致感来源） */
body .cl-card::after,
body .rm-card::after,
body .cl-start-card::after,
body .rm-bench-grid::after{
  content:""; position:absolute; top:0; left:12%; right:12%; height:1px;
  background:linear-gradient(90deg, transparent, color-mix(in srgb,var(--cl-brand) 22%,transparent), transparent);
  pointer-events:none; opacity:.8;
}
/* hover：微浮起 + 品牌光晕（不喧宾夺主） */
body .cl-card:hover,
body .rm-card:hover,
body .cl-start-card:hover,
body .rm-bench-grid:hover{
  transform:translateY(-2px);
  border-color:color-mix(in srgb,var(--cl-brand) 34%,var(--cl-line));
  box-shadow:
    0 2px 4px color-mix(in srgb,var(--cl-ink) 5%,transparent),
    0 16px 40px -16px color-mix(in srgb,var(--cl-brand) 30%,transparent);
}

/* --- 10.2 主按钮质感：品牌渐变 + 光泽 + hover 提亮 --- */
body .cl-btn.primary{
  background:linear-gradient(135deg, var(--cl-brand), color-mix(in srgb,var(--cl-brand) 70%,var(--cl-brand-2)));
  border-color:transparent;
  box-shadow:
    inset 0 1px 0 color-mix(in srgb,#fff 22%,transparent),
    0 6px 16px -8px color-mix(in srgb,var(--cl-brand) 60%,transparent);
  transition:box-shadow .2s ease, filter .2s ease, transform .2s ease;
}
body .cl-btn.primary:hover{
  filter:brightness(1.06);
  box-shadow:
    inset 0 1px 0 color-mix(in srgb,#fff 26%,transparent),
    0 10px 24px -10px color-mix(in srgb,var(--cl-brand) 70%,transparent);
}
body .cl-btn.primary:active{ transform:translateY(1px); }

/* --- 10.3 次级按钮/图标按钮：更干净的 hover --- */
body .cl-btn:not(.primary):hover,
body .cl-iconbtn:hover{
  box-shadow:0 2px 8px -4px color-mix(in srgb,var(--cl-ink) 18%,transparent);
}

/* --- 10.4 标签/徽章：更精致的描边与底色 --- */
body .cl-chip{
  box-shadow:inset 0 1px 0 color-mix(in srgb,#fff 6%,transparent);
}

/* --- 10.5 输入框：focus 品牌光晕 --- */
body .cl-input:focus,
body input:focus-visible,
body textarea:focus-visible,
body select:focus-visible{
  border-color:var(--cl-brand);
  box-shadow:0 0 0 3px color-mix(in srgb,var(--cl-brand) 14%,transparent);
}

/* reduced-motion：关闭浮起/按位移动画 */
@media (prefers-reduced-motion: reduce){
  body .cl-card, body .rm-card, body .cl-start-card, body .rm-bench-grid{ transition:box-shadow .2s, border-color .2s; }
  body .cl-card:hover, body .rm-card:hover, body .cl-start-card:hover, body .rm-bench-grid:hover{ transform:none; }
  body .cl-btn.primary:active{ transform:none; }
}

/* ==========================================================================
   11. 科技炫酷（暗色主题专属）：光效 / 渐变 / 微动效，仪器面板质感
   只在 dark 下发力（暗色才能承载光效）；light 保持干净。
   所有动效尊重 prefers-reduced-motion。
   ========================================================================== */

/* --- 11.1 深色氛围光：页面底层铺一层品牌色径向光晕，营造实验室氛围 --- */
html[data-theme="dark"] body{
  background-image:
    radial-gradient(1100px 600px at 82% -8%, color-mix(in srgb,var(--cl-brand) 12%,transparent), transparent 62%),
    radial-gradient(900px 520px at 6% 4%, color-mix(in srgb,var(--cl-cyan) 7%,transparent), transparent 60%);
  background-attachment:fixed;
}

/* --- 11.2 深色卡片：玻璃拟态 + 发光描边，hover 品牌色光晕 --- */
html[data-theme="dark"] body .cl-card,
html[data-theme="dark"] body .rm-card,
html[data-theme="dark"] body .cl-start-card,
html[data-theme="dark"] body .rm-bench-grid{
  background:color-mix(in srgb,var(--cl-surface) 82%,transparent);
  -webkit-backdrop-filter:blur(10px); backdrop-filter:blur(10px);
  border-color:color-mix(in srgb,var(--cl-brand) 16%,var(--cl-line));
  box-shadow:
    inset 0 1px 0 color-mix(in srgb,var(--cl-brand) 10%,transparent),
    0 8px 30px -18px color-mix(in srgb,#000 80%,transparent);
}
html[data-theme="dark"] body .cl-card:hover,
html[data-theme="dark"] body .rm-card:hover,
html[data-theme="dark"] body .cl-start-card:hover,
html[data-theme="dark"] body .rm-bench-grid:hover{
  border-color:color-mix(in srgb,var(--cl-brand) 60%,transparent);
  box-shadow:
    inset 0 1px 0 color-mix(in srgb,var(--cl-brand) 18%,transparent),
    0 0 0 1px color-mix(in srgb,var(--cl-brand) 30%,transparent),
    0 0 26px -6px color-mix(in srgb,var(--cl-brand) 45%,transparent),
    0 18px 50px -20px color-mix(in srgb,#000 85%,transparent);
}

/* --- 11.3 渐变标题文字：品牌青绿 → 酸橙，科技感点缀 --- */
html[data-theme="dark"] .hp-hero h1 em,
html[data-theme="dark"] .cmp-hero-copy h1 em{
  background:linear-gradient(100deg, var(--cl-brand-2) 0%, var(--cl-accent) 90%);
  -webkit-background-clip:text; background-clip:text;
  -webkit-text-fill-color:transparent; color:transparent;
}

/* --- 11.4 主按钮：深色下发光 + 渐变 --- */
html[data-theme="dark"] body .cl-btn.primary,
html[data-theme="dark"] .hp-btn-primary{
  background:linear-gradient(135deg, var(--cl-brand-2), var(--cl-brand));
  box-shadow:
    inset 0 1px 0 color-mix(in srgb,#fff 28%,transparent),
    0 0 18px -4px color-mix(in srgb,var(--cl-brand) 55%,transparent),
    0 8px 22px -12px color-mix(in srgb,#000 80%,transparent);
}
html[data-theme="dark"] body .cl-btn.primary:hover,
html[data-theme="dark"] .hp-btn-primary:hover{
  box-shadow:
    inset 0 1px 0 color-mix(in srgb,#fff 32%,transparent),
    0 0 30px -2px color-mix(in srgb,var(--cl-brand) 70%,transparent);
}

/* --- 11.5 微动效：楼层卡/放置区的状态光点呼吸 --- */
@keyframes cl-breathe{
  0%,100%{ opacity:.55; box-shadow:0 0 0 0 color-mix(in srgb,var(--cl-brand) 40%,transparent); }
  50%{ opacity:1; box-shadow:0 0 0 4px color-mix(in srgb,var(--cl-brand) 0%,transparent); }
}
html[data-theme="dark"] .hp-building-live i,
html[data-theme="dark"] .cmp-board-live i{
  animation:cl-breathe 2.6s ease-in-out infinite;
}
/* 楼层卡 hover：左侧光标 + 背景微光 */
html[data-theme="dark"] .hp-floor{ transition:background .2s ease, box-shadow .2s ease; }
html[data-theme="dark"] .hp-floor:hover{
  box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--cl-brand) 22%,transparent);
}

/* reduced-motion：关闭呼吸/渐变动画，保留静态光效 */
@media (prefers-reduced-motion: reduce){
  html[data-theme="dark"] .hp-building-live i,
  html[data-theme="dark"] .cmp-board-live i{ animation:none; }
  html[data-theme="dark"] body{ background-attachment:scroll; }
}

/* ==========================================================================
   12. 查看器批注（选中文本批注，本机保存）
   ========================================================================== */

/* 批注浮动按钮：选中文字上方 */
.cl-anno-pop{
  position:fixed; z-index:var(--cl-z-toast); transform:translate(-50%,-100%);
  opacity:0; pointer-events:none; transition:opacity .15s ease;
}
.cl-anno-pop.show{ opacity:1; pointer-events:auto; }
.cl-anno-pop button{
  padding:7px 13px; border-radius:9px; border:1px solid var(--cl-brand);
  background:var(--cl-brand); color:#fff; font-size:12px; font-weight:600;
  box-shadow:var(--cl-shadow); cursor:pointer; white-space:nowrap;
}
html[data-theme="dark"] .cl-anno-pop button{ color:#042f2b; }

/* 批注面板：查看器右侧滑出 */
.cl-anno-panel{
  position:absolute; top:0; right:0; bottom:0; width:320px; max-width:86%;
  background:var(--cl-surface); border-left:1px solid var(--cl-line);
  box-shadow:-18px 0 50px -20px rgba(0,0,0,.3);
  transform:translateX(102%); transition:transform .28s ease;
  overflow-y:auto; z-index:5; display:flex; flex-direction:column;
}
.cl-anno-panel.open{ transform:none; }
.cl-anno-head{
  display:flex; align-items:center; justify-content:space-between;
  padding:14px 16px; border-bottom:1px solid var(--cl-line);
  font-size:13px; color:var(--cl-ink); position:sticky; top:0; background:var(--cl-surface);
}
.cl-anno-close{ background:none; border:0; color:var(--cl-mut); cursor:pointer; font-size:14px; padding:4px 8px; border-radius:6px; }
.cl-anno-close:hover{ background:var(--cl-surface-3); color:var(--cl-ink); }
.cl-anno-tip{ padding:10px 16px; font-size:11.5px; color:var(--cl-mut); line-height:1.6; }
.cl-anno-empty{ padding:24px 16px; text-align:center; color:var(--cl-mut); font-size:12px; }
.cl-anno-item{
  margin:0 12px 10px; padding:11px 13px; border-radius:11px;
  background:var(--cl-surface-2); border:1px solid var(--cl-line);
  border-left:3px solid var(--cl-accent);
}
.cl-anno-text{
  font-size:11.5px; color:var(--cl-mut); line-height:1.55; margin-bottom:7px;
  display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden;
  border-left:2px solid var(--cl-line); padding-left:8px; font-style:italic;
}
.cl-anno-note{ font-size:12.5px; color:var(--cl-ink); line-height:1.6; white-space:pre-wrap; }
.cl-anno-foot{ display:flex; align-items:center; justify-content:space-between; margin-top:8px; font-size:10.5px; color:var(--cl-mut); }
.cl-anno-del{ background:none; border:0; color:var(--cl-red); cursor:pointer; font-size:11px; padding:2px 6px; border-radius:5px; }
.cl-anno-del:hover{ background:color-mix(in srgb,var(--cl-red) 12%,transparent); }

@media (max-width:640px){
  .cl-anno-panel{ width:100%; max-width:100%; }
}
@media (prefers-reduced-motion: reduce){
  .cl-anno-panel{ transition:none; }
}

/* --- 12.1 自定义批注编辑器（居中卡片，取代原生 prompt） --- */
.cl-anno-editor-mask{
  position:fixed; inset:0; z-index:var(--cl-z-toast);
  background:color-mix(in srgb,#000 45%,transparent);
  -webkit-backdrop-filter:blur(4px); backdrop-filter:blur(4px);
  display:flex; align-items:center; justify-content:center; padding:20px;
  animation:cl-fade-in .18s ease;
}
.cl-anno-editor{
  width:min(480px,100%); background:var(--cl-surface);
  border:1px solid var(--cl-line); border-radius:var(--cl-r);
  box-shadow:var(--cl-shadow); padding:18px 20px;
  animation:cl-pop-in .22s cubic-bezier(.2,.9,.3,1.2);
}
.cl-anno-editor-title{ font-size:14px; font-weight:700; color:var(--cl-ink); margin-bottom:10px; }
.cl-anno-quote{
  font-size:12px; color:var(--cl-mut); line-height:1.6; font-style:italic;
  border-left:3px solid var(--cl-accent); padding:6px 10px; margin-bottom:12px;
  background:var(--cl-surface-2); border-radius:0 8px 8px 0;
  max-height:90px; overflow:hidden;
}
.cl-anno-input{
  width:100%; resize:vertical; min-height:88px;
  background:var(--cl-surface-2); color:var(--cl-ink);
  border:1px solid var(--cl-line); border-radius:10px; padding:10px 12px;
  font:inherit; font-size:13px; line-height:1.65;
}
.cl-anno-input:focus{ border-color:var(--cl-brand); box-shadow:0 0 0 3px color-mix(in srgb,var(--cl-brand) 14%,transparent); outline:none; }
.cl-anno-editor-foot{ display:flex; align-items:center; gap:8px; margin-top:12px; }
.cl-anno-hint{ flex:1; font-size:11px; color:var(--cl-mut); }
@keyframes cl-fade-in{ from{opacity:0} to{opacity:1} }
@keyframes cl-pop-in{ from{opacity:0; transform:translateY(10px) scale(.97)} to{opacity:1; transform:none} }
.cl-anno-shake{ animation:cl-shake .35s ease; border-color:var(--cl-red)!important; }
@keyframes cl-shake{ 0%,100%{transform:none} 25%{transform:translateX(-5px)} 75%{transform:translateX(5px)} }
@media (prefers-reduced-motion: reduce){
  .cl-anno-editor-mask, .cl-anno-editor{ animation:none; }
  .cl-anno-shake{ animation:none; }
}

/* ==========================================================================
   13. 图书馆式资料浏览（编目检索 + 资料卡片 + 书架）
   ========================================================================== */

/* 全站索引检索框 */
.cl-lib-searchbox{
  display:flex; align-items:center; gap:10px;
  margin:0 0 18px; padding:6px 14px;
  background:var(--cl-surface); border:1px solid var(--cl-line);
  border-radius:var(--cl-r); box-shadow:var(--cl-shadow-sm);
}
.cl-lib-searchbox .i{ color:var(--cl-mut); flex:none; }
.cl-lib-searchbox input{
  flex:1; min-width:0; border:0; background:transparent; color:var(--cl-ink);
  font-size:13.5px; padding:9px 0; outline:none;
}
.cl-lib-searchbox:focus-within{
  border-color:var(--cl-brand);
  box-shadow:0 0 0 3px color-mix(in srgb,var(--cl-brand) 12%,transparent);
}
.cl-lib-search-hint{ font-size:11.5px; color:var(--cl-mut); white-space:nowrap; flex:none; }

/* 检索结果：资料卡片网格 */
.cl-lib-results{
  display:grid; grid-template-columns:repeat(auto-fill,minmax(300px,1fr));
  gap:10px; margin-bottom:22px; max-height:60vh; overflow-y:auto; padding:2px;
}
.cl-doc-card{
  display:flex; align-items:center; gap:12px; text-align:left;
  padding:13px 14px; border-radius:13px; cursor:pointer;
  background:var(--cl-surface); border:1px solid var(--cl-line);
  box-shadow:var(--cl-shadow-sm);
  transition:border-color .18s, box-shadow .18s, transform .18s;
}
.cl-doc-card:hover{
  border-color:color-mix(in srgb,var(--cl-brand) 40%,var(--cl-line));
  transform:translateY(-2px);
  box-shadow:0 10px 26px -14px color-mix(in srgb,var(--cl-brand) 40%,transparent);
}
.cl-doc-badge{
  display:grid; place-items:center; width:38px; height:38px; flex:none;
  font-size:19px; border-radius:10px;
  background:var(--cl-brand-soft); border:1px solid var(--cl-line-2);
}
.cl-doc-main{ flex:1; min-width:0; }
.cl-doc-main b{ display:block; font-size:13px; color:var(--cl-ink); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.cl-doc-path{ display:block; font-size:10.8px; color:var(--cl-mut); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; margin-top:3px; font-family:var(--cl-mono); }
.cl-doc-meta{ font-size:11px; color:var(--cl-mut); flex:none; font-family:var(--cl-mono); }

/* 书架编目卡片（资料库） */
body .cl-lib-card{
  position:relative; overflow:hidden;
  transition:transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}
body .cl-lib-card:hover{ transform:translateY(-3px); }
/* 书架顶部书脊色条（编目分类的视觉锚点） */
body .cl-lib-card::before{
  content:""; position:absolute; left:0; top:0; bottom:0; width:3px;
  background:linear-gradient(180deg,var(--cl-brand),var(--cl-brand-2));
  opacity:.55;
}

@media (max-width:640px){
  .cl-lib-results{ grid-template-columns:1fr; max-height:70vh; }
}
@media (prefers-reduced-motion: reduce){
  .cl-doc-card, body .cl-lib-card{ transition:none; }
  .cl-doc-card:hover, body .cl-lib-card:hover{ transform:none; }
}

/* --- 13.1 我的资料架（本机上传） --- */
.cl-up-card{
  display:flex; align-items:center; gap:12px; flex-wrap:wrap;
  padding:12px 14px; margin-bottom:8px;
  background:var(--cl-surface); border:1px solid var(--cl-line);
  border-radius:12px; box-shadow:var(--cl-shadow-sm);
}
.cl-up-main{ flex:1; min-width:180px; }
.cl-up-main b{ display:block; font-size:13px; color:var(--cl-ink); }
.cl-up-main span{ font-size:11px; color:var(--cl-mut); margin-top:2px; display:block; }
.cl-up-acts{ display:flex; gap:6px; flex:none; }
@media (max-width:560px){
  .cl-up-acts{ width:100%; }
  .cl-up-acts .cl-btn{ flex:1; justify-content:center; }
}

/* --- 13.2 高级检索筛选器 + 收藏 + 书架/最近阅读 --- */
.cl-lib-filters{ display:flex; gap:8px; flex-wrap:wrap; margin:0 0 14px; }
.cl-lib-filters select{
  background:var(--cl-surface); color:var(--cl-ink-2); border:1px solid var(--cl-line);
  border-radius:9px; padding:7px 10px; font-size:12px; cursor:pointer;
}
.cl-lib-filters select:focus{ border-color:var(--cl-brand); outline:none; }

/* 资料卡片：打开区 + 收藏按钮分离 */
.cl-doc-card{ padding:0; overflow:hidden; gap:0; }
.cl-doc-open{
  display:flex; align-items:center; gap:12px; flex:1; min-width:0; text-align:left;
  padding:13px 14px; background:none; border:0; cursor:pointer; color:inherit;
}
.cl-doc-fav{
  flex:none; align-self:center; margin-right:10px; width:30px; height:30px;
  border-radius:8px; border:1px solid transparent; background:transparent;
  color:var(--cl-mut); font-size:15px; cursor:pointer; transition:.15s;
}
.cl-doc-fav:hover{ background:var(--cl-surface-3); color:var(--cl-amber); }
.cl-doc-fav.on{ color:var(--cl-amber); }
.cl-doc-fav.on:hover{ color:var(--cl-amber); }

/* 我的书架 / 最近阅读 两列 */
.cl-lib-two{ display:grid; grid-template-columns:1fr 1fr; gap:26px; padding-top:26px; }
@media (max-width:900px){ .cl-lib-two{ grid-template-columns:1fr; gap:16px; } }

/* mini 资料卡片（书架/最近阅读） */
.cl-mini-card{
  display:flex; align-items:center; gap:8px;
  border:1px solid var(--cl-line); border-radius:10px; margin-bottom:7px;
  background:var(--cl-surface); transition:border-color .15s, background .15s;
}
.cl-mini-card:hover{ border-color:color-mix(in srgb,var(--cl-brand) 35%,var(--cl-line)); background:var(--cl-surface-2); }
.cl-mini-open{
  flex:1; min-width:0; text-align:left; background:none; border:0; cursor:pointer;
  padding:10px 12px; color:inherit;
}
.cl-mini-open b{ display:block; font-size:12.5px; color:var(--cl-ink); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.cl-mini-open span{ font-size:10.5px; color:var(--cl-mut); margin-top:2px; display:block; }
.cl-mini-del{
  flex:none; margin-right:8px; width:26px; height:26px; border-radius:7px;
  border:0; background:transparent; color:var(--cl-mut); cursor:pointer; font-size:12px;
}
.cl-mini-del:hover{ background:color-mix(in srgb,var(--cl-red) 12%,transparent); color:var(--cl-red); }

/* --- 14. 对照组数量设置（可配置 N 宫格） --- */
.cmp-count-ctl{
  display:flex; align-items:center; gap:10px; flex-wrap:wrap;
  margin-top:16px; padding:10px 13px;
  background:var(--cl-surface); border:1px solid var(--cl-line);
  border-radius:12px; width:fit-content; box-shadow:var(--cl-shadow-sm);
}
.cmp-count-ctl > label{ font-size:12px; color:var(--cl-sub); font-weight:600; white-space:nowrap; }
.cmp-count-ctl input{
  width:64px; text-align:center; padding:7px 8px;
  background:var(--cl-surface-2); color:var(--cl-ink);
  border:1px solid var(--cl-line); border-radius:8px; font:inherit; font-size:13px;
  font-family:var(--cl-mono);
}
.cmp-count-ctl input:focus{ border-color:var(--cl-brand); outline:none; box-shadow:0 0 0 3px color-mix(in srgb,var(--cl-brand) 14%,transparent); }
.cmp-count-presets{ display:flex; gap:5px; }
.cmp-count-presets button{
  min-width:38px; padding:6px 10px; border-radius:8px; cursor:pointer;
  background:var(--cl-surface-2); border:1px solid var(--cl-line);
  color:var(--cl-sub); font-size:12px; font-family:var(--cl-mono); transition:.15s;
}
.cmp-count-presets button:hover{ border-color:var(--cl-brand); color:var(--cl-brand); }
.cmp-count-presets button.on{ background:var(--cl-brand); border-color:var(--cl-brand); color:#fff; font-weight:700; }
html[data-theme="dark"] .cmp-count-presets button.on{ color:#042f2b; }
@media (max-width:560px){
  .cmp-count-ctl{ width:100%; }
}

/* --- 15. 自定义数据输入区 --- */
.cl-custom-data{ margin-top:10px; border-top:1px dashed var(--cl-line); padding-top:10px; }
#dt-custom-area{ margin-top:10px; }
#dt-custom-text{ font-family:var(--cl-mono); font-size:12px; }

/* --- 15.1 稀释配制结果 --- */
.cl-dil-result{ text-align:center; padding:18px 10px; }
.cl-dil-result .v{ font-family:var(--cl-mono); font-size:40px; font-weight:700; color:var(--cl-brand); line-height:1.1; }
html[data-theme="dark"] .cl-dil-result .v{ text-shadow:0 0 20px color-mix(in srgb,var(--cl-brand) 40%,transparent); }
.cl-dil-result .l{ font-size:13px; color:var(--cl-ink-2); margin-top:6px; font-weight:600; }
.cl-dil-result .formula{ font-family:var(--cl-mono); font-size:12px; color:var(--cl-mut); margin-top:12px; padding-top:12px; border-top:1px dashed var(--cl-line); }

/* --- 16. DOCX 在线阅读排版 --- */
.cl-docx{
  max-width:820px; margin:0 auto; padding:8px 4px;
  font-size:14px; line-height:1.85; color:var(--cl-ink-2);
}
.cl-docx h1,.cl-docx h2,.cl-docx h3{ font-family:var(--cl-display); color:var(--cl-ink); line-height:1.3; margin:22px 0 10px; }
.cl-docx h1{ font-size:24px; } .cl-docx h2{ font-size:19px; } .cl-docx h3{ font-size:16px; }
.cl-docx p{ margin:10px 0; }
.cl-docx ul,.cl-docx ol{ padding-left:22px; margin:10px 0; }
.cl-docx table{ width:100%; border-collapse:collapse; margin:14px 0; font-size:13px; }
.cl-docx td,.cl-docx th{ border:1px solid var(--cl-line); padding:7px 10px; }
.cl-docx th{ background:var(--cl-surface-2); }
.cl-docx img{ max-width:100%; border-radius:8px; }
.cl-docx a{ color:var(--cl-brand); }

/* --- 17. 阅读体验：标题导航 TOC + 进度条 + 字号 --- */
/* 阅读进度条（查看器顶部） */
.cl-read-progress{
  position:absolute; top:0; left:0; right:0; height:3px; z-index:6;
  background:color-mix(in srgb,var(--cl-line) 40%,transparent);
}
.cl-read-progress i{
  display:block; height:100%; width:0;
  background:linear-gradient(90deg,var(--cl-brand),var(--cl-accent));
  transition:width .1s linear;
}

/* 标题导航 TOC（查看器左侧栏，可切换展开/收起） */
.cl-viewer-box{ position:relative; }  /* TOC 定位上下文 */
.cl-toc{
  position:absolute; top:60px; bottom:44px; left:0; width:216px; z-index:4;
  background:color-mix(in srgb,var(--cl-surface) 96%,transparent);
  border-right:1px solid var(--cl-line); overflow-y:auto; padding:12px 8px;
  -webkit-backdrop-filter:blur(8px); backdrop-filter:blur(8px);
  transform:translateX(-100%); transition:transform .25s ease;
  box-shadow:8px 0 30px -18px rgba(0,0,0,.5);
}
.cl-toc.show{ transform:none; }
/* 目录切换按钮 */
.cl-toc-toggle{
  flex:none; padding:5px 11px; border-radius:8px; margin-right:8px;
  border:1px solid var(--cl-line); background:var(--cl-surface-2);
  color:var(--cl-sub); font-size:12px; cursor:pointer; transition:.15s;
}
.cl-toc-toggle:hover, .cl-toc-toggle.on{ border-color:var(--cl-brand); color:var(--cl-brand); }
/* 宽屏展开 TOC 时阅读区右移 */
@media (min-width:1000px){
  .cl-viewer-box.has-toc .cl-viewer-body{ padding-left:236px; }
}
.cl-toc-title{ font-size:10.5px; letter-spacing:.1em; color:var(--cl-mut); padding:0 10px 10px; font-family:var(--cl-mono); }
.cl-toc-link{
  display:block; padding:6px 10px; font-size:12px; line-height:1.5; color:var(--cl-sub);
  border-radius:7px; text-decoration:none; border-left:2px solid transparent;
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap; transition:.15s;
}
.cl-toc-link.lv2{ padding-left:20px; }
.cl-toc-link.lv3{ padding-left:30px; font-size:11.5px; }
.cl-toc-link.lv4{ padding-left:38px; font-size:11px; }
.cl-toc-link:hover{ background:var(--cl-surface-3); color:var(--cl-ink); }
.cl-toc-link.on{ color:var(--cl-brand); border-left-color:var(--cl-brand); background:var(--cl-brand-soft); font-weight:600; }

/* 字号控件 */
.cl-fontsize{ display:inline-flex; gap:4px; margin-right:10px; }
.cl-fontsize button{
  padding:4px 9px; border-radius:7px; border:1px solid var(--cl-line);
  background:var(--cl-surface-2); color:var(--cl-sub); font-size:12px; cursor:pointer; transition:.15s;
}
.cl-fontsize button:hover{ border-color:var(--cl-brand); color:var(--cl-brand); }

/* 窄屏：TOC 收起为覆盖式侧栏（切换按钮展开） */
@media (max-width:1000px){
  .cl-toc{ width:200px; }
}
@media (prefers-reduced-motion: reduce){
  .cl-read-progress i{ transition:none; }
  .cl-toc{ transition:none; }
}

/* --- 18. 阅读细化：可调字号/行宽/行距 + 专注模式 + 设置面板 --- */
/* 阅读区引用可配置变量（默认在 body 上设置） */
.cl-viewer-body .cl-doc,
.cl-viewer-body .cl-docx,
.cl-viewer-body .cl-code-wrap{ font-size:var(--cl-read-fs,15px); line-height:var(--cl-read-lh,1.8); max-width:var(--cl-read-width,780px); margin-left:auto; margin-right:auto; }
.cl-viewer-body .cl-doc h1,.cl-viewer-body .cl-doc h2,.cl-viewer-body .cl-doc h3{ line-height:1.3; }

/* 图标按钮（工具条） */
.cl-icon-ctl{ padding:6px 9px!important; font-size:14px; line-height:1; min-width:32px; }

/* 阅读设置面板（右上浮层） */
.cl-read-panel{
  position:absolute; top:58px; right:14px; width:270px; z-index:8;
  background:var(--cl-surface); border:1px solid var(--cl-line); border-radius:13px;
  box-shadow:var(--cl-shadow); padding:14px 16px; display:none;
}
.cl-read-panel.open{ display:block; animation:cl-pop-in .2s ease; }
.cl-rp-title{ display:flex; align-items:center; justify-content:space-between; font-size:13px; font-weight:700; color:var(--cl-ink); margin-bottom:12px; }
.cl-rp-close{ background:none; border:0; color:var(--cl-mut); cursor:pointer; font-size:13px; }
.cl-rp-row{ margin-bottom:12px; }
.cl-rp-row label{ display:flex; justify-content:space-between; font-size:11.5px; color:var(--cl-sub); margin-bottom:5px; }
.cl-rp-row label b{ color:var(--cl-brand); font-family:var(--cl-mono); }
.cl-rp-row input[type=range]{ width:100%; accent-color:var(--cl-brand); }
.cl-rp-foot{ display:flex; align-items:center; justify-content:space-between; border-top:1px dashed var(--cl-line); padding-top:10px; font-size:10.5px; color:var(--cl-mut); }
.cl-anno-export{ background:none; border:1px solid var(--cl-line); border-radius:6px; color:var(--cl-brand); font-size:11px; padding:3px 8px; cursor:pointer; margin-right:6px; }
.cl-anno-export:hover{ border-color:var(--cl-brand); }

/* 专注模式：隐藏头/脚/目录，纯阅读 */
.cl-viewer-box.cl-focus .cl-viewer-head,
.cl-viewer-box.cl-focus .cl-viewer-foot,
.cl-viewer-box.cl-focus .cl-toc,
.cl-viewer-box.cl-focus .cl-anno-panel,
.cl-viewer-box.cl-focus .cl-read-panel{ display:none!important; }
.cl-viewer-box.cl-focus .cl-viewer-body{ padding-left:0!important; }
.cl-viewer-box.cl-focus .cl-viewer-body .cl-doc,
.cl-viewer-box.cl-focus .cl-viewer-body .cl-docx{ margin-top:24px; }
.cl-focus-exit{
  position:absolute; top:10px; right:12px; z-index:9; display:none;
  padding:6px 12px; border-radius:8px; border:1px solid var(--cl-line);
  background:var(--cl-surface-2); color:var(--cl-sub); font-size:12px; cursor:pointer;
  opacity:.5; transition:opacity .2s;
}
.cl-focus-exit:hover{ opacity:1; color:var(--cl-ink); }
.cl-viewer-box.cl-focus .cl-focus-exit{ display:block; }

/* ==========================================================================
   19. 全屏工作区：隐藏周边信息，操作区撑满视口
   适用于图书馆 / 实验台 / 对比矩阵 / 各实验盘；Esc 或按钮退出。
   ========================================================================== */
.cl-ws-toggle{
  position:fixed; right:18px; bottom:18px; z-index:calc(var(--cl-z-toast) - 2);
  padding:9px 15px; border-radius:11px; cursor:pointer;
  background:var(--cl-surface); border:1px solid var(--cl-line);
  color:var(--cl-sub); font-size:12px; font-weight:600;
  box-shadow:var(--cl-shadow); opacity:.72; transition:.18s;
}
.cl-ws-toggle:hover{ opacity:1; border-color:var(--cl-brand); color:var(--cl-brand); }
.cl-ws-toggle.on{ background:var(--cl-brand); border-color:var(--cl-brand); color:#042f2b; opacity:1; }
html[data-theme="light"] .cl-ws-toggle.on{ color:#fff; }

/* 隐藏周边：头部 / 介绍 / 次要区块 / footer */
html.cl-focus-work header.rm-top,
html.cl-focus-work header.cl-top,
html.cl-focus-work .cl-browse-head,
html.cl-focus-work .cl-lab-head,
html.cl-focus-work .cl-lab-start,
html.cl-focus-work .rm-room-head,
html.cl-focus-work .data-compare-bar,
html.cl-focus-work .cmp-hero,
html.cl-focus-work .cmp-overview,
html.cl-focus-work .cmp-model,
/* 只隐藏「八个资料库」介绍区与 footer；书架/最近阅读/资料架是功能，全屏下保留紧凑可达 */
html.cl-focus-work .home-section:not(#uploads-section):not(#fav-section):not(#recent-section),
html.cl-focus-work .site-footer{ display:none!important; }
html.cl-focus-work #uploads-section,
html.cl-focus-work #fav-section,
html.cl-focus-work #recent-section{ padding-top:14px; margin-bottom:8px; }
html.cl-focus-work #fav-section .section-head p,
html.cl-focus-work #recent-section .section-head p,
html.cl-focus-work #uploads-section .section-head p{ display:none; }
html.cl-focus-work #fav-section .section-head h2,
html.cl-focus-work #recent-section .section-head h2,
html.cl-focus-work #uploads-section .section-head h2{ font-size:14px; }
html.cl-focus-work .cl-lib-two{ padding-top:10px; gap:16px; }

/* 主区去掉宽度上限，撑满视口 */
html.cl-focus-work .cl-main-in,
html.cl-focus-work .cl-browse-main,
html.cl-focus-work .rm-main,
html.cl-focus-work .cmp-main{ max-width:none; width:100%; padding-left:16px; padding-right:16px; }
html.cl-focus-work .cl-main,
html.cl-focus-work .rm-main,
html.cl-focus-work .cmp-main{ padding-top:8px; }

/* 各核心操作区尽量占据视口高度 */
html.cl-focus-work .cl-browse-grid{ min-height:calc(100vh - 150px); }
html.cl-focus-work .cmp-grid{ min-height:calc(100vh - 120px); }
html.cl-focus-work .cl-panel{ min-height:calc(100vh - 90px); }
html.cl-focus-work .rm-bench{ min-height:calc(100vh - 90px); }

/* 全屏时目录树/文件表更高的可视区 */
html.cl-focus-work .cl-tree.cl-scroll{ max-height:calc(100vh - 230px); }

@media (prefers-reduced-motion: reduce){
  .cl-ws-toggle{ transition:none; }
}

/* --- 20. 3D 分子物理提示 --- */
.cl-3d-phys{ display:block; margin-top:3px; font-size:10.5px; color:var(--cl-mut); opacity:.85; font-family:var(--cl-mono); }

/* --- 21. 全屏工作区保留的精简辅助入口（左下角） --- */
.cl-ws-utils{
  position:fixed; left:18px; bottom:18px; z-index:calc(var(--cl-z-toast) - 2);
  display:none; gap:6px; align-items:center;
}
html.cl-focus-work .cl-ws-utils{ display:flex; }
.cl-ws-util{
  display:inline-flex; align-items:center; gap:5px;
  padding:8px 12px; border-radius:10px; cursor:pointer; text-decoration:none;
  background:var(--cl-surface); border:1px solid var(--cl-line);
  color:var(--cl-sub); font-size:11.5px; font-weight:600;
  box-shadow:var(--cl-shadow); opacity:.78; transition:.18s;
}
.cl-ws-util:hover{ opacity:1; border-color:var(--cl-brand); color:var(--cl-brand); }
/* 阅读器打开时收起浮动工具，避免遮挡模态 */
html:has(.cl-viewer.open) .cl-ws-utils,
html:has(.cl-viewer.open) .cl-ws-toggle{ display:none; }
@media (max-width:640px){
  .cl-ws-utils{ left:12px; bottom:12px; }
  .cl-ws-util{ padding:7px 9px; font-size:11px; }
}
@media (prefers-reduced-motion: reduce){
  .cl-ws-util{ transition:none; }
}

/* --- 22. 分子键长标注：悬停提示 + 显式标签开关 --- */
.cl-mol-tip{
  position:absolute; display:none; z-index:6; max-width:230px; pointer-events:none;
  padding:8px 11px; border-radius:9px; font:11.5px/1.7 var(--cl-mono);
  background:var(--cl-surface); color:var(--cl-ink-2);
  border:1px solid var(--cl-line); box-shadow:var(--cl-shadow);
}
.cl-mol-tip b{ color:var(--cl-brand); }
.cl-mol-lenbtn{
  position:absolute; top:10px; left:10px; z-index:6;
  padding:5px 10px; border-radius:8px; cursor:pointer;
  background:var(--cl-surface); border:1px solid var(--cl-line);
  color:var(--cl-sub); font-size:11.5px; font-family:var(--cl-mono); opacity:.85;
}
.cl-mol-lenbtn:hover{ opacity:1; border-color:var(--cl-brand); color:var(--cl-brand); }
.cl-mol-lenbtn.on{ background:var(--cl-brand); border-color:var(--cl-brand); color:#042f2b; opacity:1; }
html[data-theme="light"] .cl-mol-lenbtn.on{ color:#fff; }

/* --- 23. 窄屏底部遮挡修复：只保留一个底部导航 --- */
@media (max-width:1180px){
  /* 桌面悬浮 dock 与 mobilebar 会叠在一起，窄屏隐藏 dock */
  .cl-dock{ display:none!important; }
  /* 全屏切换 / 辅助入口上移到 mobilebar(58px + safe-area) 之上 */
  .cl-ws-toggle{ bottom:calc(70px + env(safe-area-inset-bottom)); right:12px; padding:7px 12px; font-size:11.5px; }
  .cl-ws-utils{ bottom:calc(70px + env(safe-area-inset-bottom)); left:12px; }
  /* 确保内容不被底部导航盖住 */
  .cl-main-in{ padding-bottom:calc(80px + env(safe-area-inset-bottom)); }
}
@media (max-width:640px){
  .cl-ws-toggle{ bottom:calc(66px + env(safe-area-inset-bottom)); }
}

/* --- 22.1 分子详情：键长汇总表 --- */
.cl-bond-box{ margin-top:12px; border:1px solid var(--cl-line); border-radius:11px; padding:10px 12px; background:var(--cl-surface-2); }
.cl-bond-title{ font-size:11px; color:var(--cl-mut); letter-spacing:.04em; margin-bottom:7px; font-family:var(--cl-mono); }
.cl-bond-row{ display:flex; align-items:center; justify-content:space-between; gap:10px; padding:4px 0; border-top:1px dashed var(--cl-line); font-size:12px; }
.cl-bond-row:first-of-type{ border-top:0; }
.cl-bond-row b{ color:var(--cl-brand); font-family:var(--cl-mono); font-weight:600; }
.cl-bond-row span{ font-family:var(--cl-mono); color:var(--cl-ink-2); text-align:right; }
.cl-bond-row small{ display:block; font-size:10px; color:var(--cl-mut); }

/* --- 23.1 3D 提示避免被底部浮动工具遮挡 --- */
.cl-viewer3d > .cl-3d-hint{ display:block; line-height:1.55; text-align:right; }
/* 窄屏：提示移到 3D 视图顶部（与左上「显示键长」分列左右），底部完全留给浮动工具与导航 */
@media (max-width:1180px){
  .cl-viewer3d > .cl-3d-hint{ top:8px; bottom:auto; right:8px; max-width:58%; font-size:10px; }
  .cl-3d-phys{ display:none; }  /* 详情键长表已给出物理依据，窄屏不重复 */
}

/* --- 24. 非阻塞确认弹窗（替代原生 confirm，全站统一） --- */
.cl-confirm-mask{
  position:fixed; inset:0; z-index:10000; display:grid; place-items:center;
  background:rgba(4,14,12,.62); -webkit-backdrop-filter:blur(4px); backdrop-filter:blur(4px);
  animation:cl-fade-in .16s ease;
}
.cl-confirm{
  width:min(420px,92vw); padding:22px 24px; text-align:center;
  background:var(--cl-surface); border:1px solid var(--cl-line); border-radius:16px;
  box-shadow:0 24px 60px -18px rgba(0,0,0,.6); animation:cl-pop-in .2s ease;
}
.cl-confirm-ico{
  width:38px; height:38px; margin:0 auto 10px; border-radius:50%;
  display:grid; place-items:center; font-weight:800; font-size:18px;
  background:color-mix(in srgb,var(--cl-amber) 16%,transparent); color:var(--cl-amber);
  border:1px solid color-mix(in srgb,var(--cl-amber) 40%,transparent);
}
.cl-confirm h3{ margin:0 0 8px; font-size:16px; color:var(--cl-ink); }
.cl-confirm p{ margin:0; font-size:13px; line-height:1.7; color:var(--cl-sub); }
.cl-confirm-foot{ display:flex; justify-content:center; gap:10px; margin-top:20px; }
.cl-confirm-foot .cl-btn{ min-width:96px; justify-content:center; }
html[data-theme="dark"] .cl-confirm{ box-shadow:0 0 0 1px rgba(45,212,191,.08),0 24px 60px -18px rgba(0,0,0,.8); }
@media (prefers-reduced-motion: reduce){
  .cl-confirm-mask,.cl-confirm{ animation:none; }
}

/* --- 25. 图书馆学科书架 --- */
.cl-subject-card{
  display:flex;align-items:center;gap:10px;padding:10px 11px;margin-bottom:6px;
  border:1px solid var(--cl-line);border-radius:10px;background:var(--cl-surface);
  cursor:pointer;transition:.16s;
}
.cl-subject-card:hover{border-color:var(--cl-brand);box-shadow:var(--cl-shadow-sm)}
.cl-subject-card.on{background:var(--cl-brand-soft);border-color:var(--cl-brand)}
.cl-subj-code{
  flex:none;min-width:28px;height:28px;display:grid;place-items:center;border-radius:8px;
  background:var(--cl-brand);color:#fff;font:700 12px var(--cl-mono);
}
html[data-theme="dark"] .cl-subj-code{color:#042f2b}
.cl-subj-main{flex:1;min-width:0}
.cl-subj-main b{display:block;font-size:12.5px;color:var(--cl-ink);line-height:1.4}
.cl-subj-main small{display:block;font-size:10.5px;color:var(--cl-mut);line-height:1.4;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.cl-subj-n{flex:none;font:11px var(--cl-mono);color:var(--cl-sub)}
.cl-subj-topics{margin:12px 0 4px;padding-top:10px;border-top:1px dashed var(--cl-line)}
.cl-subj-tt{font-size:10.5px;color:var(--cl-mut);margin-bottom:7px;font-family:var(--cl-mono)}
.cl-topic{
  display:flex;justify-content:space-between;gap:8px;width:100%;padding:6px 9px;margin-bottom:4px;
  border:1px solid var(--cl-line-2);border-radius:8px;background:transparent;
  color:var(--cl-sub);font-size:11.5px;text-align:left;cursor:pointer;
}
.cl-topic:hover{border-color:var(--cl-brand);color:var(--cl-brand)}
.cl-topic.on{background:var(--cl-brand-soft);border-color:var(--cl-brand);color:var(--cl-brand)}
.cl-topic span{font-family:var(--cl-mono);opacity:.75}

/* --- 25.1 学科书架 tab 与大厅 --- */
#tab-subject.on{ background:var(--cl-brand); color:#fff; border-color:var(--cl-brand); }
html[data-theme="dark"] #tab-subject.on{ color:#042f2b; }
.cl-hall{ padding:4px 0 20px; }
.cl-hall-h{ display:flex; align-items:baseline; justify-content:space-between; gap:10px;
  font-size:15px; font-weight:650; margin-bottom:14px; color:var(--cl-ink); }
.cl-hall-h span{ font:11.5px var(--cl-mono); color:var(--cl-mut); font-weight:400; }
.cl-hall-grid{ display:grid; grid-template-columns:repeat(auto-fill,minmax(200px,1fr)); gap:10px; }
.cl-hall-card{
  display:flex; flex-direction:column; align-items:flex-start; gap:5px; text-align:left;
  padding:14px 15px; border:1px solid var(--cl-line); border-radius:12px;
  background:var(--cl-surface); color:var(--cl-ink); cursor:pointer; transition:.16s;
}
.cl-hall-card:hover{ border-color:var(--cl-brand); box-shadow:var(--cl-shadow-sm); transform:translateY(-1px); }
.cl-hall-code{ font:700 11px var(--cl-mono); color:var(--cl-brand); letter-spacing:.1em; }
.cl-hall-card b{ font-size:14px; }
.cl-hall-card small{ font-size:11px; line-height:1.5; color:var(--cl-mut); min-height:2.6em; }
.cl-hall-n{ font:11px var(--cl-mono); color:var(--cl-sub); margin-top:3px; }
@media(max-width:720px){ .cl-hall-grid{ grid-template-columns:repeat(auto-fill,minmax(150px,1fr)); } }
@media(prefers-reduced-motion:reduce){ .cl-hall-card:hover{ transform:none; } }

/* --- 25.2 资料分支入口卡 --- */
.cl-hall-branch{ background:var(--cl-brand-soft); border-color:var(--cl-brand); text-decoration:none; }
.cl-hall-branch:hover{ text-decoration:none; box-shadow:var(--cl-shadow-sm); }
.cl-hall-branch .cl-hall-code{ color:var(--cl-brand); font-weight:700; }
.cl-hall-branch b{ color:var(--cl-brand-ink); }
html[data-theme="dark"] .cl-hall-branch b{ color:var(--cl-brand); }
