/* 项目助手：统一管理台 / 项目上下文 / 项目总结（三处页面共用） */

/* 项目总结是只读页：不挂「新建对话 / AI 分析结果」看板；侧边栏「最近会话」保留 */
body[data-pa-summary="1"] #xiaolanNewConversationButton,
body[data-pa-summary="1"] #xiaolanPcPanel,
body[data-pa-summary="1"] .xiaolan-pc-panel,
body[data-pa-summary="1"] .xiaolan-artifact-fab,
body[data-pa-summary="1"] #xiaolanArtifactDrawer {
  display: none !important;
}

.pa-context-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0 0 12px;
  padding: 9px 14px;
  border: 1px solid #e2eaf4;
  border-radius: 11px;
  background: linear-gradient(180deg, #f8fbff 0%, #f4f8fd 100%);
  color: #5b6f86;
  font-size: 0.82rem;
  line-height: 1.4;
}

.pa-context-bar.is-empty {
  border-style: dashed;
  background: #fafcff;
}

.pa-context-label {
  color: #8ba0b8;
  font-size: 0.74rem;
  letter-spacing: 0.04em;
}

.pa-context-bar strong {
  color: #15355b;
  font-size: 0.88rem;
  font-weight: 650;
}

.pa-context-meta {
  color: #8ba0b8;
  font-size: 0.76rem;
}

.pa-context-link {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border: 1px solid #cfe0f2;
  border-radius: 999px;
  color: #2774d0;
  background: #fff;
  font-size: 0.76rem;
  text-decoration: none;
  white-space: nowrap;
}

.pa-context-link:hover {
  border-color: #9dc3ea;
  background: #f2f8ff;
}

/* 统一管理台：当前绑定项目 */
.pa-binding-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 16px;
  border: 1px solid #dbe8f7;
  border-radius: 12px;
  background: linear-gradient(135deg, #f6faff 0%, #eef6ff 100%);
  color: #5b6f86;
  font-size: 0.82rem;
}

.pa-binding-bar .pa-binding-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.pa-binding-bar .pa-binding-kicker {
  color: #8ba0b8;
  font-size: 0.72rem;
  letter-spacing: 0.05em;
}

.pa-binding-bar .pa-binding-name {
  color: #15355b;
  font-size: 0.95rem;
  font-weight: 650;
}

.pa-binding-bar .pa-binding-meta {
  color: #7b8fa8;
  font-size: 0.76rem;
}

.pa-binding-bar .pa-binding-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.pa-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 30px;
  padding: 4px 12px;
  border: 1px solid #d3e1f2;
  border-radius: 9px;
  background: #fff;
  color: #2774d0;
  font-size: 0.78rem;
  font-weight: 550;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}

.pa-btn:hover {
  border-color: #9dc3ea;
  background: #f4f9ff;
}

.pa-btn.is-disabled,
.pa-btn[aria-disabled="true"] {
  border-color: #e4ecf5;
  background: #f5f8fc;
  color: #b3c2d4;
  cursor: not-allowed;
  pointer-events: none;
  box-shadow: none;
}

.pa-btn.is-primary {
  border-color: #2f9e1a;
  background: #2f9e1a;
  color: #fff;
}

.pa-btn.is-primary:hover {
  border-color: #278a15;
  background: #278a15;
}

.pa-btn.is-ghost {
  border-color: transparent;
  background: transparent;
  color: #7b8fa8;
}

.pa-btn.is-ghost:hover {
  background: #eef4fb;
  color: #2774d0;
}

/* 四个功能操作项 */
.xiaolan-pa-feature-ops {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  flex-wrap: nowrap;
  min-width: 350px;
}

.pa-feature-btn {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 3px 9px;
  border: 1px solid #d9e6f4;
  border-radius: 8px;
  background: #fff;
  color: #35658f;
  font-size: 0.72rem;
  line-height: 1.2;
  cursor: pointer;
  white-space: nowrap;
}

.pa-feature-btn:hover {
  border-color: #9dc3ea;
  background: #f3f9ff;
  color: #1f5fa8;
}

.pa-feature-btn:disabled {
  border-color: #e6edf6;
  background: #fafcff;
  color: #b3c2d4;
  cursor: not-allowed;
}

.pa-feature-btn.is-summary {
  border-color: #c9e4d3;
  color: #217a4b;
}

.pa-feature-btn.is-summary:hover {
  background: #f1fbf5;
}

