/* frontend/styles.css - v3.0 Final Polish */
:root {
    /* === 基础色盘 === */
    --bg-app: #0f172a;
    --bg-sidebar: rgba(15, 23, 42, 0.6);
    --bg-panel: rgba(30, 41, 59, 0.75);
    --bg-card: rgba(51, 65, 85, 0.5);
    
    /* === 角色主题色 === */
    --color-pm: #a855f7;
    --color-ui: #ec4899;
    --color-product: #f43f5e;
    --color-dev: #3b82f6;
    --color-backend: #10b981;
    --color-qa: #f59e0b;
    --color-idea: #eab308;
    
    --primary: #6366f1;
    --primary-glow: rgba(99, 102, 241, 0.5);
    
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border: rgba(148, 163, 184, 0.15);
    
    --glass: blur(16px);
    --sidebar-width: 260px;
    --console-height: 200px;
}

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

body {
    font-family: 'Inter', system-ui, sans-serif;
    background: radial-gradient(circle at top left, #1e1b4b, #0f172a 60%, #020617);
    color: var(--text-main);
    height: 100vh;
    overflow: hidden;
    line-height: 1.5;
}

/* === 顶部导航栏 === */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    height: 60px;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255,255,255,0.05);
    overflow: visible !important;
    z-index: 5000;
    position: relative;
}

.left-section, .right-section {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
}

.right-section {
    justify-content: flex-end;
    gap: 12px;
}

.center-section {
    flex: 2;
    display: flex;
    justify-content: center;
}

/* 余额胶囊 */
.user-pill {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255,255,255,0.05);
    padding: 4px 6px 4px 12px;
    border-radius: 30px;
    border: 1px solid rgba(255,255,255,0.1);
    transition: 0.2s;
}

.user-pill:hover {
    background: rgba(255,255,255,0.08);
    border-color: rgba(255,255,255,0.2);
}

.balance-tag {
    font-size: 13px;
    font-weight: 600;
    color: #fbbf24;
    cursor: pointer;
    display: flex; align-items: center; gap: 6px;
}
.balance-tag:hover { text-decoration: underline; }

/* 头像 */
.avatar-trigger {
    width: 32px; height: 32px;
    border-radius: 50%;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid rgba(255,255,255,0.2);
}
.avatar-trigger img { width: 100%; height: 100%; object-fit: cover; }

/* 功能中心下拉菜单容器 */
.dropdown-trigger {
    position: relative;
    display: flex;
    align-items: center;
    height: 100%;
}

/* 用户信息下拉菜单容器 */
.user-profile-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    height: 100%;
}

/* 下拉菜单 */
.dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: #1e293b;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    min-width: 200px;
    width: max-content;
    z-index: 9999;
    overflow: hidden;
    animation: fadeIn 0.2s ease-out;
}

/* 修复：增加下拉菜单的悬停区域 */
.user-profile-wrapper:hover .dropdown-menu,
.dropdown-menu:hover {
    display: block;
}

/* 同样修复功能中心的下拉菜单 */
.dropdown-trigger:hover .dropdown-menu,
.dropdown-menu:hover {
    display: block;
}

/* 创建悬停连接区域 - 关键修复 */
.dropdown-trigger::after,
.user-profile-wrapper::after {
    content: '';
    position: absolute;
    top: 100%;
    left: -20px;
    right: -20px;
    height: 20px;
    background: transparent;
    z-index: 9998;
}

