:root {
  --primary-color: #1e40af;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  --success-color: #15803d;
  --success-light: #dcfce7;
  --warning-color: #b45309;
  --warning-light: #fef3c7;
  --danger-color: #b91c1c;
  --danger-light: #fee2e2;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --bg-app: #f8fafc;
  --bg-card: #ffffff;
  --border-color: #e2e8f0;
  --border-focus: #3b82f6;
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

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

body {
  font-family: var(--font-family);
  background-color: var(--bg-app);
  color: var(--text-main);
  height: 100vh;
  overflow: hidden;
}

.app-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: relative;
  overflow: hidden;
}

/* 顶部导航 */
.top-navbar {
  height: auto;
  min-height: 64px;
  flex-shrink: 0;
  background-color: #ffffff;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  z-index: 20;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-icon {
  font-size: 26px;
  color: var(--primary-color);
}

.brand-text h1 {
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
}

.brand-text .badge {
  background-color: #dbeafe;
  color: var(--primary-color);
  font-size: 10px;
  padding: 2px 5px;
  border-radius: 4px;
  font-weight: 600;
}

.brand-text .subtitle {
  font-size: 11px;
  color: var(--text-muted);
}

/* 项目选择器 (管理者视图) */
.project-selector-wrapper {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
}

.project-selector-wrapper select {
  padding: 5px 10px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 12.5px;
  background-color: #ffffff;
  color: var(--text-main);
  max-width: 240px;
  outline: none;
  cursor: pointer;
}

.project-selector-wrapper select:focus {
  border-color: var(--border-focus);
}

.header-actions {
  display: flex;
  gap: 7px;
  align-items: center;
}

