/* ── 合同智能审查模块 · 全局样式 ── */
/* NOTE: 配色方案复用制度审查原型（prototype/css/style.css），主色调整为紫色系以匹配目标系统 */

:root {
  --sidebar-w: 180px;
  --topbar-h: 0px;
  --bg: #f0f3fa;
  --card: #ffffff;
  --border: #e2e8f0;
  --text: #333639;
  --muted: #8a9eab;
  /* 合同审查主色：紫色系（与目标系统一致） */
  --primary: #6c5ce7;
  --primary-light: #a29bfe;
  --primary-soft: #f0eeff;
  --primary-gradient: linear-gradient(135deg, #6c5ce7 0%, #a29bfe 100%);
  --danger: #d03050;
  --danger-soft: #fce8eb;
  --warning: #f0a020;
  --warning-soft: #fef5e6;
  --success: #18a058;
  --success-soft: #eaf5ec;
  --sidebar-bg: #fafafc;
  --sidebar-text: #333639;
  --sidebar-active: #6c5ce7;
  --sidebar-active-bg: #f0eeff;
  --sidebar-hover: #f0f2f5;
}

* { box-sizing: border-box; margin: 0; }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background-color: transparent; }
::-webkit-scrollbar-thumb { background-color: #d4d9de; border-radius: 10px; min-height: 30px; border: 1px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background-color: #b0b7be; }
::-webkit-scrollbar-corner { background-color: transparent; }

body {
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  color: var(--text);
  background: var(--bg);
}

/* ── 应用布局 ── */
.app-layout { display: flex; min-height: 100vh; }

/* ── 侧边栏 ── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  position: fixed; left: 0; top: 0; bottom: 0;
  overflow-y: auto; overflow-x: hidden;
  z-index: 100;
  padding: 0;
  border-right: 1px solid var(--border);
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(0,0,0,.12); border-radius: 4px; }

/* 侧边栏菜单项 */
.menu-item {
  display: flex;
  align-items: center;
  padding: 0 20px;
  height: 48px;
  font-size: 14px;
  color: var(--sidebar-text);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s;
  border-left: 3px solid transparent;
  user-select: none;
}
.menu-item:hover {
  background: var(--sidebar-hover);
  color: var(--primary);
}
.menu-item.active {
  background: var(--sidebar-active-bg);
  color: var(--sidebar-active);
  font-weight: 600;
  border-left-color: var(--primary);
}

/* ── 主内容区 ── */
.main-area {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* ── 面包屑 ── */
.breadcrumb-bar {
  padding: 12px 24px;
  font-size: 13px;
  color: var(--muted);
  background: #fff;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.breadcrumb-bar span { margin: 0 6px; }

/* ── 页面内容容器 ── */
.page-content {
  padding: 16px 24px 30px;
  flex: 1;
}

/* ── 标签页切换 ── */
.tab-bar {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 16px;
}
.tab-btn {
  padding: 6px 20px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  border: none;
  background: none;
  border-radius: 20px;
  transition: all 0.2s;
}
.tab-btn:hover {
  color: var(--primary);
}
.tab-btn.active {
  background: var(--primary);
  color: #fff;
}
.tab-right {
  margin-left: auto;
}

/* ── 筛选栏 ── */
.filter-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 12px;
}
.filter-bar .form-control,
.filter-bar .form-select {
  font-size: 13px;
  height: 36px;
  padding: 4px 12px;
  border-radius: 6px;
  border: 1px solid #d5dce6;
  background: #fff;
  color: var(--text);
}
.filter-bar .form-control { min-width: 180px; max-width: 240px; }
.filter-bar .form-select { min-width: 120px; max-width: 160px; }
.filter-bar .form-control::placeholder { color: #bbb; }
.filter-bar .btn {
  height: 36px;
  font-size: 13px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-radius: 6px;
}
.btn-query {
  background: var(--primary) !important;
  border-color: var(--primary) !important;
  color: #fff !important;
}
.btn-query:hover {
  background: #5a4bd6 !important;
}
.expand-btn {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 2px;
}
.expand-btn i {
  transition: transform 0.2s;
}

/* ── 批量操作栏 ── */
.batch-bar {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-bottom: 10px;
}
.batch-bar .btn {
  font-size: 13px;
  padding: 5px 16px;
  border-radius: 6px;
  border: 1px solid #d5dce6;
  background: #fff;
  color: var(--text);
}
.batch-bar .btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* ── 数据表格 ── */
.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,.04);
}
.data-table thead th {
  font-size: 13px;
  color: #5a6b80;
  font-weight: 600;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  background: #fafbfc;
  white-space: nowrap;
  text-align: left;
}
.data-table tbody td {
  font-size: 13px;
  padding: 14px;
  border-bottom: 1px solid #f2f4f7;
  vertical-align: middle;
}
.data-table tbody tr { transition: background 0.12s; }
.data-table tbody tr:hover { background: #f8fafd; }
.data-table tbody tr:last-child td { border-bottom: none; }

/* 文件名列 */
.file-name {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
  color: var(--primary);
  cursor: pointer;
}
.file-name:hover { text-decoration: underline; }
.file-icon {
  width: 18px; height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #4a90d9;
  font-size: 16px;
}

/* 审查规则标签 */
.rule-tag {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  background: #f0eeff;
  color: var(--primary);
  white-space: nowrap;
  max-width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 阶段标签 */
.phase-tag {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  background: #e8f5e9;
  color: #2e7d32;
}

/* 状态标签 */
.status-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}
.status-tag i { font-size: 14px; }
.status-pending {
  background: #fff3e0;
  color: #e65100;
}
.status-review {
  background: #e8f5e9;
  color: #2e7d32;
}
.status-pass {
  background: #e3f2fd;
  color: #1565c0;
}

/* 操作列 */
.td-actions {
  white-space: nowrap;
  display: flex;
  gap: 6px;
  align-items: center;
}
.act-link {
  font-size: 13px;
  color: var(--primary);
  cursor: pointer;
  background: none;
  border: none;
  padding: 4px 8px;
  border-radius: 4px;
  transition: background 0.12s;
  white-space: nowrap;
}
.act-link:hover {
  background: var(--primary-soft);
}
.act-more-btn {
  font-size: 18px;
  color: var(--primary);
  cursor: pointer;
  background: none;
  border: none;
  padding: 2px 6px;
  border-radius: 4px;
  line-height: 1;
}
.act-more-btn:hover {
  background: var(--primary-soft);
}

/* 更多操作下拉 */
.act-more {
  position: relative;
  display: inline-flex;
}
.act-dropdown {
  position: absolute;
  right: 0;
  top: 100%;
  margin-top: 4px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,.1);
  min-width: 130px;
  z-index: 20;
  display: none;
  padding: 4px;
}
.act-more:hover .act-dropdown,
.act-more.open .act-dropdown {
  display: block;
}
.act-dropdown button {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 8px 12px;
  border: none;
  background: none;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  border-radius: 5px;
  text-align: left;
}
.act-dropdown button:hover {
  background: #f1f5f9;
}
.act-dropdown button.text-danger { color: var(--danger); }

/* ── 新建审查按钮 ── */
.btn-new-review {
  background: var(--primary-gradient);
  color: #fff;
  border: none;
  padding: 8px 20px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 2px 8px rgba(108, 92, 231, 0.3);
}
.btn-new-review:hover {
  box-shadow: 0 4px 16px rgba(108, 92, 231, 0.4);
  transform: translateY(-1px);
}

/* ── 分页 ── */
.pagination-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 16px 0;
}
.pagination-bar button {
  width: 32px;
  height: 32px;
  border: 1px solid #d5dce6;
  background: #fff;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.pagination-bar button:hover { border-color: var(--primary); color: var(--primary); }
.pagination-bar button.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* ── 面板（通用卡片） ── */
.panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 20px;
  box-shadow: 0 2px 8px rgba(12,30,58,.04);
}
.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.panel-title { font-size: 15px; font-weight: 700; }

