/* 专注阅读：隐藏外围 UI，正文铺满 */
body.lf-focus #tour-right-toolbar,
body.lf-focus #tour-toolbar-handle,
body.lf-focus .lf-tool-thumb,
body.lf-focus .lf-outline-panel,
body.lf-focus .lf-outline-collapsed,
body.lf-focus .lf-outline-vertical,
body.lf-focus #tour-topnav,
body.lf-focus .lf-mobile-topbar {
  display: none !important;
}
body.lf-focus #tour-main-content {
  max-width: 100% !important;
  margin-inline: auto !important;
  padding-inline: clamp(16px, 8vw, 120px) !important;
}
#lf-focus-exit{display:none;position:fixed;top:16px;right:16px;z-index:100500;padding:9px 14px;border:1px solid #e5e7eb;border-radius:10px;background:rgba(255,255,255,.96);color:#374151;font-size:13px;font-weight:600;cursor:pointer;box-shadow:0 8px 24px rgba(0,0,0,.12)}
#lf-focus-exit.on{display:block}
:root[data-theme="dark"] #lf-focus-exit{background:rgba(15,23,42,.96);border-color:#334155;color:#e5e7eb}

/* 大纲条目里的展开箭头：原站全局 button 内边距会把它挤扁 */
aside.content-navigation .course-reading-outline-item > button {
  padding: 0 !important;
}
aside.content-navigation .course-reading-outline-item > button svg {
  width: 12px; height: 12px; flex: 0 0 auto;
}

/* 隐藏公开关键帧 */
body.lf-public-hidden [data-reading-memory-public-keyframe="true"],
body.lf-public-hidden [data-reading-memory-public-keyframe-aggregate="true"] {
  opacity: 0 !important;
}

/* 桌面端收起大纲后的导轨（local-interactions.js 创建，停靠进 .sidebar-container）
   按原站 React 源码还原：容器收起为 40px；中缝线 top/bottom 各留 80px，hover 延至 40px 并变淡蓝；
   40x40 白色圆角按钮默认灰箭头，hover 变 brand 蓝、投影加深、scale 1.05；竖排文字默认隐藏 hover 淡入 */
