/**
 * AI创作面板 · 聊天工具基础样式
 * 独立命名空间 ai-create-chat-*，不与其他面板共用
 * 字体：Microsoft YaHei，符合项目字体规范
 */

.ai-create-chat-shell {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1 1 auto;
    min-height: 0;
}

.ai-create-chat-mode-tabs {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 6px;
}

.ai-create-chat-mode-tab {
    appearance: none;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
    color: rgba(255, 255, 255, 0.86);
    font-size: 12px;
    line-height: 1.2;
    padding: 6px 10px;
    border-radius: 10px;
    cursor: pointer;
    user-select: none;
    font-family: "Microsoft YaHei", "微软雅黑", "SimSun", "宋体", Arial, sans-serif;
}

.ai-create-chat-mode-tab:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.18);
}

.ai-create-chat-mode-tab.is-active {
    background: rgba(37, 99, 235, 0.22);
    border-color: rgba(37, 99, 235, 0.55);
    color: rgba(255, 255, 255, 0.95);
}

.ai-create-chat-mode-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: space-between;
}

.ai-create-chat-mode-label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.72);
    font-family: "Microsoft YaHei", "微软雅黑", "SimSun", "宋体", Arial, sans-serif;
}

.ai-create-chat-session-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ai-create-chat-session-btn {
    width: 30px;
    height: 30px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
    color: rgba(255, 255, 255, 0.86);
    cursor: pointer;
    font-family: "Microsoft YaHei", "微软雅黑", "SimSun", "宋体", Arial, sans-serif;
}

.ai-create-chat-session-btn:hover {
    background: rgba(255, 255, 255, 0.06);
}

.ai-create-chat-session-btn-dropdown {
    width: auto;
    padding: 0 10px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

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

.ai-create-chat-session-dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    width: 320px;
    max-width: 70vw;
    background: rgba(24, 26, 31, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.55);
    padding: 8px;
    z-index: 20;
    box-sizing: border-box;
}

.ai-create-chat-session-dropdown-list {
    max-height: 260px;
    overflow: auto;
}

.ai-create-chat-session-dropdown-empty {
    display: none;
    padding: 10px 8px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.55);
}
.ai-create-chat-session-dropdown-empty.is-visible {
    display: block;
}

.ai-create-chat-session-dropdown-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.02);
    margin-bottom: 6px;
}

.ai-create-chat-session-dropdown-item-content {
    flex: 1;
    min-width: 0;
    cursor: pointer;
}

.ai-create-chat-session-dropdown-item-title {
    display: block;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.9);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ai-create-chat-session-dropdown-item-time {
    display: block;
    margin-top: 2px;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.55);
}

.ai-create-chat-session-dropdown-item-delete {
    flex: 0 0 auto;
    padding: 4px 8px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
    color: rgba(255, 255, 255, 0.75);
    cursor: pointer;
    font-size: 12px;
}

.ai-create-chat-session-dropdown-item-delete:hover {
    border-color: rgba(232, 92, 92, 0.55);
    background: rgba(232, 92, 92, 0.14);
    color: rgba(255, 255, 255, 0.9);
}

/* 中部聊天内容区域：微信式左右对话布局，可滚动 */
.ai-create-chat-body {
    flex: 1 1 auto;
    min-height: 0;
    border-radius: 10px;
    background-color: #18181b;
    padding: 8px 10px;
    overflow-y: auto;
    overflow-x: hidden;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
    scrollbar-width: thin;
    scrollbar-color: rgba(107, 140, 255, 0.5) rgba(255, 255, 255, 0.06);
}
.ai-create-chat-body::-webkit-scrollbar { width: 8px; }
.ai-create-chat-body::-webkit-scrollbar-track { background: rgba(255, 255, 255, 0.06); border-radius: 4px; }
.ai-create-chat-body::-webkit-scrollbar-thumb { background: rgba(107, 140, 255, 0.5); border-radius: 4px; }
.ai-create-chat-body::-webkit-scrollbar-thumb:hover { background: rgba(107, 140, 255, 0.7); }

.ai-create-chat-message {
    display: flex;
    align-items: flex-start;
    margin-bottom: 8px;
    max-width: 100%;
}
.ai-create-chat-message.is-ai { justify-content: flex-start; }
.ai-create-chat-message.is-user { justify-content: flex-end; flex-direction: row; }

.ai-create-chat-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background-color: #2f3136;
    color: #ffffff;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 6px;
}
.ai-create-chat-message.is-user .ai-create-chat-avatar {
    margin-right: 0;
    margin-left: 6px;
    background-color: #6b8cff;
}

