/* ========== 搜索框样式 ========== */
.search-box {
  flex: 1;
  min-width: 280px;
  max-width: 400px;
}

.search-box input {
  width: 100%;
  padding: 0.75rem 1.5rem;
  border: 2px solid var(--border-light);
  border-radius: 25px;
  background: white;
  color: var(--text-color);
  font-family: 'Nunito', sans-serif;
  font-size: 0.9rem;
  transition: all 0.3s ease;
  outline: none;
}

.search-box input:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(166, 177, 225, 0.1);
}

.search-box input::placeholder {
  color: var(--text-secondary);
  opacity: 0.6;
}

/* ========== 弹窗样式 ========== */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  transition: opacity 0.3s ease;
}

.modal.hidden {
  opacity: 0;
  pointer-events: none;
}

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(5px);
  animation: fadeIn 0.3s ease;
}

.modal-content {
  position: relative;
  background: white;
  border-radius: 20px;
  max-width: 600px;
  width: 90%;
  max-height: 90vh;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: slideUp 0.3s ease;
  display: flex;
  flex-direction: column;
}

.modal-content.modal-small {
  max-width: 500px;
}

@keyframes fadeIn {
  from {opacity: 0;}
  to {opacity: 1;}
}

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

.modal-header {
  padding: 2rem;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(135deg, rgba(166, 177, 225, 0.05), rgba(233, 166, 166, 0.05));
}

.modal-header h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.8rem;
  color: var(--text-color);
  margin: 0;
}

.modal-close {
  width: 40px;
  height: 40px;
  border: none;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 50%;
  font-size: 1.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
  color: var(--text-color);
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover {
  background: rgba(0, 0, 0, 0.1);
  transform: rotate(90deg);
}

.modal-body {
  padding: 2rem;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 1.5rem 2rem;
  border-top: 1px solid var(--border-light);
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
  background: rgba(249, 246, 241, 0.3);
}

/* ========== 按钮样式 ========== */
.btn {
  padding: 0.75rem 1.8rem;
  border: none;
  border-radius: 10px;
  font-family: 'Nunito', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  outline: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
  color: white;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--shadow-hover);
}

.btn-secondary {
  background: white;
  color: var(--text-color);
  border: 2px solid var(--border-light);
}

.btn-secondary:hover {
  background: rgba(166, 177, 225, 0.05);
  border-color: var(--primary-color);
}

.btn-danger {
  background: #E8B4B8;
  color: white;
}

.btn-danger:hover {
  background: #E9A6A6;
  transform: translateY(-2px);
}

/* ========== 表单样式 ========== */
.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--text-color);
  font-size: 0.95rem;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid var(--border-light);
  border-radius: 10px;
  font-family: 'Nunito', sans-serif;
  font-size: 0.9rem;
  color: var(--text-color);
  transition: all 0.3s ease;
  outline: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(166, 177, 225, 0.1);
}

.form-group textarea {
  resize: vertical;
  min-height: 80px;
}

/* ========== 任务详情显示 ========== */
.detail-row {
  padding: 1rem 0;
  border-bottom: 1px solid var(--border-light);
}

.detail-row:last-child {
  border-bottom: none;
}

.detail-label {
  font-weight: 600;
  color: var(--primary-color);
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.detail-value {
  color: var(--text-color);
  font-size: 1.1rem;
  line-height: 1.6;
}

.detail-value.large {
  font-size: 1.5rem;
  font-family: 'Playfair Display', serif;
  font-weight: 600;
}

.detail-badge {
  display: inline-block;
  padding: 0.5rem 1.2rem;
  border-radius: 25px;
  font-size: 0.85rem;
  font-weight: 700;
  color: white;
}

/* ========== Dashboard 统计样式 ========== */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-bottom: 3rem;
}

.stat-card {
  background: white;
  border-radius: 16px;
  padding: 2rem;
  box-shadow: 0 4px 16px var(--shadow-light);
  border: 1px solid var(--border-light);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
}

