/* ============================================================
   Lumin SSH — Design System v2
   中性蓝灰色调 · 现代 UI/UX · 深/浅双模式
   ============================================================ */

/* Lucide 图标全局垂直居中对齐 */
svg[class*="lucide"] {
  vertical-align: middle;
  flex-shrink: 0;
}

/* ── 设计 Token：深色模式（默认） ──────────────────────────── */
:root {
  color-scheme: dark;

  /* ── 语义化背景层级（冷蓝色调，告别纯灰） ── */
  --surface-base:      #0e1218;  /* 应用底色 — 微蓝 */
  --surface-raised:    #131922;  /* 顶栏/面板 — 冷蓝 */
  --surface-overlay:   #192030;  /* 卡片/模态框 — 明显蓝 */
  --surface-sunken:    #1c2333;  /* 输入框/凹陷区 */
  --surface-hover:     #262f40;  /* hover 态 */
  --surface-active:    #2f3a50;  /* active/选中态 */

  /* ── 边框（暖色倾向，打破灰调） ── */
  --border:        rgba(56, 68, 90, 0.7);
  --border-light:  rgba(56, 68, 90, 0.35);
  --border-subtle: rgba(56, 68, 90, 0.4);
  --border-focus:  #4d9eff;

  /* ── 文本层级 ── */
  --text-primary:    #eaf0f7;   /* 主文本 — 微蓝白 */
  --text-secondary:  #96a2b3;   /* 次文本 — 蓝灰 */
  --text-tertiary:   #818fa0;   /* 辅助文本 — 4.5:1 WCAG AA */
  --text-muted:      #5a6578;   /* 最弱文本/占位符 — 3:1 WCAG AA UI */

  /* ── 语义化强调色（更鲜明） ── */
  --accent:         #4d9eff;    /* 主强调（亮蓝） */
  --accent-rgb:     77, 158, 255;
  --accent-hover:   #69adff;
  --accent-dim:     rgba(77, 158, 255, 0.12);
  --accent-border:  rgba(77, 158, 255, 0.30);

  --success-rgb:   63, 185, 80;
  --danger-rgb:    255, 96, 89;
  --warning-rgb:   230, 170, 50;

  --success:        #3fb950;    /* 成功/在线（绿） */
  --success-dim:    rgba(63, 185, 80, 0.12);

  --danger:         #ff6059;    /* 危险/错误 — 更鲜明 */
  --danger-dim:     rgba(255, 96, 89, 0.12);

  --warning:        #e6aa32;    /* 警告/连接中 — 更暖 */
  --warning-dim:    rgba(230, 170, 50, 0.12);

  --info:           #b88aff;    /* 信息/装饰（紫）— 更亮 */
  --info-rgb:       184, 138, 255;
  --info-dim:       rgba(184, 138, 255, 0.12);

  /* ── 阴影（带冷蓝色调） ── */
  --shadow-xs:  0 1px 2px rgba(0, 5, 20, 0.3);
  --shadow-sm:  0 2px 4px rgba(0, 5, 20, 0.35);
  --shadow-md:  0 4px 12px rgba(0, 5, 20, 0.45);
  --shadow-lg:  0 8px 28px rgba(0, 5, 20, 0.55);
  --shadow-xl:  0 16px 48px rgba(0, 5, 20, 0.65);

  /* ── 间距 Token（4px 基准） ── */
  --space-0:  0;
  --space-1:  4px;
  --space-2:  8px;
  --space-3:  12px;
  --space-4:  16px;
  --space-5:  20px;
  --space-6:  24px;
  --space-8:  32px;
  --space-10: 40px;

  /* ── 字号 Token ── */
  --text-xs:    11px;
  --text-sm:    12px;
  --text-base:  13px;
  --text-md:    14px;
  --text-lg:    16px;
  --text-xl:    18px;
  --text-2xl:   20px;
  --text-3xl:   24px;

  /* ── 圆角 Token ── */
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 9999px;

  /* ── 过渡 ── */
  --transition:       all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast:  all 0.1s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow:  all 0.3s cubic-bezier(0.4, 0, 0.2, 1);

  /* ── 字体 ── */
  --font-ui:   'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;

  /* ── 布局 ── */
  --topbar-h:  44px;
  --probe-w:   300px;
}

/* ── 设计 Token：浅色模式（暖灰色调） ───────────────────────── */
body.theme-light {
  color-scheme: light;

  /* ── 暖灰色调表面层（告别冷蓝灰） ── */
  --surface-base:      #f4f1ee;  /* 微暖底色 */
  --surface-raised:    #fefdfb;  /* 顶栏/面板 — 暖白 */
  --surface-overlay:   #fefdfb;  /* 卡片/模态框 */
  --surface-sunken:    #eae6e1;  /* 输入框/凹陷区 — 暖灰 */
  --surface-hover:     #e0dbd5;  /* hover 态 */
  --surface-active:    #d4cec7;  /* active/选中态 */

  --border:        rgba(60, 50, 40, 0.15);
  --border-light:  rgba(60, 50, 40, 0.08);
  --border-subtle: rgba(60, 50, 40, 0.10);
  --border-focus:  #2563eb;

  --text-primary:    #1c1917;   /* 暖黑主文本 */
  --text-secondary:  #57534e;   /* 暖灰次文本 */
  --text-tertiary:   #78716c;   /* 暖灰辅助文本 */
  --text-muted:      #a8a29e;   /* 暖灰占位符 */

  --accent:         #2563eb;   /* 主强调（鲜明蓝） */
  --accent-rgb:     37, 99, 235;
  --accent-hover:   #1d4ed8;
  --accent-dim:     rgba(37, 99, 235, 0.08);
  --accent-border:  rgba(37, 99, 235, 0.25);

  --success-rgb:   22, 163, 74;
  --danger-rgb:    220, 38, 38;
  --warning-rgb:   202, 138, 4;

  --success:        #16a34a;
  --success-dim:    rgba(22, 163, 74, 0.08);

  --danger:         #dc2626;
  --danger-dim:     rgba(220, 38, 38, 0.08);

  --warning:        #ca8a04;
  --warning-dim:    rgba(202, 138, 4, 0.08);

  --info:           #7c3aed;
  --info-rgb:       124, 58, 237;
  --info-dim:       rgba(124, 58, 237, 0.08);

  --shadow-xs:  0 1px 2px rgba(28, 25, 23, 0.05);
  --shadow-sm:  0 2px 4px rgba(28, 25, 23, 0.07);
  --shadow-md:  0 4px 10px rgba(28, 25, 23, 0.09);
  --shadow-lg:  0 8px 20px rgba(28, 25, 23, 0.11);
  --shadow-xl:  0 16px 36px rgba(28, 25, 23, 0.15);
}

.mention-context-textarea-highlight {
  background-color: color-mix(in srgb, var(--info) 26%, transparent);
  border-radius: 3px;
  box-shadow: 0 0 0 0.5px color-mix(in srgb, var(--info) 34%, transparent);
  color: transparent;
}

/* ── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body, #root {
  height: 100%;
  overflow: hidden;
  background: transparent;
  color: var(--text-primary);
  font-family: var(--font-ui);
  font-size: var(--text-base);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button { cursor: pointer; border: none; background: none; font-family: inherit; font-size: inherit; color: inherit; }
input, textarea, select { font-family: inherit; }
a { color: var(--accent); text-decoration: none; }

/* ── 键盘焦点环（仅键盘导航时显示） ──────────────────────────── */
:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 2px;
}
button:focus:not(:focus-visible),
a:focus:not(:focus-visible),
input:focus:not(:focus-visible),
select:focus:not(:focus-visible),
textarea:focus:not(:focus-visible) {
  outline: none;
}

/* ── 滚动条 ─────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ── 主布局 ─────────────────────────────────────────────────── */
.app-layout {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100vw;
  background: var(--surface-base);
  overflow: hidden;
  position: relative;
  color: var(--text-secondary);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
}

/* ── 顶栏 ───────────────────────────────────────────────────── */
.topbar {
  display: flex;
  align-items: center;
  height: var(--topbar-h);
  background: var(--surface-raised);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0 var(--space-2);
  --wails-draggable: drag;
  flex-shrink: 0;
  position: relative;
  z-index: 10000;
}

.topbar-content {
  display: flex;
  align-items: center;
  width: 100%;
  height: 100%;
  gap: var(--space-2);
}

.topbar-content button,
.topbar-content input,
.topbar-content .no-drag {
  --wails-draggable: no-drag;
}

.topbar-logo {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-right: var(--space-1);
  cursor: pointer;
  user-select: none;
  min-width: 0;
}

.topbar-logo img {
  width: 24px;
  height: 24px;
  border-radius: var(--radius-sm);
}

.topbar-title {
  font-size: var(--text-md);
  font-weight: 650;
  color: var(--text-primary);
  letter-spacing: -0.2px;
}

.window-controls {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  margin-left: auto;
}

.window-controls .btn-icon {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
}

.update-entry {
  isolation: isolate;
}

.update-entry-button {
  position: relative;
}

.update-entry-button.active {
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  border-color: color-mix(in srgb, var(--accent) 20%, transparent);
}

.update-entry-badge {
  z-index: 2;
}

.update-bubble {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 8px 13px 8px 12px;
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--warning) 42%, var(--accent));
  background:
    linear-gradient(135deg, rgba(var(--warning-rgb), 0.26), transparent 42%),
    linear-gradient(225deg, rgba(var(--accent-rgb), 0.2), transparent 60%),
    color-mix(in srgb, var(--surface-overlay) 97%, transparent);
  color: var(--text-primary);
  box-shadow:
    0 14px 30px rgba(0, 0, 0, 0.34),
    0 0 0 1px rgba(var(--warning-rgb), 0.12),
    0 0 24px rgba(var(--warning-rgb), 0.22),
    0 0 38px rgba(var(--accent-rgb), 0.16);
  transform-origin: top right;
  transition: opacity 0.22s ease, transform 0.22s ease;
  backdrop-filter: blur(12px);
}

.update-bubble.visible {
  animation: updateBubbleAttention 1.1s ease-in-out infinite;
}

