/* D-023 第二批的样式：本所概况（overview.js）、站内提醒的小铃铛（notices.js）、知识库审核台和“存为本所知识”（review.js）、
   使用记录和知识库的筛选折叠、分页（app.js）。颜色、字体沿用 style.css 里的变量；三色状态标签沿用 D-022 的。 */

/* ==================== 被退回的材料（D-024） ==================== */
/* 用虚线描边的棕黄色，和“要我处理”的实底红、知识库状态的几种中性色都分得开 */
.badge.returned { background: #fff; color: #8a4a00; border: 1px dashed #b8792a; font-weight: 600; margin-left: 6px; }
.notice.returned { background: #fff8ea; color: #6b3d05; border: 1px dashed #c99a4f; line-height: 1.8; }
.sub.returned-why { color: #8a4a00; }
.doc-reviewed { margin: 0 0 12px; color: var(--muted); font-size: 13.5px; }

/* ==================== 分页、筛选折叠 ==================== */
.pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 16px; color: var(--muted); font-size: 13.5px; }
.filters-toggle { display: none; }
.filters-more { display: contents; }
.filters.fold > input[type="text"] { order: 1; } /* 电脑上搜索框和原来一样排在各项筛选的后面 */
.filters .f-dates { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13.5px; }
.filters .f-dates input { flex: none; min-width: 0; width: 150px; }

/* ==================== 本所概况 ==================== */
.page.ov-page { max-width: 1040px; }
.ov-page .card { margin-top: 16px; }
.ov-page .end-tiles { margin-bottom: 4px; }
.end-tile.ov-alert { border-color: #e3b1ab; }
.end-tile.ov-alert b { color: #c8372d; }
.ov-items { margin-top: 8px; }
.ov-item { display: flex; align-items: center; gap: 14px; padding: 11px 6px; border-bottom: 1px solid #efe9db; color: var(--text); }
.ov-item:last-child { border-bottom: 0; }
.ov-item:hover { background: #faf7ef; }
.ov-item .badge { flex: none; }
.ov-item-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ov-item-main b { font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ov-item-main small { color: var(--muted); font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ov-item-wait { flex: none; color: var(--muted); font-size: 13.5px; white-space: nowrap; }
.ov-item-wait.over, .ov-over { color: #c8372d; font-weight: 600; }
.ov-two { align-items: start; margin-top: 16px; }
.ov-two > .card { margin-top: 0; }
.ov-lawyers, .ov-companies { margin-top: 8px; }
.ov-lawyers td, .ov-lawyers th { white-space: nowrap; }
.ov-days { color: var(--muted); font-size: 13.5px; }
.ov-topics { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.ov-topic { display: inline-flex; align-items: baseline; gap: 8px; padding: 5px 12px; border: 1px solid var(--line-strong); border-radius: 4px; background: #fff; font-size: 14.5px; }
.ov-topic b { font-family: Georgia, var(--serif); font-weight: 400; color: var(--gold-deep); }
.ov-feat { margin: 12px 0 0; color: var(--muted); font-size: 13.5px; }
.ov-note { margin: 12px 0 0; }
.ov-trend { margin-left: 6px; color: var(--muted); }
.ov-trend.up { color: var(--ok); }
.ov-warn { color: var(--warn); font-weight: 600; }

/* ==================== 小铃铛 ==================== */
#bell {
  position: fixed; top: 16px; right: 20px; z-index: 45; width: 40px; height: 40px; padding: 0; border-radius: 50%;
  border: 1px solid var(--line-strong); background: var(--card); color: var(--ink); cursor: pointer;
  display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 8px rgba(18, 26, 42, .06);
}
#bell:hover, #bell.open { border-color: var(--gold); }
#bell .ico { margin: 0; }
#bell .ico svg { width: 20px; height: 20px; }
#bell b { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: #c8372d; color: #fff; font: 600 11.5px/18px var(--sans); text-align: center; }
body.super-acting #bell { top: 54px; }
body.auth #bell { display: none; }
#bell-panel {
  position: fixed; top: 64px; right: 20px; z-index: 49; width: 380px; max-width: calc(100vw - 24px); max-height: min(72vh, 600px); overflow-y: auto;
  background: var(--card); border: 1px solid var(--line-strong); border-radius: var(--radius); box-shadow: 0 12px 36px rgba(18, 26, 42, .16);
}
body.super-acting #bell-panel { top: 102px; }
.bell-head { position: sticky; top: 0; display: flex; align-items: baseline; gap: 10px; padding: 12px 14px 10px; background: var(--card); border-bottom: 1px solid var(--line); }
.bell-head b { font-family: var(--serif); font-size: 16px; color: var(--ink); }
.bell-head small { color: var(--muted); font-size: 13px; }
.bell-head .link { margin-left: auto; font-size: 13.5px; }
.bell-x { border: 0; background: transparent; font-size: 20px; line-height: 1; color: var(--muted); cursor: pointer; padding: 0 2px; }
.bell-head .link + .bell-x { margin-left: 4px; }
.bell-head small + .bell-x, .bell-head b + .bell-x { margin-left: auto; }
.bell-note { padding: 8px 14px; background: var(--gold-soft); color: #5d4a22; font-size: 13px; line-height: 1.6; border-bottom: 1px solid var(--line); }
.bell-item { display: flex; flex-direction: column; gap: 3px; width: 100%; text-align: left; padding: 11px 14px 11px 18px; border: 0; border-bottom: 1px solid #efe9db; background: transparent; font: inherit; color: var(--text); cursor: pointer; position: relative; }
.bell-item:last-child { border-bottom: 0; }
.bell-item:hover { background: #faf7ef; }
.bell-item.unread::before { content: ""; position: absolute; left: 7px; top: 18px; width: 6px; height: 6px; border-radius: 50%; background: #c8372d; }
.bell-item-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.bell-kind { font-size: 12.5px; color: var(--muted); letter-spacing: 1px; }
.bell-kind.over { color: #c8372d; font-weight: 600; }
.bell-kind.exp { color: var(--warn); font-weight: 600; }
.bell-item time { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.bell-item-title { font-size: 14.5px; line-height: 1.5; color: var(--muted); }
.bell-item.unread .bell-item-title { color: var(--ink); font-weight: 600; }
.bell-item-body { font-size: 13.5px; line-height: 1.5; color: var(--muted); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.bell-empty { padding: 26px 18px; text-align: center; color: var(--muted); font-size: 13.5px; line-height: 1.8; }
/* 页面顶上那一行给铃铛留出位置：页面不够宽时，标题行右边的按钮会碰到它 */
@media (max-width: 1260px) { body.has-bell .page-head { padding-right: 56px; } }
body.has-bell .page.mt-page .page-head, body.has-bell .page.rv-page .page-head { padding-right: 56px; }

/* ==================== 知识库审核台 ==================== */
.page.rv-page { max-width: 1240px; }
.rv-progress { margin-bottom: 16px; }
.rv-progress-text { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.rv-progress-text b { font-family: var(--serif); font-size: 18px; color: var(--ink); letter-spacing: 1px; }
.rv-progress-text span { color: var(--muted); font-size: 13.5px; }
.rv-bar { height: 8px; margin-top: 8px; background: #ece6d8; border-radius: 4px; overflow: hidden; }
.rv-bar i { display: block; height: 100%; background: var(--ok); border-radius: 4px; min-width: 2px; }
.rv-wrap { display: grid; grid-template-columns: 380px minmax(0, 1fr); gap: 16px; align-items: start; }
.rv-side, .rv-pane { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.rv-side { padding: 14px 0 12px; }
.rv-side .filters { padding: 0 14px; margin-bottom: 10px; }
.rv-side .filters select { flex: 1 1 46%; min-width: 0; }
.rv-side .filters input { flex: 1 1 100%; min-width: 0; }
.rv-batch-row { padding: 0 14px 12px; border-bottom: 1px solid var(--line); }
.rv-batch-row .btn { width: 100%; justify-content: center; }
.rv-list { max-height: calc(100vh - 380px); min-height: 240px; overflow-y: auto; }
.rv-item { display: flex; align-items: flex-start; gap: 10px; padding: 0 14px; border-bottom: 1px solid #efe9db; border-left: 3px solid transparent; }
.rv-item.on { background: #faf7ef; border-left-color: var(--gold); }
.rv-item input { flex: none; width: 17px; height: 17px; margin-top: 15px; }
.rv-item-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; padding: 11px 0; border: 0; background: transparent; font: inherit; text-align: left; color: var(--text); cursor: pointer; }
.rv-item-title { font-size: 15px; line-height: 1.5; color: var(--ink); }
.rv-item-title b { margin-right: 8px; color: var(--gold-deep); }
.rv-item-sub { display: flex; justify-content: space-between; align-items: center; gap: 8px; color: var(--muted); font-size: 13.5px; }
.rv-item-sub .badge { flex: none; margin-left: 0; }
.rv-side .pager { margin: 12px 0 0; }
.rv-pane { padding: 20px 24px 0; min-height: 320px; display: flex; flex-direction: column; }
.rv-back { display: none; align-self: flex-start; margin-bottom: 12px; }
.rv-doc-head h2 { font-family: var(--serif); font-size: 20px; color: var(--ink); line-height: 1.5; margin: 0; }
.rv-doc-meta, .rv-issues { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.rv-doc-meta .badge.returned { margin-left: 0; }
.rv-by { margin: 10px 0 0; color: var(--muted); font-size: 13.5px; line-height: 1.7; }
.rv-pane .notice.returned { margin: 14px 0 0; }
.rv-doc-body { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); max-height: calc(100vh - 430px); min-height: 200px; overflow-y: auto; }
.rv-actions { position: sticky; bottom: 0; display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap; margin: 14px -24px 0; padding: 12px 24px; border-top: 1px solid var(--line); background: var(--card); border-radius: 0 0 var(--radius) var(--radius); }
.rv-actions .hf-tip { margin-right: auto; }
.rv-hint { margin: auto; }
.rv-batch { margin: 0 0 14px; padding: 10px 14px 10px 30px; max-height: 240px; overflow-y: auto; background: #faf7ef; border: 1px solid var(--line); border-radius: 4px; line-height: 1.9; }
.rv-batch b { margin-right: 8px; color: var(--gold-deep); }
.rv-sure { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 4px; cursor: pointer; line-height: 1.7; }
.rv-sure input { flex: none; width: 17px; height: 17px; margin-top: 4px; }

/* ==================== 存为本所知识 ==================== */
.mt-keep { margin-top: 8px; }
.sens-panel { margin: 0 0 14px; padding: 10px 14px; background: #fff9db; border: 1px solid #ecd67a; border-radius: 4px; font-size: 14px; line-height: 1.7; color: #5c4a00; }
.sens-panel b { font-weight: 600; }
.sens-panel.clear { background: var(--ok-soft); border-color: #c9dfd0; color: #23523c; }
.sens-words { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.sens-word { display: inline-flex; align-items: baseline; gap: 8px; padding: 3px 10px; border: 1px solid #d9bf4d; border-radius: 4px; background: #ffe58a; color: #3d3100; font: inherit; font-size: 14px; cursor: pointer; }
.sens-word small { color: #6f5c10; font-size: 12.5px; }
.sens-wrap { position: relative; }
.sens-wrap textarea { position: relative; display: block; background: transparent; overflow-y: scroll; resize: none; }
.sens-back { position: absolute; inset: 0; overflow-y: scroll; white-space: pre-wrap; overflow-wrap: break-word; word-break: normal; color: transparent; background: #fff; border-style: solid; border-color: transparent; pointer-events: none; box-sizing: border-box; }
.sens-back mark { background: #ffe58a; color: transparent; border-radius: 2px; }

/* ==================== 窄屏 ==================== */
@media (max-width: 1000px) {
  .rv-wrap { grid-template-columns: minmax(0, 1fr); }
  .rv-page.has-sel .rv-side { display: none; }
  .rv-page:not(.has-sel) .rv-pane { display: none; }
  .rv-back { display: inline-flex; }
  .rv-list { max-height: none; }
  .rv-doc-body { max-height: none; }
  .ov-two { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  /* 筛选收成一行：搜索框 + “筛选”按钮，其余的点开才出来 */
  .filters.fold { flex-wrap: wrap; }
  .filters.fold > input[type="text"] { flex: 1 1 0; min-width: 0; order: 0; }
  .filters.fold .filters-toggle { display: inline-flex; flex: none; align-items: center; }
  .filters.fold .filters-more { display: none; flex: 1 1 100%; flex-wrap: wrap; gap: 10px; }
  .filters.fold.open .filters-more { display: flex; }
  .filters .f-dates { flex: 1 1 100%; }
  .filters .f-dates input { flex: 1 1 0; width: auto; }
  .pager { gap: 10px; }
  /* 铃铛放在页面顶上，跟着页面走，不盖住往下滑时的内容 */
  #bell { position: absolute; top: 12px; right: 12px; width: 36px; height: 36px; }
  body.super-acting #bell { top: 64px; }
  #bell-panel { position: absolute; top: 54px; left: 10px; right: 10px; width: auto; max-width: none; max-height: none; }
  body.super-acting #bell-panel { top: 106px; }
  body.has-bell .page-head { padding-right: 48px; }
  .ov-item { flex-wrap: wrap; gap: 6px 10px; padding: 10px 2px; }
  .ov-item-main { flex: 1 1 100%; order: 3; }
  .ov-item-main b, .ov-item-main small { white-space: normal; }
  .ov-item-wait { margin-left: auto; }
  .ov-page .card:has(> table.list) { overflow-x: auto; }
  table.list.ov-lawyers { min-width: 0; }
  .rv-pane { padding: 14px 14px 0; }
  .rv-actions { margin: 12px -14px 0; padding: 10px 14px; bottom: 58px; }
  .rv-actions .hf-tip { flex: 1 1 100%; }
  .rv-actions .btn { flex: 1 1 auto; justify-content: center; }
  .rv-side .filters select { flex: 1 1 46%; }
}
