/**
 * File: client/css/drafts.css
 * 草稿管理相关样式
 * 作用: 定义草稿保存按钮、草稿列表弹窗、草稿卡片等样式
 */

/* ========== 保存项目按钮样式 ========== */
.nav-btn-save {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-right: 12px;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.nav-btn-save:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.nav-btn-save:active {
  transform: translateY(0);
}

/* ========== 草稿弹窗样式 ========== */
.drafts-modal-content {
  max-width: 900px;
  width: 90%;
  max-height: 85vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.drafts-modal-content .modal-body {
  overflow-y: auto;
  max-height: calc(85vh - 120px);
  padding: 20px;
}

/* ========== 草稿列表样式 ========== */
.drafts-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  padding: 10px 0;
}

/* ========== 草稿卡片样式 ========== */
.draft-card {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
  cursor: pointer;
  border: 2px solid transparent;
}

.draft-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
  border-color: #6366f1;
}

.draft-thumbnail {
  width: 100%;
  height: 160px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  color: white;
  position: relative;
  overflow: hidden;
}

.draft-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.draft-thumbnail-placeholder {
  font-size: 64px;
  opacity: 0.8;
}

.draft-info {
  padding: 16px;
}

.draft-title {
  font-size: 16px;
  font-weight: 600;
  color: #0f172a;
  margin-bottom: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.draft-description {
  font-size: 13px;
  color: #64748b;
  margin-bottom: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-height: 1.5;
  height: 40px;
}

.draft-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: #94a3b8;
  padding-top: 12px;
  border-top: 1px solid #f1f5f9;
}

.draft-date {
  display: flex;
  align-items: center;
  gap: 4px;
}

.draft-actions {
  display: flex;
  gap: 8px;
}

/**
 * @description 草稿操作按钮样式
 * @date 2025-11-04
 * 修改: 改为文字按钮样式,更清晰明确
 */
.draft-action-btn {
  background: none;
  border: 1px solid #e2e8f0;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s ease;
  color: #64748b;
  white-space: nowrap;
}

.draft-action-btn:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #0f172a;
  transform: translateY(-1px);
}

.draft-action-btn.load {
  color: #3b82f6;
  border-color: #3b82f6;
}

.draft-action-btn.load:hover {
  background: #dbeafe;
  border-color: #2563eb;
  color: #1e40af;
}

.draft-action-btn.delete {
  color: #ef4444;
  border-color: #fecaca;
}

.draft-action-btn.delete:hover {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #dc2626;
}

/* ========== 草稿加载状态 ========== */
.drafts-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  color: #64748b;
}

.drafts-loading .spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #f1f5f9;
  border-top-color: #6366f1;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 16px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ========== 空状态样式 ========== */
.drafts-empty {
  text-align: center;
  padding: 80px 20px;
  color: #94a3b8;
}

.drafts-empty p:first-child {
  font-size: 18px;
  font-weight: 500;
  margin-bottom: 8px;
}

/* ========== 响应式设计 ========== */
@media (max-width: 768px) {
  .drafts-list {
    grid-template-columns: 1fr;
  }

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

  .nav-btn-save {
    padding: 8px 16px;
    font-size: 13px;
  }
}

/* ========== 草稿标签 ========== */
.draft-tag {
  display: inline-block;
  padding: 4px 10px;
  background: #f1f5f9;
  color: #475569;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 500;
  margin-bottom: 8px;
}

.draft-tag.theme {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}
