:root {
  --hero-grid: linear-gradient(rgba(6, 111, 209, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(6, 111, 209, 0.08) 1px, transparent 1px);
}

body {
  background: var(--tblr-body-bg);
}

/* Tabler 默认 pre 用 --tblr-light（近白），浅色背景上不可读。 */
pre {
  color: var(--tblr-body-color);
}

/* Shared page-header primitives. Detail pages supply an explicit parent URL
   and include templates/includes/page_back_link.html for this affordance. */
.page-header .page-title {
  min-width: 0;
  overflow-wrap: anywhere;
}

.page-back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  margin-top: 0.75rem;
  margin-bottom: 0.75rem;
  white-space: nowrap;
}

.page-back-link:focus-visible {
  outline: 2px solid var(--tblr-primary);
  outline-offset: 2px;
}

.page-header-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
}

.page-header > .page-back-link {
  margin-bottom: 0.5rem;
}

.page-header .page-pretitle {
  overflow-wrap: anywhere;
}

.page-header .page-title {
  margin-bottom: 0;
}

.page-header-standard .page-title {
  min-width: 0;
  overflow-wrap: anywhere;
}

.page-header-standard .page-subtitle {
  max-width: 52rem;
  line-height: 1.5;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.form-actions .btn:first-child {
  order: 1;
}

.form-actions .btn:not(:first-child) {
  order: 2;
}

.small-meta {
  font-size: 0.75rem;
}

.inline-note-action {
  display: none;
}

.knowledge-toolbar-title .page-back-link {
  margin: 0;
  padding-inline: 0.5rem;
  font-size: 0.8125rem;
}

.filter-select-auto {
  width: auto;
  max-width: 100%;
}

.table-col-id {
  width: 4.375rem;
}

.table-col-progress {
  width: 7.5rem;
}

.table-col-title {
  min-width: 13.75rem;
}

.table-col-title-wide {
  max-width: 24rem;
}

.knowledge-card-sticky {
  position: sticky;
  top: 1rem;
}

.work-group-preview {
  max-height: 4.5em;
  overflow: hidden;
}

.radar-filter-panel {
  position: sticky;
  top: 1rem;
}

.table-col-summary {
  min-width: 18rem;
}

.table-col-summary-wide {
  min-width: 24rem;
  max-width: 42rem;
  white-space: pre-wrap;
}

.progress-bar[data-progress] {
  width: var(--progress-value, 0%);
}

/* 三个内容库问答页共享同一套双栏工作区 token。 */
.qa-layout {
  display: grid;
  grid-template-columns: minmax(18rem, 20rem) minmax(0, 1fr);
  gap: 1rem;
  min-height: calc(100vh - 200px);
}

.qa-chat-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.qa-messages {
  flex: 1 1 auto;
  min-width: 0;
  overflow-y: auto;
  padding: 1.25rem;
  background: var(--tblr-bg-surface);
}

.qa-msg {
  margin-bottom: 1.25rem;
}

.qa-msg-user {
  display: flex;
  justify-content: flex-end;
}

.qa-msg-user .qa-bubble {
  background: var(--tblr-primary);
  color: #fff;
}

.qa-bubble {
  max-width: min(80%, 52rem);
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  overflow-wrap: anywhere;
}

.qa-msg-assistant .qa-bubble {
  background: var(--tblr-bg-forms);
  border: 1px solid var(--tblr-border-color);
}

.qa-bubble p:last-child {
  margin-bottom: 0;
}

.qa-bubble table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
}

.qa-citations {
  margin-top: 0.5rem;
}

.qa-citation-chip {
  cursor: pointer;
}

.qa-input-bar {
  padding: 0.75rem;
  border-top: 1px solid var(--tblr-border-color);
}

.qa-input {
  resize: none;
}

.qa-citation-modal-body {
  max-height: 60vh;
  overflow-y: auto;
  white-space: pre-wrap;
}

.qa-scope-selected,
.qa-scope-tags {
  max-height: 10rem;
  overflow-y: auto;
}

.qa-overlay {
  position: fixed;
  inset: 0;
  z-index: 1050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.qa-overlay[hidden] {
  display: none;
}

.qa-overlay-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
}

.qa-overlay-dialog {
  position: relative;
  width: 100%;
  max-width: 45rem;
}

