/* ============================================================
   Pipeline Board — 设计系统：工程控制室
   纸面冷灰 / 墨黑 / 朱砂信号色 / Plex 字体 / 发丝线
   ============================================================ */

:root {
  --paper: #f4f5f6;
  --panel: #ffffff;
  --ink: #1a1d21;
  --ink-2: #4d5764;
  --mute: #8b95a3;
  --line: #e2e6ea;
  --line-strong: #cfd6dd;
  --seal: #c93a2e;
  --seal-soft: #fdecea;

  --st-plan: #7a8699;
  --st-review: #c07f14;
  --st-dev: #2f6bd8;
  --st-wait: #5d9aa8;
  --st-pr: #7a5cce;
  --st-done: #3e8e5a;

  --font-ui: 'IBM Plex Sans', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  --r-sm: 4px;
  --r-md: 6px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-ui);
  background: var(--paper);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.mono { font-family: var(--font-mono); font-feature-settings: 'tnum'; }

/* ---- 图标 ---- */
.ic {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
  vertical-align: -2px;
}
.ic--sm { width: 13px; height: 13px; }
.ic--lg { width: 20px; height: 20px; }

/* ---- 顶部导航 ---- */
.topbar {
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 30;
}
.topbar-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 16px;
  height: 52px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-right: 20px;
  text-decoration: none;
  color: var(--ink);
}
.brand-mark { color: var(--seal); display: flex; }
.brand-name {
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
}
.brand-sub {
  font-size: 11px;
  color: var(--mute);
  letter-spacing: 0.05em;
}
@media (max-width: 640px) {
  .brand-sub { display: none; }
  .brand { margin-right: 8px; }
  /* 顶栏内容超出时可横向滑动，不截断 */
  .topbar-inner { overflow-x: auto; scrollbar-width: none; }
  .topbar-inner::-webkit-scrollbar { display: none; }
  .topbar-inner > * { flex-shrink: 0; }
  .topbar .spacer { min-width: 8px; }
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  font-size: 13px;
  color: var(--ink-2);
  text-decoration: none;
  border-radius: var(--r-sm);
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.nav-link:hover { color: var(--ink); background: var(--paper); }
.nav-active {
  color: var(--ink);
  font-weight: 600;
  background: var(--paper);
  box-shadow: inset 0 -2px 0 var(--seal);
  border-radius: var(--r-sm) var(--r-sm) 0 0;
}
.topbar .spacer { flex: 1; }
.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--st-done);
  display: inline-block;
}
.live-dot--off { background: var(--line-strong); }
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  background: none;
  color: var(--ink-2);
  border-radius: var(--r-sm);
  cursor: pointer;
}
.icon-btn:hover { background: var(--paper); color: var(--ink); }

/* ---- 页面容器 ---- */
.page {
  max-width: 1440px;
  margin: 0 auto;
  padding: 16px;
}
.page--narrow { max-width: 960px; }

/* ---- 工具条 ---- */
.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}
.toolbar-note {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--mute);
  white-space: nowrap;
}
@media (max-width: 640px) { .toolbar-note { display: none; } }

.search-box {
  position: relative;
  flex: 1;
}
.search-box .ic {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--mute);
}
.search-input {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: var(--r-md);
  padding: 8px 12px 8px 32px;
  font-size: 13px;
  font-family: var(--font-ui);
  color: var(--ink);
  outline: none;
}
.search-input:focus { border-color: var(--ink); }

