:root {
  --bg-page: #f3f6fb;
  --bg-panel: #ffffff;
  --bg-soft: #f8fafc;
  --text-main: #0f172a;
  --text-sub: #475569;
  --line: #e2e8f0;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --secondary: #64748b;
  --success-bg: #dcfce7;
  --success-text: #166534;
  --error-bg: #fee2e2;
  --error-text: #b91c1c;
  --info-bg: #e0f2fe;
  --info-text: #075985;
  --radius: 10px;
  --shadow: 0 8px 26px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--text-main);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  background: radial-gradient(ellipse at top, #e9f1ff 0%, var(--bg-page) 38%, var(--bg-page) 100%);
}

#app {
  flex: 1;
}

.site-global-footer {
  margin-top: auto;
  padding: 16px 24px 20px;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
  font-size: 13px;
  color: var(--text-sub);
  text-align: center;
}

.site-global-footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  max-width: 1480px;
  margin: 0 auto;
}

.site-global-footer-line {
  line-height: 1.5;
}

.site-global-footer a {
  color: var(--primary);
  text-decoration: none;
}

.site-global-footer a:hover {
  text-decoration: underline;
}

.app-header {
  background: linear-gradient(90deg, #0b4ea9, #1f67d2);
  color: #fff;
  padding: 18px 24px;
  box-shadow: 0 2px 12px rgba(17, 24, 39, 0.2);
}

.app-header h1 {
  margin: 0;
  font-size: 21px;
  letter-spacing: 0.3px;
}

.container {
  max-width: 1480px;
  margin: 24px auto;
  background: var(--bg-panel);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 16px 20px 20px;
}

.tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 16px;
}

.tab {
  padding: 10px 14px;
  cursor: pointer;
  font-size: 14px;
  color: #334155;
  border-radius: 8px 8px 0 0;
  transition: background 0.18s ease, color 0.18s ease;
}

.tab:hover {
  background: #eff6ff;
}

.tab.active {
  color: #0b4ea9;
  background: #ebf2ff;
  border-bottom: 2px solid #3b82f6;
  font-weight: 600;
}

.form-row {
  display: flex;
  gap: 12px;
}

.form-row.form-row-3 > .form-group {
  flex: 1 1 33.33%;
}

.form-group {
  margin-bottom: 12px;
  flex: 1;
}

.form-group label {
  display: block;
  font-size: 12px;
  color: var(--text-sub);
  margin-bottom: 4px;
  font-weight: 600;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 8px 10px;
  font-size: 13px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  background: #fff;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: #60a5fa;
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.2);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  background: var(--primary);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.18s ease;
}

.btn:hover:not(:disabled) {
  background: var(--primary-hover);
}

.btn-secondary {
  background: var(--secondary);
}

.btn-secondary:hover:not(:disabled) {
  background: #475569;
}

.btn-outline {
  background: #fff;
  color: #334155;
  border-color: #cbd5e1;
}

.btn-outline:hover:not(:disabled) {
  background: #f8fafc;
}

.btn[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
}

.pm-optimize-page .btn:disabled,
.pm-optimize-page .btn[disabled],
.pm-optimize-page .btn.pm-btn-disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
  filter: grayscale(0.2);
  box-shadow: none;
}

.pm-optimize-page .form-group input.pm-readonly-field[readonly] {
  background: #f1f5f9;
  color: #475569;
  cursor: not-allowed;
}

.pm-optimize-page .form-group input.pm-readonly-field[readonly]:focus {
  border-color: #cbd5e1;
  box-shadow: none;
}

.pm-optimize-page #pm-task-tbody tr.pm-task-row-alert {
  background: #fef9c3;
}

.pm-optimize-page #pm-task-tbody tr.pm-task-row-overdue {
  background: #fee2e2;
}

.btn-icon {
  width: 14px;
  height: 14px;
  display: inline-block;
}

.btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

/* 企业/产品检索：区分普通查询与 AI 功能按钮 */
.btn.btn-search-query {
  background: var(--secondary);
  color: #fff;
  border-color: transparent;
}
.btn.btn-search-query:hover:not(:disabled) {
  background: #475569;
}