.menu-header { 
    padding: 15px; 
    background: rgba(0,0,0,0.2);
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.user-name { font-weight: bold; color: white; }
.user-email { font-size: 12px; color: #94a3b8; }

.menu-item {
    display: flex; 
    align-items: center; 
    gap: 10px;
    padding: 12px 15px;
    color: #cbd5e1;
    text-decoration: none;
    font-size: 14px;
    transition: 0.2s;
    cursor: pointer;
}
.menu-item:hover { 
    background: rgba(255,255,255,0.1); 
    color: white; 
}
.menu-item.danger:hover { 
    background: rgba(239,68,68,0.15); 
    color: #ef4444; 
}
.menu-divider { 
    height: 1px; 
    background: rgba(255,255,255,0.1); 
    margin: 5px 0; 
}

/* 项目控制区 */
.project-controls {
    display: flex; 
    align-items: center; 
    gap: 8px;
    background: rgba(255,255,255,0.03); 
    padding: 4px 12px; 
    border-radius: 8px; 
    border: 1px solid var(--border);
}

.select-wrapper { 
    display: flex; 
    align-items: center; 
    gap: 8px; 
    color: var(--text-muted); 
    font-size: 13px; 
}
#global-project-select {
    background: transparent; 
    color: white; 
    border: none; 
    font-size: 13px; 
    cursor: pointer;
    max-width: 180px; 
    min-width: 120px;
}
#global-project-select:focus { outline: none; }
#global-project-select option { background: #1e293b; color: white; }

.btn-icon-only {
    width: 28px; 
    height: 28px; 
    border-radius: 6px; 
    border: none; 
    background: transparent;
    color: var(--text-muted); 
    cursor: pointer; 
    transition: 0.2s; 
    display: flex; 
    align-items: center; 
    justify-content: center;
}
.btn-icon-only:hover { 
    background: rgba(255,255,255,0.1); 
    color: white; 
}

.divider-v { 
    width: 1px; 
    height: 16px; 
    background: var(--border); 
    margin: 0 4px; 
}
.path-display { 
    font-family: 'JetBrains Mono'; 
    font-size: 11px; 
    color: #60a5fa; 
    opacity: 0.8; 
    max-width: 200px; 
    overflow: hidden; 
    white-space: nowrap; 
    text-overflow: ellipsis; 
}

.top-controls { 
    display: flex; 
    gap: 10px; 
}

/* 通用按钮样式 */
.btn-ghost {
    background: rgba(255,255,255,0.05); 
    border: 1px solid transparent; 
    color: var(--text-muted);
    padding: 6px 12px; 
    border-radius: 6px; 
    font-size: 13px; 
    cursor: pointer; 
    transition: 0.2s;
    display: flex; 
    align-items: center; 
    gap: 6px;
    white-space: nowrap;
}
.btn-ghost:hover { 
    background: rgba(255,255,255,0.1); 
    color: white; 
    border-color: rgba(255,255,255,0.1); 
}

/* 带图标的文字按钮 */
.btn-icon-text {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    color: var(--text-muted);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
    height: 36px;
    white-space: nowrap;
    flex-shrink: 0;
    min-width: 120px;
    justify-content: center;
}

.btn-icon-text:hover {
    background: rgba(255,255,255,0.1);
    color: white;
    border-color: rgba(255,255,255,0.2);
}

/* 登录按钮特殊样式 */
#login-btn {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border: none;
    color: white !important;
    padding: 6px 16px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 36px;
    white-space: nowrap;
    min-width: 100px;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

#login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
    filter: brightness(1.1);
}

/* 霓虹按钮增强版 */
.btn-primary-glow {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border: none;
    border-radius: 8px;
    padding: 8px 16px;
    color: white;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    height: 36px;
    white-space: nowrap;
    flex-shrink: 0;
}

.btn-primary-glow:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.6);
    filter: brightness(1.1);
}

.btn-primary-glow:active {
    transform: translateY(0);
}

/* === 主工作区 === */
.workspace { 
    display: flex; 
    height: calc(100vh - 60px);
    overflow: hidden;
}

/* 左侧侧边栏 */
.sidebar {
    width: var(--sidebar-width);
    height: 100%;
    background: var(--bg-sidebar);
    backdrop-filter: blur(20px);
    border-right: 1px solid var(--border);
    display: flex; 
    flex-direction: column; 
    gap: 20px;
    padding: 20px;
    overflow-y: auto;
    overflow-x: hidden;
    padding-bottom: 60px;
}

.agent-group { 
    display: flex; 
    flex-direction: column; 
    gap: 8px; 
}
.group-title { 
    font-size: 10px; 
    font-weight: 700; 
    color: var(--text-muted); 
    text-transform: uppercase; 
    letter-spacing: 1px; 
    margin-bottom: 4px; 
    padding-left: 4px; 
    transition: all 0.2s; 
}

