/**
 * 2.0 布局：顶栏导航（GitHub 式）+ 左侧报告项目栏
 */

body.benying-phosphor {
  padding-top: 0 !important;
}

body.benying-phosphor::before,
body.benying-phosphor::after {
  z-index: 9990;
}

/* 取消 Phosphor 旧版固定顶栏 + 侧栏分栏占位 */
.ph-pageheader.benying-header--legacy,
.ph-splitpagelayout.app--legacy {
  display: none !important;
}

.app-v2 {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* —— 双层顶栏（GitHub 式） —— */
.topbar-stack {
  position: sticky;
  top: 0;
  z-index: 200;
  background: var(--ph-surface-2);
  border-bottom: 2px solid var(--ph-amber);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45);
}

.topbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0 1rem;
  min-height: 48px;
}

.topbar--primary {
  border-bottom: 1px solid var(--ph-surface-3);
}

.topbar--workflow {
  min-height: 42px;
  background: var(--ph-bg);
  padding-top: 0;
  padding-bottom: 0;
}

.topbar--workflow.is-hidden {
  display: none;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 1;
  min-width: 0;
  font-family: var(--benying-font);
}

.topbar-brand-mark {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ph-amber);
  text-decoration: none;
  letter-spacing: 0.06em;
  flex-shrink: 0;
}

.topbar-brand-mark:hover {
  color: var(--ph-cyan);
}

.topbar-breadcrumb-sep {
  color: var(--ph-white);
  opacity: 0.45;
  flex-shrink: 0;
}

.topbar-project-crumb {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ph-white);
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: min(280px, 40vw);
}

.topbar-project-crumb:hover {
  color: var(--ph-cyan);
}

.topbar-project-crumb[hidden] {
  display: none;
}

.topbar-leading {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.topbar-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--ph-surface-3);
  background: var(--ph-surface-1);
  color: var(--ph-white);
  cursor: pointer;
}

.topbar-icon-btn:hover {
  border-color: var(--ph-cyan);
  color: var(--ph-cyan);
}

.topbar-icon-btn i {
  font-size: 1.2rem;
}

.topbar-brand-page {
  font-size: 0.82rem;
  color: var(--ph-white);
  opacity: 0.7;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.topbar-brand-page::before {
  content: '/';
  margin: 0 0.35rem;
  opacity: 0.45;
}

.topbar-search-wrap {
  position: relative;
  flex: 0 1 auto;
  width: min(220px, 30vw);
  min-width: 120px;
}

.topbar-search {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  height: 36px;
  box-sizing: border-box;
  padding: 0 0.5rem;
  border: 1px solid var(--ph-surface-3);
  background: var(--ph-bg);
  border-radius: 4px;
  margin: 0;
}

.topbar-search i {
  opacity: 0.55;
  font-size: 0.88rem;
  flex-shrink: 0;
}

.topbar-search input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  background: transparent;
  color: var(--ph-white);
  font-size: 0.78rem;
  line-height: 1;
  font-family: var(--benying-font);
  outline: none;
}

.topbar-search input::placeholder {
  opacity: 0.45;
}

.topbar-trailing {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.65rem;
  flex-shrink: 0;
  margin-left: auto;
}

.global-search-results {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: min(320px, 92vw);
  max-height: min(360px, 50vh);
  overflow-y: auto;
  background: var(--ph-surface-2);
  border: 2px solid var(--ph-surface-3);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.5);
  z-index: 250;
  padding: 0.35rem 0;
}

.global-search-results[hidden] {
  display: none;
}

.global-search-group-label {
  margin: 0.35rem 0.75rem 0.25rem;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.55;
}

.global-search-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.global-search-item {
  display: block;
  padding: 0.45rem 0.75rem;
  color: var(--ph-white);
  text-decoration: none;
  font-size: 0.86rem;
}

.global-search-item:hover {
  background: rgba(0, 243, 243, 0.08);
  color: var(--ph-cyan);
}

.global-search-empty {
  margin: 0.5rem 0.75rem;
  font-size: 0.82rem;
}

/* —— 顶栏通知 —— */
.notifications-wrap {
  position: relative;
}

.notifications-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  height: 36px;
  padding: 0 0.65rem;
  border: 1px solid var(--ph-surface-3);
  background: var(--ph-surface-1);
  color: var(--ph-white);
  cursor: pointer;
  font-family: var(--benying-font);
  font-size: 0.82rem;
  position: relative;
}

.notifications-trigger:hover {
  border-color: var(--ph-cyan);
  color: var(--ph-cyan);
}

.notifications-trigger i {
  font-size: 1.1rem;
}

.notifications-trigger-label {
  font-weight: 600;
}

.notifications-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 1.1rem;
  height: 1.1rem;
  padding: 0 0.25rem;
  border-radius: 999px;
  background: var(--ph-amber);
  color: var(--ph-bg);
  font-size: 0.62rem;
  font-weight: 800;
  line-height: 1.1rem;
  text-align: center;
}

.notifications-badge[hidden] {
  display: none;
}

.notifications-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: min(380px, 92vw);
  max-height: min(480px, 70vh);
  display: flex;
  flex-direction: column;
  background: var(--ph-surface-2);
  border: 2px solid var(--ph-surface-3);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.5);
  z-index: 300;
}

.notifications-panel[hidden] {
  display: none;
}

.notifications-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid var(--ph-surface-3);
  flex-shrink: 0;
}

.notifications-panel-title {
  margin: 0;
  font-size: 0.95rem;
  color: var(--ph-amber);
}

.notifications-panel-head .ph-button {
  margin: 0;
  padding: 0.25rem 0.5rem;
  font-size: 0.72rem;
}

.notifications-list {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.notifications-empty {
  margin: 0.5rem;
  text-align: center;
}

.notifications-item {
  padding: 0.6rem 0.7rem;
  border: 1px solid var(--ph-surface-3);
  background: var(--ph-surface-1);
}

.notifications-item--error {
  border-color: var(--ph-red, #f87171);
}

.notifications-item-head {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
  font-size: 0.68rem;
  opacity: 0.75;
}

.notifications-item-cat {
  color: var(--ph-cyan);
  font-weight: 700;
}

.notifications-item--error .notifications-item-cat {
  color: var(--ph-red, #f87171);
}

.notifications-item-msg {
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.45;
  color: var(--ph-white);
}

.notifications-panel-foot {
  padding: 0.5rem 0.85rem 0.65rem;
  border-top: 1px solid var(--ph-surface-3);
  flex-shrink: 0;
  font-size: 0.82rem;
}

/* —— 左侧导航抽屉 —— */
.nav-drawer {
  position: fixed;
  inset: 0;
  z-index: 500;
  pointer-events: none;
  visibility: hidden;
}

.nav-drawer.is-open {
  pointer-events: auto;
  visibility: visible;
}

.nav-drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.nav-drawer.is-open .nav-drawer-backdrop {
  opacity: 1;
}

.nav-drawer-panel {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: min(300px, 88vw);
  background: var(--ph-surface-2);
  border-right: 2px solid var(--ph-amber);
  transform: translateX(-100%);
  transition: transform 0.22s ease;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.nav-drawer.is-open .nav-drawer-panel {
  transform: translateX(0);
}

.nav-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0.85rem;
  border-bottom: 1px solid var(--ph-surface-3);
}

.nav-drawer-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--ph-amber);
  font-weight: 700;
}

.nav-drawer-logo {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--ph-amber);
  border-radius: 50%;
  font-size: 0.75rem;
}

.nav-drawer-close {
  margin: 0;
}

.nav-drawer-nav {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem 0;
}

.nav-drawer-section-label {
  margin: 0.75rem 1rem 0.35rem;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.5;
}

.nav-drawer-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 1rem;
  text-decoration: none;
  color: var(--ph-white);
  font-size: 0.88rem;
  border-left: 3px solid transparent;
}

.nav-drawer-link i {
  font-size: 1.05rem;
  opacity: 0.85;
}

.nav-drawer-link:hover {
  background: rgba(0, 243, 243, 0.06);
  color: var(--ph-cyan);
}

.nav-drawer-link.active {
  background: rgba(255, 176, 0, 0.1);
  border-left-color: var(--ph-amber);
  color: var(--ph-amber);
  font-weight: 700;
}

/* 管理与设置页：抽屉内不展示报告项目列表 */
body.route-global-mgmt .nav-drawer-projects-block {
  display: none;
}

.nav-drawer-hr {
  border: 0;
  border-top: 1px solid var(--ph-surface-3);
  margin: 0.5rem 0;
}

.nav-drawer-projects-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0 1rem;
  margin-bottom: 0.35rem;
}

.nav-drawer-projects-head .nav-drawer-section-label {
  margin: 0;
}

.nav-drawer-new-btn {
  margin: 0;
  padding: 0.2rem 0.5rem;
  font-size: 0.68rem;
}

.nav-drawer-projects-search {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0 1rem 0.5rem;
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--ph-surface-3);
  background: var(--ph-bg);
}

.nav-drawer-projects-search input {
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--ph-white);
  font-size: 0.8rem;
  outline: none;
  font-family: var(--benying-font);
}

.nav-drawer-project-list {
  max-height: min(40vh, 320px);
  overflow-y: auto;
  padding: 0 0.35rem 0.5rem;
}

.nav-drawer-project-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.65rem;
  text-decoration: none;
  color: var(--ph-white);
  font-size: 0.86rem;
  border-radius: 4px;
}

.nav-drawer-project-item:hover {
  background: rgba(0, 243, 243, 0.08);
}

.nav-drawer-project-item.active {
  background: rgba(255, 176, 0, 0.12);
}

.nav-drawer-project-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ph-cyan);
  flex-shrink: 0;
}

.nav-drawer-project-item.active .nav-drawer-project-dot {
  background: var(--ph-amber);
}

.nav-drawer-project-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
}

.nav-drawer-project-meta {
  font-size: 0.65rem;
  opacity: 0.55;
  flex-shrink: 0;
}

.nav-drawer-show-all {
  display: block;
  margin: 0.35rem 1rem 0.75rem;
  font-size: 0.78rem;
  color: var(--ph-cyan);
  text-decoration: none;
}

.nav-drawer-show-all:hover {
  text-decoration: underline;
}

