/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    height: 100vh;
    overflow: hidden;
}

.container {
    display: flex;
    height: 100vh;
    max-width: 1600px;
    margin: 0 auto;
    padding: 20px;
    gap: 20px;
}

/* 侧边栏 */
.sidebar {
    width: 320px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 24px;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.logo {
    text-align: center;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
}

.logo h1 {
    font-size: 24px;
    color: #2d5016;
    margin-bottom: 8px;
}

.logo p {
    font-size: 14px;
    color: #666;
}

/* 等级卡片 */
.level-card {
    background: linear-gradient(135deg, #43a047 0%, #66bb6a 100%);
    color: white;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
}

.level-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-size: 18px;
    font-weight: bold;
}

.progress-bar {
    height: 8px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-fill {
    height: 100%;
    background: white;
    border-radius: 4px;
    transition: width 0.3s ease;
}

.level-next {
    font-size: 12px;
    opacity: 0.9;
}

/* 统计卡片 */
.stats-card, .achievements-card {
    background: #f5f5f5;
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 16px;
}

.stats-card h3, .achievements-card h3 {
    font-size: 16px;
    color: #333;
    margin-bottom: 12px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #e0e0e0;
}

.stat-item:last-child {
    border-bottom: none;
}

.stat-item span {
    color: #666;
    font-size: 14px;
}

.stat-item strong {
    color: #43a047;
    font-size: 16px;
}

/* 成就进度 */
.achievement-progress {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    font-size: 18px;
    font-weight: bold;
    color: #333;
}

/* 按钮 */
.btn-primary, .btn-secondary {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.btn-primary {
    background: linear-gradient(135deg, #43a047 0%, #66bb6a 100%);
    color: white;
    width: 100%;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(67, 160, 71, 0.4);
}

.btn-secondary {
    background: white;
    color: #43a047;
    border: 2px solid #43a047;
    width: 100%;
    margin-bottom: 8px;
}

.btn-secondary:hover {
    background: #43a047;
    color: white;
}

.actions {
    margin-top: 16px;
}

/* 聊天区域 */
.chat-area {
    flex: 1;
    background: white;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.chat-header {
    padding: 20px 24px;
    background: linear-gradient(135deg, #43a047 0%, #66bb6a 100%);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-header h2 {
    font-size: 20px;
}

.mode-selector {
    display: flex;
    align-items: center;
    gap: 8px;
}

.mode-selector label {
    font-size: 14px;
}

.mode-selector select {
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    background: white;
    color: #333;
}

/* 聊天消息区 */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    background: #f9f9f9;
}

.welcome-message {
    text-align: center;
    padding: 40px 20px;
}

.welcome-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.welcome-message h2 {
    color: #2d5016;
    margin-bottom: 12px;
}

.welcome-message p {
    color: #666;
    margin-bottom: 8px;
    line-height: 1.6;
}

.quick-questions {
    margin-top: 24px;
}

.quick-questions p {
    font-weight: bold;
    margin-bottom: 12px;
}

.quick-btn {
    padding: 10px 20px;
    margin: 4px;
    background: white;
    border: 2px solid #43a047;
    border-radius: 20px;
    color: #43a047;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.quick-btn:hover {
    background: #43a047;
    color: white;
}

/* 消息气泡 */
.message {
    margin-bottom: 16px;
    display: flex;
    gap: 12px;
    animation: fadeIn 0.3s ease;
}

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

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

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.message.user .message-avatar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.message.assistant .message-avatar {
    background: linear-gradient(135deg, #43a047 0%, #66bb6a 100%);
}

.message-content {
    max-width: 70%;
    padding: 12px 16px;
    border-radius: 12px;
    line-height: 1.6;
    position: relative;
}

.message.user .message-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.message.assistant .message-content {
    background: white;
    color: #333;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.message-mode {
    font-size: 11px;
    opacity: 0.7;
    margin-bottom: 4px;
}

.message-text {
    white-space: pre-wrap;
    word-wrap: break-word;
}

.message-actions {
    margin-top: 8px;
    display: flex;
    gap: 8px;
}

.message-action-btn {
    padding: 4px 8px;
    font-size: 11px;
    background: rgba(0, 0, 0, 0.05);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.message-action-btn:hover {
    background: rgba(0, 0, 0, 0.1);
}

/* 输入区 */
.chat-input-area {
    padding: 20px 24px;
    background: white;
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 12px;
}

#messageInput {
    flex: 1;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    resize: none;
    font-family: inherit;
    transition: border-color 0.3s ease;
}

#messageInput:focus {
    outline: none;
    border-color: #43a047;
}

#sendBtn {
    width: 120px;
}

/* 加载动画 */
.loading {
    display: inline-block;
}

.loading::after {
    content: '...';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: white;
    margin: 5% auto;
    padding: 32px;
    border-radius: 16px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}

.close {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 28px;
    font-weight: bold;
    color: #999;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close:hover {
    color: #333;
}

.achievement-summary {
    display: flex;
    gap: 24px;
    margin: 24px 0;
    justify-content: center;
}

.summary-item {
    text-align: center;
}

.summary-number {
    font-size: 36px;
    font-weight: bold;
    color: #43a047;
}

.summary-label {
    font-size: 14px;
    color: #666;
    margin-top: 4px;
}

.achievement-list {
    display: grid;
    gap: 12px;
}

.achievement-item {
    padding: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.3s ease;
}

.achievement-item.unlocked {
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
}

.achievement-item.locked {
    background: #f5f5f5;
    opacity: 0.6;
}

.achievement-icon {
    font-size: 32px;
}

.achievement-info {
    flex: 1;
}

.achievement-name {
    font-weight: bold;
    color: #333;
    margin-bottom: 4px;
}

.achievement-desc {
    font-size: 12px;
    color: #666;
}

.achievement-points {
    font-size: 14px;
    font-weight: bold;
    color: #43a047;
}

/* 成就通知 */
.achievement-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    z-index: 2000;
    display: none;
    animation: slideIn 0.5s ease;
}

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

.notification-content {
    display: flex;
    align-items: center;
    gap: 16px;
}

.notification-icon {
    font-size: 48px;
}

.notification-title {
    font-size: 18px;
    font-weight: bold;
    color: #43a047;
    margin-bottom: 4px;
}

.notification-desc {
    font-size: 14px;
    color: #666;
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #43a047;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #2d5016;
}

/* 响应式 */
@media (max-width: 1024px) {
    .sidebar {
        width: 280px;
    }
}

@media (max-width: 768px) {
    .container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        height: auto;
        max-height: 40vh;
    }

    .message-content {
        max-width: 85%;
    }
}

/* 图片生成相关样式 */
.scene-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}

.scene-item {
    padding: 16px;
    background: #f5f5f5;
    border: 2px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.scene-item:hover {
    background: #e8f5e9;
    border-color: #43a047;
    transform: translateY(-2px);
}

.scene-item.selected {
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    border-color: #43a047;
}

.scene-icon {
    font-size: 32px;
    margin-bottom: 8px;
}

.scene-name {
    font-weight: bold;
    color: #333;
    margin-bottom: 4px;
}

.scene-desc {
    font-size: 12px;
    color: #666;
}

.image-result {
    display: none;
    text-align: center;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
}

.image-result.show {
    display: block;
}

.image-result img {
    max-width: 100%;
    border-radius: 8px;
    margin-bottom: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.image-prompt {
    font-size: 12px;
    color: #666;
    margin-top: 12px;
    padding: 12px;
    background: white;
    border-radius: 6px;
    text-align: left;
}

.image-actions {
    margin-top: 16px;
    display: flex;
    gap: 8px;
    justify-content: center;
}

.image-actions button {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.btn-download {
    background: #43a047;
    color: white;
}

.btn-download:hover {
    background: #2d5016;
}

.btn-regenerate {
    background: #2196F3;
    color: white;
}

.btn-regenerate:hover {
    background: #1976D2;
}

