/* Chat页面样式 */

.chat-container {
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* 登录界面 */
.login-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.login-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 40px;
    width: 100%;
    max-width: 400px;
    animation: slideIn 0.5s ease;
}

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

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header .logo {
    font-size: 64px;
    margin-bottom: 10px;
}

.login-header h1 {
    font-size: 2em;
    margin: 10px 0;
    color: #667eea;
}

.login-header .subtitle {
    color: #666;
    font-size: 1em;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-weight: 600;
    color: #333;
}

.form-group input {
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1em;
    transition: all 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 10px rgba(102, 126, 234, 0.2);
}

.login-btn {
    padding: 14px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

.login-btn:active {
    transform: translateY(0);
}

.error {
    text-align: center;
    color: #e74c3c;
    font-weight: 500;
    font-size: 0.9em;
    margin: 0;
}

/* 聊天界面 */
.chat-screen {
    display: none;
    flex-direction: column;
    min-height: 100vh;
}

.chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 20px;
    background: rgba(255, 255, 255, 0.5);
}

.chat-header {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.chat-title {
    font-size: 1.5em;
    font-weight: 600;
    color: #667eea;
}

.chat-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.refresh-btn {
    padding: 8px 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.9em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.refresh-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 3px 10px rgba(102, 126, 234, 0.3);
}

.refresh-btn:active {
    transform: translateY(0);
}

.chat-status {
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-dot {
    width: 12px;
    height: 12px;
    background: #4CAF50;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.status-text {
    color: #4CAF50;
    font-weight: 600;
}

/* 消息列表 */
.message-list {
    flex: 1;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    overflow-y: auto;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    max-height: calc(100vh - 300px);
}

.message {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 15px;
    border-radius: 12px;
    animation: fadeIn 0.3s ease;
}

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

.message.user {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    align-items: flex-end;
    margin-left: 20%;
}

.message.assistant {
    background: #f8f9fa;
    color: #333;
    align-items: flex-start;
    margin-right: 20%;
}

.message-header {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    font-size: 0.85em;
}

.message.user .message-header {
    justify-content: flex-end;
}

.message-role {
    font-weight: 600;
}

.message-time {
    opacity: 0.7;
}

.message-content {
    width: 100%;
    line-height: 1.6;
    word-wrap: break-word;
}

/* 输入区域 */
.input-area {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    gap: 15px;
    align-items: flex-end;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.input-area textarea {
    flex: 1;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    resize: none;
    font-family: inherit;
    font-size: 1em;
    transition: all 0.3s ease;
    min-height: 80px;
}

.input-area textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 10px rgba(102, 126, 234, 0.2);
}

.send-btn {
    padding: 12px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 100px;
}

.send-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

.send-btn:active:not(:disabled) {
    transform: translateY(0);
}

.send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 退出按钮 */
.nav-item.logout {
    background: #e74c3c;
    color: white;
}

.nav-item.logout:hover {
    background: #c0392b;
}

/* 空状态 */
.loading, .empty {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 40px 20px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .login-card {
        padding: 30px 20px;
    }

    .message.user {
        margin-left: 10%;
    }

    .message.assistant {
        margin-right: 10%;
    }

    .input-area {
        flex-direction: column;
        align-items: stretch;
    }

    .send-btn {
        min-width: auto;
    }

    .chat-header {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .login-card {
        padding: 25px 15px;
    }

    .login-header h1 {
        font-size: 1.5em;
    }

    .message.user {
        margin-left: 0;
    }

    .message.assistant {
        margin-right: 0;
    }
}
