/* Tailwind CSS CDN */
@import url('https://cdn.jsdelivr.net/npm/tailwindcss@2.2.19/dist/tailwind.min.css');

/* 自定义CSS变量 */
:root {
  --primary-color: #3B82F6;
  --primary-hover: #2563EB;
  --secondary-color: #6B7280;
  --success-color: #10B981;
  --danger-color: #EF4444;
  --warning-color: #F59E0B;
  --background-color: #FFFFFF;
  --surface-color: #F9FAFB;
  --border-color: #E5E7EB;
  --text-primary: #111827;
  --text-secondary: #6B7280;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --radius: 8px;
  --radius-lg: 12px;
}

/* 基础样式重置 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background-color: var(--surface-color);
  color: var(--text-primary);
  line-height: 1.6;
}

/* 导航栏样式 */
.navbar {
  background-color: var(--background-color);
  border-bottom: 1px solid var(--border-color);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
}

.nav-actions {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  transition: all 0.2s ease;
}

.nav-link:hover {
  color: var(--primary-color);
  background-color: var(--surface-color);
}

.nav-btn {
  background-color: var(--primary-color);
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.nav-btn:hover {
  background-color: var(--primary-hover);
}

/* 主容器样式 */
.main-container {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 1rem;
}

/* 上传卡片样式 */
.upload-card {
  background-color: var(--background-color);
  border-radius: var(--radius-lg);
  padding: 2rem;
  max-width: 600px;
  margin: 0 auto;
}

.card-title {
  font-size: 1.5rem;
  font-weight: 600;
   margin-bottom: 1.5rem; 
  text-align: center;
  color: var(--text-primary);
}

/* 表单样式 */
.upload-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-label {
  font-weight: 500;
  color: var(--text-primary);
  font-size: 0.875rem;
}

.form-input {
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  font-size: 1rem;
  transition: all 0.2s ease;
  background-color: var(--background-color);
}

.form-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* 上传区域样式 */
.upload-area {
  position: relative;
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-lg);
  padding: 3rem 2rem;
  text-align: center;
  transition: all 0.2s ease;
  cursor: pointer;
  background-color: var(--surface-color);
}

.upload-area:hover {
  border-color: var(--primary-color);
  background-color: rgba(59, 130, 246, 0.02);
}

.upload-area.dragover {
  border-color: var(--primary-color);
  background-color: rgba(59, 130, 246, 0.05);
}

.upload-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.upload-icon {
  width: 3rem;
  height: 3rem;
  color: var(--text-secondary);
}

.upload-text {
  font-size: 1.125rem;
  font-weight: 500;
  color: var(--text-primary);
}