/* ---- 按钮 ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid transparent;
  border-radius: var(--r-md);
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 500;
  font-family: var(--font-ui);
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.12s, border-color 0.12s;
}
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn--primary { background: var(--ink); color: #fff; }
.btn--primary:hover:not(:disabled) { background: #000; }
.btn--seal { background: var(--seal); color: #fff; }
.btn--seal:hover:not(:disabled) { background: #a92f25; }
.btn--green { background: var(--st-done); color: #fff; }
.btn--green:hover:not(:disabled) { background: #327348; }
.btn--violet { background: var(--st-pr); color: #fff; }
.btn--violet:hover:not(:disabled) { background: #6549ad; }
.btn--ghost {
  background: var(--panel);
  border-color: var(--line);
  color: var(--ink-2);
}
.btn--ghost:hover:not(:disabled) { border-color: var(--ink-2); color: var(--ink); }
.btn--block { width: 100%; }
.btn--sm { padding: 5px 10px; font-size: 12px; }

/* ---- 看板：流水线轨道 ---- */
.board-wrap {
  position: relative;
}
/* 轨道线：贯穿各列顶部的信号线 */
.board-wrap::before {
  content: '';
  position: absolute;
  top: 15px;
  left: 24px;
  right: 24px;
  height: 1px;
  background: var(--line-strong);
  display: none;
}
@media (min-width: 768px) {
  .board-wrap::before { display: block; }
}

.board {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 16px;
  align-items: flex-start;
  position: relative;
}

.board-col {
  display: flex;
  flex-direction: column;
  min-width: 0;
  width: 100%;
  flex-shrink: 0;
}
@media (min-width: 768px) {
  /* 六列弹性等分：宽屏全部可见不滚动，窄屏（<~1420px）保持横向滚动 */
  .board-col { flex: 1 1 220px; width: auto; min-width: 220px; }
}
.board-col--hidden-mobile { display: none; }
@media (min-width: 768px) {
  .board-col--hidden-mobile { display: flex; }
}

.col-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 4px 10px;
  background: var(--paper);
  position: relative;
  z-index: 1;
}
.col-node {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 2px solid var(--node-color, var(--st-plan));
  background: var(--paper);
  flex-shrink: 0;
}
.col-node--live {
  background: var(--node-color, var(--st-plan));
}
.col-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 6px;
}
.col-title .ic { color: var(--node-color, var(--st-plan)); }
.col-count {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--mute);
  letter-spacing: 0.04em;
}
.col-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.col-empty {
  font-size: 12px;
  color: var(--mute);
  padding: 14px 6px;
  border: 1px dashed var(--line);
  border-radius: var(--r-md);
  text-align: center;
}

/* ---- 卡片 ---- */
.board-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 10px 12px;
  cursor: pointer;
  transition: border-color 0.12s, box-shadow 0.12s;
}
.board-card:hover {
  border-color: var(--ink-2);
  box-shadow: 0 1px 4px rgba(26, 29, 33, 0.08);
}
.card-num {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--mute);
}
.card-title {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.45;
  margin-top: 2px;
}
.card-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 9px;
  flex-wrap: wrap;
}
.card-age {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--mute);
}
.card-age--stale {
  color: var(--seal);
  font-weight: 600;
}
.card-age--stale::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--seal);
  animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.25; }
}
.card-stale { border-color: #e5b6b0; }

@keyframes card-flash {
  0% { background: var(--seal-soft); border-color: var(--seal); }
  100% { background: var(--panel); }
}
.card-changed { animation: card-flash 1.4s ease-out; }

/* ---- 徽标 ---- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  line-height: 1;
  padding: 3px 7px;
  border-radius: var(--r-sm);
  font-weight: 500;
  border: 1px solid transparent;
}
.badge--mono { font-family: var(--font-mono); letter-spacing: 0.03em; }
.badge--bug { background: #fbeae8; color: #b3372b; border-color: #f0ccc8; }
.badge--feature { background: #e9f0fc; color: #2f5fb3; border-color: #cdddf5; }
.badge--task { background: #eef1f4; color: #55606d; border-color: #dde2e8; }
.badge--p0 { background: var(--seal); color: #fff; }
.badge--p1 { background: #fdf3e3; color: #a86e0f; border-color: #f3ddb5; }
.badge--p2 { background: #fef9e7; color: #8a7a1a; border-color: #efe6b8; }
.badge--pr { background: #f0ebfb; color: #6847c2; border-color: #ddd2f5; }
.badge--label {
  background: var(--panel);
  color: var(--ink-2);
  border-color: var(--line);
  font-family: var(--font-mono);
  font-size: 10.5px;
}

/* ---- 移动端列切换（分段控件） ---- */
.col-chips {
  display: flex;
  gap: 0;
  overflow-x: auto;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--panel);
  padding: 3px;
}
@media (min-width: 768px) { .col-chips { display: none; } }
.col-chips { scrollbar-width: none; }
.col-chips::-webkit-scrollbar { display: none; }