/* 侧边栏迷你卡片 */
.mini-card {
    display: flex; 
    align-items: center; 
    gap: 12px;
    padding: 10px; 
    border-radius: 8px;
    background: rgba(255,255,255,0.02); 
    border: 1px solid transparent;
    cursor: grab; 
    transition: all 0.2s;
    position: relative;
    user-select: none;
    -webkit-user-select: none;
    -webkit-user-drag: element;
}
.mini-card:hover { 
    background: rgba(255,255,255,0.05); 
    transform: translateX(4px); 
    border-color: rgba(255,255,255,0.1); 
}
.mini-card:active { cursor: grabbing; }
.mini-card.active { 
    background: rgba(99, 102, 241, 0.15); 
    border-color: var(--primary); 
}
.mini-card.active .status { color: var(--primary); }

.icon-box {
    width: 32px; 
    height: 32px; 
    border-radius: 8px;
    display: flex; 
    align-items: center; 
    justify-content: center;
    font-size: 14px;
}

/* 角色配色定义 */
.role-pm { background: rgba(168, 85, 247, 0.15); color: var(--color-pm); }
.role-ui { background: rgba(236, 72, 153, 0.15); color: var(--color-ui); }
.role-product { background: rgba(244, 63, 94, 0.15); color: var(--color-product); }
.role-dev { background: rgba(59, 130, 246, 0.15); color: var(--color-dev); }
.role-backend { background: rgba(16, 185, 129, 0.15); color: var(--color-backend); }
.role-qa { background: rgba(245, 158, 11, 0.15); color: var(--color-qa); }
.role-idea { background: rgba(234, 179, 8, 0.15); color: var(--color-idea); }

/* 文字配色 */
.role-pm-color { color: var(--color-pm); }
.role-ui-color { color: var(--color-ui); }
.role-product-color { color: var(--color-product); }
.role-dev-color { color: var(--color-dev); }
.role-backend-color { color: var(--color-backend); }
.role-qa-color { color: var(--color-qa); }
.role-idea-color { color: var(--color-idea); }

.info { 
    display: flex; 
    flex-direction: column; 
    gap: 2px; 
}
.info .name { 
    font-size: 13px; 
    font-weight: 500; 
}
.info .status { 
    font-size: 10px; 
    color: var(--text-muted); 
}

/* === 主舞台 (Stage) === */
.stage {
    flex: 1;
    height: 100%;
    padding: 20px;
    position: relative;
    overflow: hidden;
    background: radial-gradient(circle at center, rgba(99, 102, 241, 0.03), transparent 70%);
    perspective: 1000px;
}

/* 九宫格模式 */
.stage.grid-mode {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    grid-auto-rows: minmax(250px, auto);
    gap: 20px;
    overflow-y: auto;
    align-items: start;
    padding: 20px;
}

/* 单窗口模式 */
.stage:not(.grid-mode) {
    display: block !important;
    position: relative !important;
    overflow-y: auto !important;
    padding: 20px !important;
    width: 100% !important;
    height: 100% !important;
}

.stage:not(.grid-mode) .window-card {
    width: 100% !important;
    height: 100% !important;
    min-height: 500px;  /* 给个合理的最小高度，或改成 calc(100vh - 100px) 根据你的布局 */
    position: relative !important;
}

/* === 窗口卡片 === */
.window-card {
    background: var(--bg-panel);
    backdrop-filter: var(--glass);
    border: 1px solid var(--border);
    border-radius: 12px;
    display: flex; 
    flex-direction: column;
    overflow: hidden;
    width: 100%; 
    height: 100%;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    animation: zoomIn 0.3s ease-out;
}
@keyframes zoomIn { 
    from { opacity: 0; transform: scale(0.95); } 
    to { opacity: 1; transform: scale(1); } 
}