.update-bubble::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.16), transparent 32%, transparent 68%, rgba(var(--warning-rgb), 0.14));
  opacity: 0.9;
  pointer-events: none;
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  padding: 1px;
}

.update-bubble::after {
  content: "";
  position: absolute;
  top: -6px;
  right: 18px;
  width: 12px;
  height: 12px;
  border-top: 1px solid color-mix(in srgb, var(--warning) 42%, var(--accent));
  border-left: 1px solid color-mix(in srgb, var(--warning) 42%, var(--accent));
  background: color-mix(in srgb, var(--surface-overlay) 99%, transparent);
  transform: rotate(45deg);
}

.update-bubble.visible .update-bubble-pulse {
  animation: updateBubblePulse 1.05s ease-out infinite;
}

.update-bubble-dot {
  position: relative;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(180deg, #fff, color-mix(in srgb, var(--warning) 84%, #fff));
  box-shadow:
    0 0 0 5px rgba(var(--warning-rgb), 0.18),
    0 0 12px rgba(var(--warning-rgb), 0.54);
  flex-shrink: 0;
  z-index: 1;
}

.update-bubble-pulse {
  position: absolute;
  left: 8px;
  top: 50%;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  border: 1px solid rgba(var(--warning-rgb), 0.48);
  transform: translateY(-50%) scale(0.72);
  opacity: 0;
  pointer-events: none;
}

.update-bubble-content {
  display: flex;
  flex-direction: column;
  gap: 3px;
  position: relative;
  z-index: 1;
}

.update-bubble-pill {
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.08em;
  color: var(--warning);
  text-transform: uppercase;
}

.update-bubble-text {
  font-size: 13px;
  font-weight: 800;
  line-height: 1.05;
  white-space: nowrap;
}

body.theme-light .update-bubble {
  border-color: color-mix(in srgb, var(--warning) 30%, var(--accent));
  background:
    linear-gradient(135deg, rgba(var(--warning-rgb), 0.14), transparent 42%),
    linear-gradient(225deg, rgba(var(--accent-rgb), 0.1), transparent 60%),
    color-mix(in srgb, var(--surface-raised) 99%, transparent);
  box-shadow:
    0 12px 24px rgba(52, 44, 34, 0.14),
    0 0 0 1px rgba(var(--warning-rgb), 0.08),
    0 0 18px rgba(var(--warning-rgb), 0.12),
    0 0 26px rgba(var(--accent-rgb), 0.08);
}

body.theme-light .update-bubble::after {
  border-top-color: color-mix(in srgb, var(--warning) 30%, var(--accent));
  border-left-color: color-mix(in srgb, var(--warning) 30%, var(--accent));
  background: color-mix(in srgb, var(--surface-raised) 99%, transparent);
}

.window-divider {
  width: 1px;
  height: 18px;
  background: var(--border);
  margin: 0 var(--space-2);
}

/* ── 主区域 ─────────────────────────────────────────────────── */
.main-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--surface-base);
}

/* ── 按钮系统 ───────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  min-height: 28px;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  font-weight: 500;
  line-height: 1;
  transition: var(--transition-fast);
  white-space: nowrap;
  border: 1px solid var(--border);
  background: var(--surface-raised);
  color: var(--text-secondary);
}

.btn:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
  border-color: var(--border-focus);
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.btn-primary:hover {
  background: var(--accent-hover);
  color: #fff;
  border-color: var(--accent-hover);
}
.btn-primary:active { background: var(--accent); }

.btn-success {
  background: var(--success);
  color: #fff;
  border-color: var(--success);
}
.btn-success:hover {
  background: color-mix(in srgb, var(--success) 88%, #ffffff);
  color: #fff;
  border-color: color-mix(in srgb, var(--success) 88%, #ffffff);
}
.btn-success:active { background: var(--success); }

.btn-secondary {
  background: var(--surface-raised);
  color: var(--text-secondary);
  border-color: var(--border);
}
.btn-secondary:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
  border-color: var(--border-focus);
}

.btn-ghost {
  background: transparent;
  color: var(--text-tertiary);
  border-color: transparent;
  padding: 4px 8px;
}
.btn-ghost:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
  border-color: var(--border);
}

.btn-danger {
  background: transparent;
  color: var(--danger);
  border-color: rgba(var(--danger-rgb), 0.35);
}
.btn-danger:hover {
  background: var(--danger-dim);
  color: var(--danger);
  border-color: var(--danger);
}

.btn-sm { min-height: 24px; padding: 4px 8px; font-size: var(--text-xs); }
.btn-icon { width: 28px; min-width: 28px; height: 28px; padding: 0; border-radius: var(--radius-sm); }
.btn-block { width: 100%; padding: 6px 10px; font-size: var(--text-sm); font-weight: 600; justify-content: center; }

.btn:disabled, .btn[disabled] { opacity: 0.45; cursor: not-allowed; pointer-events: none; }

/* ── 输入框 ─────────────────────────────────────────────────── */
.input, .select {
  width: 100%;
  min-height: 30px;
  padding: 5px 10px;
  background: var(--surface-sunken);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: var(--text-sm);
  outline: none;
  transition: var(--transition-fast);
}
.input:focus, .select:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 2px var(--accent-dim);
  outline: none;
}
.input::placeholder { color: var(--text-muted); }

.select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236e7681' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--space-3) center;
  padding-right: var(--space-8);
}

.form-group { display: flex; flex-direction: column; gap: var(--space-1); }
.form-label { font-size: var(--text-xs); font-weight: 500; color: var(--text-tertiary); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); }

/* ── 卡片 ───────────────────────────────────────────────────── */
.card {
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  position: relative;
  overflow: hidden;
}
.card::before { content: none; }

/* ── 状态点 ─────────────────────────────────────────────────── */
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
}
.status-dot.online { background: var(--success); }
.status-dot.offline { background: var(--text-muted); }
.status-dot.connecting {
  background: var(--warning);
  animation: pulse-warning 1s infinite;
}
.status-dot.just-connected { background: var(--success); }

@keyframes pulse-warning {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ── 模态框 ─────────────────────────────────────────────────── */

/* 关于页链接卡片 — 需要可见边框与背景区分 */
.about-list-item {
  border: 1px solid var(--border);
}
.about-list-item:hover {
  border-color: var(--accent-border);
  background: var(--surface-sunken) !important;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.42);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.15s ease;
}

.modal {
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  animation: slideUp 0.18s ease;
  position: relative;
}

.modal-sm { max-width: 420px; }
.modal-md { max-width: 560px; }
.modal-lg { max-width: 800px; }
.modal-xl { max-width: 1100px; }

.modal-header {
  padding: var(--space-5) var(--space-6) 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-title {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.modal-body { padding: var(--space-5) var(--space-6); display: flex; flex-direction: column; gap: var(--space-4); }
.modal-footer {
  padding: var(--space-4) var(--space-6) var(--space-5);
  display: flex;
  justify-content: flex-end;
  gap: var(--space-2);
  border-top: 1px solid var(--border);
}

/* ── Chmod 对话框 ───────────────────────────────────────────── */
.chmod-dialog-body { display: flex; flex-direction: column; gap: var(--space-4); }
.chmod-dialog-path {
  font-size: var(--text-sm);
  color: var(--text-tertiary);
  word-break: break-all;
  padding: var(--space-1) var(--space-2);
  background: var(--surface-raised);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
}
.chmod-grid { display: flex; flex-direction: column; gap: var(--space-2); }
.chmod-row { display: grid; grid-template-columns: 60px repeat(3, 1fr); align-items: center; gap: var(--space-2); }
.chmod-row-label { font-size: var(--text-base); font-weight: 500; color: var(--text-secondary); }
.chmod-checkbox { display: flex; align-items: center; gap: var(--space-1); font-size: var(--text-sm); color: var(--text-tertiary); cursor: pointer; }
.chmod-checkbox input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }
.chmod-octal-input {
  width: 64px;
  padding: var(--space-1) var(--space-2);
  font-family: var(--font-mono);
  font-size: var(--text-md);
  text-align: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-raised);
  color: var(--text-primary);
  outline: none;
}
.chmod-octal-input:focus { border-color: var(--accent); }

/* ── 标签栏（会话标签） ─────────────────────────────────────── */
.tab-bar {
  display: flex;
  align-items: center;
  background: transparent;
  border-bottom: none;
  padding: 0 var(--space-1);
  gap: var(--space-1);
  height: var(--topbar-h);
  flex: 1;
  flex-shrink: 0;
  min-width: 0;
}
.tab-scroll {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  height: 100%;
}
.tab-scroll::-webkit-scrollbar { height: 0; }

.tab-item {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  height: 30px;
  padding: 0 8px;
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition-fast);
  position: relative;
  max-width: 180px;
  background: var(--surface-overlay);
  border: 1px solid var(--border);
  box-shadow: none;
}
.tab-item:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
  border-color: var(--border);
  box-shadow: none;
}
.tab-item.active {
  background: var(--surface-sunken);
  color: var(--text-primary);
  border-color: var(--border);
  box-shadow: inset 0 -2px 0 var(--accent);
  font-weight: 500;
}
.tab-item.active::after {
  content: none;
}
.tab-close {
  width: 18px;
  height: 18px;
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: var(--text-sm);
  flex-shrink: 0;
  transition: var(--transition);
}
.tab-close:hover { background: var(--danger-dim); color: var(--danger); }

.tab-reconnect { color: var(--text-muted); transition: var(--transition); }
.tab-reconnect:hover { color: var(--accent); }

/* ── 终端子标签栏 ───────────────────────────────────────────── */
.terminal-sub-tab-bar {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  padding: 4px 8px;
  background: var(--surface-base);
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
  min-width: 0;
}

.terminal-sub-tab-scroll {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--terminal-list-scrollbar-thumb, rgba(var(--accent-rgb), 0.32)) transparent;
  overscroll-behavior-x: contain;
}

.terminal-sub-tab-scroll::-webkit-scrollbar {
  height: 4px;
}

.terminal-sub-tab-scroll::-webkit-scrollbar-track {
  background: transparent;
  border-radius: var(--radius-full);
}

.terminal-sub-tab-scroll::-webkit-scrollbar-thumb {
  background: var(--terminal-list-scrollbar-thumb, rgba(var(--accent-rgb), 0.32));
  border-radius: var(--radius-full);
}

