:root {
    /* 主题蓝图 - 高端深色 */
    --bg-base: #0f1115;
    --bg-panel: #1a1d24;
    --bg-panel-hover: #232730;
    --bg-overlay: rgba(15, 17, 21, 0.85);

    /* 文本颜色 */
    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    /* 品牌状态颜色 */
    --brand-primary: #3b82f6;
    --brand-primary-hover: #2563eb;
    --brand-accent: #8b5cf6;
    --status-success: #10b981;
    --status-warning: #f59e0b;
    --status-danger: #ef4444;

    /* 边框与阴影 */
    --border-color: #2e3643;
    --shadow-soft: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
    --shadow-glow: 0 0 15px rgba(59, 130, 246, 0.2);
    
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-full: 9999px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--bg-base);
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    height: 100vh;
    overflow: hidden;
}

/* 按钮基础及变体 */
button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    outline: none;
    transition: all 0.2s ease;
}

.btn-primary {
    background-color: var(--brand-primary);
    color: white;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 2px 10px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover {
    background-color: var(--brand-primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.btn-secondary {
    background-color: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-secondary:hover {
    background-color: var(--bg-panel-hover);
    border-color: #475569;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

.btn-block {
    width: 100%;
    margin-top: 20px;
    padding: 12px;
    font-size: 16px;
}

.btn-icon {
    background: transparent;
    color: var(--text-secondary);
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}
.btn-icon:hover {
    background-color: var(--bg-panel-hover);
    color: var(--text-primary);
}

/* 状态标与 Badge */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.05);
}

.status-badge.success {
    color: var(--status-success);
    background: rgba(16, 185, 129, 0.1);
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: currentColor;
    box-shadow: 0 0 5px currentColor;
}

.badge {
    background-color: var(--brand-primary);
    color: white;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
}

/* 表单元素 */
.input-group {
    position: relative;
    margin-bottom: 16px;
}
.input-group i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 18px;
}
.input-group input {
    width: 100%;
    background-color: var(--bg-base);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 12px 14px 12px 40px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    outline: none;
    transition: all 0.2s;
}
.input-group input:focus {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.select-box, .custom-input {
    background-color: var(--bg-base);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    outline: none;
    transition: border-color 0.2s;
}
.select-box:focus, .custom-input:focus {
    border-color: var(--brand-primary);
}

/* ================= 布局系统 ================= */

.fullscreen-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: radial-gradient(circle at center, #1b2131 0%, #0f1115 100%);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.glass-panel {
    background: rgba(26, 29, 36, 0.6);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft), var(--shadow-glow);
}

.login-box {
    width: 400px;
    padding: 40px;
    text-align: center;
    animation: fadeIn 0.5s ease;
}
.login-box .logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 8px;
    color: white;
}
.login-box .logo i {
    font-size: 32px;
    color: var(--brand-primary);
}
.login-box .subtitle {
    color: var(--text-muted);
    margin-bottom: 30px;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

#app-container {
    display: flex;
    height: 100vh;
    width: 100vw;
}

.sidebar {
    width: 70px;
    background-color: var(--bg-panel);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 24px 0;
    z-index: 10;
}

.brand-icon {
    font-size: 30px;
    color: var(--brand-primary);
    margin-bottom: 40px;
    text-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 16px;
    flex: 1;
    width: 100%;
    align-items: center;
}

.nav-item {
    position: relative;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    color: var(--text-muted);
    font-size: 22px;
    text-decoration: none;
    transition: all 0.2s;
}

.nav-item:hover {
    background-color: var(--bg-panel-hover);
    color: var(--text-primary);
}

.nav-item.active {
    background-color: rgba(59, 130, 246, 0.15);
    color: var(--brand-primary);
    box-shadow: inset 3px 0 0 var(--brand-primary);
}

.nav-item .tooltip {
    position: absolute;
    left: 60px;
    background-color: var(--text-primary);
    color: var(--bg-base);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transform: translateX(-10px);
    transition: all 0.2s;
    pointer-events: none;
    z-index: 100;
}

.nav-item:hover .tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

.sidebar-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    width: 100%;
}

.user-avatar img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
    background-color: var(--bg-base);
}

.view-section {
    display: none;
    flex-direction: column;
    height: 100%;
    padding: 24px 32px;
}

.view-section.active {
    display: flex;
}

.view-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-shrink: 0;
}

.view-header h2 {
    font-size: 24px;
    font-weight: 600;
    letter-spacing: -0.5px;
}

/* ================= 新版工作台布局 ================= */
.workspace-layout {
    display: flex;
    gap: 20px;
    flex: 1;
    overflow: hidden;
}

.panel {
    background-color: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.panel-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: rgba(0, 0, 0, 0.1);
}

