/* GeorgeAI 门户外壳：核心功能 / 系统设置 */
.george-portal-root {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
    background: #f5f7fa;
}

.george-top-nav {
    flex-shrink: 0;
    height: 3.5rem;
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    padding: 0 1.25rem;
    gap: 1.5rem;
    z-index: 30;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.george-top-nav-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    font-size: 1.125rem;
    color: #1f2937;
    text-decoration: none;
    flex-shrink: 0;
}

.george-top-nav-brand img {
    width: 1.75rem;
    height: 1.75rem;
    object-fit: contain;
}

.george-top-nav-tabs {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-left: auto;
}

.george-top-nav-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #6b7280;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}

.george-top-nav-tab:hover {
    background: #f3f4f6;
    color: #374151;
}

.george-top-nav-tab.active {
    background: transparent;
    color: #2563eb;
    box-shadow: inset 0 -2px 0 #2563eb;
    border-radius: 0.5rem 0.5rem 0 0;
}

.george-portal-body {
    flex: 1;
    display: flex;
    min-height: 0;
    overflow: hidden;
}

.george-portal-sidebar {
    width: 14rem;
    flex-shrink: 0;
    background: #fff;
    border-right: 1px solid #e5e7eb;
    overflow-y: auto;
    padding: 0.75rem 0;
}

.george-portal-sidebar-title {
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.george-portal-menu-item {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    width: 100%;
    padding: 0.625rem 1rem;
    margin: 0.125rem 0.5rem;
    width: calc(100% - 1rem);
    border: none;
    background: transparent;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    color: #374151;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.george-portal-menu-item i {
    width: 1rem;
    text-align: center;
    color: #6b7280;
}

.george-portal-menu-item:hover {
    background: #f3f4f6;
}

.george-portal-menu-item.active {
    background: #eff6ff;
    color: #2563eb;
    font-weight: 500;
}

.george-portal-menu-item.active i {
    color: #2563eb;
}

.george-portal-menu-item.disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.george-portal-menu-group {
    margin-bottom: 0.5rem;
}

.george-portal-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    background: #f5f7fa;
}

.george-portal-iframe {
    flex: 1;
    width: 100%;
    border: none;
    background: #fff;
}

.george-portal-placeholder {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 0.75rem;
    color: #9ca3af;
    font-size: 0.9375rem;
}

/* 工作台顶栏：与门户顶栏同高，主区 agent 标题在其下方 */
.george-workbench-shell {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

.george-workbench-body {
    flex: 1;
    display: flex;
    min-height: 0;
    overflow: hidden;
}

.george-workbench-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
}

/* 智能体组侧栏 */
.agent-group-item {
    border-radius: 0.5rem;
    overflow: hidden;
}

.agent-group-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: none;
    background: transparent;
    text-align: left;
    cursor: pointer;
    font-size: 0.875rem;
    color: #374151;
    transition: background 0.15s;
}

.agent-group-header:hover {
    background: #f3f4f6;
}

.agent-group-header.active {
    background: #eff6ff;
    color: #2563eb;
    font-weight: 500;
}

.agent-group-sessions {
    padding: 0.25rem 0 0.5rem 1.75rem;
}

.agent-group-new-chat {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.5rem;
    margin-bottom: 0.25rem;
    border: none;
    background: transparent;
    color: #2563eb;
    font-size: 0.8125rem;
    cursor: pointer;
    border-radius: 0.375rem;
}

.agent-group-new-chat:hover {
    background: #eff6ff;
}

.agent-group-session-list {
    max-height: 12rem;
    overflow-y: auto;
}

.agent-group-session-item {
    display: block;
    width: 100%;
    padding: 0.375rem 0.5rem;
    border: none;
    background: transparent;
    text-align: left;
    font-size: 0.8125rem;
    color: #6b7280;
    cursor: pointer;
    border-radius: 0.375rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.agent-group-session-item:hover {
    background: #f3f4f6;
    color: #374151;
}

.agent-group-session-item.active {
    background: #dbeafe;
    color: #1d4ed8;
    font-weight: 500;
}

/* 工作台：智能体行 + 新建对话 */
.agent-row {
    display: flex;
    align-items: center;
    gap: 0.125rem;
    min-width: 0;
}

.agent-row .agent-item {
    flex: 1;
    min-width: 0;
}

.agent-new-chat-btn {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    border: none;
    border-radius: 0.375rem;
    background: transparent;
    color: #2563eb;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.agent-new-chat-btn:hover {
    background: #eff6ff;
    color: #1d4ed8;
}

/* 工作台：右上角最近对话下拉 */
.home-recent-sessions-menu {
    position: relative;
}

.home-recent-sessions-panel {
    position: absolute;
    top: calc(100% + 0.375rem);
    right: 0;
    z-index: 40;
    width: min(20rem, calc(100vw - 2rem));
    max-height: min(24rem, calc(100vh - 8rem));
    overflow-y: auto;
    padding: 0.5rem;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
}

.home-recent-sessions-panel .session-item,
.home-recent-sessions-panel [data-session-id] {
    border-radius: 0.375rem;
}

/* 工作台：敬城智能体独立区块 */
.home-primary-agent-slot {
    min-height: 2.5rem;
}

.home-primary-agent-row {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 0.625rem;
    padding: 0.125rem 0.25rem;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.home-primary-agent-row.is-active {
    border-color: #93c5fd;
    box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.1);
}

.home-primary-agent-btn {
    font-weight: 500;
    color: #1e40af;
}

.home-primary-agent-btn:hover {
    background: rgba(255, 255, 255, 0.55);
}

.home-primary-agent-btn.active {
    background: transparent;
}