.terminal-sub-tab-scroll::-webkit-scrollbar-thumb:hover {
  background: var(--terminal-list-scrollbar-thumb-hover, rgba(var(--accent-rgb), 0.58));
}

.terminal-sub-tab-scroll.is-dragging,
.terminal-sub-tab-scroll.is-dragging * {
  cursor: grabbing !important;
}

.terminal-sub-tab-actions {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  flex-shrink: 0;
  margin-left: auto;
  padding-left: var(--space-2);
  border-left: 1px solid var(--border-subtle);
}

.terminal-create-btn {
  height: 28px;
  border-radius: var(--radius-sm);
  background: var(--surface-raised);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  box-shadow: none;
}

.terminal-create-btn:hover {
  background: var(--surface-hover);
  border-color: var(--border-focus);
  color: var(--text-primary);
  box-shadow: none;
}

.terminal-create-btn.active {
  background: var(--surface-sunken);
  border-color: var(--border);
  color: var(--text-primary);
  box-shadow: inset 0 -2px 0 var(--accent);
}

.terminal-tool-btn {
  flex-shrink: 0;
}

.terminal-create-btn svg {
  color: currentColor;
  filter: none;
}

.terminal-create-btn:disabled,
.terminal-create-btn[disabled] {
  opacity: 0.55;
  cursor: wait;
  pointer-events: none;
}

.terminal-create-btn.is-creating {
  color: var(--text-primary);
}

.terminal-sub-tab {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  min-height: 26px;
  padding: 0 8px;
  font-size: var(--text-sm);
  border-radius: var(--radius-sm);
  cursor: pointer;
  user-select: none;
  flex-shrink: 0;
  white-space: nowrap;
  background: var(--surface-overlay);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  box-shadow: none;
  transition: var(--transition-fast);
}
.terminal-sub-tab:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
  border-color: var(--border);
  box-shadow: none;
}
.terminal-sub-tab.active {
  background: var(--surface-sunken);
  color: var(--text-primary);
  border-color: var(--border);
  box-shadow: inset 0 -2px 0 var(--accent);
  font-weight: 500;
}
.terminal-sub-tab-close {
  margin-left: var(--space-1);
  font-size: var(--text-xs);
  opacity: 0.6;
  cursor: pointer;
  display: flex;
  align-items: center;
  transition: var(--transition);
}
.terminal-sub-tab-close:hover { opacity: 1; }

.terminal-sub-tab-icon-only {
  width: 28px;
  min-width: 28px;
  height: 26px;
  justify-content: center;
  padding: 0;
  border-radius: var(--radius-sm);
  background: var(--surface-overlay);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  box-shadow: none;
}

.terminal-sub-tab-icon-only svg {
  width: 14px;
  height: 14px;
  color: currentColor;
  filter: none;
}

.terminal-sub-tab-icon-only:hover {
  background: var(--surface-hover);
  border-color: var(--border-focus);
  color: var(--text-primary);
  box-shadow: none;
}

.terminal-sub-tab-icon-only:hover svg {
  color: currentColor;
  filter: none;
}

.terminal-sub-tab-icon-only.active {
  background: var(--surface-sunken);
  border-color: var(--border);
  color: var(--text-primary);
  box-shadow: inset 0 -2px 0 var(--accent);
}

.terminal-sub-tab-icon-only.active svg {
  color: currentColor;
  filter: none;
}

.tiptop {
  position: relative;
  display: inline-flex;
}

.tiptop-trigger {
  display: inline-flex;
  width: 100%;
  height: 100%;
}

.tiptop-trigger > .split-resizer-v {
  height: 100%;
}

.tiptop-trigger > .split-resizer-h {
  width: 100%;
}

.tiptop-bubble {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 6px);
  transform: translateX(-50%);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  background: var(--surface-overlay);
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-size: var(--text-xs);
  line-height: 1.2;
  white-space: nowrap;
  box-shadow: var(--shadow-md);
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  z-index: 10001;
}

.tiptop-bubble-bottom {
  top: calc(100% + 6px);
  bottom: auto;
}

.tiptop:hover .tiptop-bubble,
.tiptop:focus-within .tiptop-bubble {
  opacity: 1;
  visibility: visible;
}

/* ── 服务器卡片 ─────────────────────────────────────────────── */
.server-card {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 8px 10px;
  margin: 0;
  width: 100%;
  min-height: 54px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition-fast);
  position: relative;
  border: 1px solid var(--border);
  background: var(--surface-base);
  box-shadow: none;
}
.server-card:hover {
  background: var(--surface-hover);
  border-color: var(--border-focus);
  box-shadow: none;
}
.server-card.active {
  background: var(--accent-dim);
  border-color: var(--accent);
  box-shadow: inset 2px 0 0 var(--accent);
}
.server-card.active .server-name { color: var(--text-primary); }
.server-card.save-flow-hit {
  animation: saveFlowCardPulse 980ms cubic-bezier(0.22, 0.82, 0.24, 1) both;
}

.server-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: var(--surface-sunken);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-md);
  flex-shrink: 0;
}

.server-info { flex: 1; min-width: 0; }
.server-name {
  font-size: var(--text-base);
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.server-host {
  font-size: var(--text-xs);
  color: var(--text-muted);
  font-family: var(--font-mono);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.server-latency {
  font-size: var(--text-xs);
  font-family: var(--font-mono);
  font-weight: 600;
  flex-shrink: 0;
}
.server-latency.good { color: var(--success); }
.server-latency.ok { color: var(--warning); }
.server-latency.bad { color: var(--danger); }
.server-latency.offline { color: var(--text-muted); }

.server-actions { display: none; gap: var(--space-1); flex-shrink: 0; }
.server-card:hover .server-actions { display: flex; }

/* ── 服务器表格 ── */
.server-table-container {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-base);
}
.server-table { width: 100%; border-collapse: collapse; text-align: left; font-size: var(--text-sm); }
.server-table th {
  padding: 7px 10px;
  color: var(--text-tertiary);
  font-weight: 650;
  border-bottom: 1px solid var(--border);
  background: var(--surface-sunken);
}
.server-table td {
  padding: 7px 10px;
  border-bottom: 1px solid var(--border-subtle);
}
.server-table-row { cursor: pointer; transition: var(--transition-fast); }
.server-table-row:hover { background: var(--surface-hover); }
.server-table-row.active { background: var(--accent-dim); box-shadow: inset 2px 0 0 var(--accent); }
.server-table-row.save-flow-hit { animation: saveFlowRowPulse 920ms cubic-bezier(0.2, 0.82, 0.22, 1) both; }

.save-flow-target {
  display: inline-flex;
  align-items: center;
  border-radius: 6px;
  padding: 1px 3px;
  margin: -1px -3px;
}

.save-flow-target-active {
  animation: saveFlowTargetPulse 900ms cubic-bezier(0.2, 0.82, 0.22, 1) both;
}

/* ── 服务器网格 ── */
.server-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 8px;
  align-items: stretch;
}

/* ── 探针面板 ───────────────────────────────────────────────── */
.probe-panel-wrapper {
  width: var(--probe-w);
  min-width: var(--probe-w);
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--surface-raised);
  border-left: 1px solid var(--border);
  overflow: hidden;
  flex-shrink: 0;
}

.probe-resizer {
  flex-shrink: 0;
}

.panel-collapse-strip {
  padding: 0;
  border: none;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-base);
  color: var(--text-tertiary);
  transition: var(--transition-fast);
}

.panel-collapse-strip:hover {
  background: var(--surface-hover);
  color: var(--accent);
}

.panel-collapse-strip-vertical {
  width: 16px;
  min-width: 16px;
  height: 100%;
}

.panel-collapse-strip-horizontal {
  width: 100%;
  height: 16px;
  min-height: 16px;
}

.panel-collapse-strip-left {
  border-right: 1px solid var(--border);
}

.panel-collapse-strip-right {
  border-left: 1px solid var(--border);
}

.panel-collapse-strip-bottom {
  border-top: 1px solid var(--border);
}

.panel-collapse-armed-zone {
  position: absolute;
  pointer-events: none;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}

.panel-collapse-armed-zone-vertical {
  top: 0;
  bottom: 0;
  width: 32px;
}

.panel-collapse-armed-zone-horizontal {
  left: 0;
  right: 0;
  height: 32px;
}

.panel-collapse-armed-zone-left {
  left: 0;
  border-right: 1px dashed var(--accent-border);
}

.panel-collapse-armed-zone-right {
  right: 0;
  border-left: 1px dashed var(--accent-border);
}

.panel-collapse-armed-zone-top {
  top: 0;
  border-bottom: 1px dashed var(--accent-border);
}

.file-manager-dock-preview-dropzone {
  position: fixed;
  pointer-events: none;
  border-radius: calc(var(--radius-lg) - 4px);
  border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--accent) 8%, transparent), color-mix(in srgb, var(--accent) 3%, transparent)),
    color-mix(in srgb, var(--surface-overlay) 42%, transparent);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.03),
    0 2px 8px rgba(var(--accent-rgb), 0.03);
  transition: var(--transition-fast);
}

.file-manager-dock-preview-dropzone.active {
  border-color: color-mix(in srgb, var(--accent) 46%, transparent);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--accent) 14%, transparent), color-mix(in srgb, var(--accent) 6%, transparent)),
    color-mix(in srgb, var(--surface-overlay) 56%, transparent);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.05),
    0 6px 14px rgba(var(--accent-rgb), 0.08);
}

.terminal-pane-dock-preview-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.terminal-pane-dock-preview-slot {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: calc(var(--radius-lg) - 2px);
  border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--accent) 8%, transparent), color-mix(in srgb, var(--accent) 2%, transparent)),
    color-mix(in srgb, var(--surface-overlay) 46%, transparent);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.03),
    0 6px 18px rgba(0, 0, 0, 0.14);
  backdrop-filter: blur(6px);
  transition: var(--transition-fast);
}

.terminal-pane-dock-preview-slot.active {
  border-color: color-mix(in srgb, var(--accent) 48%, transparent);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--accent) 16%, transparent), color-mix(in srgb, var(--accent) 7%, transparent)),
    color-mix(in srgb, var(--surface-overlay) 62%, transparent);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.05),
    0 10px 26px rgba(var(--accent-rgb), 0.12);
}