/* 按钮体系 */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.btn-primary { background-color: var(--primary-color); color: #ffffff; }
.btn-primary:hover { background-color: var(--primary-hover); }
.btn-success { background-color: var(--success-color); color: #ffffff; }
.btn-success:hover { background-color: #166534; }
.btn-outline { background-color: #ffffff; color: var(--text-main); border-color: var(--border-color); }
.btn-outline:hover { background-color: #f1f5f9; }
.btn-secondary { background-color: #f1f5f9; color: #334155; border-color: #cbd5e1; }
.btn-secondary:hover { background-color: #e2e8f0; }
.btn-outline-danger { background-color: #fff; color: var(--danger-color); border-color: #fca5a5; }
.btn-outline-danger:hover { background-color: #fee2e2; }
.btn-sm { padding: 4px 8px; font-size: 11.5px; }

.pulse-btn {
  box-shadow: 0 0 0 0 rgba(30, 64, 175, 0.4);
  animation: pulse 2.2s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(30, 64, 175, 0.4); }
  70% { box-shadow: 0 0 0 8px rgba(30, 64, 175, 0); }
  100% { box-shadow: 0 0 0 0 rgba(30, 64, 175, 0); }
}

/* 折叠开关按钮 */
.pane-toggle-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: #94a3b8;
  padding: 4px 6px;
  border-radius: 4px;
}

.pane-toggle-btn:hover {
  background-color: #f1f5f9;
  color: #0f172a;
}

.floating-unfold-btn {
  display: none;
  position: absolute;
  top: 74px;
  z-index: 15;
  background-color: #ffffff;
  border: 1px solid var(--border-color);
  box-shadow: 0 2px 5px rgba(0,0,0,0.08);
  border-radius: 4px;
  padding: 6px 10px;
  font-size: 11.5px;
  color: var(--text-muted);
  cursor: pointer;
}

.floating-unfold-btn:hover {
  color: var(--primary-color);
  background-color: #f8fafc;
}

.floating-unfold-btn.left { left: 10px; }
.floating-unfold-btn.right { right: 10px; }

/* 工作区三栏布局 */
.workspace-layout {
  display: flex;
  flex: 1;
  height: calc(100vh - 64px);
  overflow: hidden;
  position: relative;
}

/* 左侧章节树 */
.sidebar-tree {
  width: 320px;
  background-color: #ffffff;
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.sidebar-tree.collapsed {
  width: 0;
  border-right: none;
}

.sidebar-header {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-color);
}

.sidebar-header-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.project-info .label {
  font-size: 11px;
  color: var(--text-muted);
}

.project-info h3 {
  font-size: 13px;
  font-weight: 600;
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 240px;
}

.tree-search-bar {
  margin-top: 10px;
  position: relative;
}

.tree-search-bar .search-icon {
  position: absolute;
  left: 10px;
  top: 8px;
  font-size: 11px;
  color: #94a3b8;
}

.tree-search-bar input {
  width: 100%;
  padding: 5px 10px 5px 28px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 12px;
  outline: none;
}

.tree-search-bar input:focus {
  border-color: var(--border-focus);
}

.outline-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
}

.tag {
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 4px;
  font-weight: 500;
}

.tag-info { background-color: #e0f2fe; color: #0369a1; }
.tag-neutral { background-color: #f1f5f9; color: #64748b; }

.btn-icon {
  background: none;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 3px 7px;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 11.5px;
}

.btn-icon:hover {
  background-color: #f1f5f9;
  color: var(--text-main);
}

.tree-nav {
  flex: 1;
  overflow-y: auto;
  padding: 8px 6px;
}

.tree-item {
  display: flex;
  align-items: center;
  padding: 8px 10px;
  border-radius: 6px;
  margin-bottom: 3px;
  cursor: pointer;
  font-size: 12.5px;
  transition: all 0.15s ease;
  user-select: none;
  position: relative;
}

.tree-item:hover { background-color: #f1f5f9; }
.tree-item.active {
  background-color: var(--primary-light);
  color: var(--primary-color);
  font-weight: 600;
}

.tree-item .tree-icon {
  margin-right: 6px;
  font-size: 12px;
  color: var(--text-muted);
}

.tree-item.active .tree-icon { color: var(--primary-color); }
.tree-item .tree-title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree-item .tree-badge { font-size: 10px; padding: 1px 4px; border-radius: 3px; margin-left: 4px; }

/* 章节悬浮操作按钮 (敏捷调序与重命名) */
.tree-ops {
  display: none;
  gap: 3px;
  margin-left: 4px;
}

.tree-item:hover .tree-ops {
  display: flex;
}

.btn-tree-op {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 3px;
  padding: 2px 4px;
  font-size: 10px;
  color: #64748b;
  cursor: pointer;
}

.btn-tree-op:hover {
  color: #0f172a;
  border-color: #94a3b8;
}

/* 中间编辑器 */
.editor-container {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  background-color: #f8fafc;
  overflow: hidden;
  position: relative;
}

.editor-toolbar {
  height: 50px;
  background-color: #ffffff;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 16px;
}

.active-section-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.active-section-meta h2 {
  font-size: 14.5px;
  font-weight: 600;
  color: #0f172a;
}

.status-indicator {
  font-size: 11px;
  background-color: #dcfce7;
  color: #15803d;
  padding: 2px 6px;
  border-radius: 4px;
}

/* 双模态切换 */
.view-switch-tabs {
  display: flex;
  background-color: #f1f5f9;
  padding: 2px;
  border-radius: 6px;
}

.view-tab {
  padding: 4px 10px;
  border: none;
  background: none;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.15s ease;
}

.view-tab.active {
  background-color: #ffffff;
  color: var(--primary-color);
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.view-tab-label-short { display: none; }

.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.word-counter {
  font-size: 12px;
  color: var(--text-muted);
}

.save-status {
  font-size: 12px;
  color: var(--success-color);
}

/* 常用排版工具栏 */
.formatting-toolbar {
  height: 36px;
  background-color: #ffffff;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 6px;
}

.tool-btn {
  background: none;
  border: 1px solid transparent;
  padding: 3px 7px;
  border-radius: 4px;
  font-size: 11.5px;
  color: #475569;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.tool-btn:hover {
  background-color: #f1f5f9;
  border-color: var(--border-color);
  color: var(--text-main);
}

/* 内联警告条 */
.inline-warning-banner {
  background-color: #fff1f2;
  border-bottom: 1px solid #fecdd3;
  padding: 7px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: #9f1239;
}

.banner-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.editor-body {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  justify-content: center;
}

.editor-wrapper {
  width: 100%;
  max-width: 900px;
  height: 100%;
  background-color: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
  display: flex;
  flex-direction: column;
}

#sectionContentEditor {
  width: 100%;
  flex: 1;
  border: none;
  padding: 24px;
  font-size: 14.5px;
  line-height: 1.75;
  font-family: inherit;
  color: #1e293b;
  resize: none;
  outline: none;
}

/* 排版实时预览模式 */
.section-preview-area {
  width: 100%;
  flex: 1;
  padding: 26px 36px;
  overflow-y: auto;
  font-size: 14.5px;
  line-height: 1.8;
  color: #1e293b;
}

.section-preview-area h1, .section-preview-area h2, .section-preview-area h3, .section-preview-area h4 {
  color: #0f172a;
  margin-top: 18px;
  margin-bottom: 8px;
}

.section-preview-area table {
  width: 100%;
  border-collapse: collapse;
  margin: 14px 0;
  font-size: 12.5px;
}

.section-preview-area th, .section-preview-area td {
  border: 1px solid #cbd5e1;
  padding: 7px 10px;
  text-align: left;
}

.section-preview-area th {
  background-color: #f1f5f9;
  font-weight: 600;
}

.section-preview-area blockquote {
  border-left: 4px solid #3b82f6;
  padding: 8px 14px;
  margin: 12px 0;
  background-color: #eff6ff;
  color: #1e40af;
  font-size: 12.5px;
}

/* 右侧审查抽屉 */
.audit-drawer {
  width: 440px;
  background-color: #ffffff;
  border-left: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.audit-drawer.collapsed {
  width: 0;
  border-left: none;
}

.drawer-header {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.drawer-title {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #0f172a;
}

.drawer-title h3 {
  font-size: 13.5px;
  font-weight: 600;
}

.drawer-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.badge-status {
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}

.badge-pass { background-color: var(--success-light); color: var(--success-color); }
.badge-danger { background-color: var(--danger-light); color: var(--danger-color); }
.badge-warning { background-color: var(--warning-light); color: var(--warning-color); }
.badge-neutral { background-color: #f1f5f9; color: #64748b; }

/* 标书健康指数大盘 */
.health-card {
  padding: 10px 14px;
  background: linear-gradient(135deg, #f8fafc 0%, #eff6ff 100%);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 12px;
}

.health-grade-ring {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #ffffff;
  border: 4px solid var(--primary-color);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.grade-text {
  font-size: 17px;
  font-weight: 800;
  color: var(--primary-color);
}

.health-grade-ring.grade-danger { border-color: var(--danger-color); }
.health-grade-ring.grade-danger .grade-text { color: var(--danger-color); }

.health-summary-text {
  flex: 1;
}

.health-title {
  font-size: 12.5px;
  font-weight: 700;
  color: #0f172a;
}

.health-desc {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.audit-dashboard {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 6px;
  padding: 8px 10px;
  background-color: #ffffff;
  border-bottom: 1px solid var(--border-color);
}

.dash-card {
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 7px 5px;
  text-align: center;
}

.dash-title {
  font-size: 10.5px;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.dash-value {
  font-size: 14px;
  font-weight: 700;
}

.card-rejection .dash-value { color: var(--danger-color); }
.card-scoring .dash-value { color: var(--primary-color); }
.card-complete .dash-value { color: var(--success-color); }
.dash-tip { font-size: 9.5px; color: #94a3b8; margin-top: 2px; }

/* 评分维度柱状图大盘 (管理者视角) */
.category-score-box {
  padding: 10px 14px;
  background-color: #fafafa;
  border-bottom: 1px solid var(--border-color);
}

.box-title {
  font-size: 11.5px;
  font-weight: 600;
  color: #334155;
  margin-bottom: 8px;
}

.category-bar-row {
  margin-bottom: 6px;
}

.bar-meta {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  margin-bottom: 2px;
}

.bar-track {
  height: 6px;
  background-color: #e2e8f0;
  border-radius: 3px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  background-color: var(--primary-color);
  border-radius: 3px;
  transition: width 0.4s ease;
}

.audit-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-color);
  background-color: #ffffff;
}

.tab-btn {
  flex: 1;
  padding: 8px 3px;
  border: none;
  background: none;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
}

.tab-btn:hover { color: var(--text-main); }
.tab-btn.active {
  color: var(--primary-color);
  border-bottom-color: var(--primary-color);
  font-weight: 600;
}

.audit-content {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
}

.audit-card {
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 10px;
  margin-bottom: 8px;
  background: #ffffff;
  transition: transform 0.15s, box-shadow 0.15s;
}

.audit-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.05);
}

.audit-card.card-danger { border-left: 4px solid var(--danger-color); }
.audit-card.card-safe { border-left: 4px solid var(--success-color); }
.audit-card.card-warn { border-left: 4px solid var(--warning-color); }

.audit-card-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12.5px;
  font-weight: 600;
  margin-bottom: 5px;
}

.audit-card-body {
  font-size: 11.5px;
  color: #475569;
  line-height: 1.5;
}

.audit-meta-row {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--border-color);
  font-size: 11px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.audit-ops {
  display: flex;
  gap: 6px;
  align-items: center;
}

.jump-link {
  color: var(--primary-color);
  cursor: pointer;
  font-weight: 500;
  text-decoration: underline;
}

.btn-autofix {
  background-color: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecdd3;
  padding: 2px 6px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 10.5px;
}

.btn-autofix:hover { background-color: #fecdd3; }

.btn-verify {
  background-color: #f1f5f9;
  color: #475569;
  border: 1px solid #cbd5e1;
  padding: 2px 6px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 10.5px;
}

.btn-verify:hover { background-color: #e2e8f0; }

/* 招标文件原文要素对照抽屉 */
.tender-reference-drawer {
  position: absolute;
  top: 0;
  right: -460px;
  width: 450px;
  height: 100%;
  background: #ffffff;
  border-left: 1px solid var(--border-color);
  box-shadow: -4px 0 15px rgba(0, 0, 0, 0.08);
  z-index: 30;
  display: flex;
  flex-direction: column;
  transition: right 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

.tender-reference-drawer.open {
  right: 0;
}

.tender-drawer-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.tender-drawer-search {
  padding: 8px 14px;
  border-bottom: 1px solid var(--border-color);
  background-color: #f8fafc;
}

.tender-drawer-search input {
  width: 100%;
  padding: 6px 10px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 12px;
  outline: none;
}

.tender-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
}

.tender-clause-card {
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 10px;
  margin-bottom: 10px;
  background-color: #fafbfc;
}

.tender-clause-card h4 {
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 4px;
  display: flex;
  justify-content: space-between;
}

.tender-clause-card p {
  font-size: 11.5px;
  color: #475569;
  line-height: 1.5;
}

.btn-insert-clause {
  background: none;
  border: 1px solid #94a3b8;
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 10.5px;
  cursor: pointer;
  color: var(--primary-color);
}

/* 现代化拖拽上传区域 */
.drop-zone {
  border: 2px dashed #93c5fd;
  border-radius: 8px;
  padding: 26px 20px;
  text-align: center;
  background-color: #eff6ff;
  cursor: pointer;
  transition: all 0.2s ease;
}

.drop-zone:hover, .drop-zone.dragover {
  border-color: var(--primary-color);
  background-color: #dbeafe;
}

.drop-icon {
  font-size: 32px;
  color: #3b82f6;
  margin-bottom: 8px;
}

.drop-text {
  font-size: 13px;
  color: #1e3a8a;
  margin-bottom: 4px;
}

.file-chosen-text {
  font-size: 11.5px;
  color: #475569;
  background: #ffffff;
  padding: 3px 10px;
  border-radius: 12px;
  border: 1px solid #bfdbfe;
  display: inline-block;
  margin-top: 6px;
}

/* 模态框 */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background-color: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(2px);
  z-index: 50;
  justify-content: center;
  align-items: center;
}

.modal.show { display: flex; }
.modal-box {
  background: #ffffff;
  width: 520px;
  border-radius: 8px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.modal-lg { width: 720px; }
.modal-xl { width: 920px; max-width: 95vw; }

.modal-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header-ops {
  display: flex;
  gap: 10px;
  align-items: center;
}

.modal-header h3 { font-size: 14.5px; font-weight: 600; }
.close-btn { background: none; border: none; font-size: 20px; cursor: pointer; color: var(--text-muted); }
.modal-body { padding: 18px; max-height: 70vh; overflow-y: auto; }
.modal-desc { font-size: 12.5px; color: var(--text-muted); margin-bottom: 14px; line-height: 1.5; }

.form-group { margin-bottom: 12px; }
.form-group label { display: block; font-size: 12.5px; font-weight: 500; margin-bottom: 5px; }
.form-group input[type="text"] {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 12.5px;
}

.modal-alert {
  background-color: #eff6ff;
  border: 1px solid #bfdbfe;
  padding: 9px 12px;
  border-radius: 6px;
  font-size: 11.5px;
  color: #1e40af;
  display: flex;
  gap: 8px;
  align-items: center;
}

.modal-footer {
  padding: 10px 18px;
  background-color: #f8fafc;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* 全文预览窗口内容排版 */
.full-preview-body {
  max-height: 80vh;
  padding: 30px 40px;
  background-color: #f8fafc;
}

/* 空状态 */
.empty-state { text-align: center; padding: 36px 16px; color: var(--text-muted); }
.empty-state i { font-size: 30px; margin-bottom: 10px; color: #cbd5e1; }
.empty-state p { font-size: 12px; line-height: 1.6; }

/* 遮罩加载 */
.loading-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background-color: rgba(15, 23, 42, 0.6);
  z-index: 100;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  color: #ffffff;
}

.loading-overlay.show { display: flex; }
.spinner {
  width: 38px;
  height: 38px;
  border: 3px solid rgba(255, 255, 255, 0.2);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 12px;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* 现代 Toast 通知体系 */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  pointer-events: none;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: #ffffff;
  border-radius: 6px;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  border-left: 4px solid #3b82f6;
  font-size: 12.5px;
  color: #1e293b;
  min-width: 260px;
  max-width: 400px;
  animation: slideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.toast.toast-success { border-left-color: var(--success-color); }
.toast.toast-danger { border-left-color: var(--danger-color); }
.toast.toast-warning { border-left-color: var(--warning-color); }
.toast i { font-size: 15px; }
.toast.toast-success i { color: var(--success-color); }
.toast.toast-danger i { color: var(--danger-color); }
.toast.toast-warning i { color: var(--warning-color); }

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes fadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

/* ========================================================
   V3.0 多视角体验优化与主题系统 (Theme & UX Enhancements)
   ======================================================== */

/* 主题切换器 */
.theme-switcher-group {
  display: inline-flex;
  align-items: center;
  background-color: var(--border-color);
  border-radius: 20px;
  padding: 2px;
  gap: 2px;
}

.theme-btn {
  background: transparent;
  border: none;
  border-radius: 50%;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

.theme-btn:hover {
  color: var(--text-main);
}

.theme-btn.active {
  background-color: var(--bg-card);
  color: var(--primary-color);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

/* 护眼暖黄纸质模式 (Eye-care Paper Mode) */
body[data-theme="eyecare"] {
  --bg-app: #f4eee1;
  --bg-card: #fdfaf3;
  --text-main: #2b251d;
  --text-muted: #786c5c;
  --border-color: #dfd3be;
  --primary-color: #1f5132;
  --primary-hover: #173e26;
  --primary-light: #e5ede3;
  --border-focus: #3e7b57;
  --success-color: #1f6b3b;
  --warning-color: #92400e;
  --danger-color: #991b1b;
}

body[data-theme="eyecare"] .top-navbar,
body[data-theme="eyecare"] .sidebar-tree,
body[data-theme="eyecare"] .editor-toolbar,
body[data-theme="eyecare"] .formatting-toolbar,
body[data-theme="eyecare"] .audit-drawer,
body[data-theme="eyecare"] .modal-box,
body[data-theme="eyecare"] #sectionContentEditor,
body[data-theme="eyecare"] .tender-reference-drawer,
body[data-theme="eyecare"] .section-preview-area {
  background-color: var(--bg-card) !important;
  color: var(--text-main) !important;
  border-color: var(--border-color) !important;
}

/* 深色暗夜极客模式 (Midnight Dark Mode) */
body[data-theme="dark"] {
  --bg-app: #0b1120;
  --bg-card: #152033;
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --border-color: #27374d;
  --primary-color: #38bdf8;
  --primary-hover: #0ea5e9;
  --primary-light: #162a45;
  --border-focus: #38bdf8;
  --success-color: #34d399;
  --success-light: #064e3b;
  --warning-color: #fbbf24;
  --warning-light: #78350f;
  --danger-color: #f87171;
  --danger-light: #7f1d1d;
}

body[data-theme="dark"] .top-navbar,
body[data-theme="dark"] .sidebar-tree,
body[data-theme="dark"] .editor-toolbar,
body[data-theme="dark"] .formatting-toolbar,
body[data-theme="dark"] .audit-drawer,
body[data-theme="dark"] .modal-box,
body[data-theme="dark"] #sectionContentEditor,
body[data-theme="dark"] .tender-reference-drawer,
body[data-theme="dark"] .section-preview-area {
  background-color: var(--bg-card) !important;
  color: var(--text-main) !important;
  border-color: var(--border-color) !important;
}

body[data-theme="dark"] .btn-outline {
  border-color: var(--border-color);
  color: var(--text-main);
}

body[data-theme="dark"] .btn-outline:hover {
  background-color: #1e293b;
}

body[data-theme="dark"] select,
body[data-theme="dark"] input[type="text"] {
  background-color: #0b1120 !important;
  color: #f1f5f9 !important;
  border-color: var(--border-color) !important;
}

body[data-theme="dark"] .toast {
  background-color: #1e293b;
  color: #f1f5f9;
}

/* 格式工具栏警示按钮 */
.tool-btn.tool-btn-warning {
  color: #d97706;
  border-color: #fde68a;
  background-color: #fffbeb;
  font-weight: 600;
}

.tool-btn.tool-btn-warning:hover {
  background-color: #fef3c7;
  color: #b45309;
}

/* 版本快照卡片样式 */
.snapshot-create-box {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  padding: 14px;
  background-color: var(--bg-app);
  border-radius: 8px;
  border: 1px dashed var(--border-color);
}

.snapshot-list-container {
  max-height: 400px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.snapshot-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  transition: all 0.2s ease;
}

.snapshot-card:hover {
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
  border-color: var(--primary-color);
}

.snapshot-info h4 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
}

.snapshot-meta {
  font-size: 11.5px;
  color: var(--text-muted);
  display: flex;
  gap: 12px;
}

.snapshot-ops {
  display: flex;
  gap: 8px;
}

/* 签章与签字核验卡片 */
.seals-list-container {
  max-height: 420px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.seal-item-card {
  padding: 12px 16px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.seal-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.seal-item-header h4 {
  font-size: 14px;
  font-weight: 600;
}

.seal-tag-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.seal-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  background-color: #fee2e2;
  color: #b91c1c;
}

.seal-tag.seal-blue {
  background-color: #e0f2fe;
  color: #0369a1;
}

.seal-snippets-list {
  font-size: 12px;
  color: var(--text-muted);
  background-color: var(--bg-app);
  padding: 8px 12px;
  border-radius: 6px;
  line-height: 1.6;
}

/* 占位符泄漏卡片 */
.leaks-summary-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  border-radius: 6px;
  margin-bottom: 14px;
  font-size: 13px;
  font-weight: 500;
}

.leaks-summary-bar.danger {
  background-color: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.leaks-summary-bar.clean {
  background-color: #dcfce7;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.leaks-list-container {
  max-height: 400px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.leak-card {
  padding: 10px 14px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.leak-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.leak-token {
  font-family: monospace;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 3px;
}

.leak-token.critical {
  background-color: #fee2e2;
  color: #b91c1c;
}

.leak-token.warning {
  background-color: #fef3c7;
  color: #b45309;
}

.leak-preview {
  font-size: 12px;
  color: var(--text-muted);
}

/* 评分矩阵表格样式 */
#scoringMatrixModalContent table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin-top: 10px;
}

#scoringMatrixModalContent th,
#scoringMatrixModalContent td {
  border: 1px solid var(--border-color);
  padding: 8px 12px;
  text-align: left;
}

#scoringMatrixModalContent th {
  background-color: var(--bg-app);
  font-weight: 600;
}

/* ========================================================
   多企业主体管理、账号身份与电子标防串标环境隔离样式
   ======================================================== */

/* 投标主体选择器 */
.entity-selector-wrapper {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
}

.entity-selector-wrapper select {
  padding: 5px 10px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 12.5px;
  background-color: var(--bg-card);
  color: var(--primary-color);
  font-weight: 600;
  max-width: 220px;
  cursor: pointer;
}

/* 顶部账号徽章 */
.user-account-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  background-color: var(--bg-app);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.2s ease;
}

.user-account-badge:hover {
  border-color: var(--primary-color);
  background-color: var(--primary-light);
  color: var(--primary-color);
}

.user-account-badge .user-icon {
  font-size: 15px;
  color: var(--primary-color);
}

/* 认证模态框 */
.auth-tabs {
  display: flex;
  border-bottom: 2px solid var(--border-color);
  margin-bottom: 15px;
}

.auth-tab {
  flex: 1;
  padding: 10px;
  text-align: center;
  background: transparent;
  border: none;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s ease;
}

.auth-tab.active {
  color: var(--primary-color);
  border-bottom-color: var(--primary-color);
}

.user-card-detail {
  text-align: center;
  padding: 20px 10px;
  background: var(--bg-app);
  border-radius: 8px;
}

.user-avatar-large {
  font-size: 54px;
  color: var(--primary-color);
  margin-bottom: 10px;
}

/* 多企业管理面板布局 */
.multi-company-modal-body {
  display: flex;
  gap: 16px;
  height: 520px;
  padding: 0 !important;
  overflow: hidden;
}

.company-sidebar {
  width: 260px;
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  background-color: var(--bg-app);
}

.company-sidebar-header {
  padding: 12px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  font-size: 13px;
  font-weight: 600;
}

.company-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.company-list-item {
  padding: 10px 12px;
  border-radius: 6px;
  border: 1px solid transparent;
  background-color: var(--bg-card);
  cursor: pointer;
  transition: all 0.2s ease;
}

.company-list-item:hover {
  border-color: var(--primary-color);
}

.company-list-item.active {
  border-color: var(--primary-color);
  background-color: var(--primary-light);
}

.company-item-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.company-item-sub {
  font-size: 11px;
  color: var(--text-muted);
}

.company-detail-panel {
  flex: 1;
  overflow-y: auto;
  padding: 18px 24px;
}

.detail-form-section {
  margin-bottom: 20px;
}

.detail-form-section h4 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-color);
  color: var(--primary-color);
}

.grid-2-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 640px) {
  #profileModal .multi-company-modal-body { flex-direction: column; gap: 0; min-height: 0; }
  #profileModal .company-sidebar { width: 100%; flex: 0 0 auto; min-width: 0; border-right: 0; border-bottom: 1px solid var(--border-color); }
  #profileModal .company-sidebar-header { padding: 8px 12px; gap: 8px; }
  #profileModal .company-list { flex-direction: row; flex: 0 0 auto; overflow-x: auto; padding: 6px 8px; }
  #profileModal .company-list-item { flex: 0 0 180px; min-width: 0; padding: 8px; }
  #profileModal .company-item-sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  #profileModal .company-detail-panel { min-width: 0; min-height: 0; padding: 12px; overflow-x: hidden; }
  #profileModal .grid-2-col { grid-template-columns: minmax(0, 1fr); }
  #profileModal .company-detail-panel > div:first-child { flex-wrap: wrap; gap: 10px; }
  #profileModal .company-detail-panel input, #profileModal .company-detail-panel textarea { min-width: 0; max-width: 100%; }
  #profileModal #companyConflictNotice { overflow-wrap: anywhere; }
  #profileModal #companyConflictNotice button { margin: 4px 4px 4px 0; }
}

/* 电子标防串标环境仪表板网格 */
.env-dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 14px;
}

.env-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.env-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-main);
  border-bottom: 1px dashed var(--border-color);
  padding-bottom: 6px;
}

.env-item-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
}

.env-item-label {
  color: var(--text-muted);
}

.env-code-pill {
  font-family: monospace;
  font-size: 11.5px;
  background-color: var(--bg-app);
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 600;
  color: var(--primary-color);
  border: 1px solid var(--border-color);
}

/* 组织架构与协同分工样式 */
.org-selector-wrapper {
  display: flex;
  align-items: center;
  gap: 6px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.2s ease;
}

.org-selector-wrapper:hover {
  border-color: var(--warning-color);
  background-color: var(--warning-light);
}

.collab-permission-banner {
  background-color: var(--warning-light);
  border: 1px solid var(--warning-color);
  color: #92400e;
  padding: 8px 14px;
  border-radius: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 500;
}

.collab-overview-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 16px;
}

.collab-role-card {
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 12.5px;
  line-height: 1.5;
}

.collab-role-card.comm-card {
  background-color: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e40af;
}

.collab-role-card.tech-card {
  background-color: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534;
}

.role-card-header {
  font-weight: 700;
  font-size: 13.5px;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.collab-section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 8px;
}

.collab-table-wrapper {
  overflow-x: auto;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background-color: var(--bg-card);
  margin-bottom: 16px;
}

.collab-table-wrapper table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

.collab-table-wrapper th, .collab-table-wrapper td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-color);
  text-align: left;
}

.collab-table-wrapper th {
  background-color: var(--bg-app);
  color: var(--text-muted);
  font-weight: 600;
}

.invite-member-box {
  background-color: var(--bg-app);
  border: 1px dashed var(--border-color);
  border-radius: 8px;
  padding: 14px 16px;
}

.invite-member-box h4 {
  font-size: 13.5px;
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 6px;
}

.invite-form-row {
  display: flex;
  gap: 12px;
  align-items: flex-end;
}

.invite-form-row label {
  font-size: 12px;
  color: var(--text-muted);
  display: block;
  margin-bottom: 4px;
}

.invite-form-row input, .invite-form-row select {
  width: 100%;
  padding: 6px 10px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background-color: var(--bg-card);
  color: var(--text-main);
  font-size: 12.5px;
}

.org-info-card {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.08), rgba(59, 130, 246, 0.08));
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 8px;
  padding: 14px 18px;
}

#orgModal .invite-member-box :disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.sec-cat-tag {
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 4px;
  display: inline-block;
  margin-right: 4px;
}

.sec-cat-comm {
  background-color: #dbeafe;
  color: #1e40af;
  border: 1px solid #bfdbfe;
}

.sec-cat-tech {
  background-color: #dcfce7;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

.sec-cat-gen {
  background-color: #f3e8ff;
  color: #7e22ce;
  border: 1px solid #e9d5ff;
}

.sec-assignee-tag {
  font-size: 10.5px;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-left: 4px;
  max-width: 120px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ==========================================
 * 多视角优化样式体系
 * ========================================== */

/* 1. 编制人员视角: 章节树快速分类过滤药丸 */
.section-filter-pills {
  display: flex;
  gap: 4px;
  padding: 8px 10px;
  background-color: var(--bg-app);
  border-bottom: 1px solid var(--border-color);
  overflow-x: auto;
  white-space: nowrap;
}

.filter-pill {
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 500;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  background-color: var(--bg-card);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.filter-pill:hover {
  border-color: var(--primary-color);
  color: var(--text-main);
}

.filter-pill.active {
  background-color: var(--primary-color);
  color: #ffffff;
  border-color: var(--primary-color);
  font-weight: 600;
}

.filter-pill-count {
  font-size: 9.5px;
  opacity: 0.85;
}

/* 2. 管理者视角: 章节协同流转状态选择器 */
.collab-status-picker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 8px;
}

.collab-status-select {
  padding: 2px 8px;
  font-size: 11.5px;
  font-weight: 600;
  border-radius: 4px;
  border: 1px solid var(--border-color);
  background-color: var(--bg-card);
  color: var(--text-main);
  cursor: pointer;
}

.collab-status-select.approved {
  background-color: #dcfce7;
  color: #166534;
  border-color: #86efac;
}

.collab-status-select.submitted {
  background-color: #dbeafe;
  color: #1e40af;
  border-color: #93c5fd;
}

.collab-status-select.in_progress {
  background-color: #fef3c7;
  color: #92400e;
  border-color: #fde68a;
}

/* 3. 编制人员视角: 章节招标条款即时对照抽屉 */
.section-clauses-drawer {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 380px;
  background-color: var(--bg-card);
  border-left: 1px solid var(--border-color);
  box-shadow: -4px 0 16px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  z-index: 20;
  transform: translateX(100%);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.section-clauses-drawer.open {
  transform: translateX(0);
}

.clauses-drawer-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: var(--bg-app);
}

.clauses-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.drawer-clause-card {
  background-color: var(--bg-app);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 12px;
  font-size: 12px;
}

.drawer-clause-card.rejection {
  border-left: 3px solid var(--danger-color);
}

.drawer-clause-card.scoring {
  border-left: 3px solid var(--primary-color);
}

.drawer-clause-title {
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 6px;
  display: flex;
  justify-content: space-between;
}

.drawer-clause-content {
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 6px;
}

.drawer-clause-meta {
  display: flex;
  gap: 6px;
  font-size: 10.5px;
}

/* 4. 管理者视角: 协同大盘综合看板 */
.exec-collab-dashboard {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 18px;
}

.exec-metrics-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 14px;
}

.exec-metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 10px 12px;
  text-align: center;
}

.exec-metric-val {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary-color);
}

.exec-metric-lbl {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.exec-progress-bar-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.exec-progress-bar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
}

.exec-progress-bar-track {
  flex: 1;
  height: 8px;
  background-color: #e2e8f0;
  border-radius: 4px;
  overflow: hidden;
}

.exec-progress-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s ease;
}

/* 5. 投标人视角: 引用企业资产 (资质/业绩) 弹窗 */
.asset-picker-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 10px;
  margin-bottom: 14px;
}

