/* 「上线」页（views/launch.js，docs/LAUNCH.md）：登录条 + 右上巡检、待办三块、游戏 × 渠道矩阵、扫码 / 格子详情弹层。
   手机 390px 优先（用户主要在手机上看）：登录灯两列、待办一列、矩阵每款游戏一张卡；宽屏登录条一行、待办三列、矩阵是表格。触控目标 ≥ 40px。 */

.ln { display: grid; gap: 12px; container-type: inline-size; }

/* 状态色：ok 绿 / wait 蓝（等平台）/ run 紫（进行中）/ warn 黄（卡住）/ bad 红（驳回）/ idle 灰（未开始）/ skip 淡 / stale 灰（未核实） */
.ln .ok { --c: var(--ok); --cs: var(--ok-soft); }
.ln .wait { --c: var(--accent); --cs: var(--accent-soft); }
.ln .run { --c: var(--remote); --cs: var(--remote-soft); }
.ln .warn { --c: var(--warn); --cs: var(--warn-soft); }
.ln .bad { --c: var(--bad); --cs: var(--bad-soft); }
.ln .idle { --c: var(--muted); --cs: var(--panel-2); }
.ln .skip { --c: var(--idle); --cs: transparent; }
.ln .stale { --c: var(--idle); --cs: var(--panel-2); }

/* ── 检查条：「开始检查」→ 各站登录状态 →「下一步：开始查询」/「取消」（没有定时，用户手动点） ── */
.ln-check { display: grid; gap: 10px; padding: 12px 14px; margin-bottom: 0; border-left: 3px solid var(--line); }
.ln-check.active { border-left-color: var(--accent); }
.ln-check-h { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; }
.ln-check-t { display: grid; gap: 2px; flex: 1 1 240px; min-width: 0; line-height: 1.4; }
.ln-check-t b { font-size: 15px; }
.ln-check-act { display: flex; flex-wrap: wrap; gap: 8px; margin-left: auto; }
.ln-check-act .btn { min-height: 40px; }
.ln-check-go { padding-left: 18px; padding-right: 18px; font-size: 15px; }
.ln-check-body { display: grid; gap: 10px; }
.ln-br { display: inline-flex; align-items: center; gap: 8px; justify-self: start; padding: 2px 10px; border-radius: 999px; background: var(--cs); color: var(--c); font-weight: 600; }
.ln-br .ln-dot { background: var(--c); box-shadow: none; }

.ln-cs-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
@container (min-width: 760px) { .ln-cs-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.ln-cs {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; min-width: 0; padding: 9px 11px;
  border-radius: 10px; border: 1px solid color-mix(in srgb, var(--c) 30%, var(--line)); background: var(--panel);
}
.ln-cs.need { background: var(--cs); }
.ln-cs .ln-dot { background: var(--c); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 22%, transparent); }
.ln-cs.wait .ln-dot { animation: ln-pulse 1.4s ease-in-out infinite; }
.ln-cs-name { font-size: 14px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ln-cs .ln-st { margin-left: auto; }
.ln-cs-go { flex: none; padding: 0 8px; border-radius: 999px; font-size: 12px; line-height: 20px; font-weight: 700; color: #fff; background: var(--c); }
.ln-cs-note, .ln-cs-why { flex-basis: 100%; line-height: 1.4; }
.ln-cs-note { color: var(--fg); }
.ln-cs-qr { flex-basis: 100%; justify-content: center; min-height: 36px; }
@container (min-width: 760px) { .ln-cs-qr { flex-basis: auto; } }

.ln-confirm { display: grid; gap: 8px; padding: 10px 12px; border-radius: 10px; background: var(--warn-soft); border: 1px solid color-mix(in srgb, var(--warn) 40%, var(--line)); line-height: 1.45; }
.ln-confirm .btn { min-height: 40px; }
.ln-check-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px 12px; }
.ln-next.ready { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent); }
.ln-check-last { line-height: 1.4; }
/* 手机：底部两个按钮铺满 */
@container (max-width: 520px) {
  .ln-check-act { margin-left: 0; width: 100%; }
  .ln-check-act .btn { flex: 1 1 0; justify-content: center; }
}