.terminal-pane-dock-preview-slot.occupied {
  border-color: color-mix(in srgb, var(--warning) 58%, transparent);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--warning) 13%, transparent), color-mix(in srgb, var(--warning) 5%, transparent)),
    color-mix(in srgb, var(--surface-overlay) 56%, transparent);
}

.terminal-pane-dock-preview-slot.occupied.active {
  border-color: color-mix(in srgb, var(--warning) 78%, transparent);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.06),
    0 10px 26px color-mix(in srgb, var(--warning) 18%, transparent);
}

.terminal-pane-dock-preview-slot.disabled {
  opacity: 0.46;
}

.terminal-pane-dock-preview-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 54px;
  min-height: 28px;
  padding: 0 12px;
  border-radius: var(--radius-full);
  border: 1px solid color-mix(in srgb, var(--accent) 18%, transparent);
  background: color-mix(in srgb, var(--surface-raised) 90%, transparent);
  color: var(--text-primary);
  font-size: var(--text-sm);
  font-weight: 700;
  letter-spacing: 0.02em;
  box-shadow: var(--shadow-sm);
}

.terminal-pane-dock-drag-ghost {
  position: fixed;
  pointer-events: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 0 10px;
  border-radius: var(--radius-full);
  border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--accent) 10%, transparent), color-mix(in srgb, var(--accent) 4%, transparent)),
    color-mix(in srgb, var(--surface-overlay) 88%, transparent);
  color: var(--text-primary);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(10px);
  transform: translate(18px, 18px);
  white-space: nowrap;
}

.file-manager-tab-dock-placeholder {
  position: relative;
  width: 52px;
  min-width: 52px;
  height: 26px;
  flex-shrink: 0;
}

.file-manager-dock-preview-dropzone-inline {
  position: absolute;
  inset: 0;
}

/* ponytail: 监控面板在左侧时，把垂直滚动条翻到左侧（远离终端），内容保持 LTR */
.probe-panel-wrapper-left .probe-panel { direction: rtl; }
.probe-panel-wrapper-left .probe-panel > * { direction: ltr; }

.probe-panel {
  padding: var(--space-3);
  display: flex;
  flex: 1;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  gap: var(--space-3);
  background: var(--surface-base);
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
}

.probe-partition-header,
.probe-partition-row {
  display: grid;
  grid-template-columns: minmax(48px, 0.72fr) minmax(24px, 1fr) minmax(48px, max-content) minmax(48px, max-content) minmax(38px, max-content);
  align-items: center;
  column-gap: var(--space-1);
}

.probe-partition-header {
  padding: 0 0 3px;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  font-size: var(--text-xs);
  font-weight: 700;
}
.probe-partition-header span:nth-child(n + 3) { text-align: right; }

.probe-partition-row {
  padding: var(--space-1) 0;
  border-bottom: 1px solid var(--border-subtle);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
}

.probe-partition-mount {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-tertiary);
}

.probe-partition-bar {
  min-width: 24px;
  height: 5px;
  overflow: hidden;
  border-radius: var(--radius-xs);
  background: var(--border);
}

.probe-partition-value,
.probe-partition-percent {
  justify-self: end;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.probe-partition-value { color: var(--text-tertiary); }
.probe-partition-row .probe-partition-value:nth-child(3) { color: var(--text-muted); }
.probe-partition-percent { font-weight: 600; }

/* ── 数据页通用布局 ─────────────────────────────────────────── */
.data-page {
  height: 100%;
  width: 100%;
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
  padding: 12px 14px;
  background: var(--surface-raised);
}

.data-page-scroll {
  height: 100%;
  overflow-y: auto;
  background: var(--surface-raised);
  padding: 12px 14px;
}

.data-page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: 10px;
  flex-shrink: 0;
}

.data-page-title {
  margin: 0;
  font-size: var(--text-md);
  font-weight: 650;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.data-toolbar {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: 10px;
  flex-shrink: 0;
}
.data-toolbar .input { flex: 1; min-width: 120px; }

.data-count {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.segment-control {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-sunken);
}

.segment-control button {
  min-height: 24px;
  padding: 3px 9px;
  border-radius: var(--radius-xs);
  color: var(--text-tertiary);
  font-size: var(--text-xs);
  white-space: nowrap;
  border: 1px solid transparent;
}

.segment-control button:hover {
  color: var(--text-primary);
  background: var(--surface-hover);
}

.segment-control button.active {
  color: var(--text-primary);
  background: var(--surface-raised);
  border-color: var(--border);
}

.data-table-shell {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--surface-base);
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.history-item-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 12px;
  background: var(--surface-base);
  border-color: var(--border);
}

.history-command-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-3);
}

.history-command-text {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--text-primary);
  word-break: break-all;
  font-weight: 500;
}

.history-time {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  white-space: nowrap;
  opacity: 0.85;
}

.history-actions {
  display: flex;
  gap: var(--space-1);
  justify-content: flex-end;
  border-top: 1px solid var(--border-subtle);
  padding-top: 8px;
}

/* ── 文件管理器 ─────────────────────────────────────────────── */
.file-manager {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.file-toolbar {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 8px 10px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--surface-raised);
  flex-shrink: 0;
  flex-wrap: wrap;
  min-height: 0;
}
.file-toolbar-actions { display: flex; align-items: center; gap: var(--space-1); flex-wrap: wrap; }

.file-toolbar-outline-btn {
  width: 32px;
  min-width: 32px;
  height: 32px;
  min-height: 32px;
  padding: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--border));
  color: var(--text-secondary);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, rgba(255, 255, 255, 0.03) 100%, transparent);
}

.file-toolbar-outline-btn:hover {
  background: var(--surface-hover);
  border-color: var(--border-focus);
  color: var(--text-primary);
}

.file-toolbar-outline-btn:active {
  background: var(--surface-active);
}

.file-toolbar-outline-btn svg {
  width: 14px;
  height: 14px;
}

.path-input {
  flex: 1;
  min-width: 0;
  height: 28px;
  padding: 2px var(--space-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-overlay);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  outline: none;
  transition: var(--transition);
}
.path-input:focus { border-color: var(--border-focus); }

.file-list { flex: 1; overflow-y: auto; overflow-x: auto; }

.file-list-header {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) 60px 85px 110px 110px;
  min-width: 500px;
  padding: 6px 10px;
  border-bottom: 1px solid var(--border);
  font-size: var(--text-xs);
  font-weight: 650;
  color: var(--text-tertiary);
  text-transform: none;
  letter-spacing: 0;
  background: var(--surface-sunken);
  position: sticky;
  top: 0;
  z-index: 1;
}

.file-item {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) 60px 85px 110px 110px;
  min-width: 500px;
  padding: 5px 10px;
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: var(--transition-fast);
  align-items: center;
}
.file-item:hover { background: var(--surface-hover); }
.file-item:hover .file-actions { opacity: 1; }

.file-name-cell { display: flex; align-items: center; gap: var(--space-2); min-width: 0; }
.file-icon { font-size: var(--text-md); flex-shrink: 0; }
.file-name {
  font-size: var(--text-base);
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.file-name.is-dir { color: var(--accent); font-weight: 500; }

.file-size { font-size: var(--text-sm); color: var(--text-tertiary); font-family: var(--font-mono); }
.file-permission { font-size: var(--text-sm); color: var(--text-tertiary); font-family: var(--font-mono); cursor: pointer; }
.file-permission:hover { color: var(--accent); }
.file-date { font-size: var(--text-sm); color: var(--text-tertiary); }
.file-actions { opacity: 0; display: flex; gap: var(--space-1); justify-content: flex-end; }

/* ── 右键菜单 ───────────────────────────────────────────────── */
@keyframes contextMenuIn {
  from { opacity: 0; transform: scale(0.94) translateY(-6px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.context-menu {
  position: fixed;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  padding: var(--space-1);
  z-index: 2000;
  min-width: 160px;
  animation: contextMenuIn 0.12s ease;
  transform-origin: top left;
}
.context-menu-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-2);
  padding: 7px var(--space-4);
  border-radius: var(--radius-sm);
  font-size: var(--text-base);
  color: var(--text-secondary);
  cursor: pointer;
  margin: 1px var(--space-1);
  user-select: none;
  transition: var(--transition-fast);
  border-left: 2px solid transparent;
}
.context-menu-item:hover { background-color: var(--surface-hover); color: var(--text-primary); border-left-color: var(--accent); }
.context-menu-item.danger { color: var(--danger); }
.context-menu-item.danger:hover { background: var(--danger-dim); }
.context-menu-item.disabled { opacity: 0.35; pointer-events: none; cursor: default; }
.context-menu-item .item-icon { display: flex; align-items: center; opacity: 0.7; flex-shrink: 0; }
.context-menu-item:hover .item-icon { opacity: 1; }
.context-menu-item .item-label { flex: 1; }
.context-menu-item .item-shortcut { opacity: 0.55; font-size: var(--text-xs); font-family: var(--font-mono); flex-shrink: 0; }
.context-menu-divider { height: 1px; background: var(--border); margin: var(--space-1) 0; }

/* ── 传输进度 ───────────────────────────────────────────────── */
.transfer-toast {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  background: var(--surface-overlay);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-3) var(--space-4);
  box-shadow: var(--shadow-md);
  z-index: 3000;
  min-width: 260px;
  animation: slideUp 0.2s ease;
}
.transfer-toast-title { font-size: var(--text-base); font-weight: 600; margin-bottom: var(--space-2); }
.progress-bar-track { height: 4px; background: var(--surface-hover); border-radius: var(--radius-full); overflow: hidden; }
.progress-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: var(--radius-full);
  transition: width 0.3s ease;
}

/* ── 拖拽覆盖层 ────────────────────────────────────────────── */
.drag-overlay {
  position: absolute;
  inset: 0;
  background: var(--accent-dim);
  border: 2px dashed var(--accent);
  border-radius: var(--radius-lg);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.drag-overlay-text {
  background: var(--surface-overlay);
  padding: var(--space-4) var(--space-8);
  border-radius: var(--radius-lg);
  font-size: var(--text-md);
  font-weight: 600;
  color: var(--text-primary);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
}

/* ── WebDAV 设置区 ─────────────────────────────────────────── */
.webdav-section {
  background: var(--surface-sunken);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
}
.webdav-section-title {
  font-size: var(--text-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-tertiary);
  margin-bottom: var(--space-3);
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

/* ── 动画 ───────────────────────────────────────────────────── */
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; } }

