/* 云桥 SSH 界面样式，只引用 tokens.css 中的变量 */
:root { --sidebar-w: 264px; --side-w: 380px; --term-bg: #ffffff; }
:root[data-theme='dark'] { --term-bg: #1c1c1e; }
:root { --sidebar-bg: #fbfbfd; }
:root[data-theme='dark'] { --sidebar-bg: #1c1c1e; }

.hidden { display: none !important; }
.grow { flex: 1; min-width: 0; }
.mono { font-family: var(--mono); }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.btn-ghost { background: transparent; color: var(--primary); }
.btn-ghost:hover { background: var(--primary-soft); }
.btn-danger { background: transparent; color: var(--danger); }
.btn-danger:hover { background: var(--danger-bg); }
.btn-danger-solid { background: var(--danger); color: #fff; }
.btn-danger-solid:hover { background: var(--danger); filter: brightness(1.08); }
.btn:disabled, .icon-btn:disabled { opacity: 0.45; pointer-events: none; }
.icon-btn.sm { width: 26px; height: 26px; }
.icon-btn.on { background: var(--primary-soft); color: var(--primary); }
.card { background: var(--panel); border-radius: var(--r-lg); box-shadow: var(--shadow-card); }
.dot { width: 7px; height: 7px; border-radius: 50%; flex: none; background: var(--text-4); }
.dot.ok { background: var(--success); }
.dot.warn { background: var(--warning); }
.dot.err { background: var(--danger); }
.dot.busy { background: var(--primary); animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.35; } }

/* 分段控件 */
.seg { display: inline-flex; padding: 3px; border-radius: 99px; background: var(--fill); gap: 2px; }
.seg button { height: 26px; padding: 0 14px; border: 0; border-radius: 99px; background: transparent; color: var(--text-2); font-weight: 500; font-size: 12.5px; display: inline-flex; align-items: center; gap: 6px; transition: background 0.15s, color 0.15s; }
.seg button:hover { color: var(--text); }
.seg button.active { background: var(--panel); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12); }
:root[data-theme='dark'] .seg button.active { background: var(--fill-hover); }

/* ---------- 登录页 ---------- */
.auth-page { flex: 1; display: flex; align-items: center; justify-content: center; padding: 16px; }
.auth-card { width: 380px; max-width: 100%; padding: 36px 32px 30px; display: flex; flex-direction: column; gap: 14px; animation: panelUp 0.4s var(--ease-out); }
.auth-card .logo-mark { width: 52px; height: 52px; border-radius: 15px; margin-bottom: 6px; }
.auth-title { font-size: 24px; font-weight: 600; letter-spacing: -0.03em; margin: 0; }
.auth-desc { color: var(--text-2); font-size: 13.5px; line-height: 1.6; margin: -6px 0 6px; }
.auth-card .input { height: 40px; font-size: 14px; }
.auth-card .btn { height: 40px; font-size: 14px; margin-top: 4px; }
.auth-err { color: var(--danger); font-size: 12.5px; min-height: 18px; margin: -4px 0 -6px; }

/* ---------- 顶栏 ---------- */
.titlebar { height: 54px; flex: none; display: flex; align-items: center; gap: 14px; padding: 0 14px; background: var(--bg); }
.brand { display: flex; align-items: center; gap: 10px; flex: none; }
.logo-mark { width: 30px; height: 30px; border-radius: 9px; background: var(--ink); color: var(--ink-text); display: flex; align-items: center; justify-content: center; }
.brand-name { font-size: 15px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.15; }
.brand-sub { font-size: 11px; color: var(--text-3); }
.tabs { flex: 1; min-width: 0; display: flex; }
.tabs-track { display: flex; gap: 2px; padding: 3px; border-radius: 99px; background: var(--fill); overflow-x: auto; scrollbar-width: none; max-width: 100%; }
.tabs-track::-webkit-scrollbar { display: none; }
.tab { height: 30px; display: inline-flex; align-items: center; gap: 7px; padding: 0 6px 0 12px; border: 0; border-radius: 99px; background: transparent; color: var(--text-2); font-weight: 500; white-space: nowrap; max-width: 220px; flex: none; transition: background 0.15s, color 0.15s; animation: tabIn 0.28s var(--spring); }
.tab.home { padding: 0 12px; }
.tab:hover { color: var(--text); }
.tab.active { background: var(--panel); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12); }
:root[data-theme='dark'] .tab.active { background: var(--fill-hover); }
.tab-label { overflow: hidden; text-overflow: ellipsis; }
.tab-x { width: 20px; height: 20px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: var(--text-3); opacity: 0.7; }
.tab-x:hover { background: var(--hover); color: var(--text); opacity: 1; }
@keyframes tabIn { from { transform: scale(0.85); opacity: 0; } }
.tb-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.tb-round { width: 34px; height: 34px; border: 0; border-radius: 50%; background: var(--panel); box-shadow: var(--shadow-card); color: var(--text-2); display: inline-flex; align-items: center; justify-content: center; transition: box-shadow 0.2s, color 0.15s, transform 0.15s; }
.tb-round:hover { box-shadow: var(--shadow-lift); color: var(--text); }
.tb-round:active { transform: scale(0.94); }
.menu-toggle { display: none; }

/* ---------- 主体 ---------- */
.body { flex: 1; min-height: 0; display: flex; gap: 12px; padding: 0 12px 12px; }
.sidebar { width: var(--sidebar-w); flex: none; display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.sb-head { padding: 14px 14px 8px; display: flex; flex-direction: column; gap: 10px; }
.sb-title-row { display: flex; align-items: center; justify-content: space-between; }
.sb-title { font-size: 17px; font-weight: 600; letter-spacing: -0.02em; }
.search { position: relative; }
.search .ico { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.search .input { width: 100%; padding-left: 32px; background: var(--panel-2); border-color: transparent; }
.search .input:focus { background: var(--panel); }
.sb-list { flex: 1; overflow-y: auto; padding: 4px 8px 10px; }
.group-head { display: flex; align-items: center; gap: 4px; height: 28px; padding: 0 6px; margin-top: 6px; font-size: 12px; font-weight: 500; color: var(--text-3); cursor: pointer; user-select: none; border-radius: 8px; }
.group-head:hover { color: var(--text-2); }
.group-head .ico { transition: transform 0.2s var(--ease-out); }
.group-head.collapsed .ico { transform: rotate(-90deg); }
.group-count { margin-left: auto; font-variant-numeric: tabular-nums; }
.host-row { display: flex; align-items: center; gap: 10px; height: 46px; padding: 0 6px 0 8px; border-radius: 12px; cursor: pointer; user-select: none; transition: background 0.12s; }
.host-row:hover { background: var(--hover); }
.host-row.active { background: var(--primary-soft); }
.host-ico { width: 30px; height: 30px; border-radius: 9px; background: var(--fill); color: var(--text-2); display: flex; align-items: center; justify-content: center; flex: none; position: relative; }
.host-row.online .host-ico { background: var(--primary); color: #fff; }
.host-meta { flex: 1; min-width: 0; }
.host-name { font-size: 13.5px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.host-sub { font-size: 11.5px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.host-row .icon-btn { opacity: 0; }
.host-row:hover .icon-btn { opacity: 1; }
.sb-empty { padding: 30px 16px; text-align: center; color: var(--text-3); font-size: 13px; line-height: 1.7; }
.sb-foot { padding: 10px 12px 12px; border-top: 1px solid var(--line); }
.quick { display: flex; gap: 6px; }
.quick .input { flex: 1; min-width: 0; height: 30px; font-size: 12.5px; font-family: var(--mono); }
.sb-hint { font-size: 11px; color: var(--text-3); margin-top: 6px; }

.workspace { flex: 1; min-width: 0; position: relative; }
.view { position: absolute; inset: 0; display: none; }
.view.active { display: flex; }

/* ---------- 主页 ---------- */
.home-view { flex-direction: column; overflow-y: auto; padding: 26px 18px 30px; }
.home-hello { font-size: 17px; font-weight: 500; color: var(--text-2); }
.home-title { font-size: clamp(28px, 4vw, 42px); font-weight: 600; letter-spacing: -0.03em; margin: 6px 0 8px; line-height: 1.15; }
.home-title em { font-style: normal; color: var(--primary); }
.home-desc { font-size: 14.5px; color: var(--text-2); max-width: 620px; line-height: 1.65; margin: 0 0 22px; }
.home-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 30px; }
.home-actions .btn { height: 38px; padding: 0 20px; font-size: 14px; }
.sec-label { font-size: 11px; font-weight: 600; letter-spacing: 0.12em; color: var(--text-3); text-transform: uppercase; }
.sec-title { font-size: 20px; font-weight: 600; letter-spacing: -0.02em; margin: 2px 0 14px; }
.host-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.host-card { padding: 18px; display: flex; flex-direction: column; gap: 14px; cursor: pointer; transition: transform 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out); animation: riseIn 0.4s var(--ease-out) both; }
.host-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); }
.hc-top { display: flex; align-items: center; gap: 12px; }
.hc-ico { width: 42px; height: 42px; border-radius: 12px; background: var(--ink); color: var(--ink-text); display: flex; align-items: center; justify-content: center; flex: none; }
.hc-name { font-size: 15.5px; font-weight: 600; letter-spacing: -0.02em; }
.hc-addr { font-size: 12px; color: var(--text-3); font-family: var(--mono); }
.hc-foot { display: flex; align-items: center; justify-content: space-between; font-size: 12px; color: var(--text-3); }
.hc-go { width: 30px; height: 30px; border-radius: 50%; background: var(--fill); color: var(--text-2); display: flex; align-items: center; justify-content: center; transition: background 0.2s, color 0.2s, transform 0.3s var(--spring); }
.host-card:hover .hc-go { background: var(--primary); color: #fff; transform: translateX(2px); }
.host-card.add { align-items: center; justify-content: center; color: var(--text-3); min-height: 132px; gap: 8px; font-weight: 500; box-shadow: none; background: transparent; border: 1.5px dashed var(--line-strong); }
.host-card.add:hover { color: var(--primary); border-color: var(--primary); background: var(--primary-soft); box-shadow: none; }
.features { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; margin-top: 34px; }
.feature { padding: 18px; }
.feature .fi { width: 34px; height: 34px; border-radius: 10px; background: var(--primary-soft); color: var(--primary); display: flex; align-items: center; justify-content: center; margin-bottom: 12px; }
.feature b { display: block; font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.feature span { font-size: 12.5px; color: var(--text-2); line-height: 1.6; }

/* ---------- 会话视图 ---------- */
.session-view { gap: 0; }
.term-card { flex: 1; min-width: 0; display: flex; flex-direction: column; overflow: hidden; background: var(--term-bg); }
.term-bar { height: 42px; flex: none; display: flex; align-items: center; gap: 8px; padding: 0 8px 0 16px; border-bottom: 1px solid var(--line); }
.term-title { font-weight: 600; font-size: 13.5px; letter-spacing: -0.01em; }
.term-sub { font-size: 12px; color: var(--text-3); font-family: var(--mono); }
.term-state { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; color: var(--text-2); }
.term-tools { display: flex; align-items: center; gap: 2px; margin-left: auto; }
.term-host { flex: 1; min-height: 0; position: relative; padding: 8px 4px 6px 14px; }
/* 终端内不能继承 body 的字距，否则 xterm 测量字符宽度会偏小，导致最右一列被裁掉 */
.term-inner { width: 100%; height: 100%; overflow: hidden; letter-spacing: 0; }
.term-host .xterm { height: 100%; }
.term-host .xterm-viewport { background: transparent !important; }
.term-overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: var(--term-bg); z-index: 5; animation: fadeIn 0.2s; }
.term-overlay.dim { background: color-mix(in srgb, var(--term-bg) 78%, transparent); backdrop-filter: blur(2px); }
.ov-card { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; max-width: 420px; padding: 20px; }
.ov-ico { width: 48px; height: 48px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--primary-soft); color: var(--primary); }
.ov-ico.danger { background: var(--danger-bg); color: var(--danger); }
.ov-ico.warn { background: var(--warning-bg); color: var(--warning); }
.ov-title { font-size: 17px; font-weight: 600; letter-spacing: -0.02em; }
.ov-msg { font-size: 13px; color: var(--text-2); line-height: 1.65; word-break: break-word; }
.ov-fp { font-family: var(--mono); font-size: 11.5px; background: var(--panel-2); padding: 8px 12px; border-radius: 10px; text-align: left; line-height: 1.7; color: var(--text-2); word-break: break-all; }
.ov-actions { display: flex; gap: 10px; margin-top: 4px; }
.search-bar { position: absolute; top: 8px; right: 14px; z-index: 6; display: flex; align-items: center; gap: 4px; padding: 4px 4px 4px 10px; background: var(--panel); border-radius: 99px; box-shadow: var(--shadow-pop); animation: popIn 0.18s ease-out; }
.search-bar input { border: 0; outline: none; background: transparent; width: 180px; height: 26px; }

.resizer { width: 12px; flex: none; cursor: col-resize; position: relative; }
.resizer::after { content: ''; position: absolute; left: 5px; top: 50%; width: 2px; height: 36px; margin-top: -18px; border-radius: 2px; background: var(--line-strong); opacity: 0; transition: opacity 0.2s; }
.resizer:hover::after, .resizer.dragging::after { opacity: 1; }
.side { width: var(--side-w); flex: none; display: flex; flex-direction: column; min-height: 0; overflow: hidden; container-type: inline-size; }
.side-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 10px 8px 12px; }
.side-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.pane { flex: 1; min-height: 0; display: none; flex-direction: column; }
.pane.active { display: flex; }
.session-view.side-closed .side, .session-view.side-closed .resizer { display: none; }

/* 文件 */
.fs-bar { display: flex; align-items: center; gap: 2px; padding: 0 8px 8px 10px; }
.fs-path { flex: 1; min-width: 0; height: 30px; font-family: var(--mono); font-size: 12px; background: var(--panel-2); border-color: transparent; }
.fs-path:focus { background: var(--panel); }
.fs-tools { display: flex; align-items: center; gap: 2px; padding: 0 8px 6px; }
.fs-head, .fs-row { display: grid; grid-template-columns: 22px minmax(0, 1fr) 70px 104px; align-items: center; gap: 8px; padding: 0 10px; }
.fs-head { height: 26px; font-size: 11.5px; font-weight: 500; color: var(--text-3); border-bottom: 1px solid var(--line); margin: 0 6px; padding: 0 4px; user-select: none; }
.fs-head span { cursor: pointer; }
.fs-head span:hover { color: var(--text-2); }
.fs-head .num, .fs-row .num { text-align: right; font-variant-numeric: tabular-nums; }
.fs-list { flex: 1; overflow-y: auto; padding: 4px 6px 8px; position: relative; outline: none; }
.fs-row { height: 32px; border-radius: 8px; padding: 0 4px; cursor: default; user-select: none; font-size: 12.5px; }
.fs-row:hover { background: var(--hover); }
.fs-row.sel { background: var(--primary-soft); }
.fs-row .fi { color: var(--text-3); display: flex; }
.fs-row.dir .fi { color: var(--primary); }
.fs-row .num { color: var(--text-3); font-size: 11.5px; }
.fs-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fs-row.hidden-file .fs-name { color: var(--text-3); }
.fs-link { color: var(--text-3); font-size: 11px; margin-left: 4px; }
.fs-list.drop { box-shadow: inset 0 0 0 2px var(--primary); border-radius: 12px; background: var(--primary-soft); }
.fs-empty { padding: 40px 10px; text-align: center; color: var(--text-3); display: flex; flex-direction: column; align-items: center; gap: 10px; }
.fs-empty .ico { opacity: 0.6; }
.fs-status { padding: 6px 14px 10px; font-size: 11.5px; color: var(--text-3); display: flex; justify-content: space-between; border-top: 1px solid var(--line); }
@container (max-width: 340px) {
  .fs-head, .fs-row { grid-template-columns: 22px minmax(0, 1fr) 64px; }
  .fs-head .col-time, .fs-row .col-time { display: none; }
}
.transfers { border-top: 1px solid var(--line); max-height: 168px; overflow-y: auto; padding: 6px 12px; }
.tf { display: grid; grid-template-columns: 1fr auto; gap: 4px 8px; align-items: center; padding: 5px 0; font-size: 12px; }
.tf-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tf-pct { color: var(--text-3); font-variant-numeric: tabular-nums; font-size: 11.5px; }
.tf .bar { grid-column: 1 / -1; }
.tf.done .tf-pct { color: var(--success); }
.tf.fail .tf-pct { color: var(--danger); }

/* 进度条 */
.bar { height: 6px; border-radius: 6px; background: var(--fill); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 6px; background: var(--primary); width: 0; transition: width 0.5s var(--ease-out); }
.bar.warn > i { background: var(--warning); }
.bar.danger > i { background: var(--danger); }

/* 监控 */
.mon { flex: 1; overflow-y: auto; padding: 2px 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.mon-block { background: var(--panel-2); border-radius: 14px; padding: 12px 14px; }
.mon-sys { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: 12px; }
.mon-sys dt { color: var(--text-3); }
.mon-sys dd { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mon-row { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 8px; }
.mon-label { font-size: 12px; font-weight: 500; color: var(--text-2); display: flex; align-items: center; gap: 6px; }
.mon-val { font-size: 22px; font-weight: 600; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.mon-val small { font-size: 12px; font-weight: 500; color: var(--text-3); letter-spacing: 0; margin-left: 2px; }
.mon-note { font-size: 11.5px; color: var(--text-3); margin-top: 6px; font-variant-numeric: tabular-nums; display: flex; justify-content: space-between; gap: 8px; }
.spark { display: block; width: 100%; height: 38px; margin-top: 8px; }
.spark path.area { fill: var(--primary-soft); stroke: none; }
.spark path.line { fill: none; stroke: var(--primary); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.spark path.line2 { fill: none; stroke: var(--text-3); stroke-width: 1.25; stroke-dasharray: 3 3; vector-effect: non-scaling-stroke; }
.mon-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.net-legend { display: flex; gap: 14px; font-size: 12px; font-variant-numeric: tabular-nums; }
.net-legend span { display: inline-flex; align-items: center; gap: 4px; }
.disk { margin-top: 10px; }
.disk:first-of-type { margin-top: 0; }
.disk-top { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 5px; gap: 8px; }
.disk-top span:last-child { color: var(--text-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.proc-table { width: 100%; border-collapse: collapse; font-size: 12px; font-variant-numeric: tabular-nums; table-layout: fixed; }
.proc-table th { text-align: left; font-weight: 500; color: var(--text-3); padding: 0 0 6px; font-size: 11.5px; }
.proc-table td { padding: 4px 0; border-top: 1px solid var(--line); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.proc-table .r { text-align: right; }
.proc-table tr .icon-btn { opacity: 0; width: 22px; height: 22px; }
.proc-table tr:hover .icon-btn { opacity: 1; }
.mon-msg { padding: 40px 16px; text-align: center; color: var(--text-3); line-height: 1.7; }

/* 快捷命令 */
.cmds { flex: 1; overflow-y: auto; padding: 0 8px 8px; }
.cmd-item { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 10px; border-radius: 12px; cursor: pointer; transition: background 0.12s; }
.cmd-item:hover { background: var(--hover); }
.cmd-item .cmd-ico { width: 28px; height: 28px; border-radius: 8px; background: var(--fill); color: var(--text-2); display: flex; align-items: center; justify-content: center; flex: none; transition: background 0.15s, color 0.15s; }
.cmd-item:hover .cmd-ico { background: var(--primary); color: #fff; }
.cmd-name { font-size: 13px; font-weight: 500; }
.cmd-code { font-family: var(--mono); font-size: 11.5px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmd-item .icon-btn { opacity: 0; }
.cmd-item:hover .icon-btn { opacity: 1; }
.cmd-compose { border-top: 1px solid var(--line); padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 8px; }
.cmd-compose textarea { width: 100%; min-height: 64px; max-height: 200px; font-family: var(--mono); font-size: 12.5px; resize: vertical; }
.cmd-compose-row { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-2); }
.cmd-compose-row .btn { margin-left: auto; }

/* 弹窗表单 */
.modal { width: 480px; }
.modal.wide { width: 980px; height: 86vh; }
.modal .form-row .form-label { width: 76px; }
.form-row.top { align-items: flex-start; }
.form-row.top .form-label { padding-top: 7px; }
.form-hint { font-size: 12px; color: var(--text-3); margin: -4px 0 0 88px; line-height: 1.6; }
.form-err { color: var(--danger); font-size: 12.5px; min-height: 0; }
.form-ok { color: var(--success); font-size: 12.5px; }
.field-with-btn { flex: 1; display: flex; gap: 6px; min-width: 0; }
.field-with-btn .input { flex: 1; min-width: 0; }
.input.mono-sm { font-family: var(--mono); font-size: 12px; }
.modal-footer.split { justify-content: space-between; align-items: center; }
.modal-footer .left { display: flex; align-items: center; gap: 10px; min-width: 0; font-size: 12.5px; }
.modal-footer .right { display: flex; gap: 10px; }
.confirm { width: 380px; text-align: center; padding: 26px 24px 20px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.confirm .ov-msg { white-space: pre-wrap; }
.confirm-btns { display: flex; gap: 10px; width: 100%; margin-top: 10px; }
.confirm-btns .btn { flex: 1; height: 36px; }
.editor-body { flex: 1; min-height: 0; padding: 0 16px; display: flex; }
.editor-area { flex: 1; width: 100%; resize: none; border: 0; outline: none; border-radius: 12px; background: var(--panel-2); padding: 14px 16px; font-family: var(--mono); font-size: 13px; line-height: 1.6; tab-size: 4; white-space: pre; overflow: auto; color: var(--text); }
.editor-path { font-family: var(--mono); font-size: 12px; color: var(--text-3); font-weight: 400; margin-left: 10px; letter-spacing: 0; }
.perm-grid { display: grid; grid-template-columns: auto repeat(3, 1fr); gap: 8px 14px; align-items: center; font-size: 13px; }
.perm-grid .h { color: var(--text-3); font-size: 12px; font-weight: 500; }

/* 设置 */
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 40px; }
.set-row + .set-row { border-top: 1px solid var(--line); }
.set-label b { display: block; font-weight: 500; font-size: 13.5px; }
.set-label span { font-size: 12px; color: var(--text-3); }
.switch { position: relative; width: 40px; height: 24px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch i { position: absolute; inset: 0; border-radius: 99px; background: var(--fill-hover); transition: background 0.2s; cursor: pointer; }
.switch i::after { content: ''; position: absolute; left: 2px; top: 2px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2); transition: transform 0.25s var(--spring); }
.switch input:checked + i { background: var(--success); }
.switch input:checked + i::after { transform: translateX(16px); }

/* 窄屏 */
@media (max-width: 960px) {
  :root { --side-w: 320px; }
}
@media (max-width: 760px) {
  .body { padding: 0 8px 8px; gap: 8px; }
  .titlebar { padding: 0 10px; gap: 8px; }
  .brand-text { display: none; }
  .menu-toggle { display: inline-flex; }
  .sidebar { position: fixed; z-index: 1500; left: 8px; top: 62px; bottom: 8px; width: min(300px, calc(100vw - 16px)); box-shadow: var(--shadow); transform: translateX(-110%); transition: transform 0.3s var(--ease-out); }
  .sidebar.open { transform: none; }
  .session-view { flex-direction: column; }
  .resizer { display: none; }
  .side { position: absolute; inset: auto 0 0 0; width: auto !important; height: 60%; z-index: 8; box-shadow: var(--shadow); }
  .tb-actions .hide-sm { display: none; }
  .home-view { padding: 18px 8px 24px; }
  .term-sub { display: none; }
}