/* —— 右侧用户菜单 —— */
.user-menu-wrap {
  position: relative;
}

.user-menu-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  box-sizing: border-box;
  border: 1px solid var(--ph-surface-3);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}

.user-menu-trigger:hover {
  border-color: var(--ph-amber);
}

.user-avatar {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--ph-amber), var(--ph-cyan));
  color: var(--ph-bg);
  font-size: 0.75rem;
  font-weight: 800;
}

.user-avatar--lg {
  width: 40px;
  height: 40px;
  font-size: 0.95rem;
}

.user-menu-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: min(280px, 92vw);
  background: var(--ph-surface-2);
  border: 2px solid var(--ph-surface-3);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.5);
  z-index: 300;
  padding: 0.5rem 0;
}

.user-menu-panel[hidden] {
  display: none;
}

.user-menu-header {
  display: flex;
  gap: 0.65rem;
  padding: 0.65rem 0.85rem;
  align-items: center;
}

.user-menu-identity strong {
  display: block;
  color: var(--ph-amber);
}

.user-menu-hr {
  border: 0;
  border-top: 1px solid var(--ph-surface-3);
  margin: 0.35rem 0;
}

.user-menu-section {
  padding: 0.15rem 0;
}

.user-menu-item {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  padding: 0.5rem 0.85rem;
  border: 0;
  background: transparent;
  color: var(--ph-white);
  font-size: 0.86rem;
  text-decoration: none;
  cursor: pointer;
  font-family: var(--benying-font);
  text-align: left;
}

.user-menu-item:hover {
  background: rgba(0, 243, 243, 0.08);
  color: var(--ph-cyan);
}

.user-menu-item--static {
  cursor: default;
}

.user-menu-item--static:hover {
  background: transparent;
  color: var(--ph-white);
}

.user-menu-item .topbar-llm {
  max-width: none;
}

.topbar-nav {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: thin;
  padding: 0.25rem 0;
}

.topbar-nav::-webkit-scrollbar {
  height: 4px;
}

.topbar-tab {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.65rem;
  font-size: 0.82rem;
  text-decoration: none;
  color: var(--ph-white);
  opacity: 0.75;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}

.topbar-tab i {
  font-size: 1rem;
  opacity: 0.85;
}

.topbar-tab:hover {
  opacity: 1;
  color: var(--ph-cyan);
}

.topbar-tab.active {
  opacity: 1;
  color: var(--ph-amber);
  border-bottom-color: var(--ph-amber);
  font-weight: 700;
}

.topbar-tab--workflow {
  padding: 0.55rem 0.75rem;
  font-size: 0.84rem;
  margin-bottom: -1px;
}

.topbar-nav--workflow .topbar-tab.active {
  border-bottom-width: 3px;
  background: rgba(255, 176, 0, 0.06);
}

.topbar-tab--muted {
  opacity: 0.4;
  font-style: italic;
}

.topbar-workflow-context {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  flex-shrink: 0;
  max-width: 220px;
  padding-right: 0.75rem;
  margin-right: 0.25rem;
  border-right: 1px solid var(--ph-surface-3);
}

.topbar-workflow-label {
  font-size: 0.62rem;
  flex-shrink: 0;
}

.topbar-workflow-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--ph-amber);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-divider {
  width: 1px;
  height: 1.25rem;
  background: var(--ph-surface-3);
  flex-shrink: 0;
  margin: 0 0.15rem;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.topbar-actions .ph-button {
  margin: 0;
  padding: 0.35rem 0.65rem;
  font-size: 0.72rem;
}

.topbar-llm {
  font-size: 0.72rem;
  max-width: 6rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* —— 主体：全宽内容（项目列表在看板 / 菜单抽屉） —— */
.app-v2-body {
  display: flex;
  flex: 1;
  min-height: 0;
  min-height: calc(100vh - 90px);
}

.project-rail {
  display: none !important;
}

.project-rail-head {
  padding: 0.75rem 0.75rem 0.5rem;
  border-bottom: 1px solid var(--ph-surface-3);
}

.project-rail-head .ph-heading {
  font-size: 0.78rem;
  margin-bottom: 0.35rem;
  border-left-width: 3px;
  padding-left: 8px;
}

.project-rail-count {
  font-size: 0.72rem;
  opacity: 0.65;
}

.project-rail-new {
  width: 100%;
  margin-top: 0.5rem;
}

.project-rail-list {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.project-rail-item {
  display: block;
  padding: 0.55rem 0.6rem;
  text-decoration: none;
  color: var(--ph-white);
  border: 1px solid var(--ph-surface-3);
  background: var(--ph-surface-1);
  transition: border-color 0.15s, background 0.15s;
}

.project-rail-item:hover {
  border-color: var(--ph-cyan);
  background: rgba(0, 243, 243, 0.06);
}

.project-rail-item.active {
  border-color: var(--ph-amber);
  background: rgba(255, 176, 0, 0.1);
  box-shadow: inset 3px 0 0 var(--ph-amber);
}

.project-rail-item-title {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-rail-item-meta {
  display: flex;
  justify-content: space-between;
  gap: 0.35rem;
  margin-top: 0.25rem;
  font-size: 0.68rem;
  opacity: 0.72;
}

.project-rail-state {
  color: var(--ph-cyan);
  flex-shrink: 0;
}

.project-rail-time {
  flex-shrink: 0;
}

.project-rail-foot {
  padding: 0.5rem 0.75rem 0.75rem;
  border-top: 1px solid var(--ph-surface-3);
  font-size: 0.72rem;
}

.app-v2-main {
  --v2-block-gap: 1rem;
  --v2-content-inline: 1.25rem;
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.app-v2-main .main-header {
  padding: 0.75rem 1.25rem 0.5rem;
  margin-bottom: 0;
}

.app-v2-main .page-content {
  flex: 1;
  overflow: auto;
  padding: 0 var(--v2-content-inline) 2rem;
}

.app-v2-main .system-status-bar {
  margin: 0 var(--v2-content-inline) var(--v2-block-gap);
}

.project-context-banner {
  margin: 0 var(--v2-content-inline) var(--v2-block-gap);
  padding: 0.65rem 0.85rem;
  border: 1px dashed var(--ph-cyan);
  background: rgba(0, 243, 243, 0.06);
  font-size: 0.85rem;
}

.project-context-banner strong {
  color: var(--ph-amber);
}

/* —— 看板首页三栏（GitHub Home） —— */
body.route-board .main-header {
  display: none;
}

/* —— 项目内页（GitHub 仓库页） —— */
body.route-project .main-header {
  display: none;
}

body.route-project .project-context-banner {
  display: none !important;
}

body.route-project .topbar-workflow-context {
  display: none;
}

body.route-project .topbar-nav--workflow {
  padding-left: 0.25rem;
}

body.route-project .app-v2-main .page-content {
  padding: 0 var(--v2-content-inline) 2rem;
}

body.route-stage-topic .app-v2-main .page-content {
  padding: 0 var(--v2-content-inline) 1.5rem;
}

body.route-stage-project .app-v2-main .page-content {
  padding: 0 var(--v2-content-inline) 1.5rem;
}

/* —— 单项目看板（顶栏「项目」） —— */
.project-board {
  display: flex;
  flex-direction: column;
  gap: var(--v2-block-gap);
  width: 100%;
  min-width: 0;
}

.project-board .ph-block {
  margin-bottom: 0;
}

.project-board-hero.ph-block {
  margin: 0;
}

.project-board-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  column-gap: var(--v2-block-gap);
  row-gap: var(--v2-block-gap);
  padding: 0;
  align-items: start;
}

.project-board-main {
  grid-column: 1;
  display: flex;
  flex-direction: column;
  gap: var(--v2-block-gap);
  min-width: 0;
}

.project-board-sidebar {
  grid-column: 2;
  display: flex;
  flex-direction: column;
  gap: var(--v2-block-gap);
  position: sticky;
  top: 6.5rem;
}

.project-sidebar-heading {
  font-size: 0.88rem;
  margin: 0 0 0.6rem;
}

.project-sidebar-dl {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.project-sidebar-dl-row {
  display: grid;
  grid-template-columns: 5.5rem minmax(0, 1fr);
  gap: 0.35rem 0.5rem;
  font-size: 0.78rem;
}

.project-sidebar-dl dt {
  margin: 0;
  color: var(--ph-surface-3);
  font-weight: 500;
}

.project-sidebar-dl dd {
  margin: 0;
  color: var(--ph-white);
  word-break: break-word;
}

.project-sidebar-note {
  margin: 0.65rem 0 0;
  font-size: 0.68rem;
  opacity: 0.55;
}

.project-board-sidebar .project-board-events {
  max-height: 280px;
  overflow-y: auto;
}

.project-board-events-empty {
  margin: 0;
  font-size: 0.75rem;
}

.project-board-hero-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.project-board-hero-star {
  flex-shrink: 0;
}

.project-board-hero-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.4rem;
}

.project-board-title-wrap {
  flex: 1;
  min-width: 0;
}

.project-board-title {
  margin: 0;
  font-size: 1.2rem;
  color: var(--ph-amber);
  line-height: 1.35;
}

.project-board-title-input {
  width: 100%;
  margin: 0;
  padding: 0.35rem 0.5rem;
  font-family: var(--benying-font);
  font-size: 1.2rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--ph-white);
  background: var(--ph-surface-1);
  border: 2px solid var(--ph-cyan);
  box-shadow: 2px 2px 0 var(--ph-surface-3);
  box-sizing: border-box;
}

.project-board-title-input:focus {
  outline: none;
  border-color: var(--ph-amber);
}

.project-board-meta {
  margin: 0;
  flex: 1;
  min-width: 0;
  text-align: left;
}

.project-board-hero-bar .stage-repo-rename {
  flex-shrink: 0;
  margin-left: auto;
}

.project-board-section .ph-heading {
  font-size: 0.95rem;
  margin-bottom: 0.65rem;
}

.project-checklist {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.project-checklist-item {
  display: grid;
  grid-template-columns: 2rem 1fr;
  column-gap: 0.75rem;
  padding: 0.65rem 0;
  position: relative;
}

.project-checklist-item:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 0.9375rem;
  top: 2.35rem;
  bottom: 0;
  width: 2px;
  background: var(--ph-surface-3);
  transform: translateX(-50%);
}

.project-checklist-item.is-done:not(:last-child)::after {
  background: var(--ph-amber);
  opacity: 0.55;
}

.project-checklist-marker {
  width: 1.875rem;
  height: 1.875rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--ph-surface-3);
  background: var(--ph-surface-2);
  font-size: 1rem;
  line-height: 1;
  z-index: 1;
}

.project-checklist-item.is-done .project-checklist-marker {
  border-color: var(--ph-amber);
  background: rgba(255, 176, 0, 0.12);
  color: var(--ph-amber);
}

.project-checklist-item.is-current .project-checklist-marker {
  border-color: var(--ph-amber);
  background: var(--ph-amber);
  color: var(--ph-bg);
  box-shadow: 0 0 0 2px var(--ph-surface-2);
}

.project-checklist-item.is-pending .project-checklist-marker {
  color: var(--ph-surface-3);
  opacity: 0.85;
}

.project-checklist-body {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding-top: 0.1rem;
  min-width: 0;
}

.project-checklist-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem 0.6rem;
}

.project-checklist-badge {
  font-size: 0.68rem;
  padding: 0.1rem 0.4rem;
  border: 1px solid var(--ph-amber);
  color: var(--ph-amber);
  background: rgba(255, 176, 0, 0.08);
  line-height: 1.3;
}

.project-checklist-label {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--ph-white);
  text-decoration: none;
  width: fit-content;
}

