/* ============================================================================
   主线看板（/lines）
   ----------------------------------------------------------------------------
   布局沿用材料拆解台的「左清单 + 右主体」，配色沿用 app.css 的设计令牌。
   本文件只新增 .ln-* 类，不改动既有页面的任何样式。
   ========================================================================== */

.ln-page {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ------------------------------------------------------------------ 头部 */
.ln-head-main .eyebrow {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
}

.ln-head-main h1 {
  margin: 4px 0 6px;
  font-size: 26px;
  letter-spacing: -0.02em;
}

.ln-head-main .lede {
  color: var(--muted);
  font-size: 13px;
  max-width: 720px;
  line-height: 1.6;
}

.ln-head-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

/* ------------------------------------------------------------------ 统计条 */
.ln-stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.ln-stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 12px 14px;
  box-shadow: var(--shadow);
}

.ln-stat-l {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.ln-stat-v {
  font-size: 22px;
  font-weight: 650;
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
}

.ln-stat-s {
  font-size: 11px;
  color: var(--faint);
  margin-top: 2px;
}

/* ------------------------------------------------------------------ 分线布局 */
.ln-layout {
  display: grid;
  grid-template-columns: 268px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.ln-side {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 8px;
  position: sticky;
  top: calc(var(--topbar-h) + 12px);
  box-shadow: var(--shadow);
}

.ln-side-h {
  font-size: 11px;
  color: var(--muted);
  padding: 6px 8px 8px;
  letter-spacing: 0.04em;
}

.ln-nav {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 9px 9px;
  cursor: pointer;
  color: inherit;
  font: inherit;
  transition: background 0.14s ease, border-color 0.14s ease;
}

.ln-nav:hover {
  background: var(--surface-2);
}

.ln-nav.active {
  background: var(--accent-soft);
  border-color: var(--accent-line);
}

.ln-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
  flex: none;
}

.ln-dot.lg {
  width: 12px;
  height: 12px;
}

.ln-nav-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.ln-nav-name {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ln-nav-sub {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ln-nav-pct {
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

/* ------------------------------------------------------------------ 线详情 */
.ln-main {
  min-width: 0;
}

.ln-detail {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 16px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ln-detail-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
}

.ln-detail-title {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.ln-detail-title h2 {
  margin: 0;
  font-size: 18px;
  letter-spacing: -0.01em;
}

.ln-tag {
  font-size: 10.5px;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--ink-2);
  border: 1px solid var(--line);
  white-space: nowrap;
}

.ln-tag.warn {
  background: var(--warn-soft);
  border-color: var(--warn-line);
  color: #8a5a12;
}

.ln-tag.soft {
  background: transparent;
  color: var(--muted);
}

.ln-desc {
  font-size: 12.5px;
  color: var(--ink-2);
  line-height: 1.65;
}

/* 进度 */
.ln-prog {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.ln-prog-bar {
  height: 7px;
  border-radius: 999px;
  background: var(--surface-3);
  overflow: hidden;
}

.ln-prog-bar.thin {
  height: 4px;
  margin-top: 6px;
}

.ln-prog-bar i {
  display: block;
  height: 100%;
  border-radius: 999px;
  transition: width 0.3s ease;
}

.ln-prog-meta {
  font-size: 11.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* 两段说明：筹备组 / 领导 */
.ln-two {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.ln-note {
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  background: var(--surface-2);
  padding: 9px 11px;
}

.ln-note.lead {
  border-left-color: var(--st-doing);
  background: var(--warn-soft);
}

.ln-note-h {
  font-size: 11px;
  font-weight: 650;
  color: var(--ink-2);
  letter-spacing: 0.03em;
  margin-bottom: 3px;
}

.ln-note-b {
  font-size: 12px;
  color: var(--ink-2);
  line-height: 1.6;
}

/* ------------------------------------------------------------------ 树表 */
.ln-filter {
  display: flex;
  gap: 8px;
}

.ln-filter-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.ln-filter-row .ln-search {
  flex: 1;
  min-width: 220px;
  max-width: 380px;
}

.ln-search {
  max-width: 380px;
}

.ln-tree-box {
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: auto;
  max-height: calc(100vh - 430px);
  min-height: 220px;
}

.ln-tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

.ln-tbl thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  padding: 8px 9px;
  white-space: nowrap;
}

.ln-tbl td {
  padding: 7px 9px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: middle;
}

.ln-tbl tbody tr:hover {
  background: var(--hover-tint);
}

.ln-tbl .c-id {
  width: 84px;
  white-space: nowrap;
}

.ln-tbl .c-status {
  width: 88px;
}

.ln-tbl .c-owner {
  width: 110px;
}

.ln-tbl .c-date {
  width: 150px;
  white-space: nowrap;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.ln-tbl .c-dep {
  width: 56px;
  text-align: center;
  color: var(--muted);
}

.ln-tbl .c-lead {
  width: 56px;
  text-align: center;
}

.ln-row.deliverable td {
  background: var(--surface-2);
  font-weight: 600;
}

.ln-row.need-leader td {
  box-shadow: inset 3px 0 0 var(--st-doing);
}

.ln-title-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.ln-caret {
  width: 18px;
  height: 18px;
  flex: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 11px;
  line-height: 1;
  border-radius: 4px;
  padding: 0;
}

.ln-caret:hover {
  background: var(--surface-3);
  color: var(--ink);
}

.ln-caret.ghost {
  cursor: default;
}

.ln-title {
  border: 0;
  background: transparent;
  padding: 0;
  text-align: left;
  color: inherit;
  font: inherit;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 520px;
}

.ln-title:hover {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.ln-title.deliverable {
  font-weight: 650;
}

.ln-kids {
  font-size: 10px;
  color: var(--muted);
  background: var(--surface-3);
  border-radius: 999px;
  padding: 1px 6px;
  white-space: nowrap;
  flex: none;
}

.ln-deliv {
  font-size: 10.5px;
  color: var(--faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
}

.ln-lead-dot {
  color: var(--st-doing);
  font-size: 12px;
}

/* ------------------------------------------------------------------ 主线总览 */
.ln-board {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
  align-items: flex-start;
}

.ln-col {
  flex: 0 0 244px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 10px;
  box-shadow: var(--shadow);
}

.ln-col.muted-col {
  opacity: 0.85;
}

.ln-col-h {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 650;
}

.ln-col-name {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ln-col-pct {
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.ln-col-sub {
  font-size: 10.5px;
  color: var(--faint);
  margin-top: 3px;
}

.ln-col-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
  max-height: calc(100vh - 380px);
  overflow-y: auto;
}

.ln-col-empty {
  font-size: 11.5px;
  color: var(--faint);
  padding: 14px 4px;
  text-align: center;
}

.ln-card {
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 8px 9px;
  cursor: pointer;
  font: inherit;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: border-color 0.14s ease, box-shadow 0.14s ease;
}

.ln-card:hover {
  border-color: var(--accent-line);
  box-shadow: var(--shadow-md);
}

.ln-card.need-leader {
  border-left: 3px solid var(--st-doing);
}

.ln-card.done {
  opacity: 0.62;
}

.ln-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}

.ln-card-title {
  font-size: 12.5px;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ln-card-meta {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
  font-size: 10.5px;
  color: var(--muted);
}

.ln-card-owner {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 92px;
}

.ln-card-date {
  font-size: 10px;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}

/* 行内「＋」：在该任务下新建子任务（任意层级） */
.ln-add {
  width: 18px;
  height: 18px;
  flex: none;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  border-radius: 5px;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  opacity: 0;
  transition: opacity 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

.ln-row:hover .ln-add,
.ln-add:focus-visible {
  opacity: 1;
}

.ln-add:hover {
  border-color: var(--accent-line);
  color: var(--accent);
  background: var(--accent-soft);
}

.ln-parent-hint {
  font-size: 12.5px;
  color: var(--ink-2);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 7px 9px;
}

/* 段标行：材料分解 / 阶段行动 —— 同一张表里分组，各自 sticky 表头不打架 */
.ln-section-row td {
  background: var(--surface-2);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 7px 9px;
}

.ln-section-name {
  font-size: 11.5px;
  font-weight: 650;
  color: var(--ink-2);
  letter-spacing: 0.02em;
}

.ln-section-hint {
  font-size: 10.5px;
  color: var(--faint);
  margin-left: 8px;
}

/* ------------------------------------------------------------------ 响应式 */
@media (max-width: 1100px) {
  .ln-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .ln-layout {
    grid-template-columns: 1fr;
  }
  .ln-side {
    position: static;
    display: flex;
    gap: 6px;
    overflow-x: auto;
    align-items: center;
  }
  .ln-side-h {
    display: none;
  }
  .ln-nav {
    min-width: 190px;
    flex: none;
  }
  .ln-two {
    grid-template-columns: 1fr;
  }
  .ln-tree-box {
    max-height: none;
  }
}

@media (max-width: 640px) {
  .ln-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .ln-tbl .c-date,
  .ln-tbl .c-dep {
    display: none;
  }
  .ln-title {
    max-width: 240px;
  }
}