/* ── Modal ── */
.modal-content { border-radius: 12px; border: none; box-shadow: 0 20px 60px rgba(0,0,0,.15); }
.modal-header { border-bottom: 1px solid #eef1f6; padding: 14px 20px; }
.modal-title { font-size: 16px; font-weight: 700; }
.modal-body { padding: 20px; }
.modal-footer { border-top: 1px solid #eef1f6; padding: 10px 20px; }

/* ── 新建审查弹窗 ── */
.upload-zone {
  border: 2px dashed #d5dce6;
  border-radius: 10px;
  padding: 40px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: #fafbfd;
}
.upload-zone:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
}
.upload-zone i {
  font-size: 40px;
  color: var(--primary);
  opacity: 0.6;
}

/* ── 左下角用户头像 ── */
.user-avatar-bottom {
  position: fixed;
  left: 16px;
  bottom: 16px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  z-index: 101;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
}

/* ── 侧边栏收起按钮 ── */
.sidebar-collapse-btn {
  position: fixed;
  left: calc(var(--sidebar-w) - 12px);
  bottom: 20px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 101;
  font-size: 12px;
  color: var(--muted);
  box-shadow: 0 1px 4px rgba(0,0,0,.1);
  transition: all 0.15s;
}
.sidebar-collapse-btn:hover {
  background: var(--primary-soft);
  color: var(--primary);
}

/* ── 审查详情页专用 ── */
.detail-topbar {
  height: 52px;
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}
.detail-topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 12px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
  transition: all .15s;
}
.back-btn:hover { background: #f5f7fa; }
.detail-topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}
.detail-layout {
  display: flex;
  height: calc(100vh - 52px);
}
.doc-panel {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border);
  height: calc(100vh - 52px);
}
.doc-panel-body {
  flex: 1;
  overflow: hidden;
  padding: 0;
  background: #fff;
  height: 100%;
}
#dt-doc { width: 100%; height: 100%; }
.issue-panel {
  width: 420px;
  min-width: 380px;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  background: #fff;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border-right: 1px solid var(--border);
}
.ai-chat-panel {
  width: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: #fff;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border-left: 1px solid var(--border);
  flex-shrink: 0;
}
.detail-layout.show-ai-chat .issue-panel {
  width: 360px;
  min-width: 360px;
}
.detail-layout.show-ai-chat .ai-chat-panel {
  width: 380px;
}
.ai-chat-panel-header {
  padding: 12px 16px;
  background: #fff;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  min-height: 64px;
}
.ai-chat-panel-title {
  display: flex;
  align-items: center;
  gap: 10px;
}
.ai-chat-panel-icon {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: linear-gradient(135deg, #6c5ce7, #a29bfe);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  flex-shrink: 0;
}
.ai-chat-panel .chat-body {
  background: #f8faff;
}
.issue-panel-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.issue-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}
.issue-actions .btn { font-size: 12px; padding: 4px 12px; }
.issue-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border);
}
.issue-tab {
  flex: 1;
  padding: 8px 4px;
  text-align: center;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all .15s;
  color: var(--muted);
}
.issue-tab:hover { color: var(--text); }
.issue-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}
.issue-tab .tab-count {
  display: inline-block;
  min-width: 18px;
  padding: 0 5px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: #f1f5f9;
  color: var(--muted);
  margin-left: 4px;
}
.issue-tab.active .tab-count {
  background: var(--primary-soft);
  color: var(--primary);
}
.issue-filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  border-bottom: 1px solid #f0f3f7;
  flex-shrink: 0;
}
.issue-filter-bar .filter-label { font-size: 12px; color: var(--muted); }
.issue-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px 12px;
}
.issue-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: all .15s;
}
.issue-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,.06); }
.issue-card.expanded {
  box-shadow: 0 4px 16px rgba(108,92,231,.1);
  border-color: var(--primary-soft);
}
.issue-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
}
.issue-num {
  width: 28px; height: 28px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: #fff; flex-shrink: 0;
}
.issue-num.high { background: var(--danger); }
.issue-num.medium { background: var(--warning); }
.issue-num.low { background: var(--success); }
.issue-card-title { flex: 1; font-size: 13px; font-weight: 600; min-width: 0; }
.issue-detail {
  max-height: 0;
  overflow: hidden;
  transition: max-height .3s ease;
}
.issue-card.expanded .issue-detail { max-height: 800px; }
.issue-detail-inner {
  padding: 0 14px 14px;
  border-top: 1px solid #f0f3f7;
}
.detail-section { margin-top: 12px; }
.detail-section-label {
  font-size: 11.5px; font-weight: 600;
  color: var(--muted); margin-bottom: 4px;
  display: flex; align-items: center; gap: 4px;
}
.detail-section-content {
  font-size: 13px; line-height: 1.7;
  color: var(--text); padding: 8px 10px; border-radius: 6px;
}
.detail-section-content.bg-light { background: #f8fafb; }
.detail-section-content.bg-yellow { background: #fffbe6; border: 1px dashed #ffe58f; }
.detail-section-content.bg-blue { background: var(--primary-soft); border: 1px dashed var(--primary); opacity: 0.8; }
.risk-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}
.risk-badge.high { background: var(--danger-soft); color: var(--danger); }
.risk-badge.medium { background: var(--warning-soft); color: var(--warning); }
.risk-badge.low { background: var(--success-soft); color: var(--success); }
.ai-note {
  padding: 8px 16px;
  text-align: center;
  font-size: 11px;
  color: var(--muted);
  border-top: 1px solid #f0f3f7;
  flex-shrink: 0;
}
.side-tool-bar {
  width: 48px;
  background: #fff;
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 12px;
  gap: 4px;
}
.side-tool-btn {
  width: 36px; height: 44px;
  border-radius: 8px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 2px; cursor: pointer;
  border: none; background: none;
  color: var(--muted); font-size: 16px;
  transition: all .15s;
}
.side-tool-btn span { font-size: 9px; }
.side-tool-btn:hover { background: #f1f5f9; color: var(--text); }
.side-tool-btn.active { background: var(--primary-soft); color: var(--primary); }

/* ── 开关组件 ── */
.custom-switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
}
.custom-switch input { opacity: 0; width: 0; height: 0; }
.custom-switch .slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #ccc;
  border-radius: 22px;
  transition: 0.3s;
}
.custom-switch .slider:before {
  position: absolute;
  content: "";
  height: 16px; width: 16px;
  left: 3px; bottom: 3px;
  background-color: #fff;
  border-radius: 50%;
  transition: 0.3s;
}
.custom-switch input:checked + .slider { background-color: var(--primary); }
.custom-switch input:checked + .slider:before { transform: translateX(18px); }

