/* ==========================================================================
   GlassMC — 液态玻璃设计系统
   卡片刻意不用 backdrop-filter：窗口本身已经是系统级毛玻璃（NSVisualEffectView /
   Mica / 合成器），再叠一层 backdrop-filter 等于对同一块区域二次采样，
   内存与重绘成本都会翻倍，观感却没有提升。
   ========================================================================== */

:root {
  --accent: #5F9FD6;
  --accent-2: #8B7FE8;
  --accent-hi: #93C7F0;
  --accent-soft: rgba(95, 159, 214, .16);
  --accent-line: rgba(95, 159, 214, .34);
  --ok: #4ADE80;
  --warn: #E5C07B;
  --danger: #F87171;

  --radius-xl: 18px;
  --radius-lg: 14px;
  --radius-md: 10px;
  --radius-sm: 7px;

  /* 玻璃不透明度：设置页滑块改这个 */
  --glass-alpha: 1;

  --sidebar-w: 208px;
  --titlebar-h: 44px;

  /* 让原生控件（下拉弹层、复选框、滚动条）跟随主题，否则深色界面会弹出白色的列表 */
  color-scheme: dark;
}

/* ---------------------------------- 深色 */
:root,
[data-theme="dark"] {
  --shell-rgb: 8, 14, 24;
  --shell-base: .84;
  --sidebar-rgb: 4, 9, 16;
  --sidebar-base: .52;

  --card-bg: rgba(255, 255, 255, .062);
  --card-bg-hi: rgba(255, 255, 255, .095);
  --card-border: rgba(136, 178, 220, .17);
  --card-border-hi: rgba(136, 178, 220, .34);

  --text: #EDF4FD;
  --text-dim: #A9BCD2;
  --text-dimmer: #7E92A9;

  --input-bg: rgba(255, 255, 255, .055);
  --input-border: rgba(130, 175, 220, .18);
  --hover: rgba(255, 255, 255, .055);
  --active: rgba(95, 159, 214, .17);

  /* 弹层要足够实，否则后面的内容会透过来干扰阅读 */
  --sheet-bg: rgba(15, 22, 33, .97);
  --sheet-mask: rgba(0, 0, 0, .55);

  --shadow-lift: 0 20px 44px -26px rgba(0, 0, 0, .95);
  --shadow-pop: 0 26px 70px -28px rgba(0, 0, 0, .85);
  --scroll-thumb: rgba(143, 163, 186, .28);
}

/* ---------------------------------- 浅色 */
[data-theme="light"] {
  color-scheme: light;
  --shell-rgb: 247, 250, 254;
  --shell-base: .88;
  --sidebar-rgb: 255, 255, 255;
  --sidebar-base: .55;

  --card-bg: rgba(255, 255, 255, .70);
  --card-bg-hi: rgba(255, 255, 255, .92);
  --card-border: rgba(26, 48, 78, .14);
  --card-border-hi: rgba(26, 48, 78, .28);

  --text: #101D33;
  --text-dim: #4A5D75;
  --text-dimmer: #6E8098;

  --input-bg: rgba(255, 255, 255, .78);
  --input-border: rgba(26, 48, 78, .16);
  --hover: rgba(20, 40, 70, .05);
  --active: rgba(95, 159, 214, .16);

  --sheet-bg: rgba(250, 251, 253, .97);
  --sheet-mask: rgba(20, 34, 52, .34);

  --shadow-lift: 0 18px 40px -26px rgba(20, 40, 70, .35);
  --shadow-pop: 0 26px 70px -30px rgba(20, 40, 70, .32);
  --scroll-thumb: rgba(60, 90, 125, .26);
}

/* ---------------------------------- 根容器 */
body {
  background: transparent;
  color: var(--text);
  overflow: hidden;
}