@media screen and (max-width: 1023px) {
  .comment-input-area > .btn,
  .comment-actions-row > .btn,
  #assetPickerModal .modal-footer .btn {
    min-height: 44px;
  }
}

.asset-picker-tab {
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 6px;
  border: 1px solid transparent;
  background: none;
  color: var(--text-muted);
  cursor: pointer;
}

.asset-picker-tab.active {
  background-color: var(--primary-light);
  color: var(--primary-color);
  border-color: var(--primary-color);
}

.asset-items-list {
  max-height: 320px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.asset-item-choice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  background-color: var(--bg-app);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.asset-item-choice:hover {
  border-color: var(--primary-color);
  background-color: var(--bg-card);
}

.asset-item-choice input[type="checkbox"] {
  margin-top: 3px;
  cursor: pointer;
}

/* 6. 管理者与现场开标视角: 递交前五重防护大审查 */
.audit-overview-gauge {
  text-align: center;
  padding: 20px 10px;
  background: linear-gradient(135deg, #f0fdf4 0%, #e0f2fe 100%);
  border-radius: 8px;
  margin-bottom: 18px;
  border: 1px solid #bbf7d0;
}

.audit-gauge-score {
  font-size: 42px;
  font-weight: 800;
  color: #15803d;
  line-height: 1;
}

.audit-gauge-desc {
  font-size: 13px;
  color: #475569;
  margin-top: 6px;
}

.audit-checklist {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.audit-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 6px;
}

.audit-card.pass {
  border-left: 4px solid var(--success-color);
}

.audit-card.fail {
  border-left: 4px solid var(--danger-color);
}

.audit-card-info h4 {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 3px;
}

.audit-card-info p {
  font-size: 12px;
  color: var(--text-muted);
  margin: 0;
}

/* ========================================================
   V7.0 新增: 顶部多级分类下拉导航与高频工具箱
======================================================== */
.nav-dropdown {
  position: relative;
  display: inline-block;
}

.nav-dropdown-btn {
  display: flex;
  align-items: center;
  gap: 5px;
}

.nav-arrow {
  font-size: 10px;
  transition: transform 0.2s ease;
}

.nav-dropdown.open .nav-arrow {
  transform: rotate(180deg);
}

.nav-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 250px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
  padding: 6px;
  z-index: 100;
  animation: fadeInDown 0.15s ease-out;
}

.nav-dropdown.open .nav-dropdown-menu {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-dropdown-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.nav-dropdown-item:hover {
  background-color: var(--bg-app);
}

.nav-dropdown-item i {
  font-size: 16px;
  width: 20px;
  text-align: center;
}

.nav-dropdown-item div {
  display: flex;
  flex-direction: column;
}

.nav-dropdown-item div strong {
  font-size: 12.5px;
  color: var(--text-main);
}

.nav-dropdown-item div span {
  font-size: 11px;
  color: var(--text-muted);
}

.btn-icon-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  background-color: var(--bg-card);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-icon-circle:hover {
  color: var(--primary-color);
  border-color: var(--primary-color);
  background-color: var(--primary-light);
}

/* ========================================================
   V7.0 新增: 截标倒计时与工程状态感知栏
======================================================== */
.project-status-deadline-bar {
  height: 38px;
  background-color: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 16px;
  font-size: 12px;
  z-index: 15;
}

.status-bar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 20px;
  background-color: var(--bg-app);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  font-size: 12px;
}

.status-pill.env-safe-pill {
  cursor: pointer;
  background-color: #f0fdf4;
  border-color: #bbf7d0;
  color: #166534;
}

.status-pill.env-safe-pill:hover {
  background-color: #dcfce7;
}

.status-bar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.deadline-countdown-widget {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 12px;
  border-radius: 20px;
  background-color: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
  cursor: pointer;
  transition: all 0.2s ease;
}

.deadline-countdown-widget:hover {
  background-color: #fee2e2;
  border-color: #f87171;
}

.pulse-clock {
  animation: clockPulse 1.8s infinite;
}

@keyframes clockPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

.deadline-time {
  font-weight: 700;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.deadline-edit-tip {
  font-size: 11px;
  color: #b91c1c;
  opacity: 0.8;
}

.cockpit-shortcut-btn {
  background-color: var(--primary-light);
  border: 1px solid #bfdbfe;
  color: var(--primary-color);
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s ease;
}

.cockpit-shortcut-btn:hover {
  background-color: var(--primary-color);
  color: #ffffff;
}

/* ========================================================
   V7.0 新增: 主管快速核准栏与法定声明金句下拉
======================================================== */
.manager-quick-approval-toolbar {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px;
  background-color: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 6px;
}

.approval-prompt {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted);
}

.btn-xs {
  padding: 2px 7px;
  font-size: 11px;
  border-radius: 4px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
}

.snippet-dropdown-wrapper {
  position: relative;
  display: inline-block;
}

.snippet-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 310px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15);
  padding: 6px;
  z-index: 50;
  animation: fadeInDown 0.15s ease;
}

