:root {
  --bg: #0b0f17;
  --bg2: #0f1622;
  --surface: #131c2b;
  --surface2: #182337;
  --border: #22314a;
  --border2: #2c3f5e;
  --text: #e8edf6;
  --muted: #8fa1bb;
  --muted2: #64748b;
  --primary: #3b82f6;
  --primary2: #2563eb;
  --accent: #7c3aed;
  --green: #22c55e;
  --red: #ef4444;
  --amber: #f59e0b;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 10px 30px rgba(0,0,0,.35);
  --font: "Segoe UI", "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  overflow: hidden;
}
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select, textarea { font-family: inherit; font-size: 14px; color: var(--text); }
svg { width: 18px; height: 18px; flex: none; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 16px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 600; transition: .15s;
  border: 1px solid transparent;
}
.btn svg { width: 16px; height: 16px; }
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary2));
  color: #fff; box-shadow: 0 4px 14px rgba(37, 99, 235, .35);
}
.btn-primary:hover { filter: brightness(1.1); transform: translateY(-1px); }
.btn-ghost { background: var(--surface2); color: var(--text); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--border2); background: #1d2a41; }
.btn-danger { background: rgba(239,68,68,.12); color: #fca5a5; border-color: rgba(239,68,68,.35); }
.btn-danger:hover { background: rgba(239,68,68,.22); }
.btn-sm { padding: 6px 11px; font-size: 13px; }
.btn-block { width: 100%; justify-content: center; padding: 12px; font-size: 15px; }
.icon-btn {
  width: 34px; height: 34px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center;
  color: var(--muted); transition: .15s; border: 1px solid transparent;
}
.icon-btn:hover { background: var(--surface2); color: var(--text); border-color: var(--border); }

/* ---------- 登录页 ---------- */
.login-view { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; }
.login-bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(1000px 500px at 15% -10%, rgba(59,130,246,.25), transparent 60%),
    radial-gradient(900px 500px at 100% 110%, rgba(124,58,237,.25), transparent 60%),
    linear-gradient(160deg, #0b1020, #0b0f17 55%, #0d1322);
}
.login-card {
  position: relative; width: 400px; max-width: calc(100vw - 40px);
  background: rgba(19, 28, 43, .75); backdrop-filter: blur(18px);
  border: 1px solid var(--border); border-radius: 22px;
  padding: 40px 38px; box-shadow: var(--shadow);
}
.login-logo {
  width: 62px; height: 62px; margin: 0 auto 16px; border-radius: 18px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff; box-shadow: 0 8px 24px rgba(59,130,246,.4);
}
.login-logo svg { width: 30px; height: 30px; }
.login-card h1 { text-align: center; font-size: 22px; letter-spacing: .5px; }
.login-sub { text-align: center; color: var(--muted); margin: 6px 0 26px; font-size: 13px; }
.login-hint { color: var(--red); font-size: 13px; margin-top: 12px; min-height: 18px; text-align: center; }
.login-foot { text-align: center; color: var(--muted2); font-size: 12px; margin-top: 18px; }

/* ---------- 表单 ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field.grow { flex: 1; }
.field label { font-size: 13px; color: var(--muted); font-weight: 500; }
.field input, .field select, .field textarea {
  background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 10px 12px; outline: none; transition: .15s; width: 100%;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(59,130,246,.15); }
.input-wrap { position: relative; }
.input-wrap svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--muted); }
.input-wrap input { padding-left: 38px; }
.form-row { display: flex; gap: 14px; align-items: flex-end; }
.form-row > .btn { margin-bottom: 14px; }
.form-row .field { flex: 1; }
.check { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; cursor: pointer; margin-bottom: 14px; }
.check input { accent-color: var(--primary); width: 15px; height: 15px; }
.form-tip {
  display: flex; gap: 8px; align-items: flex-start;
  background: rgba(59,130,246,.08); border: 1px solid rgba(59,130,246,.25);
  padding: 10px 12px; border-radius: var(--radius-sm); color: var(--muted); font-size: 12px; line-height: 1.6;
}
.form-tip svg { width: 15px; height: 15px; color: var(--primary); margin-top: 1px; }
.form-tip code { background: var(--bg2); padding: 1px 5px; border-radius: 4px; color: #a5c8ff; }

/* ---------- 应用布局 ---------- */
.app-view { display: flex; height: 100vh; }
.sidebar {
  width: 230px; flex: none; background: var(--bg2);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column; padding: 18px 12px;
}
.side-brand { display: flex; align-items: center; gap: 10px; font-size: 16px; font-weight: 700; padding: 6px 10px 20px; letter-spacing: .3px; }
.side-brand svg { width: 24px; height: 24px; color: var(--primary); }
.side-nav { display: flex; flex-direction: column; gap: 4px; }
.side-item {
  display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 10px;
  color: var(--muted); font-size: 14px; transition: .15s; text-decoration: none;
}
.side-item svg { width: 17px; height: 17px; }
.side-item:hover { background: var(--surface); color: var(--text); }
.side-item.active { background: linear-gradient(135deg, rgba(59,130,246,.18), rgba(124,58,237,.12)); color: #cfe0ff; border: 1px solid rgba(59,130,246,.3); }
.side-bottom { margin-top: auto; display: flex; flex-direction: column; gap: 4px; }

.main { flex: 1; overflow: hidden; display: flex; flex-direction: column; }
.main-header {
  padding: 22px 28px 14px; display: flex; align-items: center; justify-content: space-between;
  gap: 18px; flex-wrap: wrap;
}
.main-header h2 { font-size: 20px; }
.header-actions { display: flex; align-items: center; gap: 12px; }
.search-box {
  display: flex; align-items: center; gap: 9px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 10px; padding: 9px 13px; width: 260px;
}
.search-box svg { width: 16px; height: 16px; color: var(--muted); }
.search-box input { background: none; border: none; outline: none; color: var(--text); width: 100%; }

#conn-section, #files-local-view, #logs-view, #batch-view { flex: 1; overflow-y: auto; padding: 4px 28px 28px; }
.stats-row { display: flex; gap: 14px; margin: 6px 0 18px; }
.stat-card {
  flex: 1; max-width: 200px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px;
}
.stat-card .num { font-size: 24px; font-weight: 700; background: linear-gradient(90deg, #60a5fa, #a78bfa); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat-card .lbl { color: var(--muted); font-size: 12px; }

.conn-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.conn-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px; transition: .18s; position: relative; overflow: hidden;
}
.conn-card::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: linear-gradient(180deg, var(--primary), var(--accent)); opacity: .7;
}
.conn-card:hover { transform: translateY(-2px); border-color: var(--border2); box-shadow: var(--shadow); }
.conn-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.conn-icon {
  width: 42px; height: 42px; border-radius: 12px; background: linear-gradient(135deg, rgba(59,130,246,.2), rgba(124,58,237,.18));
  display: flex; align-items: center; justify-content: center; color: #7db0ff;
}
.conn-icon svg { width: 22px; height: 22px; }
.conn-badge { font-size: 11px; color: var(--muted); background: var(--bg2); border: 1px solid var(--border); padding: 2px 8px; border-radius: 20px; }
.conn-title { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.conn-title h4 { font-size: 16px; font-weight: 600; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted2); display: inline-block; flex: none; }
.status-dot.on { background: var(--green); box-shadow: 0 0 8px var(--green); }
.status-dot.err { background: var(--red); box-shadow: 0 0 8px var(--red); }
.conn-meta { margin: 8px 0 14px; display: flex; flex-direction: column; gap: 4px; color: var(--muted); font-size: 13px; }
.conn-meta .host { color: #a5c8ff; font-family: Consolas, monospace; }
.conn-actions { display: flex; gap: 8px; }
.conn-actions .btn { flex: 1; justify-content: center; }
.card-menu { position: relative; }
.card-menu .icon-btn { width: 30px; height: 30px; }
.dropdown {
  position: absolute; right: 0; top: 36px; background: var(--surface2); border: 1px solid var(--border);
  border-radius: 10px; padding: 6px; z-index: 20; min-width: 110px; box-shadow: var(--shadow);
}
.dropdown button { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 10px; border-radius: 7px; font-size: 13px; color: var(--text); }
.dropdown button:hover { background: var(--bg2); }
.dropdown button.danger { color: #fca5a5; }

.empty-state { text-align: center; padding: 80px 20px; color: var(--muted); }
.empty-state svg { width: 56px; height: 56px; opacity: .5; margin-bottom: 16px; }
.empty-state h3 { color: var(--text); font-size: 18px; margin-bottom: 8px; }
.empty-state p { margin-bottom: 20px; }

/* ---------- 本机文件视图 ---------- */
.panel-view { }
.panel-toolbar { margin-bottom: 14px; }
.path-bar { display: flex; align-items: center; gap: 8px; }
.path-bar input {
  flex: 1; background: var(--bg2); border: 1px solid var(--border); border-radius: 9px;
  padding: 9px 12px; outline: none; font-family: Consolas, "Microsoft YaHei", monospace;
}
.path-bar input:focus { border-color: var(--primary); }
.file-table-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: auto; max-height: calc(100vh - 200px); }
.file-table { width: 100%; border-collapse: collapse; }
.file-table th { text-align: left; padding: 11px 16px; font-size: 12px; color: var(--muted); border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--surface); }
.file-table td { padding: 9px 16px; border-bottom: 1px solid rgba(34,49,74,.6); font-size: 13px; }
.file-table tbody tr { cursor: default; }
.file-table tbody tr:hover { background: var(--bg2); }
.file-table .col-size { width: 110px; }
.file-table .col-time { width: 170px; }
.file-row.dir { color: #a5c8ff; cursor: pointer; }
.file-name { display: flex; align-items: center; gap: 9px; }
.file-name svg { width: 16px; height: 16px; color: var(--muted); }

/* ---------- RDP 浮层 ---------- */
.rdp-overlay { position: fixed; inset: 0; background: #05070c; display: flex; flex-direction: column; z-index: 100; }
.rdp-toolbar {
  display: flex; align-items: center; gap: 12px; padding: 8px 14px;
  background: #0d1420; border-bottom: 1px solid var(--border); flex-wrap: wrap;
}
.rdp-title { display: flex; align-items: center; gap: 9px; font-weight: 600; min-width: 160px; }
.rdp-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rdp-stage {
  flex: 1; position: relative; display: flex; align-items: center; justify-content: center;
  overflow: auto; background:
    radial-gradient(circle at 50% 40%, #0c1322, #05070c 75%);
}
#rdp-canvas { image-rendering: auto; box-shadow: 0 0 0 1px rgba(255,255,255,.06), 0 16px 60px rgba(0,0,0,.6); }
.rdp-cursor {
  position: absolute; width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.7), 0 2px 8px rgba(0,0,0,.5);
  pointer-events: none; transform: translate(-50%, -50%); z-index: 5;
}
.rdp-placeholder {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 16px; color: var(--muted); z-index: 3; background: rgba(5,7,12,.55);
}
.spinner {
  width: 42px; height: 42px; border-radius: 50%; border: 3px solid rgba(255,255,255,.12);
  border-top-color: var(--primary); animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.rdp-statusbar {
  display: flex; justify-content: space-between; padding: 5px 16px; font-size: 12px;
  color: var(--muted); background: #0d1420; border-top: 1px solid var(--border);
}

/* ---------- 弹窗 ---------- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(3,6,12,.7); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; z-index: 200; padding: 24px;
}
.modal {
  width: 640px; max-width: 100%; max-height: calc(100vh - 48px); overflow-y: auto;
  background: var(--surface); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow);
}
.modal-sm { width: 470px; }
.modal-wide { width: 1000px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.modal-head h3 { font-size: 17px; }
.conn-select { margin-left: auto; margin-right: 10px; background: var(--bg2); border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; font-size: 13px; color: var(--text); outline: none; max-width: 220px; }
.conn-select:focus { border-color: var(--primary); }
.modal-body { padding: 20px 22px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 22px; border-top: 1px solid var(--border); position: sticky; bottom: 0; background: var(--surface); z-index: 2; }

.btn-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.btn-grid .btn { justify-content: center; }

/* ---------- 文件传输 ---------- */
.file-panes { display: grid; grid-template-columns: 1fr; gap: 16px; }
.file-pane { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.pane-title { padding: 10px 14px; font-size: 13px; font-weight: 600; color: #a5c8ff; border-bottom: 1px solid var(--border); }
.path-bar.small { padding: 10px; }
.path-bar.small input { padding: 7px 10px; font-size: 12px; }
.file-list { height: 240px; overflow-y: auto; padding: 6px; }
.file-item {
  display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: 8px;
  cursor: pointer; font-size: 13px; color: var(--text); transition: .12s;
}
.file-item:hover { background: var(--surface2); }
.file-item.selected { background: rgba(59,130,246,.18); border: 1px solid rgba(59,130,246,.4); }
.file-item .fname { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-item .fsize { color: var(--muted); font-size: 12px; }
.file-item svg { width: 16px; height: 16px; color: var(--muted); }
.file-item.dir svg { color: #fbbf24; }
.file-hint { color: var(--muted2); text-align: center; padding: 12px 10px; font-size: 13px; }
.pane-foot { padding: 9px 14px; border-top: 1px solid var(--border); font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.transfer-actions { display: flex; gap: 12px; justify-content: center; margin: 16px 0 8px; }

/* ---------- 分组 / 标签 / 日志 ---------- */
.group-select {
  background: var(--bg2); border: 1px solid var(--border); border-radius: 10px;
  padding: 9px 12px; font-size: 13px; color: var(--text); outline: none; min-width: 130px;
}
.group-select:focus { border-color: var(--primary); }
.group-badge {
  font-size: 11px; color: #7db0ff; background: rgba(59,130,246,.12); border: 1px solid rgba(59,130,246,.3);
  padding: 1px 8px; border-radius: 20px; white-space: nowrap;
}
.tag-row { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 2px; }
.tag-chip {
  font-size: 11px; color: var(--muted); background: var(--bg2); border: 1px solid var(--border);
  padding: 2px 8px; border-radius: 20px; position: relative; display: inline-flex; align-items: center; gap: 0;
  transition: padding .16s ease, gap .16s ease;
}
.tag-chip:hover { padding-right: 4px; gap: 3px; }
.tag-del {
  display: inline-flex; align-items: center; justify-content: center; width: 0; height: 14px; padding: 0; margin: 0;
  border: 0; border-radius: 50%; background: transparent; color: var(--muted); font-size: 13px; line-height: 1;
  opacity: 0; overflow: hidden; cursor: pointer;
  transition: width .16s ease, opacity .16s ease, background .16s ease, color .16s ease;
}
.tag-chip:hover .tag-del { width: 14px; opacity: 1; color: #ef4444; background: rgba(239,68,68,.12); }
.toolbar-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.col-check { width: 32px; }
.log-toolbar { display: flex; align-items: center; justify-content: space-between; }
.log-table td { vertical-align: top; }
.log-table .col-time { width: 160px; }
.log-type {
  font-size: 12px; padding: 2px 8px; border-radius: 6px;
  background: rgba(59,130,246,.12); color: #7db0ff; border: 1px solid rgba(59,130,246,.25);
  white-space: nowrap;
}
.log-type.log-error { background: rgba(239,68,68,.12); color: #fca5a5; border-color: rgba(239,68,68,.3); }
.log-type.log-warn { background: rgba(245,158,11,.12); color: #fcd34d; border-color: rgba(245,158,11,.3); }

/* ---------- Toast ---------- */
.toast-wrap { position: fixed; top: 18px; right: 18px; z-index: 400; display: flex; flex-direction: column; gap: 10px; }
.toast {
  background: var(--surface2); border: 1px solid var(--border2); border-left: 3px solid var(--primary);
  color: var(--text); padding: 12px 16px; border-radius: 10px; box-shadow: var(--shadow);
  font-size: 13px; max-width: 360px; animation: slideIn .25s ease;
}
.toast.error { border-left-color: var(--red); }
.toast.success { border-left-color: var(--green); }
@keyframes slideIn { from { transform: translateX(30px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- 浅色主题 ---------- */
body.light {
  --bg: #eef2f7;
  --bg2: #ffffff;
  --surface: #ffffff;
  --surface2: #edf1f7;
  --border: #d8e0ea;
  --border2: #c2cfde;
  --text: #141c28;
  --muted: #47566b;
  --muted2: #68788f;
  --shadow: 0 10px 30px rgba(30,50,80,.10);
}
body.light .login-bg {
  background:
    radial-gradient(1000px 500px at 15% -10%, rgba(59,130,246,.18), transparent 60%),
    radial-gradient(900px 500px at 100% 110%, rgba(124,58,237,.16), transparent 60%),
    linear-gradient(160deg, #e8eef7, #eef2f7 55%, #e4ebf5);
}
body.light .login-card { background: rgba(255,255,255,.82); border-color: var(--border); }
body.light .conn-icon { background: linear-gradient(135deg, rgba(59,130,246,.15), rgba(124,58,237,.12)); color: #2563eb; }
body.light .rdp-overlay { background: #e9eef5; }
body.light .rdp-toolbar { background: #ffffff; border-bottom-color: var(--border); }
body.light .rdp-statusbar { background: #ffffff; border-top-color: var(--border); }
body.light .rdp-stage { background: radial-gradient(circle at 50% 40%, #e8edf4, #dfe6ef 75%); }
body.light #rdp-canvas { box-shadow: 0 0 0 1px rgba(20,40,70,.08), 0 16px 60px rgba(30,50,80,.18); }
body.light .rdp-placeholder { background: rgba(233,238,245,.65); color: var(--muted); }
body.light .rdp-cursor { border-color: #111827; box-shadow: 0 0 0 1px rgba(255,255,255,.85), 0 2px 8px rgba(0,0,0,.3); }
body.light .spinner { border-color: rgba(20,40,70,.15); border-top-color: var(--primary); }
body.light .empty-state svg { opacity: .45; }
body.light .conn-badge { background: var(--surface2); border-color: var(--border); color: var(--muted); }
body.light .side-item.active { color: #1d4ed8; border-color: #93c5fd; }
body.light .conn-meta .host { color: #1d4ed8; }
body.light .file-row.dir { color: #1d4ed8; }
body.light .pane-title { color: #1d4ed8; }
body.light .group-badge { color: #1d4ed8; }
body.light .log-type { color: #1d4ed8; }
body.light .form-tip code { color: #1e40af; }
body.light .btn-danger { color: #b91c1c; border-color: rgba(185,28,28,.35); }
body.light .dropdown button.danger { color: #b91c1c; }
body.light .log-type.log-error { color: #b91c1c; border-color: rgba(185,28,28,.3); }
body.light .log-type.log-warn { color: #92400e; border-color: rgba(146,64,14,.3); }

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
  .sidebar { width: 64px; }
  .side-brand span, .side-item span { display: none; }
  .side-item { justify-content: center; }
  .file-panes { grid-template-columns: 1fr; }
  .form-row { flex-direction: column; gap: 0; }
  .search-box { width: 180px; }
}

body.light .btn-ghost:hover { background: #dce4ef; color: #111827; border-color: #b8c6d8; }
body.light .btn-danger { color: #b91c1c; }
body.light .side-item.active { color: #1d4ed8; }
.side-item, .btn, .icon-btn, .file-row, .file-item, .pager button, .tag-chip { cursor: pointer; }

.log-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.log-toolbar .pager { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.input-sm {
  background: var(--bg2); border: 1px solid var(--border); border-radius: 8px;
  padding: 7px 10px; color: var(--text); outline: none; font-size: 13px;
}
.input-sm:focus { border-color: var(--primary); }
body.light .input-sm { background: #ffffff; color: var(--text); }
body.light .btn-ghost:hover { background: #dce4ef; color: #111827; border-color: #b8c6d8; }

textarea {
  background: var(--bg2); border: 1px solid var(--border); border-radius: 10px;
  padding: 10px 12px; color: var(--text); width: 100%; resize: vertical;
  font-family: inherit; font-size: 14px; outline: none; line-height: 1.5;
}
textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
body.light textarea { background: #ffffff; color: var(--text); }

.btn-grid > .btn:last-child:nth-child(odd) { grid-column: 1 / -1; }

.group-manage-list { display: flex; flex-direction: column; gap: 8px; }
.group-manage-row { display: flex; align-items: center; gap: 8px; padding: 8px 10px; background: var(--surface2); border: 1px solid var(--border); border-radius: 8px; }
.group-manage-row .gname { flex: 1; font-size: 14px; }
.group-manage-row input { flex: 1; }
.tag-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; min-height: 28px; }
.tag-pick { cursor: pointer; user-select: none; border: 1px solid var(--border); background: var(--surface2); color: var(--muted); border-radius: 20px; padding: 3px 10px; font-size: 12px; }
.tag-pick.on { border-color: var(--primary); color: var(--primary); background: rgba(59,130,246,.12); }
.tag-pick:hover { border-color: var(--border2); }

#files-local-view .panel-toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
#files-local-view .path-bar { flex: 1 1 480px; }
#files-local-view .toolbar-actions { flex: 0 0 auto; }
.log-table th:nth-child(3), .log-table td:nth-child(3) { width: 260px; }

/* ---------- 批量传文件 ---------- */
.batch-toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.batch-select-all { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); cursor: pointer; }
.batch-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.batch-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.batch-card .batch-top { display: flex; align-items: center; gap: 8px; }
.batch-card .batch-name { font-size: 14px; font-weight: 600; color: var(--text); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.batch-card .batch-host { font-size: 12px; color: var(--muted); font-family: Consolas, "Microsoft YaHei", monospace; }
.batch-card .batch-status { font-size: 12px; color: var(--muted); min-height: 18px; }
.batch-card.ok .batch-status { color: #22c55e; }
.batch-card.err .batch-status { color: #ef4444; }
.batch-progress { height: 6px; background: var(--surface2); border-radius: 3px; overflow: hidden; }
.batch-progress > div { height: 100%; width: 0; background: linear-gradient(90deg, var(--primary), var(--primary2)); transition: width .3s; }

.batch-card .tag-row { display: flex; flex-wrap: wrap; gap: 4px; }
.batch-card .batch-last { font-size: 11px; color: var(--muted2); }
.batch-card .batch-actions { display: flex; gap: 8px; margin-top: 2px; }
.batch-card .batch-actions .btn { flex: 1; justify-content: center; }
.batch-confirm-list { max-height: 180px; overflow: auto; background: var(--surface2); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; font-size: 12px; color: var(--muted); line-height: 1.7; }

.batch-card .batch-meta { font-size: 12px; color: var(--muted); }

.batch-summary { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px 16px; margin-bottom: 14px; }
.batch-summary-text { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.batch-summary-text b { color: var(--text); }
.batch-progress.big { height: 10px; }

#rdp-clipboard { position: relative; }
#rdp-clipboard.has-clip::after {
  content: ''; position: absolute; top: 4px; right: 4px; width: 8px; height: 8px;
  border-radius: 50%; background: #ef4444; box-shadow: 0 0 0 2px var(--surface);
}

/* ---------- 连接卡片拖动排序 ---------- */
.card-menu { z-index: 5; }
.drag-zone {
  position: absolute; left: 0; right: 0; top: 0; height: 33.333%;
  z-index: 2; cursor: grab; border-radius: var(--radius) var(--radius) 0 0;
  background: transparent; transition: background .16s ease;
}
.drag-zone:hover {
  background: linear-gradient(180deg, rgba(59,130,246,.12) 0%, rgba(59,130,246,.04) 70%, rgba(59,130,246,0) 100%);
}
.drag-grip {
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%) scale(.96);
  display: inline-flex; align-items: center; justify-content: center;
  padding: 5px 8px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border);
  box-shadow: 0 3px 10px rgba(0, 0, 0, .10);
  opacity: 0; transition: opacity .16s ease, transform .16s ease;
}
.drag-zone:hover .drag-grip,
.conn-card.dragging .drag-grip {
  opacity: 1; transform: translate(-50%, -50%) scale(1);
}
.drag-dots { display: grid; grid-template-columns: repeat(2, 3px); gap: 2px; }
.drag-dots i { display: block; width: 3px; height: 3px; border-radius: 50%; background: var(--primary); opacity: .9; }
.conn-card.dragging {
  opacity: .55; transform: scale(.97); cursor: grabbing;
  border-color: var(--primary); box-shadow: 0 18px 42px rgba(0, 0, 0, .24);
}
.conn-card.dragging .drag-zone {
  background: linear-gradient(180deg, rgba(59,130,246,.12) 0%, rgba(59,130,246,.04) 70%, rgba(59,130,246,0) 100%);
}
body.light .drag-zone:hover,
body.light .conn-card.dragging .drag-zone {
  background: linear-gradient(180deg, rgba(37,99,235,.09) 0%, rgba(37,99,235,.03) 70%, rgba(37,99,235,0) 100%);
}
body.light .drag-grip { box-shadow: 0 3px 10px rgba(30, 50, 80, .12); }


/* ---------- 拖动插入指示线 ---------- */
.conn-grid { position: relative; }
#drag-insert-line {
  position: absolute; width: 3px; z-index: 6; pointer-events: none;
  border-radius: 4px;
  background: linear-gradient(180deg, var(--primary), var(--primary2));
  box-shadow: 0 0 12px rgba(59, 130, 246, .55);
  transition: left .08s ease, top .08s ease, height .08s ease;
}
#drag-insert-line.hidden { display: none; }
#drag-insert-line::before,
#drag-insert-line::after {
  content: ""; position: absolute; left: 50%; transform: translateX(-50%);
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--primary); box-shadow: 0 0 8px rgba(59, 130, 246, .6);
}
#drag-insert-line::before { top: -3px; }
#drag-insert-line::after { bottom: -3px; }

#rdp-overlay.batch-hidden { opacity: 0 !important; pointer-events: none !important; transition: none !important; }

#upload-progress {
  position: fixed; right: 24px; bottom: 24px; z-index: 9999; width: 320px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 12px 14px; box-shadow: var(--shadow);
}
#upload-progress .up-name {
  font-size: 12px; color: var(--text); margin-bottom: 8px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
#upload-progress .up-bar { height: 8px; background: var(--surface2); border-radius: 5px; overflow: hidden; }
#upload-progress .up-bar i {
  display: block; height: 100%; width: 0;
  background: linear-gradient(90deg, var(--primary), var(--primary2));
  transition: width .2s ease;
}
#upload-progress .up-pct { margin-top: 6px; font-size: 11px; color: var(--muted); }