.app-root {
  display: flex;
  flex-direction: column;
  height: 100vh;
  border-radius: 14px;
  overflow: hidden;
  background: rgba(var(--shell-rgb), calc(var(--shell-base) * var(--glass-alpha)));
  transition: background-color .28s ease, color .28s ease;
}

/* ---------------------------------- 标题栏 */
.titlebar {
  height: var(--titlebar-h);
  flex: none;
  display: flex;
  align-items: center;
  gap: 10px;
  padding-left: 18px;
  padding-right: 10px;
  border-bottom: 1px solid transparent;
  transition: border-color .25s ease, background-color .25s ease;
}
.app-root.scrolled .titlebar {
  border-bottom-color: var(--card-border);
  background: rgba(var(--shell-rgb), calc(var(--shell-base) * var(--glass-alpha) * .55));
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 650;
  letter-spacing: .01em;
}
.brand .dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 10px rgba(95, 159, 214, .75);
}
.brand .ver {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  color: var(--text-dimmer);
  padding: 2px 6px;
  border-radius: 5px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
}

.tb-spacer { flex: 1; }

.tb-status {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11.5px;
  color: var(--text-dim);
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
}
.tb-status .led {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--text-dimmer);
}
.tb-status.live .led {
  background: var(--ok);
  box-shadow: 0 0 8px var(--ok);
  animation: pulse 1.8s ease-in-out infinite;
}
@keyframes pulse { 50% { opacity: .35; } }

.win-btns { display: flex; gap: 2px; margin-left: 4px; }
.win-btn {
  width: 30px; height: 26px;
  display: grid; place-items: center;
  border: 0; border-radius: 7px;
  background: transparent;
  color: var(--text-dim);
  cursor: default;
  transition: background-color .16s ease, color .16s ease;
}
.win-btn:hover { background: var(--hover); color: var(--text); }
.win-btn.close:hover { background: #E5484D; color: #fff; }
.win-btn svg { width: 12px; height: 12px; }

/* ---------------------------------- 主体 */
.body-row {
  flex: 1;
  display: flex;
  min-height: 0;
}

/* ---------------------------------- 侧边栏 */
.sidebar {
  width: var(--sidebar-w);
  flex: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 10px 12px;
  background: rgba(var(--sidebar-rgb), calc(var(--sidebar-base) * var(--glass-alpha)));
  border-right: 1px solid var(--card-border);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 36px;
  padding: 0 10px;
  border: 0;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 500;
  cursor: default;
  text-align: left;
  transition: background-color .16s ease, color .16s ease;
  position: relative;
}
.nav-item:hover { background: var(--hover); color: var(--text); }
.nav-item.active {
  background: var(--active);
  color: var(--text);
  font-weight: 600;
}
.nav-item.active::before {
  content: "";
  position: absolute;
  left: 0; top: 9px; bottom: 9px;
  width: 2.5px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--accent-hi), var(--accent-2));
}
.nav-item .ico { width: 16px; height: 16px; flex: none; opacity: .9; }
.nav-item .badge {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-dimmer);
}

.sidebar .grow { flex: 1; }

.account-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  border-radius: var(--radius-md);
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  cursor: default;
  transition: border-color .18s ease, background-color .18s ease;
}
.account-chip:hover { border-color: var(--card-border-hi); background: var(--card-bg-hi); }
.avatar {
  width: 28px; height: 28px; flex: none;
  border-radius: 8px;
  display: grid; place-items: center;
  font-size: 12px; font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35);
  overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; }
.account-chip .who { min-width: 0; flex: 1; }
.account-chip .nm {
  font-size: 12.5px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.account-chip .ty { font-size: 10.5px; color: var(--text-dimmer); }

/* ---------------------------------- 内容区 */
.content {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 14px 22px 26px;
  scroll-behavior: smooth;
}

.page { display: none; animation: pageIn .26s cubic-bezier(.2, .7, .3, 1); }
.page.on { display: block; }
@keyframes pageIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

.page-head {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 16px;
}
.page-head h1 {
  margin: 0;
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -.01em;
}
.page-head .sub {
  font-size: 12px;
  color: var(--text-dim);
  padding-bottom: 3px;
}
.page-head .spacer { flex: 1; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--text-dimmer);
  margin-bottom: 6px;
}