.btn.btn-ai-analyze {
  background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
  color: #fff;
  border-color: transparent;
}
.btn.btn-ai-analyze:hover:not(:disabled) {
  background: linear-gradient(135deg, #6d28d9 0%, #5b21b6 100%);
}

.btn.btn-ai-news {
  background: linear-gradient(135deg, #0d9488 0%, #0f766e 100%);
  color: #fff;
  border-color: transparent;
}
.btn.btn-ai-news:hover:not(:disabled) {
  background: linear-gradient(135deg, #0f766e 0%, #115e59 100%);
}

.btn.btn-ai-policy {
  background: linear-gradient(135deg, #ea580c 0%, #c2410c 100%);
  color: #fff;
  border-color: transparent;
}
.btn.btn-ai-policy:hover:not(:disabled) {
  background: linear-gradient(135deg, #c2410c 0%, #9a3412 100%);
}

/* 渐变类按钮：禁用时须明显弱化；双选择器 + !important 防止 Preflight/顺序导致 .btn[disabled] 的 opacity 未压住 */
.btn.btn-ai-news[disabled],
.btn.btn-ai-news:disabled,
.btn.btn-ai-news[disabled]:hover,
.btn.btn-ai-news:disabled:hover,
.btn.btn-ai-policy[disabled],
.btn.btn-ai-policy:disabled,
.btn.btn-ai-policy[disabled]:hover,
.btn.btn-ai-policy:disabled:hover {
  opacity: 0.6 !important;
  cursor: not-allowed !important;
  filter: none !important;
  box-shadow: none !important;
}

/* 合作需求管理页：立项渐变按钮禁用态（提高特异性，避免被其它 .btn 规则覆盖） */
#coop-demand-manage-area .btn.btn-ai-news[disabled],
#coop-demand-manage-area .btn.btn-ai-news:disabled,
#coop-demand-manage-area .btn.btn-ai-news[disabled]:hover,
#coop-demand-manage-area .btn.btn-ai-news:disabled:hover,
#coop-demand-manage-area .btn.btn-ai-policy[disabled],
#coop-demand-manage-area .btn.btn-ai-policy:disabled,
#coop-demand-manage-area .btn.btn-ai-policy[disabled]:hover,
#coop-demand-manage-area .btn.btn-ai-policy:disabled:hover {
  opacity: 0.6 !important;
  cursor: not-allowed !important;
  filter: none !important;
  box-shadow: none !important;
}

.btn.btn-batch-add {
  background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
  color: #fff;
  border-color: transparent;
}
.btn.btn-batch-add:hover:not(:disabled) {
  background: linear-gradient(135deg, #15803d 0%, #166534 100%);
}
.btn.btn-batch-template {
  background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
  color: #fff;
  border-color: transparent;
}
.btn.btn-batch-template:hover:not(:disabled) {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
}
.btn.btn-batch-import {
  background: linear-gradient(135deg, #9333ea 0%, #7e22ce 100%);
  color: #fff;
  border-color: transparent;
}
.btn.btn-batch-import:hover:not(:disabled) {
  background: linear-gradient(135deg, #7e22ce 0%, #6b21a8 100%);
}
.btn.btn-batch-add .btn-icon,
.btn.btn-batch-template .btn-icon,
.btn.btn-batch-import .btn-icon {
  filter: brightness(0) invert(1);
}

.btn.btn-policy-new {
  background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
  color: #fff;
  border-color: transparent;
}
.btn.btn-policy-new:hover:not(:disabled) {
  background: linear-gradient(135deg, #15803d 0%, #166534 100%);
}
.btn.btn-policy-save {
  background: var(--primary);
  color: #fff;
  border-color: transparent;
}
.btn.btn-policy-save:hover:not(:disabled) {
  background: var(--primary-hover);
}
.btn.btn-policy-ai {
  background: linear-gradient(135deg, #ea580c 0%, #c2410c 100%);
  color: #fff;
  border-color: transparent;
}
.btn.btn-policy-ai:hover:not(:disabled) {
  background: linear-gradient(135deg, #c2410c 0%, #9a3412 100%);
}
.btn.btn-policy-setting {
  background: #f8fbff;
  color: #1d4ed8;
  border-color: #93c5fd;
}
.btn.btn-policy-setting:hover:not(:disabled) {
  background: #eff6ff;
  border-color: #60a5fa;
}

.policy-tag-multi {
  position: relative;
}
.policy-tag-trigger {
  width: 100%;
  min-height: 36px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  color: #0f172a;
  padding: 6px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
}
.policy-tag-multi.open .policy-tag-trigger,
.policy-tag-trigger:focus {
  outline: none;
  border-color: #60a5fa;
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.2);
}
.policy-tag-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 20px;
}
.policy-tag-placeholder {
  color: #64748b;
  font-size: 13px;
}
.policy-tag-chip {
  display: inline-block;
  font-size: 12px;
  color: #1e3a8a;
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  border-radius: 999px;
  padding: 2px 8px;
}
.policy-tag-arrow {
  font-size: 11px;
  color: #64748b;
  flex: 0 0 auto;
}
.policy-tag-dropdown {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
  padding: 4px 4px 6px;
  display: none;
  z-index: 24;
  max-height: 220px;
  overflow: auto;
}
.policy-tag-multi.open .policy-tag-dropdown {
  display: block;
}
.policy-tag-option {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 6px;
  border-radius: 8px;
  font-size: 13px;
  color: #334155;
  cursor: pointer;
}
.policy-tag-option:hover {
  background: #f8fafc;
}
.policy-tag-option-input {
  margin: 0;
  padding: 0;
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal-card {
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 20px;
  max-width: 560px;
  width: 100%;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}
.modal-card h4 {
  margin-top: 0;
}

.batch-ent-toolbar {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.batch-ent-toolbar .btn {
  flex: 0 0 auto;
  white-space: nowrap;
}
.batch-ent-contacts-modal {
  max-width: 920px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.batch-ent-contacts-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.batch-ent-contacts-modal-head h4 {
  margin: 0;
}
.modal-close-btn {
  border: none;
  background: transparent;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  color: var(--text-sub);
  padding: 4px 8px;
  border-radius: 6px;
}
.modal-close-btn:hover {
  background: var(--line);
  color: var(--text-main);
}
.batch-ent-contacts-table-wrap {
  max-height: min(60vh, 520px);
  overflow: auto;
  margin-bottom: 12px;
}
.batch-ent-contacts-overlay {
  z-index: 1001;
}

.btn-group.search-toolbar-row {
  align-items: center;
}

.search-chain-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 4px;
}
.search-chain-wrap label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-sub);
  white-space: nowrap;
}
.search-chain-select {
  min-width: 96px;
  padding: 7px 10px;
  font-size: 13px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg-panel);
  color: var(--text-main);
}

.btn.btn-search-query .btn-icon,
.btn.btn-ai-policy .btn-icon,
.btn.btn-ai-analyze .btn-icon,
.btn.btn-ai-news .btn-icon {
  filter: brightness(0) invert(1);
}

.card {
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
}

.card h4,
.card h5 {
  margin: 0 0 8px;
}

.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 8px 0;
  gap: 10px;
}

.table-tools {
  display: flex;
  align-items: center;
  gap: 8px;
}

.page-size-select {
  height: 34px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  padding: 0 8px;
  font-size: 12px;
  color: #334155;
}

.column-panel-wrap {
  position: relative;
}

.column-panel {
  position: absolute;
  left: 0;
  top: calc(100% + 6px);
  min-width: 200px;
  max-height: 280px;
  overflow: auto;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
  padding: 8px;
  display: none;
  z-index: 30;
}

.column-panel.open {
  display: block;
}

.column-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #334155;
  padding: 4px 2px;
}

.column-item input {
  margin: 0;
}

.table-count {
  font-size: 12px;
  color: var(--text-sub);
  padding: 4px 10px;
  border-radius: 999px;
  background: #eef2ff;
}

.table-wrapper {
  overflow: auto;
}

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

th,
td {
  padding: 8px;
  border-bottom: 1px solid #e5e7eb;
  text-align: left;
}

th {
  background: #f8fafc;
  font-weight: 600;
}

tr.selected {
  background: #e8f0ff;
}

.split-layout {
  display: flex;
  gap: 16px;
}

.split-left {
  flex: 0 0 60%;
  min-width: 0;
}

.split-right {
  flex: 1;
  min-width: 0;
}

.alert {
  padding: 9px 11px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 8px;
}

.alert-error {
  background: var(--error-bg);
  color: var(--error-text);
}

.alert-success {
  background: var(--success-bg);
  color: var(--success-text);
}

.alert-info {
  background: var(--info-bg);
  color: var(--info-text);
}

.stat-num {
  font-size: 22px;
  font-weight: 800;
  color: #0b4ea9;
}

.simple-list {
  margin: 0;
  padding-left: 18px;
  color: var(--text-sub);
  font-size: 13px;
  line-height: 1.6;
}

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

.data-table th,
.data-table td {
  border: 1px solid var(--line);
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
}

.data-table thead th {
  background: #f8fafc;
  font-weight: 700;
}

.btn-sm {
  padding: 6px 10px;
  font-size: 12px;
  border-radius: 8px;
}

.ai-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #ffffff;
}

.ai-header {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
  background: #f8fafc;
}

.ai-messages {
  flex: 1;
  min-height: 0;
  padding: 12px;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
}

.search-split-layout {
  align-items: flex-start;
}

.search-split-layout .split-left,
.search-split-layout .split-right {
  min-height: 0;
  height: auto;
}

.search-split-layout .split-left,
.search-split-layout .split-right,
.search-split-layout .ai-container,
.search-split-layout .ai-messages,
.search-split-layout .table-wrapper {
  min-height: 0;
}

.search-split-layout .split-right,
.search-split-layout .ai-container {
  display: flex;
  flex-direction: column;
}

.search-split-layout .ai-container {
  min-height: 0;
  overflow: hidden;
}

.search-split-layout .ai-messages {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  word-break: break-word;
  overscroll-behavior: contain;
}

.search-split-layout .ai-input {
  flex: 0 0 auto;
  position: sticky;
  bottom: 0;
  z-index: 2;
  background: #f3f4f6;
}

.search-split-layout .split-left .table-wrapper {
  overflow: visible;
  scrollbar-width: auto;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  background: #fff;
}

.search-split-layout .split-left .table-wrapper thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f3f4f6;
}

.search-split-layout .ai-messages {
  scrollbar-width: none;
}

.search-split-layout .ai-messages::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.search-split-layout .ai-container:hover .ai-messages {
  scrollbar-width: thin;
  scrollbar-color: #c0c4cc transparent;
}

.search-split-layout .ai-container:hover .ai-messages::-webkit-scrollbar {
  width: 8px;
}

.search-split-layout .ai-container:hover .ai-messages::-webkit-scrollbar-thumb {
  background: #c0c4cc;
  border-radius: 6px;
}

.ai-input {
  border-top: 1px solid var(--line);
  padding: 10px;
  background: #f8fafc;
  position: sticky;
  bottom: 0;
  z-index: 2;
}

.ai-input textarea {
  width: 100%;
  min-height: 66px;
  max-height: 160px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  resize: vertical;
  margin-bottom: 6px;
  font-size: 13px;
}

.msg {
  margin-bottom: 12px;
  display: flex;
}

.msg-user {
  justify-content: flex-end;
}

.msg-assistant {
  justify-content: flex-start;
}

.msg-block {
  max-width: 92%;
}

.msg-bubble {
  max-width: 100%;
  padding: 8px 10px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.52;
  word-break: break-word;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

/* Markdown 渲染增强：支持表格/代码块等（气泡内与 .hp-md 通用容器） */
.msg-bubble table,
.hp-md table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid #e5e7eb;
  margin: 8px 0;
  overflow: hidden;
}

.msg-bubble th,
.msg-bubble td,
.hp-md th,
.hp-md td {
  border: 1px solid #e5e7eb;
  padding: 6px 8px;
  vertical-align: top;
}

.msg-bubble th,
.hp-md th {
  background: #f8fafc;
  font-weight: 700;
}

.msg-bubble pre,
.hp-md pre {
  margin: 8px 0;
  padding: 10px 12px;
  background: #0f172a;
  color: #e5e7eb;
  border-radius: 10px;
  overflow-x: auto;
  line-height: 1.45;
}

.msg-bubble pre code,
.hp-md pre code {
  background: transparent;
  padding: 0;
  color: inherit;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.msg-bubble code,
.hp-md code {
  background: #eef2ff;
  padding: 2px 6px;
  border-radius: 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 12px;
}

.msg-bubble hr,
.hp-md hr {
  border: 0;
  border-top: 1px solid #e5e7eb;
  margin: 10px 0;
}

.msg-bubble blockquote,
.hp-md blockquote {
  margin: 8px 0;
  padding: 6px 10px;
  border-left: 3px solid #60a5fa;
  background: #f8fafc;
  border-radius: 8px;
}

.msg-bubble h1,
.msg-bubble h2,
.msg-bubble h3,
.msg-bubble h4,
.msg-bubble h5,
.msg-bubble h6,
.hp-md h1,
.hp-md h2,
.hp-md h3,
.hp-md h4,
.hp-md h5,
.hp-md h6 {
  margin: 8px 0 6px;
  font-weight: 800;
  line-height: 1.3;
}

.msg-bubble h1,
.hp-md h1 {
  font-size: 1.25em;
}
.msg-bubble h2,
.hp-md h2 {
  font-size: 1.14em;
}
.msg-bubble h3,
.hp-md h3 {
  font-size: 1.07em;
}

.msg-bubble ul,
.msg-bubble ol,
.hp-md ul,
.hp-md ol {
  margin: 6px 0 8px;
  padding-left: 1.35em;
}

.msg-bubble li,
.hp-md li {
  margin: 3px 0;
}

.msg-bubble p,
.hp-md p {
  margin: 0 0 8px;
}

.msg-user .msg-bubble {
  background: #2f6ceb;
  color: #fff;
  border-bottom-right-radius: 4px;
}

.msg-assistant .msg-bubble {
  background: #f1f5f9;
  color: #1e293b;
  border-bottom-left-radius: 4px;
}

.msg-actions {
  margin-top: 4px;
  display: flex;
  gap: 6px;
}

.msg-meta-footer {
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 12px;
  color: #64748b;
}

.msg-meta-ref-link {
  border: none;
  padding: 0;
  background: transparent;
  color: #2563eb;
  text-decoration: underline;
  cursor: pointer;
  font-size: 12px;
}

.msg-meta-ref-link:disabled {
  color: #94a3b8;
  text-decoration: none;
  cursor: default;
}

.icon-btn {
  width: 26px;
  height: 26px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.icon-btn img {
  width: 14px;
  height: 14px;
}

.icon-btn:hover {
  background: #f8fafc;
}

.new-msg-tip {
  position: absolute;
  right: 12px;
  top: -36px;
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.new-msg-tip:hover {
  background: #dbeafe;
}

.ai-messages.jump-bottom-flash {
  animation: jumpBottomFlash 0.45s ease-out;
}

@keyframes jumpBottomFlash {
  0% {
    box-shadow: inset 0 0 0 0 rgba(37, 99, 235, 0);
    background-color: transparent;
  }
  35% {
    box-shadow: inset 0 0 0 999px rgba(219, 234, 254, 0.35);
    background-color: rgba(219, 234, 254, 0.25);
  }
  100% {
    box-shadow: inset 0 0 0 0 rgba(37, 99, 235, 0);
    background-color: transparent;
  }
}

.spinner {
  width: 12px;
  height: 12px;
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-top-color: #fff;
  border-radius: 999px;
  animation: spin 0.8s linear infinite;
}

.tabulator .tabulator-col {
  position: relative;
}

.tabulator .tabulator-col-resize {
  position: absolute;
  top: 0;
  right: 0;
  width: 6px;
  height: 100%;
  cursor: col-resize;
}

.tabulator .tabulator-footer {
  border-top: 1px solid #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  background: #f8fafc;
}

.tabulator .tabulator-page-info {
  font-size: 12px;
  color: #475569;
}

.tabulator .tabulator-page-actions {
  display: flex;
  gap: 6px;
}

.tabulator .tabulator-page-actions button {
  border: 1px solid #cbd5e1;
  background: #fff;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 12px;
  color: #334155;
  cursor: pointer;
}

.tabulator .tabulator-page-actions button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

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

.ui-locked .tab[data-tab],
.ui-locked button:not(.new-msg-tip),
.ui-locked .icon-btn {
  pointer-events: none;
}

.ui-locked .new-msg-tip {
  pointer-events: auto;
}

/* AI 气泡旁复制/下载：不受全局 loading 锁点击影响 */
.ui-locked .ai-messages .msg-actions button,
.ui-locked .ai-messages .msg-actions .icon-btn {
  pointer-events: auto;
}

@media (max-width: 1200px) {
  .container {
    margin: 10px;
  }
  .split-layout {
    flex-direction: column;
  }
  .split-left,
  .split-right {
    flex: auto;
  }
}

/* 产品维护页：只读表格 + 编辑弹窗 */
.pp-cell-ellipsis {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pp-type-field {
  width: 100%;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pp-type-field > select,
.pp-type-field > input {
  width: 100%;
  box-sizing: border-box;
}

.pp-type-field > .searchable-select-input {
  margin: 0;
}

.pp-modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.35);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 999;
  padding: 16px;
}

.pp-modal-mask.open {
  display: flex;
}

.pp-modal-dialog {
  width: min(860px, 100%);
  max-height: 90vh;
  overflow: auto;
  background: #fff;
  border-radius: 12px;
  border: 1px solid #dbe3ef;
  box-shadow: 0 14px 40px rgba(15, 23, 42, 0.2);
}

.pp-modal-header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  border-bottom: 1px solid #e5eaf1;
  background: #fff;
}

.pp-modal-body {
  padding: 12px;
}

/* 政策申报详情：仅此处覆盖，避免整窗 .pp-modal-dialog overflow 把滚动条撑到最右侧 */
#policy-apply-modal .pp-modal-dialog,
#policy-approval-modal .pp-modal-dialog {
  display: flex;
  flex-direction: column;
  height: min(90vh, calc(100dvh - 32px));
  min-height: min(70vh, 640px);
  max-height: 90vh;
  overflow: hidden;
}

#policy-apply-modal .pp-modal-header,
#policy-approval-modal .pp-modal-header {
  flex-shrink: 0;
}

#policy-apply-modal .pp-modal-body,
#policy-approval-modal .pp-modal-body {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 12px;
}

#policy-apply-modal .policy-apply-modal-tabs,
#policy-approval-modal .policy-apply-modal-tabs {
  flex-shrink: 0;
}

#policy-apply-modal .content-article,
#policy-approval-modal .content-article {
  flex: 1 1 0;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.policy-detail-tab.active {
  background: var(--primary, #2563eb);
  color: #fff;
  border-color: var(--primary, #2563eb);
}

/* 政策详情弹窗：与 productSearch 智能产品区一致，使用 .ai-messages 负责滚动 */
#policy-apply-modal .ai-messages.policy-apply-detail-scroll,
#policy-approval-modal .ai-messages.policy-apply-detail-scroll {
  flex: 1;
  min-height: 0;
  width: 100%;
  box-sizing: border-box;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  scrollbar-width: none;
}

#policy-apply-modal .policy-apply-detail-scroll::-webkit-scrollbar,
#policy-approval-modal .policy-apply-detail-scroll::-webkit-scrollbar {
  width: 0;
  height: 0;
}

#policy-apply-modal .policy-apply-detail-scroll:hover,
#policy-approval-modal .policy-apply-detail-scroll:hover,
#policy-apply-modal .policy-apply-detail-scroll:focus-within,
#policy-approval-modal .policy-apply-detail-scroll:focus-within {
  scrollbar-width: thin;
  scrollbar-color: rgba(15, 23, 42, 0.35) transparent;
}

