﻿/* ============================================================
   阶段步骤条 —— OrderTrack「进展流程」/ OrderTech「阶段流水」共用样式
   By WorkBuddy Space-Bunny · 2026-10-27
   ============================================================
   DOM 由 App_Code/StageSteps.vb 输出（两页完全同源）：
     .stage-steps  容器
     .stage-step   单个阶段（.done / .doing / .todo / .is-current）
     .stage-dot    图标（✓ / ● / ○）
     .stage-name   阶段名
     .stage-state  状态徽标（已完成 / 进行中 / 未开始）
     .stage-meta   完成日期（yyyy-MM-dd），内含 .stage-metapfx（「完成于」前缀）
     .stage-bar    横向进度条（客户页用）→ .stage-bar-in
     .stage-vbar   竖向轨道（大屏用）  → .stage-vbar-in（填充高度 = 阶段进度）

   🔴 两页的列宽差 4 倍（客户页 ~700px 宽松 / 大屏卡片 158px 紧凑），
      同一份 DOM 靠**主题类**表现不同：
        .ot-theme  客户页（浅色商务，宽松两行式）
        大屏主题不走 .ot-theme，用 .tc-rail 作用域单独一套（见下方主题二）
   ============================================================ */

/* ---------- 共享基础 ---------- */
.stage-steps { }
.stage-step { display: flex; align-items: flex-start; position: relative; }
.stage-dot { flex: none; display: flex; align-items: center; justify-content: center; }
.stage-body { flex: none; }
.stage-name { flex: none; }
.stage-state { flex: none; }
.stage-meta { flex: none; }
.stage-metapfx { font-style: normal; }
/* 日期双跨度（2026-10-27）：默认显完整、隐短日期；窄档由大屏主题翻转
   🔴 两页统一口径：窄档降级 MM-DD，而不是把日期整个藏掉（信息量与客户页对齐）。 */
.stage-metafull { }
.stage-metashort { display: none; }
/* 进度数字（2026-10-27）：默认两主题都不显示，由各主题按需打开
   （客户页有横向进度条，显示数字属重复信息 → 保持隐藏） */
.stage-pct { flex: none; display: none; }
/* 并行说明（2026-10-27 方案 A）：默认隐藏，仅客户页主题显示 */
.stage-hint { display: none; }
.stage-bar { display: none; }
.stage-bar-in { display: block; }
.stage-vbar { display: none; }
.stage-vbar-in { display: block; }

/* ============================================================
   主题一：OrderTrack 客户页（浅色商务，宽松两行式 + 横向进度条）
   —— 从原 .ot-step* 规则迁移而来，只改了类名，视觉保持不变
   ============================================================ */
