/* HX 面板 —— 暗色 / 浅色双主题，无外部依赖（html[data-theme="light"] 切换浅色） */
:root {
  /* 基础表面 */
  --bg: #0d1014;
  --bg-2: #12161d;
  --panel: #161b23;
  --panel-2: #1b212b;
  --line: #232b37;
  --line-2: #2c3543;
  /* 文本 */
  --text: #e6e9ef;
  --text-2: #c8d0dc;
  --muted: #8b95a7;
  --dim: #626d80;
  --dim-2: #64748b;
  /* 语义色 */
  --accent: #34d399;
  --accent-2: #059669;
  --accent-grad: #2fbf8b;
  --accent-border: #0d8a63;
  --brand-fg: #04140e;
  --blue: #4f9cf9;
  --amber: #f5b544;
  --red: #f26d6d;
  --bar-bad: #b03c3c;
  --bar-warn: #b57b18;
  --link-text: #b6d4ff;
  --warn-text: #ffdca0;
  --danger-text: #ffc0c0;
  --danger-btn-text: #ff9b9b;
  /* 控件与内嵌块 */
  --input: #0e1218;
  --code: #0a0d12;
  --chip: #141a22;
  --tabs: #0f141b;
  --tabs-hover: #111823;
  --hover: #222b37;
  --hover-line: #38445a;
  --hover-line-2: #33415a;
  --row-hover: #1a202a;
  --nav-hover: #1a2029;
  --th: #131822;
  --crumb-hover: #1e2632;
  --toast-bg: #1c2430;
  --scroll: #2a3240;
  --badge-chip: #1d2632;
  --term-bg: #0b1220;
  --topbar-bg: rgba(13, 16, 20, .8);
  --radius: 10px;
  --shadow: 0 8px 30px rgba(0, 0, 0, .35);
  color-scheme: dark;
}

