/* ============================================================================
   ASPICE 研发 · 演示页业务窗口内的专用样式
   ----------------------------------------------------------------------------
   底子沿用 demo.css 的「墨色 · 纸白」令牌与 cx- 组件（顶栏、窗口、KPI、
   卡片、AI 卡…）。这里只补 ASPICE 自己的视图：
     1. 五步主线（需求 → 评审 → 设计 → 用例 → 闭环）
     2. 需求树表 / 追溯矩阵 / 用例库 / BUG 台账
     3. Sprint 看板四列
   一律只做展示，不带业务逻辑。
   ==========================================================================*/

/* 侧栏条目偏多时纵向滚动，别被裁掉；同时压缩条高，尽量一屏放完 */
.cx-side .cx-nav-list {
    overflow-y: auto;
    scrollbar-width: thin;
}
.cx-side .cx-nav-list::-webkit-scrollbar { width: 5px; }
.cx-side .cx-nav-list::-webkit-scrollbar-thumb { background: #e2e2dd; border-radius: 3px; }
.cx-side .cx-nav-item { height: 27px; font-size: 12.2px; }
.cx-side .cx-nav-group + .cx-nav-group { margin-top: 7px; }
.cx-side .cx-nav-label { padding-bottom: 3px; }

/* ---------------------------------------------------------------- 五步主线 */
.cx-steps {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 14px;
}
.cx-step {
    position: relative;
    padding: 11px 12px 12px;
    background: var(--cx-card);
    border: 1px solid var(--cx-line);
    border-radius: var(--cx-r-sm);
    overflow: hidden;
}
.cx-step::before {
    content: '';
    position: absolute; left: 0; right: 0; top: 0; height: 2.5px;
    background: var(--cx-line-2);
}
.cx-step.is-amber::before { background: var(--cx-amber); }
.cx-step.is-ok::before { background: var(--cx-ok); }
.cx-step.is-danger::before { background: var(--cx-danger); }
.cx-step-n {
    display: block;
    font-family: var(--cx-mono);
    font-size: 9.5px; font-weight: 700; letter-spacing: .07em;
    color: var(--cx-faint);
}
.cx-step-t {
    display: block;
    margin: 2px 0 3px;
    font-size: 12.5px; font-weight: 700; color: var(--cx-ink);
}
.cx-step-s { display: block; font-size: 10.5px; line-height: 1.45; color: var(--cx-muted); }
.cx-step.is-amber .cx-step-s { color: var(--cx-amber); }
.cx-step.is-danger .cx-step-s { color: var(--cx-danger); }
.cx-step.is-ok .cx-step-s { color: var(--cx-ok); }

/* ------------------------------------------------------------- 需求树表 */
.cx-tree td:first-child { padding-left: 10px; }
.cx-tree .cx-indent { display: inline-block; width: 16px; }
.cx-tree .cx-code {
    font-family: var(--cx-mono); font-size: 10.5px; font-weight: 700;
    color: var(--cx-brand);
}
.cx-tree tr.is-parent td { background: var(--cx-sink); }
.cx-tree tr.is-on td { background: var(--cx-brand-soft); }
.cx-check {
    display: inline-flex; align-items: center; justify-content: center;
    width: 13px; height: 13px; border-radius: 3px; margin-right: 6px;
    border: 1.2px solid var(--cx-line);
    color: #fff; font-size: 9px; vertical-align: -1px;
}
.cx-check.is-on { background: var(--cx-brand); border-color: var(--cx-brand); }

/* --------------------------------------------------------------- 追溯矩阵 */
.cx-matrix { border-collapse: separate; border-spacing: 0; width: 100%; }
.cx-matrix th, .cx-matrix td { padding: 6px 8px; text-align: center; }
.cx-matrix th {
    font-size: 9.5px; font-weight: 700; color: var(--cx-faint);
    border-bottom: 1px solid var(--cx-line);
    background: var(--cx-sink);
}
.cx-matrix th:first-child, .cx-matrix td:first-child { text-align: left; }
.cx-matrix td { border-bottom: 1px solid var(--cx-line-2); }
.cx-matrix td:first-child {
    font-family: var(--cx-mono); font-size: 10px; font-weight: 700;
    color: var(--cx-brand); white-space: nowrap;
}
.cx-dot {
    display: inline-block; width: 7px; height: 7px; border-radius: 50%;
    background: var(--cx-line);
}
.cx-dot.is-on { background: var(--cx-ok); }
.cx-dot.is-gap { background: var(--cx-danger); }
.cx-dot.is-warn { background: var(--cx-amber); }

/* ------------------------------------------------------------- Sprint 看板 */
.cx-kanban {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}
.cx-kcol {
    background: var(--cx-sink);
    border: 1px solid var(--cx-line);
    border-radius: var(--cx-r-sm);
    padding: 8px;
    min-height: 112px;
}
.cx-kcol-hd {
    display: flex; align-items: center; gap: 6px;
    margin-bottom: 7px;
    font-size: 10.5px; font-weight: 700; color: var(--cx-ink-2);
}
.cx-kcol-hd em {
    margin-left: auto; font-style: normal;
    font-size: 9.5px; font-weight: 600; color: var(--cx-faint);
}
.cx-kcol-hd i {
    width: 5px; height: 5px; border-radius: 50%;
    background: var(--cx-line); flex: none;
}
.cx-kcol.is-todo .cx-kcol-hd i { background: var(--cx-info); }
.cx-kcol.is-doing .cx-kcol-hd i { background: var(--cx-ok); }
.cx-kcol.is-test .cx-kcol-hd i { background: var(--cx-amber); }
.cx-kcol.is-done .cx-kcol-hd i { background: var(--cx-violet); }
.cx-kcard {
    background: var(--cx-card);
    border: 1px solid var(--cx-line);
    border-radius: 7px;
    padding: 7px 8px;
    margin-bottom: 6px;
}
.cx-kcard.is-on { border-color: var(--cx-brand-line); box-shadow: 0 0 0 2px var(--cx-brand-soft); }
.cx-kcard b {
    display: block;
    font-family: var(--cx-mono); font-size: 9.5px; font-weight: 700;
    color: var(--cx-brand); margin-bottom: 2px;
}
.cx-kcard span { display: block; font-size: 10.5px; line-height: 1.45; color: var(--cx-ink-2); }
.cx-kcard em {
    display: inline-block; margin-top: 4px;
    font-style: normal; font-size: 9px; font-weight: 700;
    padding: 0 5px; border-radius: 3px;
    background: var(--cx-amber-soft); color: var(--cx-amber);
}
.cx-kcard em.is-ai { background: var(--cx-violet-soft); color: var(--cx-violet); }
.cx-kcard em.is-ok { background: var(--cx-ok-soft); color: var(--cx-ok); }

/* ----------------------------------------------------------- 小组件补充 */
.cx-subgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cx-mini-kpi {
    background: var(--cx-sink);
    border: 1px solid var(--cx-line);
    border-radius: 7px;
    padding: 8px 10px;
}
.cx-mini-kpi b {
    display: block; font-size: 15px; font-weight: 700;
    color: var(--cx-ink); font-variant-numeric: tabular-nums; line-height: 1.25;
}
.cx-mini-kpi span { display: block; font-size: 10px; color: var(--cx-muted); }

.cx-fix {
    margin-top: 6px; padding: 6px 8px;
    border: 1px dashed var(--cx-line);
    border-radius: 6px;
    background: var(--cx-sink);
    font-size: 10.5px; line-height: 1.6; color: var(--cx-muted);
}
.cx-fix b { color: var(--cx-ok); margin-right: 4px; }

.cx-issue {
    padding: 8px 10px;
    border: 1px solid var(--cx-line);
    border-left: 3px solid var(--cx-line);
    border-radius: 7px;
    margin-bottom: 8px;
}
.cx-issue:last-child { margin-bottom: 0; }
.cx-issue.is-high { border-left-color: var(--cx-danger); }
.cx-issue.is-mid { border-left-color: var(--cx-amber); }
.cx-issue.is-low { border-left-color: var(--cx-faint); }
.cx-issue-hd {
    display: flex; align-items: center; gap: 7px; margin-bottom: 3px;
    font-size: 11.5px; font-weight: 700; color: var(--cx-ink);
}
.cx-issue-hd code {
    font-family: var(--cx-mono); font-size: 9.5px;
    background: var(--cx-brand-soft); color: var(--cx-brand);
    padding: 0 4px; border-radius: 3px;
}
.cx-issue p { font-size: 10.5px; line-height: 1.65; color: var(--cx-muted); }

.cx-legend {
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
    margin-top: 8px;
    font-size: 10px; color: var(--cx-faint);
}
.cx-legend span { display: inline-flex; align-items: center; gap: 4px; }

/* ------------------------------------------------------------- 燃尽迷你图 */
.cx-bars {
    display: flex; align-items: flex-end; gap: 10px;
    padding: 10px 4px 0; height: 108px;
}
.cx-bar { flex: 1; display: flex; flex-direction: column; gap: 4px; height: 100%; }
.cx-bar-cols {
    flex: 1; display: flex; align-items: flex-end; justify-content: center; gap: 4px;
}
.cx-bar i { display: block; width: 40%; border-radius: 3px 3px 0 0; background: var(--cx-line); }
.cx-bar i.is-actual { background: var(--cx-brand); }
.cx-bar i.is-ideal { background: transparent; border: 1px dashed var(--cx-brand-line); border-bottom: 0; }
.cx-bar span { text-align: center; font-size: 9px; color: var(--cx-faint); }

@media (max-width: 900px) {
    .cx-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .cx-kanban { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .cx-subgrid { grid-template-columns: 1fr; }
}