.lf-desk-rail {
  position: relative; width: 100%; height: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  cursor: pointer; border-right: 1px solid transparent;
  transition: background .3s ease, border-color .3s ease;
}
.lf-desk-rail:hover { background: rgba(229, 231, 235, .5); border-right-color: #d1d5db; }
.lf-desk-rail-line {
  position: absolute; left: 50%; top: 80px; bottom: 80px; width: 3px; margin-left: -1.5px;
  border-radius: 999px; background: rgba(229, 231, 235, .5);
  transition: top .3s ease, bottom .3s ease, background .3s ease;
}
.lf-desk-rail:hover .lf-desk-rail-line { top: 40px; bottom: 40px; background: rgba(38, 71, 131, .2); }
.lf-desk-rail-btn {
  position: relative; z-index: 10; box-sizing: border-box;
  width: 40px; height: 40px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  background: #fff; border: 1px solid #e5e7eb; color: #6b7280;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .04);
  transition: all .3s ease;
}
.lf-desk-rail:hover .lf-desk-rail-btn {
  border-color: rgba(38, 71, 131, .35); color: var(--brand-500, #264783);
  box-shadow: 0 4px 12px rgba(0, 0, 0, .08); transform: scale(1.05);
}
.lf-desk-rail-btn svg { margin-left: 2px; }
.lf-desk-rail-text {
  position: absolute; bottom: 64px; left: 50%; transform: translateX(-50%);
  writing-mode: vertical-rl; text-orientation: mixed;
  font-size: 12px; font-weight: 500; letter-spacing: .2em; color: #9ca3af;
  opacity: 0; transition: opacity .3s ease;
}
.lf-desk-rail:hover .lf-desk-rail-text { opacity: 1; }

/* 大纲内嵌搜索条（local-interactions.js 创建）：点查找后替换头部——< 返回 + 下划线输入框（品牌蓝底线） */
.lf-find-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px 10px;
}
.lf-find-back {
  flex: 0 0 auto; border: 0; background: transparent; color: #6b7280; cursor: pointer;
  width: 22px; height: 22px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
}
.lf-find-back:hover { color: #264783; }
.lf-find-input {
  flex: 1 1 auto; min-width: 0; border: 0; outline: 0; background: transparent;
  border-bottom: 2px solid var(--brand-500, #264783);
  font-size: 14px; line-height: 1.6; color: #1f2937; padding: 6px 2px;
}
.lf-find-input::placeholder { color: #9ca3af; }
/* 命中条目里的关键词:蓝色加粗(与原站一致),背景透明 */
mark.lf-find-mark { background: transparent; color: var(--brand-500, #264783); font-weight: 700; }
/* 深色模式 */
.dark .lf-find-back { color: #9ca3af; }
.dark .lf-find-back:hover { color: #93b0d8; }
.dark .lf-find-input { color: #e5e7eb; }
.dark .lf-find-input::placeholder { color: #6b7280; }
.dark mark.lf-find-mark { color: #93b0d8; }

/* ===== 划选文字加印记:浮动工具条 + 颜色/操作菜单(local-marks.js) ===== */
.lf-mk-bar {
  position: fixed; z-index: 99998; display: none; align-items: center;
  padding: 6px; gap: 2px; background: rgba(24, 28, 38, .95); border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, .08);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .25); backdrop-filter: blur(8px);
}
.lf-mk-bar.lf-mk-show { display: flex; animation: lfMkIn .22s cubic-bezier(.16, 1, .3, 1) both; }
@keyframes lfMkIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.lf-mk-arrow {
  position: absolute; bottom: -5px; width: 10px; height: 10px;
  background: rgba(24, 28, 38, .95); border-radius: 2px; transform: rotate(45deg);
}
.lf-mk-bar.lf-mk-below .lf-mk-arrow { bottom: auto; top: -5px; }
.lf-mk-sep { flex: 0 0 auto; width: 1px; height: 20px; margin: 0 4px; background: rgba(255, 255, 255, .14); }
.lf-mk-btn, .lf-mk-caret {
  border: 0; background: transparent; padding: 0; cursor: pointer; color: #e5e7eb;
  display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
}
.lf-mk-btn { width: 30px; height: 30px; border-radius: 8px; transition: background .15s, color .15s; }
.lf-mk-btn:hover { background: rgba(255, 255, 255, .08); }
.lf-mk-btn.lf-mk-active { background: rgba(255, 255, 255, .14); }
.lf-mk-caret { width: 14px; height: 30px; border-radius: 6px; color: #9ca3af; }
.lf-mk-caret:hover { color: #fff; }
.lf-mk-caret svg { transition: transform .15s ease; }
.lf-mk-caret.lf-mk-open svg { transform: rotate(180deg); }
.lf-mk-btn.lf-mk-open { background: rgba(212, 169, 74, .14); box-shadow: inset 0 0 0 1.5px rgba(212, 169, 74, .9); }
.lf-mk-bug { width: 30px; height: 30px; border-radius: 8px; color: #fbbf24; }
.lf-mk-bug:hover { background: rgba(255, 255, 255, .08); }
.lf-mk-menu {
  position: fixed; z-index: 99999; display: none;
  background: rgba(24, 28, 38, .97); border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, .08);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .25); padding: 8px;
}
.lf-mk-menu.lf-mk-show { display: block; animation: lfMkMenuIn .16s cubic-bezier(.16, 1, .3, 1) both; }
@keyframes lfMkMenuIn { from { opacity: 0; transform: scale(.92); } to { opacity: 1; transform: none; } }
.lf-mk-menu-title { font-size: 11px; color: #9ca3af; padding: 0 2px 6px; white-space: nowrap; }
.lf-mk-row { display: flex; align-items: center; gap: 6px; }
.lf-mk-row + .lf-mk-row, .lf-mk-row + .lf-mk-list { margin-top: 8px; }
/* 竖排颜色列表:色点 + 中文色名(与原站一致) */
.lf-mk-list { display: flex; flex-direction: column; gap: 2px; min-width: 88px; }
.lf-mk-item {
  display: flex; align-items: center; gap: 10px; padding: 7px 12px;
  border: 0; background: transparent; border-radius: 8px;
  color: #e5e7eb; font-size: 13px; line-height: 1; cursor: pointer; white-space: nowrap;
}
.lf-mk-item:hover { background: rgba(255, 255, 255, .08); }
.lf-mk-item.lf-mk-active { background: rgba(255, 255, 255, .12); }
.lf-mk-dot { flex: 0 0 auto; width: 14px; height: 14px; border-radius: 50%; }
.lf-mk-trash { color: #f87171; }
.lf-mk-trash:hover { color: #fff; background: rgba(248, 113, 113, .15); }
/* 原站正文选区:深蓝底白字 */
#tour-main-content ::selection { background: #23427a; color: #fff; }

/* ===== 提交内容纠错弹窗(工具条印章按钮) ===== */
.lf-mk-dlg-mask {
  position: fixed; inset: 0; z-index: 100000; display: none;
  align-items: center; justify-content: center; background: rgba(15, 23, 42, .45);
}
.lf-mk-dlg-mask.lf-mk-show { display: flex; }
.lf-mk-dlg {
  width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 48px); overflow: auto;
  background: #fff; border-radius: 16px; box-shadow: 0 24px 64px rgba(0, 0, 0, .25);
  display: flex; flex-direction: column; animation: lfMkDlgIn .2s cubic-bezier(.16, 1, .3, 1) both;
}
@keyframes lfMkDlgIn { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
.lf-mk-dlg-head { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid #eef0f3; }
.lf-mk-dlg-flag { display: inline-flex; color: #264783; }
.lf-mk-dlg-title { flex: 1 1 auto; font-size: 15px; font-weight: 700; color: #1f2937; }
.lf-mk-dlg-x {
  border: 0; background: transparent; color: #6b7280; cursor: pointer;
  width: 28px; height: 28px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center;
}
.lf-mk-dlg-x:hover { background: #f3f4f6; color: #1f2937; }
.lf-mk-dlg-body { padding: 20px; display: flex; flex-direction: column; }
.lf-mk-dlg-sel {
  box-sizing: border-box; width: 100%; min-height: 48px; padding: 12px 14px;
  border: 1px solid #e5e7eb; border-radius: 10px; background: #f9fafb; color: #374151;
  font-size: 14px; line-height: 1.6; resize: none; font-family: inherit;
}
.lf-mk-dlg-label { margin: 16px 0 8px; font-size: 13px; font-weight: 600; color: #1f2937; }
.lf-mk-dlg-select {
  box-sizing: border-box; width: 100%; padding: 10px 12px;
  border: 1px solid #d1d5db; border-radius: 10px; background: #fff; color: #1f2937;
  font-size: 14px; cursor: pointer;
}
.lf-mk-dlg-desc {
  box-sizing: border-box; width: 100%; min-height: 110px; padding: 10px 12px;
  border: 1px solid #d1d5db; border-radius: 10px; color: #1f2937;
  font-size: 14px; line-height: 1.6; resize: vertical; font-family: inherit;
}
.lf-mk-dlg-select:focus, .lf-mk-dlg-desc:focus {
  outline: none; border-color: #264783; box-shadow: 0 0 0 3px rgba(38, 71, 131, .15);
}
.lf-mk-dlg-foot { display: flex; justify-content: flex-end; gap: 12px; padding: 14px 20px; border-top: 1px solid #eef0f3; }
.lf-mk-dlg-cancel { border: 0; background: transparent; color: #374151; font-size: 14px; cursor: pointer; padding: 8px 14px; border-radius: 8px; }
.lf-mk-dlg-cancel:hover { background: #f3f4f6; }
.lf-mk-dlg-submit { border: 0; background: #264783; color: #fff; font-size: 14px; font-weight: 600; cursor: pointer; padding: 9px 18px; border-radius: 8px; }
.lf-mk-dlg-submit:hover { background: #1d3663; }
.lf-mk-dlg-submit:disabled { background: rgba(38, 71, 131, .45); cursor: not-allowed; }
