/**
 * DeepSeek 聊天界面样式
 */

/* 聊天容器 */
.deepseek-chat-container {
    width: 100%;
    max-width: 800px;
    margin: 20px auto;
    background-color: rgba(10, 25, 47, 0.7);
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.3);
    display: flex;
    flex-direction: column;
    height: 70vh;
    min-height: 500px;
    position: relative;
    overflow: hidden;
}

/* 输入容器 */
.deepseek-input-container {
    display: flex;
    padding: 10px;
    background-color: rgba(10, 25, 47, 0.5);
    border-top: 1px solid rgba(0, 255, 255, 0.2);
    gap: 10px;
}

/* 输入框 */
.deepseek-input {
    flex: 1;
    padding: 12px 15px;
    border: 1px solid rgba(0, 255, 255, 0.3);
    border-radius: 8px;
    background-color: rgba(10, 25, 47, 0.8);
    color: #fff;
    font-size: 16px;
    outline: none;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.deepseek-input:focus {
    border-color: rgba(0, 255, 255, 0.7);
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.3);
}

/* 按钮容器 */
.deepseek-button-container {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 10px;
}

/* 发送按钮和清空按钮 */
.deepseek-send-button,
.deepseek-clear-button {
    display: none;
    padding: 8px 15px;
    min-width: 80px;
    background-color: rgba(0, 255, 255, 0.3);
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
    text-align: center;
}

.deepseek-send-button:hover,
.deepseek-clear-button:hover {
    background-color: rgba(0, 255, 255, 0.5);
}

.deepseek-send-button:active,
.deepseek-clear-button:active {
    transform: scale(0.98);
}

/* 聊天历史区域 */
.deepseek-chat-history {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 255, 255, 0.5) rgba(10, 25, 47, 0.3);
}

.deepseek-chat-history::-webkit-scrollbar {
    width: 6px;
}

.deepseek-chat-history::-webkit-scrollbar-track {
    background: rgba(10, 25, 47, 0.3);
}

.deepseek-chat-history::-webkit-scrollbar-thumb {
    background-color: rgba(0, 255, 255, 0.5);
    border-radius: 3px;
}

/* 消息样式 */
.deepseek-message {
    padding: 12px 15px;
    border-radius: 8px;
    max-width: 85%;
    animation: fadeIn 0.3s ease-in-out;
    text-align: left;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 用户消息 */
.deepseek-message.user {
    align-self: flex-end;
    background-color: rgba(0, 255, 255, 0.2);
    border-bottom-right-radius: 2px;
}

/* 助手消息 */
.deepseek-message.assistant {
    align-self: flex-start;
    background-color: rgba(255, 255, 255, 0.1);
    border-bottom-left-radius: 2px;
}

/* 系统消息 */
.deepseek-message.system {
    align-self: center;
    background-color: rgba(255, 255, 255, 0.05);
    font-style: italic;
    max-width: 90%;
}

/* 错误消息 */
.deepseek-message.error {
    align-self: center;
    background-color: rgba(255, 0, 0, 0.2);
    color: #ff6b6b;
    max-width: 90%;
}

/* API加载错误提示 */
.deepseek-error {
    padding: 20px;
    background-color: rgba(255, 0, 0, 0.2);
    color: #ff6b6b;
    border-radius: 8px;
    text-align: center;
    margin: 20px;
    border: 1px solid rgba(255, 0, 0, 0.3);
}

/* 加载中状态 */
.deepseek-message.loading .deepseek-message-content::after {
    content: "";
    display: inline-block;
    width: 15px;
    animation: loadingDots 1.5s infinite;
}

@keyframes loadingDots {
    0% { content: "."; }
    33% { content: ".."; }
    66% { content: ""; }
    100% { content: "."; }
}

/* 消息发送者 */
.deepseek-message-sender {
    text-align: left;
    font-weight: bold;
    margin-bottom: 5px;
    font-size: 0.9em;
    opacity: 0.8;
}

/* 消息内容 */
.deepseek-message-content {
    line-height: 1.5;
    word-break: break-word;
}

/* 输入区域 */
.deepseek-input-container {
    display: block;
    padding: 15px;
    background-color: rgba(10, 25, 47, 0.9);
    border-top: 1px solid rgba(0, 255, 255, 0.2);
    gap: 10px;
}

/* 输入框 */
.deepseek-input {
    flex: 1;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid rgba(0, 255, 255, 0.3);
    background-color: rgba(255, 255, 255, 0.05);
    color: #fff;
    resize: none;
    font-family: inherit;
    font-size: 14px;
    transition: border-color 0.3s;
    height: 70%;
}

.deepseek-input:focus {
    outline: none;
    border-color: rgba(0, 255, 255, 0.8);
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.2);
}

