:root {
  /* 固定暗色 */
  --bg: #161614;
  --surface: #1e1d1b;
  --surface-2: #23221f;
  --ink: #ecEae3;
  --ink-2: #c4c1b8;
  --muted: #8d8a82;
  --faint: #5e5c56;
  --line: #2f2e2a;
  --line-2: #282724;
  --track: #2e2d29;
  --active: #6fb48f;
  --active-soft: #1f3329;
  --done: #6fb48f;
  --paused: #d1a656;
  --paused-soft: #3a3120;
  --failed: #e07a6c;
  --failed-soft: #3a2420;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px rgba(0, 0, 0, .35);
  --radius: 14px;
  --serif: "Songti SC", "Noto Serif SC", "Source Han Serif SC", serif;
  --sans: -apple-system, "PingFang SC", "Helvetica Neue", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}
button { font: inherit; color: inherit; cursor: pointer; }
input, textarea { font: inherit; color: inherit; }
kbd {
  font: 11px var(--sans);
  padding: 1px 5px;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 4px;
  background: var(--surface);
}

.page { max-width: 1180px; margin: 0 auto; padding: 48px 40px 64px; }

/* ── header ─────────────────────────────────────── */
.top { display: flex; align-items: flex-end; justify-content: space-between; gap: 32px; margin-bottom: 28px; }
h1 { font: 600 34px/1.1 var(--serif); letter-spacing: .04em; margin: 0 0 10px; }
.sub { color: var(--muted); font-size: 13px; display: flex; gap: 8px; align-items: center; }
.save { transition: color .2s; }
.save.busy { color: var(--paused); }
.save.err { color: var(--failed); }

.stats { display: flex; gap: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.stat { padding: 12px 22px; min-width: 92px; border-left: 1px solid var(--line-2); }
.stat:first-child { border-left: 0; }
.stat b { display: block; font: 600 22px/1.2 var(--sans); letter-spacing: -.01em; }
.stat span { font-size: 12px; color: var(--muted); }
.stat.overall b { color: var(--active); }
.stat.failed b { color: var(--failed); }
.stat.paused b { color: var(--paused); }

/* ── toolbar ────────────────────────────────────── */
.toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; gap: 16px; }
.filters { display: flex; gap: 4px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 3px; }
.filters button { border: 0; background: none; padding: 6px 14px; border-radius: 7px; color: var(--muted); font-size: 13px; }
.filters button:hover { color: var(--ink); }
.filters button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.08); font-weight: 500; }
.filters button i { font-style: normal; color: var(--faint); margin-left: 5px; font-size: 12px; }
.tools { display: flex; gap: 8px; }
.primary, .ghost, .danger {
  border-radius: 9px; padding: 8px 16px; font-size: 13px; font-weight: 500;
  border: 1px solid transparent; transition: background .15s, border-color .15s, transform .05s;
}
.primary { background: var(--ink); color: var(--bg); }
.primary:hover { opacity: .88; }
.primary:active, .ghost:active { transform: translateY(1px); }
.primary .plus { font-weight: 400; margin-right: 2px; }
.ghost { background: transparent; border-color: var(--line); color: var(--ink-2); }
.ghost:hover { background: var(--surface); border-color: var(--faint); }
.danger { background: transparent; color: var(--failed); border-color: transparent; padding-left: 0; }
.danger:hover { text-decoration: underline; }