.project-checklist-details {
  list-style: none;
  margin: 0;
  padding: 0.35rem 0 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  border-top: 1px solid var(--ph-surface-3);
}

.project-checklist-item.is-pending .project-checklist-details {
  border-top-color: transparent;
  padding-top: 0;
}

.project-checklist-detail-row {
  display: grid;
  grid-template-columns: 4.25rem minmax(0, 1fr);
  gap: 0.35rem 0.5rem;
  font-size: 0.78rem;
  line-height: 1.4;
}

.project-checklist-detail-k {
  color: var(--ph-surface-3);
  flex-shrink: 0;
}

.project-checklist-detail-v {
  color: var(--ph-white);
  opacity: 0.92;
  word-break: break-word;
}

.project-checklist-item.is-pending .project-checklist-detail-v {
  opacity: 0.55;
}

.project-checklist-label:hover {
  color: var(--ph-amber);
  text-decoration: underline;
}

.project-checklist-item.is-pending .project-checklist-label {
  color: var(--ph-surface-3);
  font-weight: 500;
}

.project-checklist-item.is-current .project-checklist-label {
  color: var(--ph-amber);
}

.project-board-section--progress .ph-heading {
  margin-bottom: 0.5rem;
}

.project-board-events {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.project-board-event {
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--ph-surface-3);
  background: var(--ph-surface-1);
  font-size: 0.84rem;
}

.project-board-event-time {
  display: block;
  font-size: 0.68rem;
  opacity: 0.6;
  margin-bottom: 0.2rem;
}

.project-board-event-msg {
  color: var(--ph-white);
}

/* —— 选题页（GitHub 仓库式） —— */
.stage-repo {
  display: flex;
  flex-direction: column;
  gap: var(--v2-block-gap);
  min-height: 0;
}

.stage-repo .ph-block {
  margin-bottom: 0;
}

.repo-list-toolbar-end {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.topic-list-delete-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin: 0;
  padding: 0;
  border: 1px solid var(--ph-surface-3);
  background: var(--ph-surface-1);
  color: #f87171;
  cursor: pointer;
}

.topic-list-delete-btn:hover {
  border-color: #f87171;
  background: rgba(248, 113, 113, 0.12);
}

.topic-list-delete-btn i {
  font-size: 1.1rem;
  line-height: 1;
}

.topic-list-delete-btn[hidden] {
  display: none;
}

.topic-list-sort-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin: 0;
  padding: 0;
  border: 1px solid var(--ph-surface-3);
  background: var(--ph-surface-1);
  color: var(--ph-cyan);
  cursor: pointer;
}

.topic-list-sort-btn:hover {
  border-color: var(--ph-cyan);
  background: rgba(0, 243, 243, 0.08);
}

.topic-list-sort-btn i {
  font-size: 1.1rem;
  line-height: 1;
}

.stage-repo-star {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin: 0;
  padding: 0;
  border: 1px solid var(--ph-surface-3);
  background: var(--ph-surface-1);
  color: var(--ph-white);
  cursor: pointer;
  opacity: 0.75;
}

.stage-repo-star:hover {
  border-color: var(--ph-amber);
  opacity: 1;
}

.stage-repo-star.is-starred {
  border-color: var(--ph-amber);
  color: var(--ph-amber);
  opacity: 1;
  background: rgba(255, 176, 0, 0.12);
}

.stage-repo-star i {
  font-size: 1.15rem;
  line-height: 1;
}

.stage-repo-rename {
  flex-shrink: 0;
  margin: 0;
  padding: 0.2rem 0.55rem;
  font-size: 0.72rem;
  line-height: 1.25;
  white-space: nowrap;
}

.project-item-star {
  color: var(--ph-amber);
  font-size: 0.82rem;
  margin-right: 0.25rem;
  vertical-align: -1px;
}

.board-repo-item.is-starred,
.nav-drawer-project-item.is-starred {
  border-color: rgba(255, 176, 0, 0.35);
}

.stage-repo-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: var(--v2-block-gap);
  align-items: start;
}

.stage-repo-main {
  padding: 0;
  overflow: hidden;
}

.repo-list-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.65rem 1rem;
  border-bottom: 1px solid var(--ph-surface-3);
  background: var(--ph-surface-2);
}

.repo-list-toolbar-start {
  display: flex;
  align-items: baseline;
  gap: 0.65rem;
  flex-wrap: wrap;
  min-width: 0;
}

.repo-list-fav-link {
  text-decoration: none;
  color: var(--ph-cyan);
}

.repo-list-fav-link:hover {
  color: var(--ph-amber);
  text-decoration: underline;
}

.repo-list-heading {
  margin: 0;
  font-size: 0.95rem;
}

.repo-list-body {
  display: flex;
  flex-direction: column;
}

.repo-list-empty {
  padding: 1.25rem 1rem;
  margin: 0;
}

.repo-list-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0.5rem 0.65rem;
  align-items: center;
  width: 100%;
  padding: 0.65rem 1rem;
  border: 0;
  border-bottom: 1px solid var(--ph-surface-3);
  background: var(--ph-surface-1);
  color: var(--ph-white);
  text-align: left;
  font-family: var(--benying-font);
}

.stage-repo--topic .repo-list-row.topic-row-card {
  cursor: pointer;
  padding: 0.65rem 0.75rem 0.65rem 0;
  gap: 0.35rem 0;
}

.stage-repo--topic .topic-row-card:focus-visible {
  outline: 2px solid var(--ph-cyan);
  outline-offset: -2px;
}

.stage-repo--topic .topic-row-card:hover .repo-list-name {
  color: var(--ph-cyan);
}

.stage-repo--topic .topic-row-lead {
  gap: 0;
  margin: 0;
  padding: 0;
}

.stage-repo--topic .topic-row-main,
.stage-repo--topic .topic-row-main .repo-list-main {
  padding: 0;
  margin: 0;
}

.stage-repo--topic .repo-list-body {
  padding: 0;
  margin: 0;
}

.stage-repo--topic .repo-list-row.is-checked {
  background: rgba(0, 243, 243, 0.08);
  box-shadow: inset 3px 0 0 var(--ph-cyan);
}

.repo-list-row:hover {
  background: rgba(0, 243, 243, 0.06);
}

.repo-list-row--active {
  background: rgba(255, 176, 0, 0.1);
  box-shadow: inset 3px 0 0 var(--ph-amber);
}

.repo-list-icon {
  font-size: 1.1rem;
  color: var(--ph-cyan);
  opacity: 0.85;
}

.repo-list-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.repo-list-name {
  font-weight: 600;
  font-size: 0.9rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.repo-list-desc {
  font-size: 0.78rem;
  opacity: 0.65;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.repo-list-meta {
  font-size: 0.72rem;
  opacity: 0.55;
  flex-shrink: 0;
}

/* 选题页：标题更大、副文案更紧、右侧显示生成时间 */
.stage-repo--topic .repo-list-main {
  gap: 0.08rem;
}

.stage-repo--topic .repo-list-name {
  font-size: 1.05rem;
  line-height: 1.3;
}

.stage-repo--topic .repo-list-desc {
  font-size: 0.76rem;
  line-height: 1.25;
}

.topic-row-lead {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.topic-row-action {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ph-white);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0.42;
}

.topic-row-action:hover {
  opacity: 0.78;
}

.topic-row-star.is-starred {
  color: var(--ph-amber);
  opacity: 1;
}

.topic-row-star.is-starred:hover {
  opacity: 1;
}

.topic-row-pick {
  opacity: 1;
  box-sizing: border-box;
  border: 2px solid var(--ph-white);
  background: transparent;
}

.topic-row-pick:hover {
  opacity: 1;
  border-color: var(--ph-cyan);
}

.topic-row-pick.is-picked {
  color: var(--ph-cyan);
  border-color: var(--ph-cyan);
  background: rgba(0, 243, 243, 0.14);
  box-shadow: 0 0 0 1px rgba(0, 243, 243, 0.35);
}

.topic-row-pick-icon {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1;
}

.topic-row-main {
  min-width: 0;
  width: 100%;
  padding: 0;
  margin: 0;
}

.topic-row-prov-hint {
  color: var(--ph-cyan);
  opacity: 0.85;
  max-width: 8rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topic-row-trail {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.stage-repo--topic .repo-list-meta {
  min-width: auto;
  text-align: right;
  font-size: 0.68rem;
  font-variant-numeric: tabular-nums;
  opacity: 0.62;
  white-space: nowrap;
}

.topic-favorites-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.topic-favorites-list {
  display: flex;
  flex-direction: column;
  gap: var(--v2-block-gap, 1rem);
}

.topic-fav-card {
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--ph-surface-3);
  background: var(--ph-surface-1);
}

.topic-fav-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
}

.topic-fav-title {
  margin: 0;
  font-size: 1rem;
  color: var(--ph-amber);
}

.topic-fav-desc {
  margin: 0.35rem 0 0;
  line-height: 1.4;
}

.topic-fav-meta {
  margin: 0.35rem 0 0;
  font-size: 0.72rem;
}

/* 选题详情小弹窗 */
.topic-detail-popover-backdrop {
  position: fixed;
  inset: 0;
  z-index: 450;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.55);
}

.topic-detail-popover {
  display: flex;
  flex-direction: column;
  width: min(920px, 94vw);
  max-height: min(90vh, 920px);
  min-height: min(480px, 72vh);
  overflow: hidden;
  margin: 0;
  padding: 1.5rem 1.6rem 1.25rem;
  border: 2px solid var(--ph-amber);
  box-shadow: 6px 6px 0 var(--ph-surface-3);
}

.topic-detail-popover-body {
  flex: 1;
  min-height: 0;
  margin: 0 -0.15rem 0 0;
  padding-right: 0.2rem;
}

.topic-detail-popover-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.topic-detail-popover-title {
  margin: 0;
  font-size: 1.42rem;
  line-height: 1.4;
  color: var(--ph-amber);
  flex: 1;
}

.topic-detail-popover-head-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}

