:root {
  --primary: #4a6fa5;
  --secondary: #6b8cbc;
  --light: #f8f9fa;
  --dark: #343a40;
  --success: #28a745;
  --danger: #dc3545;
  --warning: #ffc107;
  --info: #17a2b8;
  --border: #dee2e6;
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

body {
  background: linear-gradient(135deg, #f0f2f5, #e4e7eb);
  color: var(--dark);
  line-height: 1.6;
  padding-bottom: 30px;
  min-height: 100vh;
}

.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 20px;
}

header {
  text-align: center;
  padding: 30px 0;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  border-radius: 10px;
  margin-bottom: 30px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

header::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(
    circle,
    rgba(255, 255, 255, 0.1) 0%,
    rgba(255, 255, 255, 0) 70%
  );
  transform: rotate(30deg);
}

header h1 {
  font-size: 2.5rem;
  margin-bottom: 10px;
  position: relative;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

header p {
  font-size: 1.1rem;
  opacity: 0.9;
  position: relative;
  max-width: 600px;
  margin: 0 auto;
}

.upload-section {
  background: white;
  border-radius: 10px;
  padding: 25px;
  margin-bottom: 30px;
  box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
  position: relative;
  overflow: hidden;
}

.upload-section::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(
    90deg,
    var(--primary),
    var(--info),
    var(--success)
  );
  opacity: 0.7;
}

.upload-area {
  border: 2px dashed var(--border);
  border-radius: 8px;
  padding: 40px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  background-color: #fafafa;
  position: relative;
}

.upload-area:hover,
.upload-area.drag-over {
  border-color: var(--primary);
  background-color: rgba(74, 111, 165, 0.05);
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.upload-area i {
  font-size: 3.5rem;
  color: var(--primary);
  margin-bottom: 15px;
  display: block;
  transition: all 0.3s;
}

.upload-area:hover i {
  transform: scale(1.1);
}

.upload-area h3 {
  margin-bottom: 10px;
  color: var(--dark);
}

.upload-area p {
  color: #6c757d;
  margin-bottom: 15px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  background-color: var(--primary);
  color: white;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 500;
  transition: all 0.3s ease;
  text-decoration: none;
  gap: 8px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.btn i {
  font-size: 0.9em;
}

.btn:hover {
  background-color: var(--secondary);
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
}

.btn:active {
  transform: translateY(-1px);
}

.btn-success {
  background-color: var(--success);
}

.btn-success:hover {
  background-color: #218838;
}

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

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

.btn-info {
  background-color: #87CEFA; /* 浅蓝色 */
}

.btn-info:hover {
  background-color: #6cb8f8;
}

.btn-qr{
  background-color: #4a6fa5;
}

.btn-warning {
  background-color: var(--warning);
  color: #212529;
}

.btn-warning:hover {
  background-color: #e0a800;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.9rem;
}

.file-list {
  background: white;
  border-radius: 10px;
  padding: 25px;
  box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
}

.file-list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.file-item {
  display: flex;
  align-items: center;
  padding: 15px;
  border-bottom: 1px solid var(--border);
  transition: all 0.2s;
  border-radius: 8px;
}

.file-item:last-child {
  border-bottom: none;
}

.file-item:hover {
  background-color: #f8f9fa;
  transform: translateX(5px);
}

.file-icon {
  width: 80px;
  height: 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #e9ecef, #f1f3f5);
  border-radius: 8px;
  margin-right: 15px;
  font-size: 1.8rem;
  color: var(--primary);
  position: relative;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.file-icon .ext {
  position: absolute;
  bottom: 5px;
  background: rgba(255, 255, 255, 0.8);
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 12px;
  font-weight: bold;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.file-info {
  flex-grow: 1;
  min-width: 0;
}

.file-name {
  font-weight: 500;
  margin-bottom: 8px;
  word-break: break-all;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  max-height: 3em;
}

.file-meta {
  font-size: 0.85rem;
  color: #6c757d;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.file-meta span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.file-actions {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

.progress-container {
  margin-top: 20px;
  display: none;
}

.progress-bar {
  height: 12px;
  background-color: #e9ecef;
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 10px;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

.progress {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--info));
  width: 0%;
  transition: width 0.3s ease;
  position: relative;
}

.progress::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    45deg,
    rgba(255, 255, 255, 0.2) 25%,
    transparent 25%,
    transparent 50%,
    rgba(255, 255, 255, 0.2) 50%,
    rgba(255, 255, 255, 0.2) 75%,
    transparent 75%,
    transparent
  );
  background-size: 20px 20px;
  animation: progressStripes 1s linear infinite;
}

@keyframes progressStripes {
  0% {
    background-position: 0 0;
  }
  100% {
    background-position: 20px 0;
  }
}

.progress-text {
  text-align: center;
  font-size: 0.9rem;
  color: #6c757d;
  display: flex;
  justify-content: space-between;
}

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: #6c757d;
}

.empty-state i {
  font-size: 3rem;
  margin-bottom: 15px;
  color: #ced4da;
}

.empty-state p {
  font-size: 1.1rem;
}

footer {
  text-align: center;
  padding: 30px 0;
  color: #6c757d;
  font-size: 0.9rem;
}

.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background-color: var(--success);
  color: white;
  padding: 15px 25px;
  border-radius: 8px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  gap: 10px;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  z-index: 1000;
  max-width: 350px;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.toast.error {
  background-color: var(--danger);
}

.toast.warning {
  background-color: var(--warning);
  color: #212529;
}

.toast.info {
  background-color: var(--info);
}

.meta-icon {
  font-size: 0.9em;
  opacity: 0.7;
}

.clear-history {
  font-size: 0.9rem;
  color: #6c757d;
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s;
  padding: 5px 10px;
  border-radius: 4px;
}

.clear-history:hover {
  color: var(--danger);
  background-color: rgba(220, 53, 69, 0.1);
}

.pagination {
  display: flex;
  justify-content: center;
  margin-top: 20px;
  gap: 10px;
  align-items: center;
}

.pagination-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: white;
  border: 1px solid var(--border);
  color: var(--primary);
  cursor: pointer;
  transition: all 0.2s;
}

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

.pagination-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background-color: #e9ecef;
  color: #6c757d;
}