.ot-theme .stage-step { display: flex; gap: 14px; position: relative; padding: 8px 0 14px 2px; }
.ot-theme .stage-step:not(:last-child)::before { content: ""; position: absolute; left: 15px; top: 36px; bottom: -2px; width: 2px; background: #dfe6ee; }
.ot-theme .stage-dot { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 14px; flex: none; background: #eef2f6; color: #95a5a6; border: 2px solid #dfe6ee; position: relative; z-index: 1; }
.ot-theme .stage-step.done .stage-dot { background: #27ae60; border-color: #27ae60; color: #fff; }
.ot-theme .stage-step.done::before { background: #27ae60; }
.ot-theme .stage-step.doing .stage-dot { background: #fff; border-color: #2d5a8e; color: #2d5a8e; font-size: 11px; }
.ot-theme .stage-body { flex: 1; min-width: 0; }
.ot-theme .stage-name { font-size: 15px; font-weight: 600; color: #34495e; }
.ot-theme .stage-step.todo .stage-name { color: #95a5a6; font-weight: 500; }
.ot-theme .stage-state { font-size: 12px; margin-left: 8px; padding: 1px 8px; border-radius: 10px; }
.ot-theme .stage-step.done .stage-state { background: #e8f8ef; color: #1e7a45; }
.ot-theme .stage-step.doing .stage-state { background: #e8f1fb; color: #2d5a8e; }
.ot-theme .stage-step.todo .stage-state { background: #f2f4f6; color: #95a5a6; }
/* 🔴 共享 DOM 里 meta / bar 是 <span>（大屏要行内），客户页要它们各占一行 → display:block */
.ot-theme .stage-meta { display: block; font-size: 12.5px; color: #7f8c9b; margin-top: 3px; }
.ot-theme .stage-meta .stage-metapfx { margin-right: 4px; }
.ot-theme .stage-bar { display: block; height: 7px; background: #edf1f5; border-radius: 4px; margin-top: 7px; overflow: hidden; max-width: 320px; }
.ot-theme .stage-bar-in { height: 100%; background: #4a90d9; border-radius: 4px; }
/* 2026-10-27 方案 A：并行进行中的客户说明（≥2 个 doing 时 StepsHtml 才输出）
   —— 客户看到多个「进行中」时给一句解释，避免误以为数据错误。 */
.ot-theme .stage-hint { display: block; font-size: 12px; line-height: 17px; color: #8a97a5;
                        margin-top: 10px; padding-top: 9px; border-top: 1px dashed #dfe6ee; }
/* 竖向轨道在客户页不用 */
.ot-theme .stage-vbar { display: none; }

/* ============================================================
   主题二：OrderTech 大屏卡片（深色 HUD，紧凑单行 + 左侧竖向进度轨道）
   —— 作用域 .tc-rail（大屏卡片右下的阶段流水竖列）
   ============================================================ */
.tc-rail .stage-step { display: -ms-flexbox; display: flex; -ms-flex-align: center; flex-align: center;
                         /* 🔴 position:static —— 让绝对定位的竖向轨道落到 td.tc-railstep（position:relative）
                            上，铺满整行（.stage-step 自身是 relative 的话轨道只包住文字高度）。 */
                         position: static; }
.tc-rail .stage-body { display: -ms-flexbox; display: flex; -ms-flex-align: center; flex-align: center;
                        flex: 1 1 auto; min-width: 0; }
/* 🔴 2026-10-28 定档（三轮反复后的结论，别再凭观感改）：
   ① 10-27 方案 A：name13 / state11 / meta11 / pct10.5 —— 栏内不齐、比右侧「进展记录」大 → 用户说"不一样"
   ② 10-28 上午：全部压回 11px 求齐 —— 用户说"字体没变大"（方向错了：齐 ≠ 小）
   ③ 现在（用户拍板「真放大 13px」）：**name 13px / 其余 11px**，并同步把阶段列
      宽档 158→186px（OrderTech.aspx 的 td.tc-stagecell）——不加宽放不下：
      name13(4字≈52) + 徽标11(≈51) + 日期11(≈72) ≈ 175px > 158px → 名字必被压成省略号。
   行高 26px 不动（「与产品图齐平」的成果；字号与行高是两笔账）。
   窄档（≤1500px）阶段列只有 116px，见文末 media：name 回落 11px，避免被截。 */
.tc-rail .stage-dot { width: auto; height: auto; border: none; background: none; border-radius: 0;
                      font-size: 11px; line-height: 15px; margin-right: 3px; color: inherit; }
.tc-rail .stage-name { font-size: 13px; line-height: 18px; white-space: nowrap; overflow: hidden;
                       text-overflow: ellipsis; min-width: 0; flex: 0 1 auto; }
.tc-rail .stage-state { font-size: 11px; line-height: 15px; padding: 0 6px; border-radius: 7px;
                        margin-left: 6px; white-space: nowrap; border: 1px solid transparent; }
.tc-rail .stage-meta { font-family: Consolas, "Courier New", monospace; font-size: 11px; line-height: 15px;
                       color: rgba(255,255,255,.4); margin-left: 6px; white-space: nowrap; }
.tc-rail .stage-meta .stage-metapfx { display: none; }
/* 状态徽标配色：done=绿（与客户页同语义）/ doing=青 / todo=灰 */
.tc-rail .stage-step.done .stage-state { color: #86EFAC; background: rgba(34,197,94,.16); border-color: rgba(34,197,94,.55); }
.tc-rail .stage-step.doing .stage-state { color: #A5F3FC; background: rgba(34,211,238,.14); border-color: rgba(34,211,238,.5); }
.tc-rail .stage-step.todo .stage-state { color: rgba(255,255,255,.42); background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.14); }
/* 横向进度条在大屏不用 */
.tc-rail .stage-bar { display: none; }
/* 进度数字（2026-10-27）：doing 行显示「90%」，一眼看到推进到哪，不必瞄轨道填充高度
   🔴 flex:none 防被 name 的 ellipsis 压缩挤没；客户页（.ot-theme）不显示（有横向进度条）。 */
.tc-rail .stage-pct { display: inline; font-family: Consolas, "Courier New", monospace;
                      font-size: 11px; line-height: 15px; color: #7DD3FC;
                      margin-left: 6px; white-space: nowrap; flex: none; }
/* 🔴 当前阶段的进度数字提亮加粗（与行底色/轨道辉光组成三重加码，见下方 is-current 规则） */
.tc-railstep.tc-railcur .stage-step .stage-pct,
.tc-railstep.tc-railcurdev .stage-step .stage-pct { font-weight: bold; }
.tc-railstep.tc-railcur .stage-step .stage-pct { color: #A5F3FC; }
.tc-railstep.tc-railcurdev .stage-step .stage-pct { color: #DDD6FE; }
/* 🔴 doing 行「进度数字优先，日期退 title」：行内只放 pct，不放日期。
   空间账（实测列宽）：doing 行四件套「名称+徽标+pct+日期」宽档 158px 也放不下
   （dot10+徽标42+pct21+日期57+间距 ≈ 145px，name 只剩 ~13px 必被 flex 压没）；
   doing 行客户最关心"推进到多少了"，完成日期是 done 行的信息。
   完整信息不丢 —— td 的 title 已含「名称 · 更新于 日期 · 进度 N%」（RailHtml 生成）。
   🔴 特异性 (0,3,0) 压过 .tc-rail .stage-meta (0,2,0)；只隐藏 doing，done 行日期照显。 */
.tc-rail .stage-step.doing .stage-meta { display: none; }
/* 竖向轨道：卡片主体左边 5px 的「阶段进度轨」
   🔴 绝对定位 → 最近的定位祖先是 td.tc-railstep（position:relative），
      所以轨道铺满**整行**，而不是只包住文字 —— 这正是要的效果。
   🔴 2026-10-27 用户要求「未开始阶段也给空槽」：vbar 本体即空槽（灰色底），
      todo 的 vbar-in 高 0% + 透明填充 → 露出底槽；done=满格绿 / doing=按进度青 / todo=空槽灰，
      三种状态用同一把尺子量，行与行之间不会再「断档」。
      底槽透明度 .10→.14：3px 改 5px 后老透明度在深色底上几乎看不见，空槽形同虚设。 */
.tc-rail .stage-vbar { display: block; position: absolute; left: 0; top: 0; bottom: 0; width: 5px;
                        border-radius: 2px; background: rgba(255,255,255,.14); overflow: hidden; }
.tc-rail .stage-vbar-in { position: absolute; left: 0; bottom: 0; width: 100%; border-radius: 2px; }
.tc-rail .stage-step.done .stage-vbar-in { background: #4ADE80; }
.tc-rail .stage-step.doing .stage-vbar-in { background: #38BDF8; }
.tc-rail .stage-step.todo .stage-vbar-in { background: transparent; }
/* 2026-10-27「当前阶段」高亮加码：行底色在 OrderTech.aspx（.tc-railcur/.tc-railcurdev），
   这里补另外两层 —— ② 轨道辉光 ③ 徽标实底，三层叠起来「一眼可辨」。
   🔴 选择器必须凑到与 .tc-rail .stage-step.doing .stage-vbar-in 同特异性（4 个类）
      且声明在其后，否则辉光被 doing 的普通青色压过（IE11 没有 :not/low 级新特性可借）。 */
.tc-railstep.tc-railcur .stage-step .stage-vbar-in { background: #22D3EE; box-shadow: 0 0 5px rgba(34,211,238,.85); }
.tc-railstep.tc-railcurdev .stage-step .stage-vbar-in { background: #A5B4FC; box-shadow: 0 0 5px rgba(129,140,248,.85); }
.tc-railstep.tc-railcur .stage-step .stage-state { color: #ECFEFF; background: rgba(34,211,238,.26); border-color: #22D3EE; }
.tc-railstep.tc-railcurdev .stage-step .stage-state { color: #F5F3FF; background: rgba(129,140,248,.26); border-color: #818CF8; }
/* 矮屏/窄档卡片更小：进度数字同步缩号，给阶段名留压缩空间
   🔴 断点与 OrderTech.aspx 的列宽分级（1500px）/ 矮屏压缩（820px）一致，改断点两处同步。
   2026-10-27：8.5→10px（标准档字号整体 +1 档后的等比缩小，不再回到 8.5 的老缩率）。 */
@media (max-width: 1500px) {
    .tc-rail .stage-pct { font-size: 10px; margin-left: 4px; }
    /* 窄档阶段列仅 116px：徽标 padding/margin 同步收紧，给 doing 行的名称再让 4px
       （特异性 (0,2,0) 与基础规则持平、声明在后 → 生效） */
    .tc-rail .stage-state { padding: 0 4px; margin-left: 4px; }
    /* 🔴 2026-10-28：宽档把 name 抬到 13px（配 186px 列宽），窄档列只有 116px 放不下
       → 回落 11px/15px。断点与 OrderTech.aspx 的 td.tc-stagecell 分级严格同断点，改一处必须改另一处。 */
    .tc-rail .stage-name { font-size: 11px; line-height: 15px; }
}
@media (max-height: 820px) {
    .tc-rail .stage-pct { font-size: 10px; margin-left: 4px; }
}