.panel-header h3 {
    font-size: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
}

.panel-body {
    flex: 1;
    overflow-y: auto;
}
.panel-body::-webkit-scrollbar { width: 6px; }
.panel-body::-webkit-scrollbar-track { background: transparent; }
.panel-body::-webkit-scrollbar-thumb { background-color: var(--border-color); border-radius: 10px; }

/* 圈子列表项 */
.circle-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 4px;
}
.circle-item:hover {
    background-color: var(--bg-panel-hover);
}
.circle-item.active {
    background-color: rgba(59, 130, 246, 0.1);
    box-shadow: inset 3px 0 0 var(--brand-primary);
}
.circle-item .icon {
    width: 40px; height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, #1e293b, #334155);
    display: flex; align-items: center; justify-content: center;
    font-size: 18px; font-weight: 600; color: #fff;
    flex-shrink: 0;
}
.circle-item .info {
    flex: 1; overflow: hidden;
}
.circle-item .info h4 {
    font-size: 14px; margin-bottom: 4px; font-weight: 500;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.circle-item .info p {
    font-size: 12px; color: var(--text-muted);
}
.circle-checkbox {
    pointer-events: auto; /* 防止被父级拦截 */
}

/* 聊天面板 */
.chat-scroll-area {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.chat-message {
    display: flex;
    gap: 12px;
    max-width: 85%;
    animation: fadeIn 0.3s ease;
}
.chat-message.self {
    align-self: flex-end;
    flex-direction: row-reverse;
}
.chat-message .avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}
.chat-message .msg-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.chat-message.self .msg-content {
    align-items: flex-end;
}
.chat-message .msg-author {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}
.chat-message .msg-bubble {
    padding: 10px 14px;
    background-color: var(--bg-panel);
    border-radius: 0 12px 12px 12px;
    font-size: 14px;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    line-height: 1.4;
    word-break: break-all;
}
.chat-message.self .msg-bubble {
    background-color: var(--brand-primary);
    border-color: var(--brand-primary-hover);
    color: #fff;
    border-radius: 12px 0 12px 12px;
}
.chat-message .msg-bubble img, .chat-message .msg-bubble video {
    max-width: 200px;
    border-radius: 8px;
    display: block;
}

/* 树状菜单 */
.tree-group-title {
    display: flex; align-items: center; padding: 8px 10px; cursor: pointer; border-radius: var(--radius-sm); font-weight: 500; color: var(--text-secondary);
}
.tree-group-title:hover { background-color: var(--bg-panel-hover); color: var(--text-primary); }
.tree-group-title i.chevron { margin-right: 6px; transition: transform 0.2s; }
.tree-group-title.open i.chevron { transform: rotate(90deg); }
.tree-group-items { display: none; padding-left: 24px; margin-top: 4px; margin-bottom: 8px; }
.tree-group.open .tree-group-items { display: block; }
.tree-item { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: var(--radius-sm); cursor: pointer; transition: background 0.1s; }
.tree-item:hover { background-color: var(--bg-panel-hover); }
.tree-item input[type="radio"] { cursor: pointer; accent-color: var(--brand-primary); width: 16px; height: 16px; }
.tree-item img { width: 24px; height: 24px; border-radius: 50%; }
.tree-item .name { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13px; }

/* 快捷语料 */
.tabs { display: flex; gap: 10px; background: var(--bg-base); padding: 4px; border-radius: var(--radius-sm); }
.tab-btn { background: transparent; color: var(--text-secondary); padding: 6px 12px; border-radius: var(--radius-sm); font-size: 13px; flex: 1; }
.tab-btn.active { background: var(--bg-panel-hover); color: var(--text-primary); box-shadow: var(--shadow-soft); }

.shortcut-card {
    background-color: var(--bg-base); border: 1px solid var(--border-color); padding: 12px; border-radius: var(--radius-sm); cursor: pointer; transition: all 0.2s; display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; position: relative;
}
.shortcut-card:hover { border-color: var(--brand-primary); transform: translateY(-2px); box-shadow: var(--shadow-soft); }
.shortcut-card .sc-tag { font-size: 11px; color: var(--brand-primary); background: rgba(59, 130, 246, 0.1); align-self: flex-start; padding: 2px 6px; border-radius: 4px; }
.shortcut-card .sc-text { font-size: 13px; color: var(--text-primary); }

.shortcut-card .sc-actions {
    position: absolute; top: 8px; right: 8px; display: none; gap: 4px;
}
.shortcut-card:hover .sc-actions { display: flex; }
.shortcut-card .sc-actions button {
    background: rgba(0,0,0,0.5); padding: 4px; border-radius: 4px; color: var(--text-primary); font-size: 12px; backdrop-filter: blur(4px);
}
.shortcut-card .sc-actions button:hover { background: var(--brand-primary); }

/* tooltip 辅助 */
.tooltip-wrap { position: relative; }
.tooltip-wrap:hover::after {
    content: attr(data-tip); position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); background: #fff; color: #000; padding: 4px 8px; border-radius: 4px; font-size: 12px; white-space: nowrap; pointer-events: none; margin-bottom: 6px;
}