#policy-apply-modal .policy-apply-detail-scroll:hover::-webkit-scrollbar,
#policy-approval-modal .policy-apply-detail-scroll:hover::-webkit-scrollbar,
#policy-apply-modal .policy-apply-detail-scroll:focus-within::-webkit-scrollbar,
#policy-approval-modal .policy-apply-detail-scroll:focus-within::-webkit-scrollbar {
  width: 8px;
}

#policy-apply-modal .policy-apply-detail-scroll:hover::-webkit-scrollbar-thumb,
#policy-approval-modal .policy-apply-detail-scroll:hover::-webkit-scrollbar-thumb,
#policy-apply-modal .policy-apply-detail-scroll:focus-within::-webkit-scrollbar-thumb,
#policy-approval-modal .policy-apply-detail-scroll:focus-within::-webkit-scrollbar-thumb {
  background: rgba(15, 23, 42, 0.28);
  border-radius: 4px;
}

#policy-apply-modal .policy-apply-detail-scroll:hover::-webkit-scrollbar-track,
#policy-approval-modal .policy-apply-detail-scroll:hover::-webkit-scrollbar-track,
#policy-apply-modal .policy-apply-detail-scroll:focus-within::-webkit-scrollbar-track,
#policy-approval-modal .policy-apply-detail-scroll:focus-within::-webkit-scrollbar-track {
  background: transparent;
}