.stat-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 24px var(--shadow-hover);
}

.stat-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.stat-value {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--primary-color);
  font-family: 'Playfair Display', serif;
  margin-bottom: 0.5rem;
}

.stat-label {
  color: var(--text-secondary);
  font-size: 0.95rem;
  font-weight: 600;
}

.chart-container {
  background: white;
  border-radius: 16px;
  padding: 2rem;
  box-shadow: 0 4px 16px var(--shadow-light);
  border: 1px solid var(--border-light);
  margin-bottom: 2rem;
}

.chart-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  color: var(--text-color);
}

.chart-bar {
  margin-bottom: 1rem;
}

.chart-bar-label {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.chart-bar-track {
  height: 12px;
  background: rgba(166, 177, 225, 0.1);
  border-radius: 6px;
  overflow: hidden;
}

.chart-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
  border-radius: 6px;
  transition: width 0.5s ease;
}

/* ========== 甘特图样式 ========== */
.gantt-container {
  background: white;
  border-radius: 16px;
  padding: 2rem;
  box-shadow: 0 4px 16px var(--shadow-light);
  border: 1px solid var(--border-light);
  overflow-x: auto;
}

.gantt-header {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--border-light);
  font-weight: 600;
}

.gantt-row {
  display: flex;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border-light);
  align-items: center;
}

.gantt-task-info {
  min-width: 280px;
  padding-right: 1rem;
}

.gantt-task-title {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-primary);
  margin-bottom: 0.3rem;
}