/* 发送按钮 */
.deepseek-send-button {
    padding: 0 20px;
    background: linear-gradient(135deg, #00b3b3, #008080);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s;
}

.deepseek-send-button:hover {
    background: linear-gradient(135deg, #00cccc, #009999);
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
}

.deepseek-send-button:disabled {
    background: #555;
    cursor: not-allowed;
    opacity: 0.6;
}

/* 设置按钮 */
.deepseek-settings-button {
    width: 40px;
    height: 40px;
    background-color: rgba(10, 25, 47, 0.8);
    border: 1px solid rgba(0, 255, 255, 0.5);
    border-radius: 8px;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.3s;
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.3);
}

.deepseek-settings-button:hover {
    background-color: rgba(0, 255, 255, 0.1);
    border-color: rgba(0, 255, 255, 0.6);
    transform: scale(1.1);
}

/* 设置面板 */
.deepseek-settings-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    max-width: 400px;
    background-color: rgba(20, 35, 60, 0.95);
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 0 30px rgba(0, 255, 255, 0.3);
    z-index: 2000;
    animation: fadeIn 0.3s ease-out;
    border: 1px solid rgba(0, 255, 255, 0.5);
}

.deepseek-settings-panel h3 {
    margin-top: 0;
    color: rgba(0, 255, 255, 0.9);
    text-align: center;
    margin-bottom: 20px;
}

.deepseek-settings-panel form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.deepseek-settings-panel label {
    display: block;
    margin-bottom: 5px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
}

.deepseek-settings-panel input {
    width: 100%;
    padding: 10px;
    border-radius: 5px;
    border: 1px solid rgba(0, 255, 255, 0.3);
    background-color: rgba(255, 255, 255, 0.05);
    color: white;
    font-size: 14px;
}

.deepseek-settings-panel input:focus {
    outline: none;
    border-color: rgba(0, 255, 255, 0.8);
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.2);
}

.deepseek-settings-buttons {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-top: 10px;
}

.deepseek-settings-buttons button {
    flex: 1;
    padding: 10px;
    border-radius: 5px;
    border: none;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s;
}

.deepseek-settings-buttons button[type="submit"] {
    background: linear-gradient(135deg, #00b3b3, #008080);
    color: white;
}

.deepseek-settings-buttons button[type="submit"]:hover {
    background: linear-gradient(135deg, #00cccc, #009999);
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
}

.deepseek-settings-buttons button[type="button"] {
    background-color: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
}

.deepseek-settings-buttons button[type="button"]:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* 错误容器样式 */
.deepseek-error-container {
    padding: 20px;
    background-color: rgba(255, 0, 0, 0.1);
    border: 1px solid rgba(255, 0, 0, 0.3);
    border-radius: 8px;
    margin: 20px 0;
    text-align: center;
}

.deepseek-error-title {
    color: #ff6b6b;
    margin-bottom: 10px;
}

.deepseek-error-message {
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .deepseek-chat-container {
        height: 70vh;
        width: 95%;
    }
    
    .deepseek-message {
        max-width: 90%;
    }
    
    .deepseek-settings-panel {
        width: 90%;
    }
}