/* 技术架构。颜色只用 tokens.css 变量（UI 门禁）。 */
[hidden] { display: none !important; }
body { background: var(--canvas); color: var(--text-primary); }
.ta-app { margin: 0 auto; padding: 20px 16px 64px; max-width: 1100px; display: flex; flex-direction: column; gap: 14px; }
.ta-head h1 { margin: 0 0 6px; font-size: 22px; }
.ta-head p { margin: 0; color: var(--text-muted); font-size: 13px; line-height: 1.6; }
.ta-links { margin: -6px 0 0; display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; }
.ta-links a { color: var(--accent); text-decoration: none; }
.ta-links a:hover { text-decoration: underline; }
.ta-fresh { margin: 0; color: var(--text-muted); font-size: 12px; }

/* 顶上一排数 */
.ta-stats { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 1px; background: var(--border); border: 1px solid var(--border);
  border-radius: 10px; overflow: hidden; }
.ta-stat { background: var(--surface); padding: 10px 14px; display: flex; flex-direction: column; gap: 2px; min-width: 0; cursor: default; }
.ta-stat b { font-size: 22px; line-height: 1.25; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ta-stat span { font-size: 12px; color: var(--text-muted); white-space: nowrap; }
.ta-stat.key b { color: var(--accent); }

.ta-card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; }
.ta-card h2 { margin: 0; font-size: 16px; }
.ta-card h2 small { font-weight: 400; color: var(--text-muted); font-size: 12px; margin-left: 6px; }

/* 一张图 */
.ta-arch { display: flex; flex-direction: column; }
.ta-tier { display: grid; grid-template-columns: 84px 1fr; gap: 10px; align-items: start; margin-top: 6px; }
.ta-tier-l { font-size: 12px; color: var(--text-muted); padding-top: 8px; white-space: nowrap; }
.ta-nodes { display: flex; flex-wrap: wrap; gap: 8px; min-width: 0; }
.ta-node { border: 1px solid var(--border); background: var(--surface-sunken); border-radius: 8px; padding: 6px 10px; font-size: 13px; line-height: 1.45; min-width: 0; }
.ta-node b { font-weight: 600; }
.ta-node small { display: block; color: var(--text-muted); font-size: 12px; }
.ta-tier.core .ta-node { background: var(--accent-soft-bg); border-color: var(--accent-soft-border); }
.ta-tier.core .ta-node b { color: var(--accent-soft-fg); }
.ta-tier.ext .ta-node { background: transparent; border-style: dashed; }
.ta-tier.guard .ta-node { background: var(--success-bg); border-color: var(--success-border); }
.ta-tier.old .ta-node { background: transparent; border-style: dotted; color: var(--text-muted); }
.ta-tier.ext { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border-subtle); }
.ta-down { padding: 4px 0 0 94px; font-size: 12px; color: var(--text-muted); }
.ta-down::before { content: "↓ "; color: var(--accent); font-weight: 700; }

/* 各块完成度 */
.ta-legend { display: flex; flex-wrap: wrap; gap: 8px; }
.ta-pill { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 1px 9px; border-radius: 999px; white-space: nowrap; line-height: 1.7; cursor: default; }
.ta-pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.ta-pill.ok { color: var(--success-fg); background: var(--success-bg); }
.ta-pill.work { color: var(--info-fg); background: var(--info-bg); }
.ta-pill.part { color: var(--warning-fg); background: var(--warning-bg); }
.ta-layers { display: flex; flex-direction: column; gap: 12px; }
.ta-layer { border: 1px solid var(--border); border-radius: 10px; }
.ta-layer-h { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; justify-content: space-between; padding: 8px 14px;
  background: var(--surface-sunken); border-bottom: 1px solid var(--border); border-radius: 10px 10px 0 0; }
.ta-layer-h h3 { margin: 0; font-size: 14px; }
.ta-layer-h span { font-size: 12px; color: var(--text-muted); }
.ta-dom { display: grid; grid-template-columns: minmax(0, 1fr) 190px; gap: 4px 20px; padding: 12px 14px; border-top: 1px solid var(--border-subtle); }
.ta-layer-h + .ta-dom { border-top: 0; }
.ta-dom-h { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; min-width: 0; }
.ta-dom-h h3 { margin: 0; font-size: 15px; white-space: nowrap; }
.ta-flags { display: flex; flex-wrap: wrap; gap: 4px; }
.ta-flag { font-size: 11.5px; padding: 0 7px; border-radius: 4px; line-height: 1.8; white-space: nowrap; border: 1px solid var(--border-subtle); color: var(--text-secondary); cursor: default; }
.ta-flag.on { color: var(--success-fg); border-color: var(--success-border); }
.ta-flag.shadow { color: var(--warning-fg); border-color: var(--warning-border); }
.ta-flag.off { color: var(--text-muted); }
.ta-meter { grid-column: 2; grid-row: 1 / span 2; display: flex; flex-direction: column; gap: 4px; }
.ta-meter-top { display: flex; justify-content: space-between; align-items: baseline; }
.ta-meter-top b { font-size: 20px; line-height: 1; font-variant-numeric: tabular-nums; }
.ta-meter-top span { font-size: 12px; color: var(--text-muted); white-space: nowrap; cursor: default; }
.ta-bar { height: 8px; border-radius: 4px; background: var(--surface-sunken); border: 1px solid var(--border-subtle); overflow: hidden; }
.ta-bar i { display: block; height: 100%; border-radius: 3px; }
.ta-meter.ok b { color: var(--success-fg); } .ta-meter.ok i { background: var(--success-fg); }
.ta-meter.work b { color: var(--info-fg); } .ta-meter.work i { background: var(--info-fg); }
.ta-meter.part b { color: var(--warning-fg); } .ta-meter.part i { background: var(--warning-fg); }
.ta-what { grid-column: 1; margin: 0; font-size: 13px; color: var(--text-muted); line-height: 1.6; }
.ta-kv { grid-column: 1 / -1; display: grid; grid-template-columns: 40px 1fr; gap: 4px 10px; margin: 4px 0 0; font-size: 13px; line-height: 1.6; }
.ta-kv dt { color: var(--text-muted); font-size: 12px; padding-top: 1px; }
.ta-kv dd { margin: 0; min-width: 0; }
.ta-pages { display: inline-flex; flex-wrap: wrap; gap: 2px 10px; margin-left: 8px; font-size: 12px; }
.ta-pages a, .ta-ol a, .ta-todo a { color: var(--accent); text-decoration: none; }
.ta-pages a:hover, .ta-ol a:hover, .ta-todo a:hover { text-decoration: underline; }
.ta-todo { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; }
.ta-todo li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; }
.ta-todo li.done .tx { text-decoration: line-through; color: var(--text-muted); }
.ta-left { margin: 4px 0 0; font-size: 12px; color: var(--success-fg); }
.ref { font-size: 12px; font-family: var(--font-mono); }
.ta-st { font-size: 11.5px; padding: 0 7px; border-radius: 4px; line-height: 1.8; white-space: nowrap; cursor: default;
  color: var(--neutral-fg); background: var(--neutral-bg); }