.snippet-dropdown-wrapper.open .snippet-dropdown-menu {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.snippet-item {
  padding: 8px 10px;
  border-radius: 5px;
  font-size: 12px;
  color: var(--text-main);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.15s ease;
}

.snippet-item:hover {
  background-color: var(--primary-light);
  color: var(--primary-color);
}

/* ========================================================
   V7.0 新增: 管理者驾驶舱大盘卡片与图表
======================================================== */
.cockpit-metric-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}

.cockpit-card {
  background-color: var(--bg-app);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 16px;
  position: relative;
  overflow: hidden;
}

.cockpit-card-icon {
  font-size: 24px;
  margin-bottom: 8px;
}

.cockpit-card-val {
  font-size: 28px;
  font-weight: 800;
  line-height: 1.1;
  color: var(--text-main);
}

.cockpit-card-lbl {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 4px;
}

.cockpit-card-sub {
  font-size: 11px;
  color: #94a3b8;
  margin-top: 2px;
}

.cockpit-progress-section {
  background-color: var(--bg-app);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 20px;
}

.progress-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.progress-title-row h4 {
  font-size: 14px;
  font-weight: 700;
  margin: 0;
  color: var(--text-main);
}

.cockpit-bars-wrapper {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cockpit-bar-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.bar-label {
  width: 110px;
  font-size: 12.5px;
  font-weight: 600;
}

.cockpit-track {
  flex: 1;
  height: 12px;
  background-color: var(--border-color);
  border-radius: 6px;
  overflow: hidden;
}

.cockpit-fill {
  height: 100%;
  border-radius: 6px;
  transition: width 0.4s ease;
}

.bar-val {
  width: 50px;
  font-size: 12.5px;
  font-weight: 700;
  text-align: right;
}

.cockpit-team-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.cockpit-sub-card {
  background-color: var(--bg-app);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 14px;
}

.cockpit-sub-card h4 {
  font-size: 13.5px;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text-main);
}

.cockpit-team-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cockpit-team-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 12px;
}

.cockpit-risk-summary {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.risk-line {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-main);
}

.risk-badge {
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10.5px;
  font-weight: 700;
}

