/*
 * schedule.css - 排班编辑器样式
 * Mobile-first design (375px base)
 * 暗色主题，与 style.css 风格统一
 */

/* ========== 工具栏 ========== */
.sched-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}

.sched-title {
  font-size: 18px;
  font-weight: 600;
  color: #e8e8f0;
  margin: 0;
}

.sched-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.sched-tool-btn {
  padding: 7px 14px;
  border-radius: 6px;
  border: 0.5px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.05);
  color: #b0b0c0;
  font-size: 12px;
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
}
.sched-tool-btn:hover { background: rgba(255,255,255,0.1); color: #e0e0f0; }
.sched-tool-btn.primary { background: #3a86c4; color: #fff; border-color: #3a86c4; }
.sched-tool-btn.primary:hover { background: #2d6ca3; }

/* ========== 周网格 ========== */
.sched-week-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

@media (max-width: 768px) {
  .sched-week-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 480px) {
  .sched-week-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 360px) {
  .sched-week-grid { grid-template-columns: 1fr; }
}

/* ========== 日期卡片 ========== */
.sched-day-card {
  background: rgba(20,20,35,.9);
  border: 0.5px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  overflow: hidden;
  transition: border-color .15s;
}
.sched-day-card.today {
  border-color: #3a86c4;
  box-shadow: 0 0 0 1px rgba(58,134,196,.25);
}

.sched-day-header {
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 0.5px solid rgba(255,255,255,0.06);
}

.sched-day-icon {
  font-size: 22px;
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(58,134,196,.1);
  border-radius: 8px;
  flex-shrink: 0;
}

.sched-day-name {
  font-size: 13px; font-weight: 600; color: #e8e8f0;
}
.sched-day-theme {
  font-size: 11px; color: #8888a0; margin-top: 1px;
}

.sched-today-badge {
  display: inline-block;
  background: #3a86c4;
  color: #fff;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 4px;
  margin-left: 5px;
  vertical-align: middle;
}

.sched-progress {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 5px;
}
.sched-progress-bar {
  height: 5px; width: 40px;
  background: rgba(255,255,255,0.08);
  border-radius: 3px;
  overflow: hidden;
}
.sched-progress-bar::after {
  content: ''; display: block; height: 100%;
  background: #50a86c;
  width: var(--p, 0%);
  transition: width .3s;
}
.sched-progress-text {
  font-size: 10px; color: #70a070; white-space: nowrap;
}

/* ========== 任务列表 ========== */
.sched-day-body {
  padding: 10px 14px;
}

.sched-task-group { margin-bottom: 10px; }

.sched-task-label {
  font-size: 11px;
  color: #686880;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.sched-empty {
  color: #555568;
  font-size: 12px;
  padding: 6px 0;
  font-style: italic;
}

.sched-task-item {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 8px;
  border-radius: 6px;
  background: rgba(255,255,255,.02);
  margin-bottom: 4px;
  cursor: grab;
  transition: background .12s;
}
.sched-task-item:hover { background: rgba(255,255,255,.06); }
.sched-task-item.done .sched-task-text { text-decoration: line-through; opacity: 0.55; }
.sched-task-item.done { opacity: 0.65; }

/* 复选框 */
.sched-checkbox input {
  appearance: none; -webkit-appearance: none;
  width: 17px; height: 17px;
  border: 1.5px solid #444460;
  border-radius: 4px;
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  background: transparent;
}
.sched-checkbox input:checked {
  background: #3a86c4;
  border-color: #3a86c4;
}
.sched-checkbox input:checked::after {
  content: '✓'; position: absolute;
  color: #fff; font-size: 11px;
  top: 50%; left: 50%; transform: translate(-50%,-50%);
}

.sched-task-text {
  font-size: 12.5px; color: #d0d0e0;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sched-task-time {
  font-size: 10px; color: #666680;
  flex-shrink: 0;
}

.sched-task-actions {
  display: flex; gap: 2px;
  opacity: 0;
  transition: opacity .12s;
}
.sched-task-item:hover .sched-task-actions { opacity: 1; }

.sched-mini-btn {
  background: none; border: none;
  cursor: pointer; font-size: 13px;
  padding: 2px 4px;
  border-radius: 4px;
  line-height: 1;
  transition: background .12s;
}
.sched-mini-btn.edit:hover { background: rgba(58,134,196,.15); }
.sched-mini-btn.del:hover { background: rgba(220,70,70,.15); }

/* 添加按钮 */
.sched-add-btn {
  display: block; width: 100%;
  padding: 6px;
  border: 1px dashed #333350;
  border-radius: 6px;
  background: transparent;
  color: #666690;
  font-size: 12px;
  cursor: pointer;
  transition: all .12s;
  text-align: center;
}
.sched-add-btn:hover { border-color: #3a86c4; color: #3a86c4; background: rgba(58,134,196,.06); }

/* 编辑主题按钮 */
.sched-edit-theme-btn {
  display: block; width: calc(100% - 28px);
  margin: 8px auto 12px;
  padding: 6px;
  border: none;
  border-radius: 6px;
  background: rgba(255,255,255,.03);
  color: #787898;
  font-size: 11px;
  cursor: pointer;
  transition: background .12s;
}
.sched-edit-theme-btn:hover { background: rgba(255,255,255,.07); color: #a0a0c0; }

/* ========== 弹窗 ========== */
.sched-modal-overlay {
  display: none;
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,.55);
  z-index: 9999;
  align-items: center; justify-content: center;
  padding: 16px;
}

.sched-modal {
  background: #16162a;
  border: 0.5px solid rgba(255,255,255,0.12);
  border-radius: 14px;
  width: 100%;
  max-width: 420px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 24px 64px rgba(0,0,0,.45);
}

@media (max-width: 480px) {
  .sched-modal { max-width: 100%; border-radius: 12px 12px 0 0; margin-top: auto; }
}

.sched-modal-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 18px 12px; border-bottom: 0.5px solid rgba(255,255,255,.08);
}

.sched-modal-title {
  font-size: 15px; font-weight: 600; color: #e8e8f0; margin: 0;
}

.sched-modal-close {
  background: none; border: none; color: #7777a0;
  font-size: 18px; cursor: pointer; padding: 4px;
  line-height: 1;
}
.sched-modal-close:hover { color: #d0d0e0; }

.sched-modal-body { padding: 16px 18px 18px; }

/* ========== 表单 ========== */
.sched-form .sched-field { margin-bottom: 14px; }

.sched-form label {
  display: block;
  font-size: 12px; color: #9898b0; margin-bottom: 5px;
  font-weight: 500;
}

.sched-input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 7px;
  border: 0.5px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,.04);
  color: #e0e0f0;
  font-size: 13px;
  box-sizing: border-box;
  outline: none;
  transition: border-color .15s;
}
.sched-input:focus { border-color: #3a86c4; background: rgba(58,134,196,.04); }
.sched-input-main { font-size: 15px; }

.sched-form-actions {
  display: flex; gap: 8px; justify-content: flex-end;
  margin-top: 18px;
}

.sched-btn {
  padding: 9px 20px;
  border-radius: 7px;
  border: none;
  font-size: 13px; font-weight: 500;
  cursor: pointer;
  transition: all .12s;
}
.sched-btn.primary { background: #3a86c4; color: #fff; }
.sched-btn.primary:hover { background: #2d6ca3; }
.sched-btn.ghost { background: transparent; color: #8888a0; border: 0.5px solid rgba(255,255,255,0.1); }
.sched-btn.ghost:hover { background: rgba(255,255,255,.05); color: #b0b0c0; }
.sched-btn.danger { background: transparent; color: #dc4646; border: 0.5px solid rgba(220,70,70,.3); }
.sched-btn.danger:hover { background: rgba(220,70,70,.1); }

/* ========== 导入区域 ========== */
.sched-import-area p { color: #9898b0; font-size: 13px; margin: 0 0 10px; }
.sched-file-input {
  width: 100%; padding: 8px;
  border-radius: 7px;
  border: 0.5px dashed rgba(255,255,255,0.15);
  background: rgba(255,255,255,.02);
  color: #c0c0d0;
  font-size: 12px;
  margin-bottom: 8px;
}

.sched-divider {
  text-align: center;
  color: #555568;
  font-size: 11px;
  margin: 10px 0;
  position: relative;
}
.sched-divider::before,
.sched-divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: calc(50% - 15px);
  height: 0.5px;
  background: rgba(255,255,255,0.08);
}
.sched-divider::before { left: 0; }
.sched-divider::after { right: 0; }

#sched-paste-area {
  width: 100%;
  padding: 10px 12px;
  border-radius: 7px;
  border: 0.5px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,.03);
  color: #c0c0d0;
  font-size: 12px;
  font-family: 'Cascadia Code', 'Fira Code', monospace;
  resize: vertical;
  min-height: 80px;
  box-sizing: border-box;
  outline: none;
}
#sched-paste-area:focus { border-color: #3a86c4; }

/* ========== 拖拽状态 ========== */
.sched-task-item.dragging { opacity: .4; }
.sched-task-item.drag-over { border-top: 2px solid #3a86c4; }
