/* Timeline Review Overlay (Phase 8) — only styles our own .tlr-* elements. Never restyles timeline content. */
.tlr-toggle {
  position: fixed;
  right: 16px;
  top: 112px;
  z-index: 1000010;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 215, 0, 0.45);
  background: rgba(20, 22, 30, 0.92);
  color: #f3e7b3;
  font: 600 13px/1.2 system-ui, -apple-system, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}
.tlr-toggle:hover { border-color: rgba(255, 215, 0, 0.8); }
.tlr-toggle:focus-visible, .tlr-panel button:focus-visible, .tlr-panel select:focus-visible, .tlr-panel input:focus-visible, .tlr-panel textarea:focus-visible {
  outline: 2px solid #ffd54a;
  outline-offset: 2px;
}
.tlr-toggle-dot { width: 8px; height: 8px; border-radius: 50%; background: #7d7d7d; }
.tlr-toggle.tlr-on .tlr-toggle-dot { background: #ffd54a; box-shadow: 0 0 6px #ffd54a; }

.tlr-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 400px;
  max-width: 100vw;
  z-index: 1000011;
  display: flex;
  flex-direction: column;
  background: #15171f;
  color: #e9e6dc;
  border-left: 1px solid rgba(255, 215, 0, 0.25);
  box-shadow: -8px 0 28px rgba(0, 0, 0, 0.45);
  font: 13px/1.5 system-ui, -apple-system, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  overflow: hidden;
}
.tlr-panel[hidden] { display: none; }
.tlr-head, .tlr-sec, .tlr-counts, .tlr-msg, .tlr-foot { flex: 0 0 auto; }
.tlr-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px 8px; border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
.tlr-title { display: flex; flex-direction: column; gap: 2px; }
.tlr-title strong { font-size: 15px; color: #ffe08a; }
.tlr-ro { font-size: 13px; color: #9fd3a6; }
.tlr-x { background: none; border: 0; color: #bbb; font-size: 20px; line-height: 1; cursor: pointer; padding: 2px 6px; border-radius: 6px; }
.tlr-x:hover { color: #fff; background: rgba(255, 255, 255, 0.08); }
.tlr-sec { padding: 8px 14px; display: flex; flex-direction: column; gap: 6px; }
.tlr-lab { font-size: 13px; color: #a9a59a; }
.tlr-row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.tlr-row > .tlr-input { flex: 1 1 120px; min-width: 0; }
.tlr-input {
  background: #0f1117;
  color: #e9e6dc;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 6px;
  padding: 5px 7px;
  font: inherit;
  max-width: 100%;
}
.tlr-check { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: #cfcab9; white-space: nowrap; }
.tlr-btn {
  background: #242733;
  color: #e9e6dc;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 6px;
  padding: 5px 10px;
  font: inherit;
  cursor: pointer;
}
.tlr-btn:hover:not([disabled]) { border-color: rgba(255, 215, 0, 0.6); }
.tlr-btn[disabled] { opacity: 0.5; cursor: default; }
.tlr-btn-primary { background: #5a4a12; border-color: rgba(255, 215, 0, 0.55); color: #fff3c4; margin-left: auto; }
.tlr-btn-warn { background: #3a2323; border-color: rgba(255, 120, 120, 0.4); }
.tlr-btn-link { background: none; border: 0; color: #8cc8ff; padding: 2px 0; text-decoration: underline; }
.tlr-counts { display: flex; gap: 6px; padding: 6px 14px; flex-wrap: wrap; }
.tlr-chip { border-radius: 999px; padding: 3px 10px; border: 1px solid rgba(255, 255, 255, 0.16); background: #1d2029; color: #e9e6dc; cursor: pointer; font: inherit; font-size: 13px; }
.tlr-chip-n { font-weight: 700; }
.tlr-chip-on { outline: 2px solid #ffd54a; }
.tlr-sev { display: inline-block; font-size: 13px; font-weight: 700; border-radius: 4px; padding: 1px 6px; flex-shrink: 0; }
.tlr-sev-BLOCKER { background: #7a1020; color: #ffd9de; }
.tlr-sev-MAJOR { background: #7a3a10; color: #ffe2cc; }
.tlr-sev-MINOR { background: #5e5410; color: #fff4bf; }
.tlr-sev-INFO { background: #1d3f5e; color: #d4ebff; }
.tlr-chip.tlr-sev-BLOCKER .tlr-chip-n { color: #ff8a9a; }
.tlr-chip.tlr-sev-MAJOR .tlr-chip-n { color: #ffb37a; }
.tlr-chip.tlr-sev-MINOR .tlr-chip-n { color: #ffe066; }
.tlr-chip.tlr-sev-INFO .tlr-chip-n { color: #8cc8ff; }
.tlr-chip.tlr-sev-BLOCKER, .tlr-chip.tlr-sev-MAJOR, .tlr-chip.tlr-sev-MINOR, .tlr-chip.tlr-sev-INFO { background: #1d2029; color: #e9e6dc; }
.tlr-msg { padding: 2px 14px 6px; font-size: 13px; color: #a9a59a; min-height: 18px; }
.tlr-msg-err { color: #ff9a9a; }
.tlr-msg-ok { color: #9fd3a6; }
.tlr-list { list-style: none; margin: 0; padding: 0 8px 8px; overflow-y: auto; flex: 1 1 0; min-height: 72px; }
.tlr-empty { color: #8d897e; padding: 16px 8px; text-align: center; }
.tlr-item { margin: 0 0 4px; }
.tlr-item-btn {
  width: 100%;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2px 8px;
  text-align: left;
  background: #1b1e27;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 7px 8px;
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.tlr-item-btn:hover { border-color: rgba(255, 215, 0, 0.35); }
.tlr-item-on .tlr-item-btn { border-color: #ffd54a; background: #23262f; }
.tlr-stale .tlr-item-btn { opacity: 0.65; }
.tlr-item-main { display: flex; flex-direction: column; min-width: 0; }
.tlr-item-match { font-weight: 700; color: #ffe08a; overflow-wrap: anywhere; }
.tlr-item-msg { color: #cfcab9; font-size: 13px; overflow-wrap: anywhere; }
.tlr-item-meta { grid-column: 2; display: flex; gap: 6px; flex-wrap: wrap; font-size: 13px; color: #8d897e; }
.tlr-st { border-radius: 4px; padding: 0 5px; background: #2b2f3a; color: #cfcab9; }
.tlr-st-ACCEPTED { background: #1f3d27; color: #b9f0c4; }
.tlr-st-DISMISSED { background: #3a2323; color: #ffc4c4; }
.tlr-st-EXEMPTED { background: #2c2440; color: #d8c8ff; }
.tlr-st-STALE { background: #444; color: #ddd; }
.tlr-detail { flex: 0 0 auto; border-top: 1px solid rgba(255, 215, 0, 0.25); max-height: 58%; overflow-y: auto; background: #181a23; }
.tlr-detail[hidden] { display: none; }
.tlr-detail-in { padding: 10px 14px 12px; display: flex; flex-direction: column; gap: 6px; }
.tlr-detail-head { display: flex; align-items: center; gap: 8px; }
.tlr-detail-head .tlr-x { margin-left: auto; }
.tlr-muted { color: #8d897e; font-size: 13px; }
.tlr-message { margin: 0; }
.tlr-warn { margin: 0; color: #ffcf7a; font-size: 13px; }
.tlr-ctx { margin: 0; padding: 6px 8px; background: #0f1117; border-radius: 6px; overflow-wrap: anywhere; }
.tlr-ctx-side { color: #a9a59a; }
.tlr-ctx-hit { background: #ffd54a; color: #1b1400; border-radius: 3px; padding: 0 2px; }
.tlr-basis { border: 1px solid rgba(140, 200, 255, 0.25); border-radius: 6px; padding: 6px 8px; display: flex; flex-direction: column; gap: 3px; }
.tlr-basis-t { font-size: 13px; font-weight: 700; color: #8cc8ff; }
.tlr-kv { display: grid; grid-template-columns: 64px 1fr; gap: 6px; font-size: 13px; }
.tlr-k { color: #8d897e; }
.tlr-v { overflow-wrap: anywhere; }
.tlr-where { display: flex; flex-direction: column; gap: 2px; }
.tlr-actions { display: flex; flex-direction: column; gap: 6px; }
.tlr-reason { width: 100%; box-sizing: border-box; resize: vertical; }
.tlr-actions .tlr-btn-primary { margin-left: 0; }
.tlr-note { margin: 2px 0 0; font-size: 13px; color: #8d897e; }
.tlr-foot { display: flex; gap: 6px; padding: 8px 14px 12px; border-top: 1px solid rgba(255, 255, 255, 0.08); }
.tlr-hlbox {
  position: fixed;
  z-index: 1000009;
  pointer-events: none;
  border: 3px solid #ffd54a;
  border-radius: 10px;
  box-shadow: 0 0 0 4px rgba(255, 213, 74, 0.25), 0 0 24px rgba(255, 213, 74, 0.55);
  transition: opacity 0.2s;
}
.tlr-hlbox[hidden] { display: none; }
@media (max-width: 600px) {
  .tlr-panel { width: 100vw; border-left: 0; }
  .tlr-toggle { top: auto; bottom: 88px; right: 12px; }
  .tlr-detail { max-height: 60%; }
}
@media (prefers-reduced-motion: reduce) {
  .tlr-hlbox { transition: none; }
}

/* 探索对话框（搜索、笔记等）打开时收起审核开关，免得压住对话框按钮 */
body:has(.tlx-dialog-overlay) .tlr-toggle { visibility: hidden; }

/* 比较弹窗 / 430 年寄居弹窗打开时收起审核开关 */
body:has(.lc-overlay.active) .tlr-toggle,
body:has(#sojournOverlay.active) .tlr-toggle { visibility: hidden; }

/* 「跳转」菜单打开时收起审核开关（它在菜单右上角，会压住菜单） */
body:has(.nav-dropdown-wrap.open) .tlr-toggle { visibility: hidden; }