.topic-detail-popover-delete,
.topic-detail-popover-close {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin: 0;
  padding: 0;
  border: 1px solid var(--ph-surface-3);
  background: var(--ph-surface-2);
  cursor: pointer;
}

.topic-detail-popover-delete {
  color: #f87171;
}

.topic-detail-popover-delete:hover {
  border-color: #f87171;
  background: rgba(248, 113, 113, 0.12);
}

.topic-detail-popover-delete i {
  font-size: 1.1rem;
  line-height: 1;
}

.topic-detail-popover-close {
  color: var(--ph-white);
}

.topic-detail-popover-close:hover {
  border-color: var(--ph-amber);
  color: var(--ph-amber);
}

.topic-detail-popover-dl {
  margin: 0;
}

.topic-detail-popover-row {
  margin-bottom: 0.85rem;
}

.topic-detail-popover-row:last-child {
  margin-bottom: 0;
}

.topic-detail-popover-row dt {
  margin: 0 0 0.4rem;
  font-size: 0.85rem;
  color: var(--ph-surface-3);
  font-weight: 600;
  letter-spacing: 0.02em;
}

.topic-detail-popover-row dd {
  margin: 0;
  font-size: 1.06rem;
  line-height: 1.58;
  color: var(--ph-white);
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.topic-detail-popover-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-shrink: 0;
  margin-top: 0.85rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--ph-surface-3);
}

.topic-detail-popover-foot-end {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  margin-left: auto;
}

.topic-detail-prov-wrap {
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px dashed var(--ph-surface-3);
}

.topic-detail-prov-heading {
  margin: 0 0 0.35rem;
  font-size: 0.92rem;
  color: var(--ph-cyan);
}

.topic-detail-prov-lead {
  margin: 0 0 0.65rem;
  font-size: 0.68rem;
}

.topic-prov-section {
  margin-bottom: 0.75rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--ph-surface-3);
  border-radius: 6px;
  background: var(--ph-surface-2);
}

.topic-prov-section-title {
  margin: 0 0 0.45rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ph-amber);
}

.topic-prov-section-body {
  font-size: 0.72rem;
  line-height: 1.45;
}

.topic-prov-dl {
  margin: 0;
}

.topic-prov-row {
  margin-bottom: 0.5rem;
}

.topic-prov-row:last-child {
  margin-bottom: 0;
}

.topic-prov-row dt {
  margin: 0 0 0.2rem;
  font-size: 0.66rem;
  color: var(--ph-surface-3);
  font-weight: 600;
}

.topic-prov-row dd {
  margin: 0;
  font-size: 0.74rem;
  color: var(--ph-white);
  white-space: pre-wrap;
  word-break: break-word;
}

.topic-prov-list {
  margin: 0.25rem 0 0.5rem;
  padding-left: 1.1rem;
}

.topic-prov-list li {
  margin-bottom: 0.2rem;
}

.topic-prov-subhead {
  margin: 0.35rem 0 0.2rem;
  font-size: 0.66rem;
  font-weight: 600;
  color: var(--ph-surface-3);
}

.topic-prov-badge {
  display: inline-block;
  margin: 0 0.25rem 0.2rem 0;
  padding: 0.1rem 0.35rem;
  font-size: 0.62rem;
  border-radius: 4px;
  background: var(--ph-surface-3);
  color: var(--ph-white);
}

.topic-prov-badge.is-ok {
  background: rgba(0, 243, 243, 0.15);
  color: var(--ph-cyan);
}

.topic-prov-score {
  font-size: 1.1rem;
  color: var(--ph-amber);
}

.topic-prov-score--lg {
  font-size: 1.25rem;
}

.topic-eval-dim-table,
.topic-eval-rank-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.72rem;
  margin: 0.35rem 0 0.5rem;
}

.topic-eval-dim-table th,
.topic-eval-dim-table td,
.topic-eval-rank-table th,
.topic-eval-rank-table td {
  padding: 0.35rem 0.5rem;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  vertical-align: top;
}

.topic-eval-dim-desc {
  display: block;
  margin-top: 0.12rem;
  font-size: 0.64rem;
  color: rgba(255, 255, 255, 0.45);
  font-weight: normal;
}

.topic-eval-dim-score .topic-prov-score {
  font-size: 0.95rem;
}

.topic-eval-dim-row.is-low td:last-child {
  color: #f59e0b;
}

.topic-eval-rank-row.is-current {
  background: rgba(34, 211, 238, 0.08);
}

.topic-eval-ranking {
  margin: 0.25rem 0 0.5rem;
  padding-left: 1.2rem;
  font-size: 0.72rem;
}

.topic-eval-rank-item {
  margin: 0.2rem 0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.65rem;
}

.topic-eval-rank-item.is-current {
  color: var(--ph-cyan, #22d3ee);
}

.topic-eval-rank-no {
  opacity: 0.55;
  min-width: 1.5rem;
}

.topic-eval-rationale {
  margin: 0.25rem 0 0;
  font-size: 0.72rem;
  line-height: 1.55;
}

.topic-eval-details {
  margin-top: 0.5rem;
  font-size: 0.7rem;
}

.topic-eval-details summary {
  cursor: pointer;
  color: rgba(255, 255, 255, 0.62);
}

.topic-eval-details[open] summary {
  margin-bottom: 0.35rem;
}

.topic-eval-pre {
  margin: 0.35rem 0 0;
  padding: 0.5rem 0.65rem;
  font-size: 0.65rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
  background: rgba(0, 0, 0, 0.22);
  border-radius: 6px;
}

.topic-eval-pre--scroll {
  max-height: 220px;
  overflow: auto;
}

.topic-eval-pre--muted {
  opacity: 0.85;
}

.topic-eval-config-dims .topic-eval-dim-desc {
  display: block;
  margin-top: 0.12rem;
}

.topic-eval-node-sum {
  font-size: 0.7rem;
  line-height: 1.5;
}

.topic-prov-pipeline {
  margin: 0;
  padding-left: 1.1rem;
}

.topic-prov-pipeline-item {
  margin-bottom: 0.45rem;
}

.topic-prov-pipeline-name {
  font-weight: 600;
  color: var(--ph-white);
}

.topic-prov-pipeline-sum {
  margin: 0.15rem 0 0;
  font-size: 0.68rem;
  opacity: 0.85;
}

.topic-prov-search-log {
  margin: 0.45rem 0 0;
  padding-left: 0;
  list-style: none;
}

.topic-prov-search-log li {
  margin-bottom: 0.35rem;
  font-size: 0.68rem;
}

/* 滚动条：平时隐藏，悬停或滚动时显示细条 */
.overlay-scrollbar {
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: transparent transparent;
}

.overlay-scrollbar:hover {
  scrollbar-color: rgba(0, 243, 243, 0.38) transparent;
}

.overlay-scrollbar.is-scrolling {
  scrollbar-color: rgba(0, 243, 243, 0.55) transparent;
}

.overlay-scrollbar::-webkit-scrollbar {
  width: 5px;
  height: 0;
}

.overlay-scrollbar::-webkit-scrollbar-track {
  background: transparent;
}

.overlay-scrollbar::-webkit-scrollbar-thumb {
  background: transparent;
  border-radius: 4px;
}

.overlay-scrollbar:hover::-webkit-scrollbar-thumb,
.overlay-scrollbar.is-scrolling::-webkit-scrollbar-thumb {
  background: rgba(0, 243, 243, 0.48);
}

/* 选题收藏库弹层（选题页侧栏入口） */
.topic-favorites-popover-backdrop {
  position: fixed;
  inset: 0;
  z-index: 450;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.55);
}

.topic-favorites-popover {
  width: min(640px, 100%);
  max-height: min(78vh, 640px);
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 1rem 1.1rem;
  border: 2px solid var(--ph-cyan);
  box-shadow: 6px 6px 0 var(--ph-surface-3);
  overflow: hidden;
}

.topic-favorites-popover-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  flex-shrink: 0;
}

.topic-favorites-popover-title {
  margin: 0;
  font-size: 1.1rem;
  color: var(--ph-cyan);
}

.topic-favorites-popover-close {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  margin: 0;
  padding: 0;
  border: 1px solid var(--ph-surface-3);
  background: var(--ph-surface-2);
  color: var(--ph-white);
  cursor: pointer;
}

.topic-favorites-popover-close:hover {
  border-color: var(--ph-cyan);
  color: var(--ph-cyan);
}

.topic-favorites-popover-desc {
  margin: 0.35rem 0 0.65rem;
  flex-shrink: 0;
}

.topic-favorites-popover-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-right: 0.15rem;
}

.topic-favorites-popover-foot {
  flex-shrink: 0;
  margin-top: 0.75rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--ph-surface-3);
}

/* 环节 Agent 设置弹层 */
.stage-agent-settings-popover-backdrop {
  position: fixed;
  inset: 0;
  z-index: 460;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.55);
}