/* 政策详情：复制/下载与右侧滚动条错开 */
#policy-apply-modal .policy-apply-detail-scroll .msg-actions,
#policy-approval-modal .policy-apply-detail-scroll .msg-actions {
  padding-right: 10px;
}

/* 聊天区 .msg-block 默认 max-width:92%，详情弹窗内铺满，使滚动条紧贴文本气泡 */
#policy-apply-modal .policy-apply-detail-scroll .msg,
#policy-approval-modal .policy-apply-detail-scroll .msg {
  width: 100%;
  margin-bottom: 0;
}

#policy-apply-modal .policy-apply-detail-scroll .msg-block,
#policy-approval-modal .policy-apply-detail-scroll .msg-block {
  max-width: 100%;
  width: 100%;
}

/* 政策申报跟踪时间线（由 policyTrack 模板使用） */
.policy-track-wrap {
  background: #f6f8fb;
  border: 1px solid #dbe3ef;
  border-radius: 10px;
  padding: 16px;
}
.policy-track-title {
  margin: 0 0 14px;
  color: #243447;
  font-size: 17px;
  font-weight: 700;
}
.policy-track-timeline {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.policy-track-card {
  background: #fff;
  border: 1px solid #d6e0ee;
  border-left: 4px solid #7a92b8;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(36, 52, 71, 0.08);
  padding: 14px 16px;
}
.policy-track-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.policy-track-name {
  margin: 0;
  color: #1f2d3d;
  font-size: 15px;
  font-weight: 700;
}
.policy-track-meta {
  color: #5b6b80;
  font-size: 12px;
  white-space: nowrap;
}
.policy-track-section {
  margin-top: 10px;
}
.policy-track-label {
  margin-bottom: 4px;
  color: #3d4f67;
  font-size: 12px;
  font-weight: 600;
}
.policy-track-md {
  color: #2f3f52;
  font-size: 13px;
  line-height: 1.65;
  max-height: 220px;
  overflow: auto;
  word-break: break-word;
}
.policy-track-md p {
  margin: 0 0 8px;
}
.policy-track-md p:last-child {
  margin-bottom: 0;
}
.policy-track-attachments {
  color: #3d4f67;
  font-size: 13px;
}
.pt-empty {
  color: #8c9aab;
}

/* 门户首页：快捷入口与页脚 */
.panel-accent {
  border-left: 4px solid var(--primary);
}
.quick-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.quick-link {
  display: inline-block;
  padding: 8px 14px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 14px;
  color: var(--primary);
  transition: background 0.15s, border-color 0.15s;
}
.quick-link:hover {
  background: #eff6ff;
  border-color: var(--primary);
}
.stat-num {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--primary);
}
.site-footer {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--text-sub);
}
.site-footer .footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
  align-items: center;
}
.site-footer .footer-links a {
  color: var(--primary);
  text-decoration: none;
}
.site-footer .footer-links a:hover {
  text-decoration: underline;
}
.content-article {
  line-height: 1.65;
}
.content-article p {
  margin: 0.75em 0;
}