@media (max-width: 991.98px) {
  .page-header-actions {
    justify-content: flex-start;
  }

  .qa-layout {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .qa-bubble {
    max-width: 92%;
  }
}

/* Tom Select's Bootstrap theme expects --bs-body-bg, while Tabler exposes --tblr-body-bg. */
.ts-dropdown,
.ts-dropdown-content {
  background: var(--tblr-body-bg, #fff) !important;
}

.sidebar-shell {
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  background-color: #111827;
  background: linear-gradient(180deg, #182235, #111827 60%);
}

@media (min-width: 992px) {
  .sidebar-shell .sidebar-nav-list {
    min-height: calc(100vh - 4.5rem);
  }

  .sidebar-shell .sidebar-nav-bottom {
    margin-top: auto;
    padding-top: .75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
  }
}

@media (min-width: 992px) {
  .sidebar-shell {
    overflow-y: auto;
    scrollbar-width: none;
  }

  .sidebar-shell::-webkit-scrollbar {
    width: 0;
    height: 0;
  }
}

.navbar-brand-text {
  min-height: 3.5rem;
}

.topbar-shell {
  position: relative;
  z-index: 1035;
  border-bottom: 1px solid rgba(6, 111, 209, 0.08);
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(12px);
}

.topbar-shell,
.topbar-shell .container-xl,
.topbar-shell .navbar-collapse,
.topbar-shell .navbar-nav,
.topbar-shell .nav-item.dropdown {
  overflow: visible;
}

.topbar-shell .nav-link {
  font-weight: 600;
}

.topbar-shell .nav-item.active .nav-link {
  color: var(--tblr-primary);
}

.topbar-shell .dropdown-menu {
  min-width: 12rem;
  z-index: 2000;
}

.mobile-topbar-shell {
  min-height: 3.5rem;
  position: sticky;
  z-index: 1045;
  border-bottom: 1px solid rgba(6, 111, 209, 0.08);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
}

.mobile-topbar-shell .navbar-brand {
  min-width: 0;
}

.mobile-topbar-shell .navbar-brand > span:last-child {
  max-width: min(42vw, 13rem);
}

.mobile-topbar-shell .dropdown-menu {
  min-width: 12rem;
  z-index: 2000;
}

@media (max-width: 991.98px) {
  .page {
    position: relative;
  }

  .sidebar-shell {
    position: fixed;
    top: 3.5rem;
    left: 0;
    right: 0;
    z-index: 1040;
    width: 100%;
    height: auto;
    min-height: 0;
    padding: 0;
    border: 0;
    background: none !important;
    pointer-events: none;
  }

  .sidebar-shell > .container-fluid {
    padding: 0;
  }

  .sidebar-shell > .container-fluid > .navbar-toggler,
  .sidebar-shell > .container-fluid > .navbar-brand {
    display: none !important;
  }

  .sidebar-shell .navbar-collapse {
    pointer-events: auto;
    max-height: calc(100vh - 3.5rem);
    overflow-y: auto;
    background: linear-gradient(180deg, #182235, #111827 60%);
    box-shadow: 0 1rem 2rem rgba(15, 23, 42, 0.24);
  }

  .mobile-topbar-shell .navbar-nav {
    flex-shrink: 0;
  }
}

.hero-shell {
  background:
    var(--hero-grid),
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(240, 246, 255, 0.9));
  background-size: 24px 24px, auto;
  border-bottom: 1px solid rgba(6, 111, 209, 0.08);
  margin-bottom: 1.5rem;
  padding: 1.5rem 0;
}

.space-y > * + * {
  margin-top: 1rem;
}

.assess-page-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
}

.assess-page-actions > form,
.assess-page-actions > a,
.assess-page-actions > button {
  margin-left: 0 !important;
}

.assess-month-select {
  flex-wrap: nowrap;
}

.assess-month-select .form-label {
  white-space: nowrap;
}

.assess-month-select .form-control {
  width: 9.75rem;
  min-width: 9.75rem;
}

.assess-group-filter form {
  flex: 1 1 22rem;
  min-width: 0;
  max-width: 28rem;
}

.assess-group-filter .form-select {
  width: 100%;
}

@media (max-width: 991.98px) {
  .assess-page-actions {
    justify-content: flex-start;
  }
}

.auth-shell {
  min-height: 100vh;
  background: var(--tblr-body-bg);
}

.auth-brand-mark {
  width: 3rem;
  height: 3rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 1rem;
  background: linear-gradient(135deg, var(--tblr-primary), #3b82f6);
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.08em;
  box-shadow: 0 1rem 2rem rgba(6, 111, 209, 0.2);
}

.auth-card {
  border: 1px solid rgba(6, 111, 209, 0.08);
  box-shadow: 0 1.5rem 3rem rgba(15, 23, 42, 0.08);
}

.auth-muted-link {
  text-decoration: none;
}

.profile-hero-card {
  background:
    linear-gradient(135deg, rgba(6, 111, 209, 0.95), rgba(37, 99, 235, 0.86)),
    linear-gradient(135deg, #066fd1, #2563eb);
  color: #fff;
}

@media (max-width: 991.98px) {
  .project-overview-header .row {
    display: block;
  }

  .project-overview-heading {
    margin-bottom: 0.75rem;
  }

  .project-overview-actions {
    margin-left: 0 !important;
  }
}

@media (max-width: 575.98px) {
  .project-overview-stats {
    --tblr-gutter-y: 0.5rem;
  }

  .project-overview-stat-card .card-body {
    padding: 0.75rem;
  }

  .project-overview-stat-card .h1 {
    margin-top: 0.25rem !important;
  }
}

/* ---------------------------------------------------------------------------
   企业知识助手
   --------------------------------------------------------------------------- */
.knowledge-chat-page .knowledge-message {
  padding: 0.5rem 0.75rem;
  border-radius: 0.375rem;
}

.knowledge-chat-page .knowledge-message-user {
  background: var(--tblr-blue-lt, #e7f1ff);
}

.knowledge-chat-page .knowledge-message-assistant {
  background: var(--tblr-bg-surface, #f8f9fa);
}

.knowledge-chat-page .knowledge-answer-area {
  min-height: 2rem;
  padding: 0.5rem 0.75rem;
  line-height: 1.6;
}

.knowledge-chat-page .knowledge-citation-item {
  padding: 0.5rem 0.75rem;
  border-left: 3px solid var(--tblr-primary, #0054a6);
}

.knowledge-chat-page .knowledge-citation-item a {
  font-weight: 500;
}

.knowledge-chat-page .knowledge-feedback-controls {
  display: none;
}

.knowledge-chat-page .knowledge-feedback-controls[data-message-id]:not([data-message-id=""]) {
  display: inline-flex;
  gap: 0.25rem;
}

.knowledge-chat-page #knowledge-source-types {
  min-height: 2.5rem;
}

.knowledge-chat-page .knowledge-source-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.knowledge-chat-page .knowledge-source-check {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.75rem;
  border: 1px solid var(--tblr-border-color, #e6e7e9);
  border-radius: 0.375rem;
  cursor: pointer;
  user-select: none;
  transition: border-color 0.15s, background-color 0.15s;
}

.knowledge-chat-page .knowledge-source-check:hover {
  border-color: var(--tblr-primary, #0054a6);
}

.knowledge-chat-page .knowledge-source-check:has(input:checked) {
  border-color: var(--tblr-primary, #0054a6);
  background: var(--tblr-blue-lt, #e7f1ff);
}

.knowledge-chat-page .knowledge-source-check input[type="checkbox"] {
  margin: 0;
  cursor: pointer;
}

.knowledge-chat-page .knowledge-source-check-label {
  font-size: 0.875rem;
  font-weight: 500;
}

/* 日志查看器使用浅色背景时，覆盖 Tabler code 的主题色，保证内容可读。 */
.scheduler-log-content {
  --tblr-scrollbar-color: #6b7280;
  color: var(--tblr-body-color, #374151);
  background-color: var(--tblr-bg-surface-secondary, #f8f9fa);
  scrollbar-color: #9ca3af #f3f4f6;
}

.scheduler-log-content code {
  color: inherit;
  background-color: transparent;
}

.scheduler-log-content::-webkit-scrollbar {
  width: 0.75rem;
  height: 0.75rem;
}

.scheduler-log-content::-webkit-scrollbar-thumb {
  background: #9ca3af;
  border: 2px solid #f3f4f6;
  border-radius: 0.75rem;
  box-shadow: none;
}

.scheduler-log-content:hover::-webkit-scrollbar-thumb {
  background: #6b7280;
}

.scheduler-log-content::-webkit-scrollbar-track,
.scheduler-log-content::-webkit-scrollbar-corner {
  background: #f3f4f6;
}

/* 日志页：任务日志按任务/日期筛选，服务日志按服务分组。 */
.scheduler-log-filter .form-label {
  margin-bottom: 0.375rem;
  font-size: 0.8125rem;
  font-weight: 600;
}

.scheduler-log-file-card,
.scheduler-log-viewer-card {
  min-height: 24rem;
}

.scheduler-log-file-list {
  max-height: 62vh;
  overflow-y: auto;
}

.scheduler-log-file-list .list-group-header {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--tblr-bg-surface, #fff);
}

.scheduler-log-file-list .list-group-item-action {
  min-height: 3rem;
}

.scheduler-log-file-list .list-group-item-action.active {
  color: var(--tblr-primary, #206bc4);
  background: var(--tblr-primary-lt, #e9f3ff);
  border-color: var(--tblr-border-color, #d9e1e8);
}

.scheduler-log-viewer-card .card-body {
  min-height: 20rem;
}

.scheduler-log-viewer-card .scheduler-log-content {
  height: 62vh;
  max-height: 62vh;
  min-height: 20rem;
  font-size: 0.8125rem;
  line-height: 1.5;
}

/* 定时任务详情：编号和说明都在卡片内对齐，推送说明允许按单词/字符换行。 */
.scheduler-steps {
  padding: 0;
}

.scheduler-step {
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr);
  gap: 0.75rem;
  align-items: start;
  padding: 0.875rem 1rem;
  border-top: 1px solid var(--tblr-border-color, #e6e7e9);
}

.scheduler-step:first-child {
  border-top: 0;
}

.scheduler-step-number {
  display: inline-flex;
  width: 2rem;
  height: 2rem;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-weight: 600;
  line-height: 1;
}

.scheduler-step-content {
  min-width: 0;
}

.scheduler-step-content p {
  overflow-wrap: anywhere;
}

#task-detail-content .datagrid-item,
#task-detail-content .datagrid-content {
  min-width: 0;
}

#task-detail-content .datagrid {
  grid-template-columns: minmax(0, 1fr);
}

.scheduler-feishu-message {
  display: block;
  width: 100%;
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.5;
  text-align: left;
}

@media (max-width: 991.98px) {
  .scheduler-log-file-list,
  .scheduler-log-viewer-card .scheduler-log-content {
    max-height: 50vh;
    height: 50vh;
  }
}

@media (max-width: 575.98px) {
  .knowledge-chat-page .row > div {
    margin-bottom: 1rem;
  }

  .knowledge-chat-page .knowledge-input-area .input-group {
    flex-wrap: nowrap;
  }

  .knowledge-chat-page #knowledge-query-input {
    min-width: 0;
  }
}

/* ── HHA 条款引用链接（评估页 → 法规库跳转） ── */
.hha-ref-link {
    color: #2c5282;
    text-decoration: underline;
    text-decoration-style: dotted;
    font-weight: 500;
    padding: 1px 3px;
    border-radius: 3px;
    background-color: rgba(66, 153, 225, 0.08);
    transition: all 0.2s ease;
    cursor: pointer;
}

.hha-ref-link:hover {
    background-color: rgba(66, 153, 225, 0.25);
    color: #1a365d;
    text-decoration-style: solid;
}

/* CAE 输入原件的只读 Markdown 预览。 */
.cae-input-markdown {
    overflow-wrap: anywhere;
}

.cae-input-markdown pre,
.cae-input-markdown table {
    max-width: 100%;
}

.cae-input-markdown pre {
    overflow-x: auto;
}

.cae-input-markdown img {
    max-width: 100%;
    height: auto;
}
.abaqus-diagnostic-log-content {
  max-height: 32rem;
  overflow: auto;
  padding: 0.75rem;
  border: 1px solid var(--tblr-border-color);
  border-radius: 0.25rem;
  background: #f3f4f6;
  color: #1f2937;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.abaqus-diagnostic-log summary {
  cursor: pointer;
}
