/* ════════════════════════════════════════════════════════════════
   TG Joiner — topbar + left sidebar + right console
   ════════════════════════════════════════════════════════════════ */

:root {
  /* ══ 清新风格 · Fresh palette ══
     思路:奶白底 + 薄荷绿主色 + 天蓝点缀,圆角稍大,阴影很浅。 */

  /* 背景与表面 */
  --bg: #f3f9f6;                  /* 页面整体:很淡的薄荷底 */
  --surface: #ffffff;             /* 卡片/面板:纯白 */
  --surface-2: #f6fbf9;           /* 次级面板:半度薄荷 */
  --surface-hover: #edf6f1;

  /* 边框 */
  --border: #e2ede8;
  --border-strong: #c8dbd2;

  /* 文字 */
  --text: #1d2a2e;                /* 主文字:墨青 */
  --text-muted: #6b7c82;
  --text-faint: #9aa9ad;

  /* 品牌绿 —— 用作 accent(高亮)与 primary(主操作)*/
  --mint:         #5ec29a;        /* 主薄荷 */
  --mint-strong:  #3da77e;        /* hover */
  --mint-soft:    #dcf1e6;        /* 徽章/tag 背景 */

  /* 点缀色 */
  --sky:          #7cc0e4;        /* 天蓝:info */
  --sky-soft:     #dcecf6;
  --peach:        #f5b971;        /* 桃色:warning */
  --peach-soft:   #fdecd2;
  --coral:        #ef7066;        /* 珊瑚:danger(比正红柔和)*/
  --coral-strong: #d85b53;
  --coral-soft:   #fde1dd;

  /* 语义别名(保持原有变量名以兼容其它规则)*/
  --accent:        var(--mint);
  --accent-strong: var(--mint-strong);
  --primary:       var(--mint-strong);    /* primary 按钮 = 深薄荷,不再是黑 */
  --primary-hover: #2e8b66;
  --danger:        var(--coral);
  --danger-hover:  var(--coral-strong);

  /* 形状与阴影 */
  --radius: 18px;
  --radius-sm: 12px;
  --radius-pill: 999px;
  --shadow-sm: 0 1px 2px rgba(60, 110, 90, 0.05);
  --shadow:    0 6px 20px rgba(60, 110, 90, 0.08);
  --shadow-lg: 0 16px 48px rgba(40, 90, 70, 0.14);

  /* Layout */
  --topbar-h: 58px;
  --sidebar-w: 180px;
  --console-w: 360px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI",
               "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h2 { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; margin: 0 0 20px; }
h3 { font-size: 18px; font-weight: 600; margin: 0 0 14px; }
h4 { font-size: 14px; font-weight: 600; margin: 0 0 8px; }

/* ══════════════ Top bar (config pages) ══════════════ */
#topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 28px;
  z-index: 150;
  box-shadow: var(--shadow-sm);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.01em;
  color: var(--text);
  flex-shrink: 0;
  padding-right: 24px;
  border-right: 1px solid var(--border);
  height: 100%;
  line-height: var(--topbar-h);
}
.brand-icon {
  font-size: 22px;
  filter: drop-shadow(0 1px 2px rgba(94, 194, 154, 0.45));
}

#topnav {
  display: flex;
  gap: 4px;
  flex: 1;
  overflow-x: auto;
}
#topnav a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: var(--radius-pill);
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 14px;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}
#topnav a:hover { background: var(--surface-2); color: var(--text); }
#topnav a.active {
  background: var(--mint-soft);
  color: var(--mint-strong);
  font-weight: 600;
}
#topnav a .nav-ico { font-size: 15px; }

.topbar-right {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
  font-size: 12px;
}
.ws-disconnected { color: var(--coral); font-weight: 500; }
.ws-connected    { color: var(--mint-strong); font-weight: 500; }

/* ══════════════ Left sidebar (functional pages) ══════════════ */
#sidebar {
  position: fixed;
  top: var(--topbar-h);
  left: 0;
  bottom: 0;
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 18px 12px;
  display: flex;
  flex-direction: column;
  z-index: 100;
}
.sidebar-section-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  padding: 6px 12px 10px;
  font-weight: 600;
}
#nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
#nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-muted);
  text-decoration: none;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: 14px;
  transition: background 0.15s, color 0.15s;
}
#nav a .nav-ico {
  font-size: 17px;
  width: 22px;
  text-align: center;
}
#nav a:hover { background: var(--surface-2); color: var(--text); }
#nav a.active {
  background: var(--mint-soft);
  color: var(--mint-strong);
  font-weight: 600;
}