.upload-hint {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.file-input {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

/* 预览区域样式 */
.preview-area {
  margin-top: 1rem;
}

.preview-title {
  font-size: 1rem;
  font-weight: 500;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
}

.preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 0.5rem;
}

.preview-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: 0;
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.preview-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.preview-remove {
  position: absolute;
  top: 0.25rem;
  right: 0.25rem;
  background-color: var(--danger-color);
  color: white;
  border: none;
  border-radius: 50%;
  width: 1.5rem;
  height: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.75rem;
  transition: all 0.2s ease;
}

.preview-remove:hover {
  background-color: #DC2626;
}

/* 提交按钮样式 */
.submit-btn {
  background-color: var(--primary-color);
  color: white;
  border: none;
  padding: 0.875rem 2rem;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1rem;
}

.submit-btn:hover {
  background-color: var(--primary-hover);
}

.submit-btn:disabled {
  background-color: var(--text-secondary);
  cursor: not-allowed;
}

/* 加载动画 */
.loading-spinner {
  width: 1rem;
  height: 1rem;
  border: 2px solid transparent;
  border-top: 2px solid currentColor;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* 模态框样式 */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-content {
  background-color: var(--background-color);
  border-radius: var(--radius-lg);
  padding: 2rem;
  max-width: 400px;
  width: 90%;
  text-align: center;
  box-shadow: var(--shadow-lg);
}

.modal-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.success-icon {
  width: 3rem;
  height: 3rem;
  color: var(--success-color);
}

.modal-btn {
  background-color: var(--primary-color);
  color: white;
  border: none;
  padding: 0.75rem 2rem;
  border-radius: var(--radius);
  font-weight: 500;
  cursor: pointer;
  margin-top: 1rem;
  transition: all 0.2s ease;
}

.modal-btn:hover {
  background-color: var(--primary-hover);
}

/* 统计卡片样式 */
.stats-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.stat-card {
  background-color: var(--background-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  gap: 1rem;
}

.stat-icon {
  width: 3rem;
  height: 3rem;
  padding: 0.75rem;
  background-color: var(--surface-color);
  border-radius: var(--radius);
  color: var(--primary-color);
}

.stat-icon svg {
  width: 100%;
  height: 100%;
}

.stat-content h3 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.stat-content p {
  color: var(--text-secondary);
  font-size: 0.875rem;
}

/* 用户列表样式 */
.users-container {
  background-color: var(--background-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.users-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.users-header h2 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
}

.users-actions {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.select-all-btn {
  background-color: var(--surface-color);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.select-all-btn:hover {
  background-color: var(--border-color);
}

.search-input {
  padding: 0.5rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  font-size: 0.875rem;
  width: 200px;
}

.search-input:focus {
  outline: none;
  border-color: var(--primary-color);
}

.users-list {
  max-height: 600px;
  overflow-y: auto;
}

/* 用户卡片样式 */
.user-card {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: all 0.2s ease;
}

.user-card:hover {
  background-color: var(--surface-color);
}

.user-card:last-child {
  border-bottom: none;
}

.user-checkbox {
  width: 1rem;
  height: 1rem;
  cursor: pointer;
}

.user-avatar {
  width: 3rem;
  height: 3rem;
  background-color: var(--primary-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 1.125rem;
}

.user-info {
  flex: 1;
}

.user-name {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.user-meta {
  display: flex;
  gap: 1rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.user-actions {
  display: flex;
  gap: 0.5rem;
}

.action-btn {
  padding: 0.5rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  background-color: var(--background-color);
  color: var(--text-primary);
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.action-btn:hover {
  background-color: var(--surface-color);
}

.action-btn.primary {
  background-color: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

.action-btn.primary:hover {
  background-color: var(--primary-hover);
}

.action-btn.danger {
  background-color: var(--danger-color);
  color: white;
  border-color: var(--danger-color);
}

.action-btn.danger:hover {
  background-color: #DC2626;
}

/* 批量操作栏 */
.batch-actions {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  background-color: var(--text-primary);
  color: white;
  padding: 1rem 2rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 100;
}

.batch-content {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.batch-btn {
  background-color: var(--primary-color);
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.batch-btn:hover {
  background-color: var(--primary-hover);
}

/* 空状态样式 */
.empty-state {
  padding: 4rem 2rem;
  text-align: center;
  color: var(--text-secondary);
}

.empty-icon {
  width: 4rem;
  height: 4rem;
  margin: 0 auto 1rem;
  opacity: 0.5;
}

.empty-state h3 {
  font-size: 1.125rem;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

/* 图片模态框样式 */
.image-modal {
  padding: 2rem;
}

.modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.image-modal-content {
  background-color: var(--background-color);
  border-radius: var(--radius-lg);
  max-width: 90%;
  max-height: 90%;
  width: 800px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  position: relative;
}

.image-modal-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.image-modal-header h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
}

.close-btn {
  background: none;
  border: none;
  padding: 0.5rem;
  cursor: pointer;
  border-radius: var(--radius);
  color: var(--text-secondary);
  transition: all 0.2s ease;
}

.close-btn:hover {
  background-color: var(--surface-color);
  color: var(--text-primary);
}

.close-btn svg {
  width: 1.25rem;
  height: 1.25rem;
}

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

.image-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 0.75rem;
  max-height: 400px;
  overflow-y: auto;
}

.gallery-item {
  aspect-ratio: 1;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.gallery-item:hover {
  transform: scale(1.05);
  box-shadow: var(--shadow-md);
  z-index: 10;
}

.gallery-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* 图片查看器样式 */
.image-viewer {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.image-viewer.active {
  opacity: 1;
  visibility: visible;
}

.image-viewer-content {
  position: relative;
  max-width: 95%;
  max-height: 95%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.image-viewer-main {
  position: relative;
  max-width: 100%;
  max-height: 85vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.image-viewer-image {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  transition: transform 0.2s ease;
  cursor: zoom-in;
}

.image-viewer-image.zoomed {
  cursor: zoom-out;
}

.image-viewer-controls {
  position: absolute;
  top: 20px;
  right: 20px;
  display: flex;
  gap: 10px;
}

.image-viewer-btn {
  background-color: rgba(255, 255, 255, 0.9);
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--text-primary);
}

.image-viewer-btn:hover {
  background-color: rgba(255, 255, 255, 1);
  transform: scale(1.1);
}

.image-viewer-btn svg {
  width: 20px;
  height: 20px;
}

.image-viewer-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background-color: rgba(255, 255, 255, 0.9);
  border: none;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--text-primary);
}

.image-viewer-nav:hover {
  background-color: rgba(255, 255, 255, 1);
  transform: translateY(-50%) scale(1.1);
}

.image-viewer-nav.prev {
  left: 20px;
}

.image-viewer-nav.next {
  right: 20px;
}

.image-viewer-nav svg {
  width: 24px;
  height: 24px;
}

.image-viewer-info {
  margin-top: 20px;
  text-align: center;
  color: white;
  background-color: rgba(0, 0, 0, 0.7);
  padding: 10px 20px;
  border-radius: var(--radius);
}

.image-viewer-title {
  font-size: 1.1rem;
  font-weight: 500;
  margin-bottom: 5px;
}

.image-viewer-meta {
  font-size: 0.9rem;
  opacity: 0.8;
}

/* 缩略图导航 */
.image-viewer-thumbnails {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  max-width: 80%;
  overflow-x: auto;
  padding: 10px;
  background-color: rgba(0, 0, 0, 0.5);
  border-radius: var(--radius);
}

.thumbnail-item {
  width: 60px;
  height: 60px;
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.thumbnail-item.active {
  border-color: white;
}

.thumbnail-item:hover {
  transform: scale(1.1);
}

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

.image-modal-footer {
  padding: 1.5rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
}

.modal-download-btn {
  background-color: var(--primary-color);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.modal-download-btn:hover {
  background-color: var(--primary-hover);
}

/* 加载遮罩层 */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.loading-content {
  background-color: var(--background-color);
  padding: 2rem;
  border-radius: var(--radius-lg);
  text-align: center;
  box-shadow: var(--shadow-lg);
}

.loading-content .loading-spinner {
  width: 2rem;
  height: 2rem;
  margin: 0 auto 1rem;
  border-width: 3px;
}

.loading-content p {
  color: var(--text-secondary);
  font-size: 0.875rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .nav-container {
    padding: 0 1rem;
  }
  
  .nav-title {
    font-size: 1.25rem;
  }
  
  .nav-actions {
    gap: 0.5rem;
  }
  
  .main-container {
    padding: 0 1rem;
    margin: 1rem auto;
  }
  
  .upload-card {
    padding: 1.5rem;
  }
  
  .upload-area {
    padding: 2rem 1rem;
  }
  
  .stats-container {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .stat-card {
    padding: 1rem;
  }
  
  .users-header {
    flex-direction: column;
    align-items: stretch;
  }
  
  .users-actions {
    justify-content: space-between;
  }
  
  .search-input {
    width: 150px;
  }
  
  .user-card {
    padding: 1rem;
    flex-wrap: wrap;
  }
  
  .user-actions {
    width: 100%;
    justify-content: flex-end;
    margin-top: 0.5rem;
  }
  
  .batch-actions {
    left: 1rem;
    right: 1rem;
    transform: none;
    width: auto;
  }
  
  .image-modal-content {
    width: 95%;
    max-height: 95%;
  }
  
  .image-gallery {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  }
  
  .modal-content {
    width: 95%;
    padding: 1.5rem;
  }
}

@media (max-width: 480px) {
  .upload-area {
    padding: 1.5rem 1rem;
  }
  
  .upload-icon {
    width: 2rem;
    height: 2rem;
  }
  
  .upload-text {
    font-size: 1rem;
  }
  
  .preview-grid {
    grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
    gap: 0.4rem;
  }
  
  .user-meta {
    flex-direction: column;
    gap: 0.25rem;
  }
  
  .image-gallery {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  }
}

/* 工具提示样式 */
.tooltip {
  position: relative;
  display: inline-block;
}

.tooltip .tooltiptext {
  visibility: hidden;
  width: 120px;
  background-color: var(--text-primary);
  color: white;
  text-align: center;
  border-radius: var(--radius);
  padding: 5px;
  position: absolute;
  z-index: 1;
  bottom: 125%;
  left: 50%;
  margin-left: -60px;
  opacity: 0;
  transition: opacity 0.3s;
  font-size: 0.75rem;
}

.tooltip:hover .tooltiptext {
  visibility: visible;
  opacity: 1;
}

/* 滚动条样式 */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--surface-color);
}

::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-secondary);
}

/* 动画效果 */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeIn 0.3s ease-out;
}

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

.slide-up {
  animation: slideUp 0.4s ease-out;
}

/* 选中状态样式 */
.user-card.selected {
  background-color: rgba(59, 130, 246, 0.05);
  border-left: 3px solid var(--primary-color);
}

/* 拖拽状态样式 */
.upload-area.drag-over {
  border-color: var(--primary-color);
  background-color: rgba(59, 130, 246, 0.05);
}

/* 禁用状态样式 */
.disabled {
  opacity: 0.5;
  pointer-events: none;
}

/* 成功状态样式 */
.success {
  color: var(--success-color);
}

.success-bg {
  background-color: rgba(16, 185, 129, 0.1);
  border-color: var(--success-color);
}

/* 错误状态样式 */
.error {
  color: var(--danger-color);
}

.error-bg {
  background-color: rgba(239, 68, 68, 0.1);
  border-color: var(--danger-color);
}