.risk-badge.badge-danger { background-color: #fee2e2; color: #b91c1c; }
.risk-badge.badge-warning { background-color: #fef3c7; color: #b45309; }
.risk-badge.badge-info { background-color: #e0f2fe; color: #0284c7; }

/* ========================================================
   V7.0 新增: 快捷键指南模态框
======================================================== */
.shortcuts-table {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.shortcut-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  background-color: var(--bg-app);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 13px;
}

.shortcut-row kbd {
  background-color: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
  color: #334155;
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 7px;
}

.shortcut-row span {
  flex: 1;
  color: var(--text-main);
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ========================================================
   主题适配: 护眼暖黄 & 暗夜极客对新组件的支持
======================================================== */
body[data-theme="eyecare"] .project-status-deadline-bar,
body[data-theme="eyecare"] .cockpit-card,
body[data-theme="eyecare"] .cockpit-progress-section,
body[data-theme="eyecare"] .cockpit-sub-card {
  background-color: #fdfbf7;
  border-color: #e7dfd5;
}

body[data-theme="dark"] .project-status-deadline-bar,
body[data-theme="dark"] .cockpit-card,
body[data-theme="dark"] .cockpit-progress-section,
body[data-theme="dark"] .cockpit-sub-card {
  background-color: #1e293b;
  border-color: #334155;
  color: #f1f5f9;
}

body[data-theme="dark"] .cockpit-card-val,
body[data-theme="dark"] .progress-title-row h4,
body[data-theme="dark"] .cockpit-sub-card h4 {
  color: #f8fafc;
}

body[data-theme="dark"] .nav-dropdown-menu,
body[data-theme="dark"] .snippet-dropdown-menu {
  background-color: #1e293b;
  border-color: #334155;
}

body[data-theme="dark"] .nav-dropdown-item:hover,
body[data-theme="dark"] .snippet-item:hover {
  background-color: #334155;
}

body[data-theme="dark"] .nav-dropdown-item div strong,
body[data-theme="dark"] .snippet-item,
body[data-theme="dark"] .status-pill {
  color: #f1f5f9;
  background-color: #0f172a;
  border-color: #334155;
}

/* 工作区高度自适应调整 (扣除 header 64px + status bar 38px) */
.workspace-layout {
  height: calc(100vh - 102px);
}

.top-navbar .logo-area { flex-wrap: wrap; min-width: 0; width: 100%; padding: 8px 0; }
.top-navbar .header-actions { flex-wrap: wrap; gap: 6px; }
.workspace-layout { height: auto; min-height: 0; }
.mobile-workspace-tabs { display: none; }
[role="button"]:focus-visible, button:focus-visible, select:focus-visible {
  outline: 3px solid var(--primary-color, #2563eb); outline-offset: 2px;
}
.compact-tools-toggle { order: -1; }
.editor-toolbar { height: auto; min-height: 50px; flex-shrink: 0; flex-wrap: wrap; gap: 8px; padding: 8px 12px; }
.editor-toolbar .toolbar-actions { flex-wrap: wrap; gap: 6px; }
.editor-toolbar .toolbar-actions > *, .editor-toolbar .view-switch-tabs { flex-shrink: 0; }
.editor-toolbar button, .editor-toolbar select, .view-tab { white-space: nowrap; }
.editor-toolbar .active-section-meta { min-width: 0; }
.editor-toolbar #activeSectionTitle { max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.formatting-toolbar { flex-shrink: 0; }
.editor-body { overflow-x: hidden; }
.formatting-toolbar:not(.show-all-tools) > :nth-child(n+6) { display: none; }
.formatting-toolbar.show-all-tools { height: auto; min-height: 36px; flex-wrap: wrap; }
.focus-project-menu { display: none; }
.archive-hash { overflow-wrap: anywhere; font-size: 12px; }
.page-break { border-top: 1px dashed #94a3b8; color: #64748b; text-align: center; font-size: 11px; break-after: page; }
.format-warning { color: #92400e; background: #fffbeb; padding: 8px; }
#sectionAssignmentControl { gap: 4px; font-size: 12px; align-items: center; }
@media (max-width: 1000px) {
  .mobile-workspace-tabs { display: flex; flex-shrink: 0; gap: 8px; padding: 6px 12px; background: var(--bg-app); }
  .mobile-workspace-tabs button { flex: 1; padding: 8px; border: 1px solid var(--border-color); border-radius: 6px; background: var(--bg-panel, white); color: var(--text-main); }
  .workspace-layout > .sidebar-tree, .workspace-layout > .editor-container, .workspace-layout > .audit-drawer { display: none; }
  .workspace-layout[data-mobile-view="chapters"] > .sidebar-tree,
  .workspace-layout[data-mobile-view="editor"] > .editor-container,
  .workspace-layout[data-mobile-view="audit"] > .audit-drawer { display: flex; width: 100%; min-width: 0; flex: 1; border: 0; }
  .top-navbar { padding: 0 8px; max-height: 30vh; overflow-y: auto; }
  .top-navbar .brand-text .subtitle, .project-status-bar .status-pill { display: none; }
  .top-navbar .header-actions { width: 100%; }
  .top-navbar .header-actions > .btn { font-size: 12px; padding: 6px 8px; }
  .editor-toolbar, .formatting-toolbar { height: auto; min-height: 44px; flex-wrap: wrap; }
  .modal-content { max-width: calc(100vw - 20px) !important; max-height: 92vh; overflow: auto; }
  .floating-unfold-btn { display: none !important; }
  .project-selector-wrapper, .entity-selector-wrapper { max-width: calc(100vw - 24px); }
  .project-selector-wrapper select, .entity-selector-wrapper select { min-width: 0; max-width: 65vw; }
  .top-navbar { max-height: 104px; }
  .top-navbar .brand-text, .top-navbar .org-selector-wrapper,
  .top-navbar .theme-switcher-group, .top-navbar #btnShortcutsHelp { display: none; }
  .top-navbar .logo-area { gap: 4px; padding: 4px 0; }
  .top-navbar .header-actions { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 3px; }
  .top-navbar .header-actions > * { flex-shrink: 0; }
  .nav-dropdown-menu { position: fixed; top: 104px; left: 8px; right: 8px; width: auto; max-height: 65vh; overflow-y: auto; }
  .project-status-deadline-bar { min-height: 30px; height: 30px; overflow-x: auto; }
  .project-status-deadline-bar .status-bar-left { display: none; }
  .editor-toolbar { padding: 6px 8px; gap: 4px; flex-shrink: 0; }
  .editor-toolbar .active-section-meta { flex-wrap: nowrap !important; width: 100%; overflow-x: auto; }
  .editor-toolbar .active-section-meta > * { flex-shrink: 0; }
  .editor-toolbar .active-section-meta h2 { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
  .editor-toolbar .toolbar-actions { width: 100%; justify-content: flex-end; flex-wrap: wrap; gap: 4px; }
  .editor-toolbar .word-counter, .editor-toolbar #btnZenMode { display: none; }
  .editor-toolbar .view-switch-tabs { display: flex; width: 100%; }
  .editor-toolbar .view-switch-tabs .view-tab { flex: 1; min-width: 0; min-height: 44px; }
  .formatting-toolbar { flex-shrink: 0; padding: 4px 8px; min-height: 34px; gap: 4px; }
  .formatting-toolbar:not(.show-all-tools) { flex-wrap: nowrap; overflow-x: auto; }
  .formatting-toolbar > * { flex-shrink: 0; }
  .formatting-toolbar.show-all-tools { max-height: 180px; overflow-y: auto; }
  .snippet-dropdown-menu { position: fixed; left: 8px; right: 8px; top: 35vh; bottom: auto; width: auto; max-height: 50vh; overflow-y: auto; }
  .editor-body { min-height: 0; flex: 1; }
  #sectionContentEditor { min-height: 0; padding: 12px; }
  body.editing-focus .top-navbar, body.editing-focus .project-status-deadline-bar { display: none; }
  body.editing-focus .editor-toolbar .active-section-meta { display: none !important; }
  body.editing-focus .editor-toolbar .toolbar-actions { flex-wrap: nowrap; }
  body.editing-focus .manager-quick-approval-toolbar { display: none !important; }
  body.editing-focus .focus-project-menu { display: block; }
}

/* ========================================================
   V8.0 新增: 多视角易用性与人体工程学设计
======================================================== */

/* 1. 保密等级感知胶囊 */
.confidentiality-pill {
  background-color: #fee2e2;
  border-color: #fca5a5;
  color: #991b1b;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.confidentiality-pill:hover {
  background-color: #fecaca;
  box-shadow: 0 1px 4px rgba(220, 38, 38, 0.2);
}

/* 2. 沉浸专注编标模式 (Zen Writing Mode) */
.editor-container.zen-mode {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  z-index: 1000 !important;
  background-color: var(--bg-card) !important;
  padding: 24px 60px !important;
  display: flex !important;
  flex-direction: column !important;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.25) !important;
  animation: fadeIn 0.2s ease-in-out;
}

.editor-container.zen-mode .editor-toolbar {
  max-width: 980px;
  width: 100%;
  margin: 0 auto 12px auto;
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 10px;
}

.editor-container.zen-mode .editor-body {
  max-width: 980px;
  width: 100%;
  margin: 0 auto;
  flex: 1;
}

.editor-container.zen-mode #sectionContentEditor {
  font-size: 15.5px;
  line-height: 1.85;
  padding: 30px;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  border: 1px solid var(--border-color);
}

.editor-container.zen-mode .floating-unfold-btn {
  display: none !important;
}

/* 3. 投标报价金额与中文大写换算器 */
.price-convert-result-card {
  background: var(--bg-app);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 14px 18px;
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.price-convert-result-card .result-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13.5px;
}

.price-format-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}

.price-format-options .radio-label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12.5px;
  cursor: pointer;
  padding: 8px 12px;
  border-radius: 6px;
  background: var(--bg-app);
  border: 1px solid var(--border-color);
  transition: all 0.2s;
}

.price-format-options .radio-label:hover {
  border-color: var(--primary-color);
  background-color: var(--primary-light);
}

/* 4. Word 页眉文字示意 */
#confidentialityModal .form-control {
  min-height: 44px;
}

.watermark-preview-box {
  position: relative;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 20px;
  margin-top: 14px;
  background: #ffffff;
  overflow: hidden;
  min-height: 140px;
}

.watermark-preview-content h4 {
  font-size: 14px;
  color: var(--text-main);
  margin-bottom: 8px;
}

.watermark-preview-content p {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.6;
}

.watermark-preview-overlay {
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-color);
  text-align: right;
  overflow-wrap: anywhere;
  font-size: 9pt;
  font-weight: 400;
  color: #a0a0a0;
  pointer-events: none;
  user-select: none;
}

/* 5. 章节审阅留言与批注流 (Comment Thread) */
.comments-panel-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  gap: 12px;
}

.comments-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-color);
}

.comment-list-wrapper {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: calc(100vh - 380px);
  overflow-y: auto;
  padding-right: 4px;
}

.comment-item-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: all 0.2s;
}

.comment-item-card.resolved {
  opacity: 0.65;
  background: var(--bg-app);
}

.comment-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
}

.comment-user-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  color: var(--text-main);
}

.comment-content-text {
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text-main);
  white-space: pre-wrap;
}

.comment-actions-row {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 4px;
}

.comment-input-area {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--border-color);
}

.comment-input-area textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 12px;
  resize: vertical;
  outline: none;
  background: var(--bg-card);
  color: var(--text-main);
}

.comment-input-area textarea:focus {
  border-color: var(--primary-color);
}

/* 主题适配 */
body[data-theme="dark"] .confidentiality-pill {
  background-color: #450a0a;
  border-color: #7f1d1d;
  color: #fca5a5;
}

body[data-theme="dark"] .price-convert-result-card,
body[data-theme="dark"] .price-format-options .radio-label,
body[data-theme="dark"] .comment-item-card {
  background-color: #1e293b;
  border-color: #334155;
  color: #f1f5f9;
}

body[data-theme="dark"] .watermark-preview-box {
  background-color: #0f172a;
  border-color: #334155;
}

body[data-theme="dark"] .comment-input-area textarea {
  background-color: #1e293b;
  border-color: #334155;
  color: #f1f5f9;
}

/* ========================================================
   多视角全面落地 V9.0: 编制人查找替换、管理者工作台、资质雷达与装订封包
   ======================================================== */

/* 1. 编制人视角: 内联查找与替换栏 */
.find-replace-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-top: none;
  padding: 8px 14px;
  border-radius: 0 0 6px 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  animation: slideDownFade 0.2s ease-out;
  margin-bottom: 8px;
}