.stage.grid-mode .window-card {
    animation: none;
    font-size: 0.9em;
}
.stage.grid-mode .window-card .input-box { 
    min-height: 40px; 
    height: 60px; 
}
.stage.grid-mode .window-card .output-box { display: none; }
.stage.grid-mode .window-card.zoomed {
    position: absolute; 
    top: 20px; 
    left: 20px; 
    right: 20px; 
    bottom: 20px;
    z-index: 100;
    width: auto; 
    height: auto;
    box-shadow: 0 0 100px rgba(0,0,0,0.8);
}
.stage.grid-mode .window-card.zoomed .output-box { display: block; }

.card-header {
    height: 44px; 
    padding: 0 16px;
    background: rgba(0,0,0,0.2);
    border-bottom: 1px solid var(--border);
    display: flex; 
    justify-content: space-between; 
    align-items: center;
    user-select: none;
}

.title { 
    display: flex; 
    align-items: center; 
    gap: 8px; 
    font-weight: 600; 
    font-size: 13px; 
}
.model-tag {
    background: rgba(255,255,255,0.05); 
    color: var(--text-muted); 
    padding: 2px 8px; 
    border-radius: 4px; 
    font-size: 10px; 
    font-family: monospace;
}
.window-controls { 
    display: flex; 
    gap: 10px; 
    color: var(--text-muted); 
    cursor: pointer; 
    opacity: 0; 
    transition: 0.2s; 
}
.window-card:hover .window-controls { opacity: 1; }
.window-controls:hover { color: white; }

.card-body {
    flex: 1; 
    padding: 16px; 
    display: flex; 
    flex-direction: column; 
    gap: 12px; 
    overflow: hidden;
}

.input-box {
    background: rgba(0,0,0,0.2); 
    border: 1px solid var(--border); 
    border-radius: 8px;
    color: var(--text-main); 
    padding: 10px; 
    font-family: 'JetBrains Mono'; 
    font-size: 13px;
    resize: none; 
    min-height: 80px; 
    flex-shrink: 0;
}
.input-box:focus { 
    outline: none; 
    border-color: var(--primary); 
    background: rgba(0,0,0,0.4); 
}

.tools-bar {
    display: flex; 
    align-items: center; 
    gap: 8px;
    padding: 4px; 
    background: rgba(255,255,255,0.02); 
    border-radius: 6px; 
    border: 1px solid var(--border);
}
.btn-tool {
    background: transparent; 
    border: none; 
    color: var(--text-muted);
    padding: 4px 10px; 
    border-radius: 4px; 
    font-size: 12px; 
    cursor: pointer; 
    transition: 0.2s;
    display: flex; 
    align-items: center; 
    gap: 6px;
}
.btn-tool:hover { 
    background: rgba(255,255,255,0.1); 
    color: white; 
}
.btn-tool.action { 
    background: var(--primary); 
    color: white; 
    box-shadow: 0 0 10px var(--primary-glow); 
}
.btn-tool.action:hover { filter: brightness(1.1); }

.output-box {
    flex: 1; 
    background: #050505; 
    border-radius: 8px; 
    border: 1px solid var(--border);
    padding: 12px; 
    overflow: auto;
    font-family: 'JetBrains Mono'; 
    font-size: 12px; 
    color: #d4d4d4; 
    line-height: 1.6;
}

/* 空状态 */
.empty-state { 
    text-align: center; 
    color: var(--text-muted); 
    opacity: 0.5; 
}
.empty-state i { 
    font-size: 48px; 
    margin-bottom: 20px; 
    display: block; 
}