/* ── 响应式 ── */
@media (max-width: 1200px) {
  .sidebar { width: 160px; }
  .main-area { margin-left: 160px; }
}

/* ── 智能对话面板 ── */
.chat-view {
  display: none;
  flex: 1;
  flex-direction: column;
  background: #f8faff;
  height: 100%;
  overflow: hidden;
}
.chat-view.active { display: flex; }

.chat-header {
  padding: 14px 16px;
  background: #fff;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.chat-header i {
  width: 32px; height: 32px;
  background: var(--primary-gradient);
  color: #fff;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
}
.chat-header span { font-size: 15px; font-weight: 700; }

.chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.chat-msg {
  display: flex;
  flex-direction: column;
  max-width: 90%;
}
.chat-msg.ai { align-self: flex-start; }
.chat-msg.user { align-self: flex-end; align-items: flex-end; }

.chat-bubble {
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 13.5px;
  line-height: 1.6;
  position: relative;
  box-shadow: 0 2px 8px rgba(0,0,0,.04);
  word-break: break-word;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}
.chat-msg.ai .chat-bubble {
  background: #fff;
  color: var(--text);
  border-top-left-radius: 2px;
  border: 1px solid #edf2f7;
}
.chat-msg.user .chat-bubble {
  background: var(--primary);
  color: #fff;
  border-top-right-radius: 2px;
}

/* 欢迎页卡片 (截图中的样式) */
.welcome-card {
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  border: 1px solid #edf2f7;
  box-shadow: 0 2px 10px rgba(108,92,231,.05);
}
.suggestion-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}
.suggestion-item {
  background: #f8faff;
  border: 1px solid #eef2f8;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
  color: #5a6b80;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all .2s;
}
.suggestion-item:hover {
  background: var(--primary-soft);
  color: var(--primary);
  border-color: var(--primary-light);
}
.suggestion-item i { color: var(--primary); opacity: 0.7; }

