/* ==========================================================================
   刑侦档案·三大标杆机制顶级质感增强样式库
   1. 《黄金偶像案》法定制式案情事实完形推演盘 (Golden Idol Cloze Deduction)
   2. 刑事科学技术痕检同一认定档案卡 (18特征点指纹/工具显微比对/16位点DNA图谱)
   3. 公安专网跨部门协查调证与官方回函系统 (Public Security Inter-Agency Inquiries)
   ========================================================================== */

/* 1. 《黄金偶像案》风格：案情事实认定完形推演盘 */
.cloze-deduction-wrap {
  background: #faf7ee;
  border: 2px solid #b8a688;
  box-shadow: 0 4px 16px rgba(60, 45, 20, 0.08), inset 0 0 40px rgba(210, 190, 160, 0.2);
  border-radius: 4px;
  padding: 24px 28px;
  margin: 16px 0 24px 0;
  position: relative;
  font-family: 'Noto Serif SC', 'Source Han Serif SC', 'FangSong', '仿宋', STFangsong, serif;
  color: #2b251f;
  line-height: 2.2;
  font-size: 16px;
}

.cloze-deduction-wrap::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 36px;
  width: 1px;
  background: rgba(190, 50, 40, 0.22);
  pointer-events: none;
}

.cloze-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  border-bottom: 2px solid #8c2d2d;
  padding-bottom: 12px;
  margin-bottom: 20px;
}

.cloze-title-block {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cloze-subhead {
  font-size: 13px;
  letter-spacing: 2px;
  color: #8c2d2d;
  font-weight: 700;
  text-transform: uppercase;
}

.cloze-main-title {
  font-size: 20px;
  font-weight: 800;
  color: #1a1612;
  letter-spacing: 1px;
}

.cloze-badge-sec {
  font-size: 12px;
  background: #f0e6d2;
  border: 1px solid #c4b293;
  color: #634d30;
  padding: 3px 8px;
  border-radius: 3px;
  letter-spacing: 1px;
}

.cloze-paragraph {
  margin-bottom: 18px;
  text-indent: 2em;
  text-align: justify;
}

.cloze-slot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  text-indent: 0;
  min-width: 110px;
  height: 32px;
  padding: 0 10px;
  margin: 0 4px;
  border-bottom: 2px dashed #8b6d43;
  background: rgba(235, 225, 205, 0.45);
  color: #70583b;
  font-size: 14.5px;
  font-family: inherit;
  cursor: pointer;
  border-radius: 3px;
  transition: all 0.2s ease;
  user-select: none;
}

.cloze-slot:hover {
  background: rgba(220, 205, 175, 0.75);
  border-bottom-color: #8c2d2d;
  transform: translateY(-1px);
}

.cloze-slot.is-filled {
  background: #fff8e8;
  border: 1px solid #bba375;
  border-bottom: 2px solid #8c2d2d;
  color: #1a1208;
  font-weight: 700;
  padding-right: 6px;
  box-shadow: 0 1px 4px rgba(70, 50, 20, 0.08);
}

.cloze-slot.is-correct {
  background: #f4faee;
  border-color: #5b8f45;
  color: #275618;
}

.cloze-slot.is-error {
  background: #fff0f0;
  border-color: #d64a4a;
  color: #8c1e1e;
}

.cloze-slot-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  margin-left: 6px;
  border-radius: 50%;
  background: rgba(140, 45, 45, 0.1);
  color: #8c2d2d;
  font-size: 12px;
  line-height: 1;
  transition: background 0.15s;
}

.cloze-slot-remove:hover {
  background: #8c2d2d;
  color: #fff;
}