/* 项目智配 */
.pm-form-card {
  border-left: 4px solid #165dff;
}
.pm-sections {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}
.pm-card {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 10px;
  background: #fff;
}
.pm-upstream {
  background: #e8f3ff;
}
.pm-downstream {
  background: #e8ffef;
}
.pm-peer {
  background: #fff2e8;
}
.pm-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.pm-tag {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid #cbd5e1;
  background: #fff;
  font-size: 12px;
}
.pm-product-grid {
  display: grid;
  gap: 8px;
}
.pm-product-card {
  background: #fff;
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  padding: 8px;
}
.pm-product-brand {
  font-size: 12px;
  color: #64748b;
}
.pm-product-name {
  font-weight: 600;
  margin: 4px 0;
}
.pm-product-desc {
  font-size: 13px;
  color: #334155;
}
.pm-empty {
  margin: 0;
  color: #64748b;
}
.pm-row-selected {
  background: #eff6ff;
}
.pm-plan-actions-cell {
  white-space: nowrap;
  vertical-align: middle;
}
.pm-plan-row-actions {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
}
.pm-analysis-actions {
  margin-top: 14px;
}
.pm-analysis-mask {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 20px;
}
.pm-match-wait {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  align-items: center;
  justify-content: center;
  z-index: 2100;
  padding: 20px;
}
.pm-match-wait-card {
  background: #fff;
  border-radius: 12px;
  padding: 28px 36px;
  max-width: 420px;
  text-align: center;
  box-shadow: 0 14px 40px rgba(15, 23, 42, 0.3);
  border: 1px solid #e2e8f0;
}
.pm-match-wait-card .pm-match-wait-msg {
  font-size: 15px;
  font-weight: 600;
  color: #0f172a;
  line-height: 1.5;
}
.pm-match-wait-card .pm-match-wait-hint {
  margin-top: 12px;
  font-size: 13px;
  color: #64748b;
}
.pm-analysis-dialog {
  width: min(1100px, 100%);
  max-height: 88vh;
  overflow: auto;
  background: #fff;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 14px 40px rgba(15, 23, 42, 0.3);
}
.pm-analysis-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  background: #fff;
  padding: 10px 12px;
  border-bottom: 1px solid #e2e8f0;
  z-index: 2;
}
.pm-analysis-tools {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
}
.pm-analysis-content {
  min-height: 280px;
  max-height: 60vh;
  overflow: auto;
  padding: 0 12px 12px;
}

.pm-analysis-meta {
  padding: 0 12px 12px;
}

/* 默认低于 .hp-dialog-host(3000)；若需在弹窗之上打开参考资料，见 createReferencePanel 的 zIndex 参数 */
.ref-panel-mask {
  position: fixed;
  inset: 0;
  z-index: 2600;
  background: rgba(15, 23, 42, 0.35);
  display: none;
  justify-content: flex-end;
}

.ref-panel {
  width: min(420px, 90vw);
  height: 100%;
  background: #fff;
  border-left: 1px solid #e2e8f0;
  box-shadow: -6px 0 20px rgba(15, 23, 42, 0.12);
  display: flex;
  flex-direction: column;
}