@keyframes updateBubbleAttention {
  0%, 100% {
    box-shadow:
      0 14px 30px rgba(0, 0, 0, 0.34),
      0 0 0 1px rgba(var(--warning-rgb), 0.12),
      0 0 24px rgba(var(--warning-rgb), 0.22),
      0 0 38px rgba(var(--accent-rgb), 0.16);
    transform: scale(1);
  }
  50% {
    box-shadow:
      0 16px 34px rgba(0, 0, 0, 0.38),
      0 0 0 1px rgba(var(--warning-rgb), 0.18),
      0 0 30px rgba(var(--warning-rgb), 0.32),
      0 0 46px rgba(var(--accent-rgb), 0.22);
    transform: scale(1.04);
  }
}

@keyframes updateBubblePulse {
  0% {
    opacity: 0.84;
    transform: translateY(-50%) scale(0.72);
  }
  75% {
    opacity: 0;
    transform: translateY(-50%) scale(1.9);
  }
  100% {
    opacity: 0;
    transform: translateY(-50%) scale(2.05);
  }
}

@keyframes editFlyCapsule {
  0% {
    opacity: 0;
    transform:
      translate(var(--fly-from-x), var(--fly-from-y))
      translate(-50%, -50%)
      scale(0.66)
      rotate(-6deg);
  }
  10% {
    opacity: 0.68;
  }
  34% {
    opacity: 0.98;
    transform:
      translate(calc((var(--fly-from-x) * 0.56) + (var(--fly-mid-x) * 0.44)), calc((var(--fly-from-y) * 0.56) + (var(--fly-mid-y) * 0.44)))
      translate(-50%, -50%)
      scale(0.96)
      rotate(7deg);
  }
  68% {
    opacity: 0.98;
    transform:
      translate(calc((var(--fly-mid-x) * 0.58) + (var(--fly-to-x) * 0.42)), calc((var(--fly-mid-y) * 0.58) + (var(--fly-to-y) * 0.42)))
      translate(-50%, -50%)
      scale(1)
      rotate(-3deg);
  }
  90% {
    opacity: 0.8;
  }
  100% {
    opacity: 0;
    transform:
      translate(var(--fly-to-x), var(--fly-to-y))
      translate(-50%, -50%)
      scale(0.72)
      rotate(0deg);
  }
}

@keyframes saveFlowCapsule {
  0% {
    opacity: 0;
    transform:
      translate(var(--save-flow-from-x), var(--save-flow-from-y))
      translate(-50%, -50%)
      scale(0.72)
      rotate(-10deg);
  }
  12% {
    opacity: 0.9;
  }
  38% {
    opacity: 1;
    transform:
      translate(calc((var(--save-flow-from-x) * 0.52) + (var(--save-flow-mid-x) * 0.48)), calc((var(--save-flow-from-y) * 0.52) + (var(--save-flow-mid-y) * 0.48)))
      translate(-50%, -50%)
      scale(1.08)
      rotate(8deg);
  }
  74% {
    opacity: 1;
    transform:
      translate(calc((var(--save-flow-mid-x) * 0.58) + (var(--save-flow-to-x) * 0.42)), calc((var(--save-flow-mid-y) * 0.58) + (var(--save-flow-to-y) * 0.42)))
      translate(-50%, -50%)
      scale(0.92)
      rotate(-4deg);
  }
  100% {
    opacity: 0;
    transform:
      translate(var(--save-flow-to-x), var(--save-flow-to-y))
      translate(-50%, -50%)
      scale(0.56)
      rotate(0deg);
  }
}

@keyframes saveFlowTargetPulse {
  0% {
    background: transparent;
    color: inherit;
    box-shadow: none;
  }
  26% {
    background: color-mix(in srgb, var(--success) 18%, transparent);
    color: var(--text-primary);
    box-shadow:
      0 0 0 1px color-mix(in srgb, var(--success) 36%, transparent),
      0 0 16px color-mix(in srgb, var(--accent) 18%, transparent);
  }
  72% {
    background: color-mix(in srgb, var(--accent) 14%, transparent);
    color: var(--text-primary);
    box-shadow:
      0 0 0 1px color-mix(in srgb, var(--accent) 26%, transparent),
      0 0 12px color-mix(in srgb, var(--success) 12%, transparent);
  }
  100% {
    background: transparent;
    color: inherit;
    box-shadow: none;
  }
}

@keyframes saveFlowCardPulse {
  0% {
    transform: scale(1);
    background: var(--surface-base);
    box-shadow: none;
  }
  28% {
    transform: translateX(2px) scale(1.015);
    background: color-mix(in srgb, var(--success) 14%, var(--surface-hover));
    box-shadow:
      inset 2px 0 0 color-mix(in srgb, var(--success) 86%, var(--accent)),
      0 0 0 1px color-mix(in srgb, var(--accent) 20%, transparent),
      0 0 22px color-mix(in srgb, var(--success) 16%, transparent);
  }
  62% {
    transform: translateX(-1px) scale(1.008);
    background: color-mix(in srgb, var(--accent) 12%, var(--surface-hover));
    box-shadow:
      inset 2px 0 0 color-mix(in srgb, var(--accent) 82%, var(--success)),
      0 0 0 1px color-mix(in srgb, var(--success) 18%, transparent),
      0 0 18px color-mix(in srgb, var(--accent) 14%, transparent);
  }
  100% {
    transform: scale(1);
    background: var(--surface-base);
    box-shadow: none;
  }
}

@keyframes saveFlowRowPulse {
  0% {
    background: transparent;
    box-shadow: none;
  }
  24% {
    background: color-mix(in srgb, var(--success) 12%, var(--surface-hover));
    box-shadow:
      inset 2px 0 0 color-mix(in srgb, var(--success) 84%, var(--accent)),
      inset 0 1px 0 color-mix(in srgb, var(--accent) 10%, transparent);
  }
  68% {
    background: color-mix(in srgb, var(--accent) 10%, var(--surface-hover));
    box-shadow:
      inset 2px 0 0 color-mix(in srgb, var(--accent) 82%, var(--success)),
      inset 0 1px 0 color-mix(in srgb, var(--success) 10%, transparent);
  }
  100% {
    background: transparent;
    box-shadow: none;
  }
}

.spin { animation: spin 1s linear infinite; }
.btn-icon-spin.spinning svg { animation: spin 1s linear infinite; }

@keyframes editFlyBeam {
  0% {
    opacity: 0;
    transform:
      translate(var(--beam-from-x), var(--beam-from-y))
      rotate(var(--beam-angle))
      scaleX(0.02);
  }
  14% {
    opacity: 0.62;
  }
  48% {
    opacity: 1;
    transform:
      translate(var(--beam-from-x), var(--beam-from-y))
      rotate(var(--beam-angle))
      scaleX(0.72);
  }
  82% {
    opacity: 0.92;
    transform:
      translate(var(--beam-from-x), var(--beam-from-y))
      rotate(var(--beam-angle))
      scaleX(1);
  }
  100% {
    opacity: 0;
    transform:
      translate(var(--beam-from-x), var(--beam-from-y))
      rotate(var(--beam-angle))
      scaleX(1.06);
  }
}

@keyframes editFlyBeamCore {
  0% {
    opacity: 0;
    transform: translateX(-16%) scale(0.74);
  }
  16% {
    opacity: 0.72;
  }
  52% {
    opacity: 1;
    transform: translateX(42%) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateX(108%) scale(1.06);
  }
}

.edit-fly-layer {
  position: absolute;
  inset: 0;
  z-index: 9998;
  pointer-events: none;
  overflow: hidden;
  border-radius: inherit;
  contain: paint;
}

.edit-fly-capsule {
  position: absolute;
  left: 0;
  top: 0;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: min(240px, calc(100% - 28px));
  min-height: 28px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--text-secondary));
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--info) 22%, transparent), transparent 42%),
    linear-gradient(225deg, color-mix(in srgb, var(--success) 18%, transparent), transparent 40%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent),
    color-mix(in srgb, var(--surface-overlay) 92%, transparent);
  color: var(--text-primary);
  box-shadow:
    0 10px 26px rgba(0, 0, 0, 0.24),
    0 0 18px color-mix(in srgb, var(--accent) 16%, transparent),
    0 0 0 1px rgba(255, 255, 255, 0.03);
  animation: editFlyCapsule 920ms cubic-bezier(0.22, 0.72, 0.2, 1) var(--fly-delay) both;
  will-change: transform, opacity;
}

body.theme-light .edit-fly-capsule {
  border-color: rgba(70, 62, 54, 0.2);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--info) 14%, transparent), transparent 42%),
    linear-gradient(225deg, color-mix(in srgb, var(--success) 12%, transparent), transparent 40%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(255, 255, 255, 0.52)),
    color-mix(in srgb, var(--surface-raised) 94%, transparent);
  box-shadow:
    0 10px 24px rgba(54, 44, 34, 0.14),
    0 0 14px color-mix(in srgb, var(--accent) 10%, transparent),
    0 0 0 1px rgba(255, 255, 255, 0.72);
}

.save-flow-capsule {
  position: absolute;
  left: 0;
  top: 0;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: min(250px, calc(100% - 28px));
  min-height: 30px;
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--success) 44%, var(--accent));
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--success) 24%, transparent), transparent 42%),
    linear-gradient(225deg, color-mix(in srgb, var(--accent) 24%, transparent), transparent 40%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.12), transparent),
    color-mix(in srgb, var(--surface-overlay) 94%, transparent);
  color: var(--text-primary);
  box-shadow:
    0 12px 28px rgba(0, 0, 0, 0.28),
    0 0 18px color-mix(in srgb, var(--success) 26%, transparent),
    0 0 30px color-mix(in srgb, var(--accent) 18%, transparent);
  animation: saveFlowCapsule 1160ms cubic-bezier(0.2, 0.78, 0.22, 1) var(--save-flow-delay) both;
  will-change: transform, opacity;
}

