/* 天玺远控 · 网页控制台
   前半是通用部件（局域网扫码页 inject/rc-web 也用这份），后半 body.rcx 是链接远控新版布局。
   画面区域不用模糊/滤镜/阴影动画，免得拖慢解码和绘制。 */
:root {
  color-scheme: dark;
  --bg: #0a0a0a; --bg2: #141414; --panel: #141414; --panel2: #1d1e1f; --line: #262727; --line2: #363637;
  --fg: #e5eaf3; --fg2: #cfd3dc; --fg3: #a3a6ad;
  --a: #2793fb; --a2: #4aa6ff; --ok: #22c55e; --warn: #f5a524; --err: #f2555a;
  --r: 8px;
  --font: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, -apple-system, sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; margin: 0; background: var(--bg); color: var(--fg); font: 15px/1.5 var(--font); }
body { padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
[hidden] { display: none !important; }
h1 { margin: 0 0 4px; font-size: 22px; font-weight: 700; letter-spacing: .2px; }
h2 { margin: 0; font-weight: 700; }
p { margin: 0; }
button { cursor: pointer; }
.muted { color: var(--fg3); }
.center { text-align: center; padding: 16px; }
.small { font-size: 12px; }
.grow { flex: 1; min-width: 0; }
.clip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.err { color: var(--err); min-height: 1.5em; font-size: 13px; }
.btn { height: 40px; padding: 0 16px; border: 1px solid var(--line2); border-radius: 10px; background: var(--panel); color: var(--fg); font: inherit; white-space: nowrap; transition: background .15s, border-color .15s; }
.btn:hover { background: var(--panel2); }
.btn.sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.btn.lg { height: 46px; font-size: 16px; border-radius: 12px; }
.btn.primary { background: var(--a); border-color: var(--a); color: #fff; font-weight: 600; }
.btn.primary:hover { background: var(--a2); border-color: var(--a2); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--fg2); }
.btn.ghost:hover { background: rgb(255 255 255 / .06); }
input { height: 44px; padding: 0 12px; border: 1px solid var(--line2); border-radius: 10px; background: var(--bg2); color: var(--fg); font: inherit; width: 100%; outline: none; transition: border-color .15s; }
input:focus { border-color: var(--a); }
select.btn { appearance: none; -webkit-appearance: none; }
.page { min-height: 100%; }
.card { border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); }

/* ---- 通用（局域网页沿用） ---- */
#login { display: flex; align-items: center; justify-content: center; padding: 16px; }
.bar { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--bg); z-index: 2; }
.devices { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; padding: 12px; }
.dev { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); color: var(--fg); font: inherit; text-align: left; }
.dev b { font-size: 15px; word-break: break-all; }
.dev small { color: var(--fg3); font-size: 12px; word-break: break-all; }
.dev .on { color: var(--ok); font-size: 12px; }
.view { display: flex; flex-direction: column; height: 100%; height: 100dvh; min-height: 0; }
.stage { position: relative; flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; overflow: hidden; background: #000; }
#vid { width: 100%; height: 100%; object-fit: contain; background: #000; }
#screen, #vid { display: block; max-width: 100%; max-height: 100%; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.status { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); max-width: 86%; padding: 14px 18px; border-radius: 12px; background: rgb(10 13 20 / .86); border: 1px solid var(--line); text-align: center; font-size: 14px; white-space: pre-line; z-index: 3; }
.keys { display: flex; justify-content: space-around; padding: 6px 4px; border-top: 1px solid var(--line); }
.keys button { flex: 1; height: 44px; border: 0; background: none; color: var(--fg); font-size: 20px; }
.keys button:active { background: rgb(255 255 255 / .08); border-radius: 10px; }
.textbar { display: flex; gap: 8px; padding: 6px 10px; }
.textbar input { height: 36px; }
.sound-msg { cursor: pointer; text-decoration: underline; }
#sound[aria-pressed="true"] { border-color: var(--a); color: var(--a2); }
.mic-toast { position: absolute; left: 50%; top: 12px; transform: translateX(-50%); max-width: 92%; padding: 8px 14px; border-radius: 10px; background: rgb(10 13 20 / .9); border: 1px solid var(--line2); color: #fff; font-size: 13px; text-align: center; z-index: 4; pointer-events: none; }
#mic.wait { opacity: .75; }
#mic.talk { background: var(--a); color: #fff; }
/* 缓存的上一屏：变暗表示还在连接、暂时不能点 */
#screen.stale { filter: brightness(.55) grayscale(.3); transition: filter .15s; }

/* =================== 链接远控（body.rcx）：照天玺自己的界面做，不另起一套
   电脑浏览器 = 天玺电脑端（深色、细线、蓝色强调、顶部导航、左侧设备栏、投屏窗：标题栏 + 右侧竖排工具条 + 底部导航）
   手机浏览器 = 天玺手机端 App（浅色、白卡片、蓝色图标格子、画面全屏 + 悬浮底部导航 + 右下角控制面板按钮） */
.rcx .sprite { position: absolute; }
.rcx svg { width: 18px; height: 18px; flex: none; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; letter-spacing: .5px; white-space: nowrap; }
.brand .logo { width: 30px; height: 30px; }
.only-m { display: none !important; }
.icon-btn { width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 6px; background: transparent; color: var(--fg3); }
.icon-btn:hover { background: rgb(255 255 255 / .06); color: var(--fg); }
.link-btn { border: 0; background: none; color: var(--fg3); font: inherit; font-size: 14px; padding: 6px 8px; }
.link-btn:hover { color: var(--a); }
.search { position: relative; display: flex; align-items: center; }
.search svg { position: absolute; left: 10px; width: 16px; height: 16px; color: var(--fg3); pointer-events: none; }
.search input { height: 34px; padding-left: 32px; font-size: 14px; border-radius: 6px; background: transparent; border-color: var(--line2); }
.search input::-webkit-search-cancel-button { filter: invert(.6); }
.dot, .wdot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); flex: none; display: inline-block; }

