* { box-sizing: border-box; }
/* 颜色与背景见 app-phosphor.css（PhosphorUI 主题） */
body { margin: 0; }
.app { min-height: 100vh; }
.sidebar {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}
.brand { padding: 0 0 1rem; margin-bottom: 0.75rem; border-bottom: 2px solid var(--ph-surface-3, #3d3834); }
.brand strong { display: block; font-size: 1.05rem; }
.brand-sub { font-size: 0.75rem; }
.nav { display: flex; flex-direction: column; gap: 0.15rem; padding: 0 0.75rem; flex: 1; overflow-y: auto; }
.nav-group-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0.85rem 0 0.25rem 0;
  display: block;
}
.nav-group-label:first-child { margin-top: 0.25rem; }
.sidebar-chat-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin: 0 0 0.75rem;
  width: 100%;
}
.sidebar-chat-icon { font-size: 1rem; }
.nav-item {
  padding: 0.2rem 0;
  text-decoration: none;
  font-size: 0.92rem;
}
.nav-stage-group { margin: 0.25rem 0 0.5rem 0.5rem; }
.nav-item.nav-stage { font-size: 0.84rem; }
.nav-item.nav-stage-muted { font-style: italic; opacity: 0.5; }
.stage-intro .stage-hint { margin: 0; line-height: 1.55; }
.board-intro ul.board-links { margin: 0.5rem 0 0; padding-left: 1.2rem; line-height: 1.6; }
.board-intro code { font-size: 0.82rem; padding: 0.1rem 0.35rem; }
.board-diagram .mermaid { margin: 0; overflow-x: auto; }
.board-diagram pre.mermaid { background: transparent; border: none; padding: 0; min-height: 0; }
.sidebar-foot { padding: 1rem 0 0; margin-top: auto; border-top: 2px solid var(--ph-surface-3, #3d3834); }
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.main-header {
  padding: 0.75rem 0 1rem;
  border-bottom: 2px solid var(--ph-surface-3, #3d3834);
  margin-bottom: 0.5rem;
}
.main-header h1 { margin: 0; font-size: 1.25rem; font-weight: 600; line-height: 1.45; }
.page-title-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0; }
.page-title-sub {
  font-size: 0.88rem;
  font-weight: 400;
  flex: 1 1 12rem;
  min-width: 0;
}
.page-content { padding: 0 0 2rem; flex: 1; overflow: auto; }
.panel {
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
}
.panel h2 { margin: 0 0 0.75rem; font-size: 0.95rem; font-weight: 600; }
.system-status-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
  margin: 0 0 1rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.75rem;
  line-height: 1.35;
  flex-shrink: 0;
}
.system-status-label { white-space: nowrap; flex-shrink: 0; }
.system-status-items {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem 0.5rem;
  min-width: 0; flex: 1;
}
.system-status-bar .badge { font-size: 0.72rem; padding: 0.15rem 0.45rem; }
.system-status-bar .form-hint { margin: 0; font-size: 0.72rem; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.system-status-help-wrap { position: relative; flex-shrink: 0; }
.system-status-help-btn {
  width: 1.1rem;
  height: 1.1rem;
  padding: 0;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1;
  cursor: help;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.system-status-help-tip {
  display: none;
  position: absolute;
  left: 0;
  top: calc(100% + 6px);
  z-index: 200;
  width: min(420px, calc(100vw - 280px));
  padding: 0.75rem 0.85rem;
  font-size: 0.78rem;
  font-weight: 400;
  text-align: left;
}
.system-status-help-wrap:hover .system-status-help-tip,
.system-status-help-wrap:focus-within .system-status-help-tip { display: block; }
.system-status-help-lead { margin: 0 0 0.5rem; line-height: 1.5; }
.system-status-help-meta { margin: 0 0 0.5rem; color: #64748b; font-size: 0.72rem; }
.system-status-help-meta code { font-size: 0.7rem; padding: 0.1rem 0.3rem; }
.system-status-help-table { width: 100%; border-collapse: collapse; font-size: 0.72rem; }
.system-status-help-table th,
.system-status-help-table td { padding: 0.35rem 0.45rem; vertical-align: top; text-align: left; }
.system-status-help-table th { white-space: nowrap; width: 38%; }
.app-toast-stack {
  position: fixed; top: 1rem; right: 1rem; z-index: 500;
  display: flex; flex-direction: column; gap: 0.5rem; max-width: min(420px, 90vw);
  pointer-events: none;
}
.app-toast {
  pointer-events: auto;
  padding: 0.65rem 0.9rem; border-radius: 8px; font-size: 0.85rem;
  background: #1e293b; color: #f8fafc; box-shadow: 0 8px 24px rgba(15, 23, 42, 0.2);
  animation: toast-in 0.2s ease;
}
.app-toast-error { background: #7f1d1d; }
.app-toast-out { opacity: 0; transform: translateX(8px); transition: 0.25s ease; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-6px); } }
.wechat-cover-thumb { max-width: 280px; border-radius: 8px; border: 1px solid #e2e8f0; }
.feature-panel { /* theme in app-phosphor.css */ }
.wechat-gallery { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 0.75rem; }
.wechat-asset { flex: 1 1 200px; max-width: 320px; }
.wechat-asset img { width: 100%; border-radius: 8px; border: 1px solid #e2e8f0; display: block; margin-top: 0.25rem; }
.primary-link { font-weight: 600; }
.gen-progress-overlay {
  position: fixed; inset: 0; z-index: 600;
  background: rgba(15, 23, 42, 0.45);
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
}
.gen-progress-card {
  padding: 1.25rem 1.5rem;
  width: min(440px, 100%);
}
.gen-progress-card h2 { margin: 0 0 0.35rem; font-size: 1.1rem; }
.gen-progress-sub { margin: 0 0 1rem; font-size: 0.9rem; }
.gen-progress-bar {
  height: 8px;
  overflow: hidden;
}
.gen-progress-bar-sm { height: 6px; margin: 0.5rem 0; }
.gen-progress-bar-fill {
  height: 100%;
  transition: width 0.35s ease;
}
.gen-progress-indeterminate {
  width: 40% !important;
  animation: gen-progress-slide 1.2s ease-in-out infinite;
}
@keyframes gen-progress-slide {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(350%); }
}
.gen-progress-msg { margin: 0.65rem 0 0.75rem; font-size: 0.88rem; }
.gen-progress-steps {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: 0.4rem;
}
.gen-progress-steps-compact { font-size: 0.82rem; }
.gen-step {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
}
.gen-step-num {
  width: 1.25rem;
  height: 1.25rem;
  font-size: 0.72rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.gen-progress-inline { margin-bottom: 0.75rem; }
.app-log-pre {
  margin-top: 0.75rem;
  padding: 0.75rem;
  font-size: 0.75rem;
  max-height: 420px;
  overflow: auto;
}
.log-panel[hidden] { display: none !important; }
.log-tabs { margin-bottom: 0.75rem; }
.card .state { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin-bottom: 0.5rem; }
.badge { font-size: 0.75rem; padding: 0.2rem 0.5rem; }
.row { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }
input, textarea, select {
  font: inherit;
  padding: 0.45rem 0.6rem;
}
textarea { width: 100%; min-height: 120px; resize: vertical; font-size: 0.85rem; }
button:not(.ph-button) {
  font: inherit;
  padding: 0.45rem 0.85rem;
  cursor: pointer;
}
button:disabled { opacity: 0.55; cursor: wait; }
.card { padding: 1rem; margin-bottom: 0.75rem; }
.card h3 { margin: 0 0 0.35rem; font-size: 1rem; }
.state { font-size: 0.85rem; margin-bottom: 0.5rem; }
.actions { display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 0.5rem 0; }
.analyses { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; margin-top: 0.75rem; }
@media (max-width: 800px) { .analyses { grid-template-columns: 1fr; } .sidebar { width: 64px; } .brand-sub, .nav-item span { display: none; } }
.analysis-box { padding: 0.65rem; max-height: 240px; overflow: auto; font-size: 0.85rem; }
.analysis-box pre { white-space: pre-wrap; margin: 0; }
.topic-grid { display: grid; gap: 0.5rem; }
.topic-item { padding: 0.65rem; cursor: pointer; }
.agent-page { display: flex; flex-direction: column; gap: 0.75rem; width: 100%; }
.agent-tabs {
  display: flex; width: 100%; gap: 0;
  padding: 0; margin: 0;
  background: transparent; border: none; border-radius: 0;
  border-bottom: 1px solid #e2e8f0;
}
.agent-tab {
  flex: 1 1 0; min-width: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 0.65rem 0.5rem; margin: 0;
  border: none; border-radius: 0; border-bottom: 2px solid transparent;
  background: transparent; cursor: pointer; text-align: center;
}
.agent-tab:hover { background: #f8fafc; }
.agent-tab.active {
  background: #fff; border-bottom-color: #2563eb;
  box-shadow: none;
}
.agent-tab.is-disabled { opacity: 0.5; }
.agent-tab-title {
  font-size: 0.88rem; font-weight: 600; color: #0f172a; line-height: 1.3;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%;
}
.agent-tab-meta {
  font-size: 0.72rem; color: #64748b; margin-top: 0.15rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%;
}
.agent-editor-panel {
  background: transparent; border: none; border-radius: 0;
  padding: 0; min-height: 420px; width: 100%;
}
.agent-form { display: flex; flex-direction: column; gap: 0.85rem; }

/* 块 1：名称 + 启用开关（不可折叠） */
.agent-block-header {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 1.25rem;
  padding: 1rem 1.15rem; background: #fff; border: 1px solid #cbd5e1;
  border-radius: 12px; box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}
.agent-header-name { flex: 1; min-width: 0; }
.agent-header-name label { display: block; font-size: 0.85rem; font-weight: 500; margin-bottom: 0.35rem; color: #475569; }
.agent-header-name input { width: 100%; font-size: 1.05rem; font-weight: 600; padding: 0.5rem 0.65rem; }
.agent-slug {
  display: inline-block; margin-top: 0.35rem; font-size: 0.75rem; color: #94a3b8;
  font-family: ui-monospace, monospace;
}
.agent-header-enable {
  display: flex; flex-direction: column; align-items: flex-end; gap: 0.4rem; flex-shrink: 0;
}
.agent-enable-label { font-size: 0.8rem; color: #64748b; font-weight: 500; }

/* 滑动开关 */
.switch { position: relative; display: inline-block; width: 48px; height: 28px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch-slider {
  position: absolute; cursor: pointer; inset: 0; background: #cbd5e1;
  border-radius: 28px; transition: background 0.2s;
}
.switch-slider::before {
  content: ""; position: absolute; height: 22px; width: 22px; left: 3px; bottom: 3px;
  background: #fff; border-radius: 50%; transition: transform 0.2s; box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
.switch input:checked + .switch-slider { background: #2563eb; }
.switch input:checked + .switch-slider::before { transform: translateX(20px); }
.switch input:focus-visible + .switch-slider { outline: 2px solid #93c5fd; outline-offset: 2px; }

/* 块 2–4：可折叠、可拖动 */
.agent-config-blocks { display: flex; flex-direction: column; gap: 0.75rem; }
.config-blocks-hint {
  margin: -0.25rem 0 0; font-size: 0.75rem; color: #94a3b8; text-align: center;
}
.config-block {
  background: #fff; border: 1px solid #cbd5e1; border-radius: 12px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
  overflow: hidden; transition: box-shadow 0.15s, opacity 0.15s;
}
.config-block.is-dragging { opacity: 0.55; box-shadow: 0 8px 24px rgba(37, 99, 235, 0.2); }
.config-block-header {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.75rem 1rem; cursor: pointer; user-select: none;
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  border-bottom: 1px solid transparent;
}
.config-block:not(.is-collapsed) .config-block-header { border-bottom-color: #e2e8f0; }
.config-block-header:hover { background: #eff6ff; }
.config-block-drag {
  cursor: grab; color: #94a3b8; font-size: 1rem; line-height: 1; padding: 0.2rem 0.35rem;
  border-radius: 4px; flex-shrink: 0; touch-action: none;
}
.config-block-drag:hover { color: #2563eb; background: #dbeafe; }
.config-block-drag:active { cursor: grabbing; }
body.is-block-dragging { user-select: none; cursor: grabbing; }
body.is-block-dragging .config-block-drag { cursor: grabbing; }
.config-block-icon { font-size: 1rem; flex-shrink: 0; }
.config-block-title { margin: 0; flex: 1; font-size: 0.95rem; font-weight: 600; color: #0f172a; }
.config-block-chevron {
  width: 0.5rem; height: 0.5rem; border-right: 2px solid #64748b; border-bottom: 2px solid #64748b;
  transform: rotate(45deg); transition: transform 0.2s; margin-right: 0.25rem; flex-shrink: 0;
}
.config-block.is-collapsed .config-block-chevron { transform: rotate(-135deg); margin-top: 0.2rem; }
.config-block-body { padding: 1rem 1.15rem 1.15rem; }
.config-block.is-collapsed .config-block-body { display: none; }

.subsection-label {
  margin: 0.75rem 0 0.5rem; font-size: 0.85rem; font-weight: 600; color: #475569;
}
.form-actions {
  margin-top: 0.25rem; padding: 0.85rem 1rem; background: #fff;
  border: 1px solid #e2e8f0; border-radius: 10px;
}
.textarea-sm { min-height: 72px; }
.input-full { width: 100%; }
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 720px) {
  .form-row-2 { grid-template-columns: 1fr; }
  .agent-tab { padding: 0.5rem 0.25rem; }
  .agent-tab-title { font-size: 0.8rem; }
  .agent-tab-meta { font-size: 0.68rem; }
}
@media (max-width: 560px) {
  .agent-block-header { flex-direction: column; align-items: stretch; }
  .agent-header-enable {
    flex-direction: row; justify-content: space-between; align-items: center;
  }
}
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-size: 0.85rem; font-weight: 500; margin-bottom: 0.35rem; color: #475569; }
.form-hint { font-size: 0.78rem; color: #94a3b8; margin-top: 0.25rem; }
.usage-bar { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.usage-stat { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px; padding: 0.65rem 1rem; min-width: 120px; }
.usage-stat strong { display: block; font-size: 1.1rem; }
.usage-stat span { font-size: 0.8rem; color: #64748b; }
table.usage-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
table.usage-table th, table.usage-table td { border: 1px solid #e2e8f0; padding: 0.4rem 0.5rem; text-align: left; }
table.usage-table th { background: #f8fafc; }
a.dl { color: #2563eb; }
.toggle { display: flex; align-items: center; gap: 0.5rem; }
.history-table-wrap { overflow-x: auto; border: 1px solid #e2e8f0; border-radius: 8px; }
table.history-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; background: #fff; }
table.history-table th, table.history-table td {
  border-bottom: 1px solid #e2e8f0; padding: 0.65rem 0.75rem; text-align: left; vertical-align: top;
}
table.history-table th { background: #f8fafc; font-weight: 600; color: #475569; }
table.history-table tbody tr:hover { background: #f8fafc; }
.state-pill {
  display: inline-block; font-size: 0.75rem; padding: 0.15rem 0.5rem;
  border-radius: 999px; background: #e0e7ff; color: #3730a3;
}
.history-actions { white-space: nowrap; }
.history-actions a.dl { margin-right: 0.75rem; }
input[type="search"] { font: inherit; border: 1px solid #cbd5e1; border-radius: 6px; padding: 0.45rem 0.6rem; }
.page-intro { color: #64748b; font-size: 0.9rem; margin: 0 0 1rem; line-height: 1.5; }
.page-intro code { font-size: 0.85em; background: #f1f5f9; padding: 0.1rem 0.35rem; border-radius: 4px; }
.skills-table input { width: 100%; min-width: 0; }
.skills-table td { vertical-align: middle; }

/* Agent 对话抽屉 */
.chat-drawer { position: fixed; inset: 0; z-index: 1000; pointer-events: none; visibility: hidden; }
.chat-drawer.is-open { pointer-events: auto; visibility: visible; }
.chat-drawer-backdrop {
  position: absolute; inset: 0; background: rgba(15, 23, 42, 0.45); opacity: 0;
  transition: opacity 0.2s;
}
.chat-drawer.is-open .chat-drawer-backdrop { opacity: 1; }
.chat-drawer-panel {
  position: absolute; top: 0; right: 0; width: min(440px, 100vw); height: 100%;
  background: #fff; box-shadow: -4px 0 24px rgba(15, 23, 42, 0.12);
  display: flex; flex-direction: column; transform: translateX(100%);
  transition: transform 0.25s ease;
}
.chat-drawer.is-open .chat-drawer-panel { transform: translateX(0); }
.chat-drawer-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1.15rem; border-bottom: 1px solid #e2e8f0;
}
.chat-drawer-header h2 { margin: 0; font-size: 1.05rem; }
.chat-close {
  border: none; background: transparent; font-size: 1.5rem; line-height: 1; cursor: pointer; color: #64748b;
}
.chat-drawer-toolbar {
  display: flex; align-items: center; gap: 0.5rem; padding: 0.65rem 1rem; border-bottom: 1px solid #f1f5f9;
  flex-wrap: wrap;
}
.chat-drawer-toolbar label { font-size: 0.8rem; color: #64748b; }
.chat-drawer-toolbar select { flex: 1; min-width: 120px; }
.chat-clear-btn { font-size: 0.8rem; padding: 0.35rem 0.6rem; }
.chat-messages {
  flex: 1; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: 0.65rem;
  background: #f8fafc;
}
.chat-empty, .chat-typing { color: #94a3b8; font-size: 0.85rem; text-align: center; margin: 1rem 0; }
.chat-bubble {
  max-width: 92%; padding: 0.55rem 0.75rem; border-radius: 10px; font-size: 0.88rem;
}
.chat-bubble pre { margin: 0; white-space: pre-wrap; font-family: inherit; font-size: inherit; }
.chat-bubble-role { font-size: 0.72rem; font-weight: 600; margin-bottom: 0.25rem; opacity: 0.75; }
.chat-bubble-user { align-self: flex-end; background: #2563eb; color: #fff; }
.chat-bubble-user .chat-bubble-role { color: #dbeafe; }
.chat-bubble-assistant { align-self: flex-start; background: #fff; border: 1px solid #e2e8f0; }
.chat-form {
  display: flex; gap: 0.5rem; padding: 0.75rem 1rem; border-top: 1px solid #e2e8f0; background: #fff;
}
.chat-form textarea { flex: 1; resize: none; min-height: 4rem; }
body.chat-open { overflow: hidden; }

.qa-citations { margin-top: 0.5rem; display: flex; flex-direction: column; gap: 0.35rem; }
.qa-cite { font-size: 0.78rem; color: #64748b; }
.qa-cite pre { margin: 0.25rem 0 0; white-space: pre-wrap; font-size: 0.75rem; background: #f8fafc; padding: 0.35rem; border-radius: 6px; }
button.linkish { background: none; border: none; color: #2563eb; cursor: pointer; padding: 0; font: inherit; text-decoration: underline; }
.archive-list { margin: 0.5rem 0 0; padding-left: 1.1rem; font-size: 0.88rem; }
.archive-list li { margin: 0.25rem 0; }
.data-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.data-table th, .data-table td { text-align: left; padding: 0.45rem 0.6rem; border-bottom: 1px solid #e2e8f0; }
.doc-markdown pre { white-space: pre-wrap; font-size: 0.82rem; line-height: 1.5; max-height: 70vh; overflow: auto; }
.research-log-box { margin-top: 0.5rem; padding: 0.6rem; background: #f8fafc; border-radius: 8px; font-size: 0.78rem; max-height: 240px; overflow: auto; white-space: pre-wrap; }
.job-error { margin: 0; font-size: 0.75rem; color: #b91c1c; }

.haisnap-mode-alert {
  margin: 0 0 0.75rem; padding: 0.65rem 0.75rem; border-radius: 8px;
  background: #fff7ed; border: 1px solid #fdba74; color: #9a3412; font-size: 0.88rem; line-height: 1.45;
}
.haisnap-mode-alert em { font-style: normal; font-weight: 700; }

/* Haisnap Playwright 可视化 */
.haisnap-viz-panel { margin-top: 0.75rem; border: 1px solid #c7d2fe; background: #f8fafc; }
.haisnap-viz-panel h4 { margin: 0 0 0.5rem; font-size: 0.9rem; }
.haisnap-viz-banner { background: #eff6ff; padding: 0.5rem 0.65rem; border-radius: 6px; margin: 0 0 0.5rem; }
.haisnap-viz-frame {
  position: relative; margin: 0.5rem 0; border: 1px solid #cbd5e1; border-radius: 8px;
  overflow: hidden; background: #0f172a; min-height: 120px;
}
.haisnap-viz-img { display: block; width: 100%; max-height: 420px; object-fit: contain; object-position: top center; }
.haisnap-viz-placeholder { display: flex; align-items: center; justify-content: center; min-height: 140px; background: #1e293b; }
.haisnap-viz-placeholder .form-hint { color: #94a3b8; }

.skill-toolbar h2 { font-size: 1rem; }
.skill-global-panel {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 0.85rem;
}
.skill-global-panel label { font-size: 0.85rem; display: inline-flex; align-items: center; gap: 0.35rem; }
.skill-card { margin-bottom: 0.7rem; }
.skill-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.5rem;
}
.skill-card-head h3 { margin: 0; font-size: 0.98rem; }
.skill-card-actions { display: inline-flex; gap: 0.45rem; align-items: center; }
.skill-card-desc { margin: 0 0 0.4rem; font-size: 0.84rem; line-height: 1.55; }
.skill-card-meta { font-size: 0.78rem; color: #64748b; margin-bottom: 0.15rem; }
.skill-editor-modal {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.skill-editor-modal--popover { z-index: 520; }
.skill-editor-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
}
.skill-editor-modal-panel {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: min(820px, 96vw);
  max-height: min(88vh, 900px);
  overflow: hidden;
  border: 2px solid var(--ph-cyan, #0891b2);
  box-shadow: 6px 6px 0 var(--ph-surface-3, #334155);
}
.skill-editor-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid #e2e8f0;
  flex-shrink: 0;
}
.skill-editor-modal-head h2 {
  margin: 0;
  font-size: 1.05rem;
  color: var(--ph-cyan, #0891b2);
}
.skill-editor-modal-close {
  border: none;
  background: transparent;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  color: #64748b;
  padding: 0.15rem 0.35rem;
}
.skill-editor-modal-close:hover { color: #0e7490; }
.skill-editor-form {
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  padding-bottom: 0.5rem;
}
.skill-editor-form .panel { margin: 0.65rem 1rem 0; }
.skill-editor-form h3 { margin: 0 0 0.6rem; font-size: 0.92rem; }
.skill-editor-form label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.82rem;
  margin-bottom: 0.6rem;
}
.skill-editor-modal-actions {
  padding: 0.75rem 1rem 1rem;
  margin: 0;
  border-top: 1px solid #e2e8f0;
  background: #fff;
  flex-shrink: 0;
}
.skill-mgmt--popover .skill-editor-modal-panel {
  width: min(760px, 94vw);
  max-height: min(82vh, 820px);
}
.skill-import-panel .form-row-3 {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(240px, 2fr) minmax(200px, 1.2fr);
  gap: 0.6rem;
}
.skill-import-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  margin-bottom: 0.45rem;
}
.skill-import-head h3 { font-size: 0.88rem; }
.skill-import-source-tabs { display: inline-flex; gap: 0.25rem; }
.skill-import-source-tab {
  font: inherit;
  font-size: 0.72rem;
  padding: 0.2rem 0.5rem;
  border: 1px solid var(--ph-surface-3, #3d3834);
  background: var(--ph-surface-2, #2a2622);
  color: var(--ph-white, #f5f0e8);
  cursor: pointer;
  border-radius: 4px;
}
.skill-import-source-tab.active {
  border-color: var(--ph-amber, #ffb000);
  background: rgba(255, 176, 0, 0.14);
  color: var(--ph-amber, #ffb000);
  font-weight: 600;
}
.skill-import-dropzone {
  border: 1px dashed rgba(255, 176, 0, 0.45);
  border-radius: 8px;
  padding: 0.55rem 0.6rem;
  background: rgba(255, 176, 0, 0.07);
  transition: border-color 0.15s, background 0.15s;
}
.skill-import-dropzone.is-dragover,
.skill-import-dropzone--file-mode.is-dragover {
  border-color: var(--ph-cyan, #22d3ee);
  background: rgba(34, 211, 238, 0.1);
}
.skill-import-dropzone-visual {
  text-align: center;
  padding: 0.25rem 0.2rem 0.4rem;
}
.skill-import-dropzone-icon { font-size: 1.15rem; display: block; margin-bottom: 0.1rem; line-height: 1; }
.skill-import-dropzone-title { margin: 0 0 0.12rem; font-size: 0.78rem; font-weight: 600; color: var(--ph-white, #f5f0e8); }
.skill-import-dropzone-hint { margin: 0 0 0.35rem; font-size: 0.68rem; color: rgba(245, 240, 232, 0.55); }
.skill-import-file-name { margin: 0.2rem 0 0; font-size: 0.7rem; color: var(--ph-cyan, #22d3ee); min-height: 1em; }
.skill-import-link-block label,
.skill-import-def-path {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.72rem;
  margin: 0.35rem 0 0;
}
.skill-import-link-block input,
.skill-import-def-path input {
  font-size: 0.75rem;
  padding: 0.32rem 0.45rem;
}
.skill-import-actions { margin-top: 0.4rem; }
.skill-import-actions .ph-button { font-size: 0.78rem; padding: 0.32rem 0.65rem; }
.skill-import-status {
  margin-top: 0.45rem;
  padding: 0.45rem 0.55rem;
  border-radius: 6px;
  background: var(--ph-surface-2, #2a2622);
  border: 1px solid var(--ph-surface-3, #3d3834);
  font-size: 0.72rem;
}
.skill-import-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.skill-import-step {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  font-size: 0.8rem;
  line-height: 1.45;
}
.skill-import-step.is-done .skill-import-step-icon { color: #059669; }
.skill-import-step.is-running .skill-import-step-icon { color: #0891b2; }
.skill-import-step.is-error .skill-import-step-icon { color: #dc2626; }
.skill-import-step-detail {
  display: block;
  font-size: 0.72rem;
  color: #64748b;
  word-break: break-all;
}
.skill-import-local-path {
  margin: 0.45rem 0 0;
  font-size: 0.72rem;
  color: #475569;
}
.skill-import-local-path code { font-size: 0.7rem; }
.skill-mgmt--popover .skill-import-panel {
  padding: 0.5rem 0.6rem;
  margin-bottom: 0.45rem;
}
.skill-mgmt--popover .skill-import-head { margin-bottom: 0.35rem; }
.skill-mgmt--popover .skill-import-head h3 { font-size: 0.82rem; }
.skill-mgmt--popover .skill-import-dropzone {
  padding: 0.45rem 0.5rem;
  border-radius: 6px;
}
.skill-mgmt--popover .skill-import-dropzone-visual { padding: 0.15rem 0 0.3rem; }
.skill-mgmt--popover .skill-import-dropzone-icon { font-size: 1rem; }
.skill-mgmt--popover .skill-import-dropzone-title { font-size: 0.74rem; }
.skill-mgmt--popover .skill-import-dropzone-hint { font-size: 0.65rem; margin-bottom: 0.28rem; }
.skill-mgmt--popover .skill-import-link-block label,
.skill-mgmt--popover .skill-import-def-path { margin-top: 0.28rem; font-size: 0.68rem; }
.skill-mgmt--popover .skill-import-actions { margin-top: 0.32rem; }
.skill-sandbox-panel textarea[readonly] { opacity: 0.95; }
@media (max-width: 980px) {
  .skill-import-panel .form-row-3 { grid-template-columns: 1fr; }
}
.agent-inline-topic-sections {
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px dashed #cbd5e1;
}
.haisnap-viz-live {
  position: absolute; top: 8px; right: 8px; font-size: 0.7rem; font-weight: 700;
  padding: 0.15rem 0.45rem; border-radius: 4px; background: #dc2626; color: #fff;
  letter-spacing: 0.05em;
}
.haisnap-viz-steps { list-style: none; margin: 0.5rem 0 0; padding: 0; font-size: 0.82rem; }
.haisnap-viz-step {
  display: grid; grid-template-columns: 7rem 1fr auto; gap: 0.35rem 0.5rem;
  padding: 0.4rem 0.5rem; border-radius: 6px; margin-bottom: 0.25rem;
}
.haisnap-viz-step-active { background: #e0e7ff; }
.haisnap-viz-step-name { font-weight: 600; color: #3730a3; }
.haisnap-viz-step-detail { color: #475569; }
.haisnap-viz-thumb { width: 72px; height: 48px; object-fit: cover; border-radius: 4px; border: 1px solid #cbd5e1; }