/* ── board ──────────────────────────────────────── */
.board { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.row-grid { display: grid; grid-template-columns: var(--col-name, minmax(260px, 1.6fr)) minmax(170px, 1fr) 70px 84px 64px; gap: 24px; align-items: center; padding: 0 24px; }
.head { height: 42px; font-size: 12px; color: var(--muted); letter-spacing: .08em; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.r { text-align: right; }

.row { min-height: 64px; padding-top: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--line-2); cursor: pointer; position: relative; transition: background .12s; }
.row:last-child { border-bottom: 0; }
.row:hover { background: var(--surface-2); }
.row.sel { background: var(--surface-2); box-shadow: inset 3px 0 0 var(--ink); }
.row.child { min-height: 52px; padding-top: 9px; padding-bottom: 9px; }
.row.child .name-text { font-size: 14px; font-weight: 450; }

.name-cell { display: flex; align-items: flex-start; gap: 6px; min-width: 0; }
.indent { flex: none; align-self: stretch; position: relative; }
.indent i { position: absolute; top: -12px; bottom: -12px; width: 1px; background: var(--line); }
.twisty {
  flex: none; width: 22px; height: 22px; margin-top: 1px; border: 0; background: none; border-radius: 6px;
  display: grid; place-items: center; color: var(--muted);
}
.twisty:hover { background: var(--line-2); color: var(--ink); }
.twisty svg { transition: transform .18s; }
.twisty.open svg { transform: rotate(90deg); }
.twisty.none { visibility: hidden; }
.name-main { min-width: 0; flex: 1; }
.name-line { display: flex; align-items: center; gap: 8px; min-width: 0; }
.name-text { font-size: 15px; font-weight: 600; letter-spacing: .01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kids-count { flex: none; font-size: 11px; color: var(--muted); border: 1px solid var(--line); border-radius: 99px; padding: 0 7px; line-height: 18px; }
.note { font-size: 12.5px; color: var(--muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reason { font-size: 12.5px; color: var(--failed); margin-top: 3px; line-height: 1.45; }
.reason b { font-weight: 500; }
.add-kid {
  flex: none; opacity: 0; border: 1px dashed var(--faint); background: var(--surface); color: var(--muted);
  font-size: 11.5px; border-radius: 6px; padding: 1px 8px; transition: opacity .12s;
}
.row:hover .add-kid { opacity: 1; }
.add-kid:hover { color: var(--ink); border-color: var(--ink-2); }

/* failed: 划掉 */
.xmark {
  flex: none; width: 18px; height: 18px; border-radius: 50%; background: var(--failed-soft); color: var(--failed);
  display: grid; place-items: center;
}
.row.failed .name-text { text-decoration: line-through; text-decoration-color: var(--failed); text-decoration-thickness: 1.5px; color: var(--muted); font-weight: 500; }
.row.failed .note { text-decoration: line-through; text-decoration-color: var(--faint); }
.row.in-failed .name-text { color: var(--muted); }
.row.in-failed .bar-fill, .row.in-failed .seg.on { background: var(--faint); }

/* progress */
.prog { display: flex; align-items: center; gap: 14px; min-width: 0; }
.bar { flex: 1; height: 6px; border-radius: 99px; background: var(--track); overflow: hidden; }
.bar-fill { height: 100%; border-radius: 99px; background: var(--active); transition: width .35s cubic-bezier(.2,.7,.3,1); }
.pct { flex: none; width: 44px; text-align: right; font-weight: 600; font-size: 14px; }
.segs { flex: 1; display: flex; gap: 3px; }
.seg { flex: 1; height: 6px; border-radius: 99px; background: var(--track); }
.seg.on { background: var(--active); }
.prog-meta { font-size: 12px; color: var(--muted); margin-top: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prog-meta em { font-style: normal; color: var(--ink-2); }
.row.paused .bar-fill, .row.paused .seg.on { background: var(--paused); }
.row.failed .bar-fill, .row.failed .seg.on { background: var(--faint); }
.row.failed .pct { color: var(--faint); font-weight: 500; }
.row.child .bar, .row.child .seg { height: 4px; }

.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; padding: 3px 10px 3px 8px; border-radius: 99px; white-space: nowrap; }
.chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip.active { background: var(--active-soft); color: var(--active); }
.chip.done { background: var(--active); color: var(--surface); }
.chip.done::before { background: var(--surface); }
.chip.paused { background: var(--paused-soft); color: var(--paused); }
.chip.failed { background: var(--failed-soft); color: var(--failed); }
.when { font-size: 12px; color: var(--muted); text-align: right; white-space: nowrap; }

.divider { display: flex; align-items: center; gap: 12px; padding: 18px 24px 8px; font-size: 12px; letter-spacing: .1em; color: var(--failed); background: var(--surface-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line-2); }
.divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.empty { padding: 72px 24px; text-align: center; color: var(--muted); }
.empty p { margin: 0 0 16px; }
.foot { margin-top: 18px; color: var(--faint); font-size: 12px; text-align: center; }

/* ── drawer ─────────────────────────────────────── */
.scrim { position: fixed; inset: 0; background: rgba(0, 0, 0, .45); backdrop-filter: blur(1px); animation: fade .2s; }
.drawer {
  position: fixed; top: 12px; right: 12px; bottom: 12px; width: 440px; max-width: calc(100vw - 24px);
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 20px 60px rgba(0,0,0,.5);
  transform: translateX(calc(100% + 24px)); transition: transform .26s cubic-bezier(.2,.8,.25,1);
  display: flex; flex-direction: column; overflow: hidden;
}
.drawer.open { transform: none; }
@keyframes fade { from { opacity: 0; } }

.d-head { padding: 18px 22px 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.crumbs { font-size: 12px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px; align-items: center; min-width: 0; }
.crumbs a { color: var(--muted); text-decoration: none; cursor: pointer; }
.crumbs a:hover { color: var(--ink); text-decoration: underline; }
.close { border: 0; background: none; width: 30px; height: 30px; border-radius: 8px; color: var(--muted); display: grid; place-items: center; flex: none; }
.close:hover { background: var(--line-2); color: var(--ink); }
.d-body { flex: 1; overflow-y: auto; padding: 8px 22px 22px; }
.d-foot { border-top: 1px solid var(--line-2); padding: 12px 22px; display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--muted); }

.f-name { width: 100%; border: 0; outline: 0; background: none; font: 600 24px/1.3 var(--serif); padding: 6px 0 2px; letter-spacing: .02em; }
.f-note { width: 100%; border: 0; outline: 0; background: none; color: var(--ink-2); font-size: 14px; padding: 2px 0 6px; }
.f-name::placeholder, .f-note::placeholder { color: var(--faint); }

.sec { margin-top: 22px; }
.sec-title { font-size: 12px; color: var(--muted); letter-spacing: .08em; margin-bottom: 10px; display: flex; justify-content: space-between; align-items: center; }
.seg-ctl { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 3px; }
.seg-ctl button { border: 0; background: none; border-radius: 7px; padding: 7px 0; font-size: 13px; color: var(--muted); }
.seg-ctl button:hover { color: var(--ink); }
.seg-ctl button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.08); font-weight: 500; }
.seg-ctl button.on.s-active { color: var(--active); }
.seg-ctl button.on.s-done { background: var(--active); color: var(--surface); }
.seg-ctl button.on.s-paused { color: var(--paused); }
.seg-ctl button.on.s-failed { background: var(--failed-soft); color: var(--failed); }
.seg-ctl.small button { padding: 5px 0; font-size: 12px; }

.f-reason {
  width: 100%; min-height: 84px; resize: vertical; margin-top: 10px; border-radius: 10px; padding: 10px 12px; outline: 0;
  border: 1px solid color-mix(in srgb, var(--failed) 35%, var(--line)); background: var(--failed-soft); color: var(--ink);
}
.f-reason::placeholder { color: color-mix(in srgb, var(--failed) 55%, transparent); }

.big-pct { display: flex; align-items: baseline; gap: 4px; margin: 4px 0 10px; }
.big-pct input { width: 74px; border: 0; outline: 0; background: none; font: 600 36px/1 var(--sans); letter-spacing: -.02em; padding: 0; }
.big-pct span { font-size: 18px; color: var(--muted); }
input[type=range] { width: 100%; accent-color: var(--ink); }
.quick { display: flex; gap: 6px; margin-top: 8px; }
.quick button { flex: 1; border: 1px solid var(--line); background: none; border-radius: 7px; padding: 4px 0; font-size: 12px; color: var(--muted); }
.quick button:hover { color: var(--ink); border-color: var(--faint); }

.steps { list-style: none; margin: 0; padding: 0; }
.step { display: flex; align-items: center; gap: 10px; padding: 6px 4px; border-radius: 8px; }
.step:hover { background: var(--surface-2); }
.step .num { width: 18px; font-size: 11px; color: var(--faint); text-align: right; flex: none; }
.check {
  flex: none; width: 18px; height: 18px; border-radius: 5px; border: 1.5px solid var(--faint); background: none; padding: 0;
  display: grid; place-items: center; color: transparent;
}
.check.on { background: var(--active); border-color: var(--active); color: var(--surface); }
.step input { flex: 1; border: 0; outline: 0; background: none; font-size: 14px; padding: 2px 0; min-width: 0; }
.step.done input { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--faint); }
.step .mini { opacity: 0; flex: none; border: 0; background: none; color: var(--faint); width: 22px; height: 22px; border-radius: 5px; font-size: 13px; line-height: 1; }
.step:hover .mini { opacity: 1; }
.step .mini:hover { background: var(--line-2); color: var(--ink); }
.add-line { display: flex; align-items: center; gap: 10px; padding: 6px 4px; }
.add-line span { width: 18px; flex: none; }
.add-line .plus-box { width: 18px; height: 18px; border-radius: 5px; border: 1.5px dashed var(--faint); flex: none; display: grid; place-items: center; color: var(--faint); font-size: 13px; line-height: 1; }
.add-line input { flex: 1; border: 0; outline: 0; background: none; font-size: 14px; }
.add-line input::placeholder { color: var(--faint); }

.auto-box { background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 12px; padding: 14px 16px; }
.auto-box .big { font: 600 30px/1 var(--sans); letter-spacing: -.02em; }
.auto-box .hint { font-size: 12px; color: var(--muted); margin-top: 6px; }
.auto-box .bar { margin-top: 12px; }

.kids { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line-2); border-radius: 12px; overflow: hidden; }
.kid { display: grid; grid-template-columns: 1fr 90px 42px; gap: 12px; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--line-2); cursor: pointer; font-size: 13.5px; }
.kid:last-child { border-bottom: 0; }
.kid:hover { background: var(--surface-2); }
.kid .k-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kid.failed .k-name { text-decoration: line-through; text-decoration-color: var(--failed); color: var(--muted); }
.kid .bar { height: 4px; }
.kid .k-pct { font-size: 12px; text-align: right; color: var(--muted); }
.kid.paused .bar-fill { background: var(--paused); }
.kid.failed .bar-fill { background: var(--faint); }
.add-kid-btn { margin-top: 8px; width: 100%; border: 1px dashed var(--faint); background: none; border-radius: 10px; padding: 9px; color: var(--muted); font-size: 13px; }
.add-kid-btn:hover { color: var(--ink); border-color: var(--ink-2); background: var(--surface-2); }