.stage-agent-settings-popover {
  display: flex;
  flex-direction: column;
  width: min(980px, 96vw);
  height: min(88vh, 920px);
  max-height: min(92vh, 920px);
  min-height: min(72vh, 640px);
  margin: 0;
  padding: 1.15rem 1.35rem 1.1rem;
  border: 2px solid var(--ph-cyan);
  box-shadow: 6px 6px 0 var(--ph-surface-3);
  overflow: hidden;
}

.stage-agent-settings-popover-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-shrink: 0;
  margin-bottom: 0.65rem;
}

.stage-agent-settings-popover-title {
  margin: 0;
  font-size: 1.1rem;
  color: var(--ph-cyan);
  flex-shrink: 0;
}

.stage-agent-settings-popover-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-left: auto;
  flex-shrink: 0;
}

.stage-agent-settings-popover-close {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  margin: 0;
  padding: 0;
  border: 1px solid var(--ph-surface-3);
  background: var(--ph-surface-2);
  color: var(--ph-white);
  cursor: pointer;
}

.stage-agent-settings-popover-close:hover {
  border-color: var(--ph-cyan);
  color: var(--ph-cyan);
}

.stage-agent-settings-popover-body {
  flex: 1;
  min-height: 0;
  padding-right: 0.15rem;
}

.stage-agent-settings-popover-body .agent-form--popover-tabs {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  flex: 1;
  min-height: 0;
  height: 100%;
}

.agent-popover-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  flex-shrink: 0;
  border-bottom: 1px solid var(--ph-surface-3);
  padding-bottom: 0.35rem;
}

.agent-popover-tabs--scroll {
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.agent-popover-tabs--scroll .agent-tab {
  flex-shrink: 0;
  white-space: nowrap;
}

.agent-popover-tabs .agent-tab {
  margin: 0;
  padding: 0.45rem 0.75rem;
  border: 1px solid transparent;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--ph-white);
  opacity: 0.65;
  cursor: pointer;
  font-family: var(--benying-font);
  font-size: 0.82rem;
}

.agent-popover-tabs .agent-tab:hover {
  opacity: 0.9;
  background: rgba(0, 243, 243, 0.06);
}

.agent-popover-tabs .agent-tab.active {
  opacity: 1;
  border-bottom-color: var(--ph-amber);
  color: var(--ph-amber);
  background: rgba(255, 176, 0, 0.08);
}

.agent-popover-panels {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  padding-right: 0.1rem;
}

.agent-popover-panel {
  display: none;
}

.agent-popover-panel.is-active {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.agent-popover-panel--subnav-fill.is-active > .agent-popover-panel-lead,
.agent-popover-panel--subnav-fill.is-active > .form-hint {
  flex-shrink: 0;
}

.agent-popover-panel--subnav-fill.is-active .agent-popover-panel-lead {
  margin-bottom: 0.45rem;
}

.agent-popover-panel.is-active:not(.agent-popover-panel--subnav-fill) {
  overflow-y: auto;
}

.agent-popover-panel--skill-fill.is-active {
  overflow-y: auto;
}

.skill-mgmt--popover .panel {
  padding: 0.5rem 0.6rem;
  margin-bottom: 0.45rem;
}

.skill-mgmt--popover .skill-card h3 {
  font-size: 0.88rem;
}

.skill-md-collapse {
  margin: 0.35rem 0 0.5rem;
  font-size: 0.82rem;
}

.skill-md-collapse summary {
  cursor: pointer;
  color: var(--ph-cyan, #22d3ee);
  margin-bottom: 0.35rem;
}

.agent-popover-panel-lead {
  margin: 0 0 0.65rem;
  line-height: 1.5;
  opacity: 0.92;
}

.agent-popover-skill-md {
  width: 100%;
  box-sizing: border-box;
  font-family: ui-monospace, monospace;
  font-size: 0.82rem;
  line-height: 1.45;
  min-height: 12rem;
}

.agent-popover-caps .topic-agent-cap-list {
  margin: 0;
}

.agent-prompt-stage-nav,
.agent-research-arch-nav.agent-popover-subnav {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  margin: 0;
}

.research-arch-depth-radios {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-bottom: 0.25rem;
}

.research-arch-depth-option {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.15rem 0.5rem;
  align-items: start;
  cursor: pointer;
  font-size: 0.82rem;
}

.research-arch-depth-option input {
  margin-top: 0.2rem;
}

.research-arch-depth-label {
  font-weight: 600;
  color: var(--ph-white);
}

.research-arch-depth-option .topic-agent-cap-hint {
  grid-column: 2;
}

.research-arch-tool-configs {
  margin-top: 0.7rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.research-tool-config[hidden] {
  display: none !important;
}

.agent-sources-mgmt .source-card {
  min-width: min(320px, 86vw);
}

.agent-prompt-subtabs {
  display: flex;
  flex-wrap: nowrap;
  flex-shrink: 0;
  gap: 0.2rem;
  overflow-x: auto;
  padding-bottom: 0.35rem;
  margin-bottom: 0.45rem;
  border-bottom: 1px solid var(--ph-surface-3);
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.agent-prompt-subtab {
  flex-shrink: 0;
  white-space: nowrap;
  font-size: 0.76rem;
  padding: 0.35rem 0.55rem;
}

.agent-prompt-subpanels {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-right: 0.1rem;
}

.agent-prompt-subpanel {
  display: none;
}

.agent-prompt-subpanel.is-active {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.agent-prompt-subpanel.is-active > .agent-prompt-subpanel-hint {
  flex-shrink: 0;
}

.agent-prompt-subpanel.is-active .agent-user-input-mgmt,
.agent-prompt-subpanel.is-active .agent-intent-routing-mgmt,
.agent-prompt-subpanel.is-active .agent-research-loop-mgmt,
.agent-prompt-subpanel.is-active .agent-topic-diverge-mgmt,
.agent-prompt-subpanel.is-active .agent-topic-eval-mgmt,
.agent-prompt-subpanel.is-active .agent-report-structure-mgmt,
.agent-prompt-subpanel.is-active .agent-final-output-mgmt {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.agent-report-structure-mgmt,
.agent-final-output-mgmt {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.report-field-required {
  margin: 0.15rem 0 0;
  font-size: 0.72rem;
}

.final-field-meta-row {
  margin-bottom: 0.35rem;
}

.agent-config-textarea--mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.68rem;
}

.agent-model-mgmt {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-height: 0;
}

.agent-popover-panel.is-active[data-agent-panel='model'] {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.agent-popover-panel.is-active[data-agent-panel='model'] .agent-model-mgmt {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}

.agent-model-card {
  padding: 0.75rem 0.85rem;
}

.agent-model-card--primary .agent-model-card-lead {
  margin: 0.2rem 0 0.65rem;
  font-size: 0.68rem;
  line-height: 1.45;
  opacity: 0.75;
}

.model-field-hint {
  margin: 0.3rem 0 0;
  font-size: 0.64rem;
}

.model-base-url-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
  margin: 0.15rem 0 0.5rem;
  padding: 0.45rem 0.55rem;
  border-radius: 6px;
  background: var(--ph-surface-2);
  border: 1px solid var(--ph-surface-3);
}

.model-base-url-label {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--ph-surface-3);
}

.model-base-url-preview {
  font-size: 0.68rem;
  color: var(--ph-cyan);
  word-break: break-all;
}

.model-base-url-auto-hint {
  margin: 0;
  font-size: 0.62rem;
  opacity: 0.55;
}

.model-base-url-custom {
  margin-bottom: 0.35rem;
}

.model-card-advanced {
  margin: 0.35rem 0 0;
  font-size: 0.72rem;
  border: 1px solid var(--ph-surface-3);
  border-radius: 6px;
  padding: 0.35rem 0.55rem;
  background: var(--ph-surface-2);
}

.model-card-advanced summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--ph-white);
  list-style: none;
}

.model-card-advanced summary::-webkit-details-marker {
  display: none;
}

.model-card-advanced-body {
  margin-top: 0.55rem;
  padding-top: 0.55rem;
  border-top: 1px solid var(--ph-surface-3);
}

.model-card-advanced--node {
  margin-top: 0.45rem;
}

.model-node-base-hint {
  margin: 0 0 0.4rem;
  font-size: 0.64rem;
}

.model-node-base-hint code {
  color: var(--ph-cyan);
  font-size: 0.64rem;
}

.agent-model-card-head {
  margin-bottom: 0.55rem;
}

.agent-model-card-title {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 600;
}

.agent-model-card-desc {
  margin: 0.35rem 0 0.65rem;
}

.agent-model-test-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin-top: 0.5rem;
}

.agent-model-node-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.agent-model-node-row {
  border: 1px solid var(--ph-surface-4);
  border-radius: 6px;
  padding: 0.5rem 0.65rem;
  background: var(--ph-surface-2);
}

.agent-model-node-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.65rem;
}

.agent-model-node-label {
  font-size: 0.78rem;
  font-weight: 600;
  flex: 1;
  min-width: 6rem;
}

.agent-model-node-toggle {
  font-size: 0.68rem;
}

.model-node-bind-hint {
  flex: 1 1 100%;
  margin: 0;
  font-size: 0.62rem;
}

.agent-model-node-body {
  margin-top: 0.55rem;
  padding-top: 0.55rem;
  border-top: 1px solid var(--ph-surface-3);
}

.agent-model-node-body[hidden] {
  display: none !important;
}

.model-node-reset-btn {
  margin-top: 0.5rem;
  font-size: 0.68rem;
}

.agent-model-advanced {
  margin-top: 0.25rem;
  font-size: 0.68rem;
}

.agent-model-advanced-ul {
  margin: 0.35rem 0 0;
  padding-left: 1.1rem;
}

.model-picker-sub {
  display: none;
  margin-top: 0.45rem;
}

.model-picker-sub.is-visible {
  display: block;
}

.model-thinking-modes {
  margin-top: 0.55rem;
  padding: 0.45rem 0.55rem;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.model-thinking-modes.is-disabled {
  opacity: 0.55;
}

.model-thinking-label {
  margin: 0 0 0.35rem;
}

.model-thinking-radios {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1.25rem;
}

.model-thinking-option {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  cursor: pointer;
}

.model-api-id-hint {
  margin: 0.45rem 0 0;
  font-size: 0.68rem;
  color: var(--ph-cyan, #22d3ee);
}

.model-api-list-hint {
  margin: 0.35rem 0 0;
  font-size: 0.64rem;
}

.model-refresh-models-btn {
  margin-top: 0.35rem;
  font-size: 0.68rem;
}

.model-custom-name-input:not(.is-visible) {
  display: none;
}

.model-range-val {
  color: var(--ph-cyan);
  font-weight: 600;
}

.agent-research-loop-mgmt {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.research-loop-strategy-opts,
.topic-diverge-strategy-opts {
  margin: 0.35rem 0 0;
  padding: 0;
}

.agent-topic-diverge-mgmt {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.topic-diverge-count-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 1rem;
}

.topic-diverge-count-range {
  flex: 1;
  min-width: 10rem;
  max-width: 20rem;
}

.topic-diverge-count-input {
  width: 4.5rem;
  flex: 0 0 auto;
}

.topic-diverge-count-hint {
  margin: 0;
  flex: 1 1 100%;
}

.topic-diverge-strategy-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.topic-diverge-strategy-label {
  flex: 0 1 auto;
  min-width: 0;
}

.topic-diverge-strategy-label .topic-agent-cap-name {
  flex-shrink: 0;
}

.topic-diverge-strategy-help {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.05rem;
  height: 1.05rem;
  flex-shrink: 0;
  border-radius: 50%;
  border: 1px solid var(--ph-surface-4);
  color: var(--ph-text-muted);
  background: var(--ph-surface-2);
  cursor: help;
  vertical-align: middle;
}

.topic-diverge-strategy-help .ri-question-line {
  font-size: 0.72rem;
  line-height: 1;
}

.topic-diverge-strategy-tooltip {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  position: absolute;
  left: 50%;
  bottom: calc(100% + 0.45rem);
  transform: translateX(-50%);
  z-index: 20;
  width: max-content;
  max-width: min(18rem, 70vw);
  padding: 0.45rem 0.55rem;
  border-radius: 6px;
  border: 1px solid var(--ph-surface-4);
  background: var(--ph-surface-1);
  color: var(--ph-text);
  font-size: 0.65rem;
  line-height: 1.45;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
  transition: opacity 0.12s ease, visibility 0.12s ease;
}

.topic-diverge-strategy-help:hover .topic-diverge-strategy-tooltip,
.topic-diverge-strategy-help:focus-visible .topic-diverge-strategy-tooltip {
  visibility: visible;
  opacity: 1;
}

.topic-diverge-strategy-remove {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  padding: 0;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: var(--ph-text-muted);
  cursor: pointer;
}

.topic-diverge-strategy-remove:hover {
  color: var(--ph-danger, #f66);
  background: rgba(255, 80, 80, 0.12);
}

.topic-diverge-strategy-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin-top: 0.65rem;
}

.topic-diverge-strategy-dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 480;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.6);
}

.topic-diverge-strategy-dialog-backdrop[hidden] {
  display: none !important;
}

.topic-diverge-strategy-dialog {
  width: min(420px, 94vw);
  padding: 1rem 1.1rem;
  border: 2px solid var(--ph-cyan);
}

.topic-diverge-strategy-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.topic-diverge-strategy-dialog-head h4 {
  margin: 0;
  font-size: 0.95rem;
}

.topic-diverge-strategy-dialog-close {
  border: none;
  background: transparent;
  color: var(--ph-text-muted);
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
}

.topic-diverge-strategy-dialog-foot {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 1rem;
}

.agent-topic-eval-mgmt {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.topic-eval-dimensions-scroller {
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 0.35rem;
  margin: 0 -0.15rem;
  padding-left: 0.15rem;
}

.topic-eval-dimensions-track {
  display: flex;
  flex-direction: row;
  gap: 0.65rem;
  min-width: min-content;
}

.topic-eval-dimension-card {
  flex: 0 0 min(280px, 85vw);
  padding: 0.65rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.topic-eval-dimension-head {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.topic-eval-dimension-name {
  flex: 1;
  min-width: 0;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.35rem 0.45rem;
  border: 1px solid var(--ph-surface-4);
  border-radius: 4px;
  background: var(--ph-surface-2);
  color: var(--ph-text);
}

.topic-eval-dimension-remove {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  padding: 0;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: var(--ph-text-muted);
  cursor: pointer;
}

.topic-eval-dimension-remove:hover {
  color: var(--ph-danger, #f66);
  background: rgba(255, 80, 80, 0.12);
}

.topic-eval-weight-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.topic-eval-weight-range {
  flex: 1;
  min-width: 5rem;
}

.topic-eval-weight-input {
  width: 3.25rem;
  flex: 0 0 auto;
}

.topic-eval-dimensions-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin-top: 0.55rem;
}

.topic-eval-output-opts {
  margin: 0;
  padding: 0;
}

.topic-eval-threshold-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin-bottom: 0.65rem;
}

.topic-eval-threshold-row label {
  flex: 0 0 auto;
  font-size: 0.72rem;
  color: var(--ph-text-muted);
}

.topic-eval-threshold-input {
  width: 5rem;
  flex: 0 0 auto;
}

.agent-prompt-subpanel.is-active .agent-prompt-stage-text {
  flex: 1;
  min-height: 10rem;
}

.agent-prompt-subpanel.is-active .agent-user-input-preview,
.agent-prompt-subpanel.is-active details.agent-user-input-preview {
  flex-shrink: 0;
  margin-top: 0.5rem;
}

.agent-prompt-subpanel-hint {
  margin: 0 0 0.4rem;
  font-size: 0.68rem;
  line-height: 1.4;
}

.agent-prompt-stage-text {
  width: 100%;
  box-sizing: border-box;
  min-height: 9rem;
  font-family: ui-monospace, monospace;
  font-size: 0.8rem;
  line-height: 1.45;
}

.agent-user-input-mgmt {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-bottom: 0.75rem;
}

.agent-config-item {
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--ph-surface-3);
  background: rgba(0, 0, 0, 0.15);
}

.agent-config-item--last {
  margin-bottom: 0;
}

.agent-config-item-head {
  margin-bottom: 0.5rem;
}

.agent-config-item-title {
  margin: 0 0 0.25rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ph-cyan);
}

.agent-config-item-desc {
  margin: 0;
  font-size: 0.68rem;
  line-height: 1.45;
  opacity: 0.85;
}

.agent-config-item-control {
  margin: 0;
}

.agent-config-item-meta {
  margin: 0.35rem 0 0;
  font-size: 0.66rem;
}

.agent-config-input-line {
  width: 100%;
  box-sizing: border-box;
}

.agent-config-textarea {
  min-height: 7.5rem;
}

.agent-config-toggle {
  margin-bottom: 0.45rem;
}

.agent-user-input-context-list {
  padding: 0.45rem 0.55rem;
  border: 1px dashed var(--ph-surface-3);
  background: var(--ph-surface-2);
}

.agent-user-input-context-list.is-disabled {
  opacity: 0.45;
  pointer-events: none;
}

.agent-user-input-context-list .form-hint {
  margin: 0 0 0.35rem;
  font-size: 0.66rem;
}

.agent-user-input-context-ul {
  margin: 0;
  padding: 0 0 0 1.1rem;
  font-size: 0.68rem;
  line-height: 1.5;
}

.agent-user-input-context-ul code {
  font-size: 0.66rem;
  color: var(--ph-amber);
}

.agent-user-input-preview {
  margin-top: 0.35rem;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--ph-surface-3);
  background: rgba(0, 243, 243, 0.04);
}

.agent-user-input-preview summary {
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ph-white);
  margin-bottom: 0.35rem;
}

