* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
}

.chat-container {
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 80vh;
    position: relative;
}

.chat-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-header h1 {
    font-size: 1.5em;
}

.reset-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid white;
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s;
}

.reset-btn:hover:not(:disabled) {
    background: white;
    color: #667eea;
}

.reset-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 加载动画样式 */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    transition: opacity 0.5s ease;
}

.loading-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.loading-content {
    text-align: center;
    padding: 40px;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    font-size: 1.5em;
    color: #667eea;
    margin-bottom: 10px;
    font-weight: bold;
}

.loading-subtext {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 20px;
}

.loading-progress {
    width: 200px;
    height: 8px;
    background: #f3f3f3;
    border-radius: 4px;
    margin: 0 auto;
    overflow: hidden;
}

.progress-bar {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 4px;
    animation: progress 2s ease-in-out infinite;
}

@keyframes progress {
    0% { width: 0%; }
    50% { width: 70%; }
    100% { width: 100%; }
}

.chat-box {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #f8f9fa;
}

.message {
    display: flex;
    margin-bottom: 15px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.message.user {
    justify-content: flex-end;
}

.message.robot {
    justify-content: flex-start;
}

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #667eea;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5em;
    margin: 0 10px;
}

.message.user .message-avatar {
    background: #764ba2;
}

.message-content {
    max-width: 70%;
    padding: 12px 18px;
    border-radius: 18px;
    background: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: relative;
}

.message.user .message-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.message-time {
    font-size: 0.75em;
    color: #999;
    text-align: right;
    margin-top: 5px;
}

.message.user .message-time {
    color: rgba(255, 255, 255, 0.8);
}

.input-container {
    display: flex;
    padding: 20px;
    background: white;
    border-top: 1px solid #eee;
}

.user-input {
    flex: 1;
    padding: 12px 20px;
    border: 2px solid #ddd;
    border-radius: 25px;
    font-size: 1em;
    outline: none;
    transition: border-color 0.3s;
}

.user-input:focus {
    border-color: #667eea;
}

.user-input:disabled {
    background: #f5f5f5;
    cursor: not-allowed;
}

.send-btn {
    margin-left: 10px;
    padding: 12px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 1em;
    cursor: pointer;
    transition: transform 0.2s;
}

.send-btn:hover:not(:disabled) {
    transform: scale(1.05);
}

.send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 状态面板 */
.status-panel {
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    height: fit-content;
}

.status-panel h3 {
    color: #667eea;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #eee;
}

.status-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #f5f5f5;
}

.status-label {
    color: #666;
}

.status-value {
    font-weight: bold;
}

.status-normal { color: #666; }
.status-info { color: #667eea; }
.status-warning { color: #f39c12; }
.status-danger { color: #e74c3c; }
.status-success { color: #27ae60; }

/* 思考面板 */
.thinking-panel {
    grid-column: 1 / -1;
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.thinking-panel h3 {
    color: #667eea;
    margin-bottom: 15px;
}

.thinking-content {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 10px;
    font-family: 'Consolas', monospace;
    font-size: 0.9em;
    line-height: 1.8;
}

.thinking-placeholder {
    color: #999;
    font-style: italic;
}

.thinking-content div {
    margin: 5px 0;
}

.highlight {
    color: #667eea;
    font-weight: bold;
}

.warning {
    color: #f39c12;
}

.status-info {
    color: #667eea;
}

.status-warning {
    color: #f39c12;
}

.status-danger {
    color: #e74c3c;
}

/* 结束提示 */
.end-notice {
    text-align: center;
    padding: 15px;
    margin: 10px 0;
    border-radius: 10px;
    font-weight: bold;
}

.end-notice.success {
    background: #d4edda;
    color: #155724;
}

.end-notice.failed {
    background: #f8d7da;
    color: #721c24;
}

.end-notice.wechat {
    background: #d1ecf1;
    color: #0c5460;
}

.end-notice.hostile {
    background: #fff3cd;
    color: #856404;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        grid-template-columns: 1fr;
    }

    .thinking-panel {
        order: -1;
    }

    .chat-container {
        height: 70vh;
    }
}