@keyframes slideDownFade {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.find-replace-group {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-input, #f8fafc);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 2px 6px;
}

.find-icon, .replace-icon {
  color: var(--text-muted);
  font-size: 13px;
  padding: 0 4px;
}

.find-input {
  border: none;
  background: transparent;
  outline: none;
  font-size: 13px;
  padding: 4px 6px;
  width: 170px;
  color: var(--text-main);
}

.find-count-badge {
  font-size: 11px;
  background-color: var(--border-color);
  color: var(--text-muted);
  padding: 2px 6px;
  border-radius: 10px;
  font-family: monospace;
  white-space: nowrap;
}

.btn-find-nav, .btn-replace, .btn-find-close {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  color: var(--text-main);
  transition: all 0.15s ease;
}

.btn-find-nav:hover, .btn-replace:hover {
  background-color: var(--bg-hover, #e2e8f0);
}

.btn-replace {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  font-weight: 500;
}

.btn-find-close {
  margin-left: auto;
  color: var(--text-muted);
}
.btn-find-close:hover {
  color: var(--color-danger, #ef4444);
}

/* 2. 管理者视角: 标书多项目工作台 */
.workbench-kpi-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.workbench-kpi-bar .kpi-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}

.workbench-kpi-bar .kpi-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.workbench-kpi-bar .kpi-val {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-main);
}

.workbench-filter-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.workbench-table-wrapper {
  max-height: 480px;
  overflow-y: auto;
  border: 1px solid var(--border-color);
  border-radius: 8px;
}

.workbench-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.workbench-table th {
  background-color: var(--bg-body, #f8fafc);
  position: sticky;
  top: 0;
  z-index: 2;
  font-weight: 600;
  padding: 10px 14px;
  border-bottom: 2px solid var(--border-color);
  text-align: left;
}

.workbench-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}

.workbench-table tr:hover td {
  background-color: var(--bg-hover, #f1f5f9);
}

.wb-progress-track {
  width: 100%;
  height: 8px;
  background-color: #e2e8f0;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 4px;
}

.wb-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #10b981);
  border-radius: 4px;
  transition: width 0.3s ease;
}

/* 3. 投标人视角: 资质业绩吻合雷达 */
.radar-score-banner {
  background: linear-gradient(135deg, #1e3a8a, #3b82f6);
  color: #fff;
  border-radius: 10px;
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.radar-score-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.radar-score-left h4 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.radar-score-circle {
  font-size: 32px;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.15);
  padding: 6px 18px;
  border-radius: 30px;
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.radar-section-title {
  font-size: 14px;
  font-weight: 700;
  margin: 16px 0 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-main);
}

.radar-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.radar-item-card {
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 10px 14px;
  background-color: var(--bg-card);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.radar-item-card.passed {
  border-left: 4px solid #10b981;
}

.radar-item-card.gap {
  border-left: 4px solid #ef4444;
  background-color: #fef2f2;
}

.radar-alt-box {
  background-color: #f0fdf4;
  border: 1px dashed #86efac;
  border-radius: 8px;
  padding: 12px 16px;
  margin-top: 14px;
}

/* 4. 投标人视角: 开标封包与装订签条 */
.packaging-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(360px, 100%), 1fr));
  gap: 16px;
  margin-top: 12px;
}

.packaging-card {
  border: 1px solid var(--border-color);
  border-radius: 10px;
  background-color: var(--bg-card);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}

.packaging-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 700;
  font-size: 14px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 8px;
}

.envelope-box {
  background-color: #fffbeb;
  border: 1px dashed #f59e0b;
  border-radius: 6px;
  padding: 12px;
  font-family: 'SimSun', serif, monospace;
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
  color: #78350f;
  position: relative;
}

.sealing-strip-box {
  background-color: #fee2e2;
  border: 2px solid #ef4444;
  border-radius: 6px;
  padding: 10px 14px;
  font-family: 'SimSun', serif, monospace;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
  text-align: center;
  color: #991b1b;
  white-space: pre-wrap;
  letter-spacing: 2px;
  position: relative;
}

.sealing-strip-box::after {
  content: "（签章要求待按本项目文件确认）";
  display: block;
  font-size: 11px;
  font-weight: normal;
  letter-spacing: normal;
  color: #b91c1c;
  margin-top: 4px;
}

/* 暗色主题适配 */
body[data-theme="dark"] .find-replace-bar {
  background-color: #1e293b;
  border-color: #334155;
}
body[data-theme="dark"] .find-replace-group {
  background-color: #0f172a;
  border-color: #334155;
}
body[data-theme="dark"] .workbench-table th {
  background-color: #1e293b;
  border-color: #334155;
}
body[data-theme="dark"] .workbench-table td {
  border-color: #334155;
}
body[data-theme="dark"] .radar-item-card.gap {
  background-color: #451a1a;
  border-color: #7f1d1d;
}
body[data-theme="dark"] .radar-alt-box {
  background-color: #064e3b;
  border-color: #059669;
}
body[data-theme="dark"] .envelope-box {
  background-color: #451a03;
  border-color: #d97706;
  color: #fef3c7;
}
body[data-theme="dark"] .sealing-strip-box {
  background-color: #450a0a;
  border-color: #dc2626;
  color: #fca5a5;
}

/* ========================================================
   多视角可用性与易用性优化 V10.0: 字号缩放、大纲随动、里程碑看板、交接单、保函测算与联合体
   ======================================================== */

/* 1. 字号缩放器与打字机聚焦模式 */
.font-zoom-group {
  display: inline-flex;
  align-items: center;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  overflow: hidden;
}

.font-zoom-btn {
  border: none;
  background: transparent;
  padding: 4px 8px;
  cursor: pointer;
  font-weight: bold;
  color: var(--text-main);
  transition: background 0.15s ease;
}

.font-zoom-btn:hover {
  background-color: var(--bg-hover, #e2e8f0);
}

.font-size-badge {
  font-size: 11px;
  font-family: monospace;
  padding: 2px 6px;
  color: var(--text-muted);
  user-select: none;
  background: var(--bg-app);
}

.typewriter-mode #sectionContentEditor {
  line-height: 2.2 !important;
  background: linear-gradient(rgba(59, 130, 246, 0.03) 0%, rgba(59, 130, 246, 0.03) 100%);
  border-color: #3b82f6 !important;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

/* 2. 章节内标题大纲悬浮抽屉 */
.section-outline-popover {
  position: absolute;
  top: 10px;
  right: 14px;
  width: 280px;
  max-height: 480px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  z-index: 10;
  display: flex;
  flex-direction: column;
  animation: fadeInRight 0.2s ease-out;
}

@keyframes fadeInRight {
  from { opacity: 0; transform: translateX(10px); }
  to { opacity: 1; transform: translateX(0); }
}

.outline-popover-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-color);
  background-color: var(--bg-app);
  border-radius: 8px 8px 0 0;
}