.order { display: flex; gap: 6px; }
.order button { border: 1px solid var(--line); background: none; border-radius: 7px; padding: 3px 10px; font-size: 12px; color: var(--muted); }
.order button:hover:not(:disabled) { color: var(--ink); border-color: var(--faint); }
.order button:disabled { opacity: .4; cursor: default; }

@media (max-width: 820px) {
  .page { padding: 28px 16px 48px; }
  .top { flex-direction: column; align-items: flex-start; }
  .row-grid { grid-template-columns: 1fr 1fr; gap: 10px 16px; padding: 0 16px; }
  .head { display: none; }
  .row .status-cell, .row .when, .row .ev-cell { display: none; }
}

/* ── 预期值 ─────────────────────────────────────── */
.c { text-align: center; }
.ev-cell { display: flex; flex-direction: column; align-items: center; line-height: 1.15; }
.ev-num { font: 600 18px/1 var(--sans); letter-spacing: -.01em; }
.ev-sub { font-size: 11px; color: var(--muted); margin-top: 4px; white-space: nowrap; }
.ev-none { color: var(--faint); }
.ev-cell.hi .ev-num, .ev-big.hi { color: var(--active); }
.ev-cell.mid .ev-num, .ev-big.mid { color: var(--ink); }
.ev-cell.lo .ev-num, .ev-big.lo { color: var(--muted); }
.row.paused .ev-num, .row.failed .ev-num, .row.in-failed .ev-num { color: var(--faint); }
.row.child .ev-num { font-size: 15px; }
#sortEv.on { background: var(--surface); border-color: var(--ink-2); color: var(--ink); }