.ref-panel-header {
  padding: 12px;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ref-panel-close {
  border: 1px solid #cbd5e1;
  background: #fff;
  border-radius: 6px;
  width: 28px;
  height: 28px;
  cursor: pointer;
}

.ref-panel-body {
  padding: 12px;
  overflow: auto;
  color: #334155;
  line-height: 1.7;
  font-size: 13px;
  white-space: normal;
  word-break: break-word;
}

.ref-panel-body a {
  color: #1d4ed8;
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
  transition: color 0.15s ease, text-decoration-thickness 0.15s ease;
}

.ref-panel-body a:visited {
  color: #6d28d9;
}

.ref-panel-body a:hover {
  color: #1e40af;
  text-decoration-thickness: 2px;
}

.ref-panel-body a:active {
  color: #1e3a8a;
}

/* 政策申报 */
.policy-apply-layout .split-left {
  flex: 0 0 60%;
}

/* 政策申报审批：左右分栏宽度与政策申报保持一致 */
.policy-approval-layout .split-left {
  flex: 0 0 60%;
}
.policy-apply-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
}
.policy-apply-tag-item {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  font-size: 12px;
  color: #334155;
}
.policy-apply-summary {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.policy-apply-status {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  background: #e2e8f0;
  color: #334155;
}
.policy-apply-status-draft {
  background: #fef3c7;
  color: #92400e;
}
.policy-apply-status-submitted,
.policy-apply-status-reviewing {
  background: #dbeafe;
  color: #1e40af;
}
.policy-apply-status-approved {
  background: #dcfce7;
  color: #166534;
}
.policy-apply-status-rejected {
  background: #fee2e2;
  color: #991b1b;
}
.policy-fav-btn {
  min-width: 42px;
}
.policy-attach-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 8px 10px;
  margin-bottom: 6px;
}

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

/* 双层导航布局 */
.top-module-tabs {
  background: #f7f9fc;
  border: 1px solid #dbe3ef;
  border-radius: 10px;
  padding: 6px;
  gap: 6px;
}

.top-module-tabs .top-module-tab {
  white-space: nowrap;
  border-radius: 8px;
  border: 1px solid transparent;
}

.top-module-tabs .top-module-tab.active {
  background: #e8eef9;
  color: #1d4e89;
  border-color: #bfd2ef;
}

.module-shell {
  margin-top: 12px;
  display: flex;
  gap: 12px;
  min-height: 760px;
}

.module-sidebar {
  width: 260px;
  flex: 0 0 260px;
  border: 1px solid #d8e1ec;
  border-radius: 12px;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  transition: width 0.2s ease, flex-basis 0.2s ease;
}

.module-sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px;
  border-bottom: 1px solid #e5eaf1;
}

.module-title {
  font-size: 15px;
  font-weight: 700;
  color: #1f3f67;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.module-collapse-btn {
  width: 30px;
  height: 30px;
  border: 1px solid #c7d2e4;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}

.module-submenu-list {
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sub-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 36px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  color: #334155;
  padding: 0 10px;
}

.sub-menu-item .sub-menu-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sub-menu-item .sub-menu-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #8ba0bd;
  flex: 0 0 6px;
}

.sub-menu-item:hover {
  background: #eef3fb;
}

.sub-menu-item.active {
  background: #dde8f8;
  border-color: #bfd2ef;
  color: #1d4e89;
  font-weight: 600;
}

.sub-menu-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 4px;
}

.sub-menu-group-title {
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  padding: 4px 10px 2px;
  letter-spacing: 0.02em;
}

.sub-menu-group-children {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-left: 6px;
  border-left: 2px solid #e2e8f0;
  margin-left: 8px;
}

.sub-menu-item--nested {
  padding-left: 8px;
}

.module-content {
  flex: 1;
  min-width: 0;
  border: 1px solid #dbe3ef;
  border-radius: 12px;
  background: #fff;
  padding: 14px;
}

.module-shell.collapsed .module-sidebar {
  width: 64px;
  flex-basis: 64px;
}

.module-shell.collapsed .module-title,
.module-shell.collapsed .sub-menu-label {
  display: none;
}

.module-shell.collapsed .sub-menu-item {
  justify-content: center;
  padding: 0;
}

.placeholder-page {
  padding: 8px;
}

.placeholder-card {
  border: 1px dashed #c2d1e8;
  border-radius: 12px;
  background: #f8fbff;
  padding: 20px;
}

.placeholder-badge {
  display: inline-block;
  font-size: 12px;
  color: #1e3a8a;
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  border-radius: 999px;
  padding: 2px 10px;
}

.placeholder-meta {
  margin-top: 10px;
  color: #475569;
}

.placeholder-points {
  margin: 10px 0 0;
  color: #334155;
}