.agent-user-input-preview-body {
  margin: 0.35rem 0 0.4rem;
  padding: 0.5rem 0.55rem;
  max-height: 10rem;
  overflow: auto;
  font-family: ui-monospace, monospace;
  font-size: 0.72rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
  border: 1px solid var(--ph-surface-3);
  background: var(--ph-surface-1);
  color: var(--ph-white);
}

.agent-user-input-preview .form-hint {
  margin: 0;
  font-size: 0.66rem;
}

.agent-intent-routing-mgmt {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-bottom: 0.75rem;
}

.intent-routing-cards-scroller {
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0.35rem 0.15rem 0.5rem;
  margin: 0 -0.15rem;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
}

.intent-routing-cards-track {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 0.65rem;
  min-height: 16.5rem;
  width: max-content;
  padding: 0.1rem 0.25rem;
}

.intent-routing-card {
  flex: 0 0 min(280px, 78vw);
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 0.65rem 0.7rem;
  margin: 0;
  border: 1px solid var(--ph-surface-3);
  background: var(--ph-surface-1);
}

.intent-card-head {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.15rem;
}

.intent-card-title {
  flex: 1;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ph-cyan);
  border: 1px solid transparent;
  background: transparent;
  padding: 0.2rem 0.35rem;
}

.intent-card-title:focus {
  border-color: var(--ph-cyan);
  background: var(--ph-surface-2);
}

.intent-card-remove {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  margin: 0;
  padding: 0;
  border: 1px solid var(--ph-surface-3);
  background: var(--ph-surface-2);
  color: var(--ph-white);
  cursor: pointer;
  line-height: 1;
}

.intent-card-remove:hover {
  border-color: var(--ph-amber);
  color: var(--ph-amber);
}

.intent-card-field {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.intent-card-field--last {
  margin-bottom: 0;
}

.intent-card-label {
  font-size: 0.66rem;
  font-weight: 600;
  color: var(--ph-surface-3);
}

.intent-field {
  width: 100%;
  box-sizing: border-box;
  font-size: 0.72rem;
}

.intent-card-textarea {
  min-height: 2.8rem;
  font-family: var(--benying-font);
  resize: vertical;
  line-height: 1.4;
}

.intent-routing-cards-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  margin-top: 0.55rem;
}

.intent-routing-cards-hint {
  margin: 0;
  font-size: 0.66rem;
}

.agent-unknown-handling .form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.agent-unknown-mode {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-top: 0.25rem;
}

.agent-unknown-mode-opt {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  cursor: pointer;
}