/* ---------------------------------- 卡片 */
.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 16px;
  transition: border-color .2s ease, background-color .2s ease, transform .2s ease;
}
.card.tight { padding: 12px 14px; }
.card.lift:hover { border-color: var(--card-border-hi); background: var(--card-bg-hi); }
.card-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 650;
  margin-bottom: 10px;
}
.card-title .k { margin-left: auto; font-family: var(--font-mono); font-size: 10.5px; color: var(--text-dimmer); font-weight: 500; }

/* 首页 hero */
.hero {
  position: relative;
  overflow: hidden;
  padding: 22px;
  border-radius: var(--radius-xl);
  border: 1px solid var(--card-border);
  background:
    radial-gradient(680px circle at 88% -30%, rgba(139, 127, 232, .22), transparent 64%),
    radial-gradient(560px circle at 4% 120%, rgba(95, 159, 214, .20), transparent 62%),
    var(--card-bg);
}
.hero h2 {
  margin: 0 0 4px;
  font-size: 26px;
  font-weight: 750;
  letter-spacing: -.015em;
}
.hero .ver-big {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent-hi);
}
.hero .meta {
  display: flex; flex-wrap: wrap; gap: 7px;
  margin: 12px 0 18px;
}
.hero .actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* 统计 */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}
.stat {
  padding: 11px 13px;
  border-radius: var(--radius-md);
  background: var(--card-bg);
  border: 1px solid var(--card-border);
}
.stat .n {
  font-family: var(--font-mono);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -.02em;
  color: var(--text);
}
.stat .l { font-size: 10.5px; color: var(--text-dimmer); margin-top: 2px; letter-spacing: .02em; }

/* ---------------------------------- 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 32px;
  padding: 0 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--card-border);
  background: var(--card-bg);
  color: var(--text);
  font-size: 12.5px;
  font-weight: 550;
  cursor: default;
  white-space: nowrap;
  transition: background-color .16s ease, border-color .16s ease, transform .12s ease, box-shadow .16s ease;
}
.btn:hover { background: var(--card-bg-hi); border-color: var(--card-border-hi); }
.btn:active { transform: scale(.975); }
.btn[disabled] { opacity: .42; pointer-events: none; }

.btn.primary {
  border-color: transparent;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 10px 24px -14px rgba(95, 159, 214, .95);
}
.btn.primary:hover {
  background: linear-gradient(135deg, var(--accent-hi), #9a8ff0);
  box-shadow: 0 14px 28px -14px rgba(95, 159, 214, 1);
}
.btn.danger { color: var(--danger); border-color: rgba(248, 113, 113, .3); }
.btn.danger:hover { background: rgba(248, 113, 113, .12); }
.btn.lg { height: 40px; padding: 0 20px; font-size: 13.5px; border-radius: 11px; }
.btn.sm { height: 26px; padding: 0 10px; font-size: 11.5px; border-radius: 8px; }
.btn.icon { width: 32px; padding: 0; }
.btn svg { width: 14px; height: 14px; }

/* ---------------------------------- 徽章 */
.badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 21px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .01em;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  color: var(--text-dim);
  white-space: nowrap;
}
.badge-pill.accent { color: var(--accent-hi); background: var(--accent-soft); border-color: var(--accent-line); }
.badge-pill.ok { color: var(--ok); background: rgba(74, 222, 128, .12); border-color: rgba(74, 222, 128, .26); }
.badge-pill.warn { color: var(--warn); background: rgba(229, 192, 123, .12); border-color: rgba(229, 192, 123, .26); }
.badge-pill.danger { color: var(--danger); background: rgba(248, 113, 113, .12); border-color: rgba(248, 113, 113, .26); }
.badge-pill .d { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }

/* ---------------------------------- 列表行 */
.row-list { display: flex; flex-direction: column; gap: 6px; }

.vrow {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 13px;
  border-radius: var(--radius-md);
  border: 1px solid var(--card-border);
  background: var(--card-bg);
  transition: border-color .18s ease, background-color .18s ease, transform .18s ease;
}
.vrow:hover { border-color: var(--card-border-hi); background: var(--card-bg-hi); transform: translateX(2px); }
.vrow .v-main { min-width: 0; flex: 1; }
.vrow .v-id {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 650;
  letter-spacing: -.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.vrow .v-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 5px;
  flex-wrap: wrap;
}
.vrow .v-actions { display: flex; gap: 6px; flex: none; }

.mono-dim {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-dimmer);
}

/* ---------------------------------- 表单 */
.field { margin-bottom: 14px; }
.field:last-child { margin-bottom: 0; }
.field .lbl {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 600;
  margin-bottom: 6px;
}
.field .lbl .hint { margin-left: auto; font-weight: 400; font-size: 11px; color: var(--text-dimmer); }
.field .desc { font-size: 11.5px; color: var(--text-dim); margin-top: 5px; }

input[type="text"],
input[type="password"],
input[type="number"],
select,
textarea {
  width: 100%;
  height: 32px;
  padding: 0 10px;
  border-radius: var(--radius-md);
  border: 1px solid var(--input-border);
  background: var(--input-bg);
  color: var(--text);
  font-size: 12.5px;
  outline: none;
  transition: border-color .16s ease, background-color .16s ease;
}
textarea { height: auto; padding: 8px 10px; resize: vertical; min-height: 64px; }
input:focus, select:focus, textarea:focus {
  border-color: var(--accent-line);
  background: var(--card-bg-hi);
}
select {
  appearance: none;
  background-image: none;
  cursor: default;
}

.slider-row { display: flex; align-items: center; gap: 12px; }
input[type="range"] {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--accent) var(--pct, 50%), var(--input-border) var(--pct, 50%));
  outline: none;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 15px; height: 15px;
  border-radius: 50%;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, .12);
  box-shadow: 0 2px 7px rgba(0, 0, 0, .38);
  cursor: default;
  transition: transform .14s ease;
}
input[type="range"]:active::-webkit-slider-thumb { transform: scale(1.14); }

.slider-val {
  font-family: var(--font-mono);
  font-size: 12px;
  min-width: 62px;
  text-align: right;
  color: var(--text-dim);
}

/* ---------------------------------- 网格 */
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.hstack { display: flex; align-items: center; gap: 10px; }

/* ---------------------------------- 日志抽屉 */
.logbar {
  flex: none;
  height: 0;
  overflow: hidden;
  border-top: 1px solid transparent;
  background: rgba(var(--shell-rgb), calc(var(--shell-base) * var(--glass-alpha) * .9));
  transition: height .26s cubic-bezier(.2, .7, .3, 1), border-color .26s ease;
  display: flex;
  flex-direction: column;
}
.logbar.on { height: 216px; border-top-color: var(--card-border); }
.logbar-head {
  height: 34px; flex: none;
  display: flex; align-items: center; gap: 10px;
  padding: 0 14px;
  font-size: 11.5px;
  color: var(--text-dim);
  border-bottom: 1px solid var(--card-border);
}
.logbar-head .t { font-weight: 600; color: var(--text); }
.log-body {
  flex: 1;
  overflow-y: auto;
  padding: 8px 14px 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-all;
  color: var(--text-dim);
}
.log-body .e { color: #F0A0A0; }
.log-body .s { color: var(--ok); }

/* ---------------------------------- 空状态 */
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 44px 20px;
  text-align: center;
  color: var(--text-dimmer);
  font-size: 12.5px;
}
.empty .big-ico { font-size: 26px; opacity: .5; }