.ev-hint { letter-spacing: 0; font-size: 11.5px; color: var(--faint); }
.ev-box { display: flex; gap: 18px; align-items: center; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 12px; padding: 14px 16px; }
.ev-big { font: 600 40px/1 var(--sans); letter-spacing: -.02em; min-width: 56px; text-align: center; }
.ev-big.none { color: var(--faint); }
.rates { flex: 1; display: grid; gap: 8px; }
.rate-row { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.rate-label { width: 60px; color: var(--ink-2); }
.pips { display: flex; gap: 4px; flex: 1; }
.pip { flex: 1; height: 10px; max-width: 34px; border: 0; padding: 0; border-radius: 99px; background: var(--track); transition: background .12s; }
.pip:hover { background: var(--faint); }
.pip.on { background: var(--active); }
.rate-val { width: 14px; text-align: right; font-weight: 600; color: var(--ink-2); }
.f-evnote { width: 100%; min-height: 56px; resize: vertical; margin-top: 8px; border-radius: 10px; padding: 9px 12px; outline: 0; border: 1px solid var(--line); background: none; font-size: 13px; color: var(--ink-2); }
.f-evnote:focus { border-color: var(--faint); }

/* ── 目标值 ─────────────────────────────────────── */
.goal-set { display: flex; gap: 10px; margin-bottom: 10px; align-items: flex-end; }
.goal-set label { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--muted); width: 110px; }
.goal-set label.wide { flex: 1; width: auto; }
.goal-set input, .entry-add input {
  border: 1px solid var(--line); background: var(--surface-2); border-radius: 9px; padding: 8px 10px; outline: 0; font-size: 14px; min-width: 0;
}
.goal-set input:focus, .entry-add input:focus { border-color: var(--faint); }
.cur-ctl { width: 84px; flex: none; }
.goal-now { background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 12px; padding: 14px 16px; margin: 6px 0 14px; }
.goal-big { display: flex; align-items: baseline; gap: 8px; }
.goal-big b { font: 600 34px/1 var(--sans); letter-spacing: -.02em; }
.goal-big span { color: var(--muted); font-size: 14px; }
.goal-big i { font-style: normal; margin-left: auto; font-weight: 600; color: var(--active); font-size: 16px; }
.goal-now .bar { margin-top: 12px; }
.goal-money { font-size: 12px; color: var(--muted); margin-top: 10px; line-height: 1.7; }
.goal-money:empty { display: none; }
.entry-add { display: flex; gap: 8px; }
.entry-add input:first-child { flex: 1; }
.entry-add input[type=number] { width: 84px; }
.entry-add .primary { padding: 8px 14px; flex: none; }
.entry-hint { font-size: 11.5px; color: var(--faint); margin: 6px 2px 10px; }
.entries { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line-2); border-radius: 12px; overflow: hidden; }
.entry { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-bottom: 1px solid var(--line-2); }
.entry:last-child { border-bottom: 0; }
.entry:hover { background: var(--surface-2); }
.entry input { border: 0; outline: 0; background: none; font-size: 13.5px; min-width: 0; }
.e-label { flex: 1; }
.e-amt { width: 74px; text-align: right; font-weight: 600; color: var(--active); }
.e-amt.neg { color: var(--failed); }
.e-date { font-size: 11.5px; color: var(--faint); width: 44px; text-align: right; flex: none; }
.entry .mini { opacity: 0; flex: none; border: 0; background: none; color: var(--faint); width: 22px; height: 22px; border-radius: 5px; }
.entry:hover .mini { opacity: 1; }
.entry .mini:hover { background: var(--line-2); color: var(--ink); }
input[type=number] { -moz-appearance: textfield; }
input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; }