/* ================= 极简数据表格 ================= */
.table-container {
    background-color: var(--bg-panel); border: 1px solid var(--border-color); border-radius: var(--radius-lg); flex: 1; display: flex; flex-direction: column; overflow: hidden;
}
.table-toolbar { padding: 16px 24px; border-bottom: 1px solid var(--border-color); display: flex; justify-content: space-between; align-items: center; min-height: 70px; }
.filter-group { display: flex; gap: 16px; margin-left: auto; }
.search-box { position: relative; }
.search-box i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-muted); }
.search-box input { background: var(--bg-base); border: 1px solid var(--border-color); color: white; padding: 8px 12px 8px 36px; border-radius: var(--radius-sm); outline: none; width: 100%; }
.search-box input:focus { border-color: var(--brand-primary); }
.batch-actions { display: flex; align-items: center; gap: 12px; animation: fadeIn 0.2s ease; }
.batch-actions .selected-text { color: var(--brand-primary); font-size: 14px; background: rgba(59, 130, 246, 0.1); padding: 4px 12px; border-radius: var(--radius-full); }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td { padding: 14px 24px; text-align: left; border-bottom: 1px solid var(--border-color); }
.data-table th { background-color: rgba(0, 0, 0, 0.2); color: var(--text-secondary); font-weight: 500; font-size: 13px; position: sticky; top: 0; z-index: 1; }
.data-table tbody tr { transition: background 0.2s; }
.data-table tbody tr:hover { background-color: var(--bg-panel-hover); }
.table-cell-account { display: flex; align-items: center; gap: 12px; }
.table-cell-account img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
.table-cell-account .acc-info h4 { font-size: 14px; font-weight: 500; margin-bottom: 2px; }
.table-cell-account .acc-info p { font-size: 12px; color: var(--text-muted); }
.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; }
.status-dot.online { background-color: var(--status-success); box-shadow: 0 0 8px var(--status-success); }
.status-dot.offline { background-color: var(--text-muted); }
input[type="checkbox"] { accent-color: var(--brand-primary); width: 18px; height: 18px; cursor: pointer; }

/* ================= 模态窗 ================= */
.modal-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: var(--bg-overlay); backdrop-filter: blur(4px); display: none; align-items: center; justify-content: center; z-index: 2000;
}
.modal-overlay.active { display: flex; animation: fadeIn 0.2s ease; }
.modal { background: var(--bg-panel); border: 1px solid var(--border-color); border-radius: var(--radius-lg); width: 440px; box-shadow: 0 20px 40px rgba(0,0,0,0.5); overflow: hidden; }
.modal-header { padding: 20px 24px; border-bottom: 1px solid var(--border-color); display: flex; justify-content: space-between; align-items: center; }
.modal-header h3 { font-size: 18px; font-weight: 600; }
.modal-body { padding: 24px; }
.modal-footer { padding: 16px 24px; background: rgba(0,0,0,0.2); border-top: 1px solid var(--border-color); display: flex; justify-content: flex-end; gap: 12px; }
.text-highlight { color: var(--brand-primary); }
.group-list-item { display: flex; justify-content: space-between; align-items: center; padding: 12px; border-bottom: 1px solid var(--border-color); }
.group-list-item:last-child { border-bottom: none; }

/* ================= Toast ================= */
#toast-container { position: fixed; top: 24px; right: 24px; z-index: 3000; display: flex; flex-direction: column; gap: 10px; }
.toast { background: var(--bg-panel); border: 1px solid var(--border-color); border-left: 4px solid var(--brand-primary); padding: 16px 20px; border-radius: var(--radius-sm); box-shadow: 0 10px 25px rgba(0,0,0,0.3); min-width: 300px; display: flex; align-items: center; gap: 12px; animation: slideInRight 0.3s ease forwards; }
.toast.success { border-left-color: var(--status-success); } .toast.success i { color: var(--status-success); }
.toast.error { border-left-color: var(--status-danger); } .toast.error i { color: var(--status-danger); }
.toast.warning { border-left-color: var(--status-warning); } .toast.warning i { color: var(--status-warning); }
.toast i { font-size: 20px; } .toast span { font-size: 14px; font-weight: 500; }
@keyframes slideInRight { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes fadeOut { to { opacity: 0; transform: translateY(-10px); } }
