/* TermToGo · 各界面样式（取自设计稿各页面） */

/* ---------- 启动页 / 欢迎（5.6） ---------- */
.splash { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding-bottom: 60px; }
.splash .lg { width: 88px; height: 88px; }
.splash .lg svg { width: 100%; height: 100%; }
.splash .wm { font-family: var(--font-mono); font-weight: 700; font-size: 22px; letter-spacing: -.01em; }
.splash .tag { color: var(--muted); font-size: 15px; letter-spacing: .04em; }
.splash .by { position: absolute; bottom: calc(var(--sab) + 20px); left: 0; right: 0; text-align: center; font-size: 12px; color: var(--muted); }
.welcome { flex: 1; display: flex; flex-direction: column; padding: 0 24px calc(var(--sab) + 16px); overflow: auto; }
.welcome .hero { flex: 1; display: flex; flex-direction: column; justify-content: center; padding-top: 12px; }
.welcome .hero > .lgs { width: 52px; height: 52px; }
.welcome h1 { font-family: var(--font-display); font-size: 30px; line-height: 1.25; margin: 22px 0 12px; font-weight: 800; letter-spacing: -.01em; }
.welcome .lead { color: var(--muted); font-size: 16px; line-height: 1.6; margin: 0; }
.demo { margin-top: 28px; border-radius: 16px; background: var(--term-bg); color: var(--term-fg); font-family: var(--font-mono); font-size: 12px; line-height: 1.7; padding: 14px 16px; box-shadow: 0 0 0 1px var(--border); }
.demo .g { color: var(--term-green); } .demo .d { color: var(--term-dim); } .demo .o { color: var(--term-orange); }
.demo .cur { display: inline-block; width: 7px; height: 14px; background: var(--term-fg); vertical-align: -2px; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.steps { list-style: none; padding: 0; margin: 22px 0 0; display: grid; gap: 12px; }
.steps li { display: flex; gap: 12px; align-items: flex-start; font-size: 15px; line-height: 1.45; }
.steps .n { width: 24px; height: 24px; border-radius: 50%; background: var(--fg-soft); display: grid; place-items: center; font-size: 13px; font-weight: 700; flex: none; font-family: var(--font-mono); }
.welcome .acts { display: grid; gap: 8px; padding-top: 16px; }

/* ---------- 扫码配对（5.7） ---------- */
.cam { position: fixed; inset: 0; background: linear-gradient(oklch(24% 0.01 250), oklch(16% 0.01 250)); color: oklch(98% 0 0); overflow: hidden; }
.cam video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cam-top { position: absolute; top: var(--sat); left: var(--sal); right: var(--sar); height: 56px; display: flex; align-items: center; justify-content: space-between; padding: 0 8px; z-index: 3; }
.cam-top .hi { font-size: 15px; font-weight: 600; text-shadow: 0 1px 6px oklch(0% 0 0 / .5); }
.cam .ibtn { color: oklch(98% 0 0); background: oklch(0% 0 0 / .35); border-radius: 50%; }
.cam .ibtn[aria-pressed="true"] { background: oklch(98% 0 0); color: oklch(20% 0 0); }
.cam-title { position: absolute; top: calc(45% - 130px - 52px); left: 24px; right: 24px; text-align: center; font-size: 18px; font-weight: 700; font-family: var(--font-display); z-index: 3; text-shadow: 0 1px 6px oklch(0% 0 0 / .5); }
.mask { position: absolute; left: 50%; top: 45%; width: 260px; height: 260px; transform: translate(-50%, -50%); border-radius: 22px; box-shadow: 0 0 0 2000px oklch(0% 0 0 / .55); z-index: 2; pointer-events: none; }
.mask .c { position: absolute; width: 34px; height: 34px; border: 4px solid oklch(98% 0 0); }
.mask .c:nth-child(1) { top: -2px; left: -2px; border-right: 0; border-bottom: 0; border-radius: 22px 0 0 0; }
.mask .c:nth-child(2) { top: -2px; right: -2px; border-left: 0; border-bottom: 0; border-radius: 0 22px 0 0; }
.mask .c:nth-child(3) { bottom: -2px; left: -2px; border-right: 0; border-top: 0; border-radius: 0 0 0 22px; }
.mask .c:nth-child(4) { bottom: -2px; right: -2px; border-left: 0; border-top: 0; border-radius: 0 0 22px 0; }
.mask .line { position: absolute; left: 16px; right: 16px; height: 2px; border-radius: 2px; background: var(--term-green); box-shadow: 0 0 12px var(--term-green); animation: scan 2.2s ease-in-out infinite; }
@keyframes scan { 0% { top: 14px; } 50% { top: 242px; } 100% { top: 14px; } }
.mask.hit .c { border-color: var(--term-green); }
.mask.hit .line, .mask.idle .line { display: none; }
.cam-msg { position: absolute; top: calc(45% + 146px); left: 24px; right: 24px; text-align: center; z-index: 3; }
.cam-msg span { display: inline-block; padding: 8px 14px; border-radius: 10px; background: var(--danger); color: var(--on-fill); font-size: 14px; font-weight: 600; }
.cam-msg span.info { background: oklch(0% 0 0 / .55); font-weight: 500; }
.cam-bot { position: absolute; left: 0; right: 0; bottom: calc(var(--sab) + 16px); z-index: 3; text-align: center; padding: 0 24px; }
.cam-bot p { font-size: 14px; line-height: 1.55; margin: 0 0 14px; color: oklch(92% 0 0); text-shadow: 0 1px 4px oklch(0% 0 0 / .5); }
.cam-bot .btn { background: oklch(100% 0 0 / .16); color: oklch(98% 0 0); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.cam-bot .dl { font-size: 12.5px; color: oklch(80% 0 0); margin: 12px 0 0; }
@media (max-height: 640px) { .cam-title { top: calc(var(--sat) + 56px); } .mask { width: 220px; height: 220px; } .cam-msg { top: calc(45% + 126px); } .cam-bot .dl { display: none; } }
.pcard { position: fixed; left: calc(12px + var(--sal)); right: calc(12px + var(--sar)); bottom: calc(var(--sab) + 12px); z-index: 4; background: var(--surface); color: var(--fg); border-radius: 22px; padding: 22px 20px 16px; box-shadow: 0 -6px 30px oklch(0% 0 0 / .3); animation: up .3s cubic-bezier(.2,.9,.3,1); text-align: center; }
@media (min-width: 600px) { .pcard { left: 50%; right: auto; width: 420px; margin-left: -210px; } }
.pcard .ci { width: 52px; height: 52px; margin: 0 auto 12px; border-radius: 50%; display: grid; place-items: center; background: var(--fg-soft); }
.pcard .ci svg { width: 26px; height: 26px; }
.pcard .ci.ok { background: color-mix(in oklch, var(--ok) 18%, transparent); color: var(--ok); }
.pcard .ci.bad { background: color-mix(in oklch, var(--danger) 14%, transparent); color: var(--danger); }
.pcard h2 { font-family: var(--font-display); font-size: 19px; margin: 0 0 6px; font-weight: 700; word-break: break-all; }
.pcard p { margin: 0 0 16px; color: var(--muted); font-size: 14.5px; line-height: 1.55; }
.pcard .code { font-family: var(--font-mono); font-size: 30px; font-weight: 700; letter-spacing: .35em; padding-left: .35em; margin: 4px 0 6px; color: var(--fg); }
.pcard .acts { display: grid; gap: 8px; }
.pcard .spin { width: 28px; height: 28px; border-width: 3px; border-color: var(--fg-soft-2); border-top-color: var(--fg); }
.page { flex: 1; display: flex; flex-direction: column; background: var(--bg); min-height: 0; }
.code-body { padding: 18px 24px 0; flex: 1; overflow: auto; }
.code-body h1 { font-family: var(--font-display); font-size: 26px; font-weight: 800; margin: 6px 0 8px; }
.code-body .lead { color: var(--muted); font-size: 15px; line-height: 1.55; margin: 0 0 28px; }
.cells { display: flex; gap: 8px; justify-content: center; position: relative; }
.cells .cell6 { width: 48px; height: 60px; border-radius: 12px; background: var(--surface); box-shadow: 0 0 0 1.5px var(--border); display: grid; place-items: center; font-family: var(--font-mono); font-size: 28px; font-weight: 700; }
.cells .cell6.gap { margin-left: 10px; }
.cells .cell6.cur { box-shadow: 0 0 0 2px var(--accent-fill), 0 0 0 5px var(--accent-soft); }
.cells.err .cell6 { box-shadow: 0 0 0 1.5px var(--danger); }
.cells input { position: absolute; inset: 0; opacity: 0; font-size: 16px; width: 100%; caret-color: transparent; }
@media (max-width: 370px) { .cells { gap: 6px; } .cells .cell6 { width: 42px; height: 54px; font-size: 24px; } }
.code-err { color: var(--danger); font-size: 14px; text-align: center; margin-top: 14px; min-height: 20px; font-weight: 500; }
.code-hint { color: var(--muted); font-size: 13.5px; text-align: center; line-height: 1.55; margin-top: 10px; }
.code-foot { padding: 12px 24px calc(var(--sab) + 16px); display: grid; gap: 8px; }
.perm { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 0 32px calc(var(--sab) + 16px); }
.perm .pi { width: 72px; height: 72px; border-radius: 50%; background: var(--fg-soft); display: grid; place-items: center; margin-bottom: 18px; }
.perm .pi svg { width: 34px; height: 34px; }
.perm h2 { font-family: var(--font-display); font-size: 21px; margin: 0 0 8px; }
.perm p { color: var(--muted); font-size: 15px; line-height: 1.6; margin: 0 0 24px; }

/* ---------- 首页（5.8） ---------- */
.mac-btn { display: inline-flex; align-items: center; gap: 4px; height: 44px; padding: 0 8px; border-radius: 10px; font-family: var(--font-display); font-weight: 700; font-size: 18px; min-width: 0; }
.mac-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mac-btn svg { width: 18px; height: 18px; color: var(--muted); }
.mac-btn:active { background: var(--fg-soft); }
.strip { display: flex; align-items: center; gap: 8px; margin: 0 16px; padding: 0 12px; min-height: 34px; border-radius: 10px; font-size: 13.5px; color: var(--muted); background: var(--fg-soft); flex: none; }
.strip b { color: var(--fg); font-weight: 600; }
.strip.warn { background: var(--warn-bg); color: var(--warn-ink); }
.strip.warn b { color: var(--warn-ink); }
.strip.wait { background: color-mix(in oklch, var(--wait) 14%, transparent); }
.strip .warn-mark { width: 15px; height: 15px; }
.strip .rt { margin-left: auto; font-weight: 600; color: var(--fg); height: 34px; padding: 0 4px; }
.reason { margin: 8px 16px 0; font-size: 13.5px; line-height: 1.55; color: var(--muted); flex: none; }
.list { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 12px 16px calc(var(--sab) + 96px); display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; align-content: start; overscroll-behavior: contain; }
.list.dim .sc { opacity: .5; }
.sc { display: flex; gap: 11px; align-items: flex-start; width: 100%; text-align: left; background: var(--surface); border-radius: 14px; padding: 11px 14px 12px; box-shadow: 0 0 0 1px var(--border); transition: transform .12s; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
/* 会话卡片左边的图标：哪个终端的应用图标；手机建的会话用手机图标 */
.sc .ci-wrap { flex: none; padding-top: 1px; }
.sc .ci { position: relative; width: 34px; height: 34px; border-radius: 9px; background: var(--fg-soft); display: grid; place-items: center; flex: none; }
.sc .ci svg { width: 19px; height: 19px; color: var(--fg); }
/* 应用图标盖在通用图标上面：没拿到就只看见通用图标，不会空 */
.sc .ci img { position: absolute; inset: 3px; width: 28px; height: 28px; object-fit: contain; background: var(--fg-soft); }
.sc .ci img:not([src]), .sc .ci img[src=""] { display: none; }
.sc .tx { flex: 1; min-width: 0; display: block; }
.sc:active, .sc.press { transform: scale(.98); }
.sc.waiting { box-shadow: 0 0 0 1.5px color-mix(in oklch, var(--wait) 55%, transparent); }
.sc .r1 { display: flex; align-items: center; gap: 8px; }
.sc .out { display: block; }
.sc .nm { font-weight: 650; font-size: 15.5px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sc .ago { font-size: 11.5px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.sc .stag { flex: none; }
.sc .out { margin-top: 2px; font-family: var(--font-mono); font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sc.waiting .out { color: color-mix(in oklch, var(--wait) 85%, var(--fg)); }
.fab { position: fixed; right: calc(16px + var(--sar)); bottom: calc(var(--sab) + 16px); height: 54px; padding: 0 22px 0 18px; border-radius: 27px; background: var(--accent-fill); color: var(--on-fill); font-weight: 700; font-size: 16px; display: flex; align-items: center; gap: 6px; box-shadow: 0 8px 22px color-mix(in oklch, var(--accent-fill) 40%, transparent), 0 2px 6px oklch(0% 0 0 / .15); z-index: 5; }
.fab svg { width: 22px; height: 22px; }
.fab:disabled { opacity: .4; box-shadow: none; }
.sk { height: 62px; border-radius: 14px; background: linear-gradient(90deg, var(--fg-soft) 0%, var(--fg-soft-2) 40%, var(--fg-soft) 80%); background-size: 300% 100%; animation: sh 1.3s linear infinite; }
@keyframes sh { to { background-position: -300% 0; } }
.empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 0 36px 80px; overflow: auto; }
.empty .ei { width: 68px; height: 68px; border-radius: 20px; background: var(--fg-soft); display: grid; place-items: center; margin-bottom: 16px; color: var(--muted); flex: none; }
.empty .ei svg { width: 32px; height: 32px; }
.empty h2 { font-family: var(--font-display); font-size: 19px; margin: 0 0 8px; }
.empty p { color: var(--muted); font-size: 14.5px; line-height: 1.6; margin: 0 0 20px; }
/* 付费墙里"去 Mac 上买"那段说明：比正文重一点，因为它是这一步唯一要用户做的事 */
.empty .macbuy { font-size: 14px; line-height: 1.6; color: var(--fg); background: var(--fg-soft); border-radius: 12px; padding: 12px 14px; margin: -4px 0 0; max-width: 300px; }
/* 付费墙的按钮：文案比其他按钮长（英文尤其），要能换行，不能撑出按钮边框 */
.empty .btn.wrap { width: auto; max-width: 300px; height: auto; min-height: 48px; padding: 12px 18px; white-space: normal; text-align: center; line-height: 1.3; }
.empty .mono-chip { font-family: var(--font-mono); background: var(--fg-soft); padding: 1px 6px; border-radius: 5px; color: var(--fg); }
.macs .cell .ci { width: 36px; height: 36px; border-radius: 10px; background: var(--fg-soft); display: grid; place-items: center; flex: none; }
.macs .cell .ci svg { width: 20px; height: 20px; }
.macs .chk { width: 20px; height: 20px; color: color-mix(in oklch, var(--accent) 70%, var(--fg)); }
.macs .chk svg { width: 20px; height: 20px; }
.sheet .form { padding: 0 20px; display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
.sheet .fl { font-size: 13px; color: var(--muted); display: grid; gap: 6px; font-weight: 500; grid-template-columns: minmax(0, 1fr); min-width: 0; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chips button { height: 38px; padding: 0 14px; border-radius: 10px; background: var(--fg-soft); font-size: 14px; color: var(--fg); }
.chips button.m { font-family: var(--font-mono); }
.chips button[aria-pressed="true"] { background: var(--fg); color: var(--bg); }
/* 目录：平时只占一行，点开才露出候选，免得新建会话的弹层一上来就是两张列表 */
.dirpick { display: flex; align-items: center; gap: 10px; width: 100%; height: 46px; padding: 0 12px; border-radius: 12px; background: var(--fg-soft); color: var(--fg); text-align: left; }
.dirpick .dpi { display: flex; flex: none; color: var(--muted); }
.dirpick .dpi svg { width: 18px; height: 18px; }
.dirpick .dpv { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.dirpick .dph { flex: none; font-size: 12px; color: var(--muted); }
.dirpick > svg { flex: none; width: 15px; height: 15px; color: var(--muted); transition: transform .15s; }
.dirpick[aria-expanded="true"] > svg { transform: rotate(180deg); }
.dirlist { display: grid; border-radius: 12px; box-shadow: 0 0 0 1px var(--border); overflow: hidden; }
.dirlist button { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 12px; text-align: left; font-family: var(--font-mono); font-size: 13.5px; color: var(--fg); min-width: 0; }
.dirlist button + button { border-top: 1px solid var(--border); }
.dirlist button span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dirlist button svg { flex: none; width: 18px; height: 18px; color: var(--muted); }
.runhint { font-size: 12.5px; color: var(--muted); min-height: 18px; line-height: 1.4; }
.runhint code { font-family: var(--font-mono); font-size: 12px; color: var(--fg); background: var(--fg-soft); padding: 1px 6px; border-radius: 6px; overflow-wrap: anywhere; }
.stag .sn { font-family: var(--font-mono); font-size: 10.5px; opacity: .75; margin-left: 3px; }
.sugg { display: grid; grid-template-columns: minmax(0, 1fr); max-height: 180px; overflow: auto; border-radius: 10px; box-shadow: 0 0 0 1px var(--border); }
.sugg:empty { display: none; }
.sugg button { text-align: left; min-height: 40px; padding: 0 12px; font-family: var(--font-mono); font-size: 13.5px; color: var(--fg); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sugg button + button { border-top: 1px solid var(--border); }
.slist .cell .stag { margin-left: auto; }

/* ---------- 设置（5.10） ---------- */
.scroll { flex: 1; overflow: auto; padding-bottom: calc(var(--sab) + 24px); overscroll-behavior: contain; }
.scroll .switch { width: 51px; height: 31px; }
.scroll .switch::after { width: 27px; height: 27px; }
.scroll .switch[aria-checked="true"]::after { transform: translateX(20px); }
.seg3 { display: flex; background: var(--seg-track); border-radius: 10px; padding: 2px; margin: 0 16px; }
.seg3 button { flex: 1; height: 34px; border-radius: 8px; font-size: 14px; }
.seg3 button[aria-pressed="true"] { background: var(--seg-on); box-shadow: 0 1px 3px oklch(0% 0 0 / .2), inset 0 0 0 1px var(--seg-edge); font-weight: 600; color: var(--fg); }
.scroll .ci { width: 30px; height: 30px; border-radius: 8px; background: var(--fg-soft); display: grid; place-items: center; flex: none; }
.scroll .ci svg { width: 18px; height: 18px; }
.stepper { display: flex; align-items: center; gap: 6px; }
.stepper button { width: 36px; height: 32px; border-radius: 8px; background: var(--fg-soft); font-family: var(--font-mono); font-size: 14px; }
.stepper b { min-width: 52px; text-align: center; font-family: var(--font-mono); font-weight: 500; color: var(--muted); font-size: 15px; }
.about { text-align: center; padding: 26px 0 6px; color: var(--muted); font-size: 13px; }
.about .lg { width: 52px; height: 52px; margin: 0 auto 8px; display: block; }
.about .lg svg { width: 100%; height: 100%; }
.about .bv { display: block; margin-top: 3px; font: 500 11px var(--font-mono); opacity: .65; letter-spacing: .2px; }
.about b { display: block; font-family: var(--font-mono); color: var(--fg); font-size: 15px; }
.preview { margin: 6px 16px 0; border-radius: 12px; background: oklch(24% 0.012 250); height: 48px; display: flex; align-items: center; gap: 6px; padding: 0 8px; overflow-x: auto; scrollbar-width: none; }
.preview::-webkit-scrollbar { display: none; }
.preview .k { height: 32px; min-width: 38px; padding: 0 9px; border-radius: 7px; background: oklch(32% 0.012 250); color: var(--term-fg); font-family: var(--font-mono); font-size: 13.5px; flex: none; display: grid; place-items: center; }
.erow { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 10px 0 6px; background: var(--surface); position: relative; }
.erow + .erow { border-top: 1px solid var(--border); }
.erow .op { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; flex: none; }
.erow .op i { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; color: var(--on-fill); font-style: normal; font-weight: 700; font-size: 18px; line-height: 1; }
.erow .op.rm i { background: var(--danger); }
.erow .op.add i { background: var(--ok); }
.erow .kc { min-width: 46px; height: 30px; padding: 0 8px; border-radius: 7px; background: var(--fg-soft); font-family: var(--font-mono); font-size: 14px; display: grid; place-items: center; font-weight: 600; flex: none; }
.erow .ds { flex: 1; font-size: 15px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.erow .hd { width: 40px; height: 44px; display: grid; place-items: center; color: var(--muted); cursor: grab; flex: none; touch-action: none; }
.erow .hd svg { width: 22px; height: 22px; }
.erow.drag { z-index: 5; box-shadow: 0 8px 24px oklch(0% 0 0 / .2); border-radius: 10px; }
.erow .pt { flex: 1; font-size: 15.5px; min-width: 0; text-align: left; padding: 14px 0; line-height: 1.4; word-break: break-all; }
.erow .pt small { display: block; color: var(--muted); font-size: 12px; font-family: var(--font-ui); }
.cnt { font-size: 12.5px; color: var(--muted); padding: 8px 20px 0; }
.sheet textarea.mfield { height: 110px; padding: 12px 14px; resize: none; line-height: 1.5; }
.swrow { display: flex; align-items: center; justify-content: space-between; font-size: 15px; }
.slist .cell .d { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 微信等内置浏览器里的拦截页：两步说明 */
.steps { display: flex; flex-direction: column; gap: 10px; margin: 4px 0 0; width: 100%; max-width: 290px; }
.step { display: flex; align-items: center; gap: 10px; text-align: left; font-size: 14px; color: var(--fg); }
.step b { flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  font-size: 12px; font-weight: 600; color: var(--fg); background: var(--fg-soft-2); }