.gantt-task-detail {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.gantt-location,
.gantt-artists {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gantt-timeline {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 0.5rem;
  position: relative;
}

.gantt-month {
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-secondary);
  padding: 0.5rem;
  background: rgba(166, 177, 225, 0.05);
  border-radius: 4px;
}

.gantt-bar {
  height: 42px;
  background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
  border-radius: 6px;
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  padding: 0.25rem 0.5rem;
  overflow: hidden;
}

.gantt-bar-label {
  font-size: 0.85rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.gantt-bar-status {
  font-size: 0.7rem;
  opacity: 0.9;
  margin-top: 0.1rem;
}

.gantt-bar:hover {
  transform: scaleY(1.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* ========== 深色模式 ========== */
body.dark-mode {
  --bg-color: #1a1a2e;
  --card-bg: #16213e;
  --text-color: #eaeaea;
  --text-secondary: #b0b0b0;
  --border-light: rgba(255, 255, 255, 0.1);
  --shadow-light: rgba(0, 0, 0, 0.3);
  --shadow-medium: rgba(0, 0, 0, 0.4);
  --shadow-hover: rgba(0, 0, 0, 0.5);
}

body.dark-mode .header {
  background: linear-gradient(135deg, #0f3460 0%, #533483 100%);
}

body.dark-mode .task-card,
body.dark-mode .month-section,
body.dark-mode .timeline-content,
body.dark-mode .stat-card,
body.dark-mode .chart-container,
body.dark-mode .gantt-container,
body.dark-mode .modal-content {
  background: var(--card-bg);
  color: var(--text-color);
}

body.dark-mode input,
body.dark-mode select,
body.dark-mode textarea {
  background: #1a1a2e;
  color: var(--text-color);
  border-color: var(--border-light);
}

body.dark-mode .calendar-day {
  background: var(--card-bg);
}

body.dark-mode .no-tasks {
  color: var(--text-secondary);
}

/* ========== 响应式调整 ========== */
@media (max-width: 768px) {
  .header-actions {
    flex-direction: column;
    width: 100%;
  }

  .header-btn {
    width: 100%;
  }

  .search-box {
    max-width: 100%;
  }

  .toolbar {
    flex-direction: column;
    gap: 1rem;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .modal-content {
    width: 95%;
    max-height: 95vh;
  }

  .modal-header,
  .modal-body,
  .modal-footer {
    padding: 1.5rem;
  }

  .gantt-task-info {
    min-width: 200px;
  }
}

@media (max-width: 480px) {
  .header-actions {
    gap: 0.5rem;
  }

  .header-btn {
    padding: 0.6rem 1rem;
    font-size: 0.85rem;
  }

  .modal-header h2 {
    font-size: 1.3rem;
  }

  .btn {
    padding: 0.6rem 1.2rem;
    font-size: 0.85rem;
  }

  .modal-footer {
    flex-direction: column;
  }

  .modal-footer .btn {
    width: 100%;
  }
}

/* ========== 导出选项样式 ========== */
.export-options {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.export-option {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 1.5rem;
  border: 2px solid var(--border-light);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  background: white;
}

.export-option:hover {
  border-color: var(--primary-color);
  background: rgba(166, 177, 225, 0.05);
  transform: translateX(5px);
  box-shadow: 0 4px 12px var(--shadow-medium);
}

.export-option:active {
  transform: translateX(5px) scale(0.98);
}

.export-option.export-all {
  background: linear-gradient(135deg, rgba(166, 177, 225, 0.1), rgba(233, 166, 166, 0.1));
  border: 2px solid var(--primary-color);
  position: relative;
  overflow: hidden;
}

.export-option.export-all::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transition: left 0.5s ease;
}

.export-option.export-all:hover::before {
  left: 100%;
}

.export-option.export-all:hover {
  background: linear-gradient(135deg, rgba(166, 177, 225, 0.15), rgba(233, 166, 166, 0.15));
  border-color: var(--accent-color);
  transform: translateX(8px) scale(1.02);
  box-shadow: 0 6px 20px rgba(166, 177, 225, 0.3);
}

.export-option.export-all .export-title {
  background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 800;
}

.export-icon {
  font-size: 2.5rem;
  flex-shrink: 0;
}

.export-info {
  flex: 1;
}

.export-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-color);
  margin-bottom: 0.3rem;
}

.export-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

@media (max-width: 480px) {
  .export-option {
    padding: 1rem;
    gap: 1rem;
  }

  .export-icon {
    font-size: 2rem;
  }

  .export-title {
    font-size: 1rem;
  }

  .export-desc {
    font-size: 0.85rem;
  }
}

/* ========== 导出内容选择弹窗样式 ========== */
.modal-content.modal-medium {
  max-width: 650px;
}

.export-content-options {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.checkbox-option {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.2rem;
  border: 2px solid var(--border-light);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  background: white;
  position: relative;
}

.checkbox-option:hover {
  border-color: var(--primary-color);
  background: rgba(166, 177, 225, 0.05);
  transform: translateX(3px);
}

.checkbox-option.disabled {
  cursor: default;
  background: rgba(166, 177, 225, 0.08);
  border-color: var(--primary-color);
}

.checkbox-option.disabled:hover {
  transform: none;
}

.checkbox-option input[type="checkbox"] {
  width: 20px;
  height: 20px;
  cursor: pointer;
  accent-color: var(--primary-color);
  flex-shrink: 0;
  margin-top: 2px;
}

.checkbox-option input[type="checkbox"]:disabled {
  cursor: default;
}

.checkbox-label {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.checkbox-label strong {
  font-size: 1rem;
  color: var(--text-color);
  font-weight: 700;
}

.checkbox-label small {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

body.dark-mode .checkbox-option {
  background: var(--card-bg);
}

body.dark-mode .checkbox-option:hover {
  background: rgba(166, 177, 225, 0.1);
}

body.dark-mode .checkbox-option.disabled {
  background: rgba(166, 177, 225, 0.15);
}

@media (max-width: 480px) {
  .checkbox-option {
    padding: 1rem;
    gap: 0.8rem;
  }

  .checkbox-label strong {
    font-size: 0.95rem;
  }

  .checkbox-label small {
    font-size: 0.8rem;
  }
}