.ta-st.live, .ta-st.done { color: var(--success-fg); background: var(--success-bg); }
.ta-st.doing { color: var(--info-fg); background: var(--info-bg); }
.ta-st.blocked, .ta-st.open { color: var(--danger-fg); background: var(--danger-bg); }
.ta-st.queued, .ta-st.idea { color: var(--warning-fg); background: var(--warning-bg); }
.ta-st.note { color: var(--text-muted); background: transparent; border: 1px dashed var(--border); }

/* 替换旧系统 */
.ta-tracks { display: flex; flex-direction: column; gap: 10px; }
.ta-track { border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px; display: flex; flex-direction: column; gap: 8px; }
.ta-track-h { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; justify-content: space-between; }
.ta-track-h h3 { margin: 0; font-size: 14px; }
.ta-track-h span { font-size: 12px; color: var(--text-muted); }
.ta-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.ta-steps li { border-radius: 8px; padding: 7px 10px; font-size: 12.5px; line-height: 1.45; background: var(--surface-sunken); border: 1px solid var(--border-subtle); min-width: 0; }
.ta-steps li b { display: block; font-size: 12px; margin-bottom: 2px; color: var(--text-muted); }
.ta-steps li.done { background: var(--success-bg); border-color: var(--success-border); }
.ta-steps li.done b { color: var(--success-fg); }
.ta-steps li.half { background: var(--warning-bg); border-color: var(--warning-border); }
.ta-steps li.half b { color: var(--warning-fg); }

/* 代码目录 */
.ta-tree-wrap { overflow-x: auto; }
.ta-tree { font-size: 13px; line-height: 1.75; min-width: 640px; }
.ta-tr { display: grid; grid-template-columns: 420px 1fr; gap: 12px; }
.ta-tr .nm { font-family: var(--font-mono); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ta-tr .nt { color: var(--text-muted); font-size: 12.5px; }
.ta-tr.dir .nm { color: var(--accent); font-weight: 600; }
.ta-tr.old .nm, .ta-tr.old .nt { color: var(--text-disabled); }
.ta-tr + .ta-tr { border-top: 1px dotted var(--border-subtle); }

/* 卡在等人 */
.ta-stuck { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; }
.ta-box { border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.ta-box h3 { margin: 0; font-size: 14px; display: flex; justify-content: space-between; gap: 8px; }
.ta-box h3 span { font-weight: 400; font-size: 12px; color: var(--text-muted); }
.ta-ol { margin: 0; padding-left: 1.7em; display: flex; flex-direction: column; gap: 6px; font-size: 13px; line-height: 1.55; }
.ta-ol li::marker { color: var(--text-muted); font-variant-numeric: tabular-nums; }
.ta-ol .ref { margin-left: 6px; }
.ta-ol .w { display: block; color: var(--text-muted); font-size: 12px; }
.ta-empty { margin: 0; color: var(--text-muted); font-size: 13px; }

/* 遗留 */
.ta-legacy { margin: 0; padding-left: 1.7em; display: flex; flex-direction: column; gap: 6px; font-size: 13px; line-height: 1.55; }
.ta-legacy li::marker { color: var(--text-muted); }
.ta-legacy li .tx { margin-right: 8px; }
.ta-legacy .ta-st { white-space: normal; }
.ta-legacy li.done .tx { color: var(--text-muted); text-decoration: line-through; }

.ta-msg { color: var(--danger-fg); background: var(--danger-bg); border-radius: 8px; padding: 10px 14px; font-size: 13px; }

@media (max-width: 1000px) { .ta-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 480px) { .ta-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 720px) {
  .ta-dom { grid-template-columns: 1fr; }
  .ta-meter { grid-column: 1; grid-row: auto; }
  .ta-tier { grid-template-columns: 1fr; gap: 4px; }
  .ta-tier-l { padding-top: 0; }
  .ta-down { padding-left: 0; }
  .ta-steps { grid-template-columns: 1fr; }
  .ta-dom-h h3 { white-space: normal; }
}
