:root {
  --primary-color: #4361ee;
  --success-color: #4cc9f0;
  --danger-color: #f72585;
  --warning-color: #f8961e;
  --low-priority: #2ec4b6;
  --medium-priority: #ff9f1c;
  --high-priority: #e71d36;
  --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  margin: 0;
  padding: 20px;
  background: #f8f9fa;
  color: #333;
  line-height: 1.6;
}

.container {
  max-width: 800px;
  margin: 20px auto;
  background: white;
  padding: 2rem;
  border-radius: 12px;
  box-shadow: var(--shadow);
}

h1 {
  color: var(--primary-color);
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-primary {
  background: var(--primary-color);
  color: white;
  border: none;
  padding: 10px 15px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
}

.btn-primary:hover {
  background: #3a56d4;
  transform: translateY(-1px);
}

/* 进度条 */
.progress-container {
  height: 8px;
  background: #e9ecef;
  border-radius: 4px;
  margin: 1.5rem 0;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: var(--success-color);
  border-radius: 4px;
  transition: width 0.3s ease;
}

/* 任务网格 */
.task-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 15px;
  margin-top: 20px;
}

.task-card {
  background: white;
  border-radius: 10px;
  padding: 15px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: all 0.3s;
  border-left: 4px solid var(--medium-priority);
  display: flex;
  flex-direction: column;
}

.task-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.task-card.completed {
  opacity: 0.8;
  border-left-color: var(--success-color);
}

.task-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.task-header h3 {
  margin: 0;
  font-size: 1.1rem;
  color: #212529;
}

.task-preview {
  color: #6c757d;
  font-size: 0.9rem;
  margin: 10px 0;
  flex-grow: 1;
}

.task-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: #adb5bd;
}

.priority-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: bold;
}

.priority-badge.low {
  background: rgba(46, 196, 182, 0.1);
  color: var(--low-priority);
}

.priority-badge.medium {
  background: rgba(255, 159, 28, 0.1);
  color: var(--medium-priority);
}

.priority-badge.high {
  background: rgba(231, 29, 54, 0.1);
  color: var(--high-priority);
}

.status-badge {
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 0.7rem;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.status-badge.completed {
  background: rgba(76, 201, 240, 0.1);
  color: var(--success-color);
}

.status-badge.pending {
  background: rgba(248, 150, 30, 0.1);
  color: var(--warning-color);
}

/* 模态框 */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background: white;
  width: 90%;
  max-width: 700px;
  max-height: 90vh;
  padding: 25px;
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  overflow-y: auto;
}

.modal h2 {
  margin-top: 0;
  color: var(--primary-color);
  display: flex;
  align-items: center;
  gap: 10px;
}

#task-title {
  width: 100%;
  padding: 10px;
  margin-bottom: 15px;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  font-size: 1rem;
}

#editor-js {
  border: 1px solid #dee2e6;
  border-radius: 6px;
  padding: 15px;
  min-height: 200px;
  margin-bottom: 15px;
}

.task-meta {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
  align-items: center;
}

.task-meta label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

#task-priority {
  padding: 8px;
  border-radius: 6px;
  border: 1px solid #dee2e6;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* 响应式设计 */
@media (max-width: 600px) {
  .container {
    padding: 15px;
  }
  
  .task-grid {
    grid-template-columns: 1fr;
  }
  
  .modal-content {
    width: 95%;
    padding: 15px;
  }
}

.btn-icon {
  background: none;
  border: none;
  cursor: pointer;
  color: #6c757d;
  padding: 5px;
  border-radius: 50%;
  transition: all 0.2s;
}

.btn-icon:hover {
  color: var(--danger-color);
  background: rgba(247, 37, 133, 0.1);
}

.task-actions {
  display: flex;
  gap: 5px;
}

.alert {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 12px 20px;
  border-radius: 6px;
  color: white;
  box-shadow: var(--shadow);
  z-index: 1001;
  animation: slideIn 0.3s ease-out;
}

.alert.success {
  background: var(--success-color);
}

.alert.error {
  background: var(--danger-color);
}

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.progress-bar::after {
  content: attr(data-progress);
  position: absolute;
  right: 10px;
  font-size: 0.7rem;
  color: white;
}