/* ============================================================
   ide.css — IDE 工作台（复刻 zcode.z.ai 首页 IDE 外观）
   左：任务列表（蓝色左边框高亮当前项）
   中：任务工作流（AI 协作日志：步骤卡片 + diff 徽章 + 终端行）
   右：Git tools (Changes/Branch/Commit) + Goal + Progress +
       蓝图 HUD 进度条（NO.10：从左到右移动的标记线）+ Milestones
   ============================================================ */

.ide-wrap { position: relative; }
.ide-note {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: #8fa3b8;
  border: 1px solid var(--line-dark-2);
  padding: 6px 14px;
  border-radius: 99px;
  margin-bottom: 16px;
  letter-spacing: .06em;
}

.ide-shell {
  background: #0a0d12;
  border: 1px solid #262d37;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 24px 80px rgba(0, 0, 0, .5);
}
.ide-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: #14181f;
  border-bottom: 1px solid #262d37;
}
.ide-dots { display: flex; gap: 7px; }
.ide-dots i { width: 12px; height: 12px; border-radius: 50%; display: block; }
.ide-dots i:nth-child(1) { background: #ff5f57; }
.ide-dots i:nth-child(2) { background: #febc2e; }
.ide-dots i:nth-child(3) { background: #28c840; }
.ide-top-tools { display: flex; gap: 8px; }
.ide-top-tools span { width: 34px; height: 16px; border-radius: 4px; background: #232a34; display: block; }

.ide-tabs {
  display: flex;
  align-items: stretch;
  background: #10141b;
  border-bottom: 1px solid #262d37;
  overflow-x: auto;
  scrollbar-width: none;
}
.ide-tabs::-webkit-scrollbar { display: none; }
.ide-tab {
  flex: none;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  font-size: 12.5px;
  color: #8fa3b8;
  background: transparent;
  border: none;
  border-right: 1px solid #1d232c;
  border-top: 2px solid transparent;
  white-space: nowrap;
  transition: background .15s, color .15s;
}
.ide-tab:hover { background: rgba(255, 255, 255, .04); }
/* B-12 演示标签：明确不可点击态（虚线边 + 降透明度，hover 不响应） */
.ide-tab.demo { opacity: .45; cursor: not-allowed; border-right-style: dashed; }
.ide-tab.demo:hover { background: transparent; }
.ide-tab.on {
  background: #0a0d12;
  color: #fff;
  border-top-color: #4a9eff;
}
.ide-tab .it-dot { width: 6px; height: 6px; border-radius: 50%; flex: none; }

/* B-21 IDE 限高：约一页内放下（视口高的 74%，上限 720px），
   超出部分由各列内部滚动（左任务 / 中工作流 / 右工具栏各自 overflow-y:auto） */
.ide-grid {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr) 330px;
  height: min(74vh, 720px);
  min-height: 480px;
  max-height: min(74vh, 720px);
  background: #0a0d12;
}
.ide-col { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.ide-col + .ide-col { border-left: 1px solid #1f2630; }
.ide-col-title {
  flex: none;
  padding: 10px 14px;
  font-size: 11px;
  letter-spacing: .18em;
  font-family: var(--font-mono);
  color: #7c8da1;
  background: #0e1219;
  border-bottom: 1px solid #1f2630;
  text-transform: uppercase;
}
.ide-col > div { min-height: 0; flex: 1 1 auto; overflow-y: auto; }

/* ---------- 左列：任务列表 ---------- */
#ide-projects { overflow-y: auto; padding: 10px 0; }
.ide-proj-item {
  position: relative;
  width: 100%;
  display: block;
  text-align: left;
  background: transparent;
  border: none;
  border-left: 2px solid transparent;
  padding: 10px 14px 10px 16px;
  color: #8fa3b8;
  transition: background .15s;
  font-size: 13px;
}
.ide-proj-item:hover { background: rgba(255, 255, 255, .04); }
.ide-proj-item.on {
  border-left-color: #4a9eff;
  background: rgba(74, 158, 255, .10);
  color: #fff;
}
.ide-proj-item .ip-row { display: flex; align-items: center; gap: 8px; }
.ide-proj-item .ip-icon {
  width: 9px; height: 9px; border-radius: 50%;
  background: #3d4754;
  flex: none;
}
.ide-proj-item.on .ip-icon { background: #4a9eff; box-shadow: 0 0 8px rgba(74, 158, 255, .8); }
.ide-proj-item .ip-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ide-proj-item .ip-time { font-family: var(--font-mono); font-size: 10.5px; color: #5d6a78; }
.ide-proj-item .ip-desc {
  margin-top: 3px;
  font-size: 11.5px;
  color: #6d7d8f;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- 中列：工作流 ---------- */
#ide-col-center > #ide-stage { overflow-y: auto; padding: 18px 20px 26px; }
.wf-head { margin-bottom: 18px; }
.wf-title {
  font-size: 16px;
  font-weight: 700;
  color: #eef3f8;
  line-height: 1.5;
  padding: 12px 16px;
  background: #0e1420;
  border: 1px solid #1f2630;
  border-left: 3px solid #4a9eff;
  border-radius: 8px;
}
.wf-goal { margin-top: 10px; font-size: 13px; color: #9fb0c2; line-height: 1.7; }
.wf-goal b { color: #cfe3ff; }

.wf-step {
  position: relative;
  margin-bottom: 14px;
  border: 1px solid #1f2630;
  border-radius: 10px;
  background: #0d1118;
  padding: 13px 16px 13px 46px;
  transition: border-color .2s, box-shadow .2s;
}
.wf-step:hover { border-color: #2c3644; }
.wf-step::before {
  content: "";
  position: absolute;
  left: 15px; top: 22px;
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 2px solid #3d4754;
  background: transparent;
}
.wf-step.status-done::before {
  content: "✓";
  border-color: #22c55e;
  background: rgba(34, 197, 94, .15);
  color: #22c55e;
  font-size: 11px;
  display: flex; align-items: center; justify-content: center;
}
.wf-step.status-doing { border-color: rgba(74, 158, 255, .55); box-shadow: 0 0 20px rgba(74, 158, 255, .10); }
.wf-step.status-doing::before {
  content: "";
  border-color: #4a9eff;
  animation: pulseRing 1.6s ease-in-out infinite;
}
@keyframes pulseRing {
  0%, 100% { box-shadow: 0 0 0 0 rgba(74, 158, 255, .5); }
  50% { box-shadow: 0 0 0 7px rgba(74, 158, 255, 0); }
}
.wf-step-title { font-size: 14px; font-weight: 600; color: #dde7f0; }
.wf-step-title .ws-num { font-family: var(--font-mono); color: #4a9eff; margin-right: 8px; font-size: 12px; }
.wf-step-desc { margin-top: 4px; font-size: 12.5px; color: #8fa3b8; line-height: 1.65; }
.wf-step-meta {
  display: flex;
  gap: 14px;
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: #6d7d8f;
  align-items: center;
  flex-wrap: wrap;
}
.wf-badge {
  padding: 1px 7px;
  border-radius: 5px;
  font-size: 10.5px;
  font-family: var(--font-mono);
  line-height: 1.5;
}
.wf-badge.add { background: rgba(34, 197, 94, .13); color: #22c55e; border: 1px solid rgba(34, 197, 94, .3); }
.wf-badge.del { background: rgba(239, 68, 68, .13); color: #ef4444; border: 1px solid rgba(239, 68, 68, .3); }
.wf-badge.info { background: rgba(74, 158, 255, .12); color: #7db9ff; border: 1px solid rgba(74, 158, 255, .3); }
.wf-badge.ok { background: rgba(34, 197, 94, .12); color: #22c55e; border: 1px solid rgba(34, 197, 94, .3); }

.wf-term {
  font-family: var(--font-mono);
  font-size: 12px;
  background: #060a10;
  border: 1px solid #1f2630;
  border-radius: 8px;
  padding: 12px 14px;
  margin: 6px 0 14px;
  color: #b9e6c8;
  line-height: 1.7;
  overflow-x: auto;
  white-space: pre-wrap;
}
.wf-term .t-ok { color: #22c55e; font-weight: 700; }
.wf-term .t-cmd { color: #7db9ff; }

.wf-diff { display: inline-flex; gap: 4px; margin-left: 6px; }

/* 步骤可编辑 */
.wf-step[contenteditable="true"] { outline: none; cursor: text; }
.wf-step.editable:hover { border-color: rgba(74, 158, 255, .4); box-shadow: 0 0 0 1px rgba(74, 158, 255, .18); }

/* ---------- 右列 ---------- */
#ide-toolbar { overflow-y: auto; display: flex; flex-direction: column; }
.tb-block { padding: 13px 14px; border-bottom: 1px solid #1f2630; }
.tb-title {
  font-size: 11px;
  font-family: var(--font-mono);
  letter-spacing: .16em;
  color: #7c8da1;
  text-transform: uppercase;
  margin-bottom: 9px;
  display: flex; align-items: center; gap: 7px;
}
.tb-title .tt-ico { color: #4a9eff; }

/* Git changes */
.git-react { display: flex; align-items: center; justify-content: space-between; font-size: 12px; color: #aebccb; margin-bottom: 8px; }
.git-refresh { cursor: pointer; background: transparent; border: none; color: #8fa3b8; font-size: 13px; }
.git-refresh:hover { color: #fff; animation: spinOnce .5s ease; }
@keyframes spinOnce { to { transform: rotate(180deg); } }
.git-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: #9fb0c2;
  padding: 6px 0;
}
.git-row .gr-msg { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.git-row .gr-hash { color: #5d6a78; }
.git-chip { padding: 1px 6px; border-radius: 4px; font-size: 10px; }
.git-chip.add { background: rgba(34, 197, 94, .14); color: #22c55e; }
.git-chip.del { background: rgba(239, 68, 68, .14); color: #ef4444; }
.git-branch-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 8px 0;
}
.git-branch {
  flex: 1;
  font-family: var(--font-mono);
  font-size: 11.5px;
  padding: 7px 10px;
  background: #101722;
  border: 1px solid #262d37;
  border-radius: 7px;
  color: #aebccb;
  display: flex;
  align-items: center;
  gap: 6px;
}
.git-commit {
  padding: 7px 14px;
  font-size: 12px;
  background: #4a9eff;
  color: #fff;
  border: none;
  border-radius: 7px;
  font-weight: 600;
  transition: background .15s, transform .15s;
}
.git-commit:hover { background: #66adff; transform: translateY(-1px); }

/* Goal */
.goal-box {
  font-size: 12.5px;
  color: #aebccb;
  line-height: 1.7;
  border: 1px dashed #2c3644;
  border-radius: 8px;
  padding: 10px 12px;
  background: rgba(74, 158, 255, .05);
  cursor: text;
  outline: none;
}
.goal-box:focus { border-color: #4a9eff; }

/* Progress —— 蓝图 HUD 进度条（NO.10：刻度 + 从左到右移动的标记线） */
.prog-bar {
  position: relative;
  height: 18px;
  border: 1px solid rgba(126, 201, 255, .55);
  background:
    repeating-linear-gradient(90deg, rgba(126, 201, 255, .16) 0 1px, transparent 1px 10%),
    rgba(4, 18, 40, .6);
  border-radius: 3px;
  overflow: hidden;
  box-shadow: inset 0 0 12px rgba(0, 0, 0, .6), 0 0 0 1px rgba(126, 201, 255, .12);
}
.prog-fill {
  height: 100%;
  width: 0%;
  background: repeating-linear-gradient(45deg, #4d9fff 0 10px, #2f7bff 10px 20px);
  box-shadow: 0 0 14px rgba(77, 159, 255, .6);
  transition: width .5s cubic-bezier(.22, .9, .3, 1);
}
.prog-marker {
  position: absolute;
  top: -2px; bottom: -2px;
  width: 2px;
  background: var(--bp-amber);
  box-shadow: 0 0 12px rgba(255, 209, 102, .9);
  left: 0%;
  animation: progSweep 2.6s linear infinite;
}
@keyframes progSweep {
  0% { left: -2px; }
  100% { left: calc(100% - 0px); }
}
.prog-meta {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 11px;
  color: #8fa3b8;
  margin-top: 8px;
}
.prog-pct { color: #7db9ff; font-weight: 700; }

/* Milestones */
.ms-row {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 5px 0;
  font-size: 12px;
  color: #aebccb;
  cursor: pointer;
}
.ms-row .ms-check {
  flex: none;
  width: 15px; height: 15px;
  border: 1.5px solid #4a5a6c;
  border-radius: 4px;
  margin-top: 2px;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; color: transparent;
  transition: all .15s;
}
.ms-row.done .ms-check {
  background: rgba(34, 197, 94, .18);
  border-color: #22c55e;
  color: #22c55e;
}
.ms-row.done .ms-title { text-decoration: line-through; color: #6d7d8f; }
.ms-row:hover .ms-check { border-color: #7db9ff; }
.ms-date { font-family: var(--font-mono); font-size: 10.5px; color: #5d6a78; margin-left: auto; flex: none; }

/* ---------- 响应式 ---------- */
@media (max-width: 1120px) {
  .ide-grid { grid-template-columns: 230px minmax(0, 1fr); }
  .ide-col-right { grid-column: 1 / -1; border-left: none; border-top: 1px solid #1f2630; max-height: 420px; }
}
@media (max-width: 760px) {
  .ide-grid { grid-template-columns: 1fr; height: auto; max-height: none; min-height: 0; }
  .ide-col { min-height: 0; }
  .ide-col + .ide-col { border-left: none; border-top: 1px solid #1f2630; }
  #ide-projects { max-height: 240px; }
  #ide-stage { max-height: 46vh; }
  #ide-toolbar { max-height: 46vh; }
}
