* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    background: linear-gradient(135deg, #1a202c 0%, #2d3748 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

.status-bar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 12px 24px;
    border-radius: 12px;
    margin-bottom: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.connection-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.status-dot.connected {
    background: #10b981;
    animation: pulse 2s infinite;
}

.status-dot.disconnected {
    background: #ef4444;
}

.online-users {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    color: #6b7280;
}

.user-count {
    background: #3b82f6;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.main-content {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.tasks-section {
    margin-bottom: 30px;
}

.section-title {
    font-size: 20px;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.section-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.create-btn {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #2d3748, #4a5568);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.create-btn:hover {
    transform: translateY(-1px) scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    background: linear-gradient(135deg, #4a5568, #718096);
}

.history-btn {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #4a5568, #718096);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.history-btn:hover {
    transform: translateY(-1px) scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    background: linear-gradient(135deg, #718096, #a0aec0);
}

.history-btn.active {
    background: linear-gradient(135deg, #2d3748, #4a5568);
}

.tasks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.task-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 16px;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.task-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #4a5568, #718096);
}

.task-card:hover {
    box-shadow: 0 4px 12px rgba(74, 85, 104, 0.2);
    transform: translateY(-2px);
}

.task-card.expanded {
    grid-column: 1 / -1;
    cursor: default;
}

.task-basic {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.task-name {
    font-size: 16px;
    font-weight: 600;
    color: #1a202c;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.task-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.assignee {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #4a5568;
}

.deadline {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #4a5568;
}

.days-count {
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
    min-width: 50px;
    text-align: center;
}

.days-count.urgent {
    background: #fee2e2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.days-count.normal {
    background: #dbeafe;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
}

.days-count.far {
    background: #dcfce7;
    color: #16a34a;
    border: 1px solid #bbf7d0;
}

.days-count.expired {
    background: #f3f4f6;
    color: #6b7280;
    border: 1px solid #e5e7eb;
}

.task-details {
    display: none;
    margin: 16px 0;
    padding: 16px;
    background: #f7fafc;
    border-radius: 8px;
    font-size: 16px;
    color: #4a5568;
    line-height: 1.8;
    border-left: 4px solid #667eea;
}

.task-card.expanded .task-details {
    display: block;
}

.attachments-section {
    display: none;
    margin: 16px 0;
}

.task-card.expanded .attachments-section {
    display: block;
}

.attachments-title {
    font-size: 14px;
    color: #718096;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

.attachments {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.attachment-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    background: #f7fafc;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    font-size: 13px;
}

.attachment-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.attachment-actions {
    display: flex;
    gap: 8px;
}

.task-actions {
    display: none;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
}

.task-card.expanded .task-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    align-items: center;
    flex-wrap: wrap;
}

.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: #3b82f6;
    color: white;
}

.btn-primary:hover {
    background: #2563eb;
}

.btn-success {
    background: #10b981;
    color: white;
}

.btn-success:hover {
    background: #059669;
}

.btn-danger {
    background: #ef4444;
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-warning {
    background: #f59e0b;
    color: white;
}

.btn-warning:hover {
    background: #d97706;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #9ca3af;
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.history-section {
    margin-top: 30px;
    padding-top: 24px;
    border-top: 2px solid #e2e8f0;
}

.history-section .section-title::before {
    content: "⏰";
}

.history-task {
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 8px;
    opacity: 0.7;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.history-task .task-name {
    color: #718096;
    text-decoration: line-through;
}

.history-task-actions {
    display: flex;
    gap: 8px;
}

.history-task-actions .btn {
    padding: 6px 12px;
    font-size: 12px;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.modal-content {
    background: white;
    margin: 50px auto;
    padding: 24px;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.modal-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 20px;
    color: #1f2937;
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #374151;
}

.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: #4a5568;
    box-shadow: 0 0 0 3px rgba(74, 85, 104, 0.1);
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
}

.file-upload {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
}

.file-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px dashed #d1d5db;
    border-radius: 6px;
    background: #f9fafb;
}

.upload-btn {
    padding: 8px 16px;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

.upload-btn:hover {
    background: #2563eb;
}

.upload-btn:disabled {
    background: #9ca3af;
    cursor: not-allowed;
}

@media (max-width: 768px) {
    .tasks-grid {
        grid-template-columns: 1fr;
    }
    
    .task-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .task-actions {
        flex-direction: column;
    }
    
    .modal-content {
        margin: 20px;
        width: calc(100% - 40px);
    }
    
    .status-bar {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }
}

/* 多选框样式 */
.multi-select {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    cursor: pointer;
    font-size: 14px;
}

.checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}