/**
 * AI创作坊面板 · 侧栏内模式与会话样式
 * 模式切换、聊天外壳、模式横幅、会话操作与下拉
 * 独立命名空间 ai-workshop-*，不与其他面板共用，保证面板独立性
 * 字体：Microsoft YaHei，符合项目字体规范
 */

/* 模式切换区：图标按钮，顶部与聊天区域视觉融合 */
.ai-workshop-mode-tabs {
    display: flex;
    align-items: stretch;
    padding: 6px 10px 2px;
    gap: 6px;
    background-color: #232327;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.ai-workshop-mode-tab {
    flex: 1 1 0;
    min-width: 0;
    height: 40px;
    border: none;
    outline: none;
    border-radius: 10px;
    background: transparent;
    cursor: pointer;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 4px 6px;
    color: #d0d0d0;
    font-family: "Microsoft YaHei", "微软雅黑", "SimSun", "宋体", "Arial", sans-serif;
    font-size: 11px;
    line-height: 1.2;
    transition: background-color 0.15s ease, color 0.15s ease, transform 0.12s ease, box-shadow 0.15s ease;
}

.ai-workshop-mode-tab:hover {
    background-color: rgba(255, 255, 255, 0.04);
    color: #ffffff;
}

.ai-workshop-mode-tab.is-active {
    background-color: #2f3136;
    color: #ffffff;
    box-shadow: none;
    border-radius: 10px 10px 0 0; /* 仅顶部圆角，底部直角，使绿色修饰条为直线 */
    border-bottom: 3px solid #6b8cff;
}

.ai-workshop-mode-text {
    font-size: 11px;
    white-space: nowrap;
}

/* 聊天整体容器：填满剩余空间 */
.ai-workshop-chat-shell {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding: 6px 10px 10px;
    gap: 6px;
    background-color: #232327;
}

/* 顶部模式提示条，与模式切换联动；绿框仅包住「当前模式」文字，右侧工具在绿框外 */
.ai-workshop-chat-mode-banner {
    min-height: 26px;
    padding: 4px 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #e0f7eb;
    font-size: 11px;
}

/* 绿色底框仅包裹「当前模式：xxx」文字 */
.ai-workshop-chat-mode-label {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 8px;
    background: linear-gradient(to right, rgba(107, 140, 255, 0.15), rgba(107, 140, 255, 0.02));
    border: 1px solid rgba(107, 140, 255, 0.5);
    font-weight: 500;
}

/* 模式提示条右侧：会话操作区（新建、保存、会话记录下拉），独立类名不与其他面板通用 */
.ai-workshop-session-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
    flex-shrink: 0;
}

.ai-workshop-session-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 24px;
    padding: 0 6px;
    border: none;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.08);
    color: #e0f7eb;
    font-family: "Microsoft YaHei", "微软雅黑", "SimSun", "宋体", "Arial", sans-serif;
    font-size: 12px;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.ai-workshop-session-btn:hover {
    background: rgba(107, 140, 255, 0.35);
    color: #ffffff;
}

.ai-workshop-session-btn:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(107, 140, 255, 0.5);
}

.ai-workshop-session-btn-icon {
    font-size: 14px;
    line-height: 1;
}

/* 保存图标：单色 SVG，与按钮文字色一致 */
.ai-workshop-session-icon-save {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.ai-workshop-session-icon-save svg {
    display: block;
    color: inherit;
}
.ai-workshop-session-icon-save svg path,
.ai-workshop-session-icon-save svg polyline {
    stroke: currentColor;
}

.ai-workshop-session-btn-text {
    margin-right: 2px;
}

.ai-workshop-session-dropdown-arrow {
    font-size: 10px;
    opacity: 0.9;
}

.ai-workshop-session-dropdown-wrap {
    position: relative;
}

.ai-workshop-session-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 4px;
    min-width: 200px;
    max-height: 280px;
    overflow-y: auto;
    background-color: #26272d;
    border: 1px solid rgba(107, 140, 255, 0.4);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    z-index: 20;
    scrollbar-width: thin;
    scrollbar-color: rgba(107, 140, 255, 0.5) rgba(255, 255, 255, 0.06);
}

.ai-workshop-session-dropdown::-webkit-scrollbar {
    width: 6px;
}

.ai-workshop-session-dropdown::-webkit-scrollbar-thumb {
    background: rgba(107, 140, 255, 0.5);
    border-radius: 3px;
}

.ai-workshop-session-dropdown-list {
    padding: 4px 0;
}

.ai-workshop-session-dropdown-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 8px 12px;
    border: none;
    border-radius: 0;
    background: transparent;
    color: #e0f7eb;
    font-family: "Microsoft YaHei", "微软雅黑", "SimSun", "宋体", "Arial", sans-serif;
    font-size: 12px;
    text-align: left;
    line-height: 1.3;
    transition: background-color 0.12s ease;
    gap: 8px;
}

.ai-workshop-session-dropdown-item:hover {
    background: rgba(107, 140, 255, 0.2);
}

/* 左侧：标题+时间，点击加载会话 */
.ai-workshop-session-dropdown-item-content {
    flex: 1 1 auto;
    min-width: 0;
    cursor: pointer;
}

.ai-workshop-session-dropdown-item-title {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ai-workshop-session-dropdown-item-time {
    display: block;
    font-size: 10px;
    color: rgba(224, 247, 235, 0.7);
    margin-top: 2px;
}

/* 右侧：删除按钮，仅悬停该条记录时显示 */
.ai-workshop-session-dropdown-item-delete {
    flex-shrink: 0;
    padding: 2px 8px;
    border: none;
    border-radius: 4px;
    background: rgba(200, 80, 80, 0.25);
    color: #f5c6c6;
    font-family: "Microsoft YaHei", "微软雅黑", "SimSun", "宋体", "Arial", sans-serif;
    font-size: 11px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.15s ease, background-color 0.15s ease;
}

.ai-workshop-session-dropdown-item:hover .ai-workshop-session-dropdown-item-delete {
    opacity: 1;
}

.ai-workshop-session-dropdown-item-delete:hover {
    background: rgba(200, 80, 80, 0.45);
    color: #ffffff;
}

.ai-workshop-session-dropdown-empty {
    padding: 12px;
    color: rgba(224, 247, 235, 0.6);
    font-size: 12px;
    text-align: center;
    display: none;
}

.ai-workshop-session-dropdown-empty.is-visible {
    display: block;
}
