/* 千柯 AI 平台界面层：只补平台页需要的组件，沿用工作台既有 token 与外壳。 */

.nav-group { display: grid; gap: 2px; margin-bottom: 10px; }
.nav-group .nav-label { margin: 2px 11px 5px; }
.nav-group:last-child { margin-bottom: 4px; }
.apple-skin.apple-light.apple-ui .nav-group:not(.compact) .nav-item { min-height: 38px; font-size: 14px; }
.apple-skin.apple-light.apple-ui .nav-group { margin-bottom: 4px; }
.apple-skin.apple-light.apple-ui .sidebar .brand { padding-bottom: 14px; }
.apple-skin.apple-light.apple-ui .nav-group.compact .nav-item { min-height: 30px; padding: 4px 11px; font-size: 12.5px; }
.apple-skin.apple-light.apple-ui .nav-group.compact .nav-item .icon { width: 16px; height: 16px; }
.apple-skin.apple-light.apple-ui .nav-group.compact .nav-label { margin: 2px 11px 4px; }
.sidebar, .apple-skin.apple-light.apple-ui .sidebar { scrollbar-width: thin; overflow-x: hidden; overflow-y: auto; }
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb { border-radius: 99px; background: #d9dde5; }

.pf-page { min-width: 0; }
.pf-metrics {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0 0 20px; border: 1px solid var(--line); border-radius: var(--radius-card);
  background: #f8f9fb; overflow: hidden;
}
.pf-dashboard { display: grid; grid-template-columns: minmax(0, 1fr) 330px; align-items: start; gap: 16px; }
.pf-stack { display: grid; min-width: 0; gap: 14px; }

.pf-toolbar {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap;
  gap: 12px; margin-bottom: 16px;
}
.pf-toolbar .tabs { flex-wrap: wrap; }

.pf-split { display: grid; grid-template-columns: minmax(0, 1fr) 430px; align-items: start; gap: 16px; }
.pf-list-panel, .pf-detail-panel { min-height: 360px; }
.pf-list { display: grid; }
.pf-list-item {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  width: 100%; padding: 13px 16px; border: 0; border-bottom: 1px solid #edf1f8;
  background: transparent; text-align: left; color: var(--ink);
}
.pf-list-item:last-child { border-bottom: 0; }
.pf-list-item:hover { background: #f8f9fb; }
.pf-list-item.active { background: #f5f8ff; box-shadow: inset 2px 0 0 var(--accent); }
.pf-list-main { display: grid; min-width: 0; gap: 3px; }
.pf-list-main b { overflow: hidden; color: #2d3440; font-size: 13px; font-weight: 550; text-overflow: ellipsis; white-space: nowrap; }
.pf-list-main b small { margin-left: 6px; color: var(--muted); font-size: 11px; font-weight: 400; }
.pf-list-main > span { overflow: hidden; color: var(--muted); font-size: 11.5px; text-overflow: ellipsis; white-space: nowrap; }
.pf-list-side { display: grid; flex: 0 0 auto; justify-items: end; gap: 4px; }
.pf-list-side small { color: var(--muted); font-size: 11px; white-space: nowrap; }

.pf-detail-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 14px;
  padding: 17px 20px; border-bottom: 1px solid var(--line);
}
.pf-detail-head h2 { color: #2d3440; font-size: 18px; font-weight: 600; line-height: 1.35; }
.pf-detail-head p { margin-top: 5px; color: var(--muted); font-size: 12px; }
.pf-eyebrow { margin-bottom: 5px; color: var(--muted); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 10.5px; letter-spacing: .03em; }
.pf-detail-actions { display: flex; align-items: center; flex: 0 0 auto; gap: 7px; }
.pf-detail-body { display: grid; min-width: 0; gap: 13px; padding: 17px 20px 20px; }

.pf-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.pf-kpis > div { padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; background: #f8f9fb; }
.pf-kpis span { display: block; color: var(--muted); font-size: 11px; }
.pf-kpis b { display: block; margin-top: 3px; color: #2d3440; font-size: 19px; font-weight: 600; letter-spacing: -.02em; }
.pf-kpis small { display: block; margin-top: 2px; color: var(--muted); font-size: 10.5px; }

.pf-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px 16px; }
.pf-facts > div { display: grid; gap: 2px; min-width: 0; }
.pf-facts span:first-child { color: var(--muted); font-size: 11px; }
.pf-facts > div > span:last-child, .pf-facts > div > *:not(span:first-child) { color: #3b4250; font-size: 12.5px; overflow-wrap: anywhere; }
.pf-facts .pf-person { display: inline-flex; }

.pf-note { padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fbfbfd; color: #454b57; font-size: 12.5px; line-height: 1.8; white-space: pre-wrap; overflow-wrap: anywhere; }
.pf-muted { color: var(--muted); font-size: 12px; line-height: 1.8; }
.pf-warn { padding: 9px 11px; border: 1px solid #f2e3cf; border-radius: 9px; background: #fff9f0; color: #8a5a17; font-size: 12px; }
.pf-negative { color: var(--red); }

.pf-section-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 5px; padding-top: 12px; border-top: 1px solid var(--line); }
.pf-section-title h3 { color: #3b4250; font-size: 12.5px; font-weight: 600; }
.pf-section-title > span { color: var(--muted); font-size: 11px; }

.pf-pill { display: inline-flex; align-items: center; min-height: 21px; padding: 1px 7px; border: 1px solid var(--line); border-radius: 999px; background: #f8f9fb; color: var(--muted); font-size: 10.5px; line-height: 1.6; white-space: nowrap; }
.pf-pill.ok { border-color: #d6ecd9; background: #f2faf4; color: var(--green); }
.pf-pill.wait { border-color: #f2e3cf; background: #fff9f0; color: var(--amber); }
.pf-pill.bad { border-color: #f2d6d6; background: #fdf3f3; color: var(--red); }
.pf-pill.info { border-color: #dbe7f7; background: #f3f8ff; color: var(--blue); }
.pf-pill.muted { color: var(--muted); }

.pf-dot { display: inline-block; width: 7px; height: 7px; flex: 0 0 auto; border-radius: 50%; background: #c7c7cc; }
.pf-dot.green { background: #34a853; }
.pf-dot.yellow { background: #e0a21a; }
.pf-dot.red { background: #d9534f; }
.pf-dot.gray { background: #c7c7cc; }
.pf-person { display: inline-flex; align-items: center; gap: 5px; color: #454b57; font-size: 12px; }
.pf-person .avatar { width: 21px; height: 21px; font-size: 10px; }

.pf-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 16px; border-bottom: 1px solid #edf1f8; }
.pf-row:last-child { border-bottom: 0; }
.pf-row-main { display: grid; min-width: 0; flex: 1; gap: 2px; }
.pf-row-main b { color: #2d3440; font-size: 12.5px; font-weight: 550; overflow-wrap: anywhere; }
.pf-row-main small { color: var(--muted); font-size: 11px; line-height: 1.6; overflow-wrap: anywhere; }
.pf-row-actions { display: flex; align-items: center; flex: 0 0 auto; gap: 3px; }

.pf-subhead { padding: 9px 16px 3px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10.5px; font-weight: 600; letter-spacing: .04em; }
.pf-activity-list { display: grid; gap: 11px; }
.pf-activity { display: flex; align-items: flex-start; gap: 8px; }
.pf-activity .pf-dot { margin-top: 6px; }
.pf-activity b { display: block; color: #3b4250; font-size: 12px; font-weight: 500; }
.pf-activity small { display: block; margin-top: 2px; color: var(--muted); font-size: 10.5px; }

.pf-snapshot { display: grid; gap: 10px; }
.pf-snapshot > div > span { display: block; color: var(--muted); font-size: 11px; }
.pf-snapshot > div > b { display: block; margin-top: 2px; color: #2d3440; font-size: 19px; font-weight: 600; letter-spacing: -.02em; }
.pf-snapshot > div > small { display: block; margin-top: 2px; color: var(--muted); font-size: 10.5px; }
.pf-snapshot .pf-split-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding-top: 8px; border-top: 1px solid var(--line); }
.pf-snapshot .pf-split-2 b { font-size: 14px; }
.pf-snapshot .pf-warn { margin-top: 2px; }

.pf-progress { display: block; width: 100%; height: 6px; overflow: hidden; border: 0; border-radius: 99px; appearance: none; background: #edf0f5; }
.pf-progress::-webkit-progress-bar { border-radius: 99px; background: #edf0f5; }
.pf-progress::-webkit-progress-value { border-radius: 99px; background: var(--accent); }
.pf-progress::-moz-progress-bar { border-radius: 99px; background: var(--accent); }

.pf-portals { display: grid; gap: 7px; }
.pf-portal { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px; background: #fbfbfd; }
.pf-portal b { display: block; font-size: 12px; font-weight: 550; }
.pf-portal small { color: var(--muted); font-size: 10.5px; }
.pf-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin-top: 2px; }

.pf-link-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; padding: 9px 0; border: 0; border-bottom: 1px solid #f1f3f7; background: transparent; text-align: left; }
.pf-link-row:last-child { border-bottom: 0; }
.pf-link-row b { display: block; color: #2d3440; font-size: 12.5px; font-weight: 500; }
.pf-link-row small { color: var(--muted); font-size: 10.5px; }
.pf-link-row:hover b { color: var(--accent); }

.pf-capacity-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.pf-capacity-grid .panel-body { display: grid; gap: 10px; }
.pf-project-hours { display: grid; gap: 5px; }
.pf-project-hours > div { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 11px; }
.pf-project-hours b { color: #3b4250; font-weight: 500; }
.pf-money-table td:first-child b { display: block; font-weight: 550; }
.pf-money-table td:first-child small { display: block; color: var(--muted); font-size: 10px; }

.pf-agent-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-bottom: 14px; }
.pf-agent-card .panel-header p { margin-top: 2px; color: var(--muted); font-size: 10.5px; }
.pf-doc { margin-top: 2px; }
.pf-code { margin: 10px 0 0; padding: 13px 15px; overflow-x: auto; border: 1px solid #e6e8ee; border-radius: 10px; background: #f7f8fa; color: #343b48; font: 11.5px/1.75 ui-monospace, SFMono-Regular, Consolas, monospace; white-space: pre; }

.pf-review { display: grid; gap: 11px; }
.pf-criteria { margin: 0; padding-left: 20px; color: #3b4250; font-size: 12.5px; line-height: 1.9; }
.pf-evidence-list { display: grid; gap: 6px; }
.pf-evidence-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fbfbfd; }
.pf-evidence-row b { display: block; font-size: 12px; font-weight: 500; }
.pf-evidence-row small { color: var(--muted); font-size: 10.5px; }
.pf-evidence { color: var(--accent); font-size: 11.5px; white-space: nowrap; }
.pf-reject { padding: 10px 12px; border: 1px solid #f2d6d6; border-radius: 9px; background: #fdf3f3; }
.pf-reject b { display: block; color: var(--red); font-size: 11.5px; }
.pf-reject p { margin-top: 3px; color: #6b3a3a; font-size: 12px; white-space: pre-wrap; }

.pf-citations { display: grid; gap: 6px; }
.pf-citation { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fbfbfd; font-size: 12px; }
.pf-citation a { font-size: 11.5px; }
.pf-tag { display: inline-flex; padding: 1px 6px; border: 1px solid var(--line); border-radius: 5px; background: #f8f9fb; color: var(--muted); font-size: 10.5px; }
.pf-knowledge-body { color: #343b48; font-size: 13.5px; line-height: 2; white-space: pre-wrap; overflow-wrap: anywhere; }

.pf-quick-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; padding: 4px 0; }
.pf-quick { display: grid; gap: 3px; padding: 13px 14px; border: 1px solid var(--line); border-radius: 10px; background: #fbfbfd; text-align: left; }
.pf-quick:hover { border-color: #cfd9ee; background: #f6f9ff; }
.pf-quick .icon { width: 18px; height: 18px; margin-bottom: 4px; color: var(--accent); }
.pf-quick b { color: #2d3440; font-size: 13px; font-weight: 550; }
.pf-quick small { color: var(--muted); font-size: 10.5px; }

.pf-check { margin-top: 2px; }
.pf-multi { min-height: 108px; }
.pf-rate-row { display: grid; grid-column: 1 / -1; grid-template-columns: 110px 1fr 1fr; align-items: end; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); }
.pf-rate-row > span { padding-bottom: 9px; color: #3b4250; font-size: 12px; }
.pf-rate-row .field { gap: 4px; }

.pf-intel { width: 100%; height: 620px; border: 0; }

.pf-empty { display: grid; place-items: center; gap: 4px; padding: 30px 18px; color: var(--muted); text-align: center; }
.pf-empty b { color: #6a7180; font-size: 12.5px; font-weight: 550; }
.pf-empty p { max-width: 300px; font-size: 11.5px; line-height: 1.8; }

@media (max-width: 1280px) {
  .pf-split { grid-template-columns: minmax(0, 1fr) 390px; }
  .pf-dashboard { grid-template-columns: minmax(0, 1fr) 300px; }
}
@media (max-width: 1100px) {
  .pf-split, .pf-dashboard { grid-template-columns: minmax(0, 1fr); }
  .pf-detail-panel { min-height: 0; }
  .pf-capacity-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .pf-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pf-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pf-facts { grid-template-columns: minmax(0, 1fr); }
  .pf-agent-grid, .pf-capacity-grid, .pf-quick-grid { grid-template-columns: minmax(0, 1fr); }
  .pf-detail-head { flex-direction: column; }
  .pf-detail-actions { align-self: flex-start; }
  .pf-row { align-items: flex-start; flex-wrap: wrap; }
  .pf-rate-row { grid-template-columns: minmax(0, 1fr); }
  .pf-rate-row > span { padding-bottom: 0; }
}

/* 业务分页 */
.pf-business-tabs {
  display: inline-flex; gap: 3px; margin: 0 0 18px; padding: 3px;
  border: 1px solid var(--line); border-radius: 10px; background: #f8f9fb;
}
.pf-business-tabs .tab { border-radius: 7px; }

/* 需求流程门禁 */
.pf-gate { margin-top: 2px; padding: 13px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fbfbfd; }
.pf-gate-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 9px; }
.pf-gate-head h3 { margin: 0; color: #2d3440; font-size: 13px; font-weight: 600; }
.pf-gate-list { display: grid; gap: 7px; margin: 0; padding: 0; list-style: none; }
.pf-gate-list li { display: flex; align-items: flex-start; gap: 8px; padding: 7px 9px; border-radius: 8px; background: white; border: 1px solid #eef1f6; }
.pf-gate-list li.ok { border-color: #e3f1e6; background: #f7fcf8; }
.pf-gate-list li.warn { border-color: #f5e8d6; background: #fffbf5; }
.pf-gate-list .icon { width: 15px; height: 15px; margin-top: 2px; flex: 0 0 auto; color: var(--green); }
.pf-gate-list li.warn .icon { color: var(--amber); }
.pf-gate-list b { display: block; color: #3b4250; font-size: 12px; font-weight: 550; }
.pf-gate-list small { display: block; margin-top: 1px; color: var(--muted); font-size: 10.5px; line-height: 1.6; }
.pf-gate-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 9px; }

/* 需求流程规范 */
.pf-process .panel-header p { margin-top: 3px; color: var(--muted); font-size: 11px; }
.pf-process-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; padding: 16px; }
.pf-process-card { padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: #fbfbfd; }
.pf-process-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 7px; }
.pf-process-no { color: var(--muted); font: 11px/1.4 ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .04em; }
.pf-process-purpose { min-height: 36px; color: #3b4250; font-size: 12px; line-height: 1.65; }
.pf-process-dl { display: grid; gap: 8px; margin: 10px 0 0; }
.pf-process-dl > div { display: grid; gap: 2px; }
.pf-process-dl dt { color: var(--muted); font-size: 10.5px; font-weight: 600; }
.pf-process-dl dd { margin: 0; color: #4a5160; font-size: 11.5px; line-height: 1.7; }
.pf-process-rules { margin: 0 16px 16px; padding: 13px 15px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.pf-process-rules h3 { margin: 0 0 7px; color: #2d3440; font-size: 13px; }
.pf-process-rules ul { display: grid; gap: 4px; margin: 0; padding-left: 18px; color: #4a5160; font-size: 11.5px; line-height: 1.8; }

@media (max-width: 1100px) {
  .pf-process-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .pf-process-grid { grid-template-columns: minmax(0, 1fr); padding: 12px; }
  .pf-business-tabs { width: 100%; overflow-x: auto; }
  .pf-gate-foot { align-items: flex-start; flex-direction: column; }
}

/* GitHub 公开仓库选择 */
.public-repo-list { display: grid; gap: 7px; }
.public-repo-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 11px; border: 1px solid var(--line); border-radius: 9px; background: #fbfbfd; }
.public-repo-row b { display: block; color: #2d3440; font-size: 12.5px; font-weight: 550; }
.public-repo-row small { display: block; margin-top: 2px; color: var(--muted); font-size: 10.5px; line-height: 1.6; overflow-wrap: anywhere; }
.public-repo-row .actions { flex: 0 0 auto; }

/* 情报局：整页铺满，不显示工作台页头、说明和刷新按钮 */
#page-content.intel-mode {
  width: 100%;
  max-width: none;
  padding: 0;
}
#page-content.intel-mode .intel-page {
  display: flex;
  height: calc(100dvh - 74px);
  min-height: 420px;
  gap: 0;
}
#page-content.intel-mode .intel-page-empty {
  display: grid;
  height: auto;
  min-height: 0;
  padding: 28px 30px;
}
#page-content.intel-mode .intel-frame-wrap {
  flex: 1;
  min-height: 0;
  border: 0;
  border-radius: 0;
  background: #fff;
  box-shadow: none;
}
#page-content.intel-mode .intel-frame { width: 100%; height: 100%; }
@media (max-width: 760px) {
  #page-content.intel-mode .intel-page { height: calc(100dvh - 56px); min-height: 320px; }
}