/* ── 拖拽并入 ───────────────────────────────────── */
.row[draggable=true] { -webkit-user-drag: element; }
.row.dragging { opacity: .35; }
.row.drop-into { background: var(--active-soft); box-shadow: inset 0 0 0 1.5px var(--active); border-radius: 10px; }
.row.drop-into::after { content: "放进这里当子项目"; position: absolute; right: 16px; top: 50%; transform: translateY(-50%); font-size: 12px; color: var(--active); background: var(--surface); padding: 3px 10px; border-radius: 99px; border: 1px solid var(--active); }
.root-drop { margin: 10px 16px; padding: 12px; border: 1.5px dashed var(--faint); border-radius: 10px; text-align: center; color: var(--muted); font-size: 13px; }
.root-drop.drop-into { border-color: var(--active); color: var(--active); background: var(--active-soft); }
.f-parent { width: 100%; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); border-radius: 9px; padding: 8px 10px; font: inherit; font-size: 13.5px; outline: 0; }

.sub-title { font-size: 12px; color: var(--muted); margin: 4px 0 6px; }
.goal-formula { display: flex; align-items: center; gap: 8px; margin-bottom: 2px; }
.goal-formula input { flex: 1; min-width: 0; border: 1px solid var(--line); background: var(--surface-2); border-radius: 9px; padding: 8px 10px; outline: 0; font: 14px ui-monospace, "SF Mono", Menlo, monospace; }
.goal-formula input:focus { border-color: var(--faint); }
.goal-formula .u { color: var(--ink); }
.goal-formula .cur-ctl { flex: none; }
.f-err { color: var(--failed); }
.goal-money div { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.goal-money b { color: var(--ink); font-weight: 600; }
.goal-money .yr { color: var(--faint); }

/* ── 归档 / 右键菜单 ────────────────────────────── */
.ctx { position: fixed; z-index: 50; min-width: 180px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 5px; box-shadow: 0 12px 32px rgba(0,0,0,.5); }
.ctx button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 7px 12px; border-radius: 6px; font-size: 13px; color: var(--ink); }
.ctx button:hover { background: var(--line); }
.ctx hr { border: 0; border-top: 1px solid var(--line); margin: 4px 2px; }
.arch-tag { flex: none; font-size: 11px; color: var(--muted); border: 1px dashed var(--faint); border-radius: 99px; padding: 0 7px; line-height: 18px; }
.row.archived .name-text { color: var(--muted); }
.foot-actions { display: flex; align-items: center; gap: 10px; }
.small-btn { padding: 4px 10px; font-size: 12px; }

