/* 模块：三栏审核工作台 (finesse-ui High-Craft Workbench)、顶栏在线状态、通知中心 Flyout 与 CSV 导入面板 (assets/review-topbar.css) */
/* finesse · register=product(workbench) · soul=botanical-laboratory-precision · SPECTACLE=2 · DENSITY=8 */

/* 1. 工作台一体化单行指挥顶栏 (严禁折行悬空与水平溢出) */
#scene-review {
  max-width: 100%;
  overflow-x: hidden;
  box-sizing: border-box;
}
.review-workbench-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 24px 12px;
  flex-wrap: wrap;
  box-sizing: border-box;
  width: 100%;
}
.review-wb-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex-wrap: wrap;
}
.review-wb-title-group h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 750;
  letter-spacing: -0.02em;
  color: var(--ink1);
  white-space: nowrap;
}
.review-sla-pills {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.review-sla-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  background: var(--surface);
  border: 1px solid var(--border-hairline);
  color: var(--ink2);
  white-space: nowrap;
}
.review-sla-pill.urgent {
  background: rgba(220, 38, 38, 0.09);
  border-color: rgba(220, 38, 38, 0.24);
  color: #DC2626;
}
.review-kbd-bar {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--ink3);
  background: rgba(22, 32, 25, 0.035);
  padding: 3px 8px;
  border-radius: 7px;
  border: 1px solid var(--border-hairline);
  white-space: nowrap;
}
@media (max-width: 1420px) {
  .review-kbd-bar { display: none; }
}
.review-kbd-bar kbd {
  display: inline-block;
  padding: 0 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px;
  font-weight: 600;
  color: var(--ink1);
  background: var(--surface);
  border: 1px solid rgba(22, 32, 25, 0.14);
  border-radius: 4px;
}

/* 补齐高危害红色徽标与全局防折行锁 (Anti-Wrap Floor) */
.badge-danger {
  background: rgba(220, 38, 38, 0.1) !important;
  color: #DC2626 !important;
  border: 1px solid rgba(220, 38, 38, 0.24) !important;
}
#scene-review .badge,
#scene-review .badge-subtle,
#scene-review .btn,
#scene-review .chart-seg-btn {
  white-space: nowrap !important;
  flex-shrink: 0;
}

/* 2. 三栏高工艺分屏容器 (修复 .split-flex-container width:100% 叠加 margin 导致右侧溢出 32px 遮挡问题) */
.review-grid,
.review-grid.split-flex-container {
  display: flex;
  flex: 1 1 0%;
  width: calc(100% - 48px) !important;
  max-width: calc(100% - 48px) !important;
  margin: 0 24px 20px !important;
  height: auto;
  min-height: 0;
  border-radius: 16px;
  border: 1px solid rgba(22, 32, 25, 0.09);
  box-shadow: 0 18px 44px -22px rgba(18, 32, 24, 0.11), 0 1px 3px rgba(18, 32, 24, 0.04);
  background: var(--surface);
  overflow: hidden;
  box-sizing: border-box;
}
.review-panel {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  height: 100%;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
  box-sizing: border-box;
}
#review-col-left,
#review-col-right {
  background: #FAFBF9;
}
#review-col-right {
  overflow-y: auto;
}
.review-grid > .gutter {
  background-color: rgba(22, 32, 25, 0.06);
  cursor: col-resize;
  position: relative;
  transition: background-color 0.15s ease;
}
.review-grid > .gutter:hover {
  background-color: rgba(45, 122, 82, 0.35);
}

