* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', Tahoma, sans-serif;
  background:
    radial-gradient(ellipse at top left, #1e1b4b 0%, transparent 60%),
    radial-gradient(ellipse at bottom right, #312e81 0%, transparent 60%),
    linear-gradient(135deg, #0b1026 0%, #0f172a 50%, #1e1b4b 100%);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  color: #e5e7eb;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 20% 80%, rgba(124, 58, 237, 0.28) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(236, 72, 153, 0.22) 0%, transparent 50%),
    radial-gradient(circle at 50% 50%, rgba(56, 189, 248, 0.15) 0%, transparent 55%);
  pointer-events: none;
  z-index: 0;
}

.floating-particles {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

.particle {
  position: absolute;
  width: 10px;
  height: 10px;
  background: rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  animation: float 15s infinite ease-in-out;
  box-shadow: 0 0 12px rgba(167, 139, 250, 0.4);
}

@keyframes float {
  0%, 100% { transform: translateY(100vh) rotate(0deg); opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { transform: translateY(-100vh) rotate(720deg); opacity: 0; }
}

.main-container {
  padding: 20px;
  position: relative;
  z-index: 2;
  animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.header {
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(20px);
  padding: 24px 32px;
  border-radius: 20px;
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.25),
    0 0 0 1px rgba(255, 255, 255, 0.2);
  margin-bottom: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.header h1 {
  background: linear-gradient(135deg, #7c3aed 0%, #ec4899 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-size: 28px;
  font-weight: 700;
}

.header h1 span { -webkit-text-fill-color: #ec4899; }

.storage-info { display: flex; align-items: center; gap: 18px; }

.storage-bar {
  width: 320px;
  height: 24px;
  background: rgba(15, 23, 42, 0.08);
  border-radius: 12px;
  overflow: hidden;
  position: relative;
}

.storage-fill {
  height: 100%;
  background: linear-gradient(90deg, #7c3aed 0%, #ec4899 50%, #f59e0b 100%);
  transition: width 0.5s ease;
  border-radius: 12px;
  box-shadow: 0 0 20px rgba(124, 58, 237, 0.55);
}

.storage-text {
  color: #374151;
  font-weight: 600;
  font-size: 14px;
  min-width: 140px;
}

.content {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 24px;
}

.sidebar {
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(20px);
  padding: 28px 24px;
  border-radius: 20px;
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.25),
    0 0 0 1px rgba(255, 255, 255, 0.2);
  height: fit-content;
}

.sidebar h2 {
  color: #1f2937;
  margin-bottom: 24px;
  font-size: 20px;
  font-weight: 700;
}

.upload-area {
  border: 3px dashed #7c3aed;
  border-radius: 18px;
  padding: 40px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s;
  margin-bottom: 20px;
  background: rgba(124, 58, 237, 0.05);
}

.upload-area:hover,
.upload-area.dragover {
  background: rgba(124, 58, 237, 0.12);
  border-color: #ec4899;
  transform: scale(1.02);
}

.upload-area .icon {
  font-size: 48px;
  color: #7c3aed;
  margin-bottom: 10px;
  display: block;
  animation: bounce 2s infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.upload-area p {
  color: #6d28d9;
  font-weight: 600;
  font-size: 14px;
  line-height: 1.5;
}

.file-input { display: none; }

.action-btn {
  width: 100%;
  padding: 14px;
  margin-bottom: 12px;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 600;
  font-size: 15px;
  transition: all 0.3s;
  color: white;
}

.refresh-btn {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
}

.refresh-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(59, 130, 246, 0.55);
}

.clear-btn {
  background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
}

.clear-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(239, 68, 68, 0.55);
}

.file-container {
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(20px);
  padding: 28px 24px;
  border-radius: 20px;
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.25),
    0 0 0 1px rgba(255, 255, 255, 0.2);
  min-height: 500px;
}

.file-container h2 {
  color: #1f2937;
  margin-bottom: 24px;
  font-size: 20px;
  font-weight: 700;
}

.file-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
}

.file-item {
  background: linear-gradient(135deg, #f9fafb 0%, #f1f5f9 100%);
  padding: 16px 12px;
  border-radius: 14px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s;
  position: relative;
  border: 2px solid transparent;
}

.file-item:hover {
  background: linear-gradient(135deg, #fff 0%, #f9fafb 100%);
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 10px 30px rgba(124, 58, 237, 0.18);
  border-color: #7c3aed;
}

.file-item .file-icon {
  font-size: 40px;
  margin-bottom: 8px;
  display: block;
  transition: transform 0.3s;
}

.file-item:hover .file-icon { transform: scale(1.12); }

.file-item .file-name {
  color: #1f2937;
  font-weight: 600;
  word-break: break-all;
  margin-bottom: 4px;
  font-size: 13px;
  line-height: 1.3;
}

.file-item .file-size {
  color: #6b7280;
  font-size: 11px;
  font-weight: 500;
}

.file-item .file-date {
  color: #9ca3af;
  font-size: 10px;
  margin-top: 2px;
}

.file-item .delete-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: linear-gradient(135deg, #ef4444 0%, #ec4899 100%);
  color: white;
  border: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: bold;
  transition: all 0.3s;
  box-shadow: 0 3px 10px rgba(239, 68, 68, 0.45);
  z-index: 10;
}

.file-item:hover .delete-btn { display: flex; }

.file-item .delete-btn:hover {
  transform: scale(1.2);
  box-shadow: 0 5px 15px rgba(239, 68, 68, 0.65);
}

.file-item .download-btn {
  position: absolute;
  top: 8px;
  right: 38px;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  border: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  transition: all 0.3s;
  box-shadow: 0 3px 10px rgba(16, 185, 129, 0.45);
  z-index: 10;
}

.file-item:hover .download-btn { display: flex; }

.file-item .download-btn:hover {
  transform: scale(1.2);
  box-shadow: 0 5px 15px rgba(16, 185, 129, 0.65);
}

.file-item .note-btn {
  position: absolute;
  top: 8px;
  right: 68px;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: white;
  border: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  transition: all 0.3s;
  box-shadow: 0 3px 10px rgba(245, 158, 11, 0.45);
  z-index: 10;
}

.file-item:hover .note-btn { display: flex; }

.file-item .note-btn:hover {
  transform: scale(1.2);
  box-shadow: 0 5px 15px rgba(245, 158, 11, 0.65);
}

.file-note-display {
  margin-top: 8px;
  padding: 6px 8px;
  background: rgba(245, 158, 11, 0.1);
  border-left: 3px solid #f59e0b;
  border-radius: 4px;
  font-size: 11px;
  color: #6b7280;
  text-align: left;
  word-break: break-word;
}

.note-input-area {
  margin-top: 10px;
  padding: 8px;
  background: rgba(245, 158, 11, 0.08);
  border-radius: 8px;
  border: 1px dashed #f59e0b;
}

.note-textarea {
  width: 100%;
  min-height: 60px;
  padding: 8px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 12px;
  font-family: inherit;
  resize: vertical;
  margin-bottom: 6px;
  background: white;
}

.note-textarea:focus {
  outline: none;
  border-color: #f59e0b;
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.2);
}

.note-save-btn,
.note-cancel-btn {
  padding: 5px 12px;
  border: none;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  margin-right: 6px;
}

.note-save-btn {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: white;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.35);
}

.note-save-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.5);
}

.note-cancel-btn {
  background: #e5e7eb;
  color: #6b7280;
}

.note-cancel-btn:hover {
  background: #d1d5db;
}

.empty-state {
  text-align: center;
  padding: 80px 20px;
  color: #6b7280;
  grid-column: 1 / -1;
}

.empty-state .icon {
  font-size: 96px;
  margin-bottom: 24px;
  display: block;
  animation: floatIcon 3s ease-in-out infinite;
}

@keyframes floatIcon {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-15px); }
}