body.theme-light .save-flow-capsule {
  border-color: rgba(54, 122, 76, 0.24);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--success) 16%, transparent), transparent 42%),
    linear-gradient(225deg, color-mix(in srgb, var(--accent) 14%, transparent), transparent 40%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.58)),
    color-mix(in srgb, var(--surface-raised) 96%, transparent);
  box-shadow:
    0 12px 24px rgba(52, 44, 34, 0.16),
    0 0 14px color-mix(in srgb, var(--success) 14%, transparent),
    0 0 24px color-mix(in srgb, var(--accent) 10%, transparent);
}

.edit-fly-beam {
  position: absolute;
  left: 0;
  top: 0;
  width: var(--beam-length);
  height: 3px;
  border-radius: 999px;
  transform-origin: left center;
  background:
    linear-gradient(
      90deg,
      transparent 0%,
      color-mix(in srgb, var(--info) 44%, transparent) 12%,
      color-mix(in srgb, var(--accent) 62%, transparent) 36%,
      rgba(255, 255, 255, 0.94) 50%,
      color-mix(in srgb, var(--success) 56%, transparent) 68%,
      color-mix(in srgb, var(--warning) 42%, transparent) 84%,
      transparent 100%
    );
  box-shadow:
    0 0 12px color-mix(in srgb, var(--accent) 30%, transparent),
    0 0 22px color-mix(in srgb, var(--info) 14%, transparent);
  animation: editFlyBeam 700ms cubic-bezier(0.18, 0.74, 0.22, 1) var(--beam-delay) both;
  will-change: transform, opacity;
}

.edit-fly-beam::after {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 26px;
  height: 6px;
  border-radius: 999px;
  background:
    radial-gradient(circle, rgba(255, 255, 255, 0.96) 0, color-mix(in srgb, var(--accent) 44%, transparent) 52%, transparent 100%);
  transform: translateY(-50%);
  animation: editFlyBeamCore 700ms cubic-bezier(0.18, 0.74, 0.22, 1) var(--beam-delay) both;
}

body.theme-light .edit-fly-beam {
  background:
    linear-gradient(
      90deg,
      transparent 0%,
      color-mix(in srgb, var(--info) 24%, transparent) 12%,
      color-mix(in srgb, var(--accent) 34%, transparent) 36%,
      rgba(255, 255, 255, 0.98) 50%,
      color-mix(in srgb, var(--success) 28%, transparent) 68%,
      color-mix(in srgb, var(--warning) 22%, transparent) 84%,
      transparent 100%
    );
  box-shadow:
    0 0 8px color-mix(in srgb, var(--accent) 18%, transparent),
    0 0 14px color-mix(in srgb, var(--info) 10%, transparent);
}

body.theme-light .edit-fly-beam::after {
  background:
    radial-gradient(circle, rgba(255, 255, 255, 0.98) 0, color-mix(in srgb, var(--accent) 24%, transparent) 52%, transparent 100%);
}

@keyframes addSupernovaCore {
  0% {
    opacity: 0;
    offset-distance: 0%;
    transform: translate(-50%, -50%) scale(0.54);
  }
  8% {
    opacity: 1;
  }
  88% {
    opacity: 1;
    offset-distance: 100%;
    transform: translate(-50%, -50%) scale(1);
  }
  100% {
    opacity: 0;
    offset-distance: 100%;
    transform: translate(-50%, -50%) scale(1.86);
  }
}

@keyframes addSupernovaParticle {
  0% {
    opacity: 0;
    offset-distance: 0%;
    transform: translate(-50%, -50%) scale(0.35);
  }
  18% {
    opacity: 0.95;
  }
  76% {
    opacity: 0.78;
  }
  100% {
    opacity: 0;
    offset-distance: 100%;
    transform: translate(-50%, -50%) scale(0.2);
  }
}

@keyframes addSupernovaRing {
  0% {
    opacity: 0;
    transform:
      translate(var(--ring-x), var(--ring-y))
      translate(-50%, -50%)
      scale(0.16);
  }
  22% {
    opacity: 0.9;
  }
  100% {
    opacity: 0;
    transform:
      translate(var(--ring-x), var(--ring-y))
      translate(-50%, -50%)
      scale(1);
  }
}

.add-supernova-core {
  position: absolute;
  left: 0;
  top: 0;
  offset-path: var(--add-path);
  offset-rotate: 0deg;
  offset-distance: 0%;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background:
    radial-gradient(circle at 50% 50%, #fff 0 12%, color-mix(in srgb, var(--warning) 90%, #fff) 22%, color-mix(in srgb, var(--accent) 84%, transparent) 46%, color-mix(in srgb, var(--info) 54%, transparent) 72%, transparent 100%);
  box-shadow:
    0 0 10px rgba(255, 255, 255, 0.75),
    0 0 24px color-mix(in srgb, var(--accent) 48%, transparent),
    0 0 42px color-mix(in srgb, var(--info) 34%, transparent);
  animation: addSupernovaCore 950ms linear var(--add-delay) both;
  will-change: transform, opacity;
}

.add-supernova-core::before,
.add-supernova-core::after {
  content: "";
  position: absolute;
  inset: -12px;
  border-radius: inherit;
  border: 1px solid color-mix(in srgb, var(--accent) 38%, transparent);
  opacity: 0.72;
}

.add-supernova-core::after {
  inset: -22px;
  border-color: color-mix(in srgb, var(--info) 28%, transparent);
}

.add-supernova-particle {
  position: absolute;
  left: 0;
  top: 0;
  offset-path: var(--particle-path);
  offset-rotate: 0deg;
  offset-distance: 0%;
  width: var(--particle-size);
  height: var(--particle-size);
  border-radius: 999px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.98), color-mix(in srgb, var(--accent) 72%, transparent) 58%, transparent 100%);
  box-shadow:
    0 0 8px color-mix(in srgb, var(--accent) 32%, transparent),
    0 0 14px color-mix(in srgb, var(--info) 18%, transparent);
  animation: addSupernovaParticle 900ms linear var(--particle-delay) both;
  will-change: offset-distance, transform, opacity;
}

.add-supernova-ring {
  position: absolute;
  left: 0;
  top: 0;
  width: min(168px, 28vw);
  height: min(168px, 28vw);
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--accent) 42%, transparent);
  background:
    radial-gradient(circle, transparent 44%, color-mix(in srgb, var(--accent) 12%, transparent) 48%, transparent 58%),
    radial-gradient(circle, color-mix(in srgb, var(--info) 10%, transparent), transparent 64%);
  box-shadow:
    inset 0 0 22px color-mix(in srgb, var(--accent) 14%, transparent),
    0 0 28px color-mix(in srgb, var(--accent) 22%, transparent),
    0 0 54px color-mix(in srgb, var(--info) 16%, transparent);
  animation: addSupernovaRing 560ms cubic-bezier(0.16, 0.84, 0.2, 1) var(--ring-delay) both;
  will-change: offset-distance, transform, opacity;
}

body.theme-light .add-supernova-core {
  box-shadow:
    0 0 8px rgba(255, 255, 255, 0.9),
    0 0 18px color-mix(in srgb, var(--accent) 22%, transparent),
    0 0 30px color-mix(in srgb, var(--info) 18%, transparent);
}

body.theme-light .add-supernova-ring {
  border-color: color-mix(in srgb, var(--accent) 28%, transparent);
  background:
    radial-gradient(circle, transparent 44%, color-mix(in srgb, var(--accent) 8%, transparent) 48%, transparent 58%),
    radial-gradient(circle, color-mix(in srgb, var(--info) 7%, transparent), transparent 64%);
  box-shadow:
    inset 0 0 18px color-mix(in srgb, var(--accent) 10%, transparent),
    0 0 20px color-mix(in srgb, var(--accent) 14%, transparent),
    0 0 36px color-mix(in srgb, var(--info) 10%, transparent);
}

.edit-fly-capsule::before,
.edit-fly-capsule::after,
.save-flow-capsule::before,
.save-flow-capsule::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 9px;
  height: 15px;
  border-radius: 999px 999px 999px 2px;
  background: color-mix(in srgb, var(--text-secondary) 24%, transparent);
  opacity: 0.75;
}

.edit-fly-capsule::before,
.save-flow-capsule::before {
  left: -5px;
  transform: translateY(-50%) rotate(-18deg);
}

.edit-fly-capsule::after,
.save-flow-capsule::after {
  right: -5px;
  transform: translateY(-50%) rotate(18deg) scaleX(-1);
}

.edit-fly-label {
  color: var(--text-tertiary);
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.edit-fly-value {
  overflow: hidden;
  max-width: 150px;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@keyframes editorFieldGlow {
  0% {
    border-color: var(--editor-line);
    box-shadow: none;
  }
  24% {
    border-color: color-mix(in srgb, var(--accent) 42%, var(--editor-line));
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 8%, transparent);
  }
  68% {
    border-color: color-mix(in srgb, var(--accent) 28%, var(--editor-line));
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 5%, transparent);
  }
  100% {
    border-color: var(--editor-line);
    box-shadow: none;
  }
}

@keyframes editorFieldSweep {
  0% {
    opacity: 0;
    transform: translateX(-118%);
  }
  18% {
    opacity: 0.95;
  }
  74% {
    opacity: 0.65;
  }
  100% {
    opacity: 0;
    transform: translateX(118%);
  }
}

.editor-field-shell {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: 8px;
}

.editor-field-shell::after {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: 7px;
  pointer-events: none;
  opacity: 0;
}

.editor-field-shell.editor-field-shell-shine::after {
  background:
    linear-gradient(
      108deg,
      transparent 0%,
      transparent 30%,
      color-mix(in srgb, var(--info) 18%, transparent) 40%,
      color-mix(in srgb, var(--accent) 24%, transparent) 46%,
      rgba(255, 255, 255, 0.88) 50%,
      color-mix(in srgb, var(--success) 22%, transparent) 56%,
      color-mix(in srgb, var(--warning) 18%, transparent) 62%,
      transparent 72%,
      transparent 100%
    );
  animation: editorFieldSweep 920ms cubic-bezier(0.2, 0.86, 0.24, 1) both;
}

