* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e0e0e0;
}

h1 {
    color: #2c3e50;
    font-size: 1.8rem;
}

.model-selector {
    display: flex;
    align-items: center;
    gap: 10px;
}

#model {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: white;
    font-size: 14px;
}

/* 按钮基础样式 */
.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    color: white;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

/* 主要按钮样式 */
.btn-primary {
    background-color: #3498db;
}

.btn-primary:hover {
    background-color: #2980b9;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(52, 152, 219, 0.3);
}

/* 次要按钮样式 */
.btn-secondary {
    background-color: #95a5a6;
}

.btn-secondary:hover {
    background-color: #7f8c8d;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(149, 165, 166, 0.4);
}

.btn-secondary:active {
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(149, 165, 166, 0.3);
}

/* 成功按钮样式 */
.btn-success {
    background-color: #2ecc71;
}

.btn-success:hover {
    background-color: #27ae60;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(46, 204, 113, 0.4);
}

.btn-success:active {
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(46, 204, 113, 0.3);
}

#change-api-key {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    color: white;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    background-color: #95a5a6;
}

#change-api-key:hover {
    background-color: #7f8c8d;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(149, 165, 166, 0.4);
}

#change-api-key:active {
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(149, 165, 166, 0.3);
}

main {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    max-height: calc(100vh - 200px);
}

.message {
    margin-bottom: 15px;
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 18px;
    word-break: break-word;
}

.user-message {
    background-color: #dcf8c6;
    margin-left: auto;
    border-bottom-right-radius: 4px;
}

.bot-message {
    background-color: #e5e5ea;
    border-bottom-left-radius: 4px;
}

.message-author {
    font-weight: bold;
    margin-bottom: 4px;
    font-size: 14px;
}

.input-area {
    display: flex;
    padding: 15px;
    border-top: 1px solid #e0e0e0;
}

#user-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-radius: 4px;
    resize: none;
    font-size: 16px;
    height: 60px;
}

#send-btn {
    padding: 8px 20px;
    border: none;
    border-radius: 4px;
    color: white;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    background-color: #2ecc71;
    margin-left: 10px;
}

#send-btn:hover {
    background-color: #27ae60;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(46, 204, 113, 0.4);
}

#send-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(46, 204, 113, 0.3);
}

#export-chat {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    color: white;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    background-color: #3498db;
}

#export-chat:hover {
    background-color: #2980b9;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.4);
}

#export-chat:active {
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(52, 152, 219, 0.3);
}

footer {
    text-align: center;
    padding-top: 20px;
    color: #7f8c8d;
    font-size: 14px;
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    h1 {
        font-size: 1.5rem;
    }
    .model-selector {
        flex-direction: column;
        align-items: flex-end;
    }
    .message {
        max-width: 90%;
    }
}

.loading-indicator {
    display: inline-block;
    width: 15px;
    height: 15px;
    border: 2px solid rgba(0,0,0,0.3);
    border-radius: 50%;
    border-top-color: #000;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.api-key-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background-color: white;
    padding: 25px;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    text-align: center;
}

#api-key-input {
    width: 100%;
    padding: 12px;
    margin: 15px 0;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

#save-api-key {
    padding: 10px 25px;
    background-color: #2ecc71;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
}

#save-api-key:hover {
    background-color: #27ae60;
}

/* 列表样式 */
ol {
    padding-left: 25px;
    margin: 10px 0;
}

ul {
    padding-left: 25px;
    margin: 10px 0;
}

li {
    margin-bottom: 5px;
}

/* 代码块样式 */
pre {
    background-color: #f5f5f5;
    padding: 15px;
    border-radius: 4px;
    overflow-x: auto;
    margin: 10px 0;
}

code {
    font-family: 'Courier New', Courier, monospace;
    font-size: 14px;
}

/* 引用样式 */
blockquote {
    border-left: 4px solid #3498db;
    padding-left: 15px;
    margin: 10px 0;
    color: #7f8c8d;
}