/* ---- 顶部导航（同电脑端） ---- */
.appbar { height: 56px; display: flex; align-items: center; gap: 28px; padding: 0 20px; border-bottom: 1px solid var(--line); background: var(--bg); flex: none; }
.tabs { display: flex; align-items: center; gap: 4px; height: 100%; }
.tab { position: relative; display: inline-flex; align-items: center; gap: 6px; height: 100%; padding: 0 12px; border: 0; background: none; color: var(--fg2); font: inherit; font-size: 15px; }
.tab:hover { color: var(--fg); }
.tab.on { color: var(--a); }
.tab.on::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: 0; height: 2px; background: var(--a); border-radius: 2px; }
.who { max-width: 30vw; font-size: 13px; color: var(--fg3); }
.gtab { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px; border-radius: 6px; color: var(--fg2); font-size: 15px; }
.gtab.on { background: rgb(39 147 251 / .12); color: var(--a); }
.gtab b { font-weight: 500; }

/* ---- 登录 ---- */
.rcx #login { padding: 0; display: grid; align-items: stretch; grid-template-columns: 1.1fr 1fr; min-height: 100vh; min-height: 100dvh; }
.login-brand { display: flex; flex-direction: column; justify-content: center; gap: 28px; padding: 56px 7vw; background: var(--bg2); border-right: 1px solid var(--line); }
.login-brand h2 { font-size: 32px; line-height: 1.3; max-width: 12em; font-weight: 600; }
.feats { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 16px; }
.feats li { display: flex; gap: 12px; align-items: flex-start; color: var(--fg3); }
.feats li svg { color: var(--a); margin-top: 3px; }
.feats b { display: block; color: var(--fg); font-size: 16px; font-weight: 600; }
.login-card { align-self: center; justify-self: center; width: calc(100% - 32px); max-width: 380px; display: flex; flex-direction: column; gap: 14px; padding: 32px 28px; background: var(--panel); border-radius: 8px; }
.login-card h1 { font-weight: 600; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--fg2); }
.field input { border-radius: 6px; }
.login-card .err { min-height: 1.2em; margin: -4px 0; }
.btn.lg { height: 44px; font-size: 16px; border-radius: 6px; }
.btn.primary { background: var(--a); border-color: var(--a); }

