* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f5f7fa;
    color: #2c3e50;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 30px;
}

header h1 {
    font-size: 2rem;
    color: #2c3e50;
}

header p {
    color: #7f8c8d;
    margin-top: 5px;
}

.main {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 20px;
    height: calc(100vh - 180px);
}

.tasks-panel {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 2px solid #ecf0f1;
}

.panel-header h2 {
    font-size: 1.2rem;
    color: #2c3e50;
}

.icon-btn {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 6px;
    transition: background 0.2s;
}

.icon-btn:hover {
    background: #ecf0f1;
}

.tasks-list {
    flex: 1;
    overflow-y: auto;
}

.empty-state {
    text-align: center;
    color: #95a5a6;
    padding: 40px 20px;
}

.task-item {
    padding: 12px;
    margin-bottom: 10px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 3px solid #3498db;
    cursor: pointer;
    transition: all 0.2s;
}

.task-item:hover {
    background: #ecf0f1;
    transform: translateX(2px);
}

.task-item.completed {
    border-left-color: #95a5a6;
    opacity: 0.7;
}

.task-item .task-title {
    font-weight: 600;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.task-item .task-meta {
    font-size: 0.85rem;
    color: #7f8c8d;
}

.chat-panel {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    min-height: 0;
    /* 重要：允许flex收缩 */
}

.message {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
}

.message.user {
    align-items: flex-end;
}

.message.assistant {
    align-items: flex-start;
}

.message-content {
    max-width: 70%;
    padding: 12px 16px;
    border-radius: 12px;
    line-height: 1.5;
}

.message.user .message-content {
    background: #3498db;
    color: white;
}

.message.assistant .message-content {
    background: #ecf0f1;
    color: #2c3e50;
}

.thinking-process {
    background: #f8f9fa;
    border-left: 3px solid #3498db;
    padding: 10px 12px;
    margin-top: 8px;
    border-radius: 6px;
    font-size: 0.9rem;
    color: #7f8c8d;
}

.thinking-header {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}

.thinking-header:hover {
    color: #3498db;
}

.thinking-icon {
    transition: transform 0.2s;
}

.thinking-icon.collapsed {
    transform: rotate(-90deg);
}

.thinking-content {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #ddd;
}

.thinking-content.hidden {
    display: none;
}

.final-result {
    font-weight: 500;
    color: #2c3e50;
}

.input-area {
    padding: 20px;
    border-top: 1px solid #ecf0f1;
    display: flex;
    gap: 10px;
}

.input-area input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #ecf0f1;
    border-radius: 8px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s;
}

.input-area input:focus {
    border-color: #3498db;
}

.primary-btn,
.secondary-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
}

.primary-btn {
    background: #3498db;
    color: white;
}

.primary-btn:hover {
    background: #2980b9;
}

.secondary-btn {
    background: #ecf0f1;
    color: #2c3e50;
}

.secondary-btn:hover {
    background: #bdc3c7;
}

@media (max-width: 768px) {
    .main {
        grid-template-columns: 1fr;
        height: auto;
    }

    .tasks-panel {
        max-height: 300px;
    }

    .chat-panel {
        height: 500px;
    }
}