* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Georgia', 'Times New Roman', 'PingFang SC', serif;
}

:root {
  --primary: #8B5A2B; /* 深棕色，温暖高级 */
  --secondary: #2E2E4F; /* 深蓝紫色，沉稳优雅 */
  --accent: #D4A017; /* 金色，奢华点缀 */
  --success: #4A7043; /* 深绿色，自然稳重 */
  --light: #F5F2E7; /* 米白色，柔和温暖 */
  --dark: #1A1A1A; /* 深炭灰色，高级深色调 */
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  --transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
  --border-radius: 12px;
  --gradient-bg: linear-gradient(135deg, #2E2E4F 0%, #1A1A1A 100%);
  --gradient-header: linear-gradient(135deg, #2E2E4F 0%, #4A4A6A 100%);
  --gradient-card: linear-gradient(135deg, #F5F2E7 0%, #E8E5D8 100%);
}

body {
  background: var(--gradient-bg);
  min-height: 100vh;
  color: var(--dark);
  padding: 20px;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
}

header {
  text-align: center;
  margin-bottom: 30px;
  padding: 30px 20px;
  background: var(--gradient-header);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  color: var(--light);
  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.05) 0%,
    rgba(255, 255, 255, 0) 70%
  );
  transform: rotate(20deg);
}

h1 {
  color: var(--light);
  margin-bottom: 10px;
  font-weight: 700;
  font-size: 2.5rem;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.subtitle {
  color: rgba(245, 242, 231, 0.9);
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.6;
}

.folder-section {
  background: var(--gradient-card);
  border-radius: var(--border-radius);
  padding: 25px;
  margin-bottom: 25px;
  box-shadow: var(--shadow);
  text-align: center;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(245, 242, 231, 0.3);
}

.folder-section::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(
    90deg,
    var(--primary),
    var(--secondary),
    var(--accent)
  );
}

.folder-info {
  margin-bottom: 20px;
}

.folder-path {
  font-size: 1.1rem;
  margin-bottom: 15px;
  color: var(--dark);
  min-height: 1.5em;
  padding: 10px;
  background: rgba(245, 242, 231, 0.7);
  border-radius: 10px;
  display: inline-block;
}

.folder-path.active {
  color: var(--secondary);
  font-weight: 500;
  background: rgba(46, 46, 79, 0.1);
}

.btn {
  background: linear-gradient(135deg, var(--primary), #A66F3C);
  color: var(--light);
  border: none;
  padding: 14px 28px;
  border-radius: 50px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 4px 15px rgba(139, 90, 43, 0.4);
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  transition: 0.5s;
}

.btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(139, 90, 43, 0.6);
}

.btn:hover::before {
  left: 100%;
}

.btn:disabled {
  background: linear-gradient(135deg, #999999, #777777);
  cursor: not-allowed;
  transform: none;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.btn i {
  font-size: 1.2rem;
}

.stats {
  display: flex;
  justify-content: center;
  gap: 30px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.stat-item {
  background: rgba(245, 242, 231, 0.8);
  padding: 15px 25px;
  border-radius: var(--border-radius);
  text-align: center;
  min-width: 150px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
  transition: var(--transition);
  border: 1px solid rgba(245, 242, 231, 0.7);
}

.stat-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
}

.stat-number {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--secondary);
  margin-bottom: 5px;
}

.stat-label {
  color: #5D5D5D;
  font-size: 0.9rem;
}

.progress-container {
  width: 100%;
  max-width: 500px;
  margin: 20px auto;
  background: rgba(245, 242, 231, 0.7);
  border-radius: 10px;
  overflow: hidden;
  height: 10px;
  display: none;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  width: 0%;
  transition: width 0.3s ease;
  border-radius: 10px;
}

.scan-status {
  margin-top: 10px;
  color: var(--secondary);
  font-size: 0.9rem;
  min-height: 1.2em;
  font-weight: 500;
}

.filters {
  display: flex;
  gap: 10px;
  margin-bottom: 25px;
  flex-wrap: wrap;
  justify-content: center;
}

.filter-btn {
  background: rgba(245, 242, 231, 0.8);
  color: var(--dark);
  border: 1px solid rgba(245, 242, 231, 0.5);
  padding: 10px 20px;
  border-radius: 30px;
  cursor: pointer;
  font-size: 14px;
  transition: var(--transition);
  font-weight: 500;
}

.filter-btn:hover {
  background: rgba(245, 242, 231, 1);
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.filter-btn.active {
  background: linear-gradient(135deg, var(--secondary), #4A4A6A);
  color: var(--light);
  border-color: var(--secondary);
  box-shadow: 0 4px 10px rgba(46, 46, 79, 0.3);
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.image-card {
  background: var(--gradient-card);
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: var(--transition);
  cursor: pointer;
  position: relative;
  border: 1px solid rgba(245, 242, 231, 0.3);
}

.image-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
}

.image-card img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  display: block;
  transition: var(--transition);
}

.image-card:hover img {
  transform: scale(1.05);
}

.image-info {
  padding: 15px;
}

.image-name {
  font-weight: 600;
  margin-bottom: 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--dark);
}

.image-size {
  color: #5D5D5D;
  font-size: 0.9rem;
}

.raw-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--accent);
  color: var(--dark);
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 600;
  z-index: 2;
}

