/* ===== 工作台布局 ===== */
.wb { max-width: 1440px; margin: 0 auto; padding: 28px var(--gutter) 96px; display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 32px; align-items: start; }
.wb__main { min-width: 0; display: grid; gap: 20px; }

/* ===== 项目台账（深色侧栏） ===== */
.ledger { position: sticky; top: 100px; max-height: calc(100vh - 124px); overflow: auto; background: var(--brand-deep); color: #fff; border-radius: var(--r-lg); scrollbar-width: thin; }
.ledger__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 20px 20px 12px; }
.ledger__head h2 { font-size: 15px; font-weight: 700; }
.ledger__count { font-size: 12px; color: var(--on-brand-2); }
.ledger__toggle { display: none; }
.ledger__list { padding: 0 10px 10px; display: grid; gap: 6px; }
.ledger__foot { display: flex; gap: 10px; margin: 0 10px 10px; padding: 14px 12px; border-top: 1px solid rgba(255, 255, 255, 0.12); font-size: 12px; line-height: 1.6; color: var(--on-brand-2); }
.ledger__foot svg { flex: none; width: 16px; height: 16px; margin-top: 1px; color: var(--hl); }

.proj { border-radius: var(--r); transition: background-color var(--t) var(--ease); }
.proj.is-current { background: rgba(255, 255, 255, 0.08); }
.proj__open { display: grid; gap: 10px; width: 100%; padding: 14px 12px 12px; border: 0; border-radius: var(--r); background: transparent; color: inherit; text-align: left; }
.proj:not(.is-current) .proj__open:hover { background: rgba(255, 255, 255, 0.05); }
.proj__top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.proj__no { font-size: 14px; font-weight: 600; letter-spacing: 0.01em; }
.proj__tag { font-size: 11.5px; font-weight: 600; padding: 3px 8px; border-radius: 999px; background: rgba(255, 255, 255, 0.12); color: var(--on-brand); white-space: nowrap; }
.proj__tag--live { background: var(--hl); color: var(--ink); }
.proj__prog { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.proj__prog i { height: 3px; border-radius: 2px; background: rgba(255, 255, 255, 0.16); overflow: hidden; position: relative; }
.proj__prog i::after { content: ""; position: absolute; inset: 0; background: #fff; transform: scaleX(0); transform-origin: left; transition: transform var(--t-slow) var(--ease); }
.proj__prog i.on::after { transform: scaleX(1); }
.proj__prog i.warn::after { background: var(--hl); transform: scaleX(1); }
.proj__steps { display: grid; padding: 0 4px 8px; }
.pstep { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; padding: 7px 8px; border: 0; border-radius: var(--r-sm); background: transparent; color: var(--on-brand-2); text-align: left; font-size: 13px; transition: background-color var(--t-fast), color var(--t-fast); }
.pstep:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
.pstep__val { font-variant-numeric: tabular-nums; color: rgba(188, 208, 238, 0.9); white-space: nowrap; }
.pstep.is-done { color: #fff; }
.pstep.is-done .pstep__val { color: #9fe0c0; }
.pstep.is-current { color: #fff; font-weight: 600; }
.pstep.is-current .pstep__val { color: var(--hl); font-weight: 600; }
.pstep.is-warn .pstep__val { color: #ffd27a; }

/* ===== 项目抬头 ===== */
.phead { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px 24px; align-items: end; padding: 4px 0 8px; }
.phead__label { font-size: 13px; color: var(--ink-3); }
.phead__row { margin-top: 6px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.phead__no { font-size: clamp(26px, 2.6vw, 36px); font-weight: 600; font-stretch: 106%; line-height: 1.15; letter-spacing: -0.01em; }
.phead__meta { margin-top: 8px; display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-3); }
.phead__meta .dot { color: var(--ok); }
.phead__actions { position: relative; display: flex; gap: 8px; }
.phead--archive { padding: 20px 24px; border-radius: var(--r-lg); background: var(--brand-tint); border: 1px solid var(--brand-line); }

.menu { position: absolute; right: 0; top: calc(100% + 8px); z-index: var(--z-popover); width: 320px; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh-2); animation: pop 180ms var(--ease); transform-origin: top right; }
.menu__head { display: flex; justify-content: space-between; padding: 8px 10px; font-size: 12px; color: var(--ink-3); }
.menu__item { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; padding: 10px; border: 0; border-radius: var(--r-sm); background: transparent; text-align: left; transition: background-color var(--t-fast); }
.menu__item:hover, .menu__item:focus-visible { background: var(--surface-2); }
.menu__item b { display: block; font-size: 13.5px; font-weight: 600; }
.menu__item small { display: block; margin-top: 2px; font-size: 12px; color: var(--ink-3); }
.menu__item > svg { width: 16px; height: 16px; color: var(--brand); flex: none; }
@keyframes pop { from { opacity: 0; transform: translateY(-4px) scale(0.98); } }

/* ===== 步骤进度 ===== */
.stepper { position: relative; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); padding: 18px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.stepper__track { position: absolute; left: calc(20px + 14px); right: calc(25% - 6px); top: 32px; height: 2px; background: var(--line); }
.stepper__track i { position: absolute; inset: 0; background: var(--brand); transform-origin: left; transform: scaleX(var(--k, 0)); transition: transform var(--t-slow) var(--ease); }
.stp { position: relative; z-index: 1; display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 2px 12px; padding: 0 12px 0 0; border: 0; background: transparent; text-align: left; }
.stp__mark { grid-row: span 2; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); border: 1.5px solid var(--line-2); font-size: 13px; font-weight: 600; color: var(--ink-3); font-variant-numeric: tabular-nums; transition: background-color var(--t), border-color var(--t), color var(--t); }
.stp__mark svg { width: 14px; height: 14px; }
.stp__t { justify-self: start; padding: 4px 10px 0 0; background: var(--surface); font-size: 14px; font-weight: 600; line-height: 1.4; color: var(--ink-3); }
.stp__v { font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stp.is-done .stp__mark { background: var(--brand); border-color: var(--brand); color: #fff; }
.stp.is-done .stp__t { color: var(--ink); }
.stp.is-current .stp__mark { border-color: var(--brand); color: var(--brand); box-shadow: 0 0 0 4px var(--brand-tint-2); }
.stp.is-current .stp__t { color: var(--ink); }
.stp.is-current .stp__v { color: var(--brand); font-weight: 600; }
.stp.is-warn .stp__mark { border-color: var(--warn); color: var(--warn); box-shadow: 0 0 0 4px var(--warn-bg); }
.stp.is-warn .stp__v { color: var(--warn); font-weight: 600; }
.stp:not(:disabled):hover .stp__t { color: var(--brand); }
.stp:disabled { cursor: default; }
.stp__short { display: none; }

/* ===== 步骤卡片 ===== */
.step { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); scroll-margin-top: 96px; transition: border-color var(--t) var(--ease), box-shadow var(--t) var(--ease); }
.step.is-open { box-shadow: var(--sh-2); }
.step.is-locked { background: transparent; border-style: dashed; }
.step__head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 16px; padding: 20px 24px; width: 100%; border: 0; background: transparent; text-align: left; border-radius: var(--r-lg); }
button.step__head:hover .step__title { color: var(--brand); }
.step__no { font-size: 28px; font-weight: 500; font-stretch: 112%; line-height: 1; color: var(--brand); font-variant-numeric: tabular-nums; min-width: 1.6em; }
.step.is-locked .step__no { color: #7d8798; }
.step__title { font-size: 18px; font-weight: 700; line-height: 1.35; transition: color var(--t-fast); }
.step.is-locked .step__title { color: var(--ink-3); }
.step__sum { margin-top: 2px; font-size: 13px; color: var(--ink-3); }
.step__sum b { color: var(--ink); font-weight: 600; }
.step__side { display: flex; align-items: center; gap: 10px; }
.step__chev { width: 18px; height: 18px; color: var(--ink-3); transition: transform var(--t) var(--ease); }
.step.is-open .step__chev { transform: rotate(180deg); }
.step__fold { display: grid; grid-template-rows: 0fr; transition: grid-template-rows var(--t-slow) var(--ease); }
.step.is-open .step__fold { grid-template-rows: 1fr; }
.step__fold > div { overflow: hidden; min-height: 0; }
.step__body { padding: 4px 24px 24px 80px; }
.step__foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 0 24px 0 80px; padding: 18px 0 22px; border-top: 1px solid var(--line); }
.step__hint { font-size: 13.5px; color: var(--ink-3); }
.step__hint svg { display: inline; width: 14px; height: 14px; vertical-align: -2px; margin-right: 6px; }

/* ===== Toast ===== */
.toasts { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: var(--z-toast); display: grid; gap: 8px; justify-items: center; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 999px; background: var(--ink); color: #fff; font-size: 13.5px; box-shadow: var(--sh-2); animation: toast-in 260ms var(--ease); max-width: min(520px, calc(100vw - 32px)); }
.toast svg { width: 16px; height: 16px; flex: none; color: #8fe0b8; }
.toast--warn svg { color: var(--hl); }
.toast.is-leaving { animation: toast-out 180ms ease-in forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px) scale(0.96); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(6px); } }

/* ===== 对话框 ===== */
.dialog { width: min(440px, calc(100vw - 32px)); padding: 0; border: 0; border-radius: var(--r-lg); background: var(--surface); color: var(--ink); box-shadow: var(--sh-3); }
.dialog::backdrop { background: rgba(3, 20, 52, 0.55); backdrop-filter: blur(3px); }
.dialog[open] { animation: dialog-in 280ms var(--ease); }
.dialog__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 24px 24px 0; }
.dialog__head h2 { margin-top: 16px; font-size: 20px; font-weight: 700; }
.dialog__head p { margin-top: 4px; font-size: 13.5px; color: var(--ink-3); }
.dialog__body { padding: 20px 24px; display: grid; gap: 16px; }
.dialog__foot { padding: 0 24px 24px; display: flex; justify-content: flex-end; gap: 8px; }
.icon-btn { width: 34px; height: 34px; display: grid; place-items: center; border: 0; border-radius: var(--r-sm); background: transparent; color: var(--ink-3); transition: background-color var(--t-fast), color var(--t-fast); }
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.icon-btn svg { width: 16px; height: 16px; }
@keyframes dialog-in { from { opacity: 0; transform: translateY(12px) scale(0.98); } }

@media (max-width: 1080px) {
  .wb { grid-template-columns: 1fr; gap: 20px; padding-top: 20px; }
  .ledger { position: static; max-height: none; }
  .ledger__toggle { display: inline-flex; background: transparent; color: #fff; border-color: rgba(255, 255, 255, 0.3); }
  .ledger__toggle:hover { background: rgba(255, 255, 255, 0.1); border-color: #fff; }
  .ledger:not(.is-open) .ledger__list, .ledger:not(.is-open) .ledger__foot { display: none; }
  .ledger:not(.is-open) .ledger__head { padding-bottom: 20px; }
}
@media (max-width: 720px) {
  .wb { padding: 16px 12px 64px; }
  .nav .user-pill { display: none; }
  .phead { grid-template-columns: 1fr; }
  .phead__actions .btn { flex: 1; }
  .menu { left: 0; right: 0; width: auto; }
  .stepper { padding: 14px 12px; }
  .stepper__track { left: calc(12px + 14px); right: calc(25% - 14px); top: 28px; }
  .stp { grid-template-columns: 1fr; justify-items: start; gap: 8px; padding-right: 4px; }
  .stp__mark { grid-row: auto; }
  .stp__t { font-size: 12px; padding-top: 0; white-space: nowrap; }
  .stp__full { display: none; }
  .stp__short { display: inline; }
  .stp__v { display: none; }
  .step__head { padding: 16px; gap: 12px; }
  .step__no { font-size: 22px; min-width: 1.4em; }
  .step__title { font-size: 16px; }
  .step__side .chip { display: none; }
  .step__body { padding: 4px 16px 20px; }
  .step__foot { margin: 0 16px; flex-direction: column; align-items: stretch; }
  .step__foot .btn { width: 100%; }
}