.pagination-info {
  font-size: 0.9rem;
  color: #6c757d;
}

.pagination-dots {
  display: flex;
  gap: 5px;
}

.pagination-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #ced4da;
}

.pagination-dot.active {
  background-color: var(--primary);
}

.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.8);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 2000;
  display: none;
}

.loading-spinner {
  width: 60px;
  height: 60px;
  border: 5px solid rgba(74, 111, 165, 0.2);
  border-top: 5px solid var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 20px;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.loading-text {
  font-size: 1.2rem;
  color: var(--dark);
}

/* 二维码模态框样式 */
.qr-modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
}

.qr-modal-content {
  background-color: #fff;
  padding: 25px;
  border-radius: 12px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
  text-align: center;
  max-width: 320px;
  width: 90%;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation: modalIn 0.3s ease-out;
}

.qr-modal-header {
  cursor: move;
  padding-bottom: 15px;
  border-bottom: 1px solid #eee;
  margin-bottom: 15px;
  position: relative;
}

.qr-modal-header h3 {
  margin: 0;
  color: #333;
}

.close-modal {
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 28px;
  font-weight: bold;
  color: #aaa;
  cursor: pointer;
}

.close-modal:hover {
  color: #777;
}

#qrContainer {
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.qr-modal-content p {
  margin-top: 15px;
  font-size: 14px;
  color: #666;
}

@keyframes modalIn {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.8);
  }
  100% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

/* 响应式设计 - 768px (平板) */
@media (max-width: 768px) {
  .container {
    padding: 15px;
  }

  header {
    padding: 20px 0;
  }

  header h1 {
    font-size: 2rem;
  }

  .upload-section,
  .file-list {
    padding: 20px;
  }

  .file-item {
    flex-wrap: wrap;
  }

  .file-icon {
    width: 60px;
    height: 60px;
    font-size: 1.5rem;
  }

  .file-info {
    flex-basis: calc(100% - 75px);
  }

  .file-name {
    font-size: 0.85rem;
    line-height: 1.4;
    margin-bottom: 5px;
  }

  .file-meta {
    gap: 6px;
    font-size: 0.75rem;
  }

  .file-actions {
    width: 100%;
    margin-top: 10px;
    justify-content: flex-end;
    gap: 3px;
  }

  .file-actions .btn-sm {
    padding: 4px 6px;
    font-size: 0.8rem;
  }

  .pagination {
    flex-wrap: wrap;
  }
}

/* 响应式设计 - 425px (中等移动设备) */
@media (max-width: 425px) {
  .file-name {
    font-size: 0.8rem;
    -webkit-line-clamp: 3;
    max-height: 4rem;
  }
    
  .file-actions {
    transform: scale(1);
    justify-content: center;
    gap: 6px;
  }
  .file-actions .btn-sm {
    padding: 6px 10px;
    font-size: 0.85rem;
  }
  .file-actions .btn-sm i {
    font-size: 0.6rem;
  }
  
  .btn {
    padding: 8px 16px;
    font-size: 0.9rem;
  }
  .btn i {
    font-size: 0.8em;
  }
  
  .file-icon {
    width: 50px;
    height: 50px;
    font-size: 1.2rem;
  }
}

/* 响应式设计 - 375px (小移动设备) */
@media (max-width: 375px) {
  .file-actions {
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
  }

  .file-actions .btn-sm {
    width: 100%;
    text-align: center;
    padding: 8px;
  }

  .file-item {
    padding: 10px;
  }

  .file-icon {
    width: 45px;
    height: 45px;
    font-size: 1rem;
  }

  .file-name {
    font-size: 0.75rem;
  }

  .file-meta {
    font-size: 0.7rem;
  }
}