/* ---- 我的待办 ---- */
.todo-panel {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--panel);
  margin-bottom: 14px;
  overflow: hidden;
}
.todo-head {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-2);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
}
.todo-head .ic { color: var(--seal); }
.todo-count {
  font-family: var(--font-mono);
  font-size: 11px;
  background: var(--seal);
  color: #fff;
  border-radius: 999px;
  padding: 1px 8px;
  line-height: 1.5;
}
.todo-list { display: flex; flex-direction: column; max-height: 264px; overflow-y: auto; }
.todo-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  border-left: 3px solid var(--todo-color, var(--st-plan));
}
.todo-row + .todo-row { border-top: 1px solid var(--line); }
.todo-row:hover { background: var(--paper); }
.todo-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--todo-color, var(--st-plan));
  min-width: 84px;
}
.todo-name {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}
.todo-name:hover { color: var(--st-dev); text-decoration: underline; }
.todo-acts {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
  align-items: center;
}
.todo-acts .btn { text-decoration: none; }
@media (max-width: 767px) {
  .todo-row { flex-wrap: wrap; gap: 6px; }
  .todo-name { flex-basis: 100%; order: 3; }
  .todo-acts { order: 4; }
}

.board { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  font-size: 12px;
  padding: 6px 11px;
  border: none;
  background: none;
  color: var(--ink-2);
  border-radius: var(--r-sm);
  cursor: pointer;
  font-family: var(--font-ui);
}
.chip .chip-count { font-family: var(--font-mono); font-size: 10.5px; color: var(--mute); }
.chip--active { background: var(--ink); color: #fff; font-weight: 500; }
.chip--active .chip-count { color: #b9c2cd; }

/* ---- 详情抽屉 ---- */
.drawer-mask {
  position: fixed;
  inset: 0;
  background: rgba(26, 29, 33, 0.45);
  z-index: 40;
}
.drawer {
  position: fixed;
  inset: 0;
  background: var(--panel);
  z-index: 50;
  display: flex;
  flex-direction: column;
  box-shadow: -12px 0 40px rgba(26, 29, 33, 0.18);
}
@media (min-width: 640px) {
  .drawer {
    inset: 0 0 0 auto;
    width: 580px;
    max-width: 94vw;
  }
}
.drawer-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}
.drawer-num {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--mute);
  flex-shrink: 0;
}
.drawer-title {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ink);
  flex: 1;
  line-height: 1.4;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}
.drawer-actions {
  border-top: 1px solid var(--line);
  padding: 12px 16px;
  background: var(--paper);
}
.section-label {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--mute);
  margin: 18px 0 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line);
}
.section-label:first-child { margin-top: 0; }

/* ---- 评论时间线 ---- */
.comment {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 10px 12px;
  background: var(--panel);
}
.comment + .comment { margin-top: 8px; }
.comment-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.comment-avatar {
  width: 20px;
  height: 20px;
  border-radius: 50%;
}
.comment-author {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
  font-family: var(--font-mono);
}
.comment-time {
  font-size: 11px;
  color: var(--mute);
  font-family: var(--font-mono);
}
.comment-link {
  margin-left: auto;
  color: var(--mute);
  display: inline-flex;
}
.comment-link:hover { color: var(--ink); }

/* ---- 表单 ---- */
.input, .textarea, .select {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: var(--r-md);
  padding: 8px 12px;
  font-size: 13px;
  font-family: var(--font-ui);
  color: var(--ink);
  outline: none;
}
.input:focus, .textarea:focus, .select:focus { border-color: var(--ink); }
.textarea { resize: vertical; line-height: 1.55; }
.field-gap { margin-bottom: 10px; }