/* ── 顶部：登录条 + 巡检 ── */
.ln-head { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 10px 12px; }
.ln-logins { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; flex: 1 1 520px; min-width: 0; }
@container (min-width: 760px) { .ln-logins { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.ln-lamp {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; min-width: 0; padding: 8px 10px;
  border-radius: 10px; background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow-card);
}
.ln-dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--wait); box-shadow: 0 0 0 3px color-mix(in srgb, var(--wait) 22%, transparent); }
.ln-lamp.on .ln-dot { background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 22%, transparent); }
.ln-lamp.off .ln-dot { background: var(--idle); box-shadow: none; }
.ln-lamp.off { background: var(--panel2); }
.ln-lamp-t { display: grid; min-width: 0; flex: 1; line-height: 1.3; }
.ln-lamp-t b { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ln-lamp-t .small { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ln-lamp.on .ln-lamp-t .small { color: var(--ok); }
.ln-lamp-note { flex-basis: 100%; color: var(--warn); line-height: 1.35; }
.ln-qrbtn { flex-basis: 100%; justify-content: center; min-height: 36px; }

.ln-patrol { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-left: auto; min-height: 40px; }
.ln-patrol .btn { min-height: 36px; }
.ln-running { display: inline-flex; align-items: center; gap: 6px; color: var(--run); }

/* ── 待办三块：手机一列，够宽三列 ── */
.ln-todos { display: grid; gap: 12px; align-items: start; }
@container (min-width: 900px) { .ln-todos { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.ln-todos .card { margin-bottom: 0; }
.ln-block { gap: 6px; padding: 12px 14px; border-top: 3px solid var(--bc, var(--line)); }
.ln-block.user { --bc: var(--bad); }
.ln-block.me { --bc: var(--warn); }
.ln-block.platform { --bc: var(--accent); }
.ln-block-h { display: flex; align-items: center; gap: 6px; font-size: 14.5px; }
.ln-n { margin-left: auto; min-width: 22px; text-align: center; padding: 0 7px; border-radius: 999px; background: var(--panel-2); color: var(--muted); font-size: 12px; line-height: 20px; }
.ln-list { list-style: none; margin: 0; padding: 0; display: grid; }
.ln-todo { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; padding: 8px 0; border-top: 1px solid var(--line); min-width: 0; }
.ln-todo:first-child { border-top: 0; }
.ln-todo.overdue .ln-todo-title { color: var(--bad); }
.ln-todo-main { display: grid; gap: 2px; flex: 1 1 200px; min-width: 0; text-align: left; padding: 2px 0; min-height: 40px; color: inherit; background: none; border: 0; cursor: pointer; }
.ln-todo-game { font-size: 12px; color: var(--muted); }
.ln-todo-title { font-size: 14px; font-weight: 550; line-height: 1.35; }
.ln-todo-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; }
.ln-todo-next { line-height: 1.35; }
.ln-empty { padding: 6px 0 2px; }
.ln-late { color: var(--bad); }

/* 状态小牌子 */
.ln-st { display: inline-block; flex: none; padding: 0 8px; border-radius: 999px; font-size: 12px; line-height: 20px; color: var(--c); background: var(--cs); font-weight: 600; white-space: nowrap; }

/* ── 矩阵：宽屏一行一款游戏的表格；窄了每款一张卡，格子两列 ── */
.ln-matrix { padding: 12px; gap: 10px; }
.ln-mx { display: grid; gap: 8px; min-width: 0; }
.ln-mx-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; min-width: 0; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.ln-mx-row:last-child { border-bottom: 0; padding-bottom: 0; }
.ln-mx-head { display: none; }
.ln-mx-game { grid-column: 1 / -1; font-size: 15px; padding: 2px 2px 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ln-mx-h { font-size: 12px; color: var(--muted); text-align: center; line-height: 1.25; padding: 0 2px; }
@container (min-width: 820px) {
  .ln-mx-row { grid-template-columns: 112px repeat(8, minmax(0, 1fr)); align-items: stretch; padding-bottom: 0; border-bottom: 0; }
  .ln-mx-head { display: grid; align-items: end; }
  .ln-mx-game { grid-column: auto; align-self: center; font-size: 14px; white-space: normal; }
  .ln-cell .ln-cell-col { display: none; }
}

.ln-cell {
  position: relative; display: grid; align-content: start; gap: 1px; min-width: 0; min-height: 56px; padding: 7px 8px 6px; text-align: left;
  border-radius: 9px; border: 1px solid color-mix(in srgb, var(--c) 30%, var(--line)); background: var(--cs); color: var(--fg); cursor: pointer;
}
.ln-cell:hover:not(:disabled) { border-color: var(--c); }
.ln-cell:disabled { cursor: default; }
.ln-cell::before { content: ''; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px; border-radius: 0 2px 2px 0; background: var(--c); }
.ln-cell-col { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ln-cell-st { font-size: 13.5px; font-weight: 650; color: var(--c); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ln-cell-at { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.ln-cell-why { font-size: 11px; color: var(--muted); line-height: 1.3; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.ln-cell.stale { border-style: dashed; }
.ln-cell.stale .ln-cell-st { color: var(--muted); }
.ln-cell.stale .ln-cell-at { color: var(--warn); font-weight: 600; }
.ln-cell.skip { border-style: dashed; }
.ln-cell.skip .ln-cell-st { font-weight: 500; }
.ln-cell.none { --c: var(--line); --cs: transparent; border-style: dashed; }
.ln-cell.none .ln-cell-st { color: var(--muted); font-weight: 400; }
.ln-cell.none::before { display: none; }

.ln-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; }
.ln-legend span { display: inline-flex; align-items: center; gap: 5px; }
.ln-sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: var(--c); }
.ln-sw.stale { background: transparent; border: 1px dashed var(--idle); }
.ln-none { gap: 4px; }

/* ── 扫码弹层：码要大、白底留边，方便截图后用微信相册识别 ── */
.ln-qr { display: grid; justify-items: center; gap: 10px; padding: 4px 0 12px; }
.ln-qr-img {
  display: grid; place-items: center; width: min(78vw, 340px); aspect-ratio: 1; padding: 14px; box-sizing: border-box;
  background: #fff; border-radius: 12px; border: 1px solid var(--line);
}
.ln-qr-img img { width: 100%; height: 100%; object-fit: contain; image-rendering: pixelated; }
.ln-qr-img.done img { opacity: .25; }
.ln-qr-foot { max-width: 340px; text-align: center; line-height: 1.45; }
.ln-qr-state { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; padding: 4px 12px; border-radius: 999px; background: var(--panel-2); }
.ln-qr-state.waiting { color: var(--accent); background: var(--accent-soft); }
.ln-qr-state.scanned { color: var(--warn); background: var(--warn-soft); }
.ln-qr-state.online { color: var(--ok); background: var(--ok-soft); }
.ln-qr-gone { display: grid; justify-items: center; gap: 12px; padding: 28px 8px; text-align: center; }
.ln-qr-msg { font-size: 15px; color: var(--muted); }
.ln-qr-again { min-height: 44px; padding: 10px 22px; }

/* ── 格子详情：每项一段，时间线最新的在上 ── */
.ln-detail { display: grid; gap: 14px; max-height: 64vh; overflow: auto; padding-bottom: 8px; }
.ln-item { display: grid; gap: 6px; min-width: 0; }
.ln-item + .ln-item { border-top: 1px solid var(--line); padding-top: 12px; }
.ln-item-h { display: flex; align-items: center; gap: 8px; min-width: 0; }
.ln-item-title { font-size: 14.5px; line-height: 1.35; }
.ln-kv { display: flex; flex-wrap: wrap; gap: 2px 12px; }
.ln-reject { display: grid; gap: 4px; padding: 8px 10px; border-radius: 8px; background: var(--bad-soft); color: var(--bad); }
.ln-reject pre { margin: 0; white-space: pre-wrap; word-break: break-word; font: inherit; font-size: 13px; color: var(--fg); }
.ln-plans { display: flex; flex-wrap: wrap; gap: 4px 10px; }
.ln-tl { display: grid; gap: 4px; }
.ln-tl ol { margin: 0; padding-left: 18px; display: grid; gap: 3px; font-size: 13px; }
.ln-tl-at { font-size: 12.5px; }

/* 转圈、骨架 */
.ln-spin { display: inline-block; width: 28px; height: 28px; border: 3px solid color-mix(in srgb, var(--run) 25%, transparent); border-top-color: var(--run); border-radius: 50%; animation: ln-spin .8s linear infinite; }
.ln-spin.xs { width: 10px; height: 10px; border-width: 1.5px; }
@keyframes ln-spin { to { transform: rotate(360deg); } }
.ln-skel { display: grid; gap: 10px; }
.ln-skel i { display: block; height: 96px; border-radius: var(--radius); background: var(--panel-2); animation: ln-pulse 1.2s ease-in-out infinite; }
.ln-skel i.short { height: 56px; width: 60%; }
@keyframes ln-pulse { 50% { opacity: .5; } }