.intent-unknown-text {
  min-height: 3rem;
  width: 100%;
  box-sizing: border-box;
  font-family: var(--benying-font);
  font-size: 0.78rem;
}

.agent-popover-enable-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.82rem;
}

.stage-repo-sidebar {
  display: flex;
  flex-direction: column;
  gap: var(--v2-block-gap);
}

.repo-panel {
  padding: 0.85rem 1rem;
}

.repo-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.repo-panel-head .ph-heading {
  margin: 0;
  font-size: 0.92rem;
}

.repo-panel-settings {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin: 0;
  padding: 0;
  color: var(--ph-white);
  opacity: 0.75;
  text-decoration: none;
  border: 1px solid var(--ph-surface-3);
  background: var(--ph-surface-2);
  cursor: pointer;
  font: inherit;
}

.repo-panel-settings:hover {
  color: var(--ph-cyan);
  border-color: var(--ph-cyan);
}

.repo-panel-desc {
  margin: 0 0 0.65rem;
  line-height: 1.45;
}

.topic-agent-sidebar {
  gap: var(--v2-block-gap);
}

.topic-agent-card.repo-panel {
  margin: 0;
}

.topic-agent-card--main .repo-panel-head {
  margin-bottom: 0.35rem;
}

.topic-agent-card .repo-panel-subtitle {
  margin: 0 0 0.4rem;
}

.topic-agent-card-hint {
  margin: 0 0 0.45rem;
  font-size: 0.66rem;
  line-height: 1.35;
}

.topic-agent-card--main .topic-agent-shortcuts {
  margin: 0.45rem 0 0;
}

.topic-agent-shortcuts-hint {
  margin: 0.4rem 0 0;
  font-size: 0.66rem;
  line-height: 1.35;
}

.topic-panel-label {
  display: block;
  margin: 0 0 0.3rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--ph-surface-3);
}

.topic-agent-brief,
.topic-agent-feedback {
  width: 100%;
  box-sizing: border-box;
  margin: 0;
  padding: 0.45rem 0.55rem;
  border: 1px solid var(--ph-surface-3);
  background: var(--ph-surface-2);
  color: var(--ph-white);
  font-family: var(--benying-font);
  font-size: 0.78rem;
  line-height: 1.45;
  resize: vertical;
}

.topic-agent-brief:focus,
.topic-agent-feedback:focus {
  outline: none;
  border-color: var(--ph-cyan);
}

.topic-agent-fetch-btn {
  position: relative;
  width: 100%;
  margin: 0.55rem 0 0;
  overflow: hidden;
  border: 1px solid rgba(34, 211, 238, 0.35);
}

.topic-fetch-btn-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0%;
  background: linear-gradient(90deg, rgba(34, 211, 238, 0.45), rgba(34, 211, 238, 0.28));
  transition: width 0.4s ease;
  pointer-events: none;
}

.topic-agent-fetch-btn.is-fetch-running .topic-fetch-btn-fill {
  box-shadow: inset 0 0 12px rgba(255, 255, 255, 0.12);
}

.topic-agent-fetch-btn.is-fetch-done .topic-fetch-btn-fill {
  background: linear-gradient(90deg, rgba(52, 211, 153, 0.5), rgba(52, 211, 153, 0.3));
}

.topic-agent-fetch-btn.is-fetch-error {
  border-color: rgba(248, 113, 113, 0.55);
}

.topic-agent-fetch-btn.is-fetch-error .topic-fetch-btn-fill {
  background: linear-gradient(90deg, rgba(248, 113, 113, 0.45), rgba(248, 113, 113, 0.25));
  width: 100% !important;
}

.topic-fetch-btn-label {
  position: relative;
  z-index: 1;
  display: block;
  padding: 0 0.15rem;
  font-size: 0.82rem;
  line-height: 1.35;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topic-agent-capabilities {
  margin: 0;
}

.topic-agent-runtime {
  font-size: 0.72rem;
}

.topic-runtime-dl {
  margin: 0;
}

.topic-runtime-row {
  display: grid;
  grid-template-columns: 4.5rem minmax(0, 1fr);
  gap: 0.3rem 0.45rem;
  margin-bottom: 0.4rem;
  line-height: 1.4;
}

.topic-runtime-row:last-child {
  margin-bottom: 0;
}

.topic-runtime-row dt {
  margin: 0;
  color: var(--ph-surface-3);
  font-weight: 600;
}

.topic-runtime-row dd {
  margin: 0;
  color: var(--ph-white);
  opacity: 0.9;
}

.topic-runtime-ok {
  color: var(--ph-cyan);
}

.topic-runtime-off {
  color: var(--ph-amber);
}

.topic-agent-feedback-btn {
  width: 100%;
  margin: 0.45rem 0 0;
}

.topic-agent-cap-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.topic-agent-cap-item {
  margin: 0;
}

.topic-agent-cap-label {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  cursor: pointer;
  font-size: 0.74rem;
  line-height: 1.35;
}

.topic-agent-cap-checkbox {
  flex-shrink: 0;
  width: 14px;
  height: 14px;
  margin: 0.12rem 0 0;
  accent-color: var(--ph-cyan);
  cursor: pointer;
}

.topic-agent-cap-text {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.topic-agent-cap-name {
  font-weight: 600;
  color: var(--ph-white);
}

.topic-agent-cap-hint {
  margin: 0;
  font-size: 0.66rem;
  line-height: 1.3;
  opacity: 0.62;
}

.repo-panel-subtitle {
  margin: 0 0 0.65rem;
  font-size: 0.92rem;
}

.repo-shortcuts {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.repo-shortcuts .repo-shortcut,
.repo-shortcuts a.repo-shortcut {
  width: 100%;
  margin: 0;
  text-align: center;
  text-decoration: none;
  display: block;
  box-sizing: border-box;
}

.repo-shortcuts .repo-shortcut.is-disabled,
.repo-shortcuts button.repo-shortcut:disabled {
  opacity: 0.32;
  cursor: not-allowed;
  pointer-events: none;
  filter: grayscale(0.55);
  box-shadow: none;
}

.repo-panel-hint {
  margin: 0.65rem 0 0;
  font-size: 0.72rem;
  line-height: 1.4;
}

@media (max-width: 960px) {
  .stage-repo-body {
    grid-template-columns: 1fr;
  }
  .stage-repo-sidebar {
    order: -1;
  }
  .project-board-body {
    grid-template-columns: 1fr;
    padding: 0;
  }
  .project-board-main,
  .project-board-sidebar {
    grid-column: 1;
  }
  .project-board-sidebar {
    position: static;
  }
}

body.route-board .project-context-banner {
  display: none !important;
}

body.route-board .app-v2-main .page-content {
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

body.route-board .app-v2-body {
  min-height: calc(100vh - 90px);
}

.board-home {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr) 280px;
  gap: 0;
  flex: 1;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

.board-home-col {
  min-height: 0;
  overflow-y: auto;
  padding: 1rem;
}

.board-home-col--repos {
  background: var(--ph-surface-2);
  border-right: 1px solid var(--ph-surface-3);
}

.board-repos-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
}

.board-repos-title {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--ph-white);
}

.board-repos-new {
  margin: 0;
  padding: 0.25rem 0.55rem;
  font-size: 0.72rem;
}

.board-repos-search {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--ph-surface-3);
  background: var(--ph-bg);
  margin-bottom: 0.5rem;
}

.board-repos-search input {
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--ph-white);
  font-size: 0.8rem;
  outline: none;
  font-family: var(--benying-font);
}

.board-repos-count {
  margin: 0 0 0.5rem;
  font-size: 0.72rem;
}

.board-repos-list {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.board-repo-item {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  gap: 0 0.35rem;
  padding: 0.45rem 0.5rem;
  text-decoration: none;
  color: var(--ph-white);
  border-radius: 4px;
  column-gap: 0.5rem;
}

.board-repo-item:hover {
  background: rgba(0, 243, 243, 0.08);
}

.board-repo-item.active {
  background: rgba(255, 176, 0, 0.12);
}

.board-repo-dot {
  grid-row: 1 / span 2;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ph-cyan);
  align-self: center;
}

.board-repo-item.active .board-repo-dot {
  background: var(--ph-amber);
}

.board-repo-name {
  font-size: 0.86rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.board-repo-meta {
  grid-column: 2;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.45rem;
  width: 100%;
  min-width: 0;
  font-size: 0.68rem;
  opacity: 0.65;
}

.board-repo-date {
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
  opacity: 0.85;
}

.board-repo-state {
  margin-left: auto;
  text-align: right;
  flex-shrink: 0;
  max-width: 55%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.board-home-col--main {
  padding: 1.25rem 1.5rem 2rem;
}

.board-main-title {
  font-size: 1.35rem;
  margin-bottom: 0.25rem;
}

.board-main-desc {
  margin: 0 0 1rem;
}

.board-feed-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.board-feed-heading {
  margin: 0;
  font-size: 1rem;
}

.board-feed {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.board-feed-card {
  padding: 0.85rem 1rem;
  border: 1px solid var(--ph-surface-3);
  background: var(--ph-surface-1);
}

.board-feed-card--error {
  border-color: var(--ph-red, #f44);
}

.board-feed-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.65rem;
  margin-bottom: 0.4rem;
  font-size: 0.72rem;
  opacity: 0.75;
}

.board-feed-card-tag {
  color: var(--ph-cyan);
  font-weight: 700;
}

.board-feed-card--roadmap .board-feed-card-tag {
  color: var(--ph-amber);
}

.board-feed-card-title {
  margin: 0 0 0.35rem;
  font-size: 1rem;
  color: var(--ph-amber);
}

.board-feed-card-body {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.5;
}

.board-archives {
  margin-top: 1.5rem;
  padding: 0.75rem 1rem;
}

.board-archives-summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--ph-cyan);
}

.board-home-col--aside {
  border-left: 1px solid var(--ph-surface-3);
  background: rgba(0, 0, 0, 0.15);
}

.board-changelog-title {
  font-size: 0.95rem;
  margin-bottom: 0.65rem;
}

.board-changelog-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.board-changelog-item {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--ph-surface-3);
  font-size: 0.82rem;
}

.board-changelog-when {
  font-size: 0.68rem;
  opacity: 0.55;
}

