/* 全局样式 */
:root {
    --primary-color: #2d7de9;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --body-bg: #f5f8fa;
    --body-color: #333;
    --border-color: #dee2e6;
    --box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--body-color);
    background-color: var(--body-bg);
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s;
}

a:hover {
    color: #1a56a2;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* 导航栏 */
.navbar {
    background-color: #fff;
    box-shadow: var(--box-shadow);
    padding: 15px 0;
    margin-bottom: 30px;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo a {
    font-size: 24px;
    font-weight: bold;
    color: var(--primary-color);
}

.nav-links ul {
    display: flex;
    list-style: none;
}

.nav-links li {
    margin-left: 20px;
}

.nav-links a {
    color: var(--dark-color);
    font-weight: 500;
}

.nav-links a:hover {
    color: var(--primary-color);
}

/* AI聊天按钮和窗口样式 */
.ai-chat-floating-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 999;
    transition: all 0.3s ease;
}

.ai-chat-floating-btn i {
    font-size: 24px;
}

.ai-chat-floating-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.ai-chat-floating-btn:active {
    transform: translateY(0);
}

.ai-chat-modal {
    display: none;
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 350px;
    height: 500px;
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    overflow: hidden;
    transition: all 0.3s ease;
}

.ai-chat-modal.active {
    display: block;
    animation: slideIn 0.3s forwards;
}

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

.ai-chat-container {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.ai-chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background-color: var(--primary-color);
    color: white;
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
}

.ai-chat-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.ai-chat-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.ai-chat-messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    background-color: #f8f9fa;
}

.ai-message {
    display: flex;
    margin-bottom: 15px;
}

.user-message {
    flex-direction: row-reverse;
}

.ai-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
    margin-right: 10px;
}

.user-avatar {
    background-color: var(--success-color);
    margin-left: 10px;
    margin-right: 0;
}

.ai-content {
    max-width: 70%;
    padding: 10px 15px;
    background-color: white;
    border-radius: 18px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.user-content {
    background-color: var(--primary-color);
    color: white;
}

.ai-content p {
    margin: 0;
}

.ai-chat-input {
    display: flex;
    padding: 10px;
    background-color: white;
    border-top: 1px solid #e9e9e9;
}

.ai-chat-input textarea {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 20px;
    resize: none;
    outline: none;
    font-family: inherit;
    height: 40px;
    transition: height 0.2s;
}

.ai-chat-input textarea:focus {
    border-color: var(--primary-color);
    height: 60px;
}

#ai-chat-send {
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 20px;
    padding: 0 15px;
    margin-left: 10px;
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.2s;
}

#ai-chat-send:hover {
    background-color: #1a56a2;
}

.ai-typing {
    display: flex;
    align-items: center;
    padding: 5px 0;
    color: var(--secondary-color);
    font-style: italic;
}

.ai-typing .dot {
    width: 6px;
    height: 6px;
    background-color: var(--secondary-color);
    border-radius: 50%;
    margin: 0 2px;
    animation: typing 1.4s infinite;
}

.ai-typing .dot:nth-child(2) {
    animation-delay: 0.2s;
}

.ai-typing .dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
    }
    30% {
        transform: translateY(-5px);
    }
}

/* 模型设置页面样式 */
.api-key-card {
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
}

.api-key-card.active-model {
    border-left: 4px solid var(--primary-color);
    background-color: rgba(45, 125, 233, 0.05);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.settings-container h1 {
    color: var(--primary-color);
    margin-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 10px;
}

.settings-container .card {
    border: none;
    box-shadow: var(--box-shadow);
}

/* 按钮 */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
}

.btn:hover {
    transform: translateY(-2px);
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: #1a56a2;
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background-color: #5a6268;
}

.btn-success {
    background-color: var(--success-color);
    color: white;
}

.btn-success:hover {
    background-color: #218838;
}

.btn-danger {
    background-color: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background-color: #c82333;
}

.btn-full {
    width: 100%;
}

/* 表单 */
.form-group {
    margin-bottom: 20px;
}

.form-control {
    display: block;
    width: 100%;
    padding: 10px 15px;
    font-size: 16px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    transition: border-color 0.3s;
}

.form-control:focus {
    border-color: var(--primary-color);
    outline: none;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-help {
    display: block;
    margin-top: 5px;
    font-size: 14px;
    color: var(--secondary-color);
}

.form-error {
    color: var(--danger-color);
    font-size: 14px;
    margin-top: 5px;
}

/* 卡片 */
.card {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: var(--box-shadow);
    margin-bottom: 20px;
    overflow: hidden;
}

.card-header {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
}

.card-title {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.card-body {
    padding: 20px;
}

.card-footer {
    padding: 15px 20px;
    border-top: 1px solid var(--border-color);
    background-color: var(--light-color);
}

/* 提示框 */
.alert {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* 项目列表 */
.project-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.project-card {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.project-card .card-body {
    flex: 1;
}

.project-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

/* 预览和代码编辑器 */
.preview-container {
    margin: 20px 0;
    height: 500px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}

.preview-iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.code-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
}

.code-tab {
    padding: 10px 20px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
}

.code-tab.active {
    border-bottom-color: var(--primary-color);
    color: var(--primary-color);
    font-weight: 500;
}

.code-editor {
    min-height: 300px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 10px;
    font-family: monospace;
    margin-bottom: 20px;
    white-space: pre-wrap;
    overflow-x: auto;
}

/* 页脚 */
.footer {
    background-color: #fff;
    border-top: 1px solid var(--border-color);
    padding: 20px 0;
    margin-top: 50px;
    text-align: center;
    color: var(--secondary-color);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .navbar .container {
        flex-direction: column;
    }
    
    .nav-links {
        margin-top: 15px;
    }
    
    .nav-links ul {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .nav-links li {
        margin: 5px 10px;
    }
    
    .project-list {
        grid-template-columns: 1fr;
    }
} 