/* ---- 弹窗 ---- */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(26, 29, 33, 0.45);
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal {
  background: var(--panel);
  border-radius: 8px;
  box-shadow: 0 16px 48px rgba(26, 29, 33, 0.22);
  width: 100%;
  max-width: 460px;
  padding: 20px;
}
.modal-title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.error-text { color: var(--seal); font-size: 12px; }

/* ---- 度量页 ---- */
.grid-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}
@media (min-width: 768px) {
  .grid-stats { grid-template-columns: repeat(4, 1fr); }
}
.grid-panels {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
@media (min-width: 768px) {
  .grid-panels { grid-template-columns: 1fr 1fr; }
  .grid-panels .panel--wide { grid-column: 1 / -1; }
}
.chart-box { width: 100%; height: 260px; }
.page-title {
  font-size: 15px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}
.spacer { flex: 1; }
.stat-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 14px 16px;
}
.stat-label {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--mute);
  margin-bottom: 6px;
}
.stat-value {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 16px;
}
.panel-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.panel-title .ic { color: var(--mute); }

/* ---- 运行日志页 ---- */
.run-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
}
.run-head {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  font-family: var(--font-ui);
}
.run-head:hover { background: var(--paper); }
.run-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.run-lines {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  text-align: left;
}
.run-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.run-subline {
  font-size: 11.5px;
  color: var(--mute);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.run-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
  flex-shrink: 0;
}
.run-dur { color: var(--ink-2); }
.run-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--mute);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.run-meta .ic { width: 12px; height: 12px; }
/* GitHub 风格实心状态图标：绿✓ / 红× / 黄钟（进行中） */
.st-ico { width: 16px; height: 16px; flex-shrink: 0; }
.st-ico--ok { color: var(--st-done); }
.st-ico--fail { color: var(--seal); }
.st-ico--run { color: var(--st-review); animation: pulse 1.6s ease-in-out infinite; }
.st-ico--queue {
  color: var(--mute);
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.run-body {
  border-top: 1px solid var(--line);
  padding: 12px 14px;
}
.job-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-mono);
}
.step-row {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  padding: 2px 0 2px 20px;
  color: var(--ink-2);
}
.step-row--failed { color: var(--seal); font-weight: 500; }
.step-dur { font-family: var(--font-mono); font-size: 11px; color: var(--mute); }
.logs-toggle {
  border: none;
  background: none;
  color: var(--st-dev);
  font-size: 11.5px;
  cursor: pointer;
  font-family: var(--font-ui);
  padding: 0;
}
.logs-toggle:hover { text-decoration: underline; }
.log-view {
  background: var(--ink);
  color: #d6dbe2;
  font-family: var(--font-mono);
  font-size: 11px;
  border-radius: var(--r-md);
  padding: 12px;
  margin: 6px 0 10px 20px;
  overflow: auto;
  max-height: 380px;
  line-height: 1.6;
}

/* ---- 状态点 ---- */
.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.dot--ok { background: var(--st-done); }
.dot--fail { background: var(--seal); }
.dot--run { background: var(--st-review); animation: pulse 1.6s ease-in-out infinite; }
.dot--skip { background: var(--line-strong); }

/* ---- 登录页 ---- */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background:
    linear-gradient(var(--line) 1px, transparent 1px) 0 0 / 100% 56px,
    var(--paper);
}
.login-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 32px 28px;
  width: 100%;
  max-width: 340px;
  box-shadow: 0 4px 24px rgba(26, 29, 33, 0.06);
}
.login-mark { color: var(--seal); margin-bottom: 14px; }
.login-title {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.14em;
}
.login-sub {
  font-size: 12px;
  color: var(--mute);
  margin: 4px 0 22px;
}