/* 3. 左栏：高信号密度待审队列轨 (Triage Queue Rail) */
.review-queue-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink1);
  border-bottom: 1px solid var(--border-hairline);
  background: var(--surface);
}
.review-queue-filter-chips {
  display: flex;
  gap: 4px;
  padding: 6px 12px 8px;
  border-bottom: 1px solid var(--border-hairline);
  background: #FAFBF9;
}
.review-q-chip {
  flex: 1;
  height: 24px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  font-size: 11px;
  font-weight: 500;
  color: var(--ink2);
  cursor: pointer;
  transition: all 0.15s ease;
}
.review-q-chip:hover { color: var(--ink1); background: rgba(22, 32, 25, 0.04); }
.review-q-chip.active {
  background: var(--surface);
  color: var(--primary-dark);
  font-weight: 600;
  border-color: rgba(45, 122, 82, 0.22);
  box-shadow: 0 1px 2px rgba(18, 32, 24, 0.05);
}
.review-queue-body {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.queue-item {
  padding: 11px 12px;
  border-radius: 11px;
  border: 1px solid rgba(22, 32, 25, 0.06);
  background: var(--surface);
  cursor: pointer;
  font-size: 13px;
  transition: all 0.16s ease;
  position: relative;
}
.queue-item:hover {
  border-color: rgba(45, 122, 82, 0.28);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(18, 32, 24, 0.05);
}
.queue-item.on {
  background: linear-gradient(90deg, rgba(62, 197, 131, 0.11) 0%, rgba(62, 197, 131, 0.03) 100%);
  border-color: rgba(45, 122, 82, 0.42);
  box-shadow: inset 3px 0 0 var(--primary), 0 4px 14px rgba(27, 67, 50, 0.07);
}
.queue-idx-num {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--ink3);
  font-variant-numeric: tabular-nums;
}
.queue-item.on .queue-idx-num { color: var(--primary-dark); }

/* 4. 中栏：专家审阅画布与 2x2 编号病理矩阵 (Inspection Canvas) */
.review-detail {
  padding: 0;
  display: flex;
  flex-direction: column;
  height: 100%;
}
.review-canvas-head {
  padding: 16px 24px 14px;
  border-bottom: 1px solid var(--border-hairline);
  background: var(--surface);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}