.cloze-popover-mask {
  position: fixed;
  inset: 0;
  background: rgba(15, 12, 10, 0.45);
  backdrop-filter: blur(2px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cloze-popover-card {
  background: #fbf9f4;
  border: 2px solid #9e825a;
  border-radius: 6px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.25);
  width: 92%;
  max-width: 580px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: inherit;
}

.cloze-popover-header {
  background: #f1e9d8;
  border-bottom: 1px solid #d4c5a9;
  padding: 12px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cloze-popover-title {
  font-weight: 700;
  font-size: 15px;
  color: #3e3122;
  display: flex;
  align-items: center;
  gap: 8px;
}

.cloze-words-grid {
  padding: 16px 18px;
  overflow-y: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.cloze-word-chip {
  background: #fff;
  border: 1px solid #cfc0a5;
  border-radius: 4px;
  padding: 6px 12px;
  font-size: 14px;
  color: #2b251f;
  cursor: pointer;
  transition: all 0.15s;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.cloze-word-chip:hover {
  background: #8c2d2d;
  color: #fff;
  border-color: #8c2d2d;
  transform: translateY(-1px);
}

.cloze-actions-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid #d4c5a9;
}

.cloze-btn-primary {
  background: #8c2d2d;
  color: #fff;
  border: 1px solid #6b1f1f;
  padding: 8px 20px;
  border-radius: 4px;
  font-size: 14.5px;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 1px;
  box-shadow: 0 2px 6px rgba(140, 45, 45, 0.3);
  transition: background 0.15s;
}

.cloze-btn-primary:hover {
  background: #a33535;
}

.cloze-btn-secondary {
  background: #eae2d1;
  color: #4f3f2a;
  border: 1px solid #c2b297;
  padding: 8px 14px;
  border-radius: 4px;
  font-size: 13.5px;
  cursor: pointer;
  transition: background 0.15s;
}

.cloze-btn-secondary:hover {
  background: #dfd5c1;
}

.cloze-stamp-banner {
  position: absolute;
  right: 40px;
  bottom: 25px;
  width: 140px;
  height: 140px;
  border: 4px double #b32424;
  border-radius: 50%;
  color: #b32424;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 14.5px;
  letter-spacing: 2px;
  transform: rotate(-14deg) scale(0.9);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: inset 0 0 12px rgba(179, 36, 36, 0.2), 0 0 12px rgba(179, 36, 36, 0.15);
  text-align: center;
}

.cloze-stamp-banner.stamp-visible {
  opacity: 0.92;
  transform: rotate(-14deg) scale(1.05);
}

.cloze-stamp-inner {
  border-top: 1px dashed #b32424;
  border-bottom: 1px dashed #b32424;
  padding: 3px 0;
  margin: 2px 0;
  font-size: 12px;
  letter-spacing: 1px;
}

/* 2. 刑事科学技术痕检同一认定档案卡 */
.forensic-card-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(12, 10, 8, 0.65);
  backdrop-filter: blur(3px);
  z-index: 10001;
  display: flex;
  align-items: center;
  justify-content: center;
}

.forensic-card-window {
  background: #fbf8f2;
  border: 2px solid #8f7956;
  border-radius: 6px;
  width: 94%;
  max-width: 920px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 16px 48px rgba(0,0,0,0.3);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  color: #2b251f;
  overflow: hidden;
}

.forensic-card-header {
  background: #463422;
  color: #f7ecd7;
  padding: 12px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.forensic-card-nav {
  display: flex;
  gap: 8px;
  background: #ede3d1;
  padding: 8px 16px;
  border-bottom: 1px solid #d4c5a9;
}

.forensic-nav-tab {
  padding: 6px 14px;
  border-radius: 4px;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  color: #634e35;
  background: transparent;
  border: none;
  transition: all 0.15s;
}

.forensic-nav-tab.active {
  background: #8c2d2d;
  color: #fff;
}

.forensic-card-body {
  padding: 18px 22px;
  overflow-y: auto;
  flex: 1;
}

.fp-comparator-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.fp-pane {
  background: #f0ebe0;
  border: 1px solid #c9baa1;
  border-radius: 4px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

.fp-pane-title {
  font-size: 13px;
  font-weight: 700;
  color: #634d30;
  margin-bottom: 8px;
}

.fp-canvas-wrapper {
  position: relative;
  width: 280px;
  height: 320px;
  background: #e6dfce;
  border: 1px solid #bba88e;
  border-radius: 4px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fp-point-marker {
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid #d63030;
  background: rgba(214, 48, 48, 0.25);
  transform: translate(-50%, -50%);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 900;
  color: #8c1e1e;
  transition: transform 0.15s, background 0.15s;
  user-select: none;
}

.fp-point-marker:hover, .fp-point-marker.active {
  transform: translate(-50%, -50%) scale(1.35);
  background: #d63030;
  color: #fff;
  z-index: 10;
}

.micro-scope-wrapper {
  background: #111417;
  border: 3px solid #3d454d;
  border-radius: 8px;
  padding: 16px;
  color: #cad3dc;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.micro-circular-aperture {
  width: 320px;
  height: 320px;
  border-radius: 50%;
  border: 4px solid #5a6673;
  box-shadow: 0 0 24px rgba(0,0,0,0.8), inset 0 0 30px rgba(0,0,0,0.9);
  position: relative;
  overflow: hidden;
  background: #000;
  display: flex;
}

.micro-half-left, .micro-half-right {
  width: 50%;
  height: 100%;
  position: relative;
  overflow: hidden;
}

.micro-divider {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  background: #00ffcc;
  box-shadow: 0 0 8px #00ffcc;
  z-index: 5;
}

.micro-slider-control {
  width: 100%;
  max-width: 420px;
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.dna-str-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin-top: 10px;
  background: #fff;
  border: 1px solid #d4c5a9;
}

.dna-str-table th {
  background: #ede3d1;
  color: #4f3f2a;
  padding: 6px 10px;
  border: 1px solid #d4c5a9;
  text-align: center;
}

.dna-str-table td {
  padding: 6px 10px;
  border: 1px solid #e0d5c1;
  text-align: center;
}

.dna-match-chip {
  background: #e8f5e9;
  color: #2e7d32;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 11.5px;
}

/* 3. 公安专网跨部门协查调证与官方回函系统 */
.inquiry-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(14, 12, 10, 0.6);
  backdrop-filter: blur(2px);
  z-index: 10002;
  display: flex;
  align-items: center;
  justify-content: center;
}

.inquiry-window {
  background: #faf7ee;
  border: 2px solid #8c2d2d;
  border-radius: 4px;
  width: 92%;
  max-width: 780px;
  max-height: 86vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 16px 40px rgba(0,0,0,0.3);
  font-family: 'Noto Serif SC', 'FangSong', '仿宋', serif;
  color: #2b251f;
  overflow: hidden;
}

.inquiry-header-red {
  background: #8c2d2d;
  color: #fff;
  padding: 12px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.inquiry-body {
  padding: 20px 24px;
  overflow-y: auto;
  line-height: 1.8;
}

.inquiry-form-group {
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.inquiry-label {
  font-size: 13.5px;
  font-weight: 700;
  color: #634d30;
}

.inquiry-select, .inquiry-input {
  background: #fff;
  border: 1px solid #c4b293;
  padding: 8px 12px;
  border-radius: 3px;
  font-family: inherit;
  font-size: 14px;
  color: #2b251f;
}

.inquiry-memo-card {
  background: #fff;
  border: 1px solid #c9baa1;
  box-shadow: inset 0 0 20px rgba(220, 205, 175, 0.2);
  padding: 22px 26px;
  margin-top: 14px;
  position: relative;
}

.inquiry-red-header {
  color: #a82e2e;
  font-size: 20px;
  font-weight: 900;
  text-align: center;
  letter-spacing: 2px;
  border-bottom: 2px solid #a82e2e;
  padding-bottom: 10px;
  margin-bottom: 14px;
}

.inquiry-seal-red {
  position: absolute;
  right: 40px;
  bottom: 25px;
  width: 120px;
  height: 120px;
  border: 3px solid #b32424;
  border-radius: 50%;
  color: #b32424;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 1px;
  transform: rotate(-10deg);
  opacity: 0.88;
  pointer-events: none;
  text-align: center;
  line-height: 1.4;
}

/* --------------------------------------------------------------------------
   4. 《奥伯拉丁的回归》三联因果锁定机制 (Triple Verification System)
   -------------------------------------------------------------------------- */
.triple-chains-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
  margin: 18px 0;
}

.triple-chain-card {
  background: #fbf9f4;
  border: 1.5px solid #c9baa1;
  border-radius: 4px;
  padding: 14px 16px;
  box-shadow: 0 2px 8px rgba(60, 45, 20, 0.05);
  position: relative;
  overflow: hidden;
}

.triple-chain-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: #8c2d2d;
}

.triple-chain-header {
  font-size: 13.5px;
  font-weight: 800;
  color: #8c2d2d;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  letter-spacing: 0.5px;
}

.triple-chain-desc {
  font-size: 12px;
  color: #776a5b;
  margin-bottom: 10px;
  line-height: 1.5;
}

.triple-lock-stamp {
  position: absolute;
  right: 28px;
  bottom: 24px;
  width: 156px;
  height: 156px;
  border: 4px double #b32424;
  border-radius: 50%;
  color: #b32424;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 14px;
  letter-spacing: 2px;
  transform: rotate(-12deg) scale(0.9);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: inset 0 0 14px rgba(179, 36, 36, 0.25), 0 0 16px rgba(179, 36, 36, 0.15);
  text-align: center;
  z-index: 10;
}

.triple-lock-stamp.stamp-visible {
  opacity: 0.95;
  transform: rotate(-12deg) scale(1.08);
}

/* --------------------------------------------------------------------------
   5. 《SQL Murder Mystery》×《全网公敌》跨库碰撞核查台
   -------------------------------------------------------------------------- */
.osint-tab-bar {
  display: flex;
  gap: 8px;
  background: #ede3d1;
  padding: 8px 16px;
  border-bottom: 1px solid #d4c5a9;
}

.osint-nav-btn {
  padding: 6px 14px;
  border-radius: 4px;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  color: #634e35;
  background: transparent;
  border: none;
  transition: all 0.15s;
}

.osint-nav-btn.active {
  background: #8c2d2d;
  color: #fff;
}

.osint-filter-panel {
  background: #f4eee1;
  border: 1px solid #d4c5a9;
  border-radius: 4px;
  padding: 14px 18px;
  margin-bottom: 16px;
}

.osint-stat-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 3px;
  background: #e8f5e9;
  color: #2e7d32;
  border: 1px solid #c8e6c9;
}

.osint-table-container {
  max-height: 300px;
  overflow-y: auto;
  border: 1px solid #d4c5a9;
  border-radius: 4px;
  background: #fff;
  margin-top: 10px;
}

.osint-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  text-align: left;
}

.osint-table th {
  background: #ede3d1;
  color: #4f3f2a;
  padding: 8px 10px;
  border: 1px solid #d4c5a9;
  position: sticky;
  top: 0;
  z-index: 2;
  font-weight: 700;
}

.osint-table td {
  padding: 7px 10px;
  border: 1px solid #e6dcc9;
  color: #2b251f;
}

.osint-table tr:hover {
  background: #fff8e8;
}

.osint-table tr.highlighted {
  background: #fff0f0;
  font-weight: 700;
}

.osint-extract-btn {
  background: #8c2d2d;
  color: #fff;
  border: none;
  padding: 3px 8px;
  border-radius: 3px;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
}

.osint-extract-btn:hover {
  background: #a82e2e;
}

/* v380 五大模块 CSS
   审讯室 | 解剖台 | 搜查证 | 警衔功勋 | PDT对讲机
*/
@keyframes documentSlideIn {
  from { opacity: 0; transform: translateY(20px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0)    scale(1);    }
}

/* 审讯室 */
#interrogationBackdrop > div { animation: documentSlideIn 0.25s ease; }
.confront-tactic-btn:hover   { background: #3a2010 !important; border-color: #8c2d2d !important; transform: translateY(-1px); }
.confront-evidence-btn:hover { background: #3a2410 !important; border-color: #c07020 !important; }
.suspect-item:hover          { background: rgba(140,45,45,0.15) !important; }

/* 解剖台 */
#autopsyBackdrop > div          { animation: documentSlideIn 0.25s ease; }
.autopsy-tab-btn                { transition: all 0.15s ease; }
.autopsy-tab-btn:hover          { background: #fff8f0 !important; }
.injury-type-btn                { transition: all 0.2s ease; }
.injury-type-btn:hover          { opacity: 0.9; transform: translateY(-1px); }
.tox-input:focus,
.pathology-note:focus           { outline: none; border-color: #8c2d2d !important; box-shadow: 0 0 0 2px rgba(140,45,45,0.12); }

/* 搜查证 */
#warrantBackdrop > div   { animation: documentSlideIn 0.25s ease; }
.warrant-field:focus     { outline: none; border-color: #8c2d2d !important; box-shadow: 0 0 0 2px rgba(140,45,45,0.12); }
.raid-loc-btn:hover      { border-color: #8c2d2d !important; background: #f9f0f0 !important; }
#signWarrantBtn          { transition: all 0.2s ease; }
#signWarrantBtn:hover    { background: #6b1f1f !important; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(140,45,45,0.3); }

/* 警衔功勋 */
#meritRankBackdrop > div,
#meritAwardBackdrop > div { animation: documentSlideIn 0.3s ease; }
#meritMiniWidget          { transition: all 0.2s ease; }
#meritMiniWidget:hover    { background: #ede8d8 !important; transform: translateY(-1px); box-shadow: 0 2px 8px rgba(100,80,50,0.15); }
@keyframes medalPop {
  0%   { transform: scale(0.5); opacity: 0; }
  70%  { transform: scale(1.1); opacity: 1; }
  100% { transform: scale(1);   opacity: 1; }
}

/* PDT 对讲机 */
#pdtRadioWidget           { transition: box-shadow 0.2s ease; }
#pdtRadioWidget:hover     { box-shadow: 0 12px 40px rgba(0,0,0,0.7) !important; }
.pdt-ch-btn               { transition: all 0.15s ease; }
.pdt-ch-btn:hover         { opacity: 0.85; }
.pdt-ambient-btn          { transition: all 0.15s ease; }
.pdt-ambient-btn:hover    { opacity: 0.85; transform: translateY(-1px); }
#pdtPTTBtn                { transition: all 0.1s ease; user-select: none; }
#pdtPTTBtn:active         { background: #5a1010 !important; transform: scale(0.97); }

/* 响应式 */
@media (max-width: 768px) {
  #interrogationBackdrop > div,
  #autopsyBackdrop > div,
  #warrantBackdrop > div,
  #meritRankBackdrop > div { width: 100% !important; max-width: 100% !important; border-radius: 0 !important; }
  #pdtRadioBackdrop         { bottom: 10px !important; right: 10px !important; width: 300px !important; }
}


/* ========================================================
   v390 深色档案模式 & 综合体验增强
   ======================================================== */
[data-theme="dark"] {
  --bg-parchment: #181512 !important;
  --text-ink: #d8ceb8 !important;
  --border-red: #8c2d2d !important;
}

[data-theme="dark"] body {
  background-color: #12100d !important;
  color: #d8ceb8 !important;
}

[data-theme="dark"] .case-detail,
[data-theme="dark"] .investigation-view,
[data-theme="dark"] .clue-card,
[data-theme="dark"] .board-container {
  background-color: #1c1813 !important;
  color: #d8ceb8 !important;
  border-color: #3d3326 !important;
}

[data-theme="dark"] .topbar {
  background: #14110e !important;
  border-bottom: 1px solid #3d3326 !important;
}

/* 打印公文特殊样式 */
@media print {
  body {
    background: #fff !important;
    color: #000 !important;
  }
  .topbar, #pdtRadioWidget, #caseTimerWidget, .nav-tabs, button {
    display: none !important;
  }
}