/* ---- 父子任务 ---- */
.badge--parent {
  background: var(--panel);
  color: var(--ink-2);
  border-color: var(--line);
  font-family: var(--font-mono);
  font-size: 10.5px;
}
.children-progress {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--line);
}
.children-label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--mute);
  white-space: nowrap;
}
.children-dots {
  display: flex;
  gap: 4px;
  align-items: center;
}
.child-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--dot-color, var(--st-plan));
}
.child-dot--closed {
  background: transparent;
  border: 1.5px solid var(--st-done);
}
.child-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  cursor: pointer;
  background: var(--panel);
}
.child-row:hover { border-color: var(--ink-2); }
.child-row + .child-row { margin-top: 6px; }
.child-row .card-num { flex-shrink: 0; }
.child-row-title {
  font-size: 12.5px;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}
.child-row-state {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--mute);
  white-space: nowrap;
}
.parent-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--st-dev);
  cursor: pointer;
  border: 1px solid #cdddf5;
  background: #e9f0fc;
  border-radius: var(--r-sm);
  padding: 4px 9px;
  font-family: var(--font-mono);
}
.parent-link:hover { border-color: var(--st-dev); }

/* ---- 实时进度面板 ---- */
.progress-panel {
  background: var(--ink);
  border-radius: var(--r-md);
  overflow: hidden;
}
.progress-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  color: #b9c2cd;
  font-size: 11px;
  font-family: var(--font-mono);
  border-bottom: 1px solid #2a2e35;
}
.progress-head .dot { flex-shrink: 0; }
.progress-view {
  color: #d6dbe2;
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.7;
  padding: 10px 12px;
  margin: 0;
  max-height: 260px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-all;
}
.progress-done .progress-head { color: #7fc79a; }

/* ---- 通用 ---- */
.hidden { display: none !important; }
.link-ext {
  color: var(--st-dev);
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  text-decoration: none;
  white-space: nowrap;
}
.link-ext:hover { text-decoration: underline; }
.text-mute { color: var(--mute); }
.empty-hint {
  text-align: center;
  color: var(--mute);
  font-size: 13px;
  padding: 40px 0;
}

/* markdown 渲染区 */
.markdown-body {
  color: var(--ink);
  line-height: 1.65;
  word-break: break-word;
  font-size: 13.5px;
}
.markdown-body h1, .markdown-body h2, .markdown-body h3 {
  font-weight: 600;
  margin: 0.9em 0 0.4em;
  line-height: 1.4;
}
.markdown-body h1 { font-size: 1.15em; }
.markdown-body h2 { font-size: 1.08em; }
.markdown-body h3 { font-size: 1em; }
.markdown-body p { margin: 0.5em 0; }
.markdown-body ul, .markdown-body ol { margin: 0.5em 0; padding-left: 1.4em; }
.markdown-body ul { list-style: disc; }
.markdown-body ol { list-style: decimal; }
.markdown-body code {
  font-family: var(--font-mono);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 0.1em 0.35em;
  font-size: 0.85em;
}
.markdown-body pre {
  background: var(--ink);
  color: #d6dbe2;
  border-radius: var(--r-md);
  padding: 12px;
  overflow-x: auto;
  margin: 0.6em 0;
}
.markdown-body pre code {
  font-family: var(--font-mono);
  background: none;
  border: none;
  padding: 0;
  font-size: 11.5px;
}
.markdown-body blockquote {
  border-left: 2px solid var(--line-strong);
  padding-left: 0.8em;
  color: var(--ink-2);
  margin: 0.6em 0;
}
.markdown-body table {
  border-collapse: collapse;
  margin: 0.6em 0;
  font-size: 0.9em;
}
.markdown-body th, .markdown-body td {
  border: 1px solid var(--line);
  padding: 5px 10px;
}
.markdown-body th {
  background: var(--paper);
  font-weight: 600;
  text-align: left;
}
.markdown-body td { font-family: var(--font-mono); font-size: 0.85em; }
.markdown-body td:first-child { font-family: var(--font-ui); font-size: 1em; }
.markdown-body a { color: var(--st-dev); }
.markdown-body img { max-width: 100%; border-radius: var(--r-md); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
