/**
 * 聊天窗口面板 - 基础样式
 * 包含：CSS变量定义、面板容器、滚动条、布局容器
 * 独立样式（仅本面板使用，不与其他面板通用）
 * 字体：Microsoft YaHei（符合项目字体规范）
 */

/* 深色主题色值（中性深灰基色，无蓝紫偏色；仅按钮/焦点用蓝紫强调） */
#chat-window.panel-content {
    --cw-bg-deep: #141414;      /* 最深背景（消息区、输入框内），纯中性灰 */
    --cw-bg-page: #161616;      /* 页面/主背景 */
    --cw-bg-panel: #1e1e1e;     /* 侧栏、顶栏、底栏 */
    --cw-border: #2e2e2e;
    --cw-border-subtle: #262626;
    --cw-text: #e8e8e8;
    --cw-text-title: #f0f0f0;
    --cw-text-muted: #909090;
    --cw-accent: #5c6efc;       /* 仅用于焦点边框、发送按钮 */
    --cw-btn-send: #5c6efc;
    --cw-btn-send-hover: #6d7cfd;
    --cw-hover: #282828;
    --cw-active: #2a2a2a;       /* 选中会话项 */
    --cw-icon-bg: #383838;      /* 头像、工具栏图标占位 */
    --cw-scroll-track: #252525;
    --cw-scroll-thumb: #404040;
    --cw-scroll-thumb-hover: #4a4a4a;
}

/* 主站面板容器：仅在激活时显示，避免切换其他面板时因选择器优先级导致聊天窗口短暂露出 */
#chat-window.panel-content.active {
    height: 100%;
    display: flex;
    flex-direction: column;
    min-height: 0;
    background: var(--cw-bg-page, #161616);
    border-radius: 8px;
    overflow: hidden;
}

/* 面板根容器：占满主内容区高度，四周边框与个人文件面板风格一致 */
.chat-window-panel {
    font-family: "Microsoft YaHei", "微软雅黑", "SimSun", "宋体", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--cw-text, #e8e8e8);
    background: var(--cw-bg-page, #161616);
    height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    border-radius: 8px;
    border: 1px solid var(--cw-border, rgba(255, 255, 255, 0.1));
    overflow: hidden;
    box-sizing: border-box;
}

.chat-window-panel * {
    box-sizing: border-box;
}

/* 滚动条（深色） */
.chat-window-panel,
.chat-window-panel * {
    scrollbar-color: var(--cw-scroll-thumb) var(--cw-scroll-track);
    scrollbar-width: thin;
}
.chat-window-panel ::-webkit-scrollbar { width: 8px; height: 8px; }
.chat-window-panel ::-webkit-scrollbar-track { background: var(--cw-scroll-track); border-radius: 4px; }
.chat-window-panel ::-webkit-scrollbar-thumb { background: var(--cw-scroll-thumb); border-radius: 4px; }
.chat-window-panel ::-webkit-scrollbar-thumb:hover { background: var(--cw-scroll-thumb-hover); }

.chat-window-panel .chat-window-layout {
    display: flex;
    flex: 1;
    min-height: 0;
}

/* 浮动聊天窗口模式：作为独立浮窗悬浮在主内容之上 */
#chat-window.chat-window-float-mode {
    position: fixed;
    top: 0;
    left: 0;
    transform: none;
    z-index: 120000;
    border-radius: 8px;
    border: 1px solid var(--cw-border, rgba(255, 255, 255, 0.1));
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.6);
    background: var(--cw-bg-page, #161616);
    display: flex;
    flex-direction: column;
    min-width: 1100px;
    min-height: 700px;
    resize: both;
    overflow: hidden;
}

/* 浮动窗口标题栏作为拖拽区域，鼠标指针显示为移动手势 */
.chat-window-panel .chat-window-header.chat-window-float-draggable {
    cursor: move;
}

.chat-window-panel .chat-window-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.chat-window-panel .chat-window-header .chat-window-title {
    min-width: 0;
    flex: 1;
}

.chat-window-panel .chat-window-header-actions {
    display: none;
    align-items: center;
    flex-shrink: 0;
}

#chat-window.chat-window-float-mode .chat-window-header-actions {
    display: inline-flex;
}

.chat-window-panel .chat-window-header-minimize-btn {
    width: 28px;
    height: 28px;
    padding: 0;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--cw-text-muted, #909090);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.chat-window-panel .chat-window-header-minimize-btn:hover {
    background: var(--cw-hover, #282828);
    color: var(--cw-text, #e8e8e8);
}

