/* ═══════════════════════════════════════════════════════════════════════════
 * Q11 · css/modules/right-panel.css — 任务进程卡片 + 内嵌工作区面板（SPEC §2.11 Q11）
 *
 * 证据：docs/HOST-EVIDENCE-3.md §1.2–1.4（卡片三折叠区 + 打开项目文件夹）、§2.2（toolbar +
 *       actions 两大按钮，Folder/AppWindow 24px，--fullscreen modifier）、§4.3（无右侧强边界
 *       = 未展开态；**宽度无实证**，360px 为推断，待 HOST-EVIDENCE-4 对齐）。
 * token：css/modules/tokens.css（Q4）--am-radius-* / --am-shadow-panel-right / --am-font-weight-*；
 *       styles.css :root --bg-container / --border / --text / --text-2。
 * 铁律：所有选择器均以 .rp- 前缀且依赖 .rp-open / [hidden]，初始视图无任何 .rp-* 节点 → 像素 0 影响。
 * 定位：绝对定位于 .main（styles.css L170 position:relative）右侧，top = .main-header 66px，
 *       覆盖 thread 不挤压布局。
 * ═══════════════════════════════════════════════════════════════════════════ */

/* ── 公共：面板容器 ── */
.rp-task,
.rp-workspace {
  position: absolute;
  top: 66px;                                  /* styles.css .main-header height */
  right: 0;
  bottom: 0;
  width: 352px;                               /* HOST-EVIDENCE-4 §2.3：WORK_WORKSPACE_PANEL_DEFAULT_WIDTH=352 */
  min-width: 280px;                           /* §2.3 MIN_WIDTH=280 */
  max-width: min(640px, 60%);                 /* §2.3 FALLBACK_MAX_WIDTH=640 */
  box-sizing: border-box;
  background: var(--bg-container, #fcfcfc);
  border-left: 1px solid var(--border, #dddddd);
  box-shadow: var(--am-shadow-panel-right, 4px 0 24px -8px #0000001a);
  z-index: 30;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: var(--text, #1e1e1e);
  font-size: var(--type-body-size);
  
 line-height: var(--type-body-line); }
.rp-task { width: 320px; }                    /* §2.3 --worker-task-progress-rail-width: 320px */
.rp-task[hidden],
.rp-workspace[hidden] { display: none; }

/* ── F1 编码模式标题栏按钮（HOST-EVIDENCE-4 §2.2 ExpandRightSidebarButton）──
 * 28×28 / radius-6 / 图标 14 / hover #0000000d / active scale .9；面板打开后 [hidden]（JS 置）。
 * 仅在 .rp-seg-code 下作用于 panel-right 按钮；办公模式沿用 styles.css .icon-btn（像素基线不动）。 */
.main-header.rp-seg-code .icon-btn.rp-code-toggle {
  width: 28px;
  height: 28px;
  border-radius: var(--am-radius-6, 6px);
  transition: background-color 120ms ease, transform 120ms ease;
}
.main-header.rp-seg-code .icon-btn.rp-code-toggle svg { width: 14px; height: 14px; }
.main-header.rp-seg-code .icon-btn.rp-code-toggle:hover { background: var(--am-gray-a3, #0000000d); }
.main-header.rp-seg-code .icon-btn.rp-code-toggle:active { transform: scale(.9); }
.main-header .icon-btn[hidden] { display: none; }

/* ── 任务进程卡片（§1.2–1.4） ── */
.rp-task { padding: 12px; overflow-y: auto; }
.rp-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid rgba(20, 22, 28, .1);      /* contextmenu.css 同源边框（HOST-EVIDENCE-2 §1.4） */
  border-radius: var(--am-radius-12, 12px);
  box-shadow: var(--am-shadow-xs, 0 1px 2px 0 #0000000d);
  overflow: hidden;
}
.rp-section { border-bottom: 1px solid rgba(20, 22, 28, .06); }
.rp-section:last-of-type { border-bottom: 0; }
.rp-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 0;
  background: transparent;
  color: var(--text, #1e1e1e);
  font: inherit;
  font-weight: var(--am-font-weight-medium, 500);
  cursor: pointer;
  text-align: left;
}
.rp-section-head:hover { background: rgba(0, 0, 0, .03); }
.rp-chevron { display: inline-flex; color: var(--text-2, #808080); transition: transform .15s ease; }
.rp-collapsed .rp-chevron { transform: rotate(-90deg); }
.rp-section-body { padding: 0 12px 10px; }
.rp-collapsed .rp-section-body { display: none; }
.rp-group + .rp-group { margin-top: 8px; }
.rp-group-title { font-size: var(--type-caption-size); color: var(--text-2, #808080);   line-height: var(--type-caption-line); }
.rp-empty { color: var(--text-muted-nav, #9e9e9e); font-size: var(--type-body-size);   line-height: var(--type-body-line); }

/* ── F3 真实数据：steps 序列 / files 路径列表（HOST-EVIDENCE-3 §1.3 stepsProcessing；状态色同 session-status：
 *    done #00834d / running #c65b00 / error #c00900cf，HOST-EVIDENCE-2 §2.1） ── */
.rp-steps-status { color: #c65b00; font-size: var(--type-caption-size);  margin-bottom: 4px;  line-height: var(--type-caption-line); }
.rp-step-list { margin: 0; padding-left: 18px; }
.rp-step { font-size: var(--type-body-size);  color: var(--text-2, #808080);  line-height: var(--type-body-line); }
.rp-step--current { color: var(--text, #1e1e1e); font-weight: var(--am-font-weight-medium, 500); }
.rp-file-list { list-style: none; margin: 0; padding: 0; }
.rp-file { display: flex; align-items: center; gap: 6px; min-height: 22px; font-size: var(--type-caption-size);   line-height: var(--type-caption-line); }
.rp-file-dot { flex: 0 0 6px; width: 6px; height: 6px; border-radius: 50%; background: #c65b00; }
.rp-file--done .rp-file-dot { background: #00834d; }
.rp-file--error .rp-file-dot { background: #c00900cf; }
.rp-file-path {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  direction: rtl;                             /* 长路径保留文件名尾部 */
  text-align: left;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: #0066cc;                             /* markdown.css 文件路径链接同色（Q3 实证） */
}
.rp-file--error .rp-file-path { color: #c00900cf; }
.rp-card-foot { padding: 10px 12px; border-top: 1px solid rgba(20, 22, 28, .06); }
.rp-open-folder {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--border, #dddddd);
  border-radius: var(--am-radius-8, 8px);
  background: #fff;
  color: var(--text, #1e1e1e);
  font: inherit;
  font-size: var(--type-body-size);
  cursor: pointer;
 line-height: var(--type-body-line); }
.rp-open-folder:hover { background: rgba(0, 0, 0, .04); }

/* ── 内嵌工作区面板（§2.2） ── */
.rp-workspace--fullscreen {
  top: 0;
  left: 0;
  width: auto;
  max-width: none;
  border-left: 0;
  z-index: 40;
}
.rp-ws-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  height: 44px;
  padding: 0 12px;
  border-bottom: 1px solid rgba(20, 22, 28, .06);
}
.rp-ws-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: var(--am-radius-6, 6px);
  background: transparent;
  color: #3a3a3a;                             /* styles.css .hdr-actions .icon-btn svg color */
  cursor: pointer;
}
.rp-ws-btn:hover { background: rgba(0, 0, 0, .06); }
.rp-ws-btn--active { background: rgba(0, 0, 0, .06); }   /* §2.2 --active modifier */
.rp-ws-actions {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 24px;
}
.rp-ws-action {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 120px;
  height: 96px;
  justify-content: center;
  border: 1px solid var(--border, #dddddd);
  border-radius: var(--am-radius-12, 12px);
  background: #fff;
  color: var(--text, #1e1e1e);
  font: inherit;
  font-size: var(--type-body-size);
  cursor: pointer;
 line-height: var(--type-body-line); }
.rp-ws-action:hover { background: rgba(0, 0, 0, .04); }
.rp-ws-action svg { width: 24px; height: 24px; color: #3a3a3a; }   /* §2.2 size:24 strokeWidth:2 */
.rp-workspace .rp-ws-actions { flex: 0 0 auto; padding: 12px 16px 16px; gap: 12px; }
.rp-workspace .rp-ws-action { width: auto; min-width: 120px; height: 52px; flex-direction: row; gap: 12px; padding: 0 16px; }  /* HOST-EVIDENCE-4 §2.3 __workspace-panel-action min-height 52 padding 0 16 gap 12 */

/* ── Q39 F2 · RightPanel 8 标签（dtcoder-glass-react.css .right-panel-tabs* 实证，HOST-EVIDENCE-3 §5.1） ── */
.rp-tabs {
  position: relative;
  display: flex;
  min-width: 0;
  max-width: 100%;
  flex: 0 0 auto;
  align-items: center;
  overflow: hidden;
  padding-inline-start: 8px;                  /* .right-panel-tabs padding-inline-start:8px */
  min-height: 40px;
  border-bottom: 1px solid rgba(20, 22, 28, .06);
}
.rp-tabs-scroll {
  position: relative;
  display: flex;
  min-width: 0;
  max-width: 100%;
  flex: 0 1 auto;
  align-items: center;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-padding-inline: 24px;
  scrollbar-width: none;                      /* __scroll scrollbar-width:none */
}
.rp-tabs-scroll::-webkit-scrollbar { display: none; }
.rp-tab {
  position: relative;
  display: inline-flex;
  min-width: 0;
  max-width: 100px;                           /* __tab max-width:100px */
  flex-shrink: 0;
  align-items: center;
  border: 0;
  border-radius: var(--am-radius-8, 8px);     /* radius-8 */
  background: transparent;
  color: var(--text-2, #808080);              /* --muted-foreground = --color-gray-text-secondary */
  font: inherit;
  font-size: var(--am-font-size-body, 14px);  /* --font-size-body */
  font-weight: var(--am-font-weight-medium, 500);
  line-height: 20px;
  cursor: pointer;
  transition: background-color 150ms ease, color 150ms ease;
}
.rp-tab:not(:first-child) { margin-inline-start: 9px; }   /* __tab:not(:first-child) margin-inline-start:9px */
.rp-tab[data-active="false"]:hover { background: color-mix(in oklab, var(--am-gray-a3, #0000000d) 45%, transparent); color: var(--text, #1e1e1e); }
.rp-tab[data-active="true"] { background: var(--am-gray-a3, #0000000d); color: var(--text, #1e1e1e); }   /* --accent = control-fill-hover #0000000d */
.rp-tab-content { display: inline-flex; min-width: 0; align-items: center; gap: 8px; padding: 4px 8px; }  /* __tab-content */
.rp-tab-icon { display: inline-flex; flex: 0 0 16px; }
.rp-tab-icon svg { width: 16px; height: 16px; }          /* RightPanelTabIcon size=16 */
.rp-tab-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rp-tab-sep {
  position: absolute;
  top: 50%;
  left: -5px;
  width: 1px;
  height: 16px;
  background: var(--border, #dddddd);
  pointer-events: none;
  transform: translateY(-50%);
  transition: opacity 150ms ease;
}
.rp-tab[data-active="true"] .rp-tab-sep,
.rp-tab:hover .rp-tab-sep { opacity: 0; }
.rp-tab-content-area { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
.rp-tab-pane { padding: 12px; }
.rp-tab-pane[hidden] { display: none; }

/* ── SB F2 · 标签空态三型（HOST-EVIDENCE-5 §⑤ 渲染列 + §⑥ L203 口径；文案见 right-panel.js TABS） ── */
/* rich（files）：EmptyState{title,description} — div.flex.h-full.flex-col.items-center.justify-center.px-6.text-center
 *   > Folder.h-10.w-10.text-muted-foreground.opacity-35 strokeWidth 1.5 + 标题 mt-4 text-14 semibold + 描述 mt-1.5 sm（RP L3351–3380） */
.rp-empty-rich {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 24px 32px;                    /* px-6 水平 24px；上下留呼吸 */
  min-height: 200px;
  text-align: center;
}
.rp-empty-rich-icon { display: inline-flex; color: var(--text-2, #808080); opacity: .35; }
.rp-empty-rich-icon svg { width: 40px; height: 40px; }
.rp-empty-rich-title { margin-top: 16px; font-size: var(--type-body-size); font-weight: var(--am-font-weight-semibold, 600); color: var(--text, #1e1e1e);   line-height: var(--type-body-line); }
.rp-empty-rich-desc { margin-top: 6px; font-size: var(--type-body-size); color: var(--text-2, #808080);   line-height: var(--type-body-line); }

/* art（changes/pipeline）：ThemedEmpty — antd Empty + 自绘插画 75×67、imageStyle{height:36}、
 *   外层 display:flex;flex-direction:column;align-items:center（main L116117–116152）；插画为简式代位【推断】 */
.rp-empty-art {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
  text-align: center;
}
.rp-empty-art-img { width: 75px; height: 36px; }     /* 75×67 等比缩至高 36（imageStyle） */
.rp-empty-art-desc { margin-top: 8px; font-size: var(--type-body-size); color: var(--text-2, #808080);   line-height: var(--type-body-line); }

/* plain（plan/team/output/preview/terminal）：居中灰字 —
 *   div.flex.h-full.items-center.justify-center.px-4.text-center.text-[sm].text-muted-foreground（RP L14135–14165 等） */
.rp-empty-plain {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
  min-height: 160px;
  text-align: center;
  font-size: var(--type-body-size);
  color: var(--text-2, #808080);
  
 line-height: var(--type-body-line); }

/* ── Q39 F2 · 「文件」标签文件树（与任务进程 files 段同源；深度缩进 12px/级） ── */
.rp-tree,
.rp-tree ul { list-style: none; margin: 0; padding: 0; }
.rp-tree-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 24px;
  padding-left: calc(var(--rp-depth, 0) * 12px);
  font-size: var(--type-caption-size);
  
  white-space: nowrap;
  overflow: hidden;
 line-height: var(--type-caption-line); }
.rp-tree-icon { display: inline-flex; flex: 0 0 14px; color: var(--text-2, #808080); }
.rp-tree-icon svg { width: 14px; height: 14px; }
.rp-tree-dir > .rp-tree-row .rp-tree-name { color: var(--text, #1e1e1e); }
.rp-tree-file .rp-tree-name { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; color: #0066cc; overflow: hidden; text-overflow: ellipsis; }
.rp-tree-file.rp-file--error .rp-tree-name { color: #c00900cf; }
.rp-tree-file .rp-file-dot { margin-left: 4px; }
