
/* ═══════════════════════════════════════════════════════════════
   UI 重设计 v2 — 现代化 / 大气 / 用户友好
   ═══════════════════════════════════════════════════════════════ */

/* === 全局字体与排版 === */
* {
  font-feature-settings: "cv11", "ss01", "ss02";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
body, button, input, select, textarea {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial,
               "Hiragino Sans GB", sans-serif;
}

/* === 滚动条美化 === */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: rgba(0,0,0,0.15); }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent, #00d9ff); }

/* === 桌面背景 — 动态渐变 + 微动效 === */
body {
  background:
    radial-gradient(at 10% 10%, rgba(0,217,255,0.10) 0, transparent 40%),
    radial-gradient(at 90% 30%, rgba(46,213,115,0.08) 0, transparent 40%),
    radial-gradient(at 50% 90%, rgba(124,77,255,0.10) 0, transparent 50%),
    linear-gradient(135deg, #0a0e1a 0%, #0f1424 50%, #0a0e1a 100%) !important;
  background-attachment: fixed;
  animation: bgshift 30s ease-in-out infinite;
}
@keyframes bgshift {
  0%, 100% { background-position: 0% 0%, 100% 0%, 50% 100%, 0 0; }
  50% { background-position: 30% 20%, 70% 40%, 30% 80%, 0 0; }
}

/* === 窗口大幅美化 === */
.window {
  background: rgba(20, 25, 40, 0.92) !important;
  border: 1px solid rgba(255,255,255,0.10) !important;
  border-radius: 14px !important;
  box-shadow:
    0 24px 64px rgba(0,0,0,0.6),
    0 8px 24px rgba(0,0,0,0.4),
    0 0 0 1px rgba(255,255,255,0.05),
    inset 0 1px 0 rgba(255,255,255,0.08) !important;
  backdrop-filter: blur(40px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(40px) saturate(180%) !important;
  overflow: hidden;
  transition: box-shadow 0.25s ease, transform 0.15s ease;
}
.window:hover { box-shadow: 0 28px 72px rgba(0,0,0,0.7), 0 12px 32px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.1) !important; }
.window.maximized { border-radius: 0 !important; }

.window-titlebar {
  background: linear-gradient(180deg,
    rgba(255,255,255,0.08) 0%,
    rgba(255,255,255,0.03) 100%) !important;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  padding: 10px 14px !important;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.2px;
  height: 38px;
  display: flex;
  align-items: center;
}
.window-titlebar i { color: var(--accent, #00d9ff); margin-right: 8px; font-size: 14px; }

.window-controls { gap: 8px; }
/* === macOS 风格窗口按钮：3 个彩色圆点 === */
/* Windows 风格窗口按钮：彩色图标，hover 时高亮 */
.window-ctrl {
  width: 28px; height: 28px;
  border-radius: 5px;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0;
  margin: 0;
  transition: background 0.15s, color 0.15s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.window-ctrl i { font-size: 13px; opacity: 0.85; }
/* 默认图标颜色（暗色背景下用浅色） */
.window-ctrl:nth-child(1) i { color: #ff6b6b; }   /* 关闭 - 红 */
.window-ctrl:nth-child(2) i { color: #ffd93d; }   /* 最小化 - 黄 */
.window-ctrl:nth-child(3) i { color: #6bcf7f; }   /* 最大化 - 绿 */
/* hover 时高亮背景 */
.window-ctrl:nth-child(1):hover { background: #ff6b6b; }
.window-ctrl:nth-child(1):hover i { color: white; }
.window-ctrl:nth-child(2):hover { background: #ffd93d; }
.window-ctrl:nth-child(2):hover i { color: #333; }
.window-ctrl:nth-child(3):hover { background: #6bcf7f; }
.window-ctrl:nth-child(3):hover i { color: white; }

/* === 任务栏 === */
.taskbar {
  background: rgba(15, 18, 30, 0.88) !important;
  backdrop-filter: blur(30px) saturate(180%);
  border-top: 1px solid rgba(255,255,255,0.08);
  height: 48px !important;
  padding: 0 12px;
  box-shadow: 0 -4px 24px rgba(0,0,0,0.4);
}
.taskbar-btn {
  border-radius: 8px !important;
  padding: 8px 12px !important;
  min-height: 36px;
  height: auto;
  transition: all 0.15s;
}
.taskbar-btn:hover { background: rgba(255,255,255,0.10) !important; transform: translateY(-1px); }
.start-btn {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  background: rgba(88,101,242,0.12) !important;
  border: 1px solid rgba(88,101,242,0.2) !important;
  color: #a8b4ff !important;
  font-weight: 500;
  font-size: 13px;
  padding: 6px 16px !important;
  margin-right: 6px;
  white-space: nowrap;
  width: auto !important;
  min-width: unset !important;
  max-width: unset !important;
}
.start-btn i { font-size: 16px; }
.start-btn:hover {
  background: rgba(88,101,242,0.22) !important;
  border-color: rgba(88,101,242,0.35) !important;
  color: #fff !important;
  transform: translateY(-1px);
  box-shadow: 0 2px 12px rgba(88,101,242,0.2);
}

.taskbar-app-btn {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.05);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  transition: all 0.15s;
}
.taskbar-app-btn:hover { background: rgba(255,255,255,0.12); }
.taskbar-app-btn.active {
  background: rgba(0,217,255,0.18);
  border-color: rgba(0,217,255,0.4);
  color: #00d9ff;
  box-shadow: 0 0 12px rgba(0,217,255,0.3);
}
.taskbar-time {
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  font-size: 12px;
  color: rgba(255,255,255,0.85);
}

/* === 按钮美化 === */
.btn, button.dash-btn {
  background: rgba(255,255,255,0.06) !important;
  border: 1px solid rgba(255,255,255,0.10) !important;
  color: var(--text, #e8e8e8) !important;
  padding: 7px 14px !important;
  border-radius: 7px !important;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
  font-weight: 500;
}
.btn:hover, button.dash-btn:hover {
  background: rgba(0,217,255,0.12) !important;
  border-color: rgba(0,217,255,0.4) !important;
  color: #00d9ff !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(0,217,255,0.2);
}
.btn-primary, .dash-btn-primary {
  background: linear-gradient(135deg, #00d9ff 0%, #2ed573 100%) !important;
  border: none !important;
  color: #000 !important;
  font-weight: 600 !important;
}
.btn-primary:hover, .dash-btn-primary:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(0,217,255,0.4);
}
.btn-danger {
  background: rgba(255,71,87,0.15) !important;
  border-color: rgba(255,71,87,0.4) !important;
  color: #ff4757 !important;
}
.btn-danger:hover { background: rgba(255,71,87,0.25) !important; }

/* === 仪表盘卡片 === */
.server-card, .dash-card {
  background: rgba(255,255,255,0.04) !important;
  border: 1px solid rgba(255,255,255,0.08) !important;
  border-radius: 12px !important;
  padding: 16px !important;
  transition: all 0.2s;
}
.server-card:hover, .dash-card:hover {
  background: rgba(255,255,255,0.07) !important;
  border-color: rgba(0,217,255,0.3) !important;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

/* === 输入框 === */
input[type=text], input[type=password], input[type=email], input[type=url],
input[type=number], textarea, select {
  background: rgba(0,0,0,0.30) !important;
  border: 1px solid rgba(255,255,255,0.10) !important;
  border-radius: 6px !important;
  padding: 8px 12px !important;
  color: var(--text, #e8e8e8);
  font-size: 13px;
  outline: none;
  transition: all 0.15s;
}
input:focus, textarea:focus, select:focus {
  border-color: var(--accent, #00d9ff) !important;
  box-shadow: 0 0 0 3px rgba(0,217,255,0.15) !important;
}

/* === 模态框 === */
.modal-overlay {
  background: rgba(0,0,0,0.65) !important;
  backdrop-filter: blur(8px);
}
.modal-content {
  background: rgba(20,25,40,0.96) !important;
  border: 1px solid rgba(255,255,255,0.12) !important;
  border-radius: 14px !important;
  box-shadow: 0 24px 64px rgba(0,0,0,0.7) !important;
  backdrop-filter: blur(40px);
}
.modal-header {
  padding: 16px 20px !important;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  font-weight: 600;
}
.modal-header h3 { margin: 0; font-size: 15px; }
.modal-body { padding: 18px 20px !important; }
.modal-footer {
  padding: 12px 20px !important;
  border-top: 1px solid rgba(255,255,255,0.08);
}

/* === 表格 === */
.file-table {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  font-size: 13px;
}
.file-table th {
  background: rgba(255,255,255,0.06);
  padding: 10px 12px;
  text-align: left;
  font-weight: 600;
  color: rgba(255,255,255,0.75);
  position: sticky;
  top: 0;
  z-index: 1;
  border-bottom: 1px solid rgba(255,255,255,0.10);
}
.file-table td {
  padding: 8px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.file-table tr:hover td { background: rgba(0,217,255,0.06); }

/* === 进度条 === */
.progress-bar {
  height: 6px;
  background: rgba(255,255,255,0.08);
  border-radius: 3px;
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #00d9ff, #2ed573);
  transition: width 0.2s;
}

/* === 压缩/解压大进度条 (2026-07-17) === */
.progress-bar-large {
  height: 24px;
  background: rgba(255,255,255,0.08);
  border-radius: 6px;
  overflow: hidden;
  position: relative;
}
.progress-bar-large-fill {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #60a5fa);
  transition: width 0.3s;
  position: relative;
}
.progress-bar-large-indeterminate {
  position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(96,165,250,0.6), transparent);
  animation: progress-indet 1.5s infinite;
  display: none;
}
@keyframes progress-indet {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}
.progress-text {
  margin-top: 10px;
  font-size: 13px;
  color: var(--text-dim);
  text-align: center;
  font-family: monospace;
}

/* === 系统管理面板 === */
.syspanel-container {
  display: flex !important;
  height: 100% !important;
  background: rgba(0,0,0,0.2) !important;
}
.syspanel-sidebar {
  background: rgba(0,0,0,0.25);
  border-right: 1px solid rgba(255,255,255,0.06);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}
.syspanel-tabs { flex: 1; padding: 8px 6px; overflow-y: auto; }
.syspanel-tab {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
  color: rgba(255,255,255,0.75);
  margin-bottom: 2px;
}
.syspanel-tab:hover {
  background: rgba(0,217,255,0.10);
  color: #00d9ff;
}
.syspanel-tab.active {
  background: linear-gradient(90deg, rgba(0,217,255,0.18), rgba(46,213,115,0.10));
  color: #00d9ff;
  font-weight: 600;
  box-shadow: inset 3px 0 0 #00d9ff;
}
.syspanel-tab i { width: 16px; text-align: center; font-size: 13px; }
.syspanel-content {
  flex: 1;
  padding: 0;
  overflow: auto;
  background: linear-gradient(135deg, rgba(0,0,0,0.15), rgba(0,0,0,0.05));
}
.syspanel-sidebar-footer {
  border-top: 1px solid rgba(255,255,255,0.06);
  padding: 6px;
}

/* === 监控图表 === */
.stat-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  padding: 14px;
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0;
  width: 3px;
  height: 100%;
  background: var(--accent, #00d9ff);
}
.stat-value {
  font-size: 24px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(135deg, #fff, #aaa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.stat-label { font-size: 11px; color: rgba(255,255,255,0.55); text-transform: uppercase; letter-spacing: 0.5px; }

/* === 登录页美化 === */
.login-card {
  width: 380px;
  padding: 36px;
  background: rgba(20,25,40,0.85) !important;
  border: 1px solid rgba(255,255,255,0.10) !important;
  border-radius: 18px !important;
  backdrop-filter: blur(40px) saturate(180%);
  box-shadow: 0 24px 64px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.05);
}
.login-card h1 {
  font-size: 22px;
  margin: 0 0 4px;
  background: linear-gradient(135deg, #00d9ff, #2ed573);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.login-card .subtitle { color: rgba(255,255,255,0.55); font-size: 13px; margin-bottom: 24px; }
.login-card input {
  width: 100% !important;
  box-sizing: border-box;
  padding: 11px 14px !important;
  margin-bottom: 14px;
}
.login-card button {
  width: 100%;
  padding: 12px !important;
  font-size: 14px !important;
}

/* === toast 通知 === */
.toast {
  background: rgba(40,45,65,0.97) !important;
  border: 1px solid rgba(255,255,255,0.2) !important;
  border-radius: 12px !important;
  padding: 14px 22px !important;
  box-shadow: 0 8px 32px rgba(0,0,0,0.6), 0 2px 8px rgba(0,0,0,0.4) !important;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.3px;
  animation: toastIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  max-width: 480px;
}
.toast.toast-success { background: rgba(46,213,115,0.15) !important; border-left: 4px solid #2ed573 !important; border-color: rgba(46,213,115,0.4) !important; color: #2ed573 !important; }
.toast.toast-error   { background: rgba(255,71,87,0.15) !important; border-left: 4px solid #ff4757 !important; border-color: rgba(255,71,87,0.4) !important; color: #ff6b6b !important; }
.toast.toast-warning { background: rgba(255,165,2,0.15) !important; border-left: 4px solid #ffa502 !important; border-color: rgba(255,165,2,0.4) !important; color: #ffa502 !important; }
.toast.toast-info    { background: rgba(0,200,255,0.12) !important; border-left: 4px solid #00d9ff !important; border-color: rgba(0,200,255,0.3) !important; color: #7dd8ff !important; }
@keyframes toastIn {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* === loading === */
.loading-spinner {
  width: 36px; height: 36px;
  border: 3px solid rgba(255,255,255,0.08);
  border-top-color: #00d9ff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* === i18n 语言选择器 === */
.lang-selector {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  color: var(--text, #e8e8e8);
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  margin: 0 6px;
  outline: none;
  transition: all 0.2s;
  font-weight: 500;
}
.lang-selector:hover {
  background: rgba(0,217,255,0.15);
  border-color: rgba(0,217,255,0.4);
}
.lang-selector option { background: #14182a; color: #e8e8e8; }

[dir="rtl"] .taskbar { flex-direction: row-reverse; }
[dir="rtl"] .syspanel-sidebar { border-right: none; border-left: 1px solid rgba(255,255,255,0.06); }
[dir="rtl"] .syspanel-tab.active { box-shadow: inset -3px 0 0 #00d9ff; }

/* === 启动菜单 === */
.start-menu {
  background: rgba(20,25,40,0.95) !important;
  border: 1px solid rgba(255,255,255,0.10) !important;
  border-radius: 12px !important;
  backdrop-filter: blur(40px);
  box-shadow: 0 16px 48px rgba(0,0,0,0.6) !important;
}
.start-item {
  padding: 10px 16px !important;
  border-radius: 6px !important;
  font-size: 13px !important;
  transition: all 0.15s;
}
.start-item:hover {
  background: rgba(0,217,255,0.10) !important;
  color: #00d9ff !important;
}

/* === 右键菜单 === */
.context-menu {
  background: rgba(20,25,40,0.96) !important;
  border: 1px solid rgba(255,255,255,0.12) !important;
  border-radius: 10px !important;
  backdrop-filter: blur(20px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.6) !important;
  padding: 6px !important;
}
.context-item {
  padding: 8px 14px !important;
  border-radius: 5px !important;
  font-size: 13px !important;
  transition: all 0.12s;
}
.context-item:hover {
  background: rgba(0,217,255,0.15) !important;
  color: #00d9ff !important;
}
.context-item i { margin-right: 8px; width: 14px; }

/* === 选择高亮 === */
::selection { background: rgba(0,217,255,0.30); color: white; }


/* === i18n 语言选择器 === */
.lang-selector {
  background: rgba(255,255,255,0.08);
  border: 1px solid var(--border-color);
  color: var(--text);
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
  margin: 0 6px;
  outline: none;
  transition: all 0.2s;
}
.lang-selector:hover { background: rgba(255,255,255,0.15); border-color: var(--accent); }
.lang-selector option { background: #1a1a2e; color: var(--text); }
[dir="rtl"] .lang-selector { direction: rtl; }
[dir="rtl"] .taskbar { flex-direction: row-reverse; }
[dir="rtl"] .taskbar-left { flex-direction: row-reverse; }

/* === UI 美化补充 === */
.window {
  box-shadow: 0 8px 32px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.08) !important;
  border-radius: 10px !important;
  overflow: hidden;
  backdrop-filter: blur(20px);
}
.window-titlebar {
  background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02)) !important;
  border-bottom: 1px solid var(--border-color);
  padding: 8px 12px;
  font-weight: 500;
  font-size: 13px;
  user-select: none;
}
.taskbar {
  backdrop-filter: blur(20px);
  background: rgba(20,20,30,0.85) !important;
  border-top: 1px solid rgba(255,255,255,0.08);
}
button.btn, button.dash-btn, .taskbar-btn {
  transition: all 0.15s ease;
}
button.btn:hover, button.dash-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,217,255,0.2);
}

/* ── WebGMSSH Desktop Style ─────────────────────────────── */
:root {
  --taskbar-h: 48px;
  --bg-dark: #0d0d14;
  --bg-window: #1a1a28;
  --bg-titlebar: #12121e;
  --border-color: #2a2a3e;
  --text: #d4d4e0;
  --text-dim: #8888a8;
  --text-bright: #f0f0f8;
  --accent: #4f8cff;
  --accent-hover: #6ba0ff;
  --accent-dim: rgba(79,140,255,0.15);
  --green: #2ed573;
  --red: #ff4757;
  --orange: #ffa502;
  --shadow: 0 8px 32px rgba(0,0,0,0.5);
  --radius: 10px;
  --radius-sm: 6px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Noto Sans SC', sans-serif; background: var(--bg-dark); color: var(--text); font-size: 14px; }

/* ── Desktop ──────────────────────────────────────────── */
#desktop { width: 100%; height: 100%; position: relative; overflow: hidden; }
.wallpaper {
  position: fixed; inset: 0;
  background: linear-gradient(135deg, #0a0a1a 0%, #15152f 30%, #1a1a30 60%, #0f0f20 100%);
  z-index: 0;
}
.wallpaper::after {
  content: ''; position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(79,140,255,0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(108,92,231,0.04) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 80%, rgba(79,140,255,0.03) 0%, transparent 50%);
}

/* ── Desktop Icons ────────────────────────────────────── */
.desktop-icons {
  position: absolute; left: 20px; top: 20px; z-index: 1;
  display: flex; flex-direction: column; gap: 16px;
}
.desktop-icon {
  display: flex; flex-direction: column; align-items: center;
  width: 80px; padding: 12px 8px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer; color: var(--text); text-align: center;
  transition: background 0.15s;
  user-select: none; -webkit-user-select: none;
}
.desktop-icon:hover { background: rgba(255,255,255,0.08); }
.desktop-icon:active { background: rgba(255,255,255,0.12); }
.desktop-icon .icon-wrap {
  width: 52px; height: 52px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; margin-bottom: 6px;
  background: linear-gradient(135deg, var(--accent), #6c5ce7);
  color: #fff; box-shadow: 0 4px 12px rgba(79,140,255,0.3);
}
.desktop-icon span { font-size: 12px; line-height: 1.3; text-shadow: 0 1px 4px rgba(0,0,0,0.6); }

/* ── Taskbar ──────────────────────────────────────────── */
.taskbar {
  position: fixed; bottom: 0; left: 0; right: 0;
  height: var(--taskbar-h); z-index: 9000;
  background: rgba(16,16,28,0.92);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border-color);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 8px;
}
.taskbar-left { display: flex; align-items: center; gap: 4px; flex: 1; min-width: 0; }
.taskbar-right { display: flex; align-items: center; gap: 4px; }
.taskbar-btn {
  background: none; border: none; color: var(--text-dim);
  width: 36px; height: 36px; border-radius: var(--radius-sm);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  font-size: 16px; transition: all 0.15s;
}
.taskbar-btn:hover { background: rgba(255,255,255,0.1); color: var(--text); }
.taskbar-divider { width: 1px; height: 24px; background: var(--border-color); margin: 0 4px; }
.taskbar-time { color: var(--text-dim); font-size: 12px; padding: 0 8px; white-space: nowrap; }
.taskbar-apps { display: flex; gap: 2px; min-width: 0; overflow: hidden; flex: 1; }
.taskbar-app-btn {
  background: rgba(255,255,255,0.05); border: 1px solid transparent;
  color: var(--text-dim); padding: 4px 12px; border-radius: 4px;
  cursor: pointer; font-size: 12px; white-space: nowrap; max-width: 160px;
  overflow: hidden; text-overflow: ellipsis; transition: all 0.15s;
}
.taskbar-app-btn:hover { background: rgba(255,255,255,0.1); }
.taskbar-app-btn.active { background: var(--accent-dim); border-color: var(--accent); color: var(--text-bright); }

/* ── Start Menu ───────────────────────────────────────── */
.start-menu {
  position: fixed; bottom: var(--taskbar-h); left: 0;
  z-index: 8999; width: 240px;
  background: rgba(20,20,36,0.95);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  border-bottom: none; border-radius: var(--radius) var(--radius) 0 0;
  padding: 0; display: none;
  box-shadow: var(--shadow);
}
.start-menu.show { display: block; }
.start-header {
  padding: 16px 16px 12px;
  font-size: 15px; font-weight: 700;
  background: linear-gradient(135deg, var(--accent), #6c5ce7);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.start-items { padding: 4px 8px 12px; }
.start-item {
  padding: 10px 12px; border-radius: var(--radius-sm);
  cursor: pointer; display: flex; align-items: center; gap: 10px;
  font-size: 14px; transition: background 0.1s;
}
.start-item:hover { background: rgba(255,255,255,0.06); }
.start-item i { width: 20px; text-align: center; color: var(--accent); }
.start-divider { height: 1px; background: var(--border-color); margin: 6px 12px; }

/* ── Connection Panel ─────────────────────────────────── */
.connection-panel {
  position: fixed; bottom: calc(var(--taskbar-h) + 8px); right: 8px;
  z-index: 8999; width: 280px; max-height: 300px;
  background: rgba(20,20,36,0.95);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color); border-radius: var(--radius);
  display: none; box-shadow: var(--shadow);
}
.connection-panel.show { display: flex; flex-direction: column; }
.panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-bottom: 1px solid var(--border-color);
  font-size: 13px; font-weight: 600;
}
.panel-header button { background: none; border: none; color: var(--text-dim); font-size: 20px; cursor: pointer; padding: 0 4px; }
.panel-body { padding: 8px; overflow-y: auto; flex: 1; }
.conn-empty { text-align: center; color: var(--text-dim); font-size: 13px; padding: 20px; }
.conn-item {
  padding: 8px 12px; display: flex; align-items: center; gap: 8px;
  font-size: 13px; border-radius: var(--radius-sm);
}
.conn-item:hover { background: rgba(255,255,255,0.04); }

/* ── Windows ──────────────────────────────────────────── */
.window {
  position: absolute; z-index: 100;
  background: var(--bg-window); border: 1px solid var(--border-color);
  border-radius: var(--radius); box-shadow: var(--shadow);
  display: flex; flex-direction: column; min-width: 300px; min-height: 200px;
  animation: winOpen 0.15s ease-out;
}
@keyframes winOpen { from { transform: scale(0.95); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.window.maximized {
  top: 0 !important; left: 0 !important;
  width: 100% !important; height: calc(100% - var(--taskbar-h)) !important;
  border-radius: 0; border: none;
}
.window.minimized { display: none; }
.window-titlebar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 12px; height: 40px; cursor: default;
  background: var(--bg-titlebar);
  border-radius: var(--radius) var(--radius) 0 0;
  user-select: none; flex-shrink: 0;
}
.window-titlebar:active { cursor: grabbing; }
.window-title { font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.window-title i { color: var(--accent); width: 16px; text-align: center; font-size: 14px; }
.window-controls { display: flex; gap: 4px; }
.window-ctrl {
  background: none; border: none; width: 30px; height: 30px;
  border-radius: 4px; cursor: pointer; display: flex;
  align-items: center; justify-content: center;
  color: var(--text-dim); font-size: 14px; transition: all 0.1s;
}
.window-ctrl:hover { background: rgba(255,255,255,0.1); color: var(--text); }
.window-ctrl.close:hover { background: var(--red); color: #fff; }
.window-body { flex: 1; overflow: hidden; display: flex; flex-direction: column; position: relative; }
.window-resize-handle { position: absolute; right: 0; bottom: 0; width: 16px; height: 16px; cursor: nwse-resize; }

/* ── Server Manager ───────────────────────────────────── */
.app-servers { padding: 0; display: flex; flex-direction: column; height: 100%; }
.app-toolbar {
  display: flex; align-items: center; gap: 6px;
  padding: 10px 14px; border-bottom: 1px solid var(--border-color);
  flex-shrink: 0; flex-wrap: wrap;
}
.app-toolbar .btn {
  padding: 6px 14px; border: 1px solid var(--border-color);
  background: rgba(255,255,255,0.04); color: var(--text);
  border-radius: var(--radius-sm); cursor: pointer; font-size: 13px;
  display: flex; align-items: center; gap: 6px; transition: all 0.15s;
}
.app-toolbar .btn:hover { background: rgba(255,255,255,0.1); }
.app-toolbar .btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.app-toolbar .btn-primary:hover { background: var(--accent-hover); }
.app-toolbar .btn i { font-size: 12px; }
.server-list { flex: 1; overflow-y: auto; padding: 8px; }
.server-card {
  padding: 12px 14px; border-radius: var(--radius-sm);
  border: 1px solid transparent; margin-bottom: 6px;
  display: flex; align-items: center; justify-content: space-between;
  cursor: pointer; transition: all 0.15s;
}
.server-card:hover { background: rgba(255,255,255,0.04); border-color: var(--border-color); }
.server-info { flex: 1; min-width: 0; }
.server-name { font-weight: 600; font-size: 14px; margin-bottom: 2px; }
.server-host { font-size: 12px; color: var(--text-dim); }
.server-actions { display: flex; gap: 6px; opacity: 0; transition: opacity 0.15s; }
.server-card:hover .server-actions { opacity: 1; }
.server-actions button {
  background: none; border: none; color: var(--text-dim); cursor: pointer;
  width: 30px; height: 30px; border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; transition: all 0.15s;
}
.server-actions .connect-btn:hover { color: var(--green); background: rgba(46,213,115,0.1); }
.server-actions .edit-btn:hover { color: var(--accent); background: var(--accent-dim); }
.server-actions .delete-btn:hover { color: var(--red); background: rgba(255,71,87,0.1); }

/* ── Modal ────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 99999;
  background: rgba(0,0,0,0.5);
  display: flex; align-items: center; justify-content: center;
  animation: fadeIn 0.15s;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal-content {
  background: var(--bg-window); border: 1px solid var(--border-color);
  border-radius: var(--radius); width: 90%; max-width: 480px;
  max-height: 85vh; overflow-y: auto; box-shadow: var(--shadow);
  animation: slideUp 0.15s;
}
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px 12px; border-bottom: 1px solid var(--border-color);
}
.modal-header h3 { font-size: 16px; font-weight: 600; }
.modal-close { background: none; border: none; color: var(--text-dim); font-size: 22px; cursor: pointer; padding: 4px; }
.modal-body { padding: 16px 20px 20px; }
.modal-body .form-group { margin-bottom: 14px; }
.modal-body label { display: block; font-size: 13px; color: var(--text-dim); margin-bottom: 5px; font-weight: 500; }
.modal-body input, .modal-body select, .modal-body textarea {
  width: 100%; padding: 9px 12px; background: rgba(0,0,0,0.3);
  border: 1px solid var(--border-color); border-radius: var(--radius-sm);
  color: var(--text); font-size: 14px; outline: none; transition: border-color 0.15s;
}
.modal-body input:focus, .modal-body select:focus, .modal-body textarea:focus { border-color: var(--accent); }
.modal-body textarea { resize: vertical; min-height: 60px; font-family: 'Courier New', monospace; font-size: 13px; }
.modal-footer {
  display: flex; gap: 8px; justify-content: flex-end;
  padding: 12px 20px 16px; border-top: 1px solid var(--border-color);
}
.modal-footer .btn {
  padding: 8px 20px; border-radius: var(--radius-sm); cursor: pointer;
  font-size: 14px; font-weight: 500; transition: all 0.15s;
}
.modal-footer .btn-secondary { background: rgba(255,255,255,0.06); border: 1px solid var(--border-color); color: var(--text); }
.modal-footer .btn-secondary:hover { background: rgba(255,255,255,0.12); }
.modal-footer .btn-primary { background: var(--accent); border: 1px solid var(--accent); color: #fff; }
.modal-footer .btn-primary:hover { background: var(--accent-hover); }

/* ── File Manager ─────────────────────────────────────── */
.app-files { display: flex; flex-direction: column; height: 100%; min-height: 0; }

/* ── 文件管理器：顶部 header（连接 / 搜索 / 状态） ── */
.fm-header {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px;
  background: rgba(0,0,0,0.25);
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0; flex-wrap: wrap;
}
.fm-header select,
.fm-header .fm-search-input {
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--border-color);
  color: var(--text);
  padding: 5px 10px;
  border-radius: 4px;
  font-size: 13px;
  outline: none;
}
.fm-header select { min-width: 130px; }
.fm-header select:focus,
.fm-header .fm-search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(72,126,176,0.15);
}
.fm-header .fm-search-wrap {
  flex: 1; min-width: 120px; position: relative;
  display: flex; align-items: center;
}
.fm-header .fm-search-wrap > i {
  position: absolute; left: 9px; top: 50%;
  transform: translateY(-50%); color: var(--text-dim); font-size: 12px; pointer-events: none;
}
.fm-header .fm-search-input { width: 100%; padding-left: 28px; }
.fm-header .fm-status {
  font-size: 11px; color: var(--text-dim);
  padding: 0 6px; white-space: nowrap;
}

/* ── 文件管理器：body（侧边栏 + 主区） ── */
.fm-body {
  flex: 1; display: flex; min-height: 0; overflow: hidden;
}

/* ── 文件管理器：左侧导航侧边栏 ── */
.fm-sidebar {
  width: 200px;
  background: rgba(0,0,0,0.2);
  border-right: 1px solid var(--border-color);
  display: flex; flex-direction: column;
  flex-shrink: 0;
  transition: width 0.2s ease;
  overflow: hidden;
}
.fm-sidebar.collapsed { width: 44px; }
.fm-sidebar-sections {
  flex: 1; overflow-y: auto; overflow-x: hidden;
  padding: 6px 0;
}
.fm-sidebar-section { margin-bottom: 6px; }
.fm-sidebar-title {
  padding: 8px 12px 4px;
  font-size: 10px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.6px;
  color: var(--text-dim);
}
.fm-sidebar.collapsed .fm-sidebar-title,
.fm-sidebar.collapsed .fm-sidebar-label,
.fm-sidebar.collapsed .fm-sidebar-badge { display: none; }
.fm-sidebar-item {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 12px;
  cursor: pointer;
  font-size: 13px;
  color: rgba(255,255,255,0.75);
  transition: all 0.12s;
  border-left: 3px solid transparent;
  white-space: nowrap;
  user-select: none;
}
.fm-sidebar-item:hover {
  background: rgba(255,255,255,0.05);
  color: var(--text);
}
.fm-sidebar-item.active {
  background: rgba(72,126,176,0.15);
  color: var(--accent);
  border-left-color: var(--accent);
}
.fm-sidebar-item i {
  width: 16px; text-align: center;
  font-size: 13px; flex-shrink: 0;
  color: inherit;
}
.fm-sidebar-item .fm-sidebar-label {
  flex: 1; overflow: hidden;
  text-overflow: ellipsis; min-width: 0;
}
.fm-sidebar-item .fm-sidebar-badge {
  font-size: 10px; padding: 1px 5px;
  background: rgba(255,255,255,0.08);
  border-radius: 8px; color: var(--text-dim);
  flex-shrink: 0;
}
.fm-sidebar-item.parent-folder i { color: var(--orange); }
.fm-sidebar-footer {
  border-top: 1px solid var(--border-color);
  padding: 4px;
  display: flex; justify-content: flex-end;
}
.fm-sidebar-toggle {
  background: none; border: 1px solid transparent;
  color: var(--text-dim);
  cursor: pointer;
  padding: 5px 8px;
  border-radius: 4px;
  font-size: 12px;
  transition: all 0.15s;
}
.fm-sidebar-toggle:hover {
  background: rgba(255,255,255,0.06);
  color: var(--text);
  border-color: rgba(255,255,255,0.08);
}

/* RTL: 侧边栏在右边 */
[dir="rtl"] .fm-sidebar {
  border-right: none;
  border-left: 1px solid var(--border-color);
}
[dir="rtl"] .fm-sidebar-item {
  border-left: none;
  border-right: 3px solid transparent;
}
[dir="rtl"] .fm-sidebar-item.active {
  border-right-color: var(--accent);
}

/* ── 文件管理器：主区域 ── */
.fm-main {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column;
  overflow: hidden;
}

.file-toolbar {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 12px;
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0; flex-wrap: wrap;
  background: rgba(0,0,0,0.12);
}
.file-toolbar .btn {
  padding: 4px 10px; border: 1px solid var(--border-color);
  background: rgba(255,255,255,0.04); color: var(--text);
  border-radius: 4px; cursor: pointer; font-size: 12px;
  display: flex; align-items: center; gap: 5px; transition: all 0.15s;
  white-space: nowrap;
}
.file-toolbar .btn:hover { background: rgba(255,255,255,0.1); }
.file-toolbar .btn:disabled { opacity: 0.4; cursor: not-allowed; }
.file-toolbar .btn i { font-size: 11px; }
.file-toolbar .toolbar-sep {
  width: 1px; height: 18px;
  background: var(--border-color);
  margin: 0 2px;
}
.file-path-bar {
  display: flex; align-items: center; gap: 4px;
  padding: 6px 12px;
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
  font-size: 12px; color: var(--text-dim);
  overflow-x: auto; white-space: nowrap;
  background: rgba(0,0,0,0.08);
}
.file-path-bar .path-segment {
  cursor: pointer; padding: 2px 6px; border-radius: 3px;
}
.file-path-bar .path-segment:hover { background: rgba(255,255,255,0.06); color: var(--text); }
.file-browser { flex: 1; overflow: auto; min-height: 0; }
.file-table { width: 100%; border-collapse: collapse; }
.file-table th {
  position: sticky; top: 0; background: var(--bg-window);
  padding: 8px 12px; text-align: left; font-size: 12px;
  font-weight: 600; color: var(--text-dim); border-bottom: 1px solid var(--border-color);
  z-index: 1;
}
.file-table td { padding: 6px 12px; font-size: 13px; border-bottom: 1px solid rgba(255,255,255,0.03); }
.file-table tr { cursor: pointer; transition: background 0.1s; }
.file-table tr:hover { background: rgba(255,255,255,0.04); }
.file-table .file-icon { width: 20px; text-align: center; margin-right: 8px; color: var(--accent); }
.file-table .file-icon.dir { color: var(--orange); }
.file-table .file-name { display: flex; align-items: center; }
.file-table .file-size { color: var(--text-dim); font-size: 12px; }
.file-table .file-mtime { color: var(--text-dim); font-size: 12px; }
.file-table .selected { background: var(--accent-dim) !important; }
/* Selection highlight */
.file-table .selected { background: var(--accent-dim) !important; border-left: 3px solid var(--accent); }
.file-table tr.selected td:first-child { padding-left: 9px; } /* compensate for left border */

/* File Card View */
.file-card-view {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 8px; padding: 8px;
  align-content: start;
  align-items: start;
}
.fm-card {
  display: flex; flex-direction: column; align-items: center;
  padding: 12px 10px 10px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-color); cursor: pointer;
  transition: all 0.15s; text-align: center;
  justify-content: flex-start;
}
.fm-card:hover { background: rgba(255,255,255,0.04); border-color: var(--accent); }
.fm-card.fm-selected { background: var(--accent-dim); border-color: var(--accent); }
.fm-card-parent { opacity: 0.7; border-style: dashed; }
.fm-card-icon {
  font-size: 24px; color: var(--accent); margin-bottom: 4px;
  line-height: 1;
}
.fm-card-icon.dir { color: var(--orange); }
.fm-card-name {
  font-size: 12px; font-weight: 500; overflow: hidden;
  text-overflow: ellipsis; max-width: 100%; white-space: nowrap;
  line-height: 1.3;
}
.fm-card-meta { font-size: 10px; color: var(--text-dim); margin-top: 2px; line-height: 1; }
.file-empty {
  text-align: center; padding: 40px 20px; color: var(--text-dim);
}

/* ── File Editor ──────────────────────────────────────── */
.file-editor-modal .modal-content { max-width: 900px; width: 95%; height: 85vh; display: flex; flex-direction: column; }
.file-editor-modal .modal-body {
  padding: 0; flex: 1; display: flex; flex-direction: column;
  min-height: 0; /* flexbox override */
}
.file-editor-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 16px; border-bottom: 1px solid var(--border-color);
  font-size: 13px; background: var(--bg-titlebar); flex-shrink: 0;
}
.file-editor-modal .file-editor-textarea,
.file-editor-textarea {
  padding: 14px 16px; background: rgba(0,0,0,0.4);
  border: none; color: #e8e8e8; font-family: 'Cascadia Code', 'Fira Code', 'Courier New', monospace;
  font-size: 14px; line-height: 1.7; resize: vertical;
  outline: none; tab-size: 2; width: 100%;
  /* Fill remaining space */
  flex: 1; min-height: 250px;
}
.file-editor-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 16px; border-top: 1px solid var(--border-color);
  background: var(--bg-titlebar); font-size: 12px; color: var(--text-dim);
  flex-shrink: 0;
}

/* ── Terminal ─────────────────────────────────────────── */
.terminal-container {
  flex: 1; padding: 0; overflow: hidden; background: #1a1a2a;
  display: flex; flex-direction: column;
}
.terminal-connect-bar {
  display: flex; align-items: center; gap: 8px; padding: 8px 14px;
  border-bottom: 1px solid var(--border-color); flex-shrink: 0;
  background: var(--bg-titlebar); flex-wrap: wrap;
}
.terminal-connect-bar select {
  background: rgba(0,0,0,0.3); border: 1px solid var(--border-color);
  color: var(--text); padding: 6px 10px; border-radius: var(--radius-sm);
  font-size: 13px; outline: none; flex: 1; min-width: 120px;
}
.terminal-connect-bar .btn {
  padding: 6px 14px; border-radius: var(--radius-sm); cursor: pointer;
  font-size: 13px; border: none; transition: all 0.15s;
}
.terminal-connect-bar .btn-connect { background: var(--accent); color: #fff; }
.terminal-connect-bar .btn-connect:hover { background: var(--accent-hover); }
.terminal-connect-bar .btn-disconnect { background: rgba(255,71,87,0.2); color: var(--red); border: 1px solid rgba(255,71,87,0.3); }
.terminal-connect-bar .btn-disconnect:hover { background: rgba(255,71,87,0.3); }
.terminal-xterm { flex: 1; overflow: hidden; padding: 4px; }

/* ── Toast ────────────────────────────────────────────── */
.toast-container {
  position: fixed; top: 16px; right: 16px; z-index: 99999;
  display: flex; flex-direction: column; gap: 8px;
}
/* ── Mobile ───────────────────────────────────────────── */
@media (max-width: 768px) {
  .desktop-icons { left: 12px; top: 12px; gap: 12px; }
  .desktop-icon { width: 64px; padding: 8px 4px 6px; }
  .desktop-icon .icon-wrap { width: 44px; height: 44px; font-size: 18px; }
  .desktop-icon span { font-size: 11px; }
  .window { min-width: 200px !important; min-height: 150px; }
  .window:not(.maximized) {
    width: calc(100% - 12px) !important;
    left: 6px !important; right: 6px !important;
  }
  .server-actions { opacity: 1 !important; }
  .taskbar-app-btn { max-width: 80px; font-size: 11px; padding: 4px 8px; }
  .start-menu { width: 200px; }
  .file-table th:nth-child(3), .file-table td:nth-child(3) { display: none; } /* hide mtime on mobile */
  .dashboard-header { flex-direction: column; align-items: flex-start; gap: 10px; }
  .dashboard-header h2 { font-size: 17px; }
  .dashboard-header-actions { flex-wrap: wrap; width: 100%; }
  .dashboard-header-actions .dash-btn { flex: 1 1 auto; justify-content: center; font-size: 12px; padding: 7px 10px; }
}

/* ── Scrollbar ────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

/* ── Context Menu ──────────────────────────────────────── */
.context-menu {
  display: none;
  position: fixed;
  z-index: 100000;
  background: rgba(24,24,40,0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  min-width: 160px;
  padding: 4px;
  box-shadow: var(--shadow);
}
.context-item {
  padding: 8px 12px;
  font-size: 13px;
  cursor: pointer;
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background 0.1s;
}
.context-item:hover { background: rgba(255,255,255,0.08); }
.context-item i { width: 16px; color: var(--text-dim); }

/* ── Loading Spinner Overlay ──────────────────────────── */
/* ── 📊 Dashboard ────────────────────────────── */
.dashboard {
  position: absolute; left: 24px; top: 20px; right: 24px;
  bottom: calc(var(--taskbar-h) + 16px); z-index: 1;
  overflow-y: auto; padding-right: 8px;
}
.dashboard-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px; padding: 0 4px;
}
.dashboard-header h2 { font-size: 20px; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.dashboard-header h2 i { color: var(--accent); }
.dashboard-header-actions { display: flex; gap: 8px; }
.donate-btn { color: #ff6b9d; border-color: rgba(255,107,157,0.45); font-weight: 600; }
.donate-btn:hover { background: rgba(255,107,157,0.12); border-color: rgba(255,107,157,0.7); color: #ff8fb3; }
.dash-btn {
  padding: 7px 16px; border: 1px solid var(--border-color);
  background: rgba(255,255,255,0.04); color: var(--text);
  border-radius: var(--radius-sm); cursor: pointer; font-size: 13px;
  display: flex; align-items: center; gap: 6px; transition: all 0.15s;
}
.dash-btn:hover { background: rgba(255,255,255,0.1); }
.dash-btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.dash-btn-primary:hover { background: var(--accent-hover); }

/* Card Grid */
.dashboard-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px; padding-bottom: 20px;
}
.dash-card {
  background: var(--bg-window); border: 1px solid var(--border-color);
  border-radius: var(--radius); cursor: pointer;
  transition: all 0.2s; overflow: hidden;
  display: flex; flex-direction: column;
}
.dash-card:hover {
  border-color: var(--accent); transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(79,140,255,0.15);
}
.dash-card-top {
  display: flex; align-items: center; gap: 14px;
  padding: 18px 18px 12px; flex: 1;
}
.dash-card-icon {
  width: 44px; height: 44px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--accent), #6c5ce7);
  color: #fff; box-shadow: 0 4px 12px rgba(79,140,255,0.25);
}
.dash-card-info { min-width: 0; flex: 1; }
.dash-card-name { font-weight: 600; font-size: 15px; margin-bottom: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-card-meta { font-size: 12px; color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-card-badges { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 4px; align-items: center; }
.dash-card-badges > span { margin-left: 0 !important; }
.dash-card-stats { display: flex; gap: 6px; margin-top: 4px; flex-wrap: wrap; }
.dash-card-stats .dash-stat-item { font-size: 11px; display: inline-flex; align-items: center; gap: 2px; cursor: help; }
.dash-card-stats .dash-stat-item i { font-size: 10px; }
.dash-card-stats .dash-stat-loading { font-size: 11px; color: var(--text-dim); }
.dash-card-stats .dash-stat-offline { font-size: 11px; color: var(--orange); }
.dash-list-stats { font-size: 11px; margin-top: 2px; }
.dash-card-actions {
  display: flex; gap: 6px; padding: 10px 14px 14px;
  border-top: 1px solid rgba(255,255,255,0.04);
}
.dash-act-btn {
  flex: 1; padding: 4px 6px; border: 1px solid var(--border-color);
  background: rgba(255,255,255,0.04); color: var(--text);
  border-radius: var(--radius-sm); cursor: pointer; font-size: 11px;
  display: flex; align-items: center; justify-content: center; gap: 5px;
  transition: all 0.15s; white-space: nowrap;
}
.dash-act-btn:hover { background: rgba(255,255,255,0.1); }
.dash-act-btn i { color: var(--accent); }
.dash-act-edit, .dash-act-del { flex: 0 0 34px; }
.dash-act-del:hover { background: rgba(255,71,87,0.15); border-color: var(--red); }
.dash-act-del:hover i { color: var(--red); }
.dash-act-edit:hover { background: var(--accent-dim); }
.dash-act-mirror { flex: 0 0 34px; }
.dash-act-mirror:hover { background: rgba(255,193,7,0.15); border-color: rgba(255,193,7,0.4); }
.dash-act-mirror:hover i { color: #ffc107; }

/* List View */
.dashboard-list {
  display: flex; flex-direction: column; gap: 4px;
}
.dash-list-header, .dash-list-row {
  display: grid; grid-template-columns: 2fr 2fr 80px 1.2fr 140px;
  padding: 10px 16px; align-items: center; gap: 8px;
}
.dash-list-header {
  font-size: 12px; color: var(--text-dim); font-weight: 600;
  border-bottom: 1px solid var(--border-color);
}
.dash-list-row {
  border-radius: var(--radius-sm); cursor: pointer;
  transition: background 0.1s; font-size: 14px;
}
.dash-list-row:hover { background: rgba(255,255,255,0.04); }
.dash-list-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.dash-list-host { color: var(--text-dim); font-size: 13px; }
.dash-list-port { color: var(--text-dim); }
.dash-list-user { color: var(--text-dim); font-size: 13px; }
.dash-list-actions { display: flex; gap: 4px; }
.ds-btn {
  width: 30px; height: 30px; border: 1px solid var(--border-color);
  background: rgba(255,255,255,0.04); color: var(--text-dim);
  border-radius: 6px; cursor: pointer; font-size: 12px;
  display: inline-flex; align-items: center; justify-content: center;
  transition: all 0.15s ease;
  position: relative;
  -webkit-tap-highlight-color: transparent;
}
/* \u89e6\u5c4f\u4f18\u5316\uff1a\u786e\u4fdd\u70b9\u51fb\u533a\u57df\u8db3\u591f\u5927 */
@media (hover: none) and (pointer: coarse) {
  .ds-btn { width: 36px; height: 36px; font-size: 14px; }
}
.ds-btn:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.15);
  color: var(--text);
}
.ds-btn:active {
  transform: scale(0.92);
}
.ds-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  transform: none !important;
}
.ds-btn.term:hover { color: #2ed573; border-color: rgba(46,213,115,0.3); }
.ds-btn.term:active { background: rgba(46,213,115,0.12); }
.ds-btn.file:hover { color: var(--accent); border-color: var(--accent); }
.ds-btn.file:active { background: rgba(72,126,176,0.12); }
.ds-btn.edit:hover { color: var(--orange); border-color: rgba(255,165,2,0.3); }
.ds-btn.edit:active { background: rgba(255,165,2,0.12); }
.ds-btn.del:hover { color: #ff4757; background: rgba(255,71,87,0.08); border-color: rgba(255,71,87,0.3); }
.ds-btn.del:active { background: rgba(255,71,87,0.15); }
.ds-btn.log:hover { color: #a29bfe; border-color: rgba(162,155,254,0.3); }
.ds-btn.log:active { background: rgba(162,155,254,0.12); }
.ds-btn.mirror:hover { color: #ffc107; border-color: rgba(255,193,7,0.35); }
.ds-btn.mirror:active { background: rgba(255,193,7,0.12); }
/* 容器挂载目录按钮（带文字, 宽度自适应） */
.ds-btn.mnt { width: auto; padding: 0 8px; gap: 4px; }
.ds-btn.mnt span { font-size: 10px; }
.ds-btn.mnt:hover { color: #00a1ff; border-color: rgba(0,161,255,0.35); }
.ds-btn.mnt:active { background: rgba(0,161,255,0.12); }
/* 容器数据库按钮 */
.ds-btn.db:hover { color: #2ed573; border-color: rgba(46,213,115,0.35); }
.ds-btn.db:active { background: rgba(46,213,115,0.12); }

/* Empty State */
.dash-group-header {
  display: flex; align-items: center; gap: 8px;
  padding: 16px 4px 8px; font-size: 13px; font-weight: 600;
  color: var(--text-dim); border-bottom: 1px solid rgba(255,255,255,0.06);
  margin-bottom: 8px; grid-column: 1 / -1;
}
.dash-group-header:first-child { padding-top: 0; }

/* --- 分组筛选栏 --- */
.dash-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 0 12px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--border-color);
}
.dash-filter-btn {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border-color);
  color: var(--text);
  padding: 5px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.15s;
}
.dash-filter-btn:hover { background: rgba(255,255,255,0.12); border-color: var(--accent); }
.dash-filter-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.dash-filter-count { opacity: 0.6; font-size: 11px; margin-left: 3px; }

/* --- 分组筛选栏 --- */
.dash-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 0 12px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--border-color);
}
.dash-filter-btn {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border-color);
  color: var(--text);
  padding: 5px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.15s;
}
.dash-filter-btn:hover { background: rgba(255,255,255,0.12); border-color: var(--accent); }
.dash-filter-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.dash-filter-count { opacity: 0.6; font-size: 11px; margin-left: 3px; }

/* --- 分组筛选栏 --- */
.dash-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 0 12px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--border-color);
}
.dash-filter-btn {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border-color);
  color: var(--text);
  padding: 5px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.15s;
}
.dash-filter-btn:hover { background: rgba(255,255,255,0.12); border-color: var(--accent); }
.dash-filter-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.dash-filter-count { opacity: 0.6; font-size: 11px; margin-left: 3px; }
.dash-group-count {
  font-size: 11px; background: rgba(255,255,255,0.06);
  padding: 1px 8px; border-radius: 10px; color: var(--text-dim);
}
.dash-empty, .dash-loading {
  text-align: center; padding: 60px 20px; color: var(--text-dim);
  grid-column: 1 / -1;
}

/* Mobile */
@media (max-width: 768px) {
  .dashboard { left: 16px; top: 16px; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .dash-list-header, .dash-list-row { grid-template-columns: 1.5fr 1fr 60px; }
  .dash-list-header span:nth-child(3), .dash-list-row span:nth-child(3),
  .dash-list-header span:nth-child(4), .dash-list-row span:nth-child(4) { display: none; }
}

.loading-overlay {
  position: absolute; inset: 0; z-index: 10;
  background: rgba(0,0,0,0.5);
  display: flex; align-items: center; justify-content: center;
}
.loading-spinner { width: 32px; height: 32px; border: 3px solid rgba(255,255,255,0.1); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ══════════════════════════════════════════════════════════════
   UI 美化增强
   ══════════════════════════════════════════════════════════════ */

/* ── Dashboard Cards ── */
.dash-card {
  background: linear-gradient(135deg, rgba(26,26,46,0.95) 0%, rgba(30,35,55,0.95) 100%);
  border: 1px solid rgba(72,126,176,0.2);
  border-radius: 10px;
  padding: 14px;
  cursor: pointer;
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}

.dash-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), #6c5ce7);
  opacity: 0.6;
  transition: opacity 0.25s;
}

.dash-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(72,126,176,0.15);
}

.dash-card:hover::before {
  opacity: 1;
}

.dash-card-top {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.dash-card-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(72,126,176,0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: var(--accent);
  flex-shrink: 0;
}

.dash-card-actions {
  display: flex;
  gap: 6px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255,255,255,0.05);
}

.dash-act-btn {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--text);
  padding: 5px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.dash-act-btn:hover {
  background: rgba(72,126,176,0.15);
  border-color: var(--accent);
  color: var(--accent);
}

.dash-act-primary {
  background: linear-gradient(135deg, var(--accent), #5b8ec9) !important;
  color: #fff !important;
  font-weight: 600;
  border-color: var(--accent) !important;
}

.dash-act-primary:hover {
  filter: brightness(1.15);
  transform: translateY(-1px);
}

.dash-act-edit:hover { color: var(--accent); border-color: var(--accent); }
.dash-act-del:hover { color: #ff4757; border-color: #ff4757; background: rgba(255,71,87,0.1) !important; }

/* Stats badges on cards */
.dash-card-stats { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.dash-card-stats .dash-stat-item {
  font-size: 11px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  cursor: help;
  background: rgba(0,0,0,0.2);
  padding: 2px 6px;
  border-radius: 4px;
}
.dash-card-stats .dash-stat-item i { font-size: 10px; }
.dash-card-stats .dash-stat-loading { font-size: 11px; color: var(--text-dim); }
.dash-card-stats .dash-stat-offline { font-size: 11px; color: var(--orange); }
.dash-list-stats { font-size: 11px; margin-top: 2px; }

/* ── Group Headers ── */
.dash-group-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 4px;
  margin: 8px 0 4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.dash-group-header:first-child { margin-top: 0; }

.dash-group-count {
  font-size: 10px;
  background: rgba(72,126,176,0.15);
  color: var(--accent);
  padding: 1px 6px;
  border-radius: 8px;
  font-weight: 500;
}

/* ── System Panel ── */
.syspanel-container {
  display: flex;
  height: 100%;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(22,22,40,1) 0%, rgba(28,30,50,1) 100%);
}

.syspanel-sidebar {
  width: 140px;
  background: rgba(0,0,0,0.25);
  border-right: 1px solid rgba(255,255,255,0.06);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: width 0.25s ease;
  overflow: hidden;
}

.sidebar-collapsed .syspanel-sidebar { width: 44px; }

/* 移动端 / 小屏: 边栏默认折叠 (图标模式)，节省空间 */
@media (max-width: 768px) {
  .syspanel-sidebar { width: 44px; }
  .syspanel-tab-label { display: none; }
  .syspanel-sidebar .syspanel-collapse-btn i:before { content: "\f054"; }  /* fa-chevron-right */
}

/* 手动展开后 (用户点开折叠按钮) */
@media (max-width: 768px) {
  .syspanel-container:not(.sidebar-collapsed) .syspanel-sidebar { width: 140px; }
  .syspanel-container:not(.sidebar-collapsed) .syspanel-tab-label { display: inline; }
}

.syspanel-tabs {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}

.syspanel-tab {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  color: var(--text-dim);
  font-size: 13px;
  transition: all 0.15s;
  white-space: nowrap;
  border-left: 3px solid transparent;
  margin: 1px 0;
}

.syspanel-tab:hover {
  background: rgba(255,255,255,0.04);
  color: var(--text);
}

.syspanel-tab.active {
  background: rgba(72,126,176,0.12);
  color: var(--accent);
  border-left-color: var(--accent);
}

.syspanel-tab i {
  font-size: 16px;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

.syspanel-tab-label {
  font-size: 12px;
  font-weight: 500;
}

.sidebar-collapsed .syspanel-tab-label { display: none; }

.syspanel-sidebar-footer {
  padding: 6px;
  border-top: 1px solid rgba(255,255,255,0.06);
  text-align: center;
}

.syspanel-collapse-btn {
  background: none;
  border: 1px solid transparent;
  color: var(--text-dim);
  cursor: pointer;
  padding: 4px 10px;
  font-size: 14px;
  border-radius: 6px;
  transition: all 0.15s;
}

.syspanel-collapse-btn:hover {
  background: rgba(255,255,255,0.05);
  color: var(--text);
  border-color: rgba(255,255,255,0.1);
}

.syspanel-content {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.syspanel-tab-content {
  flex: 1;
  overflow: auto;
}

/* ── Stats Grid ── */
.syspanel-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}

.syspanel-stat-card {
  background: rgba(0,0,0,0.2);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px;
  padding: 14px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  transition: all 0.2s;
}

.syspanel-stat-card:hover {
  border-color: var(--accent);
  background: rgba(0,0,0,0.3);
}

.syspanel-stat-icon {
  font-size: 24px;
  color: var(--accent);
  flex-shrink: 0;
  width: 36px;
  text-align: center;
}

.syspanel-stat-info { min-width: 0; flex: 1; }
.syspanel-stat-value { font-size: 22px; font-weight: 700; line-height: 1.2; }
.syspanel-stat-label { font-size: 12px; color: var(--text-dim); margin-top: 2px; }
.syspanel-stat-detail { font-size: 11px; color: var(--text-dim); margin-top: 2px; }

/* ── Section Headers ── */
.syspanel-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  font-weight: 600;
  gap: 8px;
  flex-wrap: wrap;
}

.syspanel-setting-group { margin-bottom: 14px; }
.syspanel-setting-group label {
  display: block;
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 4px;
}

.syspanel-terminal-wrap {
  height: 100%;
  padding: 4px;
  box-sizing: border-box;
}

/* ── File Manager Card Grid Fix ── */
.file-card-view {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 8px;
  padding: 8px;
  align-content: start;
  align-items: start;
}

.fm-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 12px 10px 10px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.06);
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
  background: rgba(0,0,0,0.15);
}

.fm-card:hover {
  background: rgba(72,126,176,0.1);
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(72,126,176,0.1);
}

.fm-card.fm-selected {
  background: rgba(72,126,176,0.15);
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(72,126,176,0.2);
}

.fm-card-parent {
  opacity: 0.6;
  border-style: dashed;
}

.fm-card-parent:hover {
  opacity: 1;
}

.fm-card-icon {
  font-size: 28px;
  color: var(--accent);
  margin-bottom: 6px;
  line-height: 1;
}

.fm-card-icon.dir { color: var(--orange); }

.fm-card-name {
  font-size: 12px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  white-space: nowrap;
  line-height: 1.3;
}

.fm-card-meta {
  font-size: 10px;
  color: var(--text-dim);
  margin-top: 3px;
  line-height: 1;
}

/* ── Modal Enhancement ── */
.modal-content {
  border-radius: 12px !important;
  box-shadow: 0 12px 40px rgba(0,0,0,0.4) !important;
}

.modal-header {
  border-radius: 12px 12px 0 0 !important;
}

/* ═══════════════════════════════════════════════════════════════
 *  穿透运维面板 (v2)
 * ═══════════════════════════════════════════════════════════════ */

.tun-intro {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  margin-bottom: 12px;
  background: linear-gradient(135deg, rgba(0,200,83,0.08), rgba(46,213,115,0.04));
  border: 1px solid rgba(0,200,83,0.2);
  border-radius: 8px;
  flex-shrink: 0;
}

.tun-intro-step {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
}

.tun-intro-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #00c853, #2ed573);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}

.tun-intro-text {
  font-size: 12px;
  line-height: 1.4;
  color: var(--text-main);
}

.tun-intro-text code {
  background: rgba(0,0,0,0.25);
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 11px;
  color: var(--accent);
}

.tun-intro-arrow {
  color: var(--accent);
  font-size: 14px;
  flex-shrink: 0;
  opacity: 0.6;
}

/* ── 状态徽章 ── */
.tun-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 10px;
  white-space: nowrap;
}

.tun-status-online {
  background: rgba(46,213,115,0.15);
  color: #2ed573;
}
.tun-status-degraded {
  background: rgba(255,165,2,0.15);
  color: #ffa502;
}
.tun-status-connecting {
  background: rgba(46,213,115,0.10);
  color: #888;
}
.tun-status-offline {
  background: rgba(128,128,128,0.15);
  color: #888;
}

/* ── 状态点 ── */
.tun-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.tun-dot-online {
  background: #2ed573;
  box-shadow: 0 0 0 0 rgba(46,213,115,0.5);
  animation: tun-pulse-online 2s infinite;
}
.tun-dot-degraded {
  background: #ffa502;
  animation: tun-pulse-degraded 1s infinite;
}
.tun-dot-connecting {
  background: #888;
  animation: tun-pulse-degraded 0.6s infinite;
}
.tun-dot-offline {
  background: #888;
}

@keyframes tun-pulse-online {
  0% { box-shadow: 0 0 0 0 rgba(46,213,115,0.5); }
  70% { box-shadow: 0 0 0 6px rgba(46,213,115,0); }
  100% { box-shadow: 0 0 0 0 rgba(46,213,115,0); }
}
@keyframes tun-pulse-degraded {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ── RTL 支持 ── */
[dir="rtl"] .tun-intro {
  flex-direction: row-reverse;
}
[dir="rtl"] .tun-intro-step {
  flex-direction: row-reverse;
}