/* ---- 手机列表（电脑：设备墙；手机：App 里的卡片列表） ---- */
.rcx #list { display: flex; flex-direction: column; height: 100vh; height: 100dvh; }
.lbody { flex: 1; min-height: 0; display: flex; }
.groups { width: 260px; flex: none; padding: 12px; border-right: 1px solid var(--line); }
.lmain { flex: 1; min-width: 0; overflow-y: auto; padding: 16px 20px; }
.ltool { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.ltool .search { width: 280px; }
.tbtn { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border: 1px solid var(--line2); border-radius: 6px; background: transparent; color: var(--fg2); font: inherit; font-size: 14px; }
.tbtn:hover { color: var(--a); border-color: var(--a); }
.tbtn[hidden] { display: none; }
#install { color: var(--a); border-color: var(--a); }
.rcx .devices { grid-template-columns: repeat(auto-fill, minmax(150px, 170px)); gap: 14px; padding: 0; }
.rcx .dev { display: flex; flex-direction: column; align-items: stretch; gap: 0; padding: 0; border: 1px solid var(--line2); border-radius: 8px; background: var(--panel); overflow: hidden; transition: border-color .15s; }
.rcx .dev:hover { border-color: var(--a); }
.thumb { position: relative; aspect-ratio: 9 / 16; background: #000 radial-gradient(rgb(255 255 255 / .07) 1px, transparent 1px) 0 0 / 14px 14px; display: flex; align-items: center; justify-content: center; color: #5b5d63; overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
.thumb svg { width: 40px; height: 40px; }
.dev-txt { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; min-width: 0; text-align: left; }
.dev-l1 { display: flex; align-items: center; gap: 6px; min-width: 0; }
.dev-no { color: var(--fg3); font-size: 12px; font-weight: 400; flex: none; }
.rcx .dev b { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
.rcx .dev small { font-family: Menlo, Consolas, monospace; font-size: 11px; color: var(--fg3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rcx .dev .on { display: none; }
.dev-chev { display: none; }

/* ---- 远控页 ---- */
.rcx .view { display: flex; flex-direction: column; }
.vbody { flex: 1; min-height: 0; display: flex; }
.rail { width: 260px; flex: none; display: flex; flex-direction: column; gap: 10px; padding: 12px; border-right: 1px solid var(--line); background: var(--bg); min-height: 0; }
.rail-head { display: flex; align-items: center; justify-content: space-between; }
.rail-head .gtab { flex: 1; }
.rail-list { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; }
.rail-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border: 0; border-radius: 6px; background: none; color: var(--fg); font: inherit; text-align: left; }
.rail-item:hover { background: rgb(255 255 255 / .04); }
.rail-item.cur { background: rgb(39 147 251 / .12); }
.rail-item.cur b { color: var(--a); }
.rail-item b { display: block; font-size: 15px; font-weight: 600; }
.rail-item small { display: block; font-size: 12px; color: var(--fg3); font-family: Menlo, Consolas, monospace; }
.rail-item .no { margin-left: auto; color: var(--fg3); font-size: 13px; }
.rail-item .dev-ico { display: none; }
.share:not(.share-multi) .rail, .share .tabs { display: none; }
.scrim { position: fixed; inset: 0; background: rgb(0 0 0 / .45); z-index: 20; }

.conn { position: relative; display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 12px; border-radius: 15px; border: 1px solid var(--line2); font-size: 13px; color: var(--fg2); white-space: nowrap; font-variant-numeric: tabular-nums; cursor: default; outline: none; }
.conn i { width: 8px; height: 8px; border-radius: 50%; background: var(--fg3); }
.conn[data-s="good"] i { background: var(--ok); }
.conn[data-s="fair"] i { background: var(--warn); }
.conn[data-s="bad"] i, .conn[data-s="off"] i { background: var(--err); }
.conn[data-s="wait"] i { background: var(--warn); animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: .25; } }
.conn-pop { display: none; position: absolute; right: 0; top: 36px; width: 260px; padding: 12px 14px; border: 1px solid var(--line2); border-radius: 8px; background: var(--panel2); box-shadow: 0 8px 24px rgb(0 0 0 / .5); z-index: 30; flex-direction: column; gap: 6px; white-space: normal; }
.conn:hover .conn-pop, .conn:focus .conn-pop { display: flex; }
.kv { display: flex; justify-content: space-between; font-size: 13px; color: var(--fg3); }
.kv b { color: var(--fg); font-weight: 600; }
.stat { font-size: 12px; color: var(--fg3); line-height: 1.5; }

/* 投屏窗：标题栏 + 画面 + 右侧竖排工具条 + 底部导航（同电脑端聚焦窗口） */
.desk { flex: 1; min-width: 0; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 16px 24px; background: var(--bg) radial-gradient(rgb(255 255 255 / .06) 1px, transparent 1px) 0 0 / 18px 18px; }
.win { height: 100%; display: flex; flex-direction: column; align-items: flex-start; gap: 0; min-height: 0; }
.wtitle { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 6px 0 4px; background: var(--panel2); border: 1px solid var(--line2); border-bottom: 0; border-radius: 8px 8px 0 0; width: var(--sw, 360px); min-width: 300px; }
.wback { width: 26px; height: 28px; border: 0; border-radius: 6px; background: none; color: var(--fg3); font: inherit; font-size: 22px; line-height: 1; padding: 0; }
.wback:hover { color: var(--fg); background: rgb(255 255 255 / .06); }
.dev-pick { display: inline-flex; align-items: center; gap: 4px; min-width: 0; padding: 2px 4px; border: 0; border-radius: 6px; background: none; color: var(--fg); font: inherit; font-size: 15px; }
.dev-pick b { font-weight: 600; }
.dev-pick .caret { width: 14px; height: 14px; color: var(--fg3); display: none; }
.wrow { flex: 1; min-height: 0; display: flex; align-items: flex-start; gap: 10px; }
.rcx .stage { flex: none; height: 100%; aspect-ratio: var(--ar, 9 / 19.5); max-width: calc(100vw - 260px - 140px); background: #000; border: 1px solid var(--line2); border-radius: 0 0 8px 8px; padding: 0; overflow: hidden; }
.rcx #screen { width: 100%; height: 100%; max-width: none; max-height: none; object-fit: contain; }
.rcx #screen.stale { filter: brightness(.55); }
.fx { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 2; }
.call-bar { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); display: inline-flex; align-items: center; gap: 8px; height: 28px; padding: 0 12px; border-radius: 14px; background: rgb(22 163 74 / .92); color: #fff; font-size: 13px; font-weight: 600; z-index: 3; pointer-events: none; font-variant-numeric: tabular-nums; white-space: nowrap; }
.call-bar i { width: 8px; height: 8px; border-radius: 50%; background: #b8ffcf; }
.call-bar.talk i { background: #fff; box-shadow: 0 0 0 3px rgb(255 255 255 / .3); }
.rcx .mic-toast { top: 46px; background: rgb(29 30 31 / .95); border-color: var(--line2); }
.rcx .status { background: rgb(20 20 20 / .9); border-color: var(--line2); }

/* 通话键：标题栏里（电脑端标题栏也是电话图标），按下变红 */
.rcx #mic { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px 0 10px; border: 0; border-radius: 15px; background: var(--ok); color: #fff; font-size: 0; font-family: inherit; white-space: nowrap; }
.rcx #mic::before { content: ""; width: 16px; height: 16px; background: currentColor; -webkit-mask: var(--ic-phone) center / contain no-repeat; mask: var(--ic-phone) center / contain no-repeat; }
.rcx #mic::after { content: attr(data-label); font-size: 13px; font-weight: 600; }
.rcx #mic[aria-pressed="true"] { background: var(--err); }
.rcx #mic.wait { background: #3d6b4c; opacity: 1; }
.rcx #mic.talk { box-shadow: 0 0 0 3px rgb(242 85 90 / .35); }
:root { --ic-phone: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6.6 10.8a15.1 15.1 0 0 0 6.6 6.6l2.2-2.2a1 1 0 0 1 1-.25 11.4 11.4 0 0 0 3.6.57 1 1 0 0 1 1 1V20a1 1 0 0 1-1 1A17 17 0 0 1 3 4a1 1 0 0 1 1-1h3.5a1 1 0 0 1 1 1c0 1.25.2 2.45.57 3.57a1 1 0 0 1-.25 1z'/%3E%3C/svg%3E");
  --ic-snd-on: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M11 5 6 9H3v6h3l5 4z'/%3E%3Cpath d='M15.5 8.5a5 5 0 0 1 0 7M18.5 5.5a9 9 0 0 1 0 13'/%3E%3C/svg%3E");
  --ic-snd-off: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M11 5 6 9H3v6h3l5 4z'/%3E%3Cpath d='m16 9 5 6M21 9l-5 6'/%3E%3C/svg%3E"); }

/* 右侧竖排工具条（电脑） */
.tools { width: 64px; flex: none; display: flex; flex-direction: column; gap: 8px; padding: 6px; border: 1px solid var(--line2); border-radius: 8px; background: var(--panel2); }
.tgrid { display: flex; flex-direction: column; gap: 2px; }
.tl { position: relative; width: 50px; height: 46px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border: 0; border-radius: 6px; background: none; color: var(--fg2); font: inherit; font-size: 0; }
.tl:hover { background: rgb(255 255 255 / .07); color: var(--fg); }
.tl:active { background: rgb(39 147 251 / .2); }
.tl svg { width: 20px; height: 20px; }
.tl span { font-size: 10px; color: var(--fg3); }
.rcx #kbd[aria-pressed="true"] { color: var(--a); }
.rcx #sound::before { content: ""; width: 20px; height: 20px; background: currentColor; -webkit-mask: var(--ic-snd-off) center / contain no-repeat; mask: var(--ic-snd-off) center / contain no-repeat; }
.rcx #sound::after { content: "声音"; font-size: 10px; color: var(--fg3); }
.rcx #sound[aria-pressed="true"] { color: var(--a); border: 0; }
.rcx #sound[aria-pressed="true"]::before { -webkit-mask-image: var(--ic-snd-on); mask-image: var(--ic-snd-on); }
.qbox { display: flex; flex-direction: column; align-items: center; gap: 4px; padding-top: 6px; border-top: 1px solid var(--line); }
.qlabel { display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--fg3); }
.qlabel span { font-size: 10px; }
.sel { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.seg { display: flex; flex-direction: column; gap: 2px; width: 100%; }
.seg button { height: 26px; border: 0; border-radius: 5px; background: none; color: var(--fg3); font: inherit; font-size: 12px; }
.seg button:hover { color: var(--fg); }
.seg button[aria-checked="true"] { background: rgb(39 147 251 / .16); color: var(--a); font-weight: 600; }
.tools .sound-msg, .tools .mic-msg { display: none !important; }

.navpill { display: flex; gap: 4px; margin: 10px 0 0; padding: 4px; border: 1px solid var(--line2); border-radius: 22px; background: var(--panel2); align-self: flex-start; transform: translateX(calc(var(--sw, 360px) / 2 - 50%)); }
.navpill button { display: inline-flex; align-items: center; justify-content: center; gap: 4px; width: 56px; height: 34px; border: 0; border-radius: 17px; background: none; color: var(--fg2); font: inherit; }
.navpill button:hover { background: rgb(255 255 255 / .07); color: var(--fg); }
.navpill button span { display: none; }
.rcx .textbar { width: var(--sw, 360px); padding: 8px 0 0; gap: 6px; }
.rcx .textbar input { height: 34px; border-radius: 6px; font-size: 14px; }
.send { height: 34px; padding: 0 14px; border: 0; border-radius: 6px; background: var(--a); color: #fff; font: inherit; font-size: 14px; }

/* =================== 手机浏览器：照天玺手机端 App（浅色） =================== */
@media (max-width: 899px) {
  :root { color-scheme: light; --bg: #f2f3f5; --bg2: #fff; --panel: #fff; --panel2: #fff; --line: #ebeef5; --line2: #dcdfe6; --fg: #1f2329; --fg2: #3c4048; --fg3: #8a8f99; --tile: #eef4fd; }
  .only-m { display: inline-flex !important; }
  .only-d { display: none !important; }
  .login-brand { display: none; }
  .rcx #login { grid-template-columns: 1fr; place-items: center; padding: 16px; }
  .login-card { gap: 12px; padding: 26px 20px; border-radius: 16px; border: 0; box-shadow: 0 2px 12px rgb(0 0 0 / .04); }
  .login-card .brand { margin-bottom: 8px; }
  .btn.lg { border-radius: 12px; }
  .rcx input { background: #f5f6f8; border-color: transparent; }
  .rcx input:focus { border-color: var(--a); background: #fff; }

  /* 列表：App 的白卡片 */
  .appbar { height: 52px; padding: 0 16px; background: #fff; gap: 12px; }
  .brand { font-size: 17px; }
  .lmain { padding: 14px 14px 24px; }
  .ltool { flex-wrap: wrap; gap: 8px; }
  .ltool h1 { flex: 1 1 100%; font-size: 22px; margin: 2px 0 2px; }
  .ltool .search { flex: 1; width: auto; }
  .search input { height: 40px; border-radius: 12px; }
  .tbtn { height: 40px; width: 44px; justify-content: center; padding: 0; border: 0; border-radius: 12px; background: #fff; color: var(--a); }
  #install { width: auto; padding: 0 12px; font-size: 13px; }
  /* 「我的手机」缩略图卡片墙（HY 要缩略图、不要列表）：两列卡片，上次画面缩略图铺在卡片上，下面名称+状态 */
  .rcx .devices { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .rcx .dev { flex-direction: column; align-items: stretch; gap: 0; padding: 0; border: 0; border-radius: 14px; background: #fff; box-shadow: 0 1px 4px rgb(0 0 0 / .06); overflow: hidden; }
  .thumb { width: auto; height: auto; aspect-ratio: 3 / 4; flex: none; border-radius: 0; background: #0e0f12 radial-gradient(rgb(255 255 255 / .06) 1px, transparent 1px) 0 0 / 14px 14px; color: #6b7079; }
  .thumb img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top; }
  .thumb svg { width: 40px; height: 40px; }
  .dev-txt { flex: none; padding: 9px 11px 11px; gap: 3px; }
  .rcx .dev b { font-size: 15px; }
  .rcx .dev small { font-family: inherit; font-size: 12px; }
  .rcx .dev .on { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--fg3); }
  .dev-no { display: none; }
  .dev-chev { display: none; }

  /* 远控：画面全屏，悬浮底部导航 + 右下角控制面板按钮（同 App） */
  .desk { padding: 0; background: #000; position: relative; align-items: stretch; }
  .win { width: 100%; height: 100%; align-items: stretch; }
  .wtitle { width: auto; min-width: 0; height: 48px; border: 0; border-radius: 0; background: #fff; border-bottom: 1px solid var(--line); padding: 0 8px; }
  .wback { color: var(--a); font-size: 15px; }
  .wback svg { width: 24px; height: 24px; }
  .dev-pick { font-size: 16px; }
  .dev-pick .caret { display: block; }
  .share:not(.share-multi) .dev-pick .caret { display: none; }
  .connm { font-size: 12px; color: var(--fg3); font-variant-numeric: tabular-nums; align-items: center; gap: 5px; }
  .connm::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); }
  .connm[data-s="wait"]::before, .connm[data-s="fair"]::before { background: var(--warn); }
  .connm[data-s="bad"]::before, .connm[data-s="off"]::before { background: var(--err); }
  .rcx #mic { height: 34px; padding: 0 14px 0 12px; border-radius: 17px; }
  .wrow { position: relative; }
  .rcx .stage { flex: 1; height: 100%; aspect-ratio: auto; max-width: none; border: 0; border-radius: 0; }
  .rcx .mic-toast { top: 46px; background: rgb(255 255 255 / .96); color: var(--fg); border-color: var(--line); box-shadow: 0 4px 16px rgb(0 0 0 / .12); }
  .rcx .status { background: rgb(255 255 255 / .95); color: var(--fg); }
  .navpill { position: absolute; left: 50%; bottom: calc(14px + env(safe-area-inset-bottom)); transform: translateX(-50%); margin: 0; padding: 4px 6px; gap: 2px; border: 0; border-radius: 22px; background: rgb(255 255 255 / .88); box-shadow: 0 4px 16px rgb(0 0 0 / .18); z-index: 5; }
  .navpill button { flex-direction: column; gap: 1px; width: 62px; height: 46px; color: var(--a); border-radius: 16px; }
  .navpill button span { display: block; font-size: 11px; }
  .navpill button svg { width: 20px; height: 20px; }
  .rcx .textbar { position: absolute; left: 10px; right: 10px; bottom: calc(76px + env(safe-area-inset-bottom)); width: auto; padding: 8px; border-radius: 14px; background: #fff; box-shadow: 0 4px 16px rgb(0 0 0 / .18); z-index: 6; }
  .fab { position: absolute; right: 14px; bottom: calc(18px + env(safe-area-inset-bottom)); width: 52px; height: 52px; border: 0; border-radius: 50%; background: #fff; color: var(--a); align-items: center; justify-content: center; box-shadow: 0 4px 16px rgb(0 0 0 / .2); z-index: 7; }
  .fab svg { width: 22px; height: 22px; }
  .view.set-open .fab svg { display: none; }
  .view.set-open .fab::before { content: "✕"; font-size: 22px; }

  /* 控制面板：App 里点右下角弹出的那张白卡片 */
  .tools { position: absolute; right: 12px; bottom: calc(80px + env(safe-area-inset-bottom)); width: min(300px, calc(100vw - 24px)); padding: 14px; gap: 10px; border: 0; border-radius: 22px; background: #fff; box-shadow: 0 10px 30px rgb(0 0 0 / .25); z-index: 22; display: none; }
  .view.set-open .tools { display: flex; }
  .view.set-open .fab { z-index: 23; }
  .tools-head { align-items: center; gap: 8px; font-size: 15px; }
  .tools-head b { max-width: 150px; }
  .tgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .tl { width: auto; height: 72px; gap: 6px; border-radius: 14px; background: var(--tile); color: var(--a); }
  .tl:hover { background: #e3edfc; color: var(--a); }
  .tl span, .rcx #sound::after { font-size: 12px; color: var(--fg2); }
  .tl svg, .rcx #sound::before { width: 22px; height: 22px; }
  .rcx #sound[aria-pressed="true"] { background: #dbe9fd; }
  .qbox { flex-direction: row; justify-content: space-between; padding: 12px; border: 0; border-radius: 14px; background: var(--tile); }
  .qlabel { flex-direction: row; gap: 6px; color: var(--a); }
  .qlabel span { font-size: 14px; color: var(--fg); font-weight: 600; }
  .rcx .qlabel { width: auto; height: auto; padding: 0; background: none; pointer-events: none; }
  .seg { flex-direction: row; width: auto; padding: 2px; border-radius: 10px; background: #fff; }
  .seg button { height: 28px; padding: 0 10px; font-size: 13px; border-radius: 8px; }
  .seg button[aria-checked="true"] { background: var(--a); color: #fff; }
  .tools .sound-msg, .tools .mic-msg { display: block !important; font-size: 12px; line-height: 1.5; }
  .tools .sound-msg[hidden], .tools .mic-msg[hidden] { display: none !important; }
  .disc { display: flex !important; align-items: center; justify-content: center; gap: 6px; height: 44px; border: 0; border-radius: 14px; background: #fdeeee; color: #e5484d; font: inherit; font-size: 15px; }

  /* 设备抽屉（点设备名） */
  .rail { position: fixed; left: 0; top: 0; bottom: 0; width: min(300px, 84vw); z-index: 21; transform: translateX(-102%); transition: transform .2s; padding-top: calc(12px + env(safe-area-inset-top)); background: #fff; border: 0; }
  .view.rail-open .rail { transform: none; }
  .rail-item { padding: 12px; border-radius: 12px; }
  .rail-item.cur { background: var(--tile); }
}
@media (max-width: 360px) {
  .navpill button { width: 54px; }
}

/* =================== 电脑浏览器：聚焦窗按可用空间算尺寸（rc-ui.js fit 设 --sw/--sh），标题栏小图标、画质弹出 =================== */
.rcx button, .rcx .tab, .rcx .gtab { white-space: nowrap; }
.rcx .textbar input { flex: 1; min-width: 0; }
.send { flex: none; white-space: nowrap; }
.wback { display: inline-flex; align-items: center; justify-content: center; gap: 4px; flex: none; min-width: 28px; height: 28px; padding: 0 6px; font-size: 13px; white-space: nowrap; }
.wback svg { width: 18px; height: 18px; }
.seg small { display: none; }
@media (min-width: 900px) {
  .desk { overflow: hidden; }
  .win { height: auto; }
  .wtitle { width: var(--sw, 360px); min-width: 0; }
  .wback { color: var(--fg2); }
  .rcx .stage { width: var(--sw, 360px); height: var(--sh, 640px); aspect-ratio: auto; max-width: none; }
  /* 通话：同电脑端标题栏，小电话图标；通话中变红底（计时在画面上方的绿条） */
  .rcx #mic { width: 32px; height: 28px; padding: 0; justify-content: center; border-radius: 6px; background: none; color: var(--ok); }
  .rcx #mic::after { display: none; }
  .rcx #mic::before { width: 18px; height: 18px; }
  .rcx #mic:hover { background: rgb(255 255 255 / .08); }
  .rcx #mic[aria-pressed="true"] { width: auto; padding: 0 10px; gap: 6px; background: var(--err); color: #fff; }
  .rcx #mic[aria-pressed="true"]::after { display: inline; font-size: 12px; }
  .rcx #mic.wait { background: none; color: var(--fg3); }
  .tools { align-self: flex-start; }
  .qbox { position: relative; padding-top: 4px; }
  .qlabel { gap: 2px; }
  .rcx .qlabel span { color: var(--a); font-weight: 600; }
  .qbox.open .qlabel { background: rgb(39 147 251 / .16); }
  .seg { display: none; position: absolute; left: calc(100% + 14px); top: -6px; width: 168px; padding: 6px; gap: 2px; border: 1px solid var(--line2); border-radius: 8px; background: var(--panel); box-shadow: 0 8px 24px rgb(0 0 0 / .45); z-index: 10; }
  .qbox.open .seg { display: flex; }
  .seg button { height: auto; display: flex; flex-direction: column; align-items: flex-start; gap: 1px; padding: 7px 10px; text-align: left; }
  .seg button b { font-size: 13px; font-weight: 600; }
  .seg small { display: block; font-size: 11px; color: var(--fg3); font-weight: 400; }
  .navpill { margin-top: 10px; }
  .rcx .textbar { width: var(--sw, 360px); padding: 10px 0 0; }
}

.share #mDisc { display: none !important; }

/* =================== 原版界面（天玺电脑端聚焦窗，iframe）=================== */
.appframe { display: none; }
.app-status { display: none; }
.app .appframe { display: block; border: 0; background: transparent; }
.app .win, .app .fab { display: none !important; }
.app .desk { position: relative; }
.app .app-status:not([hidden]) { display: block; position: absolute; left: 50%; top: 40%; transform: translate(-50%, -50%); max-width: min(86%, 420px); padding: 12px 16px; border-radius: 10px; background: rgb(20 20 20 / .92); color: #fff; font-size: 14px; line-height: 1.6; text-align: center; white-space: pre-line; z-index: 3; }
@media (max-width: 899px) {
  .app .view .appbar, .app .vbody > .rail, .app .scrim { display: none !important; }
  .app .desk { padding: 0; background: #f2f3f5; }
  .app .appframe { position: absolute; inset: 0; width: 100%; height: 100%; }
}


/* =================== 登录页：天玺电脑端原版（tx-login.css 提供样式，这里只做网页端适配）=================== */
/* 全屏粒子登录层：显隐交给 .page[hidden]（上面 [hidden]{display:none!important} 已够），.show 只负责进场动画 */
#login.tx-login { color-scheme: dark; }
.tx-login-mark-svg { width: 64%; height: 64%; }
/* rc.js 只写 #loginErr 文本、不加 .show，所以有内容就显示 */
#loginErr.tx-login-msg:not(:empty) { display: block; }
@media (max-width: 899px) {
  /* 手机端那套浅色输入框样式（.rcx input{background:#f5f6f8}）别盖到登录页：登录页是深色粒子层，输入框透明、字白 */
  #login.tx-login .tx-fl-box input { background: transparent; border-color: transparent; }
}
.share #logout { display: none !important; }
.app .app-status.mini:not([hidden]) { left: 12px; top: 52px; transform: none; max-width: 60%; padding: 4px 10px; border-radius: 999px; font-size: 12px; line-height: 1.5; background: rgb(20 20 20 / .7); pointer-events: none; }
.dev .on.lost, .rcx .dev .on.lost { color: var(--warn, #e6a23c); }