.board-changelog-more {
  display: inline-block;
  margin-top: 0.65rem;
  font-size: 0.82rem;
}

.board-aside-card {
  margin-top: 1rem;
  padding: 0.85rem;
}

.board-aside-card .ph-heading {
  font-size: 0.88rem;
  margin-bottom: 0.5rem;
}

@media (max-width: 1100px) {
  .board-home {
    grid-template-columns: 220px minmax(0, 1fr);
  }
  .board-home-col--aside {
    display: none;
  }
}

@media (max-width: 900px) {
  .project-rail {
    width: 220px;
  }
  .topbar-search-wrap {
    width: min(200px, 42vw);
  }
  .board-home {
    grid-template-columns: 1fr;
  }
  .board-home-col--repos {
    max-height: 200px;
    border-right: 0;
    border-bottom: 1px solid var(--ph-surface-3);
  }
}

@media (max-width: 720px) {
  .app-v2-body {
    flex-direction: column;
  }
  .project-rail {
    width: 100%;
    max-height: 200px;
    border-right: 0;
    border-bottom: 2px solid var(--ph-surface-3);
  }
  .project-rail-list {
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
  }
  .project-rail-item {
    min-width: 160px;
    flex-shrink: 0;
  }
}

/* Toast：避开顶栏，避免与双层 workflow 栏重叠 */
body.benying-phosphor .app-toast-stack {
  top: 1.25rem;
}

body.benying-phosphor.route-project .app-toast-stack {
  top: 1.5rem;
}

/* Agent 连接与储存 */
.agent-popover-panel--storage-fill.is-active {
  overflow: hidden;
}

.agent-popover-panel--storage-fill.is-active > .agent-popover-panel-lead,
.agent-popover-panel--storage-fill.is-active > .form-hint:first-of-type {
  flex-shrink: 0;
}

.agent-storage-mgmt {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  gap: 0.5rem;
}

.agent-storage-nav {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  gap: 0.45rem;
}

.agent-storage-tabs {
  flex-shrink: 0;
}

.agent-storage-panels {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-right: 0.15rem;
}

.agent-storage-subpanel {
  display: none;
}

.agent-storage-subpanel.is-active {
  display: block;
}

.agent-storage-sub-hint {
  margin: 0 0 0.5rem;
  font-size: 0.78rem;
}

.agent-storage-section {
  margin-bottom: 0.75rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.agent-storage-section:last-child {
  border-bottom: 0;
}

.agent-storage-test-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.45rem;
  flex-wrap: wrap;
}

.agent-storage-status {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  flex-shrink: 0;
}

.agent-storage-status.is-ok {
  background: #34d399;
  box-shadow: 0 0 6px rgba(52, 211, 153, 0.6);
}

.agent-storage-status.is-fail {
  background: #f87171;
  box-shadow: 0 0 6px rgba(248, 113, 113, 0.5);
}

.agent-storage-status.is-unknown {
  background: rgba(255, 255, 255, 0.25);
}

.agent-storage-test-msg {
  flex: 1;
  font-size: 0.78rem;
  opacity: 0.75;
  min-width: 120px;
}

.agent-storage-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.agent-storage-stat {
  min-width: 100px;
  padding: 0.35rem 0.55rem;
  border: 1px solid var(--ph-surface-3);
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.15);
}

.agent-storage-stat strong {
  display: block;
  font-size: 1rem;
  color: var(--ph-amber);
}

.agent-storage-stat span {
  font-size: 0.72rem;
  opacity: 0.7;
}

.agent-storage-conn-input {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.agent-storage-secret-ref {
  font-size: 0.75rem;
}

.agent-storage-fields-table table {
  font-size: 0.78rem;
}

.agent-storage-field-actions {
  white-space: nowrap;
}

.agent-storage-field-example {
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.agent-storage-textarea {
  min-height: 4.5rem;
  resize: vertical;
}

.agent-storage-privacy-actions,
.agent-storage-global-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.35rem 0;
}

.agent-storage-checkgroup {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  margin-bottom: 0.45rem;
}

.agent-storage-project-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  max-height: 220px;
  overflow-y: auto;
}

.agent-storage-project-card {
  border: 1px solid var(--ph-surface-3);
  border-radius: 4px;
  padding: 0.45rem 0.55rem;
  background: rgba(0, 0, 0, 0.12);
}

.agent-storage-project-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
}

.agent-storage-project-card h4 {
  margin: 0;
  font-size: 0.85rem;
}

.agent-storage-project-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 0.4rem;
}

.agent-storage-global-block {
  flex-shrink: 0;
  padding-bottom: 0.55rem;
  margin-bottom: 0.35rem;
  border-bottom: 1px solid var(--ph-surface-3);
}

.agent-storage-global {
  flex-shrink: 0;
}

.agent-storage-global .agent-storage-cost-hint {
  margin: 0.25rem 0 0;
}

.agent-storage-output-dir {
  margin: 0.55rem 0 0;
}

.form-row--2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
}

@media (max-width: 720px) {
  .form-row--2 {
    grid-template-columns: 1fr;
  }
}

/* Agent API 用量 */
.agent-popover-panel--usage-fill.is-active {
  overflow: hidden;
}

.agent-usage-mgmt {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  gap: 0.5rem;
}

.agent-usage-nav {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  gap: 0.45rem;
}

.agent-usage-panels {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.agent-usage-subpanel {
  display: none;
}

.agent-usage-subpanel.is-active {
  display: block;
}

.agent-usage-sub-hint {
  margin: 0 0 0.5rem;
  font-size: 0.78rem;
}

.agent-usage-toolbar {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.55rem;
  flex-wrap: wrap;
}

.agent-usage-period {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
}

.agent-usage-period select {
  min-width: 110px;
}

.agent-usage-kpis {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.55rem;
}

.agent-usage-kpi {
  min-width: 88px;
  padding: 0.35rem 0.55rem;
  border: 1px solid var(--ph-surface-3);
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.15);
}

.agent-usage-kpi strong {
  display: block;
  font-size: 0.95rem;
  color: var(--ph-cyan, #22d3ee);
}

.agent-usage-kpi span {
  font-size: 0.72rem;
  opacity: 0.7;
}

.agent-usage-section {
  margin-bottom: 0.75rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.agent-usage-bar {
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  overflow: hidden;
  min-width: 60px;
}

.agent-usage-bar span {
  display: block;
  height: 100%;
  background: var(--ph-amber);
  border-radius: 3px;
}

.agent-usage-breakdown-table table,
.agent-usage-logs-table table {
  font-size: 0.78rem;
}

.agent-usage-logs-table {
  max-height: 280px;
  overflow-y: auto;
}

body.benying-phosphor .usage-table th,
body.benying-phosphor .usage-table td {
  border-color: var(--ph-surface-3);
}

body.benying-phosphor .usage-table th {
  background: rgba(0, 0, 0, 0.2);
}

.agent-usage-log-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.45rem;
}

.agent-usage-log-filters select {
  min-width: 120px;
  font-size: 0.8rem;
}

.agent-usage-tag {
  display: inline-block;
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
  font-size: 0.72rem;
}

.agent-usage-tag.is-ok {
  background: rgba(52, 211, 153, 0.15);
  color: #34d399;
}

.agent-usage-tag.is-fail {
  background: rgba(248, 113, 113, 0.15);
  color: #f87171;
}

.agent-usage-tag.is-mock {
  background: rgba(255, 176, 0, 0.12);
  color: var(--ph-amber);
}

.agent-usage-progress {
  margin: 0.35rem 0;
}

.agent-usage-progress-head {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  margin-bottom: 0.25rem;
}

.agent-usage-progress-track {
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  overflow: hidden;
}

.agent-usage-progress-track span {
  display: block;
  height: 100%;
  background: var(--ph-cyan);
  border-radius: 4px;
}

.agent-usage-progress.is-caution .agent-usage-progress-track span {
  background: var(--ph-amber);
}

.agent-usage-progress.is-warn .agent-usage-progress-track span {
  background: #f87171;
}

.agent-usage-global {
  flex-shrink: 0;
  padding-top: 0.35rem;
  border-top: 1px solid var(--ph-surface-3);
}

.agent-usage-global-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.35rem 0;
}

.agent-usage-node-hint {
  margin-top: 0.5rem;
  font-size: 0.75rem;
  opacity: 0.65;
}

/* Agent 管理页：与选题 Agent 设置弹窗同构 */
body.benying-phosphor .agent-settings-page {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 8.5rem);
  gap: 0;
  padding: 0.75rem 0.85rem 1rem;
}

body.benying-phosphor .agent-settings-page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-shrink: 0;
  margin-bottom: 0.55rem;
}

body.benying-phosphor .agent-settings-page-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--ph-cyan);
  font-family: var(--benying-font);
}

body.benying-phosphor .agent-settings-page-actions {
  display: flex;
  gap: 0.45rem;
}

body.benying-phosphor .agent-page-agent-tabs {
  flex-shrink: 0;
  margin-bottom: 0.45rem;
}

body.benying-phosphor .agent-page-agent-tabs .agent-tab {
  flex: 0 0 auto;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 130px;
  padding: 0.45rem 0.7rem;
  gap: 0.1rem;
}

body.benying-phosphor .agent-page-agent-tabs .agent-tab-title {
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.25;
}

body.benying-phosphor .agent-page-agent-tabs .agent-tab-meta {
  font-size: 0.68rem;
  opacity: 0.62;
  line-height: 1.2;
}

body.benying-phosphor .agent-settings-page-body {
  flex: 1;
  min-height: 520px;
  display: flex;
  flex-direction: column;
}

body.benying-phosphor .agent-form--page-tabs {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

body.benying-phosphor .agent-form--page-tabs .agent-popover-panels {
  flex: 1;
  min-height: 480px;
}

body.benying-phosphor .usage-bar {
  margin-bottom: 0.65rem;
}

body.benying-phosphor .usage-stat {
  background: rgba(0, 0, 0, 0.2);
  border-color: var(--ph-surface-3);
}

body.benying-phosphor .usage-stat strong {
  color: var(--ph-amber);
}

body.benying-phosphor .usage-stat span {
  color: rgba(255, 255, 255, 0.65);
}
