:root {
  --bg: #f6f7f9;
  --panel: #ffffff;
  --text: #1f2329;
  --muted: #646a73;
  --line: #e4e6ea;
  --line-strong: #d0d3d9;
  --primary: #3370ff;
  --primary-text: #ffffff;
  --danger: #e5484d;
  --warn: #d97706;
  --ok: #16a34a;
  --today: rgba(51, 112, 255, 0.09);
  --bar-bg-s: 52%;
  --bar-bg-l: 90%;
  --bar-fg-s: 38%;
  --bar-fg-l: 26%;
  --bar-bd-s: 48%;
  --bar-bd-l: 40%;
  --weekend: rgba(0, 0, 0, 0.025);
  --hover: rgba(51, 112, 255, 0.10);
  --radius: 8px;
  --radius-card: 12px;
  --faint: #8f959e;
  --primary-soft: rgba(51, 112, 255, 0.09);
  --ok-soft: rgba(22, 163, 74, 0.11);
  --warn-soft: rgba(217, 119, 6, 0.12);
  --danger-soft: rgba(229, 72, 77, 0.10);
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 3px rgba(16, 24, 40, .03);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #17181b;
    --panel: #1f2125;
    --text: #e6e8eb;
    --muted: #9ba1aa;
    --line: #2d3036;
    --line-strong: #3a3e45;
    --primary: #4c84ff;
    --today: rgba(76, 132, 255, 0.16);
    --bar-bg-s: 26%;
    --bar-bg-l: 26%;
    --bar-fg-s: 55%;
    --bar-fg-l: 86%;
    --bar-bd-s: 55%;
    --bar-bd-l: 64%;
    --weekend: rgba(255, 255, 255, 0.025);
    --hover: rgba(76, 132, 255, 0.16);
    --faint: #747a84;
    --primary-soft: rgba(76, 132, 255, 0.15);
    --shadow: none;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
}
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.error { color: var(--danger); min-height: 1em; margin: 0; white-space: pre-wrap; }
code, pre, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }
pre { background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; overflow-x: auto; white-space: pre-wrap; word-break: break-all; }
h1, h2 { margin: 0 0 12px; }
h2 { font-size: 16px; }

