/* 软件地图 × 任务图：同一张无界画布（10-16 晚） */
.tg-board:not(.tg-maplayout) .tg-only-map { display: none !important; }
.tg-maplayout .tg-only-modules { display: none !important; }
.tg-layout { display: inline-flex; align-items: center; gap: 2px; background: #efeaff; border-radius: 9px; padding: 3px; }
.tg-layout > span { font-size: 11.5px; color: #4f3d8c; padding: 0 6px 0 4px; font-weight: 600; }
.tg-layout .tg-btn { border: 0; background: transparent; }
.tg-layout .tg-btn.active { background: var(--surface); color: #4f3d8c; font-weight: 700; box-shadow: 0 1px 3px #0000000f; }
.tg-toolbar .tg-only-map, .tg-toolbar .tg-only-modules { display: inline-flex; gap: 6px; }
.tg-toolbar .tg-only-map .tg-btn.active { background: var(--accent-soft); color: var(--accent); }
.tg-mapbar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin: -2px 0 10px; }
.tg-mapbar[hidden] { display: none; }
.tg-mapbar .smm-legend { margin: 0; }
.smm-legend .lg-red { width: 22px; border-top: 2px solid #D8352B; }
.tg-camera .tg-only-map .tg-btn[aria-pressed="true"] { color: var(--accent); font-weight: 700; }

/* 五条带：每个端一条，地图纸底色 */
.smc-band { position: absolute; z-index: 0; box-sizing: border-box; background: #fbfaf7; border: 1px solid #e6e1d6; border-radius: 16px; box-shadow: 0 2px 10px #2a20100a; }
.smc-band.ghost { opacity: .35; }
.smc-head { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 16px; padding: 12px 18px 0; color: #5d574c; font-size: 13px; }
.smc-name { border: 0; background: transparent; font: inherit; font-size: 20px; font-weight: 800; color: #1d1d1f; cursor: pointer; padding: 0; }
.smc-name:hover { color: var(--accent); }
.smc-head b { color: #1d1d1f; }
.smc-head .sm-meter { width: 140px; }
.smc-head em { font-style: normal; color: #8a857c; font-size: 12px; }
.smc-svg { position: absolute; left: 0; top: 0; z-index: 1; overflow: visible; pointer-events: none; }
.smc-svg .smm-g { pointer-events: auto; }
.smc-svg .smm-col.ghost { opacity: .3; }
.smc-sub, .smc-depot { position: absolute; z-index: 2; box-sizing: border-box; font: inherit; text-align: left; cursor: pointer; }
.smc-sub { height: 18px; padding: 0 6px; border: 0; border-radius: 5px; background: #ece8df; color: #5d574c; font-size: 11px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.smc-depot { height: 40px; display: grid; align-content: center; padding: 2px 10px; border: 2px solid var(--c); border-left-width: 8px; border-radius: 9px; background: #fff; color: #1d1d1f; }
.smc-depot b { font-size: 13px; }
.smc-depot small { font-size: 11px; color: #6b665c; }
.smc-sub.ghost, .smc-depot.ghost { opacity: .18; }

/* 挂在车站下的任务卡 */
.tg-world .tg-task.tg-mini { padding: 5px 8px 5px 7px; gap: 2px; border-left-width: 4px; border-radius: 7px; font-size: 11px; justify-content: space-between; overflow: hidden; }
.tg-mini-top { min-height: 14px; display: flex; align-items: center; gap: 4px; color: var(--text-2); font-size: 10.5px; white-space: nowrap; overflow: hidden; }
.tg-mini-top b { font-weight: 600; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; }
.tg-mini-top em { margin-left: auto; font-style: normal; font-weight: 700; font-size: 10px; border-radius: 999px; padding: 0 6px; background: #666; color: #fff; }
.tg-mini-top em.wait { background: #b26a12; }
.tg-mini-top em.late { background: #d64545; }
.tg-mini-st { font-style: normal; font-weight: 800; }
.tg-mini-st.s-done { color: var(--success); }
.tg-mini-st.s-in_progress, .tg-mini-st.s-review { color: var(--accent); }
.tg-world .tg-task.tg-mini > strong { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; flex: none; font-size: 12px; line-height: 1.3; font-weight: 650; }
.tg-mini-top, .tg-mini-foot { flex: none; }
.tg-mini-foot { min-height: 15px; display: flex; align-items: center; gap: 4px; font-size: 10.5px; color: var(--text-2); white-space: nowrap; overflow: hidden; }
.tg-mini-foot i { flex: none; width: 15px; height: 15px; border-radius: 50%; color: #fff; font-style: normal; font-size: 9px; display: grid; place-items: center; }
.tg-mini-foot span { overflow: hidden; text-overflow: ellipsis; }
.tg-mini-foot time { margin-left: auto; }
.tg-board .tg-task.tg-mini::before { width: 9px; height: 9px; top: -4px; margin-left: -4px; }
.tg-task.tg-mini.ghost { opacity: .14; }
.tg-task.tg-mini.tg-skip { opacity: .5; filter: grayscale(1); border-style: dashed; }
.tg-task.tg-mini.tg-skip > strong { text-decoration: line-through; }

/* 目录：浮在画布左上 */
.tg-outline { position: absolute; z-index: 4; left: 12px; top: 40px; width: 252px; max-height: calc(100% - 112px); overflow: auto; overscroll-behavior: contain; background: var(--surface); border: 1px solid var(--sep); border-radius: 12px; box-shadow: var(--shadow-card); padding: 6px; cursor: default; }
.tg-outline .smm-nav { width: auto; max-height: none; border: 0; padding: 0; background: transparent; }
.smm-end { margin-top: 8px; padding-top: 6px; border-top: 1px solid var(--sep); }
.smm-nav .smm-e { grid-template-columns: 1fr auto; font-size: 14px; }
.smm-e .smm-bar { grid-column: 1 / -1; }

/* 意图看板（任务图的第三种看法） */
.tg-mapboard { padding: 14px 16px; height: clamp(540px, 68vh, 860px); overflow: auto; background: var(--tg-canvas); box-sizing: border-box; }
.tg-immersive .tg-mapboard { height: 100%; }
.tg-mapboard .smm-bar { margin-bottom: 10px; }
.smm-bsw header .linklike { margin-left: auto; font-size: 12px; white-space: nowrap; }
.smm-bsw.hot { border-color: #6B4FBB; box-shadow: 0 0 0 3px rgba(107, 79, 187, .14); }
.sm-flow-end { margin: 12px 0 4px; font-size: 14px; }
.sm-flow-end span { color: var(--text-2); font-weight: 400; font-size: 12px; }

/* 侧栏里的车站 / 道岔详情 */
.sm-embed { display: grid; gap: 8px; align-content: start; font-size: 13px; }
.tg-panel-body.sm-embed h3 { font-size: 18px; margin: 2px 0 0; display: flex; align-items: center; gap: 8px; }
.sm-embed h4 { margin: 8px 0 0; font-size: 13px; }

@media (max-width: 820px) {
  .tg-maplayout .tg-canvas-caption { display: none; }
  .tg-outline { width: min(250px, 72%); }
  .tg-layout { order: -1; }
  .tg-mapbar { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .tg-mapbar .smm-legend { display: none; }
  .tg-mapbar .smm-modes, .tg-mapbar .smm-chip { flex: none; }
  .tg-toolbar [data-map-focus] { flex: 1 1 100%; max-width: none; min-height: 38px; }
  .tg-mapboard { height: auto; max-height: none; padding: 10px; }
}
