/* ========== BSS 邦润易连 EasyConnect 智能终端服务 - 深色/白色双主题 ========== */
:root {
    --sidebar-w: 280px;
    --sidebar-rail-w: 46px;
    --banner-h: 40px;
    --radius: 6px;
    --radius-sm: 4px;

    --bg-body: #040507;
    --bg-sidebar: #050608;
    --bg-card: #1c1f26;
    --bg-input: #1e2129;
    --bg-hover: #252830;
    --border: #2a2d35;
    --border-light: #33363e;
    --bg-rail: #030405;
    --bg-panel: #040506;
    --bg-tab-bar: #15171d;
    --bg-display: #0d1117;
    --bg-modal: #1a1d24;
    --rail-icon-color: #c8ccd4;

    --text: #f5f6f8;
    --text-secondary: #d0d3da;
    --text-muted: #9a9eaa;

    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --green: #22c55e;
    --green-bg: rgba(34,197,94,.12);
    --orange: #f59e0b;
    --orange-bg: rgba(245,158,11,.12);
    --red: #ef4444;
    --red-bg: rgba(239,68,68,.12);
    --blue-bg: rgba(59,130,246,.12);

    --banner-from: #161b2e;
    --banner-to: #1a2240;
    --modal-mask-bg: rgba(0,0,0,.6);
    --placeholder-color: rgba(255,255,255,.4);
    --placeholder-icon: rgba(255,255,255,.15);
    --shadow-modal: 0 16px 48px rgba(0,0,0,.4);
}

/* ========== 白色主题 ========== */
[data-theme="light"] {
    --bg-body: #f0f2f5;
    --bg-sidebar: #ffffff;
    --bg-card: #ffffff;
    --bg-input: #f5f6f8;
    --bg-hover: #e8eaed;
    --border: #d0d3da;
    --border-light: #e0e3e8;
    --bg-rail: #f7f8fa;
    --bg-panel: #ffffff;
    --bg-tab-bar: #ebedf0;
    --bg-display: #e4e6ea;
    --bg-modal: #ffffff;
    --rail-icon-color: #5a5e68;

    --text: #1a1d24;
    --text-secondary: #4a4e58;
    --text-muted: #8a8e98;

    --green-bg: rgba(34,197,94,.1);
    --orange-bg: rgba(245,158,11,.1);
    --red-bg: rgba(239,68,68,.08);
    --blue-bg: rgba(59,130,246,.08);

    --banner-from: #ffffff;
    --banner-to: #ffffff;
    --modal-mask-bg: rgba(0,0,0,.35);
    --placeholder-color: rgba(0,0,0,.4);
    --placeholder-icon: rgba(0,0,0,.12);
    --shadow-modal: 0 16px 48px rgba(0,0,0,.12);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    font-size: 13px; color: var(--text); background: var(--bg-body);
    height: 100vh; overflow: hidden;
}

/* ========== Banner ========== */
.banner {
    position: fixed; top: 0; left: 0; right: 0; z-index: 200;
    height: var(--banner-h);
    background: linear-gradient(180deg, var(--banner-from) 0%, var(--banner-to) 100%);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 16px; color: #fff; user-select: none;
    border-bottom: 1px solid rgba(255,255,255,.08);
}
.banner-left { display: flex; align-items: center; gap: 10px; }
.banner-title { font-size: 13px; font-weight: 600; letter-spacing: 1px; color: rgba(255,255,255,.92); }
.banner-ver { font-size: 10px; color: rgba(255,255,255,.4); padding: 0; background: none; }
.banner-right { display: flex; align-items: center; gap: 14px; font-size: 12px; color: rgba(255,255,255,.6); flex-shrink: 0; }
.banner-time { font-variant-numeric: tabular-nums; font-size: 12px; }
.banner-status { display: flex; align-items: center; gap: 6px; }
.status-dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; }
.status-dot.online { background: var(--green); animation: pulse 2s infinite; }
.status-dot.offline { background: #555; }
.status-dot.connecting { background: var(--orange); animation: pulse 1s infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.5} }

/* Banner 按钮 */
.banner-btn {
    display: inline-flex; align-items: center; gap: 4px; color: rgba(255,255,255,.6);
    font-size: 12px; padding: 4px 10px; border: none;
    border-radius: 4px; background: transparent;
    cursor: pointer; transition: all .15s;
}
.banner-btn:hover { color: rgba(255,255,255,.95); background: rgba(255,255,255,.08); }

/* 导航菜单触发项 */
.nav-mega-trigger {
    position: relative; display: flex; align-items: center;
    padding: 4px 10px; cursor: pointer; transition: color .15s;
    border-radius: 4px; gap: 4px;
    border: none; background: transparent;
    color: rgba(255,255,255,.6);
}
.nav-mega-trigger:hover,
.nav-mega-trigger.active { color: rgba(255,255,255,.95); background: rgba(255,255,255,.06); }
.nav-mega-trigger-text { font-size: 12px; color: inherit; font-weight: 500; }
.mega-arrow { opacity: .5; transition: transform .2s, opacity .2s; flex-shrink: 0; color: inherit; }
.mega-arrow-up { display: none; flex-shrink: 0; color: inherit; }
.nav-mega-trigger:hover .mega-arrow { opacity: .9; transform: rotate(180deg); }
.nav-mega-trigger.active .mega-arrow { display: none; }
.nav-mega-trigger.active .mega-arrow-up { display: block; }

