/* ========== 详情页（对齐 proto_detail 原型） ========== */

.btn-ghost-sm { background:#f3f4f6; border:none; padding:7px 14px; border-radius:8px; font-size:13px; color:#4b5563; cursor:pointer;}
.btn-ghost-sm:hover { background:#e5e7eb;}
.btn-ai { background:#ede9fe; border:none; padding:7px 14px; border-radius:8px; font-size:13px; font-weight:600; color:#7c3aed; display:flex; align-items:center; gap:6px; cursor:pointer;}
.btn-ai:hover { background:#f5f3ff;}

/* 双栏布局 */
.detail-layout { display:flex; flex-direction:column; }
.detail-grid { order:-1; }
.detail-right { margin-bottom:18px; }
.detail-grid { display:grid; grid-template-columns:1fr 1fr; gap:0 18px; }
@media (max-width:900px){ .detail-grid { grid-template-columns:1fr; } }
.detail-left { min-width:0; }
.detail-right { min-width:0; }
@media (max-width:900px){ .detail-layout { grid-template-columns:1fr; } }

/* 白色上下文卡 */
.col-card { background:#fff; border-radius:14px; padding:20px; box-shadow:var(--shadow); margin-bottom:18px;}
.col-title { font-size:15px; font-weight:700; color:#1f2937; margin-bottom:14px; display:flex; align-items:center; gap:8px;}
.col-title .t-ico { width:26px; height:26px; border-radius:8px; background:#ede9fe; display:flex; align-items:center; justify-content:center; color:#7c3aed; flex-shrink:0;}

/* 目的卡 */
.purpose-card { background:#ede9fe; border-radius:12px; padding:16px;}
.purpose-card h4 { color:#7c3aed; font-size:13px; margin-bottom:8px;}
.purpose-card p { color:#4c1d95; font-size:14px; line-height:1.7;}

/* 进展双卡 */
.dual { display:grid; grid-template-columns:1fr 1fr; gap:14px;}
@media (max-width:520px){ .dual { grid-template-columns:1fr; } }
.prog-card { border-radius:12px; padding:16px;}
.prog-card.prog-green { background:#dcfce7;}
.prog-card.prog-green h4 { color:#16a34a; font-size:13px; margin-bottom:6px;}
.prog-card.prog-blue { background:#dbeafe;}
.prog-card.prog-blue h4 { color:#2563eb; font-size:13px; margin-bottom:6px;}
.big-pct { font-size:26px; font-weight:800; color:#15803d;}
.prog-card.prog-blue .big-pct { color:#2563eb;}
.prog-card .prog-bar { height:8px; background:rgba(255,255,255,0.7); border-radius:4px; overflow:hidden; margin-top:8px;}
.prog-card .prog-fill { height:100%; background:#22c55e; border-radius:4px; transition:width .3s;}
.prog-card .prog-fill.fill-blue { background:#2563eb;}

/* 当前聚焦卡 */
.focus-card { background:#fff; border:1px solid #e5e7eb; border-radius:12px; padding:16px; display:flex; gap:12px; align-items:flex-start;}
.focus-num { width:30px; height:30px; border-radius:50%; background:#2563eb; color:#fff; display:flex; align-items:center; justify-content:center; font-weight:700; font-size:13px; flex-shrink:0;}
.focus-body { flex:1; min-width:0;}
.focus-body .f-title { font-weight:700; font-size:14px; color:#1f2937; margin-bottom:4px;}
.focus-body .f-meta { font-size:12.5px; color:#6b7280; line-height:1.6;}

/* AI 参谋提醒 */
.ai-reminder { background:#fef3c7; border-radius:12px; padding:14px 16px;}
.ai-reminder .r-head { display:flex; align-items:center; gap:8px; font-weight:700; color:#a16207; font-size:14px; margin-bottom:8px;}
.ai-reminder .r-item { font-size:13px; color:#713f12; line-height:1.7; padding-left:20px; position:relative;}
.ai-reminder .r-item::before { content:''; position:absolute; left:6px; top:8px; width:6px; height:6px; border-radius:50%; background:#ca8a04;}
/* 单行提醒条（5c9a8d4）：只露首条+条数角标，点击展开全部 */
.col-card.reminder-bar { padding:0; cursor:pointer;}
.col-card.reminder-bar .ai-reminder { padding:10px 14px;}
.reminder-bar .r-head { margin-bottom:4px;}
.reminder-bar .r-item { white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}
.reminder-bar .r-item + .r-item { display:none;}
.reminder-bar.open .r-item { white-space:normal; overflow:visible;}
.reminder-bar.open .r-item + .r-item { display:block;}
.reminder-hint { font-size:11px; font-weight:600; color:#92400e; background:#fde68a; border-radius:8px; padding:1px 7px; margin-left:2px;}

/* 执行路径头部 */
.path-head { display:flex; align-items:center; gap:10px; margin-bottom:16px;}
.path-head .ph-title { font-size:16px; font-weight:800; flex:1; display:flex; align-items:center; gap:8px; color:#1f2937;}
.path-head .ph-title .t-ico { width:28px; height:28px; border-radius:8px; background:#ede9fe; color:#7c3aed; display:flex; align-items:center; justify-content:center;}
.path-actions { display:flex; gap:8px;}
.btn-add { background:#f3f4f6; border:none; padding:8px 14px; border-radius:8px; font-size:13px; color:#4b5563; display:flex; align-items:center; gap:6px; cursor:pointer;}
.btn-add:hover { background:#e5e7eb;}
.btn-ai-gen { background:#7c3aed; color:#fff; border:none; padding:8px 14px; border-radius:8px; font-size:13px; font-weight:600; display:flex; align-items:center; gap:6px; cursor:pointer;}
.btn-ai-gen:hover { background:#6d28d9;}

/* 执行路径步骤列表 */
.path-list { display:flex; flex-direction:column; gap:10px;}
.tree-module { margin-bottom:4px;}
.module-head { display:flex; align-items:center; gap:8px; padding:10px 12px; background:#f9fafb; border-radius:8px; cursor:pointer; font-weight:700; font-size:14px; color:#1f2937;}
.module-arrow { font-size:12px; color:#6b7280;}
.path-steps { display:flex; flex-direction:column; gap:10px; margin-top:8px;}
.step-item { background:#fff; border:1px solid #f3f4f6; border-radius:12px; padding:14px 16px; transition:.15s;}
.step-item:hover { border-color:#ddd6fe; box-shadow:0 2px 10px rgba(124,58,237,0.08);}
.step-item.is-locked { opacity:.6;}
.step-row { display:flex; align-items:center; gap:12px; cursor:pointer;}
.step-order { width:26px; height:26px; border-radius:8px; background:#f5f3ff; color:#7c3aed; font-weight:700; font-size:13px; display:flex; align-items:center; justify-content:center; flex-shrink:0;}
.step-name { font-size:14.5px; font-weight:600; color:#1f2937; flex:1; min-width:0; display:flex; align-items:center; gap:8px; flex-wrap:wrap;}
.icon-btn { width:28px; height:28px; border-radius:8px; border:none; background:#f3f4f6; color:#4b5563; display:flex; align-items:center; justify-content:center; cursor:pointer; flex-shrink:0;}
.icon-btn:hover { background:#e5e7eb;}
.step-detail { display:none; margin-top:12px; padding-top:12px; border-top:1px dashed #e5e7eb; font-size:13px; color:#6b7280; line-height:1.7;}
.step-item.open > .step-detail { display:block;}
.step-detail .sd-row { margin-bottom:6px;}
.step-detail .sd-row b { color:#4b5563;}

/* 弹窗表单（复用通用 modal 系统） */
.m-sub { font-size:13px; color:#6b7280; margin-bottom:18px;}
.field { margin-bottom:14px;}
.field label { display:block; font-size:13px; color:#4b5563; margin-bottom:6px; font-weight:600;}
.field input, .field textarea, .field select { width:100%; border:1px solid #e5e7eb; border-radius:10px; padding:10px 12px; font-size:14px; outline:none; font-family:inherit; resize:vertical; box-sizing:border-box;}
.field input:focus, .field textarea:focus, .field select:focus { border-color:#7c3aed;}
.modal-actions { display:flex; gap:10px; justify-content:flex-end; margin-top:10px;}
.btn-ghost { background:#f3f4f6; border:none; padding:9px 18px; border-radius:8px; font-size:14px; color:#4b5563; cursor:pointer;}
.btn-ghost:hover { background:#e5e7eb;}
.btn-secondary { background:#f3f4f6; border:none; border-radius:8px; padding:8px 14px; font-size:13px; cursor:pointer; color:#4b5563;}
.btn-secondary:hover { background:#e5e7eb; }

/* AI 生成：思路方向 */
.gen-loading { text-align:center; padding:30px 0; color:#6b7280; font-size:14px;}
.gen-loading .spin { width:34px; height:34px; border:3px solid #ede9fe; border-top-color:#7c3aed; border-radius:50%; margin:0 auto 14px; animation:agSpin 1s linear infinite;}
@keyframes agSpin { to { transform:rotate(360deg); } }
.dir-opt { border:2px solid #e5e7eb; border-radius:12px; padding:14px 16px; margin-bottom:12px; cursor:pointer; transition:.15s;}
.dir-opt:hover { border-color:#ddd6fe;}
.dir-opt.sel { border-color:#7c3aed; background:#f5f3ff;}
.dir-opt .do-head { display:flex; align-items:center; gap:8px; font-weight:700; font-size:14.5px; color:#1f2937; margin-bottom:6px;}
.dir-opt .do-radio { width:18px; height:18px; border-radius:50%; border:2px solid #9ca3af; flex-shrink:0; display:flex; align-items:center; justify-content:center;}
.dir-opt.sel .do-radio { border-color:#7c3aed;}
.dir-opt.sel .do-radio::after { content:''; width:9px; height:9px; border-radius:50%; background:#7c3aed;}
.dir-opt .do-desc { font-size:13px; color:#6b7280; line-height:1.6;}
.dir-opt .do-pros { font-size:12px; color:#16a34a; margin-top:6px;}

/* AI 生成：预览步骤 */
.prev-item { display:flex; align-items:flex-start; gap:10px; padding:10px 12px; border:1px solid #f3f4f6; border-radius:10px; margin-bottom:8px; cursor:pointer;}
.prev-item:hover { border-color:#ddd6fe; }
.prev-item input { margin-top:3px; width:16px; height:16px; accent-color:#7c3aed;}
.prev-item .pi-body { flex:1; min-width:0;}
.prev-item .pi-title { font-size:14px; font-weight:600; color:#1f2937;}
.prev-item .pi-meta { font-size:12px; color:#6b7280; margin-top:2px; line-height:1.5;}
.prev-note { font-size:12px; color:#9ca3af; margin-top:8px;}

/* 步骤「✓ 完成」主操作按钮（评审纪要 F3：操作条首位，主视觉区别于其余 ghost 按钮） */
.sd-actions .btn-primary-sm {
  background:#7c3aed; color:#fff; border:none; padding:6px 12px; border-radius:6px;
  font-size:13px; font-weight:600; cursor:pointer; margin-top:0;
}
.sd-actions .btn-primary-sm:hover { background:#6d28d9; }

/* 主线产物清单（P0-3）：产物是"成果"，主线页直接可见 */
.do-list {
  display:flex; flex-direction:column; gap:6px;
  max-height:220px; overflow-y:auto; padding-right:2px;
}
.do-item {
  display:flex; align-items:center; gap:8px;
  padding:7px 9px; border:1px solid #eef0f4; border-radius:8px;
  background:#fbfbfe; font-size:13px; cursor:default;
}
.do-item:hover { border-color:#ddd6fe; background:#f7f5ff; }
.do-ico { flex:0 0 auto; }
.do-title {
  flex:1 1 auto; min-width:0; color:#1f2937;
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}
.do-time { flex:0 0 auto; font-size:11px; color:#9ca3af; }


/* ---------- 页头 hero 卡：图标锚 + 标题 + 徽章元信息行；动作统一右侧 ---------- */
.detail-header { display:flex; align-items:center; gap:16px; position:relative;
                 background:linear-gradient(135deg,#fbfaff 0%,#ffffff 60%);
                 border:1px solid #ebe6fb; border-radius:16px; padding:18px 22px; margin-bottom:16px;
                 box-shadow:var(--shadow); }
.detail-header::before { content:''; position:absolute; left:0; top:0; bottom:0; width:4px;
                         background:linear-gradient(180deg,#8b5cf6,#6d28d9);
                         border-radius:16px 0 0 16px; }
.dh-icon { width:46px; height:46px; border-radius:13px; flex-shrink:0; color:#fff;
           background:linear-gradient(135deg,#8b5cf6,#6d28d9);
           display:flex; align-items:center; justify-content:center;
           box-shadow:0 4px 12px rgba(124,58,237,.28); }
.dh-main { flex:1; min-width:0; }
.detail-header-title { font-size:21px; font-weight:800; color:var(--t1); line-height:1.35;
                       white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.detail-sub { margin-top:9px; display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.detail-header-actions { display:flex; gap:8px; align-items:center; flex-shrink:0; }
.dh-back { display:flex; align-items:center; gap:6px; background:#fff; border:1px solid var(--line2);
           color:var(--t2); font-size:13px; font-weight:600; padding:8px 14px; border-radius:9px;
           cursor:pointer; transition:.15s; flex-shrink:0; }
.dh-back:hover { color:var(--pri); border-color:#ddd6fe; background:var(--pri-soft2); }

/* 徽章元信息行 */
.dh-pill { display:inline-flex; align-items:center; gap:4px; padding:3px 10px; border-radius:999px;
           font-size:12px; font-weight:600; white-space:nowrap; }
.dh-pill.badge-pri-high { background:#ede9fe; color:#7c3aed; }
.dh-pill.badge-pri-mid  { background:#fef3c7; color:#d97706; }
.dh-pill.badge-pri-low  { background:#f3f4f6; color:#6b7280; }
.dh-pill.badge-status-doing { background:#dcfce7; color:#16a34a; }
.dh-pill.badge-status-wait  { background:#dbeafe; color:#2563eb; }
.dh-pill.badge-status-hold  { background:#ffedd5; color:#ea580c; }
.dh-pill.badge-status-done  { background:#ede9fe; color:#7c3aed; }
.dh-prog { display:inline-flex; align-items:center; gap:7px; padding:3px 10px; border-radius:999px;
           background:#fff; border:1px solid var(--line2); font-size:12px; color:var(--t3); }
.dh-prog b { color:var(--t1); font-weight:700; }
.dh-prog-bar { width:56px; height:5px; border-radius:3px; background:#eceef3; overflow:hidden; }
.dh-prog-bar i { display:block; height:100%; background:linear-gradient(90deg,#8b5cf6,#7c3aed); border-radius:3px; transition:width .3s; }
.dh-time { font-size:12px; color:var(--t4); white-space:nowrap; }

/* ---------- 版本号徽章（需求4：详情页展示主线版本） ---------- */
.dh-pill.badge-ver {
  background:#f0f9ff; color:#0284c7; border:1px solid #bae6fd;
  font-weight:700; font-family:'SF Mono',Consolas,monospace;
}

/* ---------- 变更日志弹窗（需求3/4：步骤编辑版本记录查看） ---------- */
.cl-summary {
  font-size:13px; color:var(--t3); margin:4px 0 14px; padding:8px 12px;
  background:#f8fafc; border-radius:8px;
}
.cl-list { display:flex; flex-direction:column; gap:10px; max-height:60vh; overflow-y:auto; }
.cl-item {
  background:#fff; border:1px solid var(--line2); border-radius:10px; padding:10px 14px;
}
.cl-head { display:flex; align-items:center; gap:10px; flex-wrap:wrap; margin-bottom:6px; }
.cl-step { font-weight:700; color:var(--t1); font-size:13.5px; }
.cl-field { font-size:12px; color:#7c3aed; background:#f3e8ff; padding:1px 8px; border-radius:999px; }
.cl-ver { font-size:11px; color:var(--t3); font-family:'SF Mono',Consolas,monospace; }
.cl-time { font-size:11.5px; color:var(--t4); margin-left:auto; }
.cl-diff { display:flex; align-items:center; gap:8px; font-size:13px; flex-wrap:wrap; }
.cl-diff .old { color:#dc2626; background:#fef2f2; padding:2px 8px; border-radius:5px; max-width:40%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.cl-diff .arrow { color:var(--t4); font-size:14px; }
.cl-diff .new { color:#16a34a; background:#f0fdf4; padding:2px 8px; border-radius:5px; max-width:40%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.dh-pill.dh-note { background:#f0f9ff; color:#0369a1; }
.dh-pill.dh-reason { background:var(--amber-bg); color:var(--amber-d); max-width:420px;
                     overflow:hidden; text-overflow:ellipsis; }

/* 「⋯」更多菜单（编辑/搁置/删除） */
.more-wrap { position:relative; }
.more-menu { position:absolute; right:0; top:calc(100% + 6px); background:#fff; border:1px solid var(--line);
             border-radius:10px; box-shadow:0 8px 24px rgba(0,0,0,.10); padding:6px; min-width:118px; z-index:60; }
.more-menu button { display:block; width:100%; text-align:left; border:none; background:transparent;
                    padding:8px 12px; border-radius:8px; font-size:13.5px; color:var(--t1); cursor:pointer; }
.more-menu button:hover { background:#f5f3ff; }
.more-menu .mm-sep { height:1px; background:var(--line); margin:5px 4px; }
.more-menu button.mm-danger { color:#dc2626; }
.more-menu button.mm-danger:hover { background:#fef2f2; }

@media (max-width:860px){
  .detail-header { flex-wrap:wrap; }
  .detail-header-actions { width:100%; justify-content:flex-end; }
}