body.theme-light .editor-field-shell.editor-field-shell-shine::after {
  background:
    linear-gradient(
      108deg,
      transparent 0%,
      transparent 30%,
      color-mix(in srgb, var(--info) 12%, transparent) 40%,
      color-mix(in srgb, var(--accent) 16%, transparent) 46%,
      rgba(255, 255, 255, 0.94) 50%,
      color-mix(in srgb, var(--success) 14%, transparent) 56%,
      color-mix(in srgb, var(--warning) 12%, transparent) 62%,
      transparent 72%,
      transparent 100%
    );
}

.dashboard-server-editor .input.editor-field-shine {
  animation: editorFieldGlow 980ms cubic-bezier(0.2, 0.82, 0.22, 1) both;
}

@media (prefers-reduced-motion: reduce) {
  .edit-fly-layer {
    display: none;
  }
}

/* ── Toast 通知 ─────────────────────────────────────────────── */
.toast-container {
  position: fixed;
  top: calc(var(--topbar-h) + var(--space-3));
  right: var(--space-5);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-lg);
  font-size: var(--text-base);
  box-shadow: var(--shadow-md);
  animation: slideUp 0.2s ease;
  min-width: 240px;
  max-width: 360px;
}
.toast-content {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  flex: 1;
  min-width: 0;
}
.toast-icon {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  margin-top: 1px;
}
.toast-message {
  flex: 1;
  min-width: 0;
  word-break: break-word;
}
.toast-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  min-width: 22px;
  height: 22px;
  padding: 0;
  border-radius: var(--radius-full);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-tertiary);
  flex-shrink: 0;
  transition: var(--transition-fast);
}
.toast-close:hover {
  background: var(--surface-hover);
  border-color: var(--border);
  color: var(--text-primary);
}
.toast-success { background: var(--surface-overlay); border: 1px solid var(--success); border-left: 4px solid var(--success); color: var(--text-primary); }
.toast-success .toast-icon { color: var(--success); }
.toast-error { background: var(--surface-overlay); border: 1px solid var(--danger); border-left: 4px solid var(--danger); color: var(--text-primary); }
.toast-error .toast-icon { color: var(--danger); }
.toast-info { background: var(--surface-overlay); border: 1px solid var(--accent); border-left: 4px solid var(--accent); color: var(--text-primary); }
.toast-info .toast-icon { color: var(--accent); }

/* ── 空状态 ─────────────────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-10) var(--space-5);
  color: var(--text-muted);
  gap: var(--space-3);
  text-align: center;
}
.empty-state-icon {
  font-size: 40px;
  color: var(--text-tertiary);
  opacity: 0.8;
}
.empty-state-text { font-size: var(--text-base); }

/* ── 重命名输入框 ───────────────────────────────────────────── */
.rename-input {
  background: var(--surface-raised);
  border: 1px solid var(--border-focus);
  border-radius: var(--radius-xs);
  color: var(--text-primary);
  font-size: var(--text-base);
  padding: 2px var(--space-1);
  font-family: inherit;
  outline: none;
  width: 100%;
}

/* ── 分割线 ─────────────────────────────────────────────────── */
.divider { height: 1px; background: var(--border); margin: var(--space-1) 0; }

/* ── 内联警告 ───────────────────────────────────────────────── */
.alert {
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  font-size: var(--text-base);
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  border-left: 3px solid transparent;
}
.alert-info { background: var(--accent-dim); border: 1px solid var(--accent-dim); border-left-color: var(--accent); color: var(--accent); }
.alert-warning { background: var(--warning-dim); border: 1px solid var(--warning-dim); border-left-color: var(--warning); color: var(--warning); }

/* ── Toggle 开关 ────────────────────────────────────────────── */
.toggle { display: flex; align-items: center; gap: var(--space-2); cursor: pointer; }
.toggle-track {
  width: 38px;
  height: 22px;
  background: var(--surface-sunken);
  border-radius: var(--radius-full);
  position: relative;
  transition: var(--transition);
  border: 1px solid var(--border);
}
.toggle-track.on { background: var(--accent); border-color: var(--accent); }
.toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  background: #fff;
  border-radius: var(--radius-full);
  transition: var(--transition);
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
.toggle-track.on .toggle-thumb { left: 18px; }

/* ============================================================
   仪表盘与闪电连接面板
   ============================================================ */
.dashboard-container {
  display: flex;
  height: calc(100vh - var(--topbar-h));
  width: 100%;
  overflow: hidden;
  background: var(--surface-base);
}

.dashboard-left {
  width: 380px;
  min-width: 380px;
  border-right: 1px solid var(--border);
  background: var(--surface-raised);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: hidden;
  min-height: 0;
}

.dashboard-right {
  flex: 1;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: hidden;
  background: var(--surface-base);
}

/* 首页卡片 */
.glass-card {
  background: var(--surface-base);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  box-shadow: none;
  transition: var(--transition-fast);
  position: relative;
  overflow: hidden;
}
.glass-card:hover { border-color: var(--border-focus); box-shadow: none; }

.card-header-icon-title { display: flex; align-items: center; gap: var(--space-2); margin-bottom: 10px; }
.card-header-icon { font-size: var(--text-md); display: flex; align-items: center; color: var(--text-secondary); }
.card-header-title { font-weight: 650; font-size: var(--text-sm); color: var(--text-primary); }

.dashboard-server-editor {
  --editor-bg: color-mix(in srgb, var(--surface-base) 86%, var(--surface-raised));
  --editor-head: color-mix(in srgb, var(--surface-raised) 90%, var(--surface-base));
  --editor-line: color-mix(in srgb, var(--border) 78%, transparent);
  --editor-line-soft: color-mix(in srgb, var(--border-subtle) 86%, transparent);
  --editor-field: color-mix(in srgb, var(--surface-sunken) 62%, var(--surface-base));
  --editor-field-hover: color-mix(in srgb, var(--surface-hover) 48%, var(--surface-sunken));
  --editor-ink-soft: var(--text-tertiary);
  padding: 0;
  overflow: hidden;
  display: flex;
  flex: 1;
  min-height: 0;
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--border-subtle) 32%, transparent) 1px, transparent 1px) 0 0 / 28px 28px,
    linear-gradient(0deg, color-mix(in srgb, var(--border-subtle) 22%, transparent) 1px, transparent 1px) 0 0 / 28px 28px,
    var(--editor-bg);
  border-color: var(--editor-line);
}

body.theme-light .dashboard-server-editor {
  --editor-bg: #f7f3ed;
  --editor-head: #fffaf3;
  --editor-line: rgba(68, 58, 48, 0.20);
  --editor-line-soft: rgba(68, 58, 48, 0.11);
  --editor-field: rgba(255, 253, 249, 0.76);
  --editor-field-hover: #fffefa;
  --editor-ink-soft: #786f66;
}

.dashboard-server-editor-shell {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.dashboard-server-editor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 58px;
  padding: 0 18px;
  border-bottom: 1px solid var(--editor-line);
  background: var(--editor-head);
}

.dashboard-server-editor-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 750;
  color: var(--text-primary);
}

.dashboard-server-editor-title-icon {
  width: 28px;
  height: 28px;
  justify-content: center;
  border-radius: 8px;
  border: 1px solid var(--editor-line);
  background: var(--editor-field);
  color: var(--editor-ink-soft);
}

.dashboard-server-editor-form {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.dashboard-server-editor-body {
  display: flex;
  flex: 1;
  min-height: 0;
  flex-direction: column;
  gap: 0;
  padding: 0 18px 0 20px;
  overflow-y: auto;
  overflow-x: hidden;
}

.dashboard-server-editor .server-editor-section {
  position: relative;
  margin: 0;
  padding: 16px 0 18px;
  border: 0;
  border-radius: 0;
  border-left: 0;
  background: transparent;
}

.dashboard-server-editor .server-editor-section + .server-editor-section {
  border-top: 1px solid var(--editor-line);
}

.server-editor-section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 12px;
  padding: 0 0 10px;
  border-bottom: 1px solid var(--editor-line-soft);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 720;
  letter-spacing: 0;
  text-transform: none;
}

.server-editor-section-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 7px;
  border: 1px solid var(--editor-line-soft);
  color: var(--editor-ink-soft);
  background: var(--editor-field);
}

.server-editor-fields {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dashboard-server-editor .form-label {
  color: var(--editor-ink-soft);
  font-size: 11px;
  font-weight: 650;
}

.dashboard-server-editor .form-row {
  grid-template-columns: minmax(0, 1.35fr) 110px;
  gap: 10px;
}

.dashboard-server-editor .input,
.dashboard-server-editor .select {
  min-height: 37px;
  padding: 7px 11px;
  border-radius: 8px;
  border-color: var(--editor-line);
  background: var(--editor-field);
  box-shadow: none;
}

.dashboard-server-editor .input:hover,
.dashboard-server-editor .select:hover {
  background: var(--editor-field-hover);
}

.dashboard-server-editor .input:focus,
.dashboard-server-editor .select:focus {
  border-color: color-mix(in srgb, var(--text-secondary) 58%, transparent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--text-secondary) 10%, transparent);
}

.dashboard-server-editor textarea.input {
  min-height: 108px;
}

.server-editor-auth-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.server-editor-segment {
  display: grid;
  grid-template-columns: 1fr 1px 1fr;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--editor-line);
  border-radius: 10px;
  background: var(--editor-field);
}

.server-editor-segment::before {
  content: "";
  width: 1px;
  min-height: 22px;
  align-self: center;
  grid-column: 2;
  grid-row: 1;
  background: var(--editor-line);
}

.server-editor-segment button {
  min-height: 31px;
  border-radius: 7px;
  color: var(--editor-ink-soft);
  font-size: 12px;
  font-weight: 650;
}

.server-editor-segment button:first-child {
  grid-column: 1;
}

.server-editor-segment button:last-child {
  grid-column: 3;
}

.server-editor-segment button:hover,
.server-editor-segment button.active {
  background: var(--editor-head);
  color: var(--text-primary);
}

.server-editor-credential-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 39px;
  padding: 0 11px;
  border: 1px solid var(--editor-line);
  border-radius: 9px;
  background: var(--editor-field);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 650;
}