/* ══════════════ Main content ══════════════ */
main {
  position: fixed;
  top: var(--topbar-h);
  left: var(--sidebar-w);
  right: var(--console-w);
  bottom: 0;
  overflow-y: auto;
  padding: 28px 32px;
}

.alert {
  position: fixed;
  top: calc(var(--topbar-h) + 14px);
  right: calc(var(--console-w) + 20px);
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--mint);
  border-left: 4px solid var(--mint);
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow);
  z-index: 500;
  max-width: 420px;
  white-space: pre-wrap;
  line-height: 1.5;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 22px;
  border-radius: var(--radius);
  margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
}

/* ══════════════ Dashboard cards ══════════════ */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 20px;
  border-radius: var(--radius);
  transition: border-color 0.2s;
}
.card:hover { border-color: var(--border-strong); }
.card h4 {
  margin: 0 0 12px;
  color: var(--text-muted);
  font-weight: 500;
  font-size: 13px;
}
.card .num {
  font-size: 32px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.card .sub { color: var(--text-faint); font-size: 12px; margin-top: 6px; }

/* ══════════════ Tables ══════════════ */
table {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-collapse: separate;
  border-spacing: 0;
  border-radius: var(--radius);
  overflow: hidden;
}
th, td {
  padding: 13px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
th {
  background: var(--surface-2);
  font-weight: 600;
  color: var(--text-muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--surface-2); }

/* ══════════════ Forms ══════════════ */
input, select, textarea {
  font: inherit;
  padding: 9px 13px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--mint);
  box-shadow: 0 0 0 3px rgba(94, 194, 154, 0.18);
}
textarea {
  font-family: 'SF Mono', Menlo, Consolas, monospace;
  font-size: 12px;
  width: 100%;
  line-height: 1.5;
  resize: vertical;
}
input[type="file"] { padding: 7px; }

/* ══════════════ Buttons ══════════════ */
button {
  font: inherit;
  font-weight: 500;
  padding: 8px 16px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
  position: relative;
}
button:hover:not(:disabled) {
  background: var(--surface-2);
  border-color: var(--text-muted);
}
button:active:not(:disabled) { transform: scale(0.98); }
button:disabled { opacity: 0.55; cursor: not-allowed; }
button.primary {
  background: var(--primary);
  color: var(--surface);
  border-color: var(--primary);
}
button.primary:hover:not(:disabled) {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
}
button.accent {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
  font-weight: 600;
}
button.accent:hover:not(:disabled) {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
}
button.danger {
  background: var(--danger);
  color: white;
  border-color: var(--danger);
}
button.danger:hover:not(:disabled) {
  background: var(--danger-hover);
  border-color: var(--danger-hover);
}

button.is-loading { color: transparent !important; pointer-events: none; }
button.is-loading::after {
  content: "";
  position: absolute;
  top: 50%; left: 50%;
  width: 14px; height: 14px;
  margin: -7px 0 0 -7px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  color: var(--text);
}
button.primary.is-loading::after,
button.danger.is-loading::after { color: white; }
@keyframes spin { to { transform: rotate(360deg); } }

.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.form-row { display: flex; align-items: center; gap: 12px; margin: 12px 0; flex-wrap: wrap; }
.form-row label { min-width: 110px; color: var(--text-muted); font-weight: 500; }
.form-row input, .form-row select { flex: 1; max-width: 420px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 900px) { .grid-2 { grid-template-columns: 1fr; } }
.hint { color: var(--text-muted); font-size: 12px; margin: 10px 0; line-height: 1.6; }

/* ══════════════ Account picker ══════════════ */
.acc-picker { display: flex; align-items: center; gap: 10px; }
.acc-checkbox-list {
  max-height: 220px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  background: var(--surface-2);
}
.acc-checkbox-list label,
.acc-checkbox-list .acc-pill {
  display: inline-block;
  margin: 4px 6px 4px 0;
  padding: 6px 12px;
  background: var(--surface);
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  cursor: pointer;
  font-size: 12px;
  transition: all 0.15s;
  user-select: none;
}
.acc-checkbox-list label:hover,
.acc-checkbox-list .acc-pill:hover { border-color: var(--border-strong); }
.acc-checkbox-list label.selected,
.acc-checkbox-list .acc-pill.selected {
  background: var(--text);
  color: var(--surface);
  border-color: var(--text);
}
.acc-checkbox-list .acc-pill.busy {
  background: repeating-linear-gradient(
    45deg,
    var(--surface),
    var(--surface) 6px,
    rgba(128,128,128,0.12) 6px,
    rgba(128,128,128,0.12) 12px
  );
  color: var(--muted, #999);
  border-color: var(--border);
  cursor: not-allowed;
  opacity: 0.6;
}
.acc-checkbox-list .acc-pill.busy:hover { border-color: var(--border); opacity: 0.8; }

/* ══════════════ Badges ══════════════ */
.badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 600;
}
.badge.active    { background: var(--mint-soft);  color: var(--mint-strong); }
.badge.pending   { background: var(--peach-soft); color: #9a6814; }
.badge.dead      { background: var(--coral-soft); color: var(--coral-strong); }
.badge.trashed   { background: #eef2f1;           color: #5a6a6e; }
.badge.joined    { background: var(--mint-soft);  color: var(--mint-strong); }
.badge.failed    { background: var(--coral-soft); color: var(--coral-strong); }
.badge.flood_wait{ background: var(--peach-soft); color: #a05a10; }
.badge.running   { background: var(--sky-soft);   color: #2a7aa3; }
.badge.done      { background: var(--mint-soft);  color: var(--mint-strong); }
.badge.stopped   { background: #eef2f1;           color: #5a6a6e; }
.badge.stopping  { background: var(--peach-soft); color: #9a6814; }
.badge.cooling   { background: var(--sky-soft);   color: #2a7aa3; }

/* ══════════════ Usage indicator ══════════════ */
.usage {
  display: inline-block;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.usage-ok   { background: var(--mint-soft);  color: var(--mint-strong); }
.usage-warn { background: var(--peach-soft); color: #9a6814; }
.usage-bad  { background: var(--coral-soft); color: var(--coral-strong); }

button.mini {
  padding: 3px 8px;
  font-size: 11px;
  margin-left: 6px;
  border-radius: var(--radius-pill);
}

.toolbar-sep {
  width: 1px;
  height: 22px;
  background: var(--border);
  display: inline-block;
  margin: 0 4px;
}

/* ══════════════ Task cards ══════════════ */
.task-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 12px;
}
.task-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
}
.task-card-header h4 { margin: 0; font-size: 15px; }
.task-card-progress {
  height: 8px;
  background: var(--border);
  border-radius: var(--radius-pill);
  overflow: hidden;
  margin: 14px 0;
}
.task-card-progress-bar {
  height: 100%;
  background: var(--accent);
  transition: width 0.3s;
}
.task-card-detail {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.task-card-detail table { border: none; }

/* ══════════════ Right-side console ══════════════ */
/* ══════════════ Console (dark terminal theme) ══════════════
   右侧日志面板独立于清新主色,用深底白字风格,像真实终端。
   主色仍沿用 --mint 系列做高亮,保持与整体呼应。 */
#console {
  position: fixed;
  top: var(--topbar-h);
  right: 0;
  bottom: 0;
  width: var(--console-w);
  background: #121a17;                /* 深墨绿 / 近黑 */
  color: #e8f1ec;                     /* 主文字:近白偏绿 */
  font-family: 'SF Mono', Menlo, Consolas, monospace;
  font-size: 12px;
  z-index: 120;
  display: flex;
  flex-direction: column;
  border-left: 1px solid #0b120f;
  box-shadow: -4px 0 16px rgba(0, 0, 0, 0.18);
}
#console-resize {
  position: fixed;
  top: var(--topbar-h);
  bottom: 0;
  right: var(--console-w);
  width: 6px;
  background: transparent;
  cursor: ew-resize;
  z-index: 121;
  transition: background 0.15s;
}
#console-resize:hover, #console-resize.dragging { background: var(--mint); }

.console-header {
  background: #1a2420;                /* 比正文稍亮的 header 条 */
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid #263330;
  font-size: 11px;
  flex-wrap: wrap;
}
.console-header label {
  color: #b7c9c0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  font-size: 11px;
}
.console-header input[type="checkbox"] { accent-color: var(--mint); }
.console-header button {
  background: #243330;
  color: #e8f1ec;
  border: 1px solid #32433f;
  padding: 4px 11px;
  font-size: 11px;
  border-radius: var(--radius-pill);
}
.console-header button:hover:not(:disabled) {
  background: var(--mint);
  color: #0f1a17;
  border-color: var(--mint);
}

#console-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px 14px;
}
#console-body .line {
  line-height: 1.6;
  word-wrap: break-word;
  white-space: pre-wrap;
  padding: 2px 0;
  color: #e8f1ec;                     /* 默认白字 */
}
#console-body .line.progress { color: #e8f1ec; }
#console-body .line.error    { color: #ff8a80; }   /* 柔和亮红,在深底上清晰 */

/* console tabs + persistent log */
.console-tabs { display: inline-flex; gap: 6px; }
.console-tab {
  background: #243330;
  color: #b7c9c0;
  border: 1px solid #32433f;
  padding: 5px 14px;
  font-size: 11px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  font-weight: 500;
  transition: all 0.15s;
}
.console-tab:hover {
  background: #2e3f3a;
  color: #e8f1ec;
  border-color: #3d524d;
}
.console-tab.active {
  background: var(--mint);
  color: #0f1a17;
  border-color: var(--mint);
  font-weight: 700;
  box-shadow: 0 0 0 3px rgba(94, 194, 154, 0.18);
}
.console-tab-tools {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  color: #b7c9c0;
}
#persistent-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px 14px;
  color: #e8f1ec;
}
#persistent-body .plog-line {
  display: flex;
  flex-direction: column;
  gap: 3px;
  line-height: 1.6;
  padding: 8px 0;
  border-bottom: 1px dashed #263330;
  word-break: break-word;
}
#persistent-body .plog-ts { color: #7a8f86; font-size: 10px; }
#persistent-body .plog-cat {
  display: inline-block;
  padding: 1px 8px;
  border-radius: var(--radius-pill);
  font-size: 10px;
  height: 16px;
  line-height: 14px;
  align-self: flex-start;
  font-weight: 600;
}
#persistent-body .plog-cat-err  { background: rgba(255, 138, 128, 0.18); color: #ff8a80; border: 1px solid rgba(255, 138, 128, 0.35); }
#persistent-body .plog-cat-fail { background: rgba(245, 185, 113, 0.18); color: #f5b971; border: 1px solid rgba(245, 185, 113, 0.35); }
#persistent-body .plog-msg { white-space: pre-wrap; color: #e8f1ec; }
#persistent-body .plog-line.err  { color: #ff8a80; }
#persistent-body .plog-line.fail { color: #f5b971; }

/* dark console scrollbar */
#console-body::-webkit-scrollbar,
#persistent-body::-webkit-scrollbar { width: 8px; }
#console-body::-webkit-scrollbar-thumb,
#persistent-body::-webkit-scrollbar-thumb {
  background: #2e3f3a;
  border-radius: 4px;
}
#console-body::-webkit-scrollbar-thumb:hover,
#persistent-body::-webkit-scrollbar-thumb:hover { background: #3d524d; }
#console-body::-webkit-scrollbar-track,
#persistent-body::-webkit-scrollbar-track { background: transparent; }

/* ══════════════ Modal ══════════════ */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(40, 90, 70, 0.35);
  align-items: center;
  justify-content: center;
  z-index: 1000;
  display: none;
  padding: 20px;
}
.modal:not([hidden]) { display: flex; }
.modal-content {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 32px;
  border-radius: var(--radius);
  max-width: 560px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  position: relative;
  box-shadow: var(--shadow-lg);
}
.modal-content h3 {
  margin-top: 0;
  font-size: 20px;
  padding-right: 32px;
}
.close {
  position: absolute;
  top: 20px;
  right: 22px;
  font-size: 24px;
  cursor: pointer;
  color: var(--text-muted);
  line-height: 1;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.15s;
}
.close:hover { background: var(--surface-2); color: var(--text); }