/* 按钮 & 表单 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  height: 32px; padding: 0 12px; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--line-strong); background: var(--panel); color: var(--text);
  font: inherit; text-decoration: none; white-space: nowrap;
}
.btn:hover { border-color: var(--primary); color: var(--primary); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-text); }
.btn.primary:hover { filter: brightness(1.08); color: var(--primary-text); }
.btn.danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 45%, var(--line)); }
.btn.danger:hover { background: var(--danger-soft); border-color: var(--danger); color: var(--danger); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost.icon { color: var(--muted); }
.btn.ghost:hover { background: var(--primary-soft); }
.btn.ghost.danger-ghost:hover { background: var(--danger-soft); color: var(--danger); }
.btn.small { height: 28px; padding: 0 10px; font-size: 12.5px; border-radius: 7px; }
.btn.icon { width: 28px; padding: 0; }
.btn.block { width: 100%; }
.btn.big { height: 44px; padding: 0 28px; font-size: 16px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
input, select, textarea {
  font: inherit; color: var(--text); background: var(--panel);
  border: 1px solid var(--line-strong); border-radius: 6px; padding: 6px 8px; min-height: 32px; width: 100%;
}
/* 下拉框：自绘向下箭头，离右边框留出一点距离 */
select {
  appearance: none; -webkit-appearance: none; padding-right: 32px; background-repeat: no-repeat; background-position: right 12px center; background-size: 10px 6px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%238b93a1' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--primary); outline-offset: -1px; border-color: transparent; }
label { display: flex; flex-direction: column; gap: 4px; color: var(--muted); font-size: 13px; }
label > input, label > select, label > textarea { color: var(--text); font-size: 14px; }
.label { color: var(--muted); font-size: 13px; margin-bottom: 4px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: end; }
/* 两列里标签文字行数不同（一个两行一个一行）时，让输入框底部对齐 */
.two > label { justify-content: space-between; }
.group { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.actions { display: flex; justify-content: flex-end; gap: 8px; align-items: center; }
.spacer { flex: 1; }
.row-form { display: grid; grid-template-columns: 1fr 1fr 1.5fr auto; gap: 8px; margin-top: 12px; }

/* 登录 */
.login {
  min-height: 100vh; display: grid; place-items: center; padding: 24px 16px;
  background:
    radial-gradient(900px 480px at 15% -10%, rgba(51, 112, 255, 0.14), transparent 60%),
    radial-gradient(700px 420px at 100% 110%, rgba(51, 112, 255, 0.10), transparent 60%),
    var(--bg);
}
.login-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 36px 32px 24px;
  text-align: center; width: 100%; max-width: 380px; box-shadow: 0 10px 40px rgba(31, 35, 41, 0.08);
}
.login-head { margin-bottom: 20px; }
.login-logo { width: 64px; height: 64px; margin-bottom: 10px; }
.login-head h1 { margin: 0 0 6px; font-size: 22px; letter-spacing: 0.5px; }
.login-head p { margin: 0; font-size: 13px; }
.qr-box {
  position: relative; width: 250px; height: 250px; margin: 0 auto; border-radius: 12px; overflow: hidden;
  background: #fff; border: 1px solid var(--line); display: grid; place-items: center;
}
.qr-box iframe { border: 0; display: block; width: 250px; height: 250px; }
.qr-tip { margin: 12px 0 0; font-size: 14px; color: var(--muted); }
.qr-tip b { color: var(--text); }
.login-or { display: flex; align-items: center; gap: 12px; margin: 18px 0 14px; color: var(--muted); font-size: 12px; }
.login-or::before, .login-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.login-btn { display: flex; align-items: center; justify-content: center; width: 100%; box-sizing: border-box; height: 42px; font-size: 14px; padding: 0 16px; }
.login-foot { margin: 22px 0 0; }
.dev-login { margin-top: 24px; display: flex; flex-direction: column; gap: 8px; }

/* 顶栏 */
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 16px;
  padding: 0 16px; height: 52px; background: var(--panel); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.brand-logo { width: 34px; height: 34px; flex: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text span { font-weight: 600; font-size: 15px; }
.brand-text small { font-size: 11px; color: var(--muted); letter-spacing: .08em; }
.tabs { display: flex; gap: 4px; flex: 1; overflow-x: auto; }
.tabs button { border: 0; background: none; color: var(--muted); font: inherit; padding: 6px 12px; border-radius: 6px; cursor: pointer; white-space: nowrap; }
.tabs button.active { color: var(--primary); background: var(--hover); font-weight: 500; }
.me { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.banner { background: #fff7e6; color: #8a5300; border-bottom: 1px solid #ffe2b3; padding: 8px 16px; font-size: 13px; }
@media (prefers-color-scheme: dark) { .banner { background: #2e2410; color: #f5c46b; border-color: #4a3a17; } }
.banner a { color: inherit; font-weight: 600; }
.banner a.link-blue { color: var(--primary); text-decoration: underline; }
.banner.warn { background: #fdecec; color: #a3262b; border-color: #f6caca; }
@media (prefers-color-scheme: dark) { .banner.warn { background: #3a1517; color: #f5a3a6; border-color: #5a2326; } }
main { padding: 16px; max-width: 1600px; margin: 0 auto; }

/* 日历 */
.toolbar { display: flex; align-items: center; gap: 14px 20px; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .spacer { flex: 1; }
.nav-group { display: inline-flex; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); padding: 3px; position: relative; }
.nav-group .btn { border: 0; height: 30px; border-radius: 7px; background: none; color: var(--text); }
.nav-group .btn:hover { background: var(--primary-soft); color: var(--primary); }
.nav-group .btn.icon { width: 32px; }
.month-btn { min-width: 128px; font-weight: 600; font-size: 15px; gap: 8px; }
.month-btn svg.i { color: var(--faint); width: 14px; height: 14px; }
.pop { position: absolute; z-index: 40; top: 46px; left: 0; width: 280px; background: var(--panel); border: 1px solid var(--line-strong); border-radius: 12px; box-shadow: 0 10px 36px rgba(0, 0, 0, .16); padding: 12px; }
.pop-year { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; font-weight: 600; }
.month-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.month-grid .btn { border: 0; height: 34px; background: none; }
.month-grid .btn:hover { background: var(--primary-soft); color: var(--primary); }
.month-grid .btn.primary { background: var(--primary); color: #fff; }
.pop-foot { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; }
.pop-foot .btn { border-color: var(--line-strong); }
.pop-foot .btn.ghost { border-color: transparent; }
.legend { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; color: var(--muted); font-size: 12.5px; }
.legend i { display: inline-block; vertical-align: -3px; width: 22px; height: 14px; border-radius: 4px; margin-right: 6px; box-sizing: border-box; }
.lg-mine { background: hsl(215 52% 90%); border: 2px solid hsl(215 48% 40%); }
.lg-other { background: hsl(215 52% 90%); }
@media (prefers-color-scheme: dark) { .lg-mine { background: hsl(215 26% 26%); border-color: hsl(215 55% 64%); } .lg-other { background: hsl(215 26% 26%); } }
.legend svg.i { width: 14px; height: 14px; vertical-align: -3px; margin-right: 4px; }
.hint { color: var(--faint); font-size: 12.5px; margin: -6px 2px 10px; }
.cal-wrap { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-card); box-shadow: var(--shadow); overflow-x: auto; }
.calendar { --label-w: 250px; --col-w: 28px; --row-h: 58px; min-width: calc(var(--label-w) + var(--days) * var(--col-w)); }
.cal-row { display: flex; }
.cal-label { position: sticky; left: 0; z-index: 4; width: var(--label-w); flex: 0 0 var(--label-w); background: var(--panel); border-right: 1px solid var(--line); padding: 8px 14px; display: flex; flex-direction: column; justify-content: center; min-width: 0; }
/* 一张卡的所有预约共用一行：行高固定，同一天有几个人就把行高平分成几条“车道” */
.cal-track { flex: 1; display: grid; grid-template-columns: repeat(var(--days), minmax(var(--col-w), 1fr)); grid-template-rows: repeat(var(--lanes, 1), minmax(0, 1fr)); position: relative; min-width: 0; }
.cal-cell { grid-row: 1 / -1; border-right: 1px solid var(--line); }
.cal-cell:last-child { border-right: 0; }
.cal-cell.mon { border-left: 1px solid var(--line-strong); }
.cal-cell.weekend { background: var(--weekend); }
.cal-gpu .cal-cell:not(.past) { cursor: pointer; position: relative; }
.cal-gpu .cal-cell:not(.past):hover { background: var(--primary-soft); }
.cal-gpu .cal-cell:not(.past):hover::after { content: "+"; position: absolute; inset: 0; display: grid; place-items: center; color: var(--primary); font-size: 18px; font-weight: 300; }
/* 已过去的日期：同一台服务器的所有显卡行共用一层斜线（每格 / 每行各画一份花纹会在边界错位）；今天这一列盖在预约色块上面，不挡点击 */
.cal-body { position: relative; }
.past-zone { position: absolute; left: var(--label-w); top: 0; bottom: 0; z-index: 1; pointer-events: none; background-image: repeating-linear-gradient(135deg, transparent 0 5px, color-mix(in srgb, var(--line-strong) 75%, transparent) 5px 6.5px); }
.today-zone { grid-row: 1 / -1; z-index: 3; pointer-events: none; background: var(--today); box-shadow: inset 1px 0 0 color-mix(in srgb, var(--primary) 40%, transparent), inset -1px 0 0 color-mix(in srgb, var(--primary) 40%, transparent); }

.cal-head { border-bottom: 1px solid var(--line-strong); }
.cal-head .cal-label { color: var(--faint); font-size: 12px; justify-content: flex-end; }
.cal-head .cal-cell { text-align: center; padding: 6px 0 5px; line-height: 1.2; color: var(--faint); }
.cal-head .cal-cell b { display: inline-grid; place-items: center; min-width: 24px; height: 24px; padding: 0 2px; border-radius: 12px; font-size: 13.5px; font-weight: 500; color: var(--text); }
.cal-head .cal-cell small { display: block; font-size: 10.5px; margin-top: 1px; }
.cal-head .cal-cell.weekend b, .cal-head .cal-cell.weekend small { color: var(--faint); }
.cal-head .cal-cell.today { background: var(--today); }
.cal-head .cal-cell.today b { background: var(--primary); color: #fff; font-weight: 600; }
.cal-head .cal-cell.today small { color: var(--primary); font-weight: 500; }

/* 服务器分组：点击服务器行折叠 / 展开，GPU 行用 grid-template-rows 0fr↔1fr 做高度动画（overflow: clip 不影响左列的 sticky） */
.cal-server-group { border-bottom: 1px solid var(--line-strong); }
.cal-server-group:last-child { border-bottom: 0; }
.cal-server { position: relative; z-index: 2; background: color-mix(in srgb, var(--bg) 60%, var(--panel)); min-height: 46px; user-select: none; }  /* z-index：盖住下面那一整块斜线 */
.cal-server > .cal-label { cursor: pointer; background: color-mix(in srgb, var(--bg) 60%, var(--panel)); padding: 9px 14px; }
.cal-server > .cal-label:hover { filter: brightness(.975); }
.cal-server:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
.srv-body { display: grid; grid-template-rows: 1fr; transition: grid-template-rows .28s ease; border-top: 1px solid var(--line); }
.srv-inner { position: relative; min-height: 0; overflow: clip; transition: opacity .2s ease; }
.collapsed .srv-body { grid-template-rows: 0fr; border-top-color: transparent; }
.collapsed .srv-inner { opacity: 0; }
.srv-title { display: flex; align-items: center; gap: 8px; min-width: 0; }
svg.i.chev { width: 14px; height: 14px; color: var(--faint); transition: transform .25s; flex: none; }
.collapsed svg.i.chev { transform: rotate(-90deg); }
.server-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.srv-host { display: flex; align-items: center; gap: 8px; min-width: 0; padding-left: 36px; color: var(--faint); font-size: 12px; margin-top: 1px; white-space: nowrap; }
.srv-free { font-size: 11.5px; padding: 0 7px; border-radius: 999px; line-height: 18px; background: var(--ok-soft); color: var(--ok); font-weight: 500; font-family: inherit; }
.srv-free.none { background: var(--line); color: var(--muted); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); flex: none; }
.dot.on { background: var(--ok); }

/* 服务器行里的整机资源：不加背景框，进度条按占用率变色（>=70% 橙、>=90% 红），数字保持黑色 */
.srv-stats { grid-column: 1 / -1; display: flex; align-items: center; gap: 28px; padding: 0 18px; overflow: hidden; white-space: nowrap; }
.stat-chip { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.stat-chip b { color: var(--text); font-weight: 500; }
.stat-chip.mid .meter i { background: var(--warn); }
.stat-chip.hot .meter i { background: var(--danger); }
.offline-tag { color: var(--faint); font-size: 12.5px; }
.meter { width: 46px; height: 5px; border-radius: 3px; background: var(--line); overflow: hidden; flex: none; }
.meter i { display: block; height: 100%; background: var(--primary); border-radius: 3px; }
.meter.mid i { background: var(--warn); }
.meter.hot i { background: var(--danger); }
/* 蓝色链接：悬停显示气泡，点击后固定（见 app.js 的悬停提示） */
.bubble-link { color: var(--primary); cursor: pointer; }
.bubble-link:hover { text-decoration: underline; }

/* GPU 行：所有行同高、左列同宽 */
.cal-gpu { height: var(--row-h); border-top: 1px solid var(--line); }
.srv-inner .cal-gpu:first-child { border-top: 0; }
.gpu-label { position: sticky; padding-left: 36px; gap: 3px; }
.gpu-l1 { display: flex; align-items: baseline; gap: 6px; min-width: 0; padding-right: 50px; white-space: nowrap; overflow: hidden; }
.gpu-l1 b { font-size: 13.5px; }
.gpu-l1 span { color: var(--faint); font-size: 12px; overflow: hidden; text-overflow: ellipsis; }
.gpu-l2 { display: flex; align-items: center; gap: 7px; font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.gpu-l2 .meter { width: 40px; }
.gpu-extra { position: absolute; right: 12px; top: 8px; bottom: 8px; display: flex; flex-direction: column; align-items: flex-end; justify-content: space-between; }
.gpu-detail { font-size: 12px; }
.gpu-free { position: absolute; left: 14px; top: 50%; width: 8px; height: 8px; margin-top: -4px; border-radius: 50%; background: var(--line-strong); }
.gpu-free.free { background: var(--ok); }
.gpu-free.part { background: linear-gradient(90deg, var(--ok) 50%, var(--line-strong) 50%); }  /* 有人预约、还能共用 */
/* “?” 提示 */
.help { display: inline-flex; align-items: center; justify-content: center; width: 15px; height: 15px; margin-left: 4px; border-radius: 50%; border: 1px solid var(--line-strong); color: var(--muted); font-size: 11px; font-weight: 400; cursor: help; vertical-align: 1px; }
.help:hover { color: var(--primary); border-color: var(--primary); }
.alert-ico { display: inline-flex; align-items: center; flex: none; color: var(--warn); cursor: help; }

/* 预约色块：所有人用同一套柔和配色（只有色相不同）；我的预约 = 加粗边框，其他人没有边框；已结束的部分变淡 */
.bar {
  --h: 215; z-index: 2; margin: 4px 2px; border-radius: 7px; border: 2px solid transparent; padding: 0 8px; cursor: pointer;
  display: flex; align-items: center; gap: 6px; min-width: 0; overflow: hidden; white-space: nowrap; font-size: 12.5px; line-height: 1.25;
  background: hsl(var(--h) var(--bar-bg-s) var(--bar-bg-l)); color: hsl(var(--h) var(--bar-fg-s) var(--bar-fg-l)); transition: filter .12s;
}
.bar:hover { filter: brightness(.96); }
.bar { position: relative; }
/* 右边缘的拖拽把手：悬停在色块上时出现，按住左右拖动改结束日期 */
.bar.has-r { padding-right: 14px; }
.bar.has-l { padding-left: 14px; }
.resize-handle { position: absolute; top: 0; bottom: 0; width: 12px; cursor: ew-resize; display: none; touch-action: none; }
.resize-handle.r { right: 0; }
.resize-handle.l { left: 0; }
.resize-handle::after { content: ""; position: absolute; top: 28%; bottom: 28%; width: 3px; border-left: 1.5px solid currentColor; border-right: 1.5px solid currentColor; opacity: .55; border-radius: 1px; }
.resize-handle.r::after { right: 3px; }
.resize-handle.l::after { left: 3px; }
.bar:hover .resize-handle, .bar.resizing .resize-handle { display: block; }
.bar.resizing { z-index: 5; filter: none; box-shadow: 0 0 0 3px var(--primary-soft), 0 2px 8px rgba(0, 0, 0, .18); cursor: ew-resize; user-select: none; }
@media (hover: none) { .bar .resize-handle { display: block; } }
.drag-tip { position: fixed; z-index: 80; pointer-events: none; padding: 5px 10px; border-radius: 8px; background: #1f2329; color: #fff; font-size: 12.5px; white-space: nowrap; box-shadow: 0 4px 14px rgba(0, 0, 0, .25); }
.drag-tip.hidden { display: none; }
body.dragging-bar, body.dragging-bar * { cursor: ew-resize !important; }
.bar .nm { font-weight: 600; flex: none; }
.bar .note { opacity: .75; overflow: hidden; text-overflow: ellipsis; }
.bar .renew { width: 13px; height: 13px; flex: none; opacity: .8; margin-left: auto; }
.bar.mine { border-color: hsl(var(--h) var(--bar-bd-s) var(--bar-bd-l)); }
.bar.past { opacity: .45; }
.bar.cut-l { border-top-left-radius: 0; border-bottom-left-radius: 0; margin-left: 0; border-left-color: transparent; }
.bar.cut-r { border-top-right-radius: 0; border-bottom-right-radius: 0; margin-right: 0; border-right-color: transparent; }
.lanes-2 .bar, .lanes-3 .bar { margin-top: 2px; margin-bottom: 2px; font-size: 12px; border-radius: 5px; }
.lanes-3 .bar { font-size: 11px; margin-top: 1px; margin-bottom: 1px; }
.lanes-2 .avatar, .lanes-3 .avatar { width: 14px; height: 14px; font-size: 9px; }
.lanes-3 .note, .lanes-3 .renew { display: none; }
.empty { padding: 32px; text-align: center; color: var(--muted); }
/* 色块悬停提示里的内容 */
.tt-who { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 13.5px; }
.tt-who .avatar { width: 22px; height: 22px; font-size: 11px; }
.tt-who small { color: var(--faint); font-weight: 400; }
.tt-row { color: var(--muted); margin-top: 4px; }
.tt-tags { margin-top: 6px; display: flex; gap: 6px; flex-wrap: wrap; }

/* 卡片 */
.narrow { max-width: 1180px; margin: 0 auto; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-card); box-shadow: var(--shadow); min-width: 0; }
.card-h { display: flex; align-items: center; gap: 10px; padding: 16px 20px 0; }
.card-h h2 { margin: 0; font-size: 15px; font-weight: 600; }
.card-h .sub-title { color: var(--faint); font-size: 12px; }
.card-h .grow, .btn-row .grow { flex: 1; }
.card-b { padding: 12px 20px 20px; }
.card-note { color: var(--muted); font-size: 12.5px; line-height: 1.65; margin: 0; }
.card-note code, .card-foot code, .inline-code, .mig-body .note code { background: var(--bg); border: 1px solid var(--line); border-radius: 5px; padding: 0 5px; }
.card-foot { padding: 11px 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12.5px; background: color-mix(in srgb, var(--bg) 55%, var(--panel)); border-radius: 0 0 var(--radius-card) var(--radius-card); }
.icon-box { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); flex: none; }
.icon-box.ok { background: var(--ok-soft); color: var(--ok); }
.icon-box.warn { background: var(--warn-soft); color: var(--warn); }
svg.i { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.btn-row { display: flex; align-items: center; gap: 12px; }
.field-hint { font-size: 12px; color: var(--faint); }
.page-title { margin-bottom: 18px; }
.page-title h1 { font-size: 22px; letter-spacing: .3px; }
.page-title p { color: var(--muted); margin: 2px 0 0; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-weight: 500; white-space: nowrap; }
.table-wrap { overflow-x: auto; }

/* 开关 */
.switch { position: relative; display: inline-block; width: 36px; height: 20px; flex: none; cursor: pointer; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; padding: 0; border: 0; min-height: 0; width: 100%; cursor: pointer; z-index: 1; }
.switch i { position: absolute; inset: 0; border-radius: 999px; background: var(--line-strong); transition: background .18s; }
.switch i::after { content: ""; position: absolute; left: 2px; top: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .25); transition: transform .18s; }
.switch input:checked + i { background: var(--primary); }
.switch input:checked + i::after { transform: translateX(16px); }
.switch input:focus-visible + i { outline: 2px solid var(--primary); outline-offset: 2px; }
.switch input:disabled + i { opacity: .5; }

/* 我的账号 */
.hero { display: flex; align-items: center; gap: 20px; padding: 20px 24px; margin-bottom: 20px; flex-wrap: wrap; background: linear-gradient(135deg, var(--primary-soft), transparent 55%), var(--panel); }
.hero-id { display: flex; align-items: center; gap: 16px; flex: 1 1 280px; min-width: 0; }
.hero-id h1 { font-size: 20px; margin: 0; }
.hero-avatar .avatar { width: 60px; height: 60px; font-size: 24px; }
.hero-sub { display: flex; align-items: center; gap: 8px; color: var(--muted); margin-top: 3px; flex-wrap: wrap; }
.pill { font-family: ui-monospace, Menlo, monospace; font-size: 13px; background: var(--panel); border: 1px solid var(--line-strong); border-radius: 999px; padding: 1px 11px; color: var(--text); }
.hero-stats { display: grid; grid-template-columns: repeat(4, auto); gap: 6px; }
.hero-stat { display: flex; align-items: center; gap: 10px; padding: 8px 16px 8px 10px; border-radius: 10px; color: inherit; text-decoration: none; transition: background .15s; }
.hero-stat:hover { background: var(--panel); }
.hero-stat .icon-box { width: 34px; height: 34px; border-radius: 10px; }
.hero-stat b { display: block; font-size: 15px; line-height: 1.2; }
.hero-stat span.l { font-size: 12px; color: var(--muted); }
.acct-grid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 20px; align-items: start; }
.acct-col { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.tip-line { display: flex; gap: 8px; align-items: flex-start; }
.tip-line svg { margin-top: 3px; color: var(--primary); }
.srv-acct { display: grid; grid-template-columns: 150px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 12px 20px; border-top: 1px solid var(--line); }
.srv-acct .name { font-weight: 500; display: flex; align-items: center; gap: 8px; min-width: 0; }
.srv-acct-msg { grid-column: 2 / -1; margin-top: -8px; }
.cmd { display: flex; align-items: center; gap: 4px; min-width: 0; max-width: 100%; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 3px 4px 3px 11px; }
.cmd code { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmd .prompt { color: var(--faint); margin-right: 6px; user-select: none; }
.dot.on { box-shadow: 0 0 0 3px var(--ok-soft); }
.res-row { display: grid; grid-template-columns: minmax(0, 1.4fr) 64px minmax(0, 1.4fr) 140px 56px; gap: 14px; align-items: center; padding: 12px 20px; border-top: 1px solid var(--line); }
.res-row.head { padding-top: 8px; padding-bottom: 8px; color: var(--faint); font-size: 12px; border-top: 0; }
.res-row .sub { color: var(--faint); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gpu-chip { display: inline-block; padding: 0 8px; line-height: 22px; border-radius: 6px; background: var(--primary-soft); color: var(--primary); font-size: 12.5px; font-weight: 500; font-family: ui-monospace, Menlo, monospace; white-space: nowrap; }
.res-date { white-space: nowrap; }
.res-date small { display: block; color: var(--faint); font-size: 12px; }
.renew { display: flex; align-items: center; gap: 8px; white-space: nowrap; font-size: 13px; color: var(--muted); flex-direction: row; }
.key-item { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line); }
.key-item:first-child { border-top: 0; padding-top: 2px; }
.key-item .icon-box { background: var(--bg); color: var(--muted); }
.key-main { flex: 1; min-width: 0; }
.key-main b { font-weight: 600; display: block; line-height: 1.35; }
.key-main code { display: block; color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#key-toggle, #key-form { margin-top: 12px; }
#key-list:empty { display: none; }
#key-list:empty + #key-toggle { margin-top: 0; }
.pw-state { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-radius: 9px; background: var(--ok-soft); color: var(--ok); font-size: 13px; margin-bottom: 14px; }
.pw-state span { color: var(--text); }
.pw-state.off { background: var(--bg); color: var(--muted); }

/* 管理 */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; }
.kpi { display: flex; align-items: center; gap: 14px; padding: 16px 18px; }
.kpi .icon-box { width: 40px; height: 40px; border-radius: 11px; }
.kpi b { font-size: 22px; line-height: 1.15; display: block; font-weight: 600; }
.kpi b small { font-size: 13px; color: var(--muted); font-weight: 400; }
.kpi span.l { color: var(--muted); font-size: 12.5px; }
.subtabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.subtabs button { position: relative; background: none; border: 0; cursor: pointer; padding: 10px 14px; color: var(--muted); white-space: nowrap; display: inline-flex; align-items: center; gap: 7px; font: inherit; }
.subtabs button:hover { color: var(--text); }
.subtabs button.active { color: var(--primary); font-weight: 500; }
.subtabs button.active::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--primary); }
.subtabs .count { font-size: 11.5px; background: var(--line); color: var(--muted); border-radius: 999px; padding: 0 7px; line-height: 18px; }
.subtabs .count:empty { display: none; }
.subtabs button.active .count { background: var(--primary-soft); color: var(--primary); }
.vpn { display: flex; align-items: center; gap: 12px; padding: 11px 18px; margin-bottom: 14px; }
.vpn .grow { flex: 1; min-width: 0; }
.vpn .path { color: var(--muted); }
.tbl-row { display: grid; align-items: center; gap: 16px; padding: 13px 20px; border-top: 1px solid var(--line); }
.tbl-row.head { border-top: 0; padding-top: 11px; padding-bottom: 11px; color: var(--faint); font-size: 12px; background: color-mix(in srgb, var(--bg) 55%, var(--panel)); }
.srv-grid { grid-template-columns: minmax(140px, 1.4fr) minmax(140px, 1fr) minmax(120px, 1.1fr) minmax(90px, .8fr) minmax(100px, .9fr) 190px; }
.mem-grid { grid-template-columns: minmax(150px, 1.5fr) minmax(130px, 1.2fr) 70px 70px 70px 76px 76px; }
.tbl-row > * { min-width: 0; }
.cell-main { font-weight: 600; }
.cell-sub { color: var(--faint); font-size: 12px; font-weight: 400; }
.srv-status { display: flex; align-items: center; gap: 7px; }
.row-actions { display: flex; align-items: center; gap: 6px; justify-content: flex-end; }
.menu-wrap { position: relative; }
.menu { position: absolute; right: 0; top: 32px; z-index: 25; min-width: 140px; padding: 5px; background: var(--panel); border: 1px solid var(--line-strong); border-radius: 10px; box-shadow: 0 8px 28px rgba(0, 0, 0, .14); }
.menu button { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; border: 0; background: none; padding: 7px 10px; border-radius: 6px; cursor: pointer; font: inherit; font-size: 13px; color: var(--text); }
.menu button:hover { background: var(--primary-soft); color: var(--primary); }
.menu button.danger { color: var(--danger); }
.menu button.danger:hover { background: var(--danger-soft); color: var(--danger); }
.who { display: flex; align-items: center; gap: 10px; font-weight: 500; }
.who .avatar { width: 24px; height: 24px; font-size: 12px; }
.c-center { text-align: center; justify-self: center; }
.tools { display: flex; align-items: center; gap: 10px; padding: 14px 20px 4px; }
.search { position: relative; flex: 1; max-width: 300px; }
.search svg { position: absolute; left: 10px; top: 9px; color: var(--faint); }
.search input { padding-left: 32px; }
.seg { display: inline-flex; background: var(--bg); border: 1px solid var(--line); border-radius: 9px; padding: 2px; }
.seg button { border: 0; background: none; padding: 3px 12px; border-radius: 7px; cursor: pointer; font: inherit; font-size: 13px; color: var(--muted); }
.seg button.active { background: var(--panel); color: var(--text); box-shadow: var(--shadow); font-weight: 500; }
.set-group { margin-bottom: 18px; }
.set-group > h3 { font-size: 12.5px; font-weight: 500; color: var(--faint); letter-spacing: .06em; margin: 0 4px 8px; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 28px; padding: 15px 20px; border-top: 1px solid var(--line); }
.set-row:first-child { border-top: 0; }
.set-row .t { font-weight: 500; }
.set-row .d { color: var(--muted); font-size: 12.5px; margin-top: 2px; line-height: 1.65; max-width: 640px; }
.inline-num { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; color: var(--muted); }
.inline-num input { width: 68px; text-align: center; }
.savebar { position: sticky; bottom: 16px; z-index: 10; display: flex; align-items: center; gap: 12px; padding: 11px 14px 11px 20px; background: var(--panel); border: 1px solid var(--line-strong); border-radius: 12px; box-shadow: 0 8px 30px rgba(0, 0, 0, .12); margin-top: 8px; }
.savebar .grow { flex: 1; color: var(--muted); }
.savebar.clean { opacity: .65; }
.welcome { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.preview-wrap { position: sticky; top: 72px; }
.preview-label { color: var(--faint); font-size: 12px; margin: 0 4px 8px; display: flex; justify-content: space-between; }
.fcard { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 4px 18px rgba(16, 24, 40, .08); overflow: hidden; max-width: 440px; }
.fcard-h { background: #3370ff; color: #fff; padding: 12px 16px; font-weight: 600; font-size: 15px; overflow-wrap: anywhere; }
.fcard-b { padding: 14px 16px 6px; font-size: 13.5px; line-height: 1.7; overflow-wrap: anywhere; }
.fcard-b p { margin: 0 0 8px; }
.fcard-b ul { margin: 0 0 8px; padding-left: 18px; }
.fcard-btns { display: flex; flex-wrap: wrap; gap: 8px; padding: 6px 16px 16px; }
.fcard-btns span { display: inline-flex; padding: 5px 14px; border: 1px solid var(--primary); color: var(--primary); border-radius: 6px; font-size: 13px; }
.fcard-btns span:first-child { background: var(--primary); color: #fff; }

/* 弹窗 */
dialog { border: 1px solid var(--line); border-radius: 12px; padding: 20px; width: min(480px, calc(100vw - 32px)); background: var(--panel); color: var(--text); }
dialog::backdrop { background: rgba(0, 0, 0, .35); }
.copyable { user-select: all; }
.install-cmd { margin: 0; padding: 10px 12px; background: var(--bg); border: 1px solid var(--line); border-radius: 6px; font-size: 12.5px; white-space: pre-wrap; word-break: break-all; user-select: all; }
.install-notes { margin: 0; padding-left: 18px; line-height: 1.7; }

/* 勾选项 */
label.check { flex-direction: row; align-items: center; gap: 8px; color: var(--text); font-size: 14px; cursor: pointer; }
label.check input { width: auto; min-height: 0; margin: 0; }
.notice { background: var(--hover); border-radius: 6px; padding: 10px 12px; line-height: 1.6; }
dialog.wide { width: min(760px, calc(100vw - 32px)); }

/* 迁移 */
.mig-chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--primary); color: var(--primary); background: var(--hover); border-radius: 999px; padding: 3px 11px; font: inherit; font-size: 12px; cursor: pointer; white-space: nowrap; }
.mig-chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--primary); animation: pulse 1.4s infinite; }
@keyframes pulse { 50% { opacity: .25; } }
.mig { border: 1px solid var(--line); border-radius: 10px; margin-top: 10px; overflow: hidden; }
.mig:first-child { margin-top: 0; }
.mig > summary, .mig-head { list-style: none; display: flex; align-items: center; gap: 10px; padding: 11px 14px; cursor: pointer; }
.mig > summary::-webkit-details-marker { display: none; }
.mig-head { cursor: default; padding-bottom: 8px; flex-wrap: wrap; }
.mig-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mig-head .mig-title { white-space: normal; overflow-wrap: anywhere; }
.mig-title b { font-weight: 600; margin-right: 6px; }
.mig-title .path { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }
.mig-chev { color: var(--faint); transition: transform .2s; }
.mig[open] .mig-chev { transform: rotate(180deg); }
.mig-body { padding: 0 14px 13px; }
.mig-body .note { margin-top: 8px; font-size: 12.5px; color: var(--muted); line-height: 1.65; }
.mig.running { border-color: color-mix(in srgb, var(--primary) 40%, var(--line)); background: color-mix(in srgb, var(--primary) 3%, var(--panel)); }
.mig.failed { border-color: color-mix(in srgb, var(--danger) 40%, var(--line)); }
.mig-who { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; margin-right: 6px; }
.mig-who .avatar { width: 20px; height: 20px; font-size: 11px; }
.pager { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 14px; font-size: 12.5px; color: var(--muted); }
.pager .btn:disabled { opacity: .45; cursor: default; }
.mig-meta { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-top: 7px; font-size: 12px; color: var(--muted); }
.progress { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--primary); border-radius: 3px; transition: width .4s; }
.progress.done i { background: var(--ok); }
.progress.indeterminate i { width: 30% !important; animation: slide 1.2s infinite ease-in-out; }
@keyframes slide { 0% { margin-left: -30%; } 100% { margin-left: 100%; } }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 0 8px; border-radius: 999px; font-size: 12px; line-height: 20px; background: var(--line); color: var(--muted); white-space: nowrap; }
.badge.has-dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.running, .badge.queued { background: var(--hover); color: var(--primary); }
.badge.done, .badge.ok { background: rgba(22, 163, 74, .12); color: var(--ok); }
.badge.failed, .badge.error, .badge.rejected { background: rgba(229, 72, 77, .12); color: var(--danger); }
.badge.pending_approval, .badge.pending { background: rgba(217, 119, 6, .12); color: var(--warn); }
.cand-list { border: 1px solid var(--line); border-radius: 8px; max-height: 340px; overflow-y: auto; }
.cand { display: grid; grid-template-columns: auto 1fr auto; gap: 4px 10px; align-items: center; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.cand:last-child { border-bottom: 0; }
.cand input[type=checkbox] { width: auto; min-height: 0; }
.cand .path { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; overflow-wrap: anywhere; }
.cand .meta { grid-column: 2 / 4; font-size: 12px; color: var(--muted); }
.cand .dest { width: 140px; min-height: 28px; padding: 2px 6px; font-size: 12px; }
.cand-ctl { display: flex; gap: 6px; align-items: center; }
.cand-ctl select { width: auto; min-height: 28px; padding: 2px 24px 2px 6px; font-size: 12px; background-position: right 8px center; }
.pk-section { border: 1px solid var(--line); border-radius: 8px; padding: 12px; margin-top: 12px; }
.pk-section h3 { font-size: 14px; margin: 0 0 8px; }
.pk-section .label { margin-top: 10px; }
.cfg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 4px 12px; }
.cfg-grid label.check { font-size: 13px; align-items: flex-start; }
.cfg-grid label.check input { margin-top: 3px; }
.cfg.cred span { color: var(--warn); }
.cand.disabled { opacity: .5; }
.modes { display: flex; gap: 8px; flex-wrap: wrap; }
.modes label { flex: 1 1 240px; flex-direction: row; align-items: flex-start; gap: 8px; border: 1px solid var(--line-strong); border-radius: 8px; padding: 10px; cursor: pointer; color: var(--text); }
.modes label:has(input:checked) { border-color: var(--primary); background: var(--hover); }
.modes input { width: auto; min-height: 0; margin-top: 3px; }
.warn-text { color: var(--warn); }

/* 引导 */
.steps { display: flex; gap: 6px; flex-wrap: wrap; }
.steps span { font-size: 12px; padding: 2px 10px; border-radius: 999px; background: var(--line); color: var(--muted); }
.steps span.on { background: var(--primary); color: var(--primary-text); }
.steps span.ok { background: var(--hover); color: var(--primary); }
.steps span.clickable { cursor: pointer; }
.steps span.clickable:hover { background: var(--line-strong); }

/* 气泡（提示条 / 悬停提示）：和界面的白色面板统一，popover 在浏览器顶层，弹窗也盖不住 */
.toast, .tip {
  position: fixed; margin: 0; border: 1px solid var(--line-strong); border-radius: var(--radius);
  background: var(--panel); color: var(--text); box-shadow: 0 6px 24px rgba(0, 0, 0, .14);
  font-size: 13px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; overflow: visible;
}
.toast { inset: auto auto 24px 50%; transform: translateX(-50%); padding: 10px 16px; max-width: min(560px, calc(100vw - 32px)); }
.tip { inset: auto; padding: 8px 12px; max-width: min(360px, calc(100vw - 16px)); }
.toast[hidden], .tip[hidden] { display: none; }

@media (max-width: 1080px) {
  .acct-grid { grid-template-columns: 1fr; }
  .hero-stats { grid-template-columns: repeat(2, auto); }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .welcome { grid-template-columns: 1fr; }
  .preview-wrap { position: static; }
}
@media (max-width: 860px) {
  .tbl-row.head, .res-row.head { display: none; }
  .srv-grid, .mem-grid { grid-template-columns: 1fr 1fr; gap: 10px 16px; }
  .srv-grid > :first-child, .mem-grid > :first-child { grid-column: 1 / -1; }
  .srv-grid .row-actions { grid-column: 1 / -1; justify-content: flex-start; }
  .res-row { grid-template-columns: 1fr 1fr; gap: 8px 14px; }
  .srv-acct { grid-template-columns: 1fr; gap: 8px; }
  .srv-acct-msg { grid-column: 1; margin-top: 0; }
  .set-row { flex-direction: column; align-items: flex-start; gap: 12px; }
}
@media (max-width: 720px) {
  .topbar { gap: 8px; padding: 0 12px; }
  .brand-text { display: none; }
  #me-name { display: none; }
  main { padding: 12px; }
  .calendar { --label-w: 128px; --col-w: 26px; }
  .gpu-stat .meter { display: none; }
  .row-form, .two { grid-template-columns: 1fr; }
  .hero-stats { width: 100%; }
  .cand { grid-template-columns: auto 1fr; }
  .cand-ctl { grid-column: 2; }
  .cand .dest { width: 100%; }
  .cand .meta { grid-column: 2; }
}

/* 头像：有飞书头像用头像，没有就用姓名首字 */
.avatar { width: 18px; height: 18px; border-radius: 50%; flex: none; object-fit: cover; display: inline-flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 600; line-height: 1; color: #fff; background: hsl(var(--h, 215), 45%, 52%); vertical-align: middle; }
.me .avatar { width: 26px; height: 26px; font-size: 13px; }
#me-avatar-box { display: inline-flex; }
/* 进程表气泡 */
.tip.pinned { border-color: var(--primary); box-shadow: 0 6px 24px rgba(0, 0, 0, .18), 0 0 0 3px var(--primary-soft); }
.tip.rich { max-width: calc(100vw - 16px); white-space: normal; padding: 10px 12px; }
.proc-table { border-collapse: collapse; font-size: 12px; line-height: 1.5; }
.proc-table th { text-align: left; font-weight: 500; color: var(--muted); padding: 2px 14px 4px 0; white-space: nowrap; }
.proc-table td { padding: 2px 14px 2px 0; white-space: nowrap; }
.proc-table td.path { max-width: 520px; overflow: hidden; text-overflow: ellipsis; }
.proc-table tr > :last-child { padding-right: 0; }
.proc-empty { color: var(--muted); font-size: 12px; }

/* 必填项的红色 * 号 */
.req { color: var(--danger); margin-left: 3px; font-weight: 600; }
/* 文字链接样式的按钮（蓝色） */
.link-btn { background: none; border: 0; padding: 0; color: var(--primary); cursor: pointer; font: inherit; }
.link-btn:hover { text-decoration: underline; }
.env-head { display: flex; align-items: center; gap: 10px; margin-top: 8px; font-size: 13px; }
/* 迁移：已选的文件 / 目录，以及服务器文件浏览 */
.cand.picked { grid-template-columns: 1fr auto auto; }
.cand.picked .meta { grid-column: 1 / -1; }
.fs-path { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; color: var(--muted); }
.fs-path .sep { opacity: .5; }
.fs-list { border: 1px solid var(--line); border-radius: 8px; max-height: 380px; overflow-y: auto; min-height: 120px; }
.fs-row { display: grid; grid-template-columns: 1fr 96px 80px 90px 96px; gap: 8px; align-items: center; padding: 7px 10px; border-bottom: 1px solid var(--line); font-size: 13px; }
.fs-row:last-child { border-bottom: 0; }
.fs-row.head { position: sticky; top: 0; background: var(--panel); color: var(--muted); font-size: 12px; z-index: 1; }
.fs-row .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fs-row .name.dir { cursor: pointer; color: var(--text); }
.fs-row .name.dir:hover { color: var(--primary); }
.fs-row .muted { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fs-row .act { text-align: right; white-space: nowrap; }
@media (max-width: 720px) { .fs-row { grid-template-columns: 1fr auto; } .fs-row .m { display: none; } }
.pk-tips { margin-top: 10px; line-height: 1.6; }

.mig-body .note.error { color: var(--danger); white-space: pre-wrap; }
.tbl-row .gpu-chip { max-width: 100%; overflow: hidden; text-overflow: ellipsis; vertical-align: bottom; }
.vpn .path { margin-left: 8px; }
.link-btn.danger { color: var(--danger); }

/* 预约 / 预约详情弹窗 */
dialog.dlg { padding: 0; border-radius: 14px; width: min(520px, calc(100vw - 32px)); box-shadow: 0 20px 60px rgba(0, 0, 0, .25); }
dialog.dlg::backdrop { backdrop-filter: blur(2px); }
.dlg-h { display: flex; align-items: center; gap: 12px; padding: 18px 22px 14px; }
.dlg-h h2 { font-size: 16px; margin: 0; }
.dlg-h p { color: var(--faint); font-size: 12.5px; margin: 1px 0 0; }
.dlg-ico { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); flex: none; }
.dlg-ico .avatar { width: 36px; height: 36px; font-size: 15px; }
.dlg-x { margin-left: auto; align-self: flex-start; }
.dlg-b { padding: 4px 22px 18px; display: flex; flex-direction: column; gap: 16px; }
.dlg-f { display: flex; align-items: center; gap: 8px; padding: 14px 22px; border-top: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 55%, var(--panel)); border-radius: 0 0 14px 14px; }
.dlg-f .spacer { flex: 1; }
.seg label { flex-direction: row; position: relative; padding: 4px 16px; border-radius: 7px; cursor: pointer; font-size: 13px; color: var(--muted); }
.seg label input { position: absolute; opacity: 0; width: 0; min-height: 0; padding: 0; border: 0; margin: 0; }
.seg label:has(input:checked) { background: var(--panel); color: var(--text); box-shadow: var(--shadow); font-weight: 500; }
.seg label:has(input:focus-visible) { outline: 2px solid var(--primary); }
.gpu-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.gpu-pick label { position: relative; flex-direction: row; align-items: center; gap: 10px; padding: 9px 12px; border: 1px solid var(--line-strong); border-radius: 10px; cursor: pointer; color: var(--text); transition: border-color .15s, background .15s; }
.gpu-pick label:hover { border-color: var(--primary); }
.gpu-pick label:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.gpu-pick label:has(input:focus-visible) { outline: 2px solid var(--primary); outline-offset: 1px; }
.gpu-pick label.busy { opacity: .5; cursor: not-allowed; }
.gpu-pick label.busy:hover { border-color: var(--line-strong); }
.gpu-pick input { position: absolute; opacity: 0; width: 0; min-height: 0; padding: 0; border: 0; margin: 0; }
.gpu-pick .ck { width: 18px; height: 18px; border-radius: 5px; border: 1.5px solid var(--line-strong); display: grid; place-items: center; flex: none; color: #fff; }
.gpu-pick label:has(input:checked) .ck { background: var(--primary); border-color: var(--primary); }
.gpu-pick .ck svg { width: 12px; height: 12px; stroke-width: 3; opacity: 0; }
.gpu-pick label:has(input:checked) .ck svg { opacity: 1; }
.gpu-pick b { font-weight: 600; display: block; line-height: 1.3; }
.gpu-pick small { color: var(--faint); font-size: 12px; }
.note-box { display: flex; gap: 8px; margin: 0; padding: 9px 12px; border-radius: 9px; background: var(--primary-soft); color: var(--muted); font-size: 12.5px; line-height: 1.6; }
.note-box svg { color: var(--primary); margin-top: 2px; }
.info-grid { display: grid; grid-template-columns: 72px 1fr; gap: 8px 12px; font-size: 13.5px; margin: 0; }
.info-grid dt { color: var(--faint); }
.info-grid dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.switch-row { flex-direction: row; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; color: var(--text); font-size: 14px; cursor: pointer; }
.switch-row small { color: var(--faint); display: block; font-size: 12px; }
@media (max-width: 720px) { .srv-free { display: none; } .srv-host { padding-left: 0; } .srv-host .mono { overflow: hidden; text-overflow: ellipsis; } .srv-title { gap: 6px; } .cal-server > .cal-label { padding: 9px 10px; } .toolbar .legend { display: none; } .gpu-l2 .meter, .gpu-extra .gpu-detail { display: none; } .gpu-label { padding-left: 24px; } .gpu-free { left: 8px; } }

/* 组会 */
.gm-hero { display: flex; align-items: center; gap: 16px; padding: 18px 20px; margin-bottom: 16px; }
.gm-hero > .icon-box { width: 44px; height: 44px; border-radius: 12px; }
.gm-hero > .icon-box svg { width: 20px; height: 20px; }
.gm-hero .grow { flex: 1; min-width: 0; }
.gm-hero .k { color: var(--faint); font-size: 12px; }
.gm-hero .v { font-size: 18px; font-weight: 600; margin: 1px 0 5px; }
.gm-hero .meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 18px; color: var(--muted); font-size: 13px; }
.gm-hero .meta > span { display: inline-flex; align-items: center; gap: 6px; }
.gm-hero .meta .avatar { width: 18px; height: 18px; }
.gm-hero .st { margin-top: 8px; font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.gm-hero .st.warn { color: var(--warn); }
.gm-toggle { flex-direction: row; align-items: center; gap: 10px; color: var(--text); font-size: 13.5px; white-space: nowrap; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
/* 组会页的上下两行用同一套两列：近期安排 / 设置在左，汇报名单 / 卡片预览在右，左右边缘上下对齐 */
.gm-cols { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 16px; align-items: start; margin-bottom: 22px; }
.gm-grid { align-items: stretch; }
/* 名单卡片不参与撑高这一行：高度跟「近期安排」一致，人多时名单在卡片里滚动 */
.gm-roster-card { display: flex; flex-direction: column; contain: size; }
.gm-settings .preview-wrap { top: 68px; }
.gm-settings .fcard { max-width: none; }
.gm-upcoming { padding-top: 12px; }
.gm-row { grid-template-columns: 112px minmax(110px, 150px) minmax(0, 1fr) 112px auto; gap: 14px; padding: 11px 20px; }
.gm-row.off .c-date .cell-main { color: var(--faint); text-decoration: line-through; }
.gm-row select { min-height: 30px; padding-top: 4px; padding-bottom: 4px; font-size: 13px; }
.gm-row .c-who { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.gm-row .c-st .badge { margin-bottom: 2px; }
.gm-row.today { background: var(--today); }
.gm-chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 8px 0 4px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--panel); cursor: pointer; font: inherit; font-size: 13px; color: var(--text); max-width: 100%; }
.gm-chip:hover { border-color: var(--primary); color: var(--primary); }
.gm-chip .avatar { width: 20px; height: 20px; font-size: 10px; }
.gm-chip > svg { width: 12px; height: 12px; color: var(--faint); }
.gm-chip .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu.left { left: 0; right: auto; }
.gm-row .menu { min-width: 172px; }
.gm-row .menu button { white-space: nowrap; }
.gm-row .menu button small { font-size: 11.5px; }
.menu button:disabled { opacity: .4; cursor: default; background: none; color: var(--text); }
.menu .menu-sep { height: 1px; background: var(--line); margin: 4px 2px; }
.gm-roster { position: relative; flex: 1; min-height: 0; overflow-y: auto; padding: 8px 10px 10px; overscroll-behavior: contain; }
#gm-roster-note:empty { display: none; }
#gm-roster-note { padding: 0 10px 12px; }
.gm-r { display: flex; align-items: center; gap: 8px; padding: 5px 8px 5px 2px; border-radius: 9px; min-height: 42px; cursor: grab; background: var(--panel); }
.gm-r:hover { background: color-mix(in srgb, var(--bg) 75%, var(--panel)); }
.gm-grip { flex: none; width: 20px; height: 28px; display: grid; place-items: center; border: 0; padding: 0; border-radius: 6px; background: none; color: var(--faint); cursor: grab; touch-action: none; opacity: .55; }
.gm-r:hover .gm-grip, .gm-grip:focus-visible { opacity: 1; }
.gm-grip:focus-visible { outline: 2px solid var(--primary); }
.gm-grip svg { width: 15px; height: 15px; }
/* 拖动中：被拖的一行浮起来跟着鼠标，其他行让位 */
.gm-roster.sorting { user-select: none; cursor: grabbing; }
.gm-roster.sorting .gm-r { cursor: grabbing; }
.gm-roster.sorting .gm-r:not(.dragging) { transition: transform .16s ease; }
.gm-roster.sorting .gm-r:hover { background: var(--panel); }
.gm-r.dragging { position: relative; z-index: 2; background: var(--panel); box-shadow: 0 6px 22px rgba(0, 0, 0, .16), 0 0 0 1px var(--primary); }
.gm-roster.sorting .acts { opacity: 0 !important; }
.gm-r .n { width: 18px; text-align: right; color: var(--faint); font-size: 12px; font-variant-numeric: tabular-nums; flex: none; }
.gm-r .who { flex: 1; min-width: 0; flex-wrap: wrap; gap: 4px 8px; }
.gm-r .who .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gm-r .acts { display: flex; gap: 0; opacity: 0; transition: opacity .12s; }
.gm-r:hover .acts, .gm-r:focus-within .acts { opacity: 1; }
.gm-r .acts .btn.icon { width: 26px; height: 26px; }
.gm-r .acts .btn:disabled { opacity: .3; }
.gm-r.off .nm { color: var(--faint); text-decoration: line-through; }
@media (hover: none) { .gm-r .acts { opacity: 1; } }
.badge.next { background: var(--primary-soft); color: var(--primary); }
.gm-empty { padding: 18px 12px 10px; color: var(--muted); font-size: 13px; line-height: 1.7; }
.gm-note { margin: 6px 8px 0; padding: 8px 10px; border-radius: 8px; background: var(--warn-soft); color: var(--warn); font-size: 12.5px; line-height: 1.6; }
.set-row.col { flex-direction: column; align-items: stretch; gap: 10px; }
.gm-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.gm-chips:empty { display: none; }
.gm-tag { display: inline-flex; align-items: center; gap: 6px; padding: 2px 3px 2px 9px; border: 1px solid var(--line-strong); border-radius: 8px; font-size: 13px; background: var(--panel); max-width: 100%; min-height: 30px; }
.gm-tag > svg { width: 14px; height: 14px; color: var(--faint); }
.gm-tag .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gm-tag .def { font-size: 11px; color: var(--primary); background: var(--primary-soft); border-radius: 5px; padding: 0 6px; line-height: 18px; }
.gm-tag .sub { color: var(--faint); font-size: 11.5px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gm-tag.chat .t { flex: none; max-width: 240px; }
.gm-tag.chat { padding-left: 4px; }
.gm-chat-av { width: 22px; height: 22px; border-radius: 6px; flex: none; object-fit: cover; display: inline-grid; place-items: center; background: var(--primary-soft); color: var(--primary); }
.gm-chat-av svg { width: 13px; height: 13px; }
.gm-tag .link-btn { font-size: 12px; }
.gm-tag .btn.icon { width: 22px; height: 22px; }
.gm-add-row { display: flex; flex-wrap: wrap; gap: 8px; }
.gm-add-row input { flex: 1; min-width: 180px; }
.inline-num .gm-weekday { width: 104px; }
.inline-num .gm-time { width: 140px; text-align: left; }
.gm-preview-btns { margin-top: 14px; flex-wrap: wrap; gap: 8px; }
.fcard-b .fc-div { margin: 0 0 10px; }
.fcard-b .fc-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 16px; margin: 0 0 10px; }
.fcard-b hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0 10px; }
.fcard .at { color: var(--primary); }
.gm-history { margin-top: 22px; }
.gm-hist { padding-top: 12px; }
.gm-hrow { grid-template-columns: 150px minmax(0, 1fr) minmax(0, 1.6fr); padding: 10px 20px; }
.gm-hrow .who-list { display: flex; flex-wrap: wrap; gap: 4px 12px; }
.gm-hrow .who-list .who { font-weight: 400; gap: 6px; }
.gm-hrow .who-list .avatar { width: 20px; height: 20px; font-size: 10px; }
.gm-pick { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); max-height: 52vh; overflow-y: auto; padding: 2px; }
.gm-pick .avatar { width: 22px; height: 22px; font-size: 11px; }
.gm-pick > p { grid-column: 1 / -1; margin: 4px 2px; line-height: 1.7; }
.gm-pick label.hidden { display: none; }
.gm-pick-search { max-width: none; flex: none; }
.gm-pick small.new { color: var(--warn); }
.gm-pick .lbl { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.gm-pick b, .gm-pick small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gm-pick .gm-chat-av { width: 30px; height: 30px; border-radius: 8px; }
.gm-pick .gm-chat-av svg { width: 16px; height: 16px; }
@media (max-width: 1080px) {
  .gm-cols { grid-template-columns: minmax(0, 1fr); }  /* 不让内容（如很长的群 id）把这一列撑宽 */
  .gm-roster-card { contain: none; }
  .gm-roster { max-height: 440px; }
}
@media (max-width: 860px) {
  .gm-row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "date act" "loc loc" "who who" "st st"; gap: 8px 12px; }
  .gm-row .c-date { grid-area: date; } .gm-row .c-loc { grid-area: loc; } .gm-row .c-who { grid-area: who; } .gm-row .c-st { grid-area: st; } .gm-row .c-act { grid-area: act; }
  .gm-row .c-st:empty { display: none; }
  .gm-hrow { grid-template-columns: 1fr; gap: 4px; }
  .gm-hero { flex-wrap: wrap; }
  .gm-hero .grow { min-width: 240px; }
  .gm-row.off .c-loc { display: none; }
  .gm-hero > .icon-box { display: none; }
}

/* 组会：周报 */
.gm-report-grid { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px 12px; align-items: center; width: 100%; }
.gm-report-grid label { font-size: 13px; color: var(--muted); white-space: nowrap; }
.gm-report-check { display: flex; align-items: flex-start; gap: 12px; width: 100%; }
.gm-report-check > .btn { flex: none; }
#gm-r-result { flex: 1; min-width: 0; display: grid; gap: 4px; font-size: 12.5px; line-height: 1.6; }
#gm-r-result:empty { display: none; }
#gm-r-result p { margin: 2px 0 0; }
.gm-chk { display: flex; align-items: flex-start; gap: 6px; overflow-wrap: anywhere; }
.gm-chk > svg { flex: none; width: 14px; height: 14px; margin-top: 3px; }
.gm-chk.ok > svg { color: var(--ok); }
.gm-chk.bad > svg { color: var(--danger); }
.gm-chk .err { display: block; color: var(--danger); }
.gm-rep { display: inline-flex; align-items: center; gap: 4px; color: var(--primary); text-decoration: none; }
a.gm-rep:hover { text-decoration: underline; }
.gm-row .gm-rep { margin-top: 3px; font-size: 12px; }
.gm-rep.err { color: var(--danger); cursor: help; }
.gm-rep svg { width: 13px; height: 13px; }
.gm-hero .meta .gm-rep { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; }
.fcard-b a { color: #3370ff; text-decoration: none; }
.fc-btns { display: flex; flex-wrap: wrap; gap: 8px; margin: 2px 0 10px; }
.fcard-b .fc-btns a { display: inline-flex; padding: 5px 16px; border-radius: 6px; background: #3370ff; color: #fff; font-size: 13px; }
@media (max-width: 560px) {
  .gm-report-check { flex-direction: column; }
}

/* ---------------- 飞书卡片 ---------------- */
.chat-picker { display: flex; flex-direction: column; gap: 10px; }
.chat-empty { color: var(--faint); font-size: 13px; }
.fc-head { flex-wrap: wrap; row-gap: 8px; }
.fc-tpl-label { color: var(--faint); font-size: 12.5px; }
.fc-tpls { display: flex; gap: 6px; }
.fc-tpls .btn.active { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.fc-banner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 14px; margin-bottom: 14px; padding: 10px 12px;
  border-radius: 10px; background: var(--primary-soft); font-size: 13px; line-height: 1.6; }
.fc-banner-act { display: inline-flex; align-items: center; gap: 10px; margin-left: auto; }
.fc-colors { display: flex; flex-wrap: wrap; gap: 10px; }
.fc-colors label { position: relative; flex-direction: row; cursor: pointer; }
.fc-colors input { position: absolute; opacity: 0; width: 0; height: 0; min-height: 0; padding: 0; border: 0; margin: 0; }
.fc-colors span { width: 24px; height: 24px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08); transition: box-shadow .12s; }
.fc-colors input:checked + span { box-shadow: 0 0 0 2px var(--panel), 0 0 0 4px var(--text); }
.fc-colors input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 4px; }
#fc-links-err:empty { display: none; }
.fc-send { margin-top: 18px; }
.fc-actions { flex-wrap: wrap; }
.fc-actions .btn-row { margin-left: auto; }
.fc-result { display: grid; gap: 4px; font-size: 12.5px; line-height: 1.6; min-width: 0; flex: 1 1 200px; }
.fcard-h .ph { opacity: .65; font-weight: 500; }
.fcard-b .fc-btns a.def { background: var(--panel); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-strong); }