/* 用户下拉面板 */
.banner-user {
    display: none; align-items: center; height: 100%;
    position: relative; cursor: pointer; gap: 6px;
    padding: 0 8px; transition: background .15s;
    border-radius: 4px;
}
.banner-user:hover { background: rgba(255,255,255,.06); }
.banner-user-name {
    font-size: 12px; color: rgba(255,255,255,.7);
    max-width: 80px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.user-dropdown-arrow {
    opacity: .4; transition: transform .2s; flex-shrink: 0;
    color: rgba(255,255,255,.5);
}
.banner-user:hover .user-dropdown-arrow { opacity: .8; transform: rotate(180deg); }

.user-dropdown-panel {
    display: none; position: absolute; top: 100%; right: 0;
    min-width: 220px; background: var(--bg-modal);
    border: 1px solid var(--border);
    border-radius: 6px;
    box-shadow: 0 8px 24px rgba(0,0,0,.2);
    padding: 6px; z-index: 210;
    animation: userDropIn .12s ease;
}
.banner-user:hover > .user-dropdown-panel { display: block; }
@keyframes userDropIn { from { opacity:0; transform: translateY(-4px); } to { opacity:1; transform: translateY(0); } }

.dropdown-item {
    display: flex; align-items: center; gap: 8px; padding: 7px 10px;
    border-radius: 4px; font-size: 13px; color: var(--text-secondary);
    text-decoration: none; transition: background .12s; cursor: pointer;
}
.dropdown-item:hover { background: var(--bg-hover); color: var(--text); }
.dropdown-item svg { flex-shrink: 0; opacity: .5; }
.dropdown-item:hover svg { opacity: .8; }
.dropdown-item-danger { color: var(--red); }
.dropdown-item-danger:hover { background: var(--red-bg); color: var(--red); }
.dropdown-divider { height: 1px; background: var(--border); margin: 4px 0; }

.dropdown-user-info { display: flex; align-items: center; gap: 10px; padding: 6px 10px; }
.dropdown-user-avatar {
    width: 32px; height: 32px; border-radius: 50%;
    background: var(--accent);
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 600; color: #fff; flex-shrink: 0;
}
.dropdown-user-detail { min-width: 0; }
.dropdown-user-name { font-size: 13px; font-weight: 600; color: var(--text); }
.dropdown-user-id { font-size: 11px; color: var(--text-muted); font-family: 'SFMono-Regular', Consolas, monospace; margin-top: 1px; }

.user-avatar-sm {
    width: 20px; height: 20px; border-radius: 50%;
    background: var(--accent);
    display: flex; align-items: center; justify-content: center;
    font-size: 10px; font-weight: 600; color: #fff; flex-shrink: 0;
}

/* 深色模式显示太阳，浅色模式显示月亮 */
[data-theme="light"] .icon-moon { display: none; }
[data-theme="light"] .icon-sun { display: none; }
[data-theme="light"] .banner-btn svg.icon-sun { display: inline; }
[data-theme="light"] .banner-btn svg.icon-moon { display: inline; }
[data-theme="dark"] .icon-moon { display: none; }
[data-theme="dark"] .icon-sun { display: block; }

/* ========== Mega Menu 全宽面板 ========== */
.mega-menu {
    position: fixed;
    top: var(--banner-h);
    left: 0; right: 0;
    display: none;
    background: var(--bg-modal);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 8px 24px rgba(0,0,0,.25);
    z-index: 199;
}
.mega-menu.active { display: block; animation: megaIn .15s ease; }
@keyframes megaIn { from { opacity:0; transform: translateY(-4px); } to { opacity:1; transform: translateY(0); } }

.mega-menu-inner {
    max-width: 1360px;
    margin: 0 auto;
    display: flex;
    min-height: 320px;
}

.mega-sidebar {
    width: 200px;
    flex-shrink: 0;
    border-right: 1px solid var(--border);
    background: var(--bg-body);
    padding: 8px 0;
}

.mega-cat-item {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 18px; font-size: 13px; color: var(--text-secondary);
    cursor: pointer; transition: all .15s;
    border-left: 3px solid transparent;
}
.mega-cat-item:hover { background: var(--bg-hover); color: var(--text); }
.mega-cat-item.active {
    color: var(--accent);
    background: var(--bg-card);
    border-left-color: var(--accent);
    font-weight: 600;
}
.mega-cat-count {
    font-size: 11px; color: var(--text-muted); font-variant-numeric: tabular-nums;
}
.mega-cat-item.active .mega-cat-count { color: var(--accent); opacity: .7; }

.mega-content {
    flex: 1; min-width: 0; padding: 16px 24px; overflow-y: auto;
    max-height: calc(100vh - var(--banner-h) - 40px);
}

.mega-empty-hint {
    text-align: center; color: var(--text-muted); font-size: 14px;
    padding: 80px 0;
}

.mega-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px;
}
.mega-grid-title {
    font-size: 14px; font-weight: 700; color: var(--text);
    margin-bottom: 12px; padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.mega-sys-card {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 12px;
    border-radius: 4px;
    text-decoration: none; color: var(--text);
    transition: background .12s; cursor: pointer;
    border: none;
}
.mega-sys-card:hover {
    background: var(--bg-hover);
}
.mega-sys-icon {
    width: 30px; height: 30px; border-radius: 6px; display: flex;
    align-items: center; justify-content: center; flex-shrink: 0;
}
.mega-sys-icon svg { width: 15px; height: 15px; }
.mega-sys-info { min-width: 0; }
.mega-sys-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mega-sys-desc { font-size: 11px; color: var(--text-muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Mega Menu 子分类标签 */
.mega-subcat-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.mega-subcat-tab {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    font-size: 12px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all .15s;
    white-space: nowrap;
}
.mega-subcat-tab:hover {
    background: var(--bg-hover);
    border-color: var(--border-light);
    color: var(--text);
}
.mega-subcat-tab.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}
.mega-subcat-count {
    font-size: 10px;
    opacity: .7;
    font-variant-numeric: tabular-nums;
}

/* ========== 登录/个人中心弹窗表单 ========== */
.form-group { margin-bottom: 14px; }
.form-label {
    display: block; font-size: 12px; font-weight: 600; color: var(--text-secondary);
    margin-bottom: 6px;
}
.form-hint {
    font-size: 12px; min-height: 18px; margin-top: 4px;
    transition: color .2s;
}
.form-hint.error { color: var(--red); }
.form-hint.success { color: var(--green); }
.form-divider {
    height: 1px; background: var(--border); margin: 18px 0;
}

/* 头像 */
.profile-avatar { text-align: center; margin-bottom: 16px; }
.profile-avatar-circle {
    width: 56px; height: 56px; border-radius: 50%;
    background: var(--accent);
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 24px; color: #fff;
}

/* 浅色 Banner 覆盖 */
[data-theme="light"] .banner {
    color: var(--text);
    border-bottom: 1px solid var(--border);
}
[data-theme="light"] .banner-title { color: var(--text); }
[data-theme="light"] .banner-ver { color: var(--text-muted); }
[data-theme="light"] .banner-right { color: var(--text-muted); }
[data-theme="light"] .nav-mega-trigger { color: var(--text-muted); }
[data-theme="light"] .nav-mega-trigger:hover,
[data-theme="light"] .nav-mega-trigger.active { color: var(--text); background: rgba(0,0,0,.04); }
[data-theme="light"] .banner-btn { color: var(--text-muted); }
[data-theme="light"] .banner-btn:hover { color: var(--text); background: rgba(0,0,0,.04); }
[data-theme="light"] .banner-btn#loginBtn { color: var(--accent); }
[data-theme="light"] .banner-btn#loginBtn:hover { background: rgba(59,130,246,.06); }
[data-theme="light"] .banner-user:hover { background: rgba(0,0,0,.03); }
[data-theme="light"] .banner-user-name { color: var(--text-secondary); }
[data-theme="light"] .user-dropdown-arrow { color: var(--text-muted); }
[data-theme="light"] .mega-menu { box-shadow: 0 8px 24px rgba(0,0,0,.08); }
[data-theme="light"] .user-dropdown-panel { box-shadow: 0 8px 24px rgba(0,0,0,.08); }
[data-theme="light"] .icon-sun { display: none; }
[data-theme="light"] .icon-moon { display: inline; }
[data-theme="light"] .banner-btn svg.icon-sun { display: none; }
[data-theme="light"] .banner-btn svg.icon-moon { display: inline; }

/* ========== 浮动侧栏 ========== */
.sidebar {
    position: fixed; top: var(--banner-h); left: 0; bottom: 0; z-index: 150;
    display: flex; overflow: hidden;
    transition: none;
}
/* 窄轨道（始终可见） */
.sidebar-rail {
    width: var(--sidebar-rail-w); flex-shrink: 0;
    background: var(--bg-rail); border-right: 1px solid var(--border);
    display: flex; flex-direction: column; align-items: center;
    padding: 10px 0; gap: 4px;
}
.rail-icon {
    width: 34px; height: 34px; display: flex; align-items: center; justify-content: center;
    border-radius: var(--radius-sm); background: transparent; border: none;
    color: var(--rail-icon-color); cursor: pointer; transition: all .15s;
}
.rail-icon:hover { background: var(--bg-hover); color: var(--text); }
.rail-icon.active { color: var(--accent); background: var(--blue-bg); }
.rail-divider { width: 24px; height: 1px; background: var(--border); margin: 4px 0; }

/* 展开面板 */
.sidebar-panel {
    width: 0; overflow: hidden; background: var(--bg-panel);
    transition: width .2s ease; display: flex; flex-direction: column;
}
.sidebar.expanded .sidebar-panel { width: 274px; }

.sidebar-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 14px; border-bottom: 1px solid var(--border);
    flex-shrink: 0; white-space: nowrap;
}
.sidebar-title { font-size: 13px; font-weight: 600; color: var(--text); }
.sidebar-close {
    background: none; border: none; color: var(--text-muted); cursor: pointer;
    display: flex; align-items: center; padding: 4px; border-radius: var(--radius-sm);
    transition: all .15s;
}
.sidebar-close:hover { color: var(--text); background: var(--bg-hover); }

.sidebar-scroll {
    flex: 1; overflow-y: auto; overflow-x: hidden;
    padding: 12px; display: flex; flex-direction: column; gap: 14px;
}
.sidebar-scroll::-webkit-scrollbar { width: 4px; }
.sidebar-scroll::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* ========== 新建连接按钮 ========== */
.btn-new-conn {
    display: flex; align-items: center; justify-content: center; gap: 6px;
    width: 100%; padding: 8px 0; border-radius: var(--radius);
    background: var(--accent); color: #fff; border: none;
    font-size: 13px; font-weight: 500; cursor: pointer;
    transition: all .15s;
}
.btn-new-conn:hover { background: var(--accent-hover); }

/* ========== 跳板机列表 ========== */
.server-list { display: flex; flex-direction: column; gap: 2px; }
.server-item {
    display: flex; align-items: center; gap: 8px;
    padding: 7px 10px; border-radius: var(--radius-sm);
    cursor: pointer; transition: all .15s; border: 1px solid transparent;
}
.server-item:hover { background: var(--bg-hover); border-color: var(--border); }
.server-item-icon {
    width: 28px; height: 28px; border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 700; flex-shrink: 0;
}
.server-item-icon.rdp { background: var(--blue-bg); color: var(--accent); }
.server-item-icon.ssh { background: var(--green-bg); color: var(--green); }
.server-item-info { flex: 1; min-width: 0; }
.server-item-name { font-size: 12px; font-weight: 500; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.server-item-meta { font-size: 11px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.server-item-action {
    width: 24px; height: 24px; display: flex; align-items: center; justify-content: center;
    background: none; border: none; color: var(--text-muted); cursor: pointer;
    border-radius: var(--radius-sm); opacity: 0; transition: all .15s; font-size: 13px;
}
.server-item:hover .server-item-action { opacity: 1; }
.server-item-action:hover { color: var(--green); background: var(--green-bg); }

/* ========== 面板区块标题 ========== */
.section-title {
    font-size: 11px; font-weight: 600; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 1px;
    margin-bottom: 2px; display: flex; align-items: center; justify-content: space-between;
}
.section-title .title-action {
    font-size: 11px; color: var(--text-muted); background: none; border: none;
    cursor: pointer; padding: 2px 6px; border-radius: var(--radius-sm);
    transition: all .15s;
}
.section-title .title-action:hover { color: var(--red); background: var(--red-bg); }

/* ========== 粘贴输入区 ========== */
.paste-box {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 10px;
}
.paste-box textarea {
    width: 100%; background: var(--bg-input); color: var(--text);
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    padding: 8px 10px; font-size: 12px; font-family: 'SFMono-Regular', Consolas, monospace;
    resize: none; outline: none; line-height: 1.5;
}
.paste-box textarea:focus { border-color: var(--accent); }
.paste-box textarea::placeholder { color: var(--text-muted); }
.paste-box .paste-actions { display: flex; gap: 6px; margin-top: 8px; }

/* ========== 弹窗内智能识别区域 ========== */
.smart-parse-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 16px; overflow: hidden;
    transition: border-color .2s;
}
.smart-parse-box:focus-within { border-color: var(--accent); }
.smart-parse-input-wrap {
    display: flex; align-items: stretch;
    background: var(--bg-input); border-bottom: 1px solid var(--border);
}
.smart-parse-icon {
    display: flex; align-items: center; justify-content: center;
    width: 36px; min-height: 110px; flex-shrink: 0;
    color: var(--text-muted); transition: color .2s;
    border-right: 1px solid transparent;
}
.smart-parse-box:focus-within .smart-parse-icon { color: var(--accent); }
.smart-parse-input-wrap textarea {
    flex: 1; width: 100%; min-height: 110px; max-height: 200px;
    background: transparent; color: var(--text);
    border: none; padding: 12px 14px; font-size: 13px; line-height: 1.65;
    font-family: 'SFMono-Regular', Consolas, 'Courier New', monospace;
    resize: vertical; outline: none;
}
.smart-parse-input-wrap textarea::placeholder { color: var(--text-muted); opacity: .55; }

/* 底部操作栏 */
.smart-parse-bar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 8px 12px; gap: 8px;
}
.smart-parse-formats {
    display: flex; align-items: center; gap: 5px;
    flex-wrap: wrap;
    font-size: 11px; color: var(--text-muted);
}
.smart-parse-formats span { opacity: .7; }
.smart-parse-formats code {
    font-size: 10px; padding: 1px 6px; border-radius: 3px;
    background: rgba(59,130,246,.08); color: var(--accent);
    font-family: inherit; white-space: nowrap;
}
.smart-parse-actions-right { display: flex; gap: 6px; align-items: center; }

/* 识别结果预览 */
.smart-parse-preview {
    margin: 0 12px 10px; padding: 10px 12px;
    background: linear-gradient(135deg, rgba(34,197,94,.06) 0%, rgba(59,130,246,.04) 100%);
    border: 1px solid rgba(34,197,94,.2); border-radius: var(--radius-sm);
    animation: previewIn .25s ease;
}
@keyframes previewIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@keyframes spin { to { transform: rotate(360deg); } }
.preview-label {
    font-size: 10px; font-weight: 600; text-transform: uppercase;
    letter-spacing: .5px; color: #22c55e; margin-bottom: 6px;
}
.preview-fields {
    display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px 16px;
    font-size: 12px;
}
.preview-field { display: flex; align-items: baseline; gap: 6px; }
.preview-field-label {
    font-size: 10px; color: var(--text-muted); white-space: nowrap;
    min-width: 40px;
}
.preview-field-value {
    font-family: 'SFMono-Regular', Consolas, monospace;
    color: var(--text); word-break: break-all;
}
.preview-field-value.protocol-ssh { color: #22c55e; }
.preview-field-value.protocol-rdp { color: #3b82f6; }

/* ========== 表单 ========== */
.form-row { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }
.form-row:last-child { margin-bottom: 0; }
.form-row label { font-size: 11px; font-weight: 500; color: var(--text-secondary); }
.form-row-inline { display: flex; gap: 8px; }
.form-row-inline .form-row { flex: 1; margin-bottom: 0; }
.form-input {
    width: 100%; background: var(--bg-input); color: var(--text);
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    padding: 7px 10px; font-size: 13px; outline: none; transition: border-color .15s;
}
.form-input:focus { border-color: var(--accent); }
.form-input::placeholder { color: var(--text-muted); }

.tab-bar {
    display: inline-flex; background: var(--bg-input);
    border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden;
}
.tab-bar .tab-item {
    padding: 5px 14px; font-size: 12px; font-weight: 500;
    color: var(--text-secondary); background: transparent;
    border: none; cursor: pointer; transition: all .15s;
}
.tab-bar .tab-item:not(:last-child) { border-right: 1px solid var(--border); }
.tab-bar .tab-item:hover { color: var(--text); background: var(--bg-hover); }
.tab-bar .tab-item.active { color: #fff; background: var(--accent); }

.pwd-wrap { position: relative; }
.pwd-wrap .pwd-toggle {
    position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
    background: none; border: none; color: var(--text-muted);
    cursor: pointer; padding: 4px; display: flex; align-items: center;
}
.pwd-wrap .pwd-toggle:hover { color: var(--text); }

/* ========== 可达性检测按钮 ========== */
.reach-check-btn {
    display: flex; align-items: center; gap: 6px;
    width: 100%; padding: 7px 10px;
    background: var(--bg-input); border: 1px solid var(--border);
    border-radius: var(--radius-sm); cursor: pointer;
    color: var(--text-secondary); font-size: 11.5px;
    transition: all .2s; user-select: none;
}
.reach-check-btn:hover { border-color: rgba(255,255,255,.12); background: var(--bg-hover); }
.reach-check-btn.checking { border-color: var(--accent); cursor: wait; opacity: .8; }

.reach-check-btn .reach-dot {
    width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0;
    transition: all .3s ease;
}
.reach-check-btn .reach-dot.off   { background: #4a4a52; box-shadow: none; }
.reach-check-btn .reach-dot.ok    { background: var(--green); box-shadow: 0 0 5px rgba(34,197,94,.4); }
.reach-check-btn .reach-dot.fail  { background: var(--danger); box-shadow: 0 0 5px rgba(248,81,73,.4); }
.reach-check-btn .reach-dot.spin  { background: transparent; border: 2px solid var(--accent); border-top-color: transparent; animation: dotSpin .6s linear infinite; width: 6px; height: 6px; border-radius: 50%; }

.reach-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 32px; transition: color .2s; }
.reach-check-btn.ok .reach-text { color: var(--green); }
.reach-check-btn.fail .reach-text { color: var(--danger); }

@keyframes dotSpin { to { transform: rotate(360deg); } }

.reach-spin { display: none; width: 13px; height: 13px; animation: spin .8s linear infinite; color: var(--accent); }
.reach-check-btn.checking .reach-spin { display: block; }

/* ========== 按钮 ========== */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    gap: 5px; padding: 6px 14px; font-size: 12px; font-weight: 500;
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    cursor: pointer; transition: all .15s; white-space: nowrap;
    background: var(--bg-input); color: var(--text);
}
.btn:hover { background: var(--bg-hover); border-color: var(--border-light); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-success { background: var(--green); border-color: var(--green); color: #fff; }
.btn-success:hover { opacity: .85; }
.btn-danger { background: transparent; border-color: var(--red); color: var(--red); }
.btn-danger:hover { background: var(--red); color: #fff; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-secondary); }
.btn-ghost:hover { background: var(--bg-hover); color: var(--text); }
.btn-xs { padding: 3px 8px; font-size: 11px; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }

/* ========== 连接历史 ========== */
.history-list { display: flex; flex-direction: column; gap: 2px; }
.history-item {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 10px; border-radius: var(--radius-sm);
    cursor: pointer; transition: all .15s; border: 1px solid transparent;
}
.history-item:hover { background: var(--bg-hover); border-color: var(--border); }
.history-item-icon {
    width: 30px; height: 30px; border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    font-size: 14px; font-weight: 700; flex-shrink: 0;
}
.history-item-icon.ssh { background: var(--green-bg); color: var(--green); }
.history-item-icon.rdp { background: var(--blue-bg); color: var(--accent); }
.history-item-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.history-item-name { font-size: 13px; font-weight: 500; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-item-meta { font-size: 11px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-item-del {
    width: 22px; height: 22px; border-radius: var(--radius-sm);
    background: none; border: none; color: var(--text-muted);
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    font-size: 14px; opacity: 0; transition: all .15s;
}
.history-item:hover .history-item-del { opacity: 1; }
.history-item-del:hover { color: var(--red); background: var(--red-bg); }
.history-empty { text-align: center; padding: 24px 10px; color: var(--text-muted); font-size: 12px; }

/* ========== 主内容区 ========== */
.main-area {
    margin-top: var(--banner-h);
    margin-left: var(--sidebar-rail-w);
    height: calc(100vh - var(--banner-h));
    display: flex; flex-direction: column; overflow: hidden;
    transition: margin-left .2s ease;
}
.main-area.sidebar-expanded { margin-left: calc(var(--sidebar-rail-w) + 274px); }

/* ========== 标签栏 ========== */
.tab-bar-wrap {
    flex-shrink: 0; background: var(--bg-tab-bar); border-bottom: 1px solid var(--border);
    display: flex; align-items: stretch; height: 36px; overflow: hidden;
}
.tab-bar { display: flex; align-items: stretch; overflow-x: auto; flex: 1; }
.tab-bar::-webkit-scrollbar { height: 0; }
.conn-close-all {
    flex-shrink: 0; display: flex; align-items: center; justify-content: center;
    width: 36px; border: none; border-left: 1px solid var(--border);
    background: transparent; color: var(--text-muted); cursor: pointer;
    transition: all .15s;
}
.conn-close-all:hover { color: var(--red); background: rgba(239,68,68,.08); }
.conn-tab {
    display: flex; align-items: center; gap: 6px;
    padding: 0 14px; font-size: 12px; color: var(--text-secondary);
    background: transparent; border: none; border-right: 1px solid var(--border);
    cursor: pointer; white-space: nowrap; position: relative;
    transition: all .15s; min-width: 0;
}
.conn-tab:hover { background: var(--bg-hover); color: var(--text); }
.conn-tab.active { background: var(--bg-body); color: var(--text); }
.conn-tab.active::after {
    content: ''; position: absolute; bottom: 0; left: 0; right: 0;
    height: 2px; background: var(--accent);
}
.conn-tab-dot {
    width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0;
}
.conn-tab-dot.ssh { background: var(--green); }
.conn-tab-dot.rdp { background: var(--accent); }
.conn-tab-dot.connecting { background: var(--orange); animation: pulse 1s infinite; }
.conn-tab-label { overflow: hidden; text-overflow: ellipsis; max-width: 160px; }
.conn-tab-close {
    width: 16px; height: 16px; display: flex; align-items: center; justify-content: center;
    border-radius: 50%; background: none; border: none;
    color: var(--text-muted); cursor: pointer;
    opacity: .6; transition: all .15s ease; flex-shrink: 0;
    margin-left: 2px;
}
.conn-tab-close:hover {
    opacity: 1 !important;
    color: #fff;
    background: var(--red);
}
.conn-tab-close:active { opacity: .8; }

/* ========== 显示区 ========== */
.display-area {
    flex: 1; position: relative; background: var(--bg-display); overflow: hidden;
}
.display-placeholder {
    position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
}
.display-placeholder svg { opacity: .3; }
.display-placeholder p { font-size: 14px; color: var(--placeholder-color); }
.display-placeholder .placeholder-sub { font-size: 12px; opacity: .7; }

.conn-container { width: 100%; height: 100%; position: relative; }
.conn-view {
    position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    display: none; background: #0d1117;
}
.conn-view.active { display: flex; }
.conn-view .xterm-wrap {
    position: absolute; top: 0; left: 0; right: 0; bottom: 0; padding: 4px;
}
/* SSH 容器 */
.conn-view .ssh-wrap {
    position: absolute; top: 0; left: 0; right: 0; bottom: 0;
}
.conn-view .ssh-term-wrap {
    position: absolute; top: 0; left: 0; right: 0; bottom: 0; padding: 4px;
}
/* SSH 浮动工具栏 */
.ssh-toolbar {
    position: absolute; top: 10px; right: 10px; z-index: 20;
    display: flex; gap: 6px;
    background: rgba(13, 17, 23, 0.82); backdrop-filter: blur(6px);
    border: 1px solid rgba(255,255,255,0.1); border-radius: 8px;
    padding: 5px;
}
/* SFTP 路径栏 */
.sftp-path-bar {
    display: flex; align-items: center; gap: 6px;
}
.sftp-up-btn {
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--bg-input); color: var(--text-secondary); border: 1px solid var(--border);
    border-radius: var(--radius-sm); padding: 5px 8px; cursor: pointer; flex-shrink: 0;
    transition: all .15s;
}
.sftp-up-btn:hover { background: var(--bg-hover); color: var(--text); }
.sftp-path {
    flex: 1; font-size: 12px; color: var(--text-muted); font-family: 'SFMono-Regular', Consolas, monospace;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 5px 8px;
}
.sftp-dir { cursor: pointer; }
.sftp-dir:hover { background: var(--bg-hover); }
.file-item-empty { width: 18px; flex-shrink: 0; }
.conn-view .rdp-wrap {
    position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    background: #000; overflow: hidden;
}
.conn-view .rdp-canvas-wrap {
    position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    display: flex; align-items: center; justify-content: center;
}
.conn-view .rdp-wrap canvas {
    display: block; image-rendering: auto;
    /* GPU 加速 - 防止拖动时图像残留 */
    will-change: transform;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}
/* RDP 浮动工具栏 */
.rdp-toolbar {
    position: absolute; top: 10px; right: 10px; z-index: 20;
    display: flex; gap: 6px;
    background: rgba(13, 17, 23, 0.82); backdrop-filter: blur(6px);
    border: 1px solid rgba(255,255,255,0.1); border-radius: 8px;
    padding: 5px;
}
.rdp-tool-btn {
    display: inline-flex; align-items: center; gap: 5px;
    background: transparent; color: #c9d1d9; border: none;
    padding: 5px 10px; border-radius: 6px; cursor: pointer;
    font-size: 12px; transition: background .15s, color .15s;
}
.rdp-tool-btn:hover { background: rgba(255,255,255,0.1); color: #fff; }
.rdp-tool-btn svg { flex-shrink: 0; }

/* 录制按钮 */
.rec-btn .rec-icon { color: #f85149; }
.rec-btn.rec-on .rec-icon { color: #f85149; animation: rec-blink 1s infinite; }
.rec-btn.rec-on { background: rgba(248,81,73,0.18); color: #ffa198; }
.rec-btn.rec-paused { background: rgba(227,179,65,0.18); color: #f0c674; }
.rec-btn.rec-paused .rec-icon { color: #e3b341; }
.rec-btn:disabled { cursor: not-allowed; opacity: .5; }
@keyframes rec-blink { 0%,49% { opacity: 1; } 50%,100% { opacity: .35; } }

/* 录制计时器 */
.rec-timer {
    display: inline-flex; align-items: center;
    font-size: 12px; font-family: Consolas, monospace;
    color: #f85149; padding: 0 6px;
    background: rgba(248,81,73,0.1); border-radius: 4px;
    height: 24px;
}

/* 录制保存对话框 */
.record-save-box { padding: 6px 2px; }
.record-save-tip { margin: 0 0 12px; color: var(--text); }
.record-save-info { font-size: 13px; color: var(--text-muted); margin-bottom: 16px; }
.record-save-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }

/* 录制列表 */
.records-list-body { max-height: 60vh; overflow-y: auto; min-width: 460px; }
.records-loading, .records-empty { padding: 30px; text-align: center; color: var(--text-muted, #8b949e); }
.records-filter { display: flex; gap: 6px; align-items: center; margin-bottom: 10px; padding-bottom: 10px; border-bottom: 1px solid rgba(255,255,255,0.08); }
.records-items { display: flex; flex-direction: column; gap: 6px; }
.record-item { display: flex; justify-content: space-between; align-items: center; padding: 10px; background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.06); border-radius: 6px; }
.record-item-info { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.record-item-name { font-size: 13px; color: var(--text-main, #c9d1d9); word-break: break-all; }
.record-item-meta { font-size: 11px; color: var(--text-muted, #8b949e); }
.record-item-actions { display: flex; gap: 6px; align-items: center; flex-shrink: 0; }
.rec-proto-tag { display: inline-block; font-size: 10px; font-weight: 600; padding: 1px 6px; border-radius: 3px; width: fit-content; }
.rec-proto-ssh { background: rgba(63,185,80,0.18); color: #3fb950; }
.rec-proto-rdp { background: rgba(88,166,255,0.18); color: #58a6ff; }

/* 回放 */
.modal.playback-modal { width: 880px; max-width: 94vw; max-height: 88vh; }
.modal.playback-modal .modal-body { padding: 16px 18px; }
.modal.playback-modal .modal-footer { justify-content: flex-end; align-items: center; }
.playback-footer-info { flex: 1; font-size: 12px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.playback-video-wrap { text-align: center; }
.playback-video-wrap video {
    width: 100%; max-height: 68vh; background: #000; border-radius: var(--radius-sm); display: block;
}

.playback-ssh-wrap { background: #0a0a0a; border-radius: var(--radius); padding: 6px; border: 1px solid var(--border); }
.playback-ssh-wrap #playbackTerm { height: 460px; min-height: 320px; }

.playback-controls {
    display: flex; align-items: center; justify-content: space-between;
    gap: 10px; margin-top: 8px; padding: 8px 10px;
    background: var(--bg-input); border-radius: var(--radius-sm); border: 1px solid var(--border);
}
.playback-controls-left { display: flex; align-items: center; gap: 8px; }
.playback-controls-right { display: flex; align-items: center; gap: 10px; }
.playback-controls .btn-sm { display: inline-flex; align-items: center; gap: 5px; }
.playback-controls .btn-sm svg { flex-shrink: 0; }

.playback-speed { display: inline-flex; align-items: center; gap: 5px; }
.playback-speed-label { font-size: 12px; color: var(--text-muted); }
.playback-speed select {
    background: var(--bg-body); color: var(--text); border: 1px solid var(--border);
    border-radius: var(--radius-sm); padding: 3px 7px; font-size: 12px; cursor: pointer;
}
.playback-speed select:focus { outline: none; border-color: var(--accent); }

.playback-progress {
    font-size: 12px; color: var(--text-secondary); font-family: 'SFMono-Regular', Consolas, monospace;
    min-width: 56px; text-align: right; font-variant-numeric: tabular-nums;
}

.playback-name {
    margin-top: 10px; font-size: 11px; color: var(--text-muted);
    font-family: 'SFMono-Regular', Consolas, monospace; word-break: break-all; line-height: 1.5;
    padding: 6px 9px; background: var(--bg-input); border-radius: var(--radius-sm); border: 1px solid var(--border);
}


/* RDP/SSH 侧边面板（剪贴板/文件传输/SFTP）- 扁平化 */
.rdp-panel {
    position: absolute; top: 10px; right: 10px; bottom: 10px; z-index: 21;
    width: 340px; max-width: calc(100% - 20px);
    display: flex; flex-direction: column;
    background: var(--bg-card); border: 1px solid var(--border); border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.18); overflow: hidden;
}
.rdp-panel-header {
    display: flex; align-items: center; gap: 8px;
    padding: 9px 12px; border-bottom: 1px solid var(--border);
    background: var(--bg-card); flex-shrink: 0;
}
.rdp-panel-header-icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 22px; height: 22px; border-radius: var(--radius-sm);
    background: var(--blue-bg); color: var(--accent);
    flex-shrink: 0;
}
.rdp-panel-title { font-size: 13px; font-weight: 600; color: var(--text); flex: 1; }
.rdp-panel-close {
    display: inline-flex; align-items: center; justify-content: center;
    background: transparent; border: none; color: var(--text-muted);
    width: 22px; height: 22px; border-radius: var(--radius-sm); cursor: pointer;
    transition: all .15s; padding: 0;
}
.rdp-panel-close:hover { color: var(--text); background: var(--bg-hover); }
.rdp-panel-body {
    flex: 1; overflow-y: auto; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px;
}

/* 剪贴板面板 */
.clip-hint {
    display: flex; align-items: flex-start; gap: 6px;
    font-size: 11px; color: var(--text-muted); line-height: 1.5;
    padding: 7px 9px; background: var(--bg-input); border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}
.clip-hint svg { flex-shrink: 0; margin-top: 1px; opacity: .7; }
.clip-textarea {
    width: 100%; flex: 1; min-height: 150px; resize: none;
    background: var(--bg-input); color: var(--text); border: 1px solid var(--border);
    border-radius: var(--radius-sm); padding: 9px; font-size: 13px; font-family: inherit;
    line-height: 1.5; box-sizing: border-box; transition: border-color .15s;
}
.clip-textarea:focus { outline: none; border-color: var(--accent); }
.clip-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* 文件传输面板 */
.file-hint {
    display: flex; align-items: flex-start; gap: 6px;
    font-size: 11px; color: var(--text-muted); line-height: 1.5;
    padding: 7px 9px; background: var(--bg-input); border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}
.file-hint svg { flex-shrink: 0; margin-top: 1px; opacity: .7; }
.file-upload { display: flex; gap: 6px; align-items: center; }
.file-upload-btn {
    display: inline-flex; align-items: center; gap: 5px; cursor: pointer;
    background: var(--green); color: #fff; border: 1px solid var(--green);
    padding: 5px 11px; border-radius: var(--radius-sm); font-size: 12px;
    font-weight: 500; transition: background .15s;
}
.file-upload-btn:hover { background: #16a34a; }
.file-list {
    flex: 1; overflow-y: auto; border: 1px solid var(--border); border-radius: var(--radius-sm);
    background: var(--bg-input);
}
.file-empty { padding: 22px 12px; text-align: center; color: var(--text-muted); font-size: 12px; line-height: 1.6; }
.file-item {
    display: flex; align-items: center; gap: 8px;
    padding: 7px 10px; border-bottom: 1px solid var(--border);
    transition: background .12s;
}
.file-item:last-child { border-bottom: none; }
.file-item:hover { background: var(--bg-hover); }
.file-item-name {
    flex: 1; display: inline-flex; align-items: center; gap: 6px;
    color: var(--text-secondary); font-size: 12px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.file-item-name svg { color: var(--text-muted); flex-shrink: 0; }
.file-item-size { color: var(--text-muted); font-size: 11px; flex-shrink: 0; font-variant-numeric: tabular-nums; }
.file-item-dl {
    display: inline-flex; align-items: center; color: var(--accent);
    padding: 3px; border-radius: var(--radius-sm); flex-shrink: 0; transition: background .12s;
}
.file-item-dl:hover { background: var(--blue-bg); }

/* 文件上传进度 */
.file-upload-progress { display: flex; flex-direction: column; gap: 6px; }
.file-upload-row {
    display: flex; align-items: center; gap: 8px; padding: 3px 0;
}
.file-upload-row .fu-name {
    flex: 1; font-size: 12px; color: var(--text-secondary);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.file-upload-row .fu-bar {
    width: 80px; height: 5px; background: var(--border); border-radius: 3px; overflow: hidden; flex-shrink: 0;
}
.file-upload-row .fu-fill {
    display: block; height: 100%; width: 0; background: var(--green); border-radius: 3px; transition: width .15s;
}
.file-upload-row .fu-pct { font-size: 11px; color: var(--text-muted); width: 32px; text-align: right; flex-shrink: 0; }
.file-upload-row.failed .fu-fill { background: var(--red); }
.file-upload-row.failed .fu-pct { color: var(--red); }

/* Guacamole display 容器 GPU 加速 */
.guac-display, .guac-bounds {
    will-change: transform;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

/* ========== 弹窗 ========== */
.modal-mask {
    display: none; position: fixed; z-index: 1000;
    top: 0; left: 0; right: 0; bottom: 0;
    background: var(--modal-mask-bg); align-items: center; justify-content: center;
}
.modal-mask.active { display: flex; }
.modal {
    background: var(--bg-modal); border: 1px solid var(--border-light);
    border-radius: 8px; width: 560px; max-width: 92vw; max-height: 82vh;
    display: flex; flex-direction: column; box-shadow: var(--shadow-modal);
    animation: modalIn .2s ease;
}
.modal.modal-sm { width: 440px; }
@keyframes modalIn { from { opacity: 0; transform: translateY(-16px); } to { opacity: 1; transform: translateY(0); } }
.modal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 20px; border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: 15px; font-weight: 600; color: var(--text); }
.modal-close { background: none; border: none; font-size: 20px; cursor: pointer; color: var(--text-secondary); padding: 4px; }
.modal-close:hover { color: var(--text); }
.modal-body { padding: 20px; overflow-y: auto; flex: 1; }
.modal-body pre {
    background: var(--bg-input); padding: 12px; border-radius: var(--radius-sm);
    font-size: 13px; font-family: 'SFMono-Regular', Consolas, monospace;
    color: var(--text); white-space: pre-wrap; word-break: break-all; margin-bottom: 12px;
    border: 1px solid var(--border);
}
.modal-footer {
    display: flex; justify-content: flex-end; gap: 10px;
    padding: 12px 20px; border-top: 1px solid var(--border);
}

/* 关于弹窗 */
.modal.about-modal { max-width: 400px; }
.about-header { text-align: center; padding-bottom: 16px; margin-bottom: 16px; border-bottom: 1px solid var(--border); }
.about-logo {
    width: 48px; height: 48px; background: linear-gradient(135deg, #0d2b5e, #1a3c6e);
    border-radius: 10px; display: flex; align-items: center; justify-content: center;
    color: #5b9fff; margin: 0 auto 10px;
}
.about-header h3 { font-size: 17px; font-weight: 600; color: var(--text); margin: 0 0 2px; }
.about-header .about-sub { font-size: 12px; color: var(--text-secondary); }
.about-body { font-size: 13px; color: var(--text-secondary); line-height: 2; }
.about-row { display: flex; padding: 6px 0; border-bottom: 1px solid var(--border); }
.about-row:last-child { border-bottom: none; }
.about-label { width: 70px; flex-shrink: 0; color: var(--text-muted); }
.about-value { color: var(--text); }
.about-footer { text-align: center; padding-top: 14px; margin-top: 14px; border-top: 1px solid var(--border); font-size: 11px; color: var(--text-muted); }
.about-tip {
    margin-top: 12px; padding: 9px 12px; font-size: 12px; line-height: 1.6;
    color: var(--text-secondary); background: var(--orange-bg); border-radius: var(--radius-sm);
    border: 1px solid rgba(245,158,11,0.25);
}

/* 使用指南弹窗 */
.modal.guide-modal { width: 520px; max-width: 92vw; }
.guide-box { font-size: 13px; color: var(--text); }
.guide-intro { margin: 0 0 14px; color: var(--text-secondary); line-height: 1.7; font-size: 13px; }
.guide-features { display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; }
.guide-feature {
    display: flex; gap: 11px; align-items: flex-start; padding: 11px 13px;
    background: var(--blue-bg, rgba(59,130,246,0.08)); border: 1px solid rgba(59,130,246,0.25);
    border-radius: var(--radius-sm);
}
.guide-feature-icon { flex-shrink: 0; font-size: 18px; line-height: 1.4; }
.guide-feature > div { flex: 1; line-height: 1.6; }
.guide-feature b { display: block; font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 2px; }
.guide-feature span { display: block; font-size: 12.5px; color: var(--text-secondary); }
.guide-steps { display: flex; flex-direction: column; gap: 14px; }
.guide-step { display: flex; gap: 12px; align-items: flex-start; }
.guide-step-num {
    flex-shrink: 0; width: 24px; height: 24px; border-radius: 50%;
    background: linear-gradient(135deg, #1a3c6e, #2563eb); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 700;
}
.guide-step > div { flex: 1; line-height: 1.6; }
.guide-step b { display: block; font-size: 13.5px; font-weight: 600; color: var(--text); margin-bottom: 2px; }
.guide-step span { display: block; font-size: 12.5px; color: var(--text-secondary); }
.guide-dont-show {
    display: flex; align-items: center; gap: 7px; margin-top: 18px; padding-top: 14px;
    border-top: 1px solid var(--border); font-size: 12.5px; color: var(--text-secondary); cursor: pointer;
}
.guide-dont-show input { cursor: pointer; }

/* ========== Toast ========== */
#toastContainer { position: fixed; top: 54px; right: 20px; z-index: 2000; display: flex; flex-direction: column; gap: 8px; }
.toast {
    padding: 10px 16px; border-radius: var(--radius-sm); font-size: 13px;
    box-shadow: 0 4px 16px rgba(0,0,0,.3); animation: toastIn .25s ease;
    display: flex; align-items: center; gap: 8px; min-width: 220px; max-width: 400px;
    border: 1px solid var(--border); background: var(--bg-card); color: var(--text);
}
.toast-success { border-color: var(--green); }
.toast-error { border-color: var(--red); }
.toast-info { border-color: var(--accent); }
@keyframes toastIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }
@keyframes toastOut { from { opacity: 1; } to { opacity: 0; transform: translateX(20px); } }

/* ========== Rail 面板切换（由左边窄栏控制） ========== */
.rail-panel-content { display: none; }
.rail-panel-content.active { display: block; }

/* Rail 图标激活态 */
.rail-icon.active {
    color: var(--accent) !important;
    background: var(--blue-bg) !important;
}

.panel-header-row {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 8px;
}
.panel-subtitle {
    font-size: 11px; font-weight: 600; color: var(--text-secondary);
    text-transform: uppercase; letter-spacing: .5px;
}
.btn-icon-sm {
    display: inline-flex; align-items: center; gap: 3px;
    padding: 3px 8px; font-size: 11px; font-weight: 500;
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    cursor: pointer; transition: all .15s;
    background: var(--bg-input); color: var(--text-secondary);
}
.btn-icon-sm:hover { background: var(--bg-hover); color: var(--text); border-color: var(--border-light); }
.btn-icon-sm.btn-accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-icon-sm.btn-accent:hover { background: var(--accent-hover); }
.btn-icon-sm.btn-danger-soft:hover { background: var(--red-bg); border-color: var(--red); color: var(--red); }

/* ========== 会话列表 ========== */
.session-list { display: flex; flex-direction: column; gap: 2px; }
.session-item {
    display: flex; align-items: center; gap: 8px;
    padding: 9px 10px; border-radius: var(--radius-sm);
    cursor: pointer; transition: all .15s; border: 1px solid transparent;
    position: relative;
}
.session-item:hover { background: var(--bg-hover); border-color: var(--border); }
.session-item-left {
    display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0;
}
.session-item-icon {
    width: 30px; height: 30px; border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 700; flex-shrink: 0;
}
.session-item-icon.rdp { background: var(--blue-bg); color: var(--accent); }
.session-item-icon.ssh { background: var(--green-bg); color: var(--green); }
.session-item-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.session-item-name { 
    font-size: 12.5px; font-weight: 600; color: var(--text); 
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.session-item-meta { 
    font-size: 11px; color: var(--text-muted); 
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    display: flex; align-items: center; gap: 6px;
}
.session-item-tag {
    font-size: 9px; padding: 1px 6px; border-radius: 8px;
    background: var(--orange-bg); color: var(--orange);
    font-weight: 500; max-width: 80px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.session-item-actions {
    display: flex; gap: 2px; opacity: 0; transition: opacity .15s;
}
.session-item:hover .session-item-actions { opacity: 1; }
.session-action-btn {
    width: 24px; height: 24px; display: flex; align-items: center; justify-content: center;
    background: none; border: none; color: var(--text-muted); cursor: pointer;
    border-radius: var(--radius-sm); transition: all .15s; font-size: 12px;
}
.session-action-btn:hover { background: var(--bg-hover); color: var(--text); }
.session-action-btn.edit:hover { background: var(--blue-bg); color: var(--accent); }
.session-action-btn.delete:hover { background: var(--red-bg); color: var(--red); }
.session-empty {
    text-align: center; padding: 28px 16px; color: var(--text-muted); font-size: 12px;
    line-height: 1.7;
}
.session-empty svg { opacity: .4; margin-bottom: 8px; }

/* 会话分组标题 */
.session-group-title {
    font-size: 10px; font-weight: 700; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 1px;
    padding: 10px 6px 4px; border-top: 1px solid var(--border);
    margin-top: 4px;
}
.session-group-title:first-child { border-top: none; margin-top: 0; padding-top: 4px; }

/* ========== 批量 Ping ========== */
.ping-input-area { display: flex; flex-direction: column; gap: 8px; }
.ping-hosts-input {
    width: 100%; background: var(--bg-input); color: var(--text);
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    padding: 8px 10px; font-size: 12px; font-family: 'SFMono-Regular', Consolas, monospace;
    resize: vertical; outline: none; line-height: 1.5;
    min-height: 80px;
}
.ping-hosts-input:focus { border-color: var(--accent); }
.ping-hosts-input::placeholder { color: var(--text-muted); opacity: .55; }
.ping-options-row {
    display: flex; align-items: center; gap: 8px; font-size: 12px;
}
.ping-option-label { color: var(--text-muted); font-size: 11px; white-space: nowrap; }
.ping-count-select {
    background: var(--bg-input); color: var(--text);
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    padding: 3px 8px; font-size: 12px; outline: none;
    cursor: pointer;
}
.ping-count-select:focus { border-color: var(--accent); }

/* Ping 统计 */
.ping-stats {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px;
    padding: 8px 0; border-bottom: 1px solid var(--border);
}
.ping-stat-item { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.ping-stat-label { font-size: 10px; color: var(--text-muted); }
.ping-stat-value { font-size: 13px; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.ping-stat-ok { color: var(--green); }
.ping-stat-fail { color: var(--red); }

/* Ping 结果列表 */
.ping-results { display: flex; flex-direction: column; gap: 3px; margin-top: 4px; }
.ping-result-item {
    display: flex; align-items: center; gap: 8px;
    padding: 6px 10px; border-radius: var(--radius-sm);
    border: 1px solid transparent; transition: all .15s;
    animation: pingResultIn .2s ease;
}
@keyframes pingResultIn { from { opacity: 0; transform: translateX(-6px); } to { opacity: 1; transform: none; } }
.ping-result-item:hover { background: var(--bg-hover); border-color: var(--border); }
.ping-result-dot {
    width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
}
.ping-result-dot.ok { background: var(--green); box-shadow: 0 0 4px rgba(34,197,94,.4); }
.ping-result-dot.fail { background: var(--red); box-shadow: 0 0 4px rgba(239,68,68,.4); }
.ping-result-dot.pending { background: var(--orange); animation: pulse 1s infinite; }
.ping-result-host {
    flex: 1; font-size: 12px; font-family: 'SFMono-Regular', Consolas, monospace;
    color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ping-result-latency {
    font-size: 11px; font-variant-numeric: tabular-nums; white-space: nowrap;
    min-width: 52px; text-align: right;
}
.ping-result-latency.ok { color: var(--green); }
.ping-result-latency.fail { color: var(--red); }
.ping-empty { text-align: center; padding: 20px 10px; color: var(--text-muted); font-size: 12px; }

/* Ping 结果箭头指示器 */
.ping-result-arrow {
    font-size: 10px; color: var(--text-muted); margin-left: 2px; transition: transform .15s;
    flex-shrink: 0;
}

/* Ping 详情弹窗 */
.modal.ping-detail-modal { width: 600px; }
.ping-modal-loading {
    text-align: center; padding: 20px 10px; color: var(--text-muted); font-size: 13px;
}
.ping-modal-loading::before {
    content: ''; display: inline-block; width: 12px; height: 12px;
    border: 2px solid var(--accent); border-top-color: transparent;
    border-radius: 50%; animation: spin .8s linear infinite;
    margin-right: 8px; vertical-align: middle;
}
.ping-modal-output {
    background: #0c0c0c; color: #cccccc; padding: 16px; border-radius: var(--radius);
    font-size: 13px; font-family: 'SFMono-Regular', Consolas, 'Courier New', monospace;
    line-height: 1.6; white-space: pre-wrap; word-break: break-all;
    max-height: 400px; overflow-y: auto; border: 1px solid #333;
    margin: 0;
}
[data-theme="light"] .ping-modal-output {
    background: #f8f8f8; color: #1a1a1a; border-color: #ccc;
}


/* ===== Traceroute 美化弹窗 ===== */
.modal.traceroute-detail-modal { width: 700px; }
.modal.traceroute-detail-modal .modal-body { padding: 16px 20px; }

/* 统计卡片 */
.trm-stats {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
    margin-bottom: 16px;
}
.trm-stat-card {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px; border-radius: var(--radius);
    background: var(--bg-input); border: 1px solid var(--border);
    transition: all .25s;
}
.trm-stat-icon {
    width: 32px; height: 32px; border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; font-size: 14px;
}
.trm-stat-icon-status {
    background: var(--blue-bg); color: var(--accent);
    background-image: url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%233b82f6' stroke-width='2'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpolyline points='12 6 12 12 16 14'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: center; background-size: 18px;
}
.trm-stat-icon-hops {
    background: var(--green-bg); color: var(--green);
    background-image: url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2322c55e' stroke-width='2'%3E%3Cpath d='M22 12h-4l-3 9L9 3l-3 9H2'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: center; background-size: 18px;
}
.trm-stat-icon-avg {
    background: rgba(168,85,247,.1); color: #a855f7;
    background-image: url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23a855f7' stroke-width='2'%3E%3Cpath d='M3 3v18h18'/%3E%3Cpath d='M18 17V9'/%3E%3Cpath d='M13 17V5'/%3E%3Cpath d='M8 17v-3'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: center; background-size: 18px;
}
.trm-stat-icon-max {
    background: var(--orange-bg); color: var(--orange);
    background-image: url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23f59e0b' stroke-width='2'%3E%3Cpath d='M13 2L3 14h9l-1 8 10-12h-9l1-8z'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: center; background-size: 18px;
}
.trm-stat-info { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.trm-stat-label { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .5px; }
.trm-stat-value { font-size: 14px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }

/* 统计卡片状态 */
.trm-stat-running { border-color: var(--accent); box-shadow: 0 0 0 1px rgba(59,130,246,.15); }
.trm-stat-running .trm-stat-value { color: var(--accent); }
.trm-stat-done { border-color: var(--green); box-shadow: 0 0 0 1px rgba(34,197,94,.15); }
.trm-stat-done .trm-stat-icon-status {
    background-color: var(--green-bg);
    background-image: url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2322c55e' stroke-width='2.5'%3E%3Cpath d='M20 6L9 17l-5-5'/%3E%3C/svg%3E");
}
.trm-stat-done .trm-stat-value { color: var(--green); }
.trm-stat-stopped { border-color: var(--orange); box-shadow: 0 0 0 1px rgba(245,158,11,.15); }
.trm-stat-stopped .trm-stat-icon-status {
    background-color: var(--orange-bg);
    background-image: url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23f59e0b' stroke-width='2'%3E%3Crect x='6' y='6' width='12' height='12' rx='1'/%3E%3C/svg%3E");
}
.trm-stat-stopped .trm-stat-value { color: var(--orange); }

/* 时间线 */
.trm-timeline-wrap {
    background: var(--bg-input); border: 1px solid var(--border);
    border-radius: var(--radius); overflow: hidden; margin-bottom: 12px;
}
.trm-timeline-header {
    display: flex; align-items: center; gap: 6px;
    padding: 8px 14px; border-bottom: 1px solid var(--border);
    font-size: 11px; font-weight: 600; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: .5px;
}
.trm-timeline-header svg { opacity: .6; }
.trm-timeline {
    max-height: 240px; overflow-y: auto; padding: 6px 0;
}
.trm-timeline::-webkit-scrollbar { width: 4px; }
.trm-timeline::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* 时间线节点 */
.trm-node {
    display: flex; align-items: stretch; position: relative;
    animation: trmNodeIn .3s ease;
}
@keyframes trmNodeIn { from { opacity: 0; transform: translateX(-10px); } to { opacity: 1; transform: none; } }

.trm-node-rail {
    width: 28px; flex-shrink: 0; position: relative;
    display: flex; align-items: center; justify-content: center;
}
.trm-node-rail::after {
    content: ''; position: absolute; top: 0; bottom: 0; left: 50%;
    width: 2px; transform: translateX(-50%);
    background: var(--border-light);
}
.trm-node:first-child .trm-node-rail::after { top: 50%; }
.trm-node:last-child .trm-node-rail::after { bottom: 50%; }
.trm-node-timeout .trm-node-rail::after { opacity: .4; }

.trm-node-dot {
    width: 10px; height: 10px; border-radius: 50%;
    position: relative; z-index: 1; flex-shrink: 0;
    background: var(--green); box-shadow: 0 0 6px rgba(34,197,94,.35);
    transition: all .2s;
}
.trm-node-dot.trm-dot-fast { background: var(--green); box-shadow: 0 0 6px rgba(34,197,94,.35); }
.trm-node-dot.trm-dot-medium { background: var(--orange); box-shadow: 0 0 6px rgba(245,158,11,.35); }
.trm-node-dot.trm-dot-slow { background: var(--red); box-shadow: 0 0 6px rgba(239,68,68,.35); }
.trm-node-timeout .trm-node-dot {
    background: var(--text-muted); box-shadow: none; opacity: .5;
}

.trm-node-body {
    flex: 1; display: flex; align-items: center; gap: 10px;
    padding: 5px 12px 5px 6px; border-radius: var(--radius-sm);
    transition: background .15s;
}
.trm-node-body:hover { background: var(--bg-hover); }

.trm-node-seq {
    width: 22px; font-size: 10px; font-weight: 700; color: var(--text-muted);
    text-align: right; flex-shrink: 0; font-variant-numeric: tabular-nums;
}
.trm-node-info { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 8px; }
.trm-node-ip {
    font-size: 12px; font-family: 'SFMono-Regular', Consolas, monospace;
    color: var(--text); font-weight: 500;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.trm-node-timeout .trm-node-ip { color: var(--text-muted); font-style: italic; }
.trm-node-host {
    font-size: 10px; color: var(--text-muted);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.trm-node-lat {
    font-size: 11px; font-variant-numeric: tabular-nums;
    white-space: nowrap; min-width: 52px; text-align: right;
    font-weight: 600; color: var(--text-muted);
}
.trm-node-lat.trm-lat-fast { color: var(--green); }
.trm-node-lat.trm-lat-medium { color: var(--orange); }
.trm-node-lat.trm-lat-slow { color: var(--red); }

/* 终端输出 */
.trm-terminal-wrap {
    border-radius: var(--radius); overflow: hidden;
    border: 1px solid #2a2a2a; margin-bottom: 12px;
    background: #0c0c0c;
}
[data-theme="light"] .trm-terminal-wrap {
    border-color: #d0d0d0; background: #f8f8f8;
}
.trm-terminal-header {
    display: flex; align-items: center; gap: 8px;
    padding: 7px 12px; background: rgba(255,255,255,.04);
    border-bottom: 1px solid #2a2a2a;
}
[data-theme="light"] .trm-terminal-header {
    background: #eee; border-bottom-color: #d0d0d0;
}
.trm-terminal-dots { display: flex; gap: 5px; }
.trm-dot {
    width: 10px; height: 10px; border-radius: 50%; display: block;
}
.trm-dot-red { background: #ff5f56; }
.trm-dot-yellow { background: #ffbd2e; }
.trm-dot-green { background: #27c93f; }
.trm-terminal-title {
    flex: 1; font-size: 11px; color: rgba(255,255,255,.45);
    font-family: 'SFMono-Regular', Consolas, monospace;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
[data-theme="light"] .trm-terminal-title { color: rgba(0,0,0,.4); }
.trm-terminal-copy {
    background: none; border: none; color: rgba(255,255,255,.35);
    cursor: pointer; padding: 2px 4px; border-radius: var(--radius-sm);
    display: flex; align-items: center; transition: all .15s;
}
.trm-terminal-copy:hover { color: rgba(255,255,255,.8); background: rgba(255,255,255,.08); }
[data-theme="light"] .trm-terminal-copy { color: rgba(0,0,0,.35); }
[data-theme="light"] .trm-terminal-copy:hover { color: rgba(0,0,0,.7); background: rgba(0,0,0,.06); }

.trm-terminal-body {
    padding: 14px 16px; margin: 0;
    font-size: 12px; font-family: 'SFMono-Regular', Consolas, 'Courier New', monospace;
    line-height: 1.65; white-space: pre-wrap; word-break: break-all;
    color: #b0b0b0; max-height: 200px; overflow-y: auto;
}
[data-theme="light"] .trm-terminal-body { color: #333; }
.trm-terminal-body::-webkit-scrollbar { width: 4px; }
.trm-terminal-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 2px; }
[data-theme="light"] .trm-terminal-body::-webkit-scrollbar-thumb { background: rgba(0,0,0,.1); }

.trm-line { display: block; }

/* 进度条 */
.trm-progress {
    display: flex; align-items: center; gap: 10px;
}
.trm-progress-bar {
    flex: 1; height: 3px; background: var(--bg-input);
    border-radius: 2px; overflow: hidden;
}
.trm-progress-fill {
    height: 100%; background: linear-gradient(90deg, var(--accent), #6366f1);
    border-radius: 2px; transition: width .4s ease; width: 0%;
}
.trm-progress-text {
    font-size: 10px; color: var(--text-muted); white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

/* ========== 一键多开 ========== */
.multiopen-desc {
    font-size: 11px; color: var(--text-muted); line-height: 1.5;
    margin-bottom: 12px; padding: 0 2px;
}
.multiopen-section { margin-bottom: 10px; }
.multiopen-section-title {
    font-size: 10px; font-weight: 600; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: .5px;
    margin-bottom: 6px;
}
.multiopen-quick-list { display: flex; flex-direction: column; gap: 2px; max-height: 120px; overflow-y: auto; }
.multiopen-quick-item {
    display: flex; align-items: center; gap: 8px;
    padding: 6px 10px; border-radius: var(--radius-sm);
    cursor: pointer; transition: all .15s; border: 1px solid transparent;
    font-size: 12px;
}
.multiopen-quick-item:hover { background: var(--bg-hover); border-color: var(--border); }
.multiopen-quick-item.selected { background: var(--blue-bg); border-color: var(--accent); }
.multiopen-quick-item .mq-icon {
    width: 22px; height: 22px; border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    font-size: 10px; font-weight: 700; flex-shrink: 0;
    background: var(--blue-bg); color: var(--accent);
}
.multiopen-quick-item .mq-icon.ssh { background: rgba(34,197,94,.12); color: var(--green); }
.multiopen-quick-item .mq-icon.rdp { background: var(--blue-bg); color: var(--accent); }
.multiopen-smart-parse { display: flex; flex-direction: column; gap: 4px; }
.multiopen-smart-preview {
    margin-top: 4px; padding: 8px; border-radius: var(--radius-sm);
    background: var(--bg-hover); border: 1px solid var(--border);
}
.multiopen-smart-fields {
    display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px 12px; margin-top: 4px;
}
.multiopen-smart-field {
    display: flex; align-items: center; gap: 6px; font-size: 11px;
}
.multiopen-smart-field-label { color: var(--text-muted); white-space: nowrap; }
.multiopen-smart-field-value { font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.multiopen-smart-field-value.protocol-ssh { color: var(--green); }
.multiopen-smart-field-value.protocol-rdp { color: var(--accent); }
.multiopen-quick-item .mq-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.multiopen-quick-item .mq-meta { font-size: 10px; color: var(--text-muted); white-space: nowrap; }
.multiopen-form { display: flex; flex-direction: column; gap: 2px; }
.multiopen-proto-tabs {
    display: flex; gap: 0; border-radius: var(--radius-sm);
    overflow: hidden; border: 1px solid var(--border);
}
.multiopen-proto-tab {
    flex: 1; padding: 4px 12px; font-size: 11px; font-weight: 600;
    text-align: center; cursor: pointer; border: none; outline: none;
    background: var(--bg-input); color: var(--text-muted);
    transition: all .15s;
}
.multiopen-proto-tab:hover { color: var(--text); }
.multiopen-proto-tab.active {
    background: var(--accent); color: #fff;
}
.multiopen-proto-tab.active.ssh { background: #22c55e; }
.multiopen-proto-tab.active.rdp { background: #3b82f6; }
.multiopen-options-row {
    display: flex; align-items: center; gap: 8px; margin: 10px 0 12px;
    font-size: 12px;
}
.multiopen-start-btn {
    width: 100%; padding: 10px 0; font-size: 13px; font-weight: 600;
    justify-content: center; gap: 6px;
}
.multiopen-progress {
    margin-top: 10px; display: flex; flex-direction: column; gap: 6px;
}
.multiopen-progress-bar {
    height: 4px; background: var(--bg-input); border-radius: 2px; overflow: hidden;
}
.multiopen-progress-fill {
    height: 100%; background: var(--accent); border-radius: 2px;
    transition: width .3s ease; width: 0%;
}
.multiopen-progress-text {
    font-size: 11px; color: var(--text-muted); text-align: center;
    font-variant-numeric: tabular-nums;
}

/* ========== 路由追踪 Traceroute ========== */
.traceroute-desc {
    font-size: 11px; color: var(--text-muted); line-height: 1.5;
    margin-bottom: 12px; padding: 0 2px;
}
.traceroute-input-area { display: flex; flex-direction: column; gap: 8px; }
.traceroute-options-row {
    display: flex; align-items: center; gap: 8px; font-size: 12px;
}
.traceroute-stats {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px;
    padding: 8px 0; border-bottom: 1px solid var(--border);
}
.traceroute-results { margin-top: 4px; }

/* 追踪头部 */
.traceroute-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 8px 10px; background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-sm); margin-bottom: 4px;
}
.traceroute-target {
    font-size: 12px; font-weight: 600; color: var(--accent);
    font-family: 'SFMono-Regular', Consolas, monospace;
}
.traceroute-max-hops {
    font-size: 10px; color: var(--text-muted);
}

/* 单跳条目 */
.traceroute-hop {
    display: flex; align-items: center; gap: 0;
    padding: 5px 10px; border-radius: var(--radius-sm);
    transition: all .15s; position: relative;
    animation: tracerouteHopIn .3s ease;
}
.traceroute-hop:hover { background: var(--bg-hover); }
.traceroute-hop.timeout { opacity: .6; }
@keyframes tracerouteHopIn { from { opacity: 0; transform: translateX(-8px); } to { opacity: 1; transform: none; } }

/* 序号 */
.traceroute-hop-seq {
    width: 24px; font-size: 10px; font-weight: 700;
    color: var(--text-muted); text-align: right; flex-shrink: 0;
    font-variant-numeric: tabular-nums;
}

/* 连接线 */
.traceroute-hop-line {
    width: 16px; height: 2px; background: var(--border); flex-shrink: 0;
    margin: 0 2px;
    border-radius: 1px;
}
.traceroute-hop:first-child .traceroute-hop-line { background: var(--accent); }
.traceroute-hop.timeout .traceroute-hop-line { background: var(--border); opacity: .4; }

/* 节点圆点 */
.traceroute-hop-dot {
    width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0;
    margin-right: 8px; position: relative; z-index: 1;
}
.traceroute-hop-dot.ok {
    background: var(--green);
    box-shadow: 0 0 6px rgba(34,197,94,.4);
}
.traceroute-hop-dot.timeout {
    background: var(--orange);
    box-shadow: 0 0 4px rgba(245,158,11,.3);
}

/* IP / 主机名 */
.traceroute-hop-info {
    flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px;
}
.traceroute-hop-ip {
    font-size: 12px; font-family: 'SFMono-Regular', Consolas, monospace;
    color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.traceroute-hop.timeout .traceroute-hop-ip {
    color: var(--text-muted); font-style: italic;
}
.traceroute-hop-hostname {
    font-size: 10px; color: var(--text-muted);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* 延迟 */
.traceroute-hop-latency {
    font-size: 11px; font-variant-numeric: tabular-nums;
    white-space: nowrap; min-width: 56px; text-align: right;
    color: var(--text-muted);
}
.traceroute-hop-latency.fast { color: var(--green); }
.traceroute-hop-latency.medium { color: var(--orange); }
.traceroute-hop-latency.slow { color: var(--red); }

.traceroute-empty { text-align: center; padding: 20px 10px; color: var(--text-muted); font-size: 12px; }

/* ========== 快捷命令 QuickCmd ========== */
.quickcmd-desc {
    font-size: 11px; color: var(--text-muted); line-height: 1.5;
    margin-bottom: 10px; padding: 0 2px;
}
.quickcmd-list { display: flex; flex-direction: column; gap: 6px; }

/* 分组 */
.quickcmd-group {
    border: 1px solid var(--border); border-radius: var(--radius);
    overflow: hidden; transition: border-color .2s;
}
.quickcmd-group:hover { border-color: var(--border-light); }

.quickcmd-group-header {
    display: flex; align-items: center; gap: 7px;
    padding: 7px 10px; cursor: pointer; user-select: none;
    background: var(--bg-card); transition: background .15s;
}
.quickcmd-group-header:hover { background: var(--bg-hover); }
.quickcmd-group-header.collapsed .quickcmd-group-arrow { transform: rotate(-90deg); }

.quickcmd-group-icon {
    width: 20px; height: 20px; border-radius: 4px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.quickcmd-color-blue { background: var(--blue-bg); color: var(--accent); }
.quickcmd-color-green { background: var(--green-bg); color: var(--green); }
.quickcmd-color-purple { background: rgba(168,85,247,.1); color: #a855f7; }
.quickcmd-color-orange { background: var(--orange-bg); color: var(--orange); }
.quickcmd-color-red { background: var(--red-bg); color: var(--red); }
.quickcmd-color-yellow { background: rgba(234,179,8,.1); color: #eab308; }
.quickcmd-color-custom { background: rgba(236,72,153,.1); color: #ec4899; }

.quickcmd-group-name {
    flex: 1; font-size: 11px; font-weight: 600; color: var(--text);
}
.quickcmd-group-count {
    font-size: 9px; padding: 1px 6px; border-radius: 8px;
    background: var(--bg-input); color: var(--text-muted);
    font-weight: 600;
}
.quickcmd-group-arrow {
    transition: transform .2s; color: var(--text-muted);
}

.quickcmd-group-body {
    display: flex; flex-direction: column; gap: 0;
    border-top: 1px solid var(--border);
}

/* 单条命令 */
.quickcmd-item {
    display: flex; align-items: center; gap: 8px;
    padding: 6px 10px 6px 14px; cursor: pointer;
    transition: all .15s; border-bottom: 1px solid var(--border);
    position: relative;
}
.quickcmd-item:last-child { border-bottom: none; }
.quickcmd-item:hover { background: var(--bg-hover); }
.quickcmd-item:active { background: var(--blue-bg); }

.quickcmd-item-name {
    font-size: 12px; font-weight: 500; color: var(--text);
    white-space: nowrap; min-width: 60px;
}
.quickcmd-item-cmd {
    flex: 1; font-size: 11px; color: var(--text-muted);
    font-family: 'SFMono-Regular', Consolas, monospace;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.quickcmd-item:hover .quickcmd-item-cmd { color: var(--text-secondary); }

.quickcmd-item-del {
    width: 18px; height: 18px; display: flex; align-items: center; justify-content: center;
    background: none; border: none; color: var(--text-muted); cursor: pointer;
    border-radius: var(--radius-sm); font-size: 14px; opacity: 0;
    transition: all .15s; flex-shrink: 0;
}
.quickcmd-item:hover .quickcmd-item-del { opacity: .6; }
.quickcmd-item-del:hover { opacity: 1 !important; color: var(--red); background: var(--red-bg); }

/* 自定义输入区 */
.quickcmd-custom-section {
    margin-top: 10px; padding-top: 10px;
    border-top: 1px solid var(--border);
}
.quickcmd-custom-title {
    font-size: 10px; font-weight: 600; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: .5px;
    margin-bottom: 6px;
}
.quickcmd-custom-row {
    display: flex; gap: 6px; align-items: center;
}
.quickcmd-custom-row .form-input {
    font-family: 'SFMono-Regular', Consolas, monospace;
    font-size: 12px;
}

/* ========== 通用 ========== */
input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input[type="number"] { -moz-appearance: textfield; }
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-light); }
.hidden { display: none !important; }

/* ========== 白色主题特殊覆盖 ========== */
[data-theme="light"] .conn-tab-close:hover {
    color: #fff;
}
[data-theme="light"] .tab-bar .tab-item.active {
    color: #fff;
}
[data-theme="light"] .about-logo {
    background: linear-gradient(135deg, #1a3c6e, #2a5298);
}
[data-theme="light"] .smart-parse-formats code {
    background: rgba(59,130,246,.06);
}
[data-theme="light"] .conn-view .rdp-wrap {
    background: #e8eaed;
}