/* ══════════════ Misc ══════════════ */
.text-mono { font-family: 'SF Mono', Menlo, Consolas, monospace; font-size: 11px; }
.muted { color: var(--text-muted); }
.actions { display: flex; gap: 6px; }
.actions button { padding: 6px 12px; font-size: 12px; }

.probe-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 8px;
}
.probe-detail-grid h4 { margin: 0 0 6px 0; font-size: 13px; }

/* ══════════════ Responsive ══════════════ */
@media (max-width: 1100px) {
  :root { --console-w: 300px; --sidebar-w: 160px; }
}
@media (max-width: 860px) {
  :root { --sidebar-w: 58px; --console-w: 260px; }
  #sidebar { padding: 12px 6px; }
  #nav a { justify-content: center; padding: 10px 6px; }
  #nav a span:not(.nav-ico) { display: none; }
  .sidebar-section-title { display: none; }
  .brand-text { display: none; }
  .brand { padding-right: 14px; }
  main { padding: 20px 16px; }
  #topnav a span:not(.nav-ico) { display: none; }
  #topnav a { padding: 9px 12px; }
}

/* ══════════════ Folder strip (accounts / groups) ══════════════ */
.folder-strip-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}
.folder-strip-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  font-weight: 600;
}
.folder-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.folder-card {
  position: relative;
  min-width: 140px;
  padding: 12px 14px 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}