/* ---------------------------------- 加载 */
.spinner {
  width: 14px; height: 14px;
  border-radius: 50%;
  border: 2px solid var(--card-border-hi);
  border-top-color: var(--accent);
  animation: spin .8s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------------------------- toast */
.toast-wrap {
  position: fixed;
  right: 18px;
  bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 90;
  pointer-events: none;
}
.toast {
  padding: 10px 14px;
  border-radius: var(--radius-md);
  background: rgba(16, 26, 40, .94);
  border: 1px solid var(--card-border-hi);
  color: #E9F2FC;
  font-size: 12.5px;
  box-shadow: var(--shadow-pop);
  max-width: 380px;
  animation: toastIn .24s cubic-bezier(.2, .7, .3, 1);
}
.toast.err { border-color: rgba(248, 113, 113, .5); }
.toast.ok { border-color: rgba(74, 222, 128, .45); }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px) scale(.98); } }

/* ---------------------------------- 窄窗口 */
@media (max-width: 900px) {
  :root { --sidebar-w: 64px; }
  .nav-item { justify-content: center; padding: 0; }
  .nav-item span.tx, .nav-item .badge { display: none; }
  .account-chip .who { display: none; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .content { padding: 12px 14px 22px; }
}


/* ---------------------------------- 浏览器预览兜底 */
/* 真实窗口靠系统毛玻璃提供背景；浏览器里没有，需要一个模拟桌面，
   否则浅色文字直接压在白色上，什么都看不清。 */
html.preview body {
  background:
    radial-gradient(900px circle at 12% 6%, rgba(95, 159, 214, .38), transparent 62%),
    radial-gradient(760px circle at 88% 92%, rgba(139, 127, 232, .34), transparent 60%),
    radial-gradient(600px circle at 70% 20%, rgba(56, 189, 248, .18), transparent 65%),
    #0a1220;
}
html.preview[data-theme="light"] body {
  background:
    radial-gradient(900px circle at 12% 6%, rgba(95, 159, 214, .30), transparent 62%),
    radial-gradient(760px circle at 88% 92%, rgba(139, 127, 232, .24), transparent 60%),
    #dfe8f4;
}


/* ---------------------------------- 模组紧凑行 */
.mrow {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 36px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  transition: background-color .14s ease, border-color .14s ease;
}
.mrow:hover { background: var(--card-bg-hi); border-color: var(--card-border); }
.mrow .nm {
  flex: 1; min-width: 0;
  font-size: 12.5px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mrow .sz {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-dimmer);
  flex: none;
}
.mrow .st { flex: none; width: 46px; text-align: right; }

/* 下拉框箭头：select 去掉了原生外观，需要自己画 */
select {
  background-image:
    linear-gradient(45deg, transparent 50%, currentColor 50%),
    linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position:
    calc(100% - 16px) calc(50% + 1px),
    calc(100% - 11px) calc(50% + 1px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 30px;
  color: var(--text);
}

/* ==================================================================
   第二阶段：标签页 / 弹层 / 进度 / 皮肤 / 网格
   ================================================================== */

/* ---------------------------------- 标签页 */
.tabs {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border-radius: 10px;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  margin-bottom: 14px;
}
.tab {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 600;
  height: 26px;
  padding: 0 12px;
  border-radius: 7px;
  cursor: default;
  transition: background-color .16s ease, color .16s ease;
}
.tab:hover { color: var(--text); }
.tab.on {
  background: var(--card-bg-hi);
  color: var(--text);
  box-shadow: 0 1px 4px rgba(0, 0, 0, .18);
}

/* ---------------------------------- 弹层 */
.modal-mask {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: none;
  align-items: center;
  justify-content: center;
  background: var(--sheet-mask, rgba(0, 0, 0, .5));
  padding: 24px;
  animation: fadeIn .16s ease;
}
.modal-mask.on { display: flex; }
@keyframes fadeIn { from { opacity: 0 } to { opacity: 1 } }

.sheet {
  width: min(600px, 92vw);
  max-height: 84vh;
  overflow: auto;
  padding: 20px 22px;
  border-radius: var(--radius-xl);
  border: 1px solid var(--card-border-hi);
  background: var(--sheet-bg, var(--card-bg));
  box-shadow: 0 28px 90px rgba(0, 0, 0, .55);
  animation: sheetIn .2s cubic-bezier(.2, .8, .3, 1);
}
@keyframes sheetIn { from { opacity: 0; transform: translateY(10px) scale(.985) } to { opacity: 1; transform: none } }
.sheet.wide { width: min(760px, 94vw); }
.sheet-head { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.sheet-head h3 { font-size: 15px; font-weight: 680; letter-spacing: -.01em; }
.sheet-head .sub { font-size: 11.5px; color: var(--text-dimmer); }
.sheet-head .x { margin-left: auto; }
.sheet-foot { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; }

/* ---------------------------------- 进度卡 */
.progress-card {
  position: fixed;
  top: 54px;
  right: 18px;
  width: 292px;
  z-index: 55;
  display: none;
  padding: 13px 15px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--card-border-hi);
  background: var(--card-bg-hi);
  box-shadow: 0 18px 50px rgba(0, 0, 0, .42);
  backdrop-filter: blur(20px);
}
.progress-card.on { display: block; animation: sheetIn .18s ease; }
.progress-card .pt { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 650; }
.progress-card .pt .pct { margin-left: auto; font-family: var(--font-mono); font-size: 11px; color: var(--accent-hi); }
.progress-card .pl { font-size: 11px; color: var(--text-dim); margin: 6px 0 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pbar { height: 4px; border-radius: 3px; background: var(--input-bg); overflow: hidden; }
.pbar > i {
  display: block; height: 100%; width: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width .22s ease;
}

/* ---------------------------------- 皮肤 */
.skin-face {
  width: 64px; height: 64px;
  image-rendering: pixelated;
  border-radius: 8px;
  background: var(--input-bg);
  display: block;
}
.skin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 10px;
}
.skin-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 6px 8px;
  border-radius: var(--radius-md);
  border: 1px solid var(--card-border);
  background: var(--card-bg);
  cursor: default;
  transition: border-color .16s ease, background-color .16s ease, transform .16s ease;
}
.skin-cell:hover { border-color: var(--card-border-hi); background: var(--card-bg-hi); transform: translateY(-1px); }
.skin-cell .nm { font-size: 10.5px; color: var(--text-dim); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.skin-cell .au { font-size: 9.5px; color: var(--text-dimmer); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.acc-avatar {
  width: 40px; height: 40px;
  flex: none;
  border-radius: 11px;
  overflow: hidden;
  background: var(--input-bg);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700;
  color: var(--text-dim);
}
.acc-avatar canvas, .acc-avatar img { width: 100%; height: 100%; image-rendering: pixelated; display: block; }

/* ---------------------------------- 设备码 */
.code-box {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
}
.code-box .code {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: .12em;
  color: var(--accent-hi);
}

/* ---------------------------------- 小工具 */
.kv { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 12px; }
.kv .k { color: var(--text-dim); }
.kv .v { color: var(--text); font-weight: 600; }
.dot-sep { color: var(--text-dimmer); opacity: .6; }
.wrap-gap { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
  font-size: 10.5px;
  padding: 2px 7px;
  border-radius: 6px;
  border: 1px solid var(--card-border);
  color: var(--text-dim);
  background: var(--input-bg);
}
.mini-note { font-size: 11px; color: var(--text-dimmer); line-height: 1.6; }
.section-gap { margin-top: 12px; }
.scroll-y { max-height: 46vh; overflow-y: auto; padding-right: 4px; }
.row-click { cursor: default; }