.empty-state h3 {
  font-size: 24px;
  color: #374151;
  margin-bottom: 12px;
}

.empty-state p {
  font-size: 16px;
  color: #6b7280;
}

.progress-overlay {
  position: fixed;
  inset: 0;
  background: rgba(7, 11, 26, 0.78);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  backdrop-filter: blur(8px);
}

.progress-box {
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(20px);
  padding: 50px 40px;
  border-radius: 24px;
  text-align: center;
  min-width: 420px;
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.5);
  animation: scaleIn 0.3s ease-out;
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

.progress-box h3 {
  color: #1f2937;
  margin-bottom: 24px;
  font-size: 20px;
  font-weight: 700;
}

.progress-bar {
  width: 100%;
  height: 28px;
  background: rgba(15, 23, 42, 0.08);
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 18px;
  position: relative;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #7c3aed 0%, #ec4899 50%, #f59e0b 100%);
  width: 0%;
  transition: width 0.3s ease;
  border-radius: 14px;
  box-shadow: 0 0 20px rgba(124, 58, 237, 0.6);
  position: relative;
  overflow: hidden;
}

.progress-fill::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent);
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.progress-text {
  background: linear-gradient(135deg, #7c3aed 0%, #ec4899 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 700;
  font-size: 24px;
}

@media (max-width: 900px) {
  .content { grid-template-columns: 1fr; }
  .storage-bar { width: 200px; }
}