/* ── 利润公式 ───────────────────────────────────── */
.f-ptext { width: 100%; min-height: 60px; resize: vertical; border-radius: 10px; padding: 9px 12px; outline: 0; border: 1px solid var(--line); background: var(--surface-2); font-size: 14px; color: var(--ink); margin-bottom: 10px; }
.f-ptext:focus { border-color: var(--faint); }
.pend { color: var(--paused); }
.sec-title .pend, .sec-title .ok { letter-spacing: 0; font-size: 11.5px; padding: 1px 8px; border-radius: 99px; }
.sec-title .pend { background: var(--paused-soft); }
.sec-title .ok { background: var(--active-soft); color: var(--active); }
.pend-head { color: var(--paused); }
.pend-head::before { content: "·"; color: var(--muted); margin: 0 8px 0 0; }
.params { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 2px; }
.params label { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-2); background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 9px; padding: 4px 4px 4px 10px; }
.params input { width: 70px; border: 0; background: var(--bg); border-radius: 6px; padding: 4px 6px; outline: 0; font-size: 13px; text-align: right; }
.p-result { background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 10px; padding: 10px 12px; margin-top: 8px; font-size: 13px; }
.p-result:empty { display: none; }
.p-result b { font-size: 16px; }
.muted { color: var(--muted); }