.btn-outline-close {
  background: transparent;
  border: none;
  font-size: 16px;
  cursor: pointer;
  color: var(--text-muted);
}
.btn-outline-close:hover {
  color: var(--color-danger, #ef4444);
}

.outline-popover-body {
  padding: 10px 12px;
  overflow-y: auto;
  max-height: 400px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.outline-item {
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 12.5px;
  cursor: pointer;
  color: var(--text-main);
  transition: all 0.15s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.outline-item:hover {
  background-color: var(--bg-hover, #f1f5f9);
  color: var(--color-primary, #2563eb);
}

.outline-item.h2 { font-weight: 700; padding-left: 8px; border-left: 3px solid #3b82f6; }
.outline-item.h3 { padding-left: 18px; color: var(--text-main); }
.outline-item.h4 { padding-left: 28px; color: var(--text-muted); font-size: 11.5px; }

/* 3. 倒排里程碑时间轴 */
.milestones-kpi-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.milestones-timeline {
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
  padding-left: 20px;
}

.milestones-timeline::before {
  content: "";
  position: absolute;
  top: 10px;
  bottom: 10px;
  left: 31px;
  width: 2px;
  background: #e2e8f0;
}

.milestone-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  position: relative;
}

.milestone-dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: bold;
  color: white;
  background: #94a3b8;
  z-index: 2;
  flex-shrink: 0;
  margin-top: 6px;
}

.milestone-dot.completed { background: #10b981; }
.milestone-dot.warning { background: #ef4444; }
.milestone-dot.in_progress { background: #3b82f6; }

.milestone-card {
  flex: 1;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 12px 16px;
  background: var(--bg-card);
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}

/* 4. 现场交接凭证与核验单 */
.manifest-container {
  border: 2px solid #334155;
  border-radius: 8px;
  padding: 20px 24px;
  background: #fff;
  color: #1e293b;
  font-family: 'SimSun', 'Songti SC', serif;
}

.manifest-title-box {
  text-align: center;
  border-bottom: 2px solid #334155;
  padding-bottom: 12px;
  margin-bottom: 16px;
}

.manifest-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 16px;
  font-size: 13.5px;
  margin-bottom: 16px;
  padding: 10px 14px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
}

.manifest-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin-bottom: 20px;
}

.manifest-table th, .manifest-table td {
  border: 1px solid #cbd5e1;
  padding: 8px 10px;
}

.manifest-table th {
  background: #f1f5f9;
  font-weight: 700;
}

.manifest-signatures {
  display: flex;
  justify-content: space-between;
  margin-top: 30px;
  padding-top: 14px;
  border-top: 1px dashed #cbd5e1;
  font-size: 14px;
}

/* 5. 投标保证金与保函方案对比卡片 */
.bond-compare-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 14px;
}

.bond-solution-card {
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 16px;
  background: var(--bg-card);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.bond-solution-card.cash-card {
  border-top: 4px solid #f59e0b;
}

.bond-solution-card.guarantee-card {
  border-top: 4px solid #10b981;
  background: linear-gradient(180deg, rgba(16, 185, 129, 0.04) 0%, transparent 100%);
}

.bond-savings-banner {
  background: linear-gradient(135deg, #065f46, #059669);
  color: white;
  border-radius: 8px;
  padding: 12px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 14px;
}

/* 6. 快照差异比对 */
.diff-line-added {
  background-color: #dcfce7;
  color: #166534;
  padding: 2px 6px;
  border-left: 3px solid #22c55e;
  margin: 1px 0;
}

.diff-line-removed {
  background-color: #fee2e2;
  color: #991b1b;
  padding: 2px 6px;
  border-left: 3px solid #ef4444;
  margin: 1px 0;
  text-decoration: line-through;
}

.diff-line-unchanged {
  color: #64748b;
  padding: 1px 6px;
}

/* ==========================================
   多视角可用性与易用性增强 V11.0 CSS 样式
   ========================================== */

/* 1. 法定偏离表与声明函模版卡片 */
.template-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 16px;
  max-height: 520px;
  overflow-y: auto;
  padding: 4px;
}

.template-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.2s ease;
}

.template-card:hover {
  border-color: var(--primary-color);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.template-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.template-preview-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 10px;
  font-family: monospace;
  font-size: 11.5px;
  max-height: 140px;
  overflow-y: auto;
  white-space: pre-wrap;
  color: #334155;
  margin: 10px 0;
}

/* 2. 敏感词违禁词排查卡片 */
.sensitive-findings-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 480px;
  overflow-y: auto;
}

.sensitive-finding-item {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
}

.sensitive-finding-item.sev-critical {
  border-left: 4px solid #ef4444;
}

.sensitive-finding-item.sev-high {
  border-left: 4px solid #f97316;
}

.sensitive-finding-item.sev-medium {
  border-left: 4px solid #eab308;
}

.finding-snippet {
  font-size: 12.5px;
  background: #f1f5f9;
  padding: 4px 8px;
  border-radius: 4px;
  font-family: monospace;
  color: #1e293b;
  margin: 4px 0;
}

.finding-snippet-word {
  background: #fecaca;
  color: #991b1b;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 3px;
}

/* 3. 专家模拟打分卡与胜算分析 */
.scorecard-hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(135deg, #1e293b, #0f172a);
  color: white;
  border-radius: 10px;
  padding: 18px 24px;
  margin-bottom: 16px;
}

.scorecard-total-box {
  text-align: right;
}

.scorecard-big-num {
  font-size: 38px;
  font-weight: 800;
  color: #38bdf8;
  line-height: 1;
}

.score-dimension-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 10px;
}

.score-progress-track {
  height: 8px;
  background: #e2e8f0;
  border-radius: 4px;
  overflow: hidden;
  margin-top: 6px;
}

.score-progress-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.4s ease;
}

/* 4. 团队协作工时效能 */
.workload-overview-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.workload-stat-tile {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 12px;
  text-align: center;
}

.workload-stat-num {
  font-size: 24px;
  font-weight: 700;
  color: var(--primary-color);
}

.workload-member-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 14px 18px;
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* 5. 标前决策评估漏斗 */
.decision-banner {
  border-radius: 10px;
  padding: 18px 22px;
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.decision-banner.verdict-strong {
  background: linear-gradient(135deg, #059669, #10b981);
}

.decision-banner.verdict-cond {
  background: linear-gradient(135deg, #0284c7, #38bdf8);
}

.decision-banner.verdict-nogo {
  background: linear-gradient(135deg, #dc2626, #f87171);
}

.decision-breakdown-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
}

.decision-breakdown-table th,
.decision-breakdown-table td {
  padding: 10px 14px;
  border: 1px solid var(--border-color);
  font-size: 13px;
}

.decision-breakdown-table th {
  background: var(--bg-app);
}

/* 6. 标后复盘 */
.post-mortem-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 16px;
}

#printChecklistDocument { display: none; }

/* Progressive workspace keeps the canvas for writing and opens other jobs on demand. */
.workspace-brand { min-width: 0; max-width: 36%; }
.workspace-brand > span { min-width: 0; }
.workspace-brand [data-site-name] { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 750; }
[hidden] { display: none !important; }
body:not([data-auth-state="authenticated"]) #app { display: none !important; }
.workspace-auth-gate { min-height: 100dvh; display: grid; place-items: center; padding: 24px; background: radial-gradient(ellipse at top, #dbeafe, transparent 65%), var(--bg-app); }
.workspace-auth-card { width: min(440px, 100%); padding: 36px; background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 16px; box-shadow: 0 16px 50px #1e40af0d; text-align: center; }
.workspace-auth-card > i { color: var(--primary-color); font-size: 34px; margin-bottom: 16px; }
.workspace-auth-card p { color: var(--text-muted); line-height: 1.7; margin: 16px 0 24px; }
.workspace-auth-card > div { display: flex; justify-content: center; gap: 8px; }
.progressive-navbar { min-height: 64px; height: 64px; padding: 0 20px; overflow: visible; }
.workspace-brand { display: flex; align-items: center; gap: 12px; font-weight: 750; font-size: 17px; white-space: nowrap; }
.workspace-brand > i { font-size: 25px; color: var(--primary-color); }
.workspace-brand small { display: block; font-size: 11px; font-weight: 400; color: var(--text-muted); margin-top: 2px; }
.workspace-task-nav { display: flex; align-items: center; gap: 8px; min-width: 0; }
.workspace-task-nav .btn { min-height: 40px; white-space: nowrap; }
.workspace-account { max-width: 160px; }
.workspace-account span { overflow: hidden; text-overflow: ellipsis; }
.workspace-layout { min-height: 0; height: auto; flex: 1; }
.sidebar-tree { flex-shrink: 0; width: 270px; }
.section-filter-pills { flex-wrap: wrap; overflow-x: visible; white-space: normal; padding: 8px 0; }
.section-filter-pills .filter-pill { white-space: nowrap; }
.editor-container { min-height: 0; }
.editor-toolbar { min-height: 80px; padding: 10px 16px; gap: 6px 14px; align-content: center; }
.editor-toolbar .active-section-meta { flex: 1 1 100%; gap: 8px; }
.editor-toolbar #activeSectionTitle { max-width: min(46vw, 580px); font-size: 15px; }
.editor-toolbar .toolbar-actions { margin-left: auto; }
.editor-toolbar .view-switch-tabs { margin-right: auto; }
.editor-toolbar #btnSaveSection { min-width: 132px; }
.editor-quick-tools { display: flex; gap: 6px; min-height: 42px; align-items: center; padding: 4px 16px; border-bottom: 1px solid var(--border-color); background: var(--bg-card); flex-shrink: 0; }
.editor-body, .editor-wrapper { min-height: 0; }
#sectionContentEditor { min-height: 0; }
#btnShowAudit { display: none !important; }
.modal { z-index: 10050; padding: 18px; overscroll-behavior: contain; }
.loading-overlay { z-index: 11000; }
.toast-container { z-index: 12000; top: 76px; pointer-events: none; }
.modal > .modal-box, .modal > .modal-content { display: flex; flex-direction: column; max-width: min(1120px, calc(100vw - 36px)); max-height: calc(100dvh - 36px); min-height: 0; border-radius: 12px; background: var(--bg-card); color: var(--text-main); overflow: hidden; }
.modal-header { flex-shrink: 0; gap: 12px; }
.modal-header h2 { font-size: 18px; }
.modal-header .close-btn, .modal-header .modal-close { min-width: 40px; min-height: 40px; flex-shrink: 0; }
.modal-body { min-height: 0; max-height: none; overflow: auto; overscroll-behavior: contain; }
.modal-footer { flex-shrink: 0; flex-wrap: wrap; gap: 8px; }
body.has-workspace-dialog { overflow: hidden; }
.app-container { display: grid; grid-template-columns: 224px minmax(0, 1fr); height: 100dvh; }
.workspace-navigation { display: flex; flex-direction: column; min-width: 0; min-height: 0; padding: 24px 12px 16px; background: var(--bg-card); border-right: 1px solid var(--border-color); overflow-y: auto; }
.workspace-navigation .workspace-brand { display: flex; max-width: none; padding: 0 8px 24px; font-size: 17px; }
.workspace-navigation .workspace-brand small { display: block; }
.workspace-navigation nav { display: flex; flex-direction: column; gap: 6px; }
.workspace-navigation nav button { width: 100%; min-height: 46px; display: flex; align-items: center; gap: 11px; padding: 10px 12px; border: 0; border-left: 3px solid transparent; border-radius: 6px; text-align: left; color: var(--text-muted); background: transparent; font: inherit; font-size: 14px; cursor: pointer; }
.workspace-navigation nav button i { width: 18px; text-align: center; flex-shrink: 0; }
.workspace-navigation nav button:hover { background: var(--bg-app); color: var(--text-main); }
.workspace-navigation nav button[aria-current="page"] { background: var(--primary-light); color: var(--primary-color); border-left-color: var(--primary-color); font-weight: 700; }
.workspace-navigation-context { display: flex; flex-direction: column; gap: 9px; margin-top: auto; padding: 24px 12px 0; font-size: 12px; color: var(--text-muted); overflow-wrap: anywhere; }
.workspace-navigation-context a { color: var(--primary-color); padding: 10px 0; }
.workspace-main-column { display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow: hidden; }
.workspace-main-column .progressive-navbar { background: var(--bg-card); min-height: 64px; height: 64px; max-height: none; box-shadow: none; gap: 12px; flex-shrink: 0; }
.workspace-top-context { display: flex; align-items: baseline; gap: 18px; min-width: 0; }
.workspace-top-context strong { font-size: 15px; white-space: nowrap; }
.workspace-top-context > span { font-size: 12px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 42vw; }
.workspace-top-account { margin-left: auto; }
.workspace-top-account .workspace-account { min-height: 44px; max-width: 150px; }
.workspace-navigation-toggle, .workspace-navigation-close, .workspace-navigation-backdrop { display: none; }
.workspace-page-host { min-width: 0; min-height: 0; flex: 1; overflow: hidden; }
.workspace-page { height: 100%; padding: 24px; overflow: auto; overscroll-behavior: contain; }
.workspace-page-inner { max-width: 1200px; margin: 0 auto; }
.workspace-page .modal-body { padding: 0; overflow: visible; }
.workspace-page-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.workspace-page-heading h1 { font-size: 25px; line-height: 1.4; font-weight: 750; margin: 3px 0 8px; outline: none; }
.workspace-page-heading p { color: var(--text-muted); font-size: 13px; line-height: 1.7; }
.workspace-page-heading .workspace-eyebrow { font-size: 12px; letter-spacing: .03em; color: var(--primary-color); }
.workspace-page-heading > .btn { flex-shrink: 0; min-height: 44px; }
.workspace-page .workspace-action-grid { margin-bottom: 20px; }
.workspace-page .workspace-action-grid .btn { background: var(--bg-card); }
.workspace-page .workspace-action-grid .btn-primary { background: var(--primary-color); }
.workspace-page .workspace-action-grid .btn-success { background: var(--success-color); }
.workspace-editor-page { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.workspace-editor-page > .workspace-layout { min-height: 0; height: auto; flex: 1; }
.workspace-editor-page .editor-container { min-width: 0; }
.workspace-editor-page .sidebar-tree { width: 252px; }
.workspace-editor-page .sidebar-tree.collapsed { width: 0; }
.workspace-task-list { display: flex; flex-direction: column; gap: 0; border-top: 1px solid var(--border-color); }
.workspace-section-task, .workspace-member-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; width: 100%; min-height: 64px; padding: 14px 16px; border: 0; border-bottom: 1px solid var(--border-color); background: var(--bg-card); text-align: left; color: var(--text-main); font: inherit; font-size: 14px; }
.workspace-section-task { cursor: pointer; }
.workspace-section-task:hover { background: var(--primary-light); }
.workspace-section-task strong { font-size: 14px; overflow-wrap: anywhere; }
.workspace-section-task span, .workspace-member-row span { flex-shrink: 0; font-size: 12px; color: var(--text-muted); }
.workspace-empty-message { padding: 28px 0; color: var(--text-muted); font-size: 14px; line-height: 1.8; }
.workspace-context-section { margin-bottom: 32px; }
.workspace-context-section h2 { font-size: 17px; margin: 0 0 12px; }
.workspace-context-section > p { font-size: 14px; line-height: 1.8; color: var(--text-muted); margin-bottom: 14px; }
.workspace-inline-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.workspace-inline-actions .btn { min-height: 44px; }
.workspace-action-reason { display: block; align-self: center; padding: 4px 8px; font-size: 12px; color: var(--text-muted); line-height: 1.6; overflow-wrap: anywhere; }
.workspace-visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
#toolsWorkspaceModal button.nav-dropdown-item { width: 100%; background: var(--bg-card); color: var(--text-main); font: inherit; text-align: left; cursor: pointer; }
#toolsWorkspaceModal button.nav-dropdown-item:hover { background: var(--primary-light); }
.workspace-navigation button:focus-visible, .workspace-page button:focus-visible, .workspace-main-column .btn:focus-visible { outline: 3px solid var(--border-focus); outline-offset: 2px; }
.workspace-page button:disabled { cursor: not-allowed; opacity: .6; }
.workspace-dialog-return { position: static; min-height: 40px; flex-shrink: 0; background: var(--bg-card); font-size: 12px; }
.workspace-project-selectors { display: grid; gap: 12px; margin-bottom: 20px; }
.workspace-project-selectors > div { max-width: 100%; width: 100%; margin: 0; padding: 12px; display: flex; flex-wrap: wrap; gap: 8px; border: 1px solid var(--border-color); border-radius: 8px; }
.workspace-project-selectors select { min-width: 0; flex: 1; max-width: 100%; }
.workspace-action-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.workspace-action-grid .btn { min-height: 48px; white-space: normal; justify-content: flex-start; text-align: left; }
#projectWorkspaceModal .project-status-deadline-bar { display: flex; flex-direction: column; align-items: stretch; height: auto; min-height: 0; padding: 16px 0 0; margin-top: 20px; gap: 14px; overflow: visible; border-top: 1px solid var(--border-color); box-shadow: none; }
#projectWorkspaceModal .status-bar-left, #projectWorkspaceModal .status-bar-right { display: flex; flex-wrap: wrap; gap: 10px; }
#projectWorkspaceModal .deadline-countdown-widget { white-space: normal; flex-wrap: wrap; }
.workspace-tool-tabs { display: flex; gap: 6px; margin-bottom: 16px; border-bottom: 1px solid var(--border-color); padding-bottom: 10px; }
.workspace-tool-tabs button { min-height: 42px; padding: 8px 14px; border: 0; border-radius: 6px; background: var(--bg-app); color: var(--text-muted); font-weight: 600; }
.workspace-tool-tabs [aria-selected="true"] { background: var(--primary-light); color: var(--primary-color); }
#toolsWorkspaceModal .nav-dropdown { display: block; width: 100%; }
#toolsWorkspaceModal .nav-dropdown-btn { display: none; }
#toolsWorkspaceModal .nav-dropdown-menu { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); position: static; width: 100%; max-height: none; box-shadow: none; border: 0; padding: 0; overflow: visible; gap: 8px; transform: none; opacity: 1; visibility: visible; }
#toolsWorkspaceModal .nav-dropdown-item { border: 1px solid var(--border-color); border-radius: 8px; padding: 14px; min-width: 0; }
#toolsWorkspaceModal .nav-dropdown-item strong, #toolsWorkspaceModal .nav-dropdown-item span { white-space: normal; }
#workspaceSettings { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
#formatWorkspaceModal .formatting-toolbar { display: flex; flex-wrap: wrap; height: auto; max-height: none; border: 0; padding: 0; gap: 8px; overflow: visible; }
#formatWorkspaceModal .formatting-toolbar > * { display: inline-flex; min-height: 40px; }
#formatWorkspaceModal .snippet-dropdown-menu { z-index: 3; }
.workspace-audit-actions { padding: 12px 18px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; border-bottom: 1px solid var(--border-color); font-size: 12px; color: var(--text-muted); }
#auditWorkspaceModal .audit-drawer { width: 100%; min-height: 0; flex: 1; border: 0; overflow: auto; display: flex; }
#auditWorkspaceModal .audit-content { overflow: visible; flex: none; }
#auditWorkspaceModal .drawer-header .pane-toggle-btn { display: none; }
.task-drawer-modal { inset: 0 !important; width: auto !important; height: auto !important; transform: none !important; right: 0 !important; background: #0f172a80; box-shadow: none; }
.task-drawer-modal.open { display: flex; }
.task-drawer-modal .tender-drawer-body { min-height: 0; overflow: auto; }
@media (max-width: 1000px) {
  .progressive-navbar { height: 56px; min-height: 56px; max-height: none; padding: 0 12px; }
  .workspace-brand small { display: none; }
  .workspace-task-nav { gap: 5px; }
  .workspace-task-nav .btn { min-height: 44px; padding: 8px 10px; font-size: 13px; }
  .mobile-workspace-tabs { min-height: 44px; padding: 4px 10px; gap: 6px; }
  .mobile-workspace-tabs button { min-height: 36px; padding: 4px 8px; }
  .mobile-workspace-tabs .focus-project-menu { display: none !important; }
  .editor-toolbar { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); min-height: 84px; padding: 5px 10px; gap: 4px; }
  .editor-toolbar .active-section-meta { grid-column: 1 / -1; }
  .editor-toolbar .view-switch-tabs { grid-column: 1; grid-row: 2; width: auto; margin: 0; }
  .editor-toolbar .view-tab { padding: 6px; }
  .editor-toolbar .view-tab-label-full { display: none; }
  .editor-toolbar .view-tab-label-short { display: inline; }
  .editor-toolbar .active-section-meta { min-height: 30px; flex-wrap: nowrap !important; width: 100%; overflow: hidden; }
  .editor-toolbar .active-section-meta > * { flex-shrink: 1; }
  .editor-toolbar .sec-cat-tag, .editor-toolbar .status-indicator { display: none; }
  .editor-toolbar #activeSectionTitle { flex: 1; max-width: none; min-width: 0; font-size: 13px; }
  .editor-toolbar .collab-status-select { max-width: 132px; padding: 4px 6px; font-size: 11px; }
  .editor-toolbar .toolbar-actions { grid-column: 2; grid-row: 2; flex-wrap: nowrap; min-width: 0; min-height: 44px; width: auto; margin-left: 0; }
  .editor-toolbar #btnSaveSection { min-width: 124px; min-height: 44px; padding: 6px 10px; }
  .editor-toolbar #saveStatus { flex: 1 1 0; min-width: 0; margin-right: 0; font-size: 11px; max-width: 180px; overflow-wrap: anywhere; }
  .editor-toolbar #saveStatus:has(button) { display: flex; flex-direction: column; gap: 2px; }
  .editor-toolbar #saveStatus button { max-width: 100%; min-height: 44px; padding: 2px; font-size: inherit; white-space: normal; overflow-wrap: anywhere; }
  .editor-quick-tools { min-height: 38px; padding: 3px 10px; gap: 4px; }
  .editor-quick-tools .tool-btn { font-size: 12px; padding: 5px 8px; }
  body.editing-focus .progressive-navbar { display: flex; }
  body.editing-focus .mobile-workspace-tabs { display: none; }
  body.editing-focus .editor-toolbar .active-section-meta { display: flex !important; }
  .modal { padding: 8px; }
  .modal > .modal-box, .modal > .modal-content { max-width: calc(100vw - 16px) !important; max-height: calc(100dvh - 16px); width: 100%; }
  .modal-header { padding: 8px 12px; }
  .modal-header h2, .modal-header h3 { font-size: 15px; }
  .modal-body { padding: 12px; }
  .workspace-dialog-return { min-height: 40px; padding: 6px 10px; }
  .workspace-tool-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .workspace-tool-tabs button { font-size: 12px; padding: 6px; }
  #toolsWorkspaceModal .nav-dropdown-menu { grid-template-columns: 1fr; }
  .workspace-audit-actions { padding: 8px 12px; }
  #auditWorkspaceModal .audit-tabs { flex-wrap: wrap; }
  #auditWorkspaceModal .audit-dashboard { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  #auditWorkspaceModal .dash-value { font-size: 18px; }
}
@media (max-width: 600px) {
  .workspace-brand { display: none; }
  .workspace-task-nav { width: 100%; justify-content: space-between; gap: 4px; }
  .workspace-task-nav .btn { flex: 1; padding: 7px 6px; gap: 4px; }
  .workspace-account { max-width: 90px; }
  .workspace-action-grid { grid-template-columns: 1fr; }
}

@media (max-width: 1023px) {
  .app-container { grid-template-columns: minmax(0, 1fr); }
  .workspace-navigation { position: fixed; inset: 0 auto 0 0; z-index: 10010; width: min(288px, calc(100vw - 48px)); transform: translateX(-100%); visibility: hidden; pointer-events: none; padding-top: 18px; transition: transform 160ms ease, visibility 160ms; }
  .navigation-open .workspace-navigation { transform: translateX(0); visibility: visible; pointer-events: auto; }
  .workspace-navigation-toggle { display: inline-flex; align-items: center; justify-content: center; min-width: 72px; min-height: 44px; padding: 8px; }
  .workspace-navigation-close { display: inline-flex; align-items: center; justify-content: space-between; margin-bottom: 14px; min-height: 44px; }
  .workspace-navigation .workspace-brand { padding-bottom: 16px; }
  .workspace-navigation-backdrop { display: block; position: fixed; inset: 0; z-index: 10000; border: 0; background: #0f172a80; cursor: pointer; }
  .workspace-main-column .progressive-navbar { min-height: 60px; height: 60px; max-height: none; padding: 0 10px; gap: 10px; }
  .workspace-top-context { flex-direction: column; align-items: flex-start; gap: 2px; flex: 1; }
  .workspace-top-context strong { font-size: 14px; }
  .workspace-top-context > span { max-width: 42vw; font-size: 11px; }
  .workspace-top-account .workspace-account { max-width: 95px; padding: 8px; }
  .workspace-page { padding: 20px 16px; }
  .workspace-page-heading { gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
  .workspace-page-heading h1 { font-size: 23px; }
  .workspace-page-heading > .btn { min-height: 44px; }
  .workspace-editor-page { padding: 0; }
  .workspace-editor-page .mobile-workspace-tabs { display: flex; flex-shrink: 0; min-height: 44px; }
  .workspace-editor-page .mobile-workspace-tabs button { min-height: 36px; }
  .workspace-editor-page .workspace-layout > .sidebar-tree, .workspace-editor-page .workspace-layout > .editor-container { display: none; }
  .workspace-editor-page .workspace-layout[data-mobile-view="chapters"] > .sidebar-tree,
  .workspace-editor-page .workspace-layout[data-mobile-view="editor"] > .editor-container { display: flex; width: 100%; min-width: 0; flex: 1; border: 0; }
  .workspace-editor-page .editor-toolbar { min-height: 80px; }
  .workspace-editor-page .editor-body { padding: 8px; }
  .workspace-section-task { align-items: flex-start; flex-direction: column; gap: 6px; }
  .workspace-section-task span { flex-shrink: 1; }
  .toast-container { top: 72px; right: 12px; left: 12px; align-items: flex-end; }
  .toast { min-width: 0; max-width: min(400px, 100%); }
  body.editing-focus .workspace-main-column .progressive-navbar { display: flex; }
}
@media (prefers-reduced-motion: reduce) {
  .workspace-navigation { transition: none; }
}

@media print {
  @page { margin: 15mm; }
  body.printing-checklist { height: auto !important; overflow: visible !important; background: white; }
  body.printing-checklist > :not(#printChecklistDocument) { display: none !important; }
  body.printing-checklist #printChecklistDocument {
    display: block !important;
    position: static !important;
    width: auto !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    padding: 0 !important;
    color: #111;
  }
  #printChecklistDocument * {
    max-height: none !important;
    overflow: visible !important;
    position: static !important;
    box-shadow: none !important;
  }
  #printChecklistDocument table { width: 100% !important; }
  #printChecklistDocument tr, #printChecklistDocument .packaging-card { break-inside: avoid; }
  #printChecklistDocument .printed-form-value { white-space: pre-wrap; overflow-wrap: anywhere; }
}





