:root {
    --user-bg: #e1f5fe;
    --assistant-bg: #f1f3f4;
    --border-color: #ddd;
}

body {
    font-family: "Noto Sans SC", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
    background-color: #f8f9fa;
    color: #333;
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}

.container {
    width: 100%;
    max-width: 800px;
    height: 95vh;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.settings-header {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
    background: #fff;
}

.setting-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

label {
    font-weight: 500;
    font-size: 14px;
}

input[type="password"],
select {
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 14px;
}

.chat-window {
    flex-grow: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.message {
    max-width: 80%;
    padding: 12px 18px;
    border-radius: 18px;
    line-height: 1.5;
    word-wrap: break-word;
    position: relative;
}

.user-message {
    background-color: var(--user-bg) !important;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.assistant-message {
    background-color: var(--assistant-bg) !important;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    padding-bottom: 40px;
}

.chat-form {
    display: flex;
    padding: 15px;
    border-top: 1px solid var(--border-color);
    gap: 10px;
}

.chat-form textarea {
    flex-grow: 1;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    resize: none;
    font-size: 16px;
    line-height: 1.4;
    max-height: 100px;
    /* 限制文本域最大高度 */
}

.chat-form button {
    background-color: #1a73e8;
    color: white;
    padding: 0 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s;
}

.chat-form button:hover {
    background-color: #1558b8;
}

.chat-form button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

.markdown-body {
    font-family: "Noto Sans SC", sans-serif !important;
}

.markdown-body pre {
    position: relative;
}

.markdown-body pre .markdown-body code {
    font-family: "Fira Code", monospace, "Noto Sans SC" !important;
}

.copy-btn {
    position: absolute;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 32px;
    height: 32px;
    background-color: rgba(241, 243, 244, 0.8);
    /* 使用稍微不透明的背景 */
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    cursor: pointer;
    color: #5f6368;
    opacity: 0;
    transition: opacity 0.2s ease-in-out, background-color 0.2s;
    /* 确保图标字体不会被继承的字体覆盖 */
    font-family: 'Material Icons';
}

.copy-btn:hover {
    background-color: #e8eaed;
    color: #202124;
}

/* 新增：控制 Material Icons 的样式 */
.copy-btn .material-icons {
    font-size: 18px;
    /* 使用 font-size 控制图标大小 */
    user-select: none;
    /* 防止用户意外选中文本图标 */
}

/* 代码块复制按钮的具体定位 */
.copy-code-btn {
    top: 8px;
    right: 8px;
}

.markdown-body pre:hover .copy-code-btn {
    opacity: 1;
}

/* 完整消息复制按钮的具体定位 */
.copy-message-btn {
    bottom: 8px;
    right: 8px;
}

.assistant-message:hover .copy-message-btn {
    opacity: 1;
}