/* 项目总结页 */
.pa-summary {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.pa-summary-head {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}

.pa-summary-head h1 {
  margin: 0;
  color: #15355b;
  font-size: 1.18rem;
  font-weight: 680;
}

.pa-summary-head p {
  margin: 5px 0 0;
  color: #7b8fa8;
  font-size: 0.82rem;
}

.pa-summary-head .pa-summary-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.pa-summary-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.pa-summary-card {
  padding: 12px 14px;
  border: 1px solid #e3ebf5;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(21, 53, 91, 0.04);
}

.pa-summary-card span {
  display: block;
  color: #8ba0b8;
  font-size: 0.72rem;
  letter-spacing: 0.03em;
}

.pa-summary-card strong {
  display: block;
  margin-top: 5px;
  color: #15355b;
  font-size: 1.16rem;
  font-weight: 680;
  word-break: break-all;
}

.pa-summary-card small {
  display: block;
  margin-top: 2px;
  color: #9aacc0;
  font-size: 0.7rem;
}

.pa-summary-section {
  padding: 14px 16px;
  border: 1px solid #e3ebf5;
  border-radius: 13px;
  background: #fff;
}

.pa-summary-section h2 {
  margin: 0 0 8px;
  color: #15355b;
  font-size: 0.92rem;
  font-weight: 650;
}

.pa-summary-section .pa-summary-cards {
  margin-bottom: 10px;
}

.pa-summary-overview {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pa-summary-overview li {
  color: #4b647f;
  font-size: 0.82rem;
  line-height: 1.75;
}

.pa-summary-note {
  margin: 10px 0 0;
  padding: 8px 10px;
  border-radius: 8px;
  background: #f7fafc;
  color: #8598ad;
  font-size: 0.74rem;
  line-height: 1.6;
}

.pa-summary-warning {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid #f3ddb5;
  border-radius: 10px;
  background: #fffaf0;
  color: #9a6a1c;
  font-size: 0.78rem;
}

.pa-summary-table-wrap {
  overflow-x: auto;
}

.pa-summary-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
}

.pa-summary-table th,
.pa-summary-table td {
  padding: 8px 10px;
  border-bottom: 1px solid #eef3f9;
  text-align: right;
  white-space: nowrap;
}

.pa-summary-table th {
  color: #7b8fa8;
  font-weight: 600;
  background: #f8fbfe;
  position: sticky;
  top: 0;
}

.pa-summary-table th:nth-child(1),
.pa-summary-table th:nth-child(2),
.pa-summary-table td:nth-child(1),
.pa-summary-table td:nth-child(2) {
  text-align: left;
}

.pa-summary-table td {
  color: #344b63;
  font-variant-numeric: tabular-nums;
}

.pa-summary-table tbody tr:hover td {
  background: #f8fbff;
}

.pa-summary-sample {
  color: #15355b;
  font-weight: 600;
}

.pa-summary-group {
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  border-radius: 999px;
  background: #eef5fd;
  color: #35658f;
  font-size: 0.7rem;
}

.pa-summary-report {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.pa-summary-report .pa-report-name {
  color: #15355b;
  font-weight: 600;
  font-size: 0.84rem;
}

.pa-summary-report .pa-report-meta {
  color: #8ba0b8;
  font-size: 0.75rem;
}

.pa-summary-pre {
  margin: 0;
  max-height: 320px;
  overflow: auto;
  padding: 10px 12px;
  border-radius: 9px;
  background: #f8fbfe;
  color: #4b647f;
  font-family: "IBM Plex Sans", "Noto Sans SC", sans-serif;
  font-size: 0.78rem;
  line-height: 1.7;
  white-space: pre-wrap;
}

.pa-summary-empty {
  padding: 38px 20px;
  border: 1px dashed #d8e4f2;
  border-radius: 13px;
  background: #fbfdff;
  color: #7b8fa8;
  text-align: center;
  font-size: 0.85rem;
}

.pa-summary-empty .pa-btn {
  margin-top: 12px;
}

@media (max-width: 980px) {
  .pa-summary-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .pa-context-link {
    margin-left: 0;
  }
  .pa-binding-bar .pa-binding-actions {
    margin-left: 0;
  }
}

@media (max-width: 620px) {
  .pa-summary-cards {
    grid-template-columns: 1fr;
  }
}

/* 添加项目：从管理台移除后仍属于用户名下的云分析项目 */
.pa-add-project-list {
  max-height: 52vh;
  overflow: auto;
  padding: 8px 18px 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pa-add-project-row {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid #e4edf7;
  border-radius: 9px;
  background: #fff;
  cursor: pointer;
  text-align: left;
}

.pa-add-project-row:hover {
  border-color: #b9d5ee;
  background: #f8fbff;
}

.pa-add-project-row input[type="checkbox"] {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  margin: 2px 0 0;
  accent-color: #2f9e1a;
  cursor: pointer;
}

.pa-add-project-main {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  flex: 1 1 auto;
  text-align: left;
}

.pa-add-project-name {
  color: #15355b;
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pa-add-project-meta {
  color: #8ba0b8;
  font-size: 0.74rem;
  line-height: 1.45;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pa-add-project-foot {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 10px;
  /* 底部留出安全间距：按钮不能贴住弹窗圆角/下边框 */
  padding: 14px 18px 18px;
  border-top: 1px solid #eef3f9;
}

.pa-add-project-all {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #5b6f86;
  font-size: 0.78rem;
  white-space: nowrap;
  cursor: pointer;
}

.pa-add-project-all input[type="checkbox"] {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: #2f9e1a;
}

.pa-add-project-selected {
  color: #8ba0b8;
  font-size: 0.76rem;
  white-space: nowrap;
}

.pa-add-project-spacer {
  flex: 1 1 auto;
}

/* 项目总结：内容较长时由主区自身滚动，右侧固定一条细滚动条，避免被 100vh 布局裁掉 */
body[data-pa-summary="1"] .xiaolan-gpt-main.xiaolan-project-main {
  display: block;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: #93aecb #e9f0f8;
}

body[data-pa-summary="1"] .xiaolan-gpt-main.xiaolan-project-main::-webkit-scrollbar {
  width: 12px;
}

body[data-pa-summary="1"] .xiaolan-gpt-main.xiaolan-project-main::-webkit-scrollbar-track {
  background: #e9f0f8;
  border-left: 1px solid #d9e4f0;
}

body[data-pa-summary="1"] .xiaolan-gpt-main.xiaolan-project-main::-webkit-scrollbar-thumb {
  min-height: 48px;
  border: 3px solid #e9f0f8;
  border-radius: 999px;
  background: #93aecb;
}

body[data-pa-summary="1"] .xiaolan-gpt-main.xiaolan-project-main::-webkit-scrollbar-thumb:hover {
  background: #6f8fb2;
}

body[data-pa-summary="1"] .pa-summary {
  padding-bottom: 12px;
}

/* 分析结果概述不再单独内滚：统一由页面右侧滚动条滚动到底 */
body[data-pa-summary="1"] .pa-summary-pre {
  max-height: none;
  overflow: visible;
}

/* ===== 项目总结：云分析平台「项目概览」样式 ===== */
.pa-overview-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 312px;
  gap: 16px;
  align-items: start;
}

.pa-overview-article {
  min-width: 0;
  padding: 22px 24px 26px;
  border: 1px solid #e3ebf5;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(21, 53, 91, 0.04);
}

.pa-overview-intro {
  margin: 0 0 18px;
  color: #33506d;
  font-size: 0.92rem;
  line-height: 1.95;
}

.pa-overview-section {
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px dashed #e6eef7;
}

.pa-overview-section h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  color: #15355b;
  font-size: 1rem;
  font-weight: 680;
}

.pa-overview-section h2::before {
  content: "";
  width: 3px;
  height: 16px;
  border-radius: 3px;
  background: #2f7fe0;
}

.pa-overview-text {
  margin: 0 0 10px;
  color: #4b647f;
  font-size: 0.86rem;
  line-height: 1.9;
}

/* 结题报告代表图（项目总结：从报告解析出的图） */
.pa-overview-figures {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 12px 0 16px;
}

.pa-overview-figure {
  flex: 1 1 320px;
  max-width: 480px;
  margin: 0;
  padding: 8px;
  border: 1px solid #e6eef7;
  border-radius: 10px;
  background: #fbfdff;
}

.pa-overview-figure a {
  display: block;
}

.pa-overview-figure img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 6px;
  background: #ffffff;
}

.pa-overview-figure figcaption {
  margin-top: 7px;
  color: #7b8fa8;
  font-size: 0.76rem;
  line-height: 1.5;
  text-align: center;
}

.pa-hl {
  color: #1f6fd0;
  font-weight: 670;
  font-variant-numeric: tabular-nums;
}

.pa-table-block {
  margin: 12px 0 4px;
}

.pa-table-caption {
  margin-bottom: 6px;
  color: #7b8fa8;
  font-size: 0.76rem;
  font-weight: 600;
}

.pa-table-wrap {
  overflow-x: auto;
  border: 1px solid #e8eff7;
  border-radius: 10px;
}

.pa-overview-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

/* 结题报告统计表列多、数值长，用更紧凑的排版尽量在一屏内显示 */
.pa-overview-table.is-compact {
  font-size: 0.72rem;
}

.pa-overview-table.is-compact th,
.pa-overview-table.is-compact td {
  padding: 7px 8px;
}

.pa-overview-table th,
.pa-overview-table td {
  padding: 9px 11px;
  border-bottom: 1px solid #eef3f9;
  text-align: left;
  white-space: nowrap;
}

.pa-overview-table thead th {
  background: #f6f9fd;
  color: #6f849c;
  font-weight: 600;
}

.pa-overview-table th.pa-th-num,
.pa-overview-table td.pa-table-num {
  text-align: right;
}

.pa-sample-table th,
.pa-sample-table td {
  text-align: left;
}

.pa-overview-table tbody tr:last-child td {
  border-bottom: 0;
}

.pa-overview-table tbody tr:hover td {
  background: #f8fbff;
}

.pa-overview-table td {
  color: #344b63;
}

.pa-table-sample {
  color: #15355b !important;
  font-weight: 620;
}

.pa-table-num {
  color: #1f6fd0 !important;
  font-weight: 620;
  font-variant-numeric: tabular-nums;
}

.pa-up {
  color: #2f9e1a !important;
}

.pa-down {
  color: #d1493f !important;
}

.pa-table-note {
  margin: 6px 0 0;
  color: #93a5ba;
  font-size: 0.72rem;
  line-height: 1.6;
}

.pa-tag {
  display: inline-flex;
  align-items: center;
  padding: 1px 8px;
  border-radius: 999px;
  background: #eef5fd;
  color: #35658f;
  font-size: 0.72rem;
}

.pa-overview-info {
  position: sticky;
  top: 16px;
  padding: 16px 16px 18px;
  border: 1px solid #e3ebf5;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(21, 53, 91, 0.04);
}

.pa-info-head {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  margin-bottom: 8px;
  border-radius: 10px;
  background: linear-gradient(90deg, #eef5fd, #f8fbff);
}

.pa-info-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: #dceafb;
  color: #2f7fe0;
}

.pa-info-icon svg {
  width: 16px;
  height: 16px;
}

.pa-info-head h2 {
  margin: 0;
  color: #15355b;
  font-size: 0.9rem;
  font-weight: 680;
}

.pa-info-list {
  margin: 0;
}

.pa-info-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 9px 2px;
  border-bottom: 1px solid #f0f4f9;
}

.pa-info-row dt {
  flex: 0 0 88px;
  color: #8ba0b8;
  font-size: 0.76rem;
  line-height: 1.6;
}

.pa-info-row dd {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  color: #33506d;
  font-size: 0.78rem;
  line-height: 1.6;
  text-align: right;
  word-break: break-all;
}

.pa-info-row.is-long {
  display: block;
}

.pa-info-row.is-long dt {
  flex: none;
}

.pa-info-row.is-long dd {
  margin-top: 3px;
  text-align: left;
}

.pa-info-intro {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed #e6eef7;
}

.pa-info-intro h3 {
  margin: 0 0 6px;
  color: #8ba0b8;
  font-size: 0.76rem;
  font-weight: 600;
}

.pa-info-intro p {
  margin: 0;
  color: #4b647f;
  font-size: 0.78rem;
  line-height: 1.8;
}

.pa-overview-empty {
  margin: 0;
  padding: 32px 18px;
  color: #8ba0b8;
  font-size: 0.84rem;
  text-align: center;
}

@media (max-width: 1180px) {
  .pa-overview-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .pa-overview-info {
    position: static;
  }
}

.pa-overview-note {
  margin: 4px 0 10px;
  padding: 8px 11px;
  border-radius: 8px;
  background: #f8fbfe;
  color: #8598ad;
  font-size: 0.78rem;
  line-height: 1.7;
}

/* 项目总结：章节内联 SVG 图与可折叠数据表 */
.pa-chart {
  margin: 10px 0 12px;
  padding: 10px 12px 4px;
  border: 1px solid #eef3f9;
  border-radius: 10px;
  background: #fbfdff;
}

.pa-chart svg {
  display: block;
  width: 100%;
  height: auto;
}

.pa-chart-legend {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin: 0 0 2px;
  color: #6f849c;
  font-size: 0.72rem;
}

.pa-chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.pa-chart-legend i {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 2px;
}

.pa-chart-axis {
  fill: #93a5ba;
  font-size: 10px;
  font-family: "IBM Plex Sans", "Noto Sans SC", sans-serif;
}

.pa-chart-label {
  fill: #4b647f;
  font-size: 10px;
  font-family: "IBM Plex Sans", "Noto Sans SC", sans-serif;
}

.pa-table-details summary {
  padding: 6px 0;
  color: #2f7fe0;
  font-size: 0.76rem;
  cursor: pointer;
  list-style: none;
}

.pa-table-details summary::-webkit-details-marker {
  display: none;
}

.pa-table-details summary::before {
  content: "▸";
  margin-right: 6px;
}

.pa-table-details[open] summary::before {
  content: "▾";
}