.folder-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-1px);
}
.folder-card.active {
  border-color: var(--mint);
  background: var(--mint-soft);
  box-shadow: 0 0 0 3px rgba(94, 194, 154, 0.18);
}
.folder-card.active .folder-name { color: var(--mint-strong); }
.folder-card .folder-name {
  font-weight: 600;
  font-size: 13px;
  margin-bottom: 2px;
  padding-right: 18px;
}
.folder-card .folder-count {
  font-size: 11px;
}
.folder-card .folder-del {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 18px;
  height: 18px;
  border: none;
  background: transparent;
  color: var(--text-faint);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 0;
  border-radius: 4px;
}
.folder-card .folder-del:hover {
  background: var(--danger);
  color: #fff;
}
.folder-tag {
  display: inline-block;
  padding: 2px 10px;
  margin: 1px 2px;
  background: var(--mint-soft);
  color: var(--mint-strong);
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 500;
}

/* ══════════════ Drag-select rubber band ══════════════ */
.drag-host {
  position: relative;
  user-select: none;
}
.drag-rect {
  position: absolute;
  border: 1.5px solid var(--primary);
  background: rgba(94, 194, 154, 0.12);
  pointer-events: none;
  z-index: 50;
  border-radius: 3px;
}
.selectable-table tbody tr.row-selected {
  background: rgba(94, 194, 154, 0.14);
}
.selectable-table tbody tr.row-selected td {
  border-top-color: var(--accent-strong);
}