html[data-theme="light"] {
  --bg: #f3f5f9;
  --bg-2: #eef1f6;
  --panel: #ffffff;
  --panel-2: #f2f5f9;
  --line: #e3e8ef;
  --line-2: #d2dae4;
  --text: #1b2431;
  --text-2: #2b3644;
  --muted: #5b6779;
  --dim: #8593a5;
  --dim-2: #94a1b2;
  --accent: #0d9d6a;
  --accent-2: #0a8358;
  --accent-grad: #12b981;
  --accent-border: #0a8f60;
  --brand-fg: #ffffff;
  --blue: #2563eb;
  --amber: #b8791a;
  --red: #d5444a;
  --bar-bad: #e08a8a;
  --bar-warn: #d0a45a;
  --link-text: #1d4ed8;
  --warn-text: #8a5a00;
  --danger-text: #b3262c;
  --danger-btn-text: #b3262c;
  --input: #ffffff;
  --code: #f7f9fc;
  --chip: #f1f4f8;
  --tabs: #f1f4f8;
  --tabs-hover: #e9eef5;
  --hover: #e9eef5;
  --hover-line: #c3cede;
  --hover-line-2: #cbd5e1;
  --row-hover: #f6f8fb;
  --nav-hover: #e8eef6;
  --th: #f2f5f9;
  --crumb-hover: #e6ebf2;
  --toast-bg: #ffffff;
  --scroll: #c8d2de;
  --badge-chip: #e8eef6;
  --term-bg: #f7f9fc;
  --topbar-bg: rgba(255, 255, 255, .85);
  --shadow: 0 8px 26px rgba(23, 43, 77, .12);
  color-scheme: light;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.55 system-ui, -apple-system, "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.mono { font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.center { text-align: center; }
.grow { flex: 1; }
.row { display: flex; gap: 10px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.col { display: flex; flex-direction: column; gap: 10px; }

/* ---------- 图标 ---------- */
.ico {
  width: 16px; height: 16px; display: inline-block; flex: none;
  background: currentColor;
  -webkit-mask: var(--i) center / contain no-repeat;
  mask: var(--i) center / contain no-repeat;
  opacity: .9;
}
.i-dash { --i: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'><rect x='3' y='3' width='7' height='9' rx='1.5'/><rect x='14' y='3' width='7' height='5' rx='1.5'/><rect x='14' y='12' width='7' height='9' rx='1.5'/><rect x='3' y='16' width='7' height='5' rx='1.5'/></svg>"); }
.i-file { --i: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z'/><path d='M14 3v5h5'/></svg>"); }
.i-globe { --i: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'><circle cx='12' cy='12' r='9'/><path d='M3 12h18M12 3c2.5 3 2.5 15 0 18M12 3c-2.5 3-2.5 15 0 18'/></svg>"); }
.i-box { --i: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linejoin='round'><path d='M21 8l-9-5-9 5 9 5 9-5z'/><path d='M3 8v8l9 5 9-5V8'/><path d='M12 13v8'/></svg>"); }
.i-rocket { --i: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linejoin='round'><path d='M5 15c-1 3 0 4 0 4s1 1 4 0'/><path d='M14 4c4 1 6 3 6 6 0 0-2 6-9 9l-4-4c3-7 7-11 7-11z'/><circle cx='15' cy='9' r='1.6'/></svg>"); }
.i-cpu { --i: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'><rect x='6' y='6' width='12' height='12' rx='2'/><rect x='10' y='10' width='4' height='4'/><path d='M9 2v3M15 2v3M9 19v3M15 19v3M2 9h3M2 15h3M19 9h3M19 15h3'/></svg>"); }
.i-gear { --i: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linejoin='round'><circle cx='12' cy='12' r='3.2'/><path d='M19.4 15a1.6 1.6 0 0 0 .3 1.8l.1.1a2 2 0 1 1-2.8 2.8l-.1-.1a1.6 1.6 0 0 0-2.7 1.1V21a2 2 0 1 1-4 0v-.1A1.6 1.6 0 0 0 7.5 19l-.1.1a2 2 0 1 1-2.8-2.8l.1-.1A1.6 1.6 0 0 0 3 13.6H3a2 2 0 1 1 0-4h.1A1.6 1.6 0 0 0 4.7 7l-.1-.1a2 2 0 1 1 2.8-2.8l.1.1A1.6 1.6 0 0 0 10 3V3a2 2 0 1 1 4 0v.1A1.6 1.6 0 0 0 16.5 5l.1-.1a2 2 0 1 1 2.8 2.8l-.1.1a1.6 1.6 0 0 0 1.1 2.7H21a2 2 0 1 1 0 4h-.1a1.6 1.6 0 0 0-1.5 1z'/></svg>"); }
.i-sliders { --i: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'><path d='M4 6h10M18 6h2M4 12h4M12 12h8M4 18h12M20 18h0'/><circle cx='16' cy='6' r='2'/><circle cx='10' cy='12' r='2'/><circle cx='18' cy='18' r='2'/></svg>"); }
.i-clock { --i: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'><circle cx='12' cy='12' r='9'/><path d='M12 7v5l3.5 2'/></svg>"); }

/* ---------- 登录 ---------- */
.login-wrap {
  min-height: 100%;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(900px 500px at 15% -10%, rgba(52, 211, 153, .13), transparent 60%),
    radial-gradient(700px 400px at 110% 110%, rgba(79, 156, 249, .12), transparent 60%),
    var(--bg);
}
.login-card {
  width: 100%; max-width: 360px; padding: 28px 26px 22px;
  background: linear-gradient(180deg, var(--panel), var(--bg-2));
  border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow);
}
.login-brand { display: flex; gap: 12px; align-items: center; margin-bottom: 22px; }
.login-brand h1 { font-size: 19px; margin: 0 0 2px; letter-spacing: .5px; }
.login-brand p { margin: 0; font-size: 12px; }
.field { display: block; margin-bottom: 9px; }
.field > span { display: block; font-size: 11.5px; color: var(--muted); margin-bottom: 4px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 6px 9px; color: var(--text); background: var(--input); font-size: 12.5px;
  border: 1px solid var(--line-2); border-radius: 8px; outline: none;
  font: inherit; transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--accent-2); box-shadow: 0 0 0 3px rgba(52, 211, 153, .12);
}
.field textarea { min-height: 120px; resize: vertical; font-family: ui-monospace, Consolas, monospace; font-size: 13px; }
.field input[type=checkbox] { width: auto; }
.login-error {
  background: rgba(242, 109, 109, .12); border: 1px solid rgba(242, 109, 109, .35);
  color: var(--danger-text); padding: 8px 10px; border-radius: 8px; font-size: 13px; margin-bottom: 12px;
}
.login-tip { font-size: 12px; text-align: center; margin: 14px 0 0; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 5px 11px; border-radius: 7px; border: 1px solid var(--line-2);
  background: var(--panel-2); color: var(--text); font: inherit; font-size: 12.5px;
  cursor: pointer; transition: background .15s, border-color .15s, transform .05s;
  white-space: nowrap;
}
.btn:hover { background: var(--hover); border-color: var(--hover-line); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: linear-gradient(180deg, var(--accent-grad), var(--accent-2)); border-color: var(--accent-border); color: var(--brand-fg); font-weight: 600; }
.btn.primary:hover { filter: brightness(1.06); }
.btn.danger { background: rgba(242, 109, 109, .12); border-color: rgba(242, 109, 109, .4); color: var(--danger-btn-text); }
.btn.danger:hover { background: rgba(242, 109, 109, .22); }
.btn.ghost { background: transparent; }
.btn.small { padding: 3px 8px; font-size: 11.5px; border-radius: 6px; }
.btn.block { width: 100%; padding: 10px; }
.btn.icon { padding: 5px 8px; }

/* ---------- 布局 ---------- */
.shell { display: flex; height: 100%; }
.sidebar {
  width: 196px; flex: none; background: var(--bg-2); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 14px 10px;
}
.brand { display: flex; align-items: center; gap: 9px; padding: 4px 8px 18px; font-weight: 600; letter-spacing: .4px; }
#nav { display: flex; flex-direction: column; gap: 2px; }
#nav a {
  display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: 8px;
  color: var(--muted); cursor: pointer; font-size: 13.5px; transition: background .12s, color .12s;
}
#nav a:hover { background: var(--nav-hover); color: var(--text); }
#nav a.active { background: rgba(52, 211, 153, .11); color: var(--accent); }
.sidebar-foot { margin-top: auto; padding: 12px 8px 4px; font-size: 11.5px; line-height: 1.7; border-top: 1px solid var(--line); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 58px; flex: none; display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px; border-bottom: 1px solid var(--line); background: var(--topbar-bg);
  backdrop-filter: blur(6px);
}
.topbar-left { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.topbar-left h2 { font-size: 16px; margin: 0; font-weight: 600; }
.topbar-right { display: flex; align-items: center; gap: 8px; }
.pill {
  font-size: 11.5px; padding: 4px 9px; border-radius: 20px;
  background: var(--chip); border: 1px solid var(--line); color: var(--muted); white-space: nowrap;
}
.pill.warn { color: var(--amber); border-color: rgba(245, 181, 68, .35); }
.pill.bad { color: var(--red); border-color: rgba(242, 109, 109, .35); }

.view { flex: 1; overflow: auto; padding: 18px 20px 40px; }

/* ---------- 卡片 ---------- */
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 13px 15px; min-width: 0;
}
.card.pad0 { padding: 0; overflow: hidden; }
.card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin: -13px -15px 10px; padding: 9px 15px; border-bottom: 1px solid var(--line);
}
.card-head h3 { margin: 0; font-size: 13.5px; font-weight: 600; color: var(--text); }
/* pad0 卡片没有内边距，负外边距会把标题顶出上沿，这里改为正常的整块表头 */
.card.pad0 > .card-head { margin: 0; padding: 9px 15px; }
.grid { display: grid; gap: 11px; }
.grid > .span-all { grid-column: 1 / -1; }
.grid.c4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 1100px) { .grid.c4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid.c3, .grid.c2 { grid-template-columns: 1fr; } }
@media (max-width: 680px) { .grid.c4 { grid-template-columns: 1fr; } .sidebar { width: 60px; } .sidebar .brand span, #nav a { font-size: 0; } .sidebar-foot { display: none; } }

/* 指标卡 */
.stat { display: flex; flex-direction: column; gap: 8px; }
.stat-top { display: flex; align-items: center; justify-content: space-between; }
.stat-label { font-size: 12.5px; color: var(--muted); }
.stat-value { font-size: 26px; font-weight: 650; letter-spacing: .3px; line-height: 1.1; }
.stat-value small { font-size: 13px; font-weight: 400; color: var(--muted); margin-left: 3px; }
.stat-sub { font-size: 11.5px; color: var(--dim); }
.bar { height: 6px; border-radius: 6px; background: var(--input); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--accent-2), var(--accent)); transition: width .4s; }
.bar.warn > i { background: linear-gradient(90deg, var(--bar-warn), var(--amber)); }
.bar.bad > i { background: linear-gradient(90deg, var(--bar-bad), var(--red)); }

/* 表格 */
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
th, td { padding: 6px 10px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-weight: 500; font-size: 11.5px; color: var(--muted); background: var(--th); position: sticky; top: 0; z-index: 1; white-space: nowrap; }
tbody tr:hover { background: var(--row-hover); }
tbody tr:last-child td { border-bottom: none; }
td.actions { white-space: nowrap; text-align: right; }
td.actions .btn + .btn { margin-left: 5px; }
td .btn.small { padding: 2px 7px; line-height: 1.3; border-radius: 5px; }

.badge {
  display: inline-block; padding: 1px 7px; border-radius: 20px; font-size: 11.5px;
  border: 1px solid var(--line-2); color: var(--muted); background: var(--chip);
}
.badge.ok { color: var(--accent); border-color: rgba(52, 211, 153, .35); background: rgba(52, 211, 153, .1); }
.badge.warn { color: var(--amber); border-color: rgba(245, 181, 68, .35); background: rgba(245, 181, 68, .1); }
.badge.bad { color: var(--red); border-color: rgba(242, 109, 109, .35); background: rgba(242, 109, 109, .1); }
.badge.info { color: var(--blue); border-color: rgba(79, 156, 249, .35); background: rgba(79, 156, 249, .1); }

/* 工具条 */
.toolbar { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-bottom: 10px; }
.toolbar .sep { width: 1px; height: 20px; background: var(--line); margin: 0 2px; }
.search {
  flex: 1; min-width: 140px; max-width: 300px; padding: 6px 10px; font: inherit; font-size: 13px;
  color: var(--text); background: var(--input); border: 1px solid var(--line-2); border-radius: 8px; outline: none;
}
.search:focus { border-color: var(--accent-2); }

/* 文件列表 */
.crumbs { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; font-size: 13px; }
.crumbs a { color: var(--muted); cursor: pointer; padding: 2px 5px; border-radius: 5px; }
.crumbs a:hover { background: var(--crumb-hover); color: var(--text); }
.crumbs span.sep { color: var(--dim); }
.fname { display: flex; align-items: center; gap: 7px; min-width: 0; cursor: pointer; }
.fname .n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fname .ico { color: var(--dim); }
.fname .ico.dir { color: var(--blue); }
tr.selected { background: rgba(52, 211, 153, .06); }
input[type=checkbox] { accent-color: var(--accent-2); cursor: pointer; }

/* 图表 */
.chart { width: 100%; height: 150px; display: block; }
.chart-legend { display: flex; gap: 14px; font-size: 11.5px; color: var(--muted); }
.chart-legend i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 5px; }

/* 列表 */
.kv { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 4px 10px; font-size: 12.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }

pre.out {
  margin: 0; padding: 12px; background: var(--code); border: 1px solid var(--line); border-radius: 8px;
  font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; line-height: 1.55;
  color: var(--text-2); max-height: 340px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere;
}
pre.out.ok { border-color: rgba(52, 211, 153, .3); }
pre.out.bad { border-color: rgba(242, 109, 109, .35); }
.terminal-output { min-height: 220px; max-height: 60vh !important; }

/* 交互式终端 */
.terminal-card .card-head { gap: 10px; }
.terminal-host {
  margin-top: 10px; height: 62vh; min-height: 320px; background: var(--term-bg);
  border: 1px solid var(--line); border-radius: 8px; padding: 8px; overflow: hidden;
}
.terminal-host .xterm { height: 100%; }
.terminal-placeholder {
  display: flex; align-items: center; justify-content: center; height: 100%;
  color: var(--dim-2); font-size: 13px;
}

/* 站点卡片 */
.site-card { display: flex; flex-direction: column; gap: 10px; }
.site-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.site-title h3 { margin: 0; font-size: 14.5px; }
.site-domains { font-size: 12.5px; color: var(--muted); overflow-wrap: anywhere; }

/* 弹窗 */
.modal {
  position: fixed; inset: 0; background: rgba(4, 6, 9, .68); backdrop-filter: blur(2px);
  display: grid; place-items: center; padding: 24px; z-index: 50;
}
.modal-box {
  width: 100%; max-width: 720px; max-height: 88vh; overflow: auto;
  background: var(--panel); border: 1px solid var(--line-2); border-radius: 14px;
  box-shadow: var(--shadow); padding: 18px;
}
.modal-box.wide { max-width: 960px; }
.modal-box.narrow { max-width: 420px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.modal-head h3 { margin: 0; font-size: 15px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.editor { width: 100%; min-height: 46vh; font-family: ui-monospace, Consolas, monospace; font-size: 13px; line-height: 1.6;
  color: var(--text-2); background: var(--code); border: 1px solid var(--line-2); border-radius: 8px; padding: 12px; resize: vertical; outline: none; }
.editor:focus { border-color: var(--accent-2); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%);
  background: var(--toast-bg); border: 1px solid var(--line-2); color: var(--text);
  padding: 10px 16px; border-radius: 10px; box-shadow: var(--shadow); z-index: 80;
  font-size: 13px; max-width: 80vw;
}
.toast.ok { border-color: rgba(52, 211, 153, .45); }
.toast.bad { border-color: rgba(242, 109, 109, .5); color: var(--danger-text); }

/* 空状态 / 加载 */
.empty { padding: 22px; text-align: center; color: var(--dim); font-size: 12.8px; }
.loading { padding: 24px; text-align: center; color: var(--dim); font-size: 13px; }
.spin {
  width: 14px; height: 14px; border: 2px solid rgba(52, 211, 153, .25); border-top-color: var(--accent);
  border-radius: 50%; display: inline-block; animation: spin .7s linear infinite; vertical-align: -2px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.notice {
  font-size: 12.5px; padding: 7px 11px; border-radius: 8px; margin-bottom: 9px;
  background: rgba(79, 156, 249, .1); border: 1px solid rgba(79, 156, 249, .3); color: var(--link-text);
}
.notice.warn { background: rgba(245, 181, 68, .1); border-color: rgba(245, 181, 68, .3); color: var(--warn-text); }
.disk-row { display: flex; align-items: center; gap: 12px; padding: 5px 0; font-size: 12.5px; }
.disk-row .mount { width: 132px; flex: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.disk-row .bar { flex: 1; min-width: 60px; }
.disk-row .pct { width: 132px; flex: none; text-align: right; font-size: 11.8px; color: var(--muted); white-space: nowrap; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--scroll); border-radius: 6px; border: 2px solid var(--bg); }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- VPN ---------- */
.vpn-tabs { display: inline-flex; gap: 4px; padding: 3px; margin-bottom: 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 9px; }
.vpn-tab { border: 0; background: transparent; color: var(--muted); font: inherit; font-size: 12.5px; padding: 5px 13px; border-radius: 7px; cursor: pointer; transition: color .15s, background .15s; }
.vpn-tab:hover { color: var(--text); }
.vpn-tab.active { background: var(--panel-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-2); }
.vpn-hero { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.vpn-hero-main { display: flex; align-items: center; gap: 8px; }
.vpn-hero-main b { font-size: 14.5px; font-weight: 600; }
.vpn-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; background: var(--dim); }
.vpn-dot.ok { background: var(--accent); box-shadow: 0 0 0 3px rgba(52, 211, 153, .14); }
.vpn-dot.bad { background: var(--red); box-shadow: 0 0 0 3px rgba(242, 109, 109, .12); }
.vpn-stats { display: flex; flex-wrap: wrap; gap: 6px 24px; margin-top: 12px; }
.vpn-stat { display: flex; flex-direction: column; gap: 1px; font-size: 11.5px; color: var(--muted); }
.vpn-stat b { font-size: 12.5px; font-weight: 600; color: var(--text); }
.vpn-opts { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 18px; margin-top: 12px; font-size: 12.5px; color: var(--muted); }
.vpn-opts label, .vpn-check { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.vpn-opts input[type=checkbox], .vpn-check input[type=checkbox], .vpn-device input[type=checkbox] { width: auto; margin: 0; accent-color: var(--accent); }
.vpn-import { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.vpn-import .field { margin-bottom: 0; }
.vpn-devices { display: flex; flex-wrap: wrap; gap: 10px; }
.vpn-device { flex: 1 1 262px; max-width: 420px; border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; background: var(--tabs); transition: border-color .15s, background .15s; }
.vpn-device:hover { border-color: var(--line-2); background: var(--tabs-hover); }
.vpn-device-head { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; min-width: 0; }
.vpn-device-head h4 { margin: 0; font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vpn-device-head .badge { margin-left: 0; flex: none; }
.vpn-device-head h4 + .badge { margin-left: auto; }
.vpn-device-meta { display: flex; flex-wrap: wrap; gap: 2px 12px; font-size: 12px; color: var(--muted); }
.vpn-device-meta .mono { font-size: 11.5px; }
.vpn-device-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.vpn-device .vpn-check { font-size: 12px; color: var(--muted); margin-top: 2px; }
.vpn-device-note { margin-top: 4px; font-size: 12px; color: var(--muted); line-height: 1.5; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; }
.vpn-device-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.vpn-device-tags:empty { display: none; }
.vpn-device-tags .tag { font-size: 10.5px; line-height: 1.6; padding: 0 6px; border-radius: 4px; background: rgba(127, 127, 127, .12); border: 1px solid var(--line); color: var(--muted); white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.vpn-device-tags .tag.warn { color: var(--warn-text); border-color: rgba(245, 181, 68, .4); background: rgba(245, 181, 68, .1); }
.vpn-device-tags .tag.bad { color: var(--danger-text); border-color: rgba(242, 109, 109, .4); background: rgba(242, 109, 109, .1); }
.vpn-limit { margin-top: 10px; padding-top: 4px; border-top: 1px dashed var(--line); }
.vpn-limit .field { margin-bottom: 10px; }
.vpn-limit-hint { font-size: 11.5px; }
.vpn-days { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.vpn-days label { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 6px; border: 1px solid var(--line-2); background: var(--input); font-size: 12px; color: var(--text-2); cursor: pointer; margin: 0; }
.vpn-days label:has(input:checked) { border-color: var(--accent-border); background: rgba(52, 211, 153, .12); color: var(--text); }
.vpn-days input { width: auto; margin: 0; accent-color: var(--accent); }
.btn.tiny { padding: 2px 7px; font-size: 11.5px; border-radius: 5px; }
.vpn-help .field span { font-size: 11.5px; }
.vpn-help .field input, .vpn-help .field textarea { font-size: 12.5px; padding: 6px 8px; }
.vpn-help { margin-top: 12px; padding-top: 9px; border-top: 1px dashed var(--line); }
.vpn-help summary { cursor: pointer; font-size: 12px; color: var(--dim); list-style: none; }
.vpn-help summary::-webkit-details-marker { display: none; }
.vpn-help summary::before { content: '\25B8  '; }
.vpn-help[open] summary::before { content: '\25BE  '; }
.vpn-help div { margin-top: 6px; font-size: 12px; line-height: 1.8; color: var(--muted); }
.vpn-help div span.mono { font-size: 11.5px; }

/* ---------- 设备参数弹窗（精简排版） ---------- */
.vc { font-size: 12.5px; }
.vc .field { margin-bottom: 0; }
.vc .field > span { display: block; margin-bottom: 4px; font-size: 11.5px; color: var(--muted); }
.vc .field input { padding: 6px 9px; font-size: 12.5px; }
.vc-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px 10px; }
.vc-grid.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.vc-sec { margin-top: 11px; padding-top: 10px; border-top: 1px dashed var(--line); }
.vc-foot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 11px; }
.vc-psk { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-2); cursor: pointer; margin: 0; }
.vc-psk input { width: auto; margin: 0; accent-color: var(--accent); }
.vc-foot .muted { font-size: 11.5px; }
.vc-tip { margin-top: 7px; font-size: 11px; line-height: 1.55; color: var(--dim); }
.vc .vpn-days label { position: relative; padding: 3px 0; min-width: 30px; justify-content: center; font-size: 12px; }
.vc .vpn-days input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.vc .vpn-days label:has(input:checked) { border-color: var(--accent-border); background: rgba(52, 211, 153, .16); color: var(--text); font-weight: 600; }
.vc .vpn-days label:has(input:focus-visible) { outline: 2px solid var(--accent-2); outline-offset: 1px; }
.vc-foot .muted { margin-left: auto; }
@media (max-width: 720px) { .vc-grid, .vc-grid.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- 数据库页：标签页 + 内联新建 ---------- */
.db-tabs { display: inline-flex; gap: 3px; padding: 3px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; }
.db-tab { border: 0; background: transparent; color: var(--muted); font: inherit; font-size: 12px; padding: 4px 11px; border-radius: 6px; cursor: pointer; transition: color .15s, background .15s; }
.db-tab:hover { color: var(--text); }
.db-tab.active { background: var(--panel); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-2); }
.db-new { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: flex-end; padding: 2px 0 10px; border-bottom: 1px dashed var(--line); margin-bottom: 9px; }
.db-new .field { flex: 1 1 160px; margin: 0; }
/* SQL 控制台 */
.sql-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.sql-bar .search { max-width: 220px; }
.sql-text { width: 100%; min-height: 150px; resize: vertical; padding: 9px 10px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--input); color: var(--text); font-family: var(--mono, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace); font-size: 12.5px; line-height: 1.55; outline: none; }
.sql-text:focus { border-color: var(--accent-border); }
.sql-out { margin-top: 9px; }
.sql-res { max-height: 420px; border: 1px solid var(--line); border-radius: 8px; }
.sql-res table { font-size: 12px; }
.sql-res th { position: sticky; top: 0; }
.sql-foot { font-size: 11.8px; margin-top: 6px; }

.db-new > .row { flex: 0 0 auto; }

/* 还原备份：选择还原方式 */
/* 备份目录选择：目录浏览 */
.bd-pick { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; margin-bottom: 10px; }
.bd-path { padding: 6px 10px; font-size: 11.8px; color: var(--muted); background: var(--panel-2); border-bottom: 1px solid var(--line); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bd-list { max-height: 190px; overflow: auto; display: flex; flex-direction: column; }
.bd-item { text-align: left; border: 0; background: transparent; color: var(--text); font: inherit; font-size: 12.5px; padding: 5px 10px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bd-item:hover { background: var(--row-hover); }
.bd-list > .empty { padding: 14px; }

.rs-modes { display: grid; gap: 6px; margin-bottom: 10px; }
.rs-mode { display: flex; align-items: flex-start; gap: 8px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; font-size: 12.5px; transition: border-color .15s, background .15s; }
.rs-mode:hover { border-color: var(--line-2); }
.rs-mode.on { border-color: var(--accent-border); background: rgba(52, 211, 153, .07); }
.rs-mode input { margin: 2px 0 0; flex: none; accent-color: var(--accent-2); }
.rs-mode span { display: flex; flex-direction: column; gap: 2px; }
.rs-mode strong { font-weight: 600; }
.rs-mode em { font-style: normal; color: var(--muted); font-size: 11.5px; }

/* ---------- 设置页：标签页 + 紧凑排版 ---------- */
.set-tabs { display: inline-flex; gap: 4px; padding: 3px; margin-bottom: 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 9px; }
.set-tab { border: 0; background: transparent; color: var(--muted); font: inherit; font-size: 12.5px; padding: 5px 15px; border-radius: 7px; cursor: pointer; transition: color .15s, background .15s; }
.set-tab:hover { color: var(--text); }
.set-tab.active { background: var(--panel-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-2); }
.settings-page .grid.c2 { gap: 10px; }
.settings-page .card { padding: 12px 14px; }
.settings-page .card-head { margin: -12px -14px 9px; padding: 7px 14px; }
.settings-page .card-head h3 { font-size: 13px; }
.settings-page .field { margin-bottom: 8px; }
.settings-page .field > span { margin-bottom: 4px; font-size: 11.5px; }
.settings-page .field input, .settings-page .field select { padding: 6px 9px; font-size: 12.5px; }
.settings-page p.muted { font-size: 11.5px; line-height: 1.6; margin: 0 0 8px; }
.settings-page .btn { padding: 5px 11px; font-size: 12.5px; }
.settings-page .btn.small { padding: 3px 8px; font-size: 11.5px; }
.settings-page table { font-size: 12px; }
.settings-page th, .settings-page td { padding: 5px 9px; }
.settings-page th { font-size: 11.5px; }
.settings-page .kv { grid-template-columns: 66px minmax(0, 1fr) 66px minmax(0, 1fr); gap: 3px 10px; font-size: 12px; }
.settings-page .row { gap: 8px; }
.settings-page .out { font-size: 11.5px; }
@media (max-width: 900px) { .settings-page .kv { grid-template-columns: 66px minmax(0, 1fr); } }

/* ---------- VPN 页紧凑排版 ---------- */

.vpn-page .card { padding: 12px 14px; }
.vpn-page .card.sec { margin-top: 10px; }
.vpn-page .card-head { margin: -12px -14px 10px; padding: 9px 14px; }
.vpn-page .vpn-hero-main b { font-size: 14px; }
.vpn-page .vpn-stats { margin-top: 9px; gap: 3px 18px; }
.vpn-page .vpn-stat { flex-direction: row; align-items: baseline; gap: 5px; font-size: 11.5px; }
.vpn-page .vpn-stat b { font-size: 12px; }
.vpn-page .vpn-opts { margin-top: 9px; gap: 4px 16px; font-size: 12px; }
.vpn-page .vpn-help { margin-top: 9px; padding-top: 7px; }
.vpn-page .vpn-help div { line-height: 1.7; }
.vpn-adv-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 12px; }
.vpn-adv-grid .field, .vpn-adv-cmds .field { margin-bottom: 0; }
.vpn-adv-grid .field > span, .vpn-adv-cmds .field > span { margin-bottom: 4px; }
.vpn-adv-cmds { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 12px; margin-top: 8px; }
.vpn-adv-cmds textarea { min-height: 52px; }
.vpn-nat { display: flex !important; align-items: center; gap: 6px; margin: 0 !important; padding: 7px 0; font-size: 12px !important; color: var(--muted); cursor: pointer; }
.vpn-nat input { width: auto; margin: 0; accent-color: var(--accent); }
.vpn-adv-save { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 9px; }
.vpn-adv-save .muted { font-size: 11.5px; }
.vpn-page .vpn-devices { gap: 8px; }
.vpn-page .vpn-device { padding: 8px 11px; flex: 1 1 250px; }
.vpn-page .vpn-device-head { margin-bottom: 5px; }
.vpn-page .vpn-device-actions { gap: 5px; margin-top: 7px; }
@media (max-width: 900px) { .vpn-adv-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 820px) { .vpn-import { grid-template-columns: 1fr; } .vpn-adv-grid, .vpn-adv-cmds { grid-template-columns: 1fr; } }
/* 文件选择框跟随暗色主题（仅 .field 内的 file input） */
.field input[type=file] { padding: 5px 8px; font-size: 12px; cursor: pointer; }
.field input[type=file]::file-selector-button {
  margin-right: 8px; padding: 3px 10px; border-radius: 6px; border: 1px solid var(--line-2);
  background: var(--panel-2); color: var(--text); font: inherit; font-size: 12px; cursor: pointer;
}
.field input[type=file]::file-selector-button:hover { background: var(--hover); }
/* ---------- 文件共享：标签页 / 共享账号 ---------- */
.share-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.share-tabs { display: inline-flex; gap: 3px; padding: 3px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; }
.share-tab {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border: none; border-radius: 6px;
  background: transparent; color: var(--muted); font: inherit; font-size: 12.5px; cursor: pointer; transition: background .15s, color .15s;
}
.share-tab:hover { color: var(--text); background: rgba(255, 255, 255, .03); }
.share-tab.on { background: var(--panel-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-2); }
.share-tab i { font-style: normal; font-size: 11px; line-height: 1.6; padding: 0 6px; border-radius: 20px; background: var(--badge-chip); color: var(--muted); }
.share-tab.on i { background: rgba(52, 211, 153, .16); color: var(--accent); }
.share-tip { font-size: 12px; margin-bottom: 8px; line-height: 1.6; }

.acct-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 12px; align-items: start; }
.acct-card {
  display: flex; flex-direction: column; gap: 10px; padding: 14px;
  background: var(--panel); border: 1px solid var(--line-2); border-radius: 12px; transition: border-color .15s;
}
.acct-card:hover { border-color: var(--hover-line-2); }
.acct-card.off { opacity: .62; }
.acct-top { display: flex; align-items: center; gap: 10px; }
.acct-avatar {
  width: 34px; height: 34px; flex: 0 0 34px; border-radius: 10px; display: grid; place-items: center;
  font-size: 14px; font-weight: 700; color: var(--brand-fg); background: linear-gradient(180deg, var(--accent-grad), var(--accent-2));
}
.acct-card.off .acct-avatar { background: var(--hover-line-2); color: var(--muted); }
.acct-id { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.acct-id b { font-size: 13.5px; font-weight: 600; }
.acct-id .muted { font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-meta { display: flex; flex-wrap: wrap; gap: 3px 12px; font-size: 11.5px; color: var(--muted); }
.acct-actions { display: flex; gap: 6px; flex-wrap: wrap; }

.grant-list { display: flex; flex-direction: column; gap: 8px; max-height: 260px; overflow: auto; }
.grant { padding: 9px 11px; border: 1px solid var(--line-2); border-radius: 9px; background: var(--input); transition: border-color .15s, background .15s; }
.grant.on { border-color: rgba(52, 211, 153, .38); background: rgba(52, 211, 153, .06); }
.grant-head { display: flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; }
.grant-head b { font-weight: 600; }
.grant-perms { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 8px; padding-left: 23px; font-size: 12px; color: var(--muted); }
.grant-perms label { display: flex; align-items: center; gap: 5px; cursor: pointer; }
/* ---------- 文件共享：内联账号编辑 / 高级设置折叠 ---------- */
.acct-state {
  padding: 2px 9px; border-radius: 20px; border: 1px solid var(--line-2); background: var(--chip);
  color: var(--muted); font: inherit; font-size: 11.5px; cursor: pointer; white-space: nowrap;
}
.acct-state.on { color: var(--accent); border-color: rgba(52, 211, 153, .35); background: rgba(52, 211, 153, .1); }
.acct-state:hover { filter: brightness(1.18); }
.acct-add {
  display: flex; align-items: center; justify-content: center; min-height: 108px; padding: 12px;
  border: 1px dashed var(--line-2); border-radius: 12px; background: transparent;
  color: var(--muted); font: inherit; font-size: 13px; cursor: pointer;
  transition: border-color .15s, color .15s, background .15s;
}
.acct-add:hover { border-color: var(--accent); color: var(--accent); background: rgba(52, 211, 153, .05); }
.acct-card.editing { border-color: rgba(52, 211, 153, .5); }
.acct-card.editing .field { margin-bottom: 8px; }
.acct-card.editing .field > span { font-size: 11.5px; margin-bottom: 4px; }
.acct-card.editing .field input { padding: 7px 9px; font-size: 12.5px; }
.acct-inline { display: flex; gap: 6px; align-items: center; }
.acct-inline input {
  flex: 1; min-width: 0; padding: 6px 9px; border-radius: 7px; border: 1px solid var(--line-2);
  background: var(--input); color: var(--text); font: inherit; font-size: 12.5px; outline: none;
}
.acct-inline input:focus { border-color: var(--accent); }
.adv { margin: 2px 0 12px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--input); padding: 0 12px; }
.adv > summary {
  cursor: pointer; padding: 10px 0; font-size: 12.5px; color: var(--muted); list-style: none;
}
.adv > summary::-webkit-details-marker { display: none; }
.adv > summary::before { content: '\25B8  '; }
.adv[open] > summary::before { content: '\25BE  '; }
.adv > summary:hover { color: var(--text); }
.adv[open] { padding-bottom: 12px; }
.adv .field { margin-bottom: 10px; }
/* ---------- 浅色主题微调（浅底上更稳的对比度） ---------- */
html[data-theme="light"] .login-wrap {
  background:
    radial-gradient(900px 500px at 15% -10%, rgba(13, 157, 106, .10), transparent 60%),
    radial-gradient(700px 400px at 110% 110%, rgba(37, 99, 235, .08), transparent 60%),
    var(--bg);
}
html[data-theme="light"] #nav a.active { background: rgba(13, 157, 106, .12); }
html[data-theme="light"] .btn.danger { background: rgba(213, 68, 74, .08); border-color: rgba(213, 68, 74, .32); }
html[data-theme="light"] .btn.danger:hover { background: rgba(213, 68, 74, .16); }
html[data-theme="light"] .badge.ok { background: rgba(13, 157, 106, .12); }
html[data-theme="light"] .badge.warn { background: rgba(184, 121, 26, .13); }
html[data-theme="light"] .badge.bad { background: rgba(213, 68, 74, .11); }
html[data-theme="light"] .badge.info { background: rgba(37, 99, 235, .1); }
html[data-theme="light"] .acct-state.on { background: rgba(13, 157, 106, .12); }
html[data-theme="light"] th { box-shadow: inset 0 -1px 0 var(--line); }
html[data-theme="light"] .modal { background: rgba(23, 43, 77, .38); }
html[data-theme="light"] .toast { box-shadow: 0 10px 30px rgba(23, 43, 77, .18); }
html[data-theme="light"] ::selection { background: rgba(13, 157, 106, .22); }
/* ---------- VPN 设备在线/离线 ---------- */
.vpn-status { width: 16px; height: 16px; flex: none; display: inline-flex; align-items: center; justify-content: center; }
.vpn-status svg { width: 16px; height: 16px; display: block; }
.vpn-status.online { color: var(--accent); }
.vpn-status.online svg { animation: vpnPulse 2s ease-in-out infinite; }
.vpn-status.offline { color: var(--dim); }
@keyframes vpnPulse { 0%, 100% { opacity: 1; } 50% { opacity: .5; } }
.vpn-device.is-online { border-left: 3px solid var(--accent); }
.vpn-device.is-offline { border-left: 3px solid var(--line-2); }
.vpn-device.is-offline .vpn-device-head h4 { color: var(--muted); }
/* ---------- 扫码导入：二维码自适应，避免被弹窗裁切 ---------- */
.qrbox {
  width: 100%; max-width: 300px; margin: 0 auto; padding: 12px; box-sizing: border-box;
  background: #fff; border-radius: 12px; box-shadow: 0 1px 0 rgba(0, 0, 0, .04);
}
.qrbox > svg { display: block; width: 100%; height: auto; }
/* ---------- 窄视口：表格与行内按钮条自适应 ---------- */
/* 782px 左右的窗口：侧栏 196px 之后只剩 546px，数据库 / 计划任务等表格的行内操作
   按钮会被 .table-wrap 的横向滚动裁到右边，点到的是 main 容器。桌面端（≥1200px）不受影响，
   下面所有规则都限定在媒体查询里。 */
@media (max-width: 1100px) {
  /* 按钮条容不下时换行，而不是把后面的按钮挤出可视区 */
  .row, .card-head { flex-wrap: wrap; }

  /* 长文件名 / 编码 / 时间不再把整张表撑出视口；anywhere 会参与最小宽度计算 */
  .table-wrap table td { overflow-wrap: anywhere; }
  .table-wrap table td.nowrap { white-space: normal; }

  /* 操作列：按钮允许折行，列宽不再等于一整排按钮的宽度；
     表格仍比容器宽时吸附在右边（兜底），按钮始终可见、可点击 */
  td.actions {
    white-space: normal;
    position: sticky; right: 0;
    background: var(--panel);
    box-shadow: inset 1px 0 0 var(--line);
  }
  td.actions .btn { margin: 2px 0; }
  td.actions .btn + .btn { margin-left: 5px; }
  .table-wrap tbody tr:hover td.actions { background: var(--row-hover); }
  .table-wrap tbody tr.selected td.actions { background: var(--row-hover); }
}