.decoding-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--light);
  font-size: 14px;
  z-index: 1;
}

.viewer {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(26, 26, 26, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

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

.viewer-content {
  position: relative;
  max-width: 90%;
  max-height: 90%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.viewer img {
  max-width: 100%;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.5);
}

.viewer-controls {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 15px;
  background: rgba(245, 242, 231, 0.9);
  padding: 12px 20px;
  border-radius: 30px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.viewer-btn {
  background: none;
  border: none;
  color: var(--secondary);
  font-size: 24px;
  cursor: pointer;
  transition: var(--transition);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.viewer-btn:hover {
  background: rgba(46, 46, 79, 0.1);
  transform: scale(1.1);
}

.close-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(245, 242, 231, 0.9);
  color: var(--secondary);
  border: none;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.close-btn:hover {
  background: var(--light);
  transform: rotate(90deg) scale(1.1);
}

.image-counter {
  position: absolute;
  top: 20px;
  left: 20px;
  color: var(--light);
  font-size: 18px;
  background: rgba(245, 242, 231, 0.2);
  padding: 8px 16px;
  border-radius: 20px;
  backdrop-filter: blur(10px);
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #5D5D5D;
  grid-column: 1 / -1;
  background: rgba(245, 242, 231, 0.7);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
}

.empty-state i {
  font-size: 60px;
  margin-bottom: 20px;
  display: block;
  color: var(--secondary);
}

.empty-state h3 {
  margin-bottom: 10px;
  font-weight: 500;
  color: var(--dark);
}

/* Existing styles (from previous version, abbreviated for brevity) */
:root {
  --primary-bg: #1a1a2e;
  --card-bg: #2e2e4f;
  --text-color: #f5f2e7;
  --accent-color: #8b5a2b;
  --highlight-color: #d4a017;
  --shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
}

body {
  background-color: var(--primary-bg);
  color: var(--text-color);
  font-family: 'Georgia', serif;
  margin: 0;
  padding: 0;
}

/* New: Drop zone styles */
.drop-zone {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(139, 90, 43, 0.3); /* Semi-transparent accent color */
  border: 3px dashed var(--highlight-color);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  pointer-events: none;
}

.drop-zone.active {
  display: flex;
}

.drop-zone p {
  font-size: 24px;
  font-weight: bold;
  color: var(--text-color);
  text-align: center;
  background: var(--card-bg);
  padding: 20px;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

@media (max-width: 768px) {
  .gallery {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  }

  .stats {
    gap: 15px;
  }

  .stat-item {
    min-width: 120px;
    padding: 12px 15px;
  }

  .stat-number {
    font-size: 1.5rem;
  }

  .filters {
    gap: 8px;
  }

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

  .viewer-controls {
    bottom: 10px;
  }

  .viewer-btn {
    width: 35px;
    height: 35px;
    font-size: 20px;
  }
}

@media (max-width: 480px) {
  .gallery {
    grid-template-columns: 1fr;
  }

  .image-card img {
    height: 200px;
  }

  .stats {
    flex-direction: column;
    align-items: center;
  }

  .stat-item {
    width: 100%;
    max-width: 200px;
  }
}