.fx { display: flex; align-items: center; gap: 4px; font-size: 12.5px; color: var(--muted); border: 1px solid var(--line); border-radius: 9px; padding: 0 4px 0 10px; }
.fx input { width: 52px; border: 0; background: none; outline: 0; font-size: 13px; color: var(--ink); padding: 7px 2px; }
.cny { color: var(--muted); font-weight: 400; font-size: .92em; }

.pend-head.err { color: var(--failed); }
.pend-head.done { color: var(--active); }
.p-note { font-size: 12px; color: var(--paused); margin-top: 6px; }

/* ── 融资 ───────────────────────────────────────── */
.fund-stages { display: flex; flex-wrap: wrap; gap: 6px; }
.fund-stages button { border: 1px solid var(--line); background: var(--surface-2); color: var(--muted); border-radius: 99px; padding: 5px 12px; font-size: 12.5px; }
.fund-stages button:hover { color: var(--ink); border-color: var(--faint); }
.fund-stages button.on { color: var(--ink); border-color: var(--ink-2); background: var(--surface); font-weight: 500; }
.fund-stages button.on.f-raising, .fund-stages button.on.f-waiting, .fund-stages button.on.f-dd, .fund-stages button.on.f-terms { color: #8fb3e8; border-color: #8fb3e8; }
.fund-stages button.on.f-closed { color: var(--active); border-color: var(--active); }
.fund-stages button.on.f-paused { color: var(--paused); border-color: var(--paused); }
.fund-tag { flex: none; font-size: 11px; border-radius: 99px; padding: 0 8px; line-height: 18px; border: 1px solid #4a5f80; color: #8fb3e8; background: #1c2533; white-space: nowrap; }
.fund-tag.f-prep { border-color: var(--line); color: var(--ink-2); background: var(--surface-2); }
.fund-tag.f-closed { border-color: var(--active); color: var(--active); background: var(--active-soft); }
.fund-tag.f-paused { border-color: var(--paused); color: var(--paused); background: var(--paused-soft); }
.fund-bar { display: flex; align-items: center; gap: 12px; font-size: 12.5px; color: var(--muted); margin: 2px 0 4px; }
.fund-bar .bar { flex: 1; }
.gap-quick { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 4px; }
.gap-quick button { border: 1px dashed var(--faint); background: none; color: var(--muted); border-radius: 99px; padding: 2px 10px; font-size: 12px; }
.gap-quick button:hover { color: var(--ink); border-color: var(--ink-2); }
.fund-set label { width: auto; flex: 1; min-width: 0; }
.fund-set input { width: 100%; }
.fund-set .cur-ctl { width: 76px; }

/* ── 门槛 ───────────────────────────────────────── */
.moat-row { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; font-size: 13px; color: var(--ink-2); }
.moat-row > span { width: 120px; flex: none; }
.moat-row .seg-ctl { flex: 1; }
.moat-tag { flex: none; font-size: 11px; border-radius: 99px; padding: 0 8px; line-height: 18px; white-space: nowrap; border: 1px solid var(--line); color: var(--muted); }
.moat-tag.m-hi { border-color: var(--active); color: var(--active); background: var(--active-soft); }
.moat-tag.m-mid { border-color: var(--paused); color: var(--paused); background: var(--paused-soft); }
.sec-title .moat-tag { letter-spacing: 0; }

.moat-scale { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; }
.moat-scale button { border: 1px solid var(--line); background: var(--surface-2); border-radius: 9px; padding: 7px 4px 6px; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 3px; }
.moat-scale button b { font-size: 16px; font-weight: 600; }
.moat-scale button span { font-size: 10.5px; line-height: 1.25; text-align: center; }
.moat-scale button:hover { border-color: var(--faint); color: var(--ink); }
.moat-scale button.fill { background: var(--active-soft); border-color: color-mix(in srgb, var(--active) 40%, var(--line)); color: var(--ink-2); }
.moat-scale button.on { border-color: var(--active); color: var(--active); }

/* ── 标签行 + 拖动调列宽 ────────────────────────── */
.tag-line { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 5px; }
.col-name-h { position: relative; align-self: stretch; display: flex; align-items: center; }
.col-resize { position: absolute; right: -14px; top: 6px; bottom: 6px; width: 9px; cursor: col-resize; border-radius: 4px; }
.col-resize::after { content: ""; position: absolute; left: 4px; top: 0; bottom: 0; width: 1px; background: var(--line); }
.col-resize:hover::after, body.col-resizing .col-resize::after { background: var(--active); width: 2px; left: 3.5px; }
body.col-resizing, body.col-resizing * { cursor: col-resize !important; user-select: none !important; }

/* 进度条只是辅助：短条 + 百分比 */
.row .prog { gap: 10px; }
.row .bar, .row .segs { flex: none; width: 90px; }
.row .pct { width: auto; min-width: 36px; text-align: left; font-size: 13.5px; }
.row.child .pct { font-size: 13px; }
.tools button, .filters button, .fx { white-space: nowrap; }
.toolbar { flex-wrap: wrap; }

/* 拖动排序：插入位置的横线 */
.row.drop-before { box-shadow: inset 0 2.5px 0 var(--active); }
.row.drop-after { box-shadow: inset 0 -2.5px 0 var(--active); }
.row.drop-before::after, .row.drop-after::after { position: absolute; right: 16px; font-size: 11.5px; color: var(--active); background: var(--surface); padding: 1px 9px; border-radius: 99px; border: 1px solid var(--active); }
.row.drop-before::after { content: "插到这里前面"; top: 4px; }
.row.drop-after::after { content: "插到这里后面"; bottom: 4px; }

/* 未开始 */
.chip.todo { background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.seg-ctl button.on.s-todo { color: var(--ink-2); }
.row.todo .name-text { color: var(--ink-2); }

.foot #logout { color: var(--muted); margin-right: 10px; text-decoration: none; }
.foot #logout:hover { color: var(--ink); }

/* ── 上下游 / 拓扑图 ────────────────────────────── */
.link-row { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 8px; font-size: 13px; }
.link-k { width: 104px; flex: none; color: var(--ink-2); padding-top: 4px; }
.link-v { flex: 1; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.link-chip { display: inline-flex; align-items: center; gap: 4px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 99px; padding: 2px 4px 2px 10px; font-size: 12.5px; }
.link-chip button { border: 0; background: none; color: var(--faint); width: 18px; height: 18px; border-radius: 50%; font-size: 11px; padding: 0; }
.link-chip button:hover { background: var(--line); color: var(--ink); }
.link-v select { border: 1px dashed var(--faint); background: none; color: var(--muted); border-radius: 99px; padding: 3px 8px; font: inherit; font-size: 12.5px; outline: 0; max-width: 200px; }
.link-v select option { background: var(--surface); color: var(--ink); }
#viewTopo.on { border-color: var(--ink-2); color: var(--ink); background: var(--surface); }

.topo { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: auto; padding-bottom: 10px; }
.topo-hint { font-size: 12px; color: var(--muted); padding: 14px 20px 0; }
.topo-empty { font-size: 13px; color: var(--muted); padding: 0 20px 16px; }
.topo-canvas { position: relative; margin: 0 auto; }
.topo-canvas svg { position: absolute; inset: 0; overflow: visible; }
.edge { fill: none; stroke: var(--faint); stroke-width: 1.6; }
.arrow { fill: var(--faint); }
.t-node { position: absolute; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; cursor: pointer; display: flex; flex-direction: column; justify-content: center; gap: 6px; transition: border-color .12s, transform .12s; }
.t-node:hover { border-color: var(--ink-2); transform: translateY(-1px); }
.t-node.failed .t-name { text-decoration: line-through; color: var(--muted); }
.t-node.paused, .t-node.todo { opacity: .75; }
.t-sub { font-size: 10.5px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: -4px; }
.t-name { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-meta { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.t-meta .chip { font-size: 11px; padding: 1px 8px 1px 6px; }
.t-moat { font-size: 11px; border-radius: 99px; padding: 0 6px; border: 1px solid var(--line); }
.t-moat.m-hi { color: var(--active); border-color: var(--active); }
.t-moat.m-mid { color: var(--paused); border-color: var(--paused); }