/* === 底部控制台 === */
.console-panel {
    position: fixed; 
    bottom: 0; 
    left: 0; 
    right: 0; 
    z-index: 100;
    background: rgba(10,10,10,0.95); 
    border-top: 1px solid #333;
    transition: transform 0.3s;
}
.console-header {
    height: 30px; 
    padding: 0 15px; 
    background: #151515; 
    font-size: 11px; 
    color: #888;
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    cursor: pointer;
}
.console-header:hover { color: #ccc; }
.console-body { 
    height: 180px; 
    display: flex; 
    flex-direction: column; 
}
.console-panel.collapsed .console-body { display: none; }
.console-output {
    flex: 1; 
    padding: 10px 15px; 
    overflow-y: auto; 
    font-family: 'JetBrains Mono'; 
    font-size: 12px;
}
.log-item { 
    padding: 2px 0; 
    white-space: pre-wrap; 
    word-break: break-word; 
}
.log-item.info { color: #60a5fa; }
.log-item.success { color: #34d399; }
.log-item.warning { color: #fbbf24; }
.log-item.error { color: #f87171; }
.console-input-wrapper {
    display: flex; 
    align-items: center; 
    gap: 10px; 
    padding: 8px 15px; 
    border-top: 1px solid #333;
    background: rgba(0,0,0,0.3);
}
.prompt-char { color: #34d399; font-weight: bold; }
#console-cmd {
    flex: 1; 
    background: transparent; 
    border: none; 
    color: white; 
    font-family: 'JetBrains Mono'; 
    font-size: 13px;
}
#console-cmd:focus { outline: none; }

/* 修复下拉框 */
select, option {
    background-color: #1e293b !important;
    color: #f8fafc !important;
}
select {
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23a5b4fc%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 8px top 50%;
    background-size: 10px auto;
    padding-right: 24px;
}

/* 模态框 */
@keyframes fadeIn { 
    from { opacity: 0; } 
    to { opacity: 1; } 
}
@keyframes modalSlideIn {
    from { opacity: 0; transform: translateY(-30px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-backdrop {
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%;
    background: rgba(0, 0, 0, 0.8); 
    backdrop-filter: blur(8px);
    z-index: 9999; 
    display: flex; 
    align-items: center; 
    justify-content: center;
    animation: fadeIn 0.2s ease-out; 
    opacity: 0; 
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
.modal-backdrop.show { 
    opacity: 1; 
    visibility: visible; 
}
.modal-panel {
    background: linear-gradient(135deg, #1e293b, #0f172a);
    border: 1px solid rgba(99, 102, 241, 0.3); 
    border-radius: 16px; 
    padding: 30px;
    width: 400px; 
    max-width: 90vw;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.05), 0 0 40px rgba(99, 102, 241, 0.2);
    display: flex; 
    flex-direction: column; 
    gap: 20px;
    transform: translateY(20px); 
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    opacity: 0; 
    animation: zoomIn 0.2s ease-out;
}
.modal-backdrop.show .modal-panel { 
    transform: translateY(0); 
    opacity: 1; 
}
.modal-header { 
    display: flex; 
    justify-content: space-between; 
    align-items: flex-start; 
    margin-bottom: 5px; 
}
.modal-header h3 {
    margin: 0; 
    font-size: 18px; 
    color: #f8fafc; 
    font-weight: 700;
    background: linear-gradient(to right, #818cf8, #c084fc); 
    -webkit-background-clip: text; 
    -webkit-text-fill-color: transparent;
}
.modal-close {
    background: rgba(255, 255, 255, 0.05); 
    border: 1px solid rgba(255, 255, 255, 0.1); 
    border-radius: 8px;
    color: #94a3b8; 
    cursor: pointer; 
    width: 32px; 
    height: 32px; 
    display: flex; 
    align-items: center; 
    justify-content: center;
    font-size: 14px; 
    transition: all 0.2s ease; 
    margin: -8px -8px 0 0;
}
.modal-close:hover { 
    background: rgba(239, 68, 68, 0.2); 
    border-color: rgba(239, 68, 68, 0.4); 
    color: #f87171; 
    transform: rotate(90deg); 
}
.modal-input {
    background: rgba(0, 0, 0, 0.3); 
    border: 1px solid rgba(255, 255, 255, 0.1); 
    padding: 14px 16px; 
    border-radius: 10px;
    color: #f8fafc; 
    font-size: 14px; 
    font-family: 'Inter', sans-serif; 
    width: 100%; 
    outline: none; 
    transition: all 0.2s;
}
.modal-input:focus { 
    border-color: #6366f1; 
    background: rgba(0, 0, 0, 0.4); 
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2); 
}
.modal-input::placeholder { color: rgba(148, 163, 184, 0.6); }
.modal-footer { 
    display: flex; 
    justify-content: flex-end; 
    gap: 12px; 
    margin-top: 10px; 
}
.modal-footer .btn { 
    padding: 10px 24px; 
    border-radius: 8px; 
    font-weight: 600; 
    font-size: 14px; 
    cursor: pointer; 
    transition: all 0.2s; 
    min-width: 80px; 
    text-align: center; 
}
.modal-footer .btn-ghost { 
    background: rgba(255, 255, 255, 0.05); 
    border: 1px solid rgba(255, 255, 255, 0.1); 
    color: #cbd5e1; 
}
.modal-footer .btn-ghost:hover { 
    background: rgba(255, 255, 255, 0.1); 
    border-color: rgba(255, 255, 255, 0.2); 
    color: #ffffff; 
    transform: translateY(-2px); 
}
.modal-footer .btn-primary-glow { 
    background: linear-gradient(135deg, #6366f1, #8b5cf6); 
    border: none; 
    color: white; 
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4); 
}
.modal-footer .btn-primary-glow:hover { 
    background: linear-gradient(135deg, #8b5cf6, #6366f1); 
    transform: translateY(-2px); 
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.6); 
}
.modal-footer .btn:active { transform: translateY(0); }

/* 结果区域工具栏 */
.result-toolbar {
    border-radius: 6px;
}
.btn-mini {
    background: rgba(255,255,255,0.1);
    border: none;
    color: #94a3b8;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex; 
    align-items: center; 
    gap: 5px;
}
.btn-mini:hover {
    background: rgba(99, 102, 241, 0.3);
    color: white;
}

/* === 拖拽高亮特效 === */
.mini-card.dragging {
    opacity: 0.5;
    border: 2px dashed #6366f1;
    transform: scale(0.95);
}
.mini-card.drag-over {
    background: rgba(168, 85, 247, 0.2);
    border: 2px solid #a855f7;
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(168, 85, 247, 0.4);
    position: relative;
    z-index: 10;
}
.mini-card.drag-over::after {
    content: "⚡ 融合";
    position: absolute;
    top: -20px;
    right: 0;
    background: #a855f7;
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: bold;
}
.merged-window {
    border: 1px solid #818cf8 !important;
    box-shadow: 0 0 30px rgba(99, 102, 241, 0.15) !important;
}
.fusion-indicator {
    background: rgba(99, 102, 241, 0.1);
    border: 1px dashed #6366f1;
    color: #818cf8;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* === 删除按钮 (Hover) === */
.mini-card .btn-unlink {
    position: absolute;
    top: 5px;
    right: 5px;
    font-size: 10px;
    color: #aaa;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.2s;
    z-index: 10;
}
.mini-card:hover .btn-unlink { opacity: 1; }
.mini-card .btn-unlink:hover { 
    transform: scale(1.2); 
    text-shadow: 0 0 5px #ef4444; 
}

/* 溶解动画 */
@keyframes dissolve {
    0% { opacity: 1; transform: scale(1); filter: blur(0); }
    100% { opacity: 0; transform: scale(0.8); filter: blur(10px); }
}
.mini-card.dissolving {
    animation: dissolve 0.5s forwards;
    pointer-events: none;
}

/* === 全息仓库 (Holo-Deck) === */
.holo-deck {
    margin-top: 30px;
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 10px;
}
.holo-header {
    font-size: 11px;
    color: #6366f1;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    display: flex; justify-content: space-between;
    padding: 8px 0;
}
.holo-header:hover { text-shadow: 0 0 5px #6366f1; }

.holo-content {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    background: rgba(0,0,0,0.2);
    border-radius: 8px;
}
.holo-content.open {
    max-height: 300px;
    padding: 10px;
    overflow-y: auto;
    border: 1px dashed rgba(99,102,241,0.3);
}

.holo-card {
    background: rgba(255,255,255,0.05);
    border: 1px solid transparent;
    border-radius: 4px;
    padding: 6px;
    font-size: 11px;
    display: flex; align-items: center; gap: 5px;
    cursor: grab;
    user-select: none;
}
.holo-card:hover { border-color: #6366f1; }

/* 警告色 */
.token-progress-value.warning { background: #f59e0b; }
.token-progress-value.danger { background: #ef4444; }

/* 菜单 */
#features-menu {
    animation: fadeIn 0.2s ease-out;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.2s, transform 0.2s;
}
#features-menu[style*="display: block"] {
    opacity: 1;
    transform: translateY(0);
}

/* 拖拽光标 */
[draggable="true"] { cursor: grab !important; -webkit-user-drag: element !important; }
[draggable="true"]:hover { cursor: grab !important; }
[draggable="true"]:active, .mini-card.dragging { cursor: grabbing !important; }

/* 分组标题高亮 (接收拖拽) */
.agent-group .group-title.droppable-active {
    background: rgba(168, 85, 247, 0.1);
    border: 1px dashed #a855f7;
    padding: 15px; 
    margin: 5px 0;
    border-radius: 8px;
    transition: all 0.2s;
}
.agent-group .group-title.drag-over-target {
    background: rgba(168, 85, 247, 0.3);
    border: 2px solid #a855f7;
    color: #fff;
    transform: scale(1.02);
    box-shadow: 0 0 15px rgba(168, 85, 247, 0.5);
}

/* 工作流控制面板动画 */
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.4); }
  70% { box-shadow: 0 0 0 10px rgba(99, 102, 241, 0); }
  100% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0); }
}

/* 工作流按钮样式 */
.btn-workflow {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  border: none;
  color: white;
  padding: 8px 16px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s;
  animation: pulse 2s infinite;
}

.btn-workflow:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(99, 102, 241, 0.3);
}

/* 步骤状态指示器 */
.step-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  margin-right: 8px;
}

.step-status.pending {
  background: rgba(107, 114, 128, 0.2);
  color: #9ca3af;
}

.step-status.running {
  background: rgba(99, 102, 241, 0.2);
  color: #818cf8;
}

.step-status.completed {
  background: rgba(16, 185, 129, 0.2);
  color: #10b981;
}

/* 角色特定颜色 */
.role-analyst { background: linear-gradient(135deg, #3b82f6, #1d4ed8); }
.role-creative { background: linear-gradient(135deg, #8b5cf6, #7c3aed); }
.role-writer { background: linear-gradient(135deg, #10b981, #059669); }
.role-copy { background: linear-gradient(135deg, #f59e0b, #d97706); }
.role-optimizer { background: linear-gradient(135deg, #ec4899, #db2777); }
.role-seo { background: linear-gradient(135deg, #06b6d4, #0891b2); }
.role-social { background: linear-gradient(135deg, #f97316, #ea580c); }

/* 滚动条 */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: rgba(0, 0, 0, 0.1); border-radius: 3px; }
::-webkit-scrollbar-thumb { background: rgba(99, 102, 241, 0.3); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(99, 102, 241, 0.6); }

/* 响应式 */
@media (max-width: 768px) {
    .modal-panel { width: 90%; padding: 24px; }
    .modal-footer { flex-direction: column; }
    .modal-footer .btn { width: 100%; }
    
    /* 移动端下拉菜单调整 */
    .dropdown-menu {
        position: fixed;
        top: 60px;
        right: 10px;
        left: auto;
        width: 250px;
    }
    
    .dropdown-trigger::after,
    .user-profile-wrapper::after {
        display: none;
    }
}
@media (max-width: 480px) {
    .modal-panel { width: 95%; padding: 20px; }
    .modal-header h3 { font-size: 16px; }
}
/* === 修复删除按钮悬停效果 === */
/* 使用属性选择器覆盖内联样式 */
.mini-card .btn-unlink[style] {
    transition: all 0.3s ease !important;
}

.mini-card:hover .btn-unlink[style] {
    opacity: 0.8 !important;
    color: #ef4444 !important;
}

.mini-card .btn-unlink[style]:hover {
    opacity: 1 !important;
    color: #ff0000 !important;
    transform: scale(1.2) !important;
}