/* 聊天输入区 (截图下部样式) */
.chat-input-container {
  padding: 12px 16px 8px;
  background: #f8faff;
  flex-shrink: 0;
}
.chat-input-wrapper {
  background: #fff;
  border: 1px solid #d5dce6;
  border-radius: 12px;
  padding: 8px 10px;
  box-shadow: 0 4px 12px rgba(0,0,0,.05);
  transition: border-color .2s;
  display: flex;
  align-items: flex-end;
  gap: 8px;
}
.chat-input-wrapper:focus-within { border-color: var(--primary); }
.chat-input-wrapper textarea {
  flex: 1;
  min-width: 0;
  border: none;
  resize: none;
  font-size: 14px;
  color: var(--text);
  outline: none;
  padding: 4px 2px;
  min-height: 56px;
  max-height: 160px;
  line-height: 1.55;
  background: transparent;
}
.chat-input-wrapper textarea::placeholder { color: #cbd5e1; opacity: 1; }
.chat-input-wrapper textarea::-webkit-input-placeholder { color: #cbd5e1; }
.chat-input-wrapper textarea::-moz-placeholder { color: #cbd5e1; opacity: 1; }

.btn-send-msg {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  border: none;
  transition: opacity .2s;
  flex-shrink: 0;
}
.btn-send-msg:hover { opacity: 0.9; }

.chat-footer-note {
  text-align: center;
  font-size: 11px;
  color: var(--muted);
  padding: 6px 16px 0;
  margin: 4px -16px 0;
  border-top: 1px solid #f0f3f7;
}

/* ── 快捷反馈选项卡 ── */
.feedback-choice-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 10px;
}
.feedback-choice-card {
  border: 1px solid #edf2f7;
  border-radius: 12px;
  padding: 16px;
  cursor: pointer;
  background: #fff;
  transition: all .2s;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.feedback-choice-card:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(108, 92, 231, 0.1);
}
.feedback-choice-card .choice-icon {
  width: 36px; height: 36px;
  border-radius: 8px;
  background: #f1f5f9;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; color: #64748b;
  transition: all .2s;
}
.feedback-choice-card:hover .choice-icon {
  background: var(--primary);
  color: #fff;
}
.feedback-choice-card .choice-label {
  font-weight: 700;
  font-size: 14px;
  color: var(--text);
}
.feedback-choice-card .choice-desc {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}

/* 紧凑横向布局（用于反馈分类 5 卡）*/
.feedback-choice-card.compact {
  flex-direction: row;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
}
.feedback-choice-card.compact:hover {
  transform: none;
  box-shadow: 0 2px 8px rgba(108, 92, 231, 0.08);
}
.feedback-choice-card.compact .choice-icon {
  width: 30px;
  height: 30px;
  font-size: 14px;
  border-radius: 7px;
  flex-shrink: 0;
}
.feedback-choice-card.compact .choice-text {
  flex: 1;
  min-width: 0;
}
.feedback-choice-card.compact .choice-label {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 2px;
  line-height: 1.3;
}
.feedback-choice-card.compact .choice-desc {
  font-size: 11.5px;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
}

/* 子选项容器 — 显式表达"分类 → 子选项"的层级关系 */
.fb-subwidget {
  margin-top: 10px;
  background: linear-gradient(180deg, rgba(108,92,231,.10), rgba(108,92,231,.04));
  border: 1px solid var(--primary-light);
  border-left: 3px solid var(--primary);
  border-radius: 10px;
  padding: 12px 14px;
  animation: fbSubFadeIn .25s ease;
}
@keyframes fbSubFadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}
.fb-subwidget-head {
  font-size: 12px;
  color: var(--primary);
  font-weight: 600;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 4px;
  padding-bottom: 8px;
  border-bottom: 1px dashed rgba(108,92,231,.25);
}
.fb-subwidget-head i { font-size: 14px; flex-shrink: 0; }
.fb-subwidget-head strong { font-weight: 800; }
.fb-subwidget-body { /* 容器本身不加额外 padding，由各子内容自带 */ }

.fb-sub-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  cursor: pointer;
  font-size: 13px;
  color: #1e293b;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  margin: 0;
}
.fb-sub-checkbox input { margin-top: 3px; accent-color: var(--primary); }
.fb-sub-cb-label { font-weight: 600; }
.fb-sub-cb-desc { font-size: 11.5px; color: #94a3b8; margin-top: 2px; }

.fb-sub-tag {
  display: inline-block;
  padding: 5px 12px;
  border-radius: 16px;
  font-size: 12px;
  cursor: pointer;
  margin: 0 6px 6px 0;
  transition: all .15s;
}
.fb-sub-tag:hover {
  border-color: var(--primary) !important;
  color: var(--primary) !important;
}

/* 分步选择状态 */
.feedback-step-title {
  font-size: 13px;
  font-weight: 600;
  color: #94a3b8;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.feedback-back-btn {
  font-size: 12px;
  color: var(--primary);
  cursor: pointer;
  margin-bottom: 15px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.feedback-back-btn:hover { text-decoration: underline; }

/* ── 邮件流程模块 ── */
.email-flow-page { display: flex; flex-direction: column; gap: 14px; }

/* 顶部统计卡片 */
.email-stats-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}
.email-stat-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 1px 4px rgba(12,30,58,.04);
  transition: all .2s;
  position: relative;
  overflow: hidden;
}
.email-stat-card:hover {
  box-shadow: 0 4px 14px rgba(12,30,58,.08);
  transform: translateY(-1px);
}
.email-stat-card .stat-icon {
  width: 42px; height: 42px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.email-stat-card .stat-meta { flex: 1; min-width: 0; }
.email-stat-card .stat-label { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.email-stat-card .stat-value { font-size: 22px; font-weight: 800; color: var(--text); line-height: 1; }
.email-stat-card.stat-primary .stat-icon { background: #f0eeff; color: #6c5ce7; }
.email-stat-card.stat-success .stat-icon { background: #eaf5ec; color: #18a058; }
.email-stat-card.stat-warning .stat-icon { background: #fef5e6; color: #f0a020; }
.email-stat-card.stat-danger .stat-icon { background: #fce8eb; color: #d03050; }
.email-stat-card.stat-info .stat-icon { background: #e0f2fe; color: #0284c7; }

/* 邮件 Tab 栏 */
.email-tab-bar {
  display: flex;
  align-items: center;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 6px;
  box-shadow: 0 1px 4px rgba(12,30,58,.04);
}
.email-tab {
  padding: 8px 18px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  border-radius: 8px;
  transition: all .15s;
  user-select: none;
  display: inline-flex;
  align-items: center;
}
.email-tab:hover {
  color: var(--text);
  background: #f5f7fb;
}
.email-tab.active {
  background: var(--primary-soft);
  color: var(--primary);
}
.email-tab-right { margin-left: auto; padding-right: 6px; }

/* 邮件表格 */
.email-table tbody tr.email-row { cursor: default; }
.email-table tbody tr.email-row:hover { background: #fafbff; }
.email-table tbody td { vertical-align: top; padding: 12px 14px; }

.email-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}
.sender-line {
  display: flex;
  flex-direction: column;
  gap: 1px;
  font-size: 13.5px;
  margin-bottom: 3px;
  min-width: 0;
}
.sender-name {
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.4;
}
.sender-email {
  color: var(--muted);
  font-size: 11.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  display: block;
}
.sender-org {
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.email-subject {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: color .15s;
  line-height: 1.4;
}
.email-subject:hover { color: var(--primary); }
.email-snippet {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
  line-height: 1.5;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
}

.att-chips {
  display: flex; flex-wrap: wrap; gap: 6px;
}
.att-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #f3f5fb;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 11.5px;
  color: var(--text);
  max-width: 240px;
}
.att-chip i { font-size: 14px; flex-shrink: 0; }
.att-chip-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mailbox-tag {
  display: inline-block;
  background: #f0f3fa;
  color: #475569;
  font-size: 11.5px;
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
}

/* 状态徽章 */
.email-status-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}
.email-status-tag.reviewed { background: #eaf5ec; color: #18a058; }
.email-status-tag.reviewing { background: #e0f2fe; color: #0284c7; }
.email-status-tag.pending { background: #fef5e6; color: #f0a020; }
.email-status-tag.ignored { background: #f1f5f9; color: #94a3b8; }
.email-status-tag.warning { background: #fef5e6; color: #f0a020; }
.email-status-tag.danger { background: #fce8eb; color: #d03050; }
.email-status-tag .bi-arrow-repeat { animation: spin 1.6s linear infinite; }
@keyframes spin { from { transform: rotate(0); } to { transform: rotate(360deg); } }

/* 风险摘要小徽章组 */
.risk-mini-group { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.risk-mini {
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 4px;
  font-weight: 600;
}
.risk-mini.high { background: var(--danger-soft); color: var(--danger); }
.risk-mini.medium { background: var(--warning-soft); color: var(--warning); }
.risk-mini.low { background: var(--success-soft); color: var(--success); }

/* AI 生成标记 */
.ai-mini-tag {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: linear-gradient(135deg, rgba(108,92,231,.1), rgba(162,155,254,.1));
  border: 1px solid rgba(108,92,231,.25);
  color: var(--primary);
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  margin-left: 6px;
  vertical-align: middle;
}

/* 错误提示行 */
.email-error-row {
  margin-top: 6px;
  padding: 6px 10px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 6px;
  color: #b91c1c;
  font-size: 12px;
  line-height: 1.5;
}

/* 空状态 */
.email-empty {
  text-align: center;
  padding: 80px 20px;
  color: var(--muted);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
}
.email-empty i { font-size: 44px; display: block; margin-bottom: 14px; opacity: .55; }
.email-empty p { font-size: 13px; margin: 0; }

/* 邮箱配置 */
.mailbox-section {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.mailbox-help {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 14px 18px;
  background: linear-gradient(135deg, rgba(108,92,231,.06), rgba(162,155,254,.04));
  border: 1px solid rgba(108,92,231,.18);
  border-radius: 12px;
}
.mailbox-help > i {
  font-size: 22px;
  color: var(--primary);
  margin-top: 2px;
  flex-shrink: 0;
}
.mailbox-help-title { font-size: 13.5px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.mailbox-help-text { font-size: 12.5px; color: #475569; line-height: 1.6; }

.mailbox-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
.mailbox-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 1px 4px rgba(12,30,58,.04);
  transition: all .2s;
}
.mailbox-card:hover {
  border-color: var(--primary-light);
  box-shadow: 0 6px 18px rgba(108,92,231,.08);
}
.mailbox-card-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.mailbox-card-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: var(--primary-gradient);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.mailbox-card-meta { flex: 1; min-width: 0; }
.mailbox-card-name {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.mailbox-card-status {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
}
.mailbox-card-email { font-size: 12.5px; color: var(--primary); margin-bottom: 4px; }
.mailbox-card-desc { font-size: 12px; color: var(--muted); line-height: 1.5; }

.mailbox-card-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px 12px;
  padding: 10px 12px;
  background: #f8fafc;
  border-radius: 8px;
  font-size: 12.5px;
}
.mailbox-card-grid > div { display: flex; align-items: center; gap: 8px; }
.mailbox-meta-label { color: var(--muted); flex-shrink: 0; min-width: 60px; }
.mailbox-meta-value { color: var(--text); font-weight: 500; }

.mailbox-card-toggles {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 4px;
  border-top: 1px dashed #e2e8f0;
}
.toggle-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 12.5px;
  color: var(--text);
  margin: 0;
}
.toggle-item > span { display: inline-flex; align-items: center; }

/* 邮件详情弹窗 */
.email-detail-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.email-detail-head {
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
}
.email-detail-subject {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
  line-height: 1.4;
}
.email-detail-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12.5px;
  color: var(--text);
}
.email-meta-label {
  display: inline-block;
  width: 70px;
  color: var(--muted);
  font-size: 12px;
}
.email-detail-section { display: flex; flex-direction: column; gap: 6px; }
.email-detail-section-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.email-detail-text {
  background: #f8fafb;
  border: 1px solid #eef2f7;
  border-radius: 8px;
  padding: 14px 16px;
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--text);
  white-space: normal;
  min-height: 80px;
}
.email-detail-text.editable {
  background: #fff;
  border-color: var(--primary-light);
  outline: none;
}
.email-detail-text.editable:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(108,92,231,.15); }

.email-detail-att {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  margin-bottom: 6px;
}
.email-detail-att > i { font-size: 22px; flex-shrink: 0; }
.email-detail-att .att-info { flex: 1; min-width: 0; }
.email-detail-att .att-name { font-size: 13px; font-weight: 600; color: var(--text); }
.email-detail-att .att-size { font-size: 11.5px; color: var(--muted); margin-top: 2px; }

.email-detail-risk {
  background: linear-gradient(135deg, #fff7ed, #fefce8);
  border: 1px solid #fed7aa;
  border-radius: 10px;
  padding: 12px 14px;
}
.email-detail-risk-title {
  font-size: 12.5px;
  font-weight: 700;
  color: #92400e;
  margin-bottom: 8px;
}
.email-detail-risk-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.email-detail-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 12.5px;
  color: #b91c1c;
  line-height: 1.6;
}

.ai-draft-banner {
  background: linear-gradient(135deg, rgba(108,92,231,.08), rgba(162,155,254,.05));
  border: 1px dashed rgba(108,92,231,.35);
  color: var(--primary);
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 500;
}

/* 权限块 */
.email-perm-block {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  margin-top: 8px;
}
.email-perm-title {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}
.email-perm-row {
  padding: 4px 0;
  font-size: 12.5px;
}
.email-perm-row label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: var(--text);
}
.email-perm-row input[type="checkbox"] { accent-color: var(--primary); }

/* 响应式 */
@media (max-width: 1280px) {
  .email-stats-row { grid-template-columns: repeat(3, 1fr); }
  .mailbox-grid { grid-template-columns: 1fr; }
}

/* ── 审查反馈模块 ── */
.fb-card-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.fb-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 18px;
  box-shadow: 0 1px 4px rgba(12,30,58,.04);
  transition: all .2s;
  position: relative;
}
.fb-card:hover {
  box-shadow: 0 6px 18px rgba(12,30,58,.07);
}
.fb-card.pending::before {
  content: '';
  position: absolute;
  left: 0; top: 12px; bottom: 12px;
  width: 3px;
  border-radius: 0 2px 2px 0;
  background: var(--warning);
}
.fb-card.approved::before {
  content: '';
  position: absolute;
  left: 0; top: 12px; bottom: 12px;
  width: 3px;
  border-radius: 0 2px 2px 0;
  background: var(--success);
}
.fb-card.rejected::before {
  content: '';
  position: absolute;
  left: 0; top: 12px; bottom: 12px;
  width: 3px;
  border-radius: 0 2px 2px 0;
  background: var(--danger);
}
.fb-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.fb-card-source {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text);
  flex-wrap: wrap;
}
.fb-source-file {
  font-weight: 600;
  color: var(--primary);
  cursor: pointer;
}
.fb-source-file:hover { text-decoration: underline; }
.fb-source-anchor {
  font-size: 11.5px;
  color: var(--muted);
  background: #f1f5f9;
  padding: 1px 8px;
  border-radius: 4px;
}
.fb-card-tags {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

/* 反馈类型徽章 */
.fb-type {
  display: inline-flex;
  align-items: center;
  font-size: 11.5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-weight: 600;
  white-space: nowrap;
}
.fb-type-misreport { background: #fef5e6; color: #f0a020; }
.fb-type-level { background: #ede9fe; color: #7c3aed; }
.fb-type-evidence { background: #fce8eb; color: #d03050; }
.fb-type-format { background: #e0f2fe; color: #0284c7; }

/* 反馈优先级徽章（轻重缓急）*/
.fb-prio {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-weight: 600;
  white-space: nowrap;
  border: 1px solid transparent;
}
.fb-prio.urgent {
  background: linear-gradient(135deg, #fff7ed, #fee2e2);
  color: #b91c1c;
  border-color: #fecaca;
}
.fb-prio.urgent i { color: #dc2626; }
.fb-prio.normal {
  background: #eff6ff;
  color: #1d4ed8;
  border-color: #bfdbfe;
}
.fb-prio.normal i { color: #2563eb; }
.fb-prio.reference {
  background: #f1f5f9;
  color: #475569;
  border-color: #cbd5e1;
}
.fb-prio.reference i { color: #64748b; }

/* 反馈状态徽章 */
.fb-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-weight: 600;
  white-space: nowrap;
}
.fb-status.pending { background: #fef5e6; color: #f0a020; }
.fb-status.approved { background: #eaf5ec; color: #18a058; }
.fb-status.rejected { background: #fce8eb; color: #d03050; }

/* 高频徽章 */
.fb-hot-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-weight: 600;
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  color: #b45309;
  border: 1px solid #fde68a;
  white-space: nowrap;
}
.fb-hot-tag i { color: #ea580c; }

/* 风险锚点块 */
.fb-risk-anchor {
  background: #fafbfd;
  border: 1px solid #eef2f7;
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 10px;
}
.fb-risk-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.fb-risk-name { font-size: 13.5px; font-weight: 600; color: var(--text); }
.fb-risk-anchor-text {
  font-size: 12.5px;
  color: #475569;
  font-style: italic;
  line-height: 1.6;
  background: #fffbe6;
  border-left: 3px solid #facc15;
  padding: 6px 10px;
  border-radius: 4px;
}

/* 内容块 */
.fb-content-block {
  margin-bottom: 10px;
}
.fb-content-label {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.fb-content-text {
  font-size: 13px;
  line-height: 1.7;
  color: var(--text);
  background: #f8fafb;
  border: 1px solid #eef2f7;
  border-radius: 6px;
  padding: 10px 12px;
}
.fb-content-text.fb-suggestion {
  background: var(--primary-soft);
  border: 1px dashed var(--primary-light);
  color: var(--text);
}

/* 审批结果块 */
.fb-approve-block {
  background: linear-gradient(135deg, #ecfdf5, #f0fdf4);
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 10px;
}
.fb-approve-block.rejected {
  background: linear-gradient(135deg, #fef2f2, #fff1f2);
  border-color: #fecaca;
}
.fb-approve-row {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 12.5px;
  color: var(--text);
}
.fb-approve-label {
  color: var(--muted);
  font-size: 11.5px;
}
.fb-approve-time {
  color: var(--muted);
  font-size: 11.5px;
}
.fb-approve-note {
  margin-top: 6px;
  font-size: 12.5px;
  color: var(--text);
  line-height: 1.6;
  font-style: italic;
}
.fb-approve-note i { color: var(--success); opacity: .8; }
.fb-approve-block.rejected .fb-approve-note i { color: var(--danger); }

/* 同步状态行 */
.fb-sync-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed #bbf7d0;
}
.sync-chip {
  display: inline-flex;
  align-items: center;
  font-size: 11.5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-weight: 600;
  border: 1px solid transparent;
}
.sync-chip.on {
  background: #fff;
  color: var(--success);
  border-color: #bbf7d0;
}
.sync-chip.off {
  background: #fff;
  color: var(--muted);
  border-color: var(--border);
}
.sync-meta {
  font-size: 11.5px;
  color: #475569;
  align-self: center;
}
.sync-meta b { color: var(--primary); }

/* 卡片尾部 */
.fb-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 10px;
  border-top: 1px dashed #eef2f7;
  flex-wrap: wrap;
}
.fb-submitter {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.fb-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
}
.fb-submitter-name { font-size: 13px; font-weight: 600; color: var(--text); }
.fb-submitter-role { color: var(--muted); font-weight: 400; font-size: 11.5px; margin-left: 4px; }
.fb-submit-time { font-size: 11.5px; color: var(--muted); }
.fb-card-actions {
  display: inline-flex;
  gap: 8px;
  flex-wrap: wrap;
}
.fb-card-actions .btn {
  font-size: 12.5px;
  padding: 4px 12px;
  border-radius: 6px;
}

/* 审批 banner */
.fb-approve-banner {
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 12.5px;
  margin-bottom: 14px;
  display: flex;
  align-items: flex-start;
  line-height: 1.6;
}
.fb-approve-banner.success {
  background: #ecfdf5;
  border: 1px solid #bbf7d0;
  color: #047857;
}
.fb-approve-banner.danger {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
}

/* 高频聚合卡片 */
.fb-cluster-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
.fb-cluster-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 1px 4px rgba(12,30,58,.04);
  transition: all .2s;
}
.fb-cluster-card:hover {
  border-color: var(--primary-light);
  box-shadow: 0 6px 18px rgba(108,92,231,.1);
}
.fb-cluster-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.fb-cluster-icon {
  width: 42px; height: 42px;
  border-radius: 10px;
  background: linear-gradient(135deg, #fb923c, #f97316);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.fb-cluster-meta { flex: 1; min-width: 0; }
.fb-cluster-name {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}
.fb-cluster-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.fb-cluster-count {
  font-size: 11.5px;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
}
.fb-cluster-count i { color: #ea580c; }
.fb-cluster-suggestion {
  background: linear-gradient(135deg, rgba(108,92,231,.06), rgba(162,155,254,.04));
  border: 1px dashed rgba(108,92,231,.3);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 12.5px;
  color: var(--text);
  line-height: 1.6;
}
.fb-cluster-suggestion-label {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
}
.fb-cluster-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* 聚合样本（弹窗内） */
.fb-cluster-sample {
  background: #fafbfd;
  border: 1px solid #eef2f7;
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 8px;
}
.fb-cluster-sample-head {
  display: inline-flex;
  align-items: center;
  margin-bottom: 6px;
}
.fb-cluster-sample-text {
  font-size: 12.5px;
  color: var(--text);
  line-height: 1.6;
}

@media (max-width: 1100px) {
  .fb-cluster-grid { grid-template-columns: 1fr; }
}

/* ── AI 聚合议题卡（v2，主舞台）── */
.agg-banner {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 18px;
  background: linear-gradient(135deg, rgba(108,92,231,.10), rgba(162,155,254,.06));
  border: 1px solid rgba(108,92,231,.25);
  border-radius: 12px;
}
.agg-banner-icon {
  width: 42px; height: 42px;
  border-radius: 11px;
  background: var(--primary-gradient);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.agg-banner-meta { flex: 1; min-width: 0; }
.agg-banner-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}
.agg-banner-text {
  font-size: 12.5px;
  color: #475569;
  line-height: 1.6;
}
.agg-banner-text strong { color: var(--primary); font-weight: 700; }
.agg-banner-sub {
  display: block;
  margin-top: 4px;
  font-size: 11.5px;
  color: var(--muted);
}

.fb-status.skipped { background: #fff7ed; color: #c2410c; }

.fb-cluster-list-v2 {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.fb-cluster-card-v2 {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 1px 4px rgba(12,30,58,.04);
  transition: all .2s;
  position: relative;
}
.fb-cluster-card-v2:hover {
  box-shadow: 0 6px 20px rgba(12,30,58,.08);
}
.fb-cluster-card-v2.urgent-card {
  border-color: #fecaca;
  background: linear-gradient(180deg, #fff7ed 0%, #fff 80px);
}
.fb-cluster-card-v2.urgent-card::before {
  content: '';
  position: absolute;
  left: 0; top: 18px; bottom: 18px;
  width: 3px;
  background: linear-gradient(180deg, #dc2626, #ef4444);
  border-radius: 0 2px 2px 0;
}

.fb-cluster-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.fb-cluster-card-title-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  flex: 1;
  min-width: 0;
}
.fb-cluster-card-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, #fb923c, #f97316);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.fb-cluster-card-v2.urgent-card .fb-cluster-card-icon {
  background: linear-gradient(135deg, #ef4444, #dc2626);
}
.fb-cluster-card-name {
  font-size: 15.5px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
  line-height: 1.3;
}
.fb-cluster-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.fb-cluster-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  padding: 10px 12px;
  background: #f8fafc;
  border-radius: 8px;
  font-size: 12.5px;
  color: var(--text);
}
.fb-cluster-meta-item {
  display: inline-flex;
  align-items: center;
}
.fb-cluster-meta-item b {
  color: var(--text);
  font-weight: 700;
  margin: 0 2px;
}

.fb-cluster-section-label {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.4px;
  text-transform: uppercase;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
}
.fb-cluster-section-label.primary {
  color: var(--primary);
  letter-spacing: 0.3px;
}
.fb-cluster-section-text {
  font-size: 13px;
  line-height: 1.7;
  color: var(--text);
  background: #f8fafb;
  border: 1px solid #eef2f7;
  border-radius: 8px;
  padding: 10px 14px;
}
.fb-cluster-section-text.core {
  background: linear-gradient(135deg, rgba(108,92,231,.08), rgba(162,155,254,.04));
  border: 1px dashed rgba(108,92,231,.35);
  color: var(--text);
  font-weight: 500;
}

.fb-cluster-actions-row {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 4px;
  border-top: 1px dashed #eef2f7;
  padding-top: 12px;
}
.fb-cluster-actions-row .btn {
  font-size: 13px;
  padding: 6px 14px;
  border-radius: 7px;
}

/* AI 归纳流水线 · 进度动画 */
.agg-progress-wrap {
  margin-bottom: 14px;
}
.agg-progress {
  height: 6px;
  background: #f1f5f9;
  border-radius: 999px;
  overflow: hidden;
}
.agg-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #6c5ce7, #a29bfe);
  border-radius: 999px;
  transition: width .35s ease;
}
.agg-progress-text {
  margin-top: 6px;
  font-size: 11.5px;
  color: var(--muted);
  text-align: right;
}

.agg-pipeline {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.agg-stage {
  position: relative;
  display: flex;
  gap: 14px;
  padding: 10px 4px;
  align-items: flex-start;
}
.agg-stage-line {
  position: absolute;
  left: 17px;
  top: 36px;
  bottom: -4px;
  width: 2px;
  background: #e2e8f0;
  z-index: 0;
}
.agg-stage:last-child .agg-stage-line { display: none; }
.agg-stage.done .agg-stage-line {
  background: linear-gradient(180deg, #18a058, #18a058);
}
.agg-stage.running .agg-stage-line {
  background: linear-gradient(180deg, #6c5ce7 50%, #e2e8f0 50%);
}

.agg-stage-icon {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  z-index: 1;
  transition: all .3s ease;
}
.agg-stage-icon.pending {
  background: #f1f5f9;
  border: 2px solid #e2e8f0;
}
.agg-stage-icon.running {
  background: linear-gradient(135deg, #6c5ce7, #a29bfe);
  box-shadow: 0 0 0 4px rgba(108,92,231,.18);
  animation: aggPulse 1.4s ease-in-out infinite;
}
.agg-stage-icon.done {
  background: linear-gradient(135deg, #18a058, #16a34a);
  box-shadow: 0 0 0 2px rgba(24,160,88,.12);
}
@keyframes aggPulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(108,92,231,.18); }
  50% { box-shadow: 0 0 0 8px rgba(108,92,231,.06); }
}

.agg-spin {
  display: inline-block;
  animation: aggSpin 1s linear infinite;
}
@keyframes aggSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.agg-dots {
  display: inline-block;
  animation: aggDots 1.2s ease-in-out infinite;
}
@keyframes aggDots {
  0%, 100% { opacity: .3; }
  50% { opacity: 1; }
}

.agg-stage-meta {
  flex: 1;
  min-width: 0;
  padding-bottom: 6px;
}
.agg-stage-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
}
.agg-stage.pending .agg-stage-title {
  color: #94a3b8;
  font-weight: 600;
}
.agg-stage.done .agg-stage-title {
  color: #15803d;
}
.agg-stage-detail {
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.5;
}
.agg-stage-result {
  margin-top: 6px;
  font-size: 12.5px;
  line-height: 1.65;
  color: var(--text);
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-left: 3px solid #18a058;
  border-radius: 6px;
  padding: 8px 12px;
}
.agg-stage-result.running {
  background: var(--primary-soft);
  border-color: rgba(108,92,231,.25);
  border-left-color: var(--primary);
  color: var(--primary);
  font-weight: 500;
}
.agg-stage-result b {
  color: var(--primary);
  font-weight: 700;
}
.agg-stage-bullet {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  color: #475569;
}

.agg-final {
  margin-top: 18px;
  padding: 18px 16px;
  background: linear-gradient(135deg, #ecfdf5, #d1fae5);
  border: 1px solid #6ee7b7;
  border-radius: 12px;
  text-align: center;
  animation: aggFadeIn .4s ease;
}
@keyframes aggFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.agg-final-icon {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #18a058, #16a34a);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  margin: 0 auto 10px;
  box-shadow: 0 6px 16px rgba(24,160,88,.25);
}
.agg-final-title {
  font-size: 16px;
  font-weight: 700;
  color: #15803d;
  margin-bottom: 4px;
}
.agg-final-text {
  font-size: 12.5px;
  color: #166534;
  line-height: 1.6;
}
.agg-final-text strong { color: #15803d; font-weight: 800; }

/* 原始反馈池提示条 */
.raw-pool-help {
  background: linear-gradient(135deg, rgba(108,92,231,.06), rgba(162,155,254,.04));
  border: 1px dashed rgba(108,92,231,.3);
  color: #475569;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 12.5px;
  margin-bottom: 12px;
  line-height: 1.6;
}
.raw-pool-help i { color: var(--primary); }