.ai-create-chat-bubble {
    max-width: 78%;
    border-radius: 10px;
    padding: 6px 8px;
    font-size: 12px;
    line-height: 1.5;
}
.ai-create-chat-message.is-ai .ai-create-chat-bubble { background-color: #26272d; color: #f5f5f5; }
.ai-create-chat-message.is-user .ai-create-chat-bubble { background-color: #6b8cff; color: #ffffff; text-align: right; margin-left: auto; }

.ai-create-chat-name { display: none; }

.ai-create-chat-text { font-size: 12px; word-break: break-word; }

/* Markdown 层级样式 */
.ai-create-chat-text .ai-create-chat-md-h1,
.ai-create-chat-text .ai-create-chat-md-h2,
.ai-create-chat-text .ai-create-chat-md-h3 {
    font-family: "Microsoft YaHei", "微软雅黑", "SimSun", "宋体", "Arial", sans-serif;
    font-weight: bold;
    color: #f5f5f5;
    margin: 0.75em 0 0.35em;
    line-height: 1.3;
}
.ai-create-chat-text .ai-create-chat-md-h1 { font-size: 16px; }
.ai-create-chat-text .ai-create-chat-md-h2 { font-size: 14px; }
.ai-create-chat-text .ai-create-chat-md-h3 { font-size: 13px; }
.ai-create-chat-text .ai-create-chat-md-p { margin: 0.4em 0; line-height: 1.55; }
.ai-create-chat-text .ai-create-chat-md-p:first-child { margin-top: 0; }
.ai-create-chat-text .ai-create-chat-md-p:last-child { margin-bottom: 0; }
.ai-create-chat-text .ai-create-chat-md-list { margin: 0.5em 0; padding-left: 1.5em; }
.ai-create-chat-text .ai-create-chat-md-list li { margin: 0.25em 0; line-height: 1.5; }
.ai-create-chat-text strong { font-weight: bold; color: #f5f5f5; }
.ai-create-chat-text em { font-style: italic; }
.ai-create-chat-text code {
    font-family: Consolas, "Courier New", monospace;
    font-size: 11px;
    padding: 0.15em 0.4em;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.25);
}

.ai-create-chat-input-area { margin-top: 2px; }

.ai-create-chat-input {
    width: 100%;
    min-height: 60px;
    max-height: 96px;
    padding: 6px 8px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background-color: #141417;
    color: #f5f5f5;
    resize: vertical;
    font-family: "Microsoft YaHei", "微软雅黑", "SimSun", "宋体", "Arial", sans-serif;
    font-size: 12px;
    line-height: 1.5;
    outline: none;
    box-sizing: border-box;
}
.ai-create-chat-input::placeholder { color: #777777; }
.ai-create-chat-input:focus { border-color: rgba(107, 140, 255, 0.85); box-shadow: 0 0 0 1px rgba(107, 140, 255, 0.4); }

.ai-create-chat-footer {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 2px;
}

.ai-create-chat-model-select-wrapper {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: #cccccc;
    font-family: "Microsoft YaHei", "微软雅黑", "SimSun", "宋体", Arial, sans-serif;
}
.ai-create-chat-model-select-label { white-space: nowrap; }
.ai-create-chat-model-select {
    flex: 1 1 auto;
    min-width: 0;
    height: 28px;
    padding: 2px 8px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background-color: #141417;
    color: #f5f5f5;
    font-family: "Microsoft YaHei", "微软雅黑", "SimSun", "宋体", "Arial", sans-serif;
    font-size: 12px;
    outline: none;
}
.ai-create-chat-model-select:focus { border-color: rgba(107, 140, 255, 0.85); }

.ai-create-chat-send-btn {
    flex: 0 0 auto;
    min-width: 68px;
    height: 30px;
    padding: 0 14px;
    border-radius: 16px;
    border: none;
    outline: none;
    background-color: #6b8cff;
    color: #ffffff;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 8px rgba(107, 140, 255, 0.4);
    transition: background-color 0.15s ease, transform 0.12s ease, box-shadow 0.15s ease;
    font-family: "Microsoft YaHei", "微软雅黑", "SimSun", "宋体", Arial, sans-serif;
}
.ai-create-chat-send-btn:hover { background-color: #5578ee; transform: translateY(-1px); box-shadow: 0 4px 10px rgba(107, 140, 255, 0.6); }
.ai-create-chat-send-btn:active { transform: translateY(0); box-shadow: 0 2px 6px rgba(107, 140, 255, 0.45); }
.ai-create-chat-send-btn:disabled { background-color: #3a3d42; box-shadow: none; cursor: default; opacity: 0.7; }

.ai-create-chat-stop-btn {
    flex: 0 0 auto;
    min-width: 60px;
    height: 30px;
    padding: 0 12px;
    border-radius: 16px;
    border: none;
    outline: none;
    background-color: #e85c5c;
    color: #ffffff;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 8px rgba(232, 92, 92, 0.45);
    transition: background-color 0.15s ease, transform 0.12s ease, box-shadow 0.15s ease, opacity 0.15s ease;
    font-family: "Microsoft YaHei", "微软雅黑", "SimSun", "宋体", Arial, sans-serif;
}
.ai-create-chat-stop-btn:hover { background-color: #d94b4b; transform: translateY(-1px); box-shadow: 0 4px 10px rgba(232, 92, 92, 0.65); }
.ai-create-chat-stop-btn:active { transform: translateY(0); box-shadow: 0 2px 6px rgba(232, 92, 92, 0.4); }
.ai-create-chat-stop-btn:disabled { background-color: #3f3a3a; box-shadow: none; cursor: default; opacity: 0.7; }