.module-policy .module-title { color: #1e3a8a; }
.module-home .module-title { color: #0b4ea9; }
.module-member .module-title { color: #075985; }
.module-connect .module-title { color: #1d4ed8; }
.module-appeal .module-title { color: #7c3aed; }
.module-growth .module-title { color: #0f766e; }
.module-stats .module-title { color: #166534; }
.module-system .module-title { color: #9a3412; }

.ui-locked .top-module-tab,
.ui-locked .sub-menu-item,
.ui-locked button:not(.new-msg-tip),
.ui-locked .icon-btn {
  pointer-events: none;
}

@media (max-width: 1200px) {
  .module-sidebar {
    width: 64px;
    flex-basis: 64px;
  }
  .module-title,
  .sub-menu-label {
    display: none;
  }
  .sub-menu-item {
    justify-content: center;
    padding: 0;
  }
}

/* 首页 Dashboard */
.home-dashboard-wrap {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.home-dashboard-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid #dbe7fb;
  background: linear-gradient(135deg, #0b4ea9 0%, #2b6dcc 40%, #e7edf7 100%);
  color: #fff;
}
.home-dashboard-hero h2 {
  margin: 0 0 4px;
  font-size: 20px;
}
.home-dashboard-hero p {
  margin: 0;
  font-size: 13px;
  opacity: 0.95;
}
.home-dashboard-filters {
  display: flex;
  gap: 8px;
}
.home-dashboard-filters .btn.active {
  background: #fff;
  color: #0b4ea9;
  border-color: #bfdbfe;
}
.home-dashboard-kpi-grid {
  display: flex;
  flex-wrap: nowrap;
  gap: 10px;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 4px;
  scrollbar-width: thin;
}
.home-dashboard-kpi-card {
  border: 1px solid #dbe3ef;
  border-radius: 12px;
  background: #fff;
  text-align: left;
  cursor: pointer;
  padding: 12px;
  transition: all 0.15s ease;
  flex: 0 0 160px;
  min-width: 160px;
}
.home-dashboard-kpi-card:hover {
  border-color: #93c5fd;
  box-shadow: 0 8px 20px rgba(30, 58, 138, 0.08);
}
.home-dashboard-kpi-title {
  font-size: 12px;
  color: var(--text-sub);
  margin-bottom: 6px;
}
.home-dashboard-kpi-value {
  font-size: 24px;
  font-weight: 700;
  color: #0b4ea9;
}
.home-dashboard-grid {
  display: grid;
  gap: 12px;
}
.home-dashboard-grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.home-dashboard-grid-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.home-dashboard-panel,
.home-dashboard-list-card {
  border: 1px solid #dbe3ef;
  border-radius: 12px;
  background: #fff;
  padding: 10px 12px;
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.04);
}
.home-dashboard-block-title {
  font-size: 14px;
  font-weight: 700;
  color: #1f3f67;
  margin-bottom: 8px;
}
.home-dashboard-block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.home-dashboard-block-head .home-dashboard-block-title {
  margin-bottom: 0;
}
.home-dashboard-trend-view-toggle {
  display: flex;
  gap: 6px;
}
.home-dashboard-trend-view-toggle .btn.active {
  background: #0b4ea9;
  color: #fff;
  border-color: #0b4ea9;
}
.home-dashboard-chart {
  width: 100%;
  height: 280px;
}
.home-dashboard-chart-lg {
  height: 340px;
}
.home-dashboard-rank-list {
  margin: 0;
  padding: 0;
  list-style: none;
}
.home-dashboard-rank-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px dashed #e5e7eb;
  font-size: 13px;
}
.home-dashboard-rank-list li:last-child {
  border-bottom: none;
}
.home-dashboard-rank-list li.empty {
  color: var(--text-sub);
}
.home-dashboard-list-actions {
  margin-top: 8px;
}

@media (max-width: 1400px) {
  .home-dashboard-grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 992px) {
  .home-dashboard-hero {
    flex-direction: column;
    align-items: flex-start;
  }
  .home-dashboard-block-head {
    flex-direction: column;
    align-items: flex-start;
  }
  .home-dashboard-grid-2,
  .home-dashboard-grid-4 {
    grid-template-columns: 1fr;
  }
}

/* =========================
   政企统一对话框（hp-dialog）
   ========================= */
body.hp-dialog-open {
  overflow: hidden;
}

/* 每一层弹窗在 dialog.js 内再叠加递增 z-index，整体高于默认 .ref-panel-mask(2600) */
.hp-dialog-host {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 3000;
}

.hp-dialog-layer {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
}

.hp-dialog-mask {
  position: absolute;
  inset: 0;
  background: rgba(10, 24, 44, 0.34);
  backdrop-filter: blur(2px);
  animation: hpDialogMaskIn 0.18s ease;
}

.hp-dialog-panel {
  position: relative;
  width: min(560px, calc(100vw - 32px));
  max-height: min(72vh, 720px);
  overflow: auto;
  border-radius: 16px;
  background: #fdfefe;
  border: 1px solid #d7dfeb;
  box-shadow: 0 18px 46px rgba(15, 23, 42, 0.2);
  animation: hpDialogPanelIn 0.2s ease;
}

.hp-dialog-size-s {
  width: min(420px, calc(100vw - 32px));
}
.hp-dialog-size-m {
  width: min(560px, calc(100vw - 32px));
}
.hp-dialog-size-l {
  width: min(720px, calc(100vw - 32px));
}

.hp-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 16px 18px 12px;
  border-bottom: 1px solid #e3e8f0;
}

.hp-dialog-title {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  color: #193252;
}

.hp-dialog-close {
  width: 30px;
  height: 30px;
  border: 1px solid #d0d9e8;
  border-radius: 999px;
  background: #f8fbff;
  color: #3f5675;
  cursor: pointer;
}

.hp-dialog-body {
  padding: 16px 18px 14px;
}

.hp-dialog-body-custom {
  padding: 12px 16px 16px;
  max-height: min(62vh, 680px);
  overflow: auto;
}

/* 忘记密码重置弹窗：内容自适应高度，不出现纵向滚动条 */
.hp-dialog-panel--password-reset,
.hp-dialog-body--password-reset {
  max-height: none !important;
  overflow: visible !important;
}

.hp-pr-form .form-group {
  margin-bottom: 10px;
}

.hp-pr-channel-group > label {
  display: block;
}

.hp-pr-channel-row {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 24px;
}

.hp-pr-channel-option {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
  margin: 0;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 400;
  color: #1b3350;
  cursor: default;
  line-height: 1.4;
}

.hp-pr-channel-option--muted {
  opacity: 0.55;
}

.hp-pr-form-hint {
  margin: 8px 0 0;
  font-size: 13px;
  line-height: 1.5;
  color: #1b3350;
}

.hp-pr-form-hint.is-error {
  color: #b42318;
}

.hp-pr-form-hint.is-success {
  color: #166534;
}

.hp-pr-form-hint.is-neutral {
  color: #64748b;
}

.hp-pr-form--done .hp-pr-channel-group,
.hp-pr-form--done .form-group:not(:has(#pr-form-error)) {
  display: none;
}

.hp-pr-form--done #pr-form-error {
  display: block !important;
  margin: 4px 0 8px;
  font-size: 13px;
}

/* AI活动历史：详情弹窗内布局（复用 .msg / .msg-bubble） */
.abh-ai-detail {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 120px;
}

.abh-ai-detail-scroll {
  max-height: min(42vh, 420px);
  overflow: auto;
  padding: 4px 2px;
}

.abh-ai-detail-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 8px;
  border-top: 1px solid #e3e8f0;
  font-size: 13px;
  color: #64748b;
}

.abh-ai-detail-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.abh-ai-detail-actions .btn-sm {
  padding: 6px 12px;
  font-size: 13px;
}

.abh-ai-detail-actions a[data-abh-refs] {
  color: #2f6ceb;
  cursor: pointer;
  text-decoration: none;
}

.abh-ai-detail-actions a[data-abh-refs]:hover {
  text-decoration: underline;
}

.abh-ai-detail-tokens {
  margin-left: auto;
  text-align: right;
  white-space: nowrap;
}

.hp-dialog-message {
  margin: 0;
  color: #2b405d;
  font-size: 14px;
  line-height: 1.7;
  white-space: pre-wrap;
}

.hp-dialog-field-wrap {
  margin-top: 8px;
}

.hp-dialog-input {
  width: 100%;
  border: 1px solid #c6d1e3;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 14px;
  color: #1b3350;
  background: #fff;
}
.hp-dialog-input:focus {
  outline: none;
  border-color: #3e6da7;
  box-shadow: 0 0 0 3px rgba(62, 109, 167, 0.15);
}

.hp-dialog-counter {
  margin-top: 6px;
  font-size: 12px;
  text-align: right;
  color: #64758c;
}

.hp-dialog-error {
  margin: 8px 0 0;
  color: #b42318;
  font-size: 12px;
}

.hp-dialog-footer {
  padding: 12px 18px 16px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  border-top: 1px solid #e3e8f0;
}

.hp-dialog-btn {
  min-width: 88px;
  border-radius: 10px;
}
.hp-dialog-btn-primary {
  background: #1f4f87;
}
.hp-dialog-btn-primary:hover:not(:disabled) {
  background: #1b4576;
}
.hp-dialog-btn-danger {
  background: #9f2f2f;
}
.hp-dialog-btn-danger:hover:not(:disabled) {
  background: #8a2727;
}

.hp-dialog-status-default .hp-dialog-title {
  color: #193252;
}
.hp-dialog-status-success .hp-dialog-title {
  color: #14553b;
}
.hp-dialog-status-warning .hp-dialog-title {
  color: #7f4b0f;
}
.hp-dialog-status-error .hp-dialog-title {
  color: #8e2323;
}

.hp-dialog-panel button:disabled,
.hp-dialog-panel .btn:disabled {
  opacity: 0.52;
  cursor: not-allowed;
  pointer-events: none;
}

@keyframes hpDialogMaskIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes hpDialogPanelIn {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ----- 数据统计 · 功能数据看板 ----- */
.feature-behavior-statistics-wrap {
  max-width: 1400px;
}
.feature-behavior-statistics-wrap .fbs-toolbar {
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
  margin-bottom: 16px;
}
.feature-behavior-statistics-wrap .fbs-kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.feature-behavior-statistics-wrap .fbs-kpi-card {
  background: linear-gradient(145deg, #f8fafc 0%, #eef2ff 100%);
  border: 1px solid rgba(30, 58, 138, 0.12);
  border-radius: 12px;
  padding: 14px 16px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
}
.feature-behavior-statistics-wrap .fbs-kpi-value {
  font-size: 1.35rem;
  font-weight: 700;
  color: #1e3a5f;
  line-height: 1.2;
}
.feature-behavior-statistics-wrap .fbs-kpi-label {
  font-size: 0.78rem;
  color: #64748b;
  margin-top: 6px;
}
.feature-behavior-statistics-wrap .fbs-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 14px;
}
.feature-behavior-statistics-wrap .fbs-card {
  background: #fff;
  border: 1px solid rgba(30, 58, 138, 0.1);
  border-radius: 12px;
  padding: 12px 14px 10px;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.05);
}
.feature-behavior-statistics-wrap .fbs-card-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: #1e3a5f;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.35);
}
.feature-behavior-statistics-wrap .fbs-chart {
  width: 100%;
  min-height: 280px;
  height: 280px;
}
.feature-behavior-statistics-wrap .fbs-span-6 {
  grid-column: span 6;
}
.feature-behavior-statistics-wrap .fbs-span-12 {
  grid-column: span 12;
}
@media (max-width: 960px) {
  .feature-behavior-statistics-wrap .fbs-span-6,
  .feature-behavior-statistics-wrap .fbs-span-12 {
    grid-column: span 12;
  }
}

/* ----- 数据统计 · AI数据看板 ----- */
.ai-behavior-statistics-wrap {
  max-width: 1400px;
}
.ai-behavior-statistics-wrap .abs-toolbar {
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
  margin-bottom: 16px;
}
.ai-behavior-statistics-wrap .abs-kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.ai-behavior-statistics-wrap .abs-kpi-card {
  background: linear-gradient(145deg, #f8fafc 0%, #eef2ff 100%);
  border: 1px solid rgba(30, 58, 138, 0.12);
  border-radius: 12px;
  padding: 14px 16px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
}
.ai-behavior-statistics-wrap .abs-kpi-value {
  font-size: 1.35rem;
  font-weight: 700;
  color: #1e3a5f;
  line-height: 1.2;
}
.ai-behavior-statistics-wrap .abs-kpi-label {
  font-size: 0.78rem;
  color: #64748b;
  margin-top: 6px;
}
.ai-behavior-statistics-wrap .abs-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 14px;
}
.ai-behavior-statistics-wrap .abs-card {
  background: #fff;
  border: 1px solid rgba(30, 58, 138, 0.1);
  border-radius: 12px;
  padding: 12px 14px 10px;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.05);
}
.ai-behavior-statistics-wrap .abs-card-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: #1e3a5f;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.35);
}
.ai-behavior-statistics-wrap .abs-chart {
  width: 100%;
  min-height: 280px;
  height: 280px;
}
.ai-behavior-statistics-wrap .abs-span-6 {
  grid-column: span 6;
}
.ai-behavior-statistics-wrap .abs-span-12 {
  grid-column: span 12;
}
.ai-behavior-statistics-wrap .abs-mini-table {
  margin-top: 10px;
  overflow-x: auto;
}
.ai-behavior-statistics-wrap .abs-data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  color: #334155;
}
.ai-behavior-statistics-wrap .abs-data-table th,
.ai-behavior-statistics-wrap .abs-data-table td {
  border: 1px solid rgba(148, 163, 184, 0.45);
  padding: 8px 10px;
  text-align: left;
}
.ai-behavior-statistics-wrap .abs-data-table th {
  background: #f8fafc;
  font-weight: 600;
  color: #1e3a5f;
}
.ai-behavior-statistics-wrap .abs-td-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.ai-behavior-statistics-wrap .abs-table-empty {
  margin: 8px 0 0;
  font-size: 0.85rem;
  color: #64748b;
}
@media (max-width: 960px) {
  .ai-behavior-statistics-wrap .abs-span-6,
  .ai-behavior-statistics-wrap .abs-span-12 {
    grid-column: span 12;
  }
}