/* ══════════════ Task account picker (compact table) ══════════════ */
.compact-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.compact-table thead th {
  text-align: left;
  padding: 8px 10px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  color: var(--text-muted);
  font-size: 12px;
  position: sticky;
  top: 0;
  z-index: 2;
}
.compact-table tbody td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.compact-table tbody tr:hover:not(.busy) {
  background: rgba(94, 194, 154, 0.06);
  cursor: pointer;
}
.compact-table tbody tr.busy {
  opacity: 0.55;
  background: repeating-linear-gradient(
    45deg,
    transparent 0, transparent 6px,
    rgba(0,0,0,0.03) 6px, rgba(0,0,0,0.03) 12px
  );
  cursor: not-allowed;
}
.compact-table tbody tr.busy:hover { opacity: 0.7; }

#page-tasks .drag-host,
#page-probe .drag-host {
  max-height: 360px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  margin-bottom: 12px;
}

/* ═══════════════════════════════════════════════════════════════
   登录 / 修改密码 / 退出
   ═══════════════════════════════════════════════════════════════ */
.topbar-btn {
  margin-left: 10px;
  padding: 6px 12px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 6px;
  color: #e2e8f0;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
}
.topbar-btn:hover {
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.24);
}

.pwd-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}
.pwd-modal[hidden] { display: none; }
.pwd-modal-box {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 10px;
  padding: 28px 32px;
  width: 380px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.pwd-modal-title {
  font-size: 17px;
  font-weight: 600;
  color: #f1f5f9;
  margin-bottom: 6px;
}
.pwd-modal-hint {
  font-size: 12px;
  color: #f59e0b;
  margin-bottom: 18px;
}
.pwd-modal-box label {
  display: block;
  font-size: 13px;
  color: #cbd5e1;
  margin: 10px 0 5px;
}
.pwd-modal-box input[type=password] {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid #475569;
  border-radius: 6px;
  background: #0f172a;
  color: #f1f5f9;
  font-size: 14px;
  outline: none;
}
.pwd-modal-box input[type=password]:focus { border-color: #3b82f6; }
.pwd-modal-actions {
  margin-top: 22px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* 用户名定位高亮 */
tr.row-highlighted {
  background: #fff7a8 !important;
  animation: rowFlash 2.5s ease-out;
}
@keyframes rowFlash {
  0%   { background: #ffe066; }
  60%  { background: #fff7a8; }
  100% { background: transparent; }
}

/* ═══ 私信(DM)页面 ═══ */
.dm-tab-btn,
.gs-tab-btn {
  background: var(--bg2, #2a2a3a);
  border: 1px solid var(--border, #444);
  color: var(--fg, #ccc);
  padding: 4px 14px;
  cursor: pointer;
  border-radius: 4px;
  font-size: 13px;
}
.dm-tab-btn.active,
.gs-tab-btn.active {
  background: var(--accent, #5b8def);
  color: #fff;
  border-color: var(--accent, #5b8def);
}
.pager {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0;
  font-size: 13px;
}
.pager button {
  padding: 2px 10px;
}