.server-editor-credential-button:hover {
  background: var(--editor-field-hover);
  color: var(--text-primary);
}

.server-editor-empty,
.server-editor-credential-summary {
  padding: 10px 0;
  border-top: 1px solid var(--editor-line-soft);
  border-bottom: 1px solid var(--editor-line-soft);
  color: var(--editor-ink-soft);
  font-size: 13px;
}

.server-editor-empty {
  text-align: center;
}

.server-editor-browse {
  min-height: 25px;
  padding: 0 8px;
  font-size: 11px;
}

.dashboard-server-editor-footer {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-2);
  padding: 13px 18px;
  border-top: 1px solid var(--editor-line);
  background: var(--editor-head);
  flex-shrink: 0;
}
.server-editor-clear-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-right: auto;
  font-size: var(--text-sm);
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
}
.server-editor-clear-check input { cursor: pointer; }

/* 状态面板 */
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.stat-item {
  background: var(--surface-sunken);
  border-radius: var(--radius-xs);
  padding: 7px 4px;
  text-align: center;
  border: 1px solid var(--border-subtle);
  transition: var(--transition-fast);
}
.stat-item:hover { border-color: var(--border); box-shadow: none; }
.stat-val { font-size: var(--text-lg); font-weight: 700; font-family: var(--font-mono); color: var(--text-primary); }
.stat-lbl { font-size: var(--text-xs); color: var(--text-tertiary); margin-top: 1px; }

/* 主机区域 */
.section-title-container { display: flex; align-items: center; gap: var(--space-2); margin-bottom: 0; }
.section-title-icon { font-size: var(--text-md); display: flex; align-items: center; color: var(--text-secondary); }
.section-title { font-size: var(--text-sm); font-weight: 650; color: var(--text-primary); }

.hosts-section-container { flex: 1; display: flex; flex-direction: column; gap: 8px; overflow: hidden; }
.hosts-scroll-area { flex: 1; overflow-y: auto; padding-right: 2px; padding-bottom: 8px; }

/* ── 分屏分割线 ─────────────────────────────────────────────── */
.split-resizer-v {
  position: relative;
  z-index: 10;
  width: 4px;
  cursor: col-resize;
  background: var(--border-subtle);
  transition: background-color 0.25s, box-shadow 0.25s;
}
.split-resizer-v:hover,
.split-resizer-v.dragging,
.split-resizer-v.armed {
  background-color: var(--accent) !important;
  box-shadow: none;
}

.split-resizer-h {
  position: relative;
  z-index: 10;
  height: 4px;
  cursor: row-resize;
  background: var(--border-subtle);
  transition: background-color 0.25s, box-shadow 0.25s;
}
.split-resizer-h:hover,
.split-resizer-h.dragging,
.split-resizer-h.armed {
  background-color: var(--accent) !important;
  box-shadow: none;
}

/* ── 终端主题选择卡片 ────────────────────────────────────────── */
.theme-palette-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-2); margin-top: var(--space-1); }
.theme-palette-card {
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-3);
  cursor: pointer;
  transition: var(--transition);
  background: var(--surface-sunken);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.theme-palette-card:hover { border-color: var(--border-focus); background: var(--surface-hover); }
.theme-palette-card.active {
  border-color: var(--accent);
  background: var(--accent-dim);
  box-shadow: 0 0 0 1px var(--accent), var(--shadow-md);
}
.theme-palette-swatches { display: flex; gap: var(--space-1); }
.theme-palette-swatch { width: 16px; height: 16px; border-radius: var(--radius-full); border: 1px solid var(--border); flex-shrink: 0; }
.theme-palette-name { font-size: var(--text-sm); font-weight: 600; color: var(--text-secondary); }

/* ── SSH 连接进度条 ─────────────────────────────────────────── */
@keyframes ssh-progress-indeterminate {
  0%   { transform: translateX(-100%) scaleX(0.5); width: 60%; }
  40%  { transform: translateX(0%)    scaleX(1);   width: 80%; }
  70%  { transform: translateX(60%)   scaleX(0.7); width: 60%; }
  100% { transform: translateX(200%)  scaleX(0.4); width: 40%; }
}

/* ── 视图切换分段控件 ───────────────────────────────────────── */
.segment-control {
  display: flex;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface-raised);
}
.segment-control button {
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-sm);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  color: var(--text-muted);
  transition: var(--transition-fast);
}
.segment-control button.active {
  background: var(--surface-sunken);
  color: var(--text-primary);
}
.segment-control-divider { width: 1px; background: var(--border); }

/* ── 标签右键菜单 ───────────────────────────────────────────── */
.tab-context-menu {
  position: fixed;
  z-index: 10000;
  background: var(--surface-overlay);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-1) 0;
  min-width: 140px;
  box-shadow: var(--shadow-md);
  animation: contextMenuIn 0.14s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.tab-context-menu-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-base);
  cursor: pointer;
  color: var(--text-secondary);
  transition: var(--transition-fast);
}
.tab-context-menu-item:hover { background: var(--surface-sunken); color: var(--text-primary); }
.tab-context-menu-item.occupied { color: var(--warning); }
.tab-context-menu-state {
  width: 16px;
  text-align: center;
  font-size: var(--text-sm);
  line-height: 1;
}

/* ── 响应式适配 ─────────────────────────────────────────────── */
@media (max-width: 900px) {
  .dashboard-left {
    width: 340px;
    min-width: 340px;
  }
  .dashboard-right {
    padding: var(--space-3);
  }
}

@media (max-width: 700px) {
  .dashboard-container {
    flex-direction: column;
  }
  .dashboard-left {
    width: 100%;
    min-width: 100%;
    max-height: 240px;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .dashboard-right {
    padding: var(--space-3);
  }
  .server-grid {
    grid-template-columns: 1fr;
  }
  .topbar-title {
    display: none;
  }
  .server-editor-auth-row {
    grid-template-columns: 1fr;
  }
  .dashboard-server-editor .form-row {
    grid-template-columns: 1fr;
  }
  /* 触摸目标最小 44px */
  .btn { min-height: 44px; }
  .btn-sm { min-height: 36px; }
  .btn-icon { min-width: 44px; min-height: 44px; }
  .segment-control button { min-width: 44px; min-height: 36px; }
  .server-card { min-height: 52px; }
}

@media (max-width: 500px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
  .file-list-header,
  .file-item {
    grid-template-columns: minmax(100px, 1fr) 50px 70px 90px;
  }
  .file-permission { display: none; }
}

/* ── 通用徽标 ─────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border);
  background: var(--surface-overlay);
  color: var(--text-secondary);
  font-size: 11px;
  line-height: 1;
  white-space: nowrap;
}

/* ── prefers-reduced-motion ─────────────────────────────────── */
/* ── 终端命令栏按钮 ── */
.term-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: 26px;
  padding: 4px 8px;
  font-size: 11px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition-fast);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
}
.term-btn:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
  border-color: var(--border-focus);
}
.term-btn.active {
  color: var(--text-primary);
  background: var(--surface-active);
  border-color: var(--accent);
}
.term-btn-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  transition: var(--transition-fast);
  flex-shrink: 0;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  cursor: not-allowed;
}
.term-btn-icon.enabled {
  cursor: pointer;
  color: var(--text-secondary);
}
.term-btn-icon.enabled:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
  border-color: var(--border-focus);
}
.term-btn-icon.success.enabled,
.term-btn-icon.accent.enabled {
  background: transparent;
  border-color: var(--border);
  color: var(--text-secondary);
}

/* ── 终端顶部状态栏 ── */
.term-status-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: var(--term-status-bg);
  border-bottom: var(--term-status-border);
  font-size: 12px;
  color: var(--term-status-color);
  user-select: none;
  flex-shrink: 0;
}

.term-reconnect-btn {
  padding: 3px 8px;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  color: var(--text-secondary);
  font-size: 11px;
  cursor: pointer;
  font-family: inherit;
  transition: var(--transition-fast);
}
.term-reconnect-btn:hover {
  background: var(--surface-hover);
  border-color: var(--border-focus);
  color: var(--text-primary);
}

/* ── 终端底部命令输入栏 ── */
.term-input-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: var(--term-input-bar-bg);
  border-top: var(--term-input-bar-border);
  flex-shrink: 0;
  position: relative;
}

/* ── 终端容器 CSS 变量默认值（JS 主题切换时覆盖） ── */
:root {
  --term-container-bg: #0e1218;
  --term-status-bg: var(--surface-raised);
  --term-status-border: 1px solid var(--border-subtle);
  --term-status-color: #818fa0;
  --term-server-color: #eaf0f7;
  --term-input-bar-bg: var(--surface-raised);
  --term-input-bar-border: 1px solid var(--border-subtle);
  --term-input-bg: var(--surface-sunken);
  --term-input-color: #eaf0f7;
  --term-btn-border: rgba(77,158,255,0.1);
  --term-separator: rgba(77,158,255,0.08);
  --term-muted: #5a6578;
  --term-context-bg: #131922;
  --term-context-border: 1px solid rgba(56,68,90,0.8);
  --term-context-shadow: 0 8px 32px rgba(0,5,20,0.6), 0 2px 8px rgba(0,5,20,0.4);
}

/* ── 终端弹窗通用样式 ── */
.term-popup {
  position: fixed;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  z-index: 100;
}
.term-popup-backdrop {
  position: fixed;
  inset: 0;
  background: transparent;
}

/* ── 历史条目 hover ── */
.history-item:hover {
  background: var(--surface-hover);
}

/* ── ProbePanel 图标按钮 ── */
.probe-icon-btn {
  background: none;
  border: none;
  color: var(--text-tertiary);
  cursor: pointer;
  padding: 2px 4px;
  font-size: 13px;
  line-height: 1;
  border-radius: 3px;
}
.probe-icon-btn:hover {
  color: var(--text-primary);
}

@media (prefers-reduced-motion: reduce) {
  .context-menu,
  .status-dot.just-connected,
  .status-dot.online,
  .status-dot.connecting,
  .modal,
  .modal-overlay,
  .tab-context-menu,
  .update-bubble,
  .update-bubble-pulse {
    animation: none;
  }
  * {
    transition-duration: 0.01ms !important;
  }
}