.review-canvas-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 18px 24px 20px;
  background: #F6F8F5;
}
.review-pathology-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.review-path-card {
  background: var(--surface);
  border: 1px solid rgba(22, 32, 25, 0.07);
  border-radius: 12px;
  padding: 14px 16px;
  box-shadow: 0 1px 3px rgba(18, 32, 24, 0.03);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.review-path-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.review-ord-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: rgba(45, 122, 82, 0.12);
  color: var(--primary-dark);
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.review-diff-summary-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid rgba(22, 32, 25, 0.08);
  margin-bottom: 12px;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.review-dock-bar {
  padding: 10px 20px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(8px);
  border-top: 1px solid var(--border-hairline);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
}
.review-dock-bar .btn-sm {
  height: 32px;
  padding: 0 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

/* 5. 右栏：实时质量门禁卡与证据画廊 (Quality Gate & Evidence Aside) */
.evidence {
  padding: 14px 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.review-gate-card {
  flex-shrink: 0;
  background: var(--surface);
  border: 1px solid rgba(22, 32, 25, 0.08);
  border-radius: 12px;
  padding: 12px 14px;
  box-shadow: 0 1px 2px rgba(18, 32, 24, 0.03);
  min-width: 0;
  box-sizing: border-box;
}
.review-gate-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px dashed rgba(22, 32, 25, 0.07);
  font-size: 11.5px;
  min-width: 0;
}
.review-gate-row strong {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: right;
}
.review-gate-row:last-child { border-bottom: none; padding-bottom: 0; }
.review-tax-chain {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}
.review-tax-pill {
  font-size: 10.5px;
  padding: 2px 7px;
  border-radius: 5px;
  background: rgba(45, 122, 82, 0.08);
  color: var(--primary-dark);
  font-weight: 500;
}

.review-panel .pagination {
  border-top: 1px solid var(--border-hairline);
  padding: 10px 14px;
  font-size: 12px;
  background: var(--surface);
}
.proto-dialog {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 110;
  background: rgba(22, 24, 22, 0.45);
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.proto-dialog.open { display: flex; }
.proto-dialog-panel {
  width: min(440px, 100%);
  background: var(--surface);
  border-radius: var(--radius-card);
  border: 1px solid var(--border-hairline);
  box-shadow: var(--shadow-float);
  padding: 20px 24px;
}
.reject-templates {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 12px 0 16px;
}
.reject-templates button {
  text-align: left;
  padding: 10px 12px;
  border-radius: var(--radius-nested);
  border: 1px solid var(--border-hairline);
  background: var(--surface-muted);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.reject-templates button:hover {
  border-color: rgba(62, 197, 131, 0.35);
  background: var(--secondary);
}
.proto-banner strong { color: var(--primary-dark); }

/* ==========================================================================
   PM1 / PM2 新增对齐样式：在线指示器、通知中心、CSV导入、AI抽屉、富文本
   ========================================================================== */

/* 1. 在线/离线胶囊指示器 */
.topbar-connectivity {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px;
  border-radius: 99px; background: rgba(62, 197, 131, 0.12);
  border: 1px solid rgba(62, 197, 131, 0.28); font-size: 11px; font-weight: 600;
  color: var(--success); cursor: pointer; transition: all 0.2s ease; user-select: none;
}
.topbar-connectivity:hover { background: rgba(62, 197, 131, 0.2); }
.topbar-connectivity.offline {
  background: rgba(217, 119, 6, 0.12); border-color: rgba(217, 119, 6, 0.3); color: var(--warn);
}
.topbar-connectivity .conn-dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--success); box-shadow: 0 0 6px currentColor;
}

/* 2. 消息通知中心 Flyout */
.notif-trigger-wrap { position: relative; display: inline-block; }
.notif-btn { position: relative; }
.notif-badge {
  position: absolute; top: 4px; right: 4px; background: var(--danger); color: #fff;
  font-size: 9px; font-weight: 700; min-width: 16px; height: 16px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center; border: 2px solid var(--sidebar-bg);
}
.notification-flyout {
  position: absolute; top: 100%; right: 0; margin-top: 10px; width: 320px;
  background: var(--surface); border-radius: var(--radius-card);
  border: 1px solid var(--border-hairline); box-shadow: 0 12px 36px rgba(0, 0, 0, 0.14);
  z-index: 100; display: none; flex-direction: column; overflow: hidden;
  animation: flyoutSlideDown 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.notification-flyout.open { display: flex; }
@keyframes flyoutSlideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}
.notif-header {
  padding: 12px 16px; display: flex; justify-content: space-between; align-items: center;
  border-bottom: 1px solid var(--border-hairline); background: var(--surface-muted);
}
.notif-header h3 { margin: 0; font-size: 13px; font-weight: 700; }
.btn-text-sm {
  background: none; border: none; color: var(--primary-dark); font-size: 11px; cursor: pointer; padding: 2px 6px;
}
.btn-text-sm:hover { text-decoration: underline; }
.notif-list { max-height: 360px; overflow-y: auto; }
.notif-item {
  position: relative; padding: 12px 16px; border-bottom: 1px solid var(--border-hairline);
  display: flex; gap: 10px; cursor: pointer; transition: background 0.15s;
}
.notif-item:hover { background: var(--surface-muted); }
.notif-item.unread { background: rgba(62, 197, 131, 0.04); }
.notif-unread-dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--primary); margin-top: 6px; flex-shrink: 0;
}
.notif-item:not(.unread) .notif-unread-dot { visibility: hidden; }
.notif-body { flex: 1; }
.notif-meta { display: flex; justify-content: space-between; margin-bottom: 4px; }
.notif-tag {
  font-size: 10px; padding: 1px 6px; border-radius: 4px; background: var(--surface-muted); color: var(--ink2);
}
.notif-time { font-size: 10px; color: var(--ink3); }
.notif-title { font-size: 12px; line-height: 1.4; color: var(--ink1); }

/* 3. CSV 批量导入样式 */
.import-dropzone {
  border: 2px dashed var(--border-hairline); border-radius: 12px; padding: 28px 16px;
  text-align: center; background: var(--surface-muted); cursor: pointer; transition: all 0.2s;
}
.import-dropzone:hover { border-color: var(--primary); background: rgba(62, 197, 131, 0.04); }
.import-summary-bar { display: flex; gap: 12px; margin-bottom: 12px; font-size: 12px; font-weight: 600; }
.summary-success { color: var(--success); background: rgba(47, 158, 107, 0.1); padding: 4px 10px; border-radius: 6px; }
.summary-error { color: var(--warn); background: rgba(217, 119, 6, 0.1); padding: 4px 10px; border-radius: 6px; }
.import-error-list {
  background: #FFFBEB; border: 1px solid #FDE68A; border-radius: 8px; padding: 10px 14px;
  font-size: 12px; color: #92400E; display: flex; flex-direction: column; gap: 6px;
}

