:root {
  --bg-primary: #0a0a0c;
  --bg-secondary: #121216;
  --bg-card: #18181f;
  --bg-card-hover: #22222b;
  --accent-gold: #e5b869;
  --accent-gold-hover: #f3cb7e;
  --accent-gold-glow: rgba(229, 184, 105, 0.25);
  --text-primary: #f5f5f7;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-gold: rgba(229, 184, 105, 0.3);
  --glass-bg: rgba(18, 18, 22, 0.75);
  --glass-border: rgba(255, 255, 255, 0.1);
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 16px 36px rgba(0, 0, 0, 0.5);
  --shadow-gold: 0 8px 24px var(--accent-gold-glow);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  --transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Background Ambient Lighting */
.ambient-glow {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 90vw;
  max-width: 1200px;
  height: 450px;
  background: radial-gradient(circle, rgba(229, 184, 105, 0.08) 0%, rgba(18, 18, 22, 0) 70%);
  pointer-events: none;
  z-index: 0;
}

/* Header & Hero Section */
header {
  position: relative;
  z-index: 10;
  padding: 4rem 1.5rem 2.5rem;
  text-align: center;
  border-bottom: 1px solid var(--border-subtle);
  background: linear-gradient(180deg, rgba(24, 24, 31, 0.6) 0%, rgba(10, 10, 12, 0.9) 100%);
  backdrop-filter: blur(12px);
}

.hero-content {
  max-width: 800px;
  margin: 0 auto;
}

.badge-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 1rem;
  background: rgba(229, 184, 105, 0.12);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-full);
  color: var(--accent-gold);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 1.25rem;
}

.badge-tag svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

h1 {
  font-family: 'Noto Serif TC', 'Playfair Display', Georgia, 'Microsoft YaHei', 'PingFang SC', serif;
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #ffffff;
  margin-bottom: 0.75rem;
  line-height: 1.25;
}

h1 .highlight {
  color: var(--accent-gold);
  background: linear-gradient(135deg, #fce5b5 0%, #e5b869 50%, #c49542 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  color: var(--text-secondary);
  font-size: 1.1rem;
  font-weight: 300;
  margin-bottom: 1.5rem;
}

.hero-stats {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 2rem;
  margin-top: 1rem;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Sticky Control Toolbar */
.toolbar-wrapper {
  position: sticky;
  top: 1rem;
  z-index: 100;
  max-width: 1300px;
  margin: 1.5rem auto;
  padding: 0 1.25rem;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1.25rem;
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.toolbar-left, .toolbar-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.search-box input {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 0.5rem 1rem 0.5rem 2.25rem;
  color: var(--text-primary);
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
  transition: var(--transition);
  width: 200px;
}

.search-box input:focus {
  border-color: var(--accent-gold);
  box-shadow: 0 0 0 3px var(--accent-gold-glow);
  width: 240px;
}

.search-icon {
  position: absolute;
  left: 0.8rem;
  width: 16px;
  height: 16px;
  stroke: var(--text-muted);
  pointer-events: none;
}

.btn-tool {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
  padding: 0.5rem 0.9rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
  user-select: none;
}

.btn-tool:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-tool.active {
  background: rgba(229, 184, 105, 0.15);
  color: var(--accent-gold);
  border-color: var(--border-gold);
}

.btn-tool svg {
  width: 16px;
  height: 16px;
}

.select-tool {
  background: var(--bg-secondary);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-family: inherit;
  outline: none;
  cursor: pointer;
  transition: var(--transition);
}

.select-tool:focus {
  border-color: var(--accent-gold);
}

/* Gallery Grid */
main {
  max-width: 1440px;
  margin: 0 auto;
  padding: 1rem 1.25rem 5rem;
  position: relative;
  z-index: 1;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
  transition: var(--transition);
}

.gallery-grid.grid-dense {
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.85rem;
}

.gallery-grid.grid-large {
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  gap: 1.75rem;
}

/* Photo Card */
.photo-card {
  position: relative;
  background-color: var(--bg-card);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  aspect-ratio: 4 / 3;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.35s ease, border-color 0.35s ease;
}

.photo-card:hover {
  transform: translateY(-6px) scale(1.01);
  box-shadow: var(--shadow-lg), var(--shadow-gold);
  border-color: var(--border-gold);
}

.photo-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  position: relative;
  z-index: 1;
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
  opacity: 1;
}

.photo-card:hover img {
  transform: scale(1.06);
}

.photo-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 50%, rgba(0, 0, 0, 0.75) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 1rem;
  z-index: 2;
}

.photo-card:hover .photo-overlay {
  opacity: 1;
}

.photo-meta {
  color: #ffffff;
  font-size: 0.85rem;
  font-weight: 500;
  text-shadow: 0 2px 4px rgba(0,0,0,0.6);
}

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

.card-action-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.card-action-btn:hover {
  background: var(--accent-gold);
  color: #0a0a0c;
  transform: scale(1.1);
}

/* Lightbox Modal */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(5, 5, 8, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.lightbox.active {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  background: rgba(10, 10, 14, 0.6);
  border-bottom: 1px solid var(--border-subtle);
  z-index: 10;
}

.lightbox-counter {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--accent-gold);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.lightbox-filename {
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 400;
}

.lightbox-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.lightbox-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.lightbox-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.3);
}

.lightbox-btn.active {
  background: var(--accent-gold);
  color: #0a0a0c;
  border-color: var(--accent-gold);
}

.lightbox-btn svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
}

/* Lightbox Body */
.lightbox-body {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  overflow: hidden;
  user-select: none;
}

.lightbox-main-img-wrap {
  max-width: 90vw;
  max-height: 75vh;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.25s ease-out;
}

.lightbox-main-img {
  max-width: 100%;
  max-height: 75vh;
  object-fit: contain;
  border-radius: var(--radius-sm);
  box-shadow: 0 20px 50px rgba(0,0,0,0.8);
  transition: opacity 0.25s ease;
}

/* Lightbox Nav Arrows */
.lightbox-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
  border-radius: var(--radius-full);
  background: rgba(20, 20, 26, 0.7);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-subtle);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  z-index: 5;
}

.lightbox-nav-btn:hover {
  background: var(--accent-gold);
  color: #0a0a0c;
  transform: translateY(-50%) scale(1.1);
  box-shadow: var(--shadow-gold);
}

.lightbox-nav-btn.prev { left: 1.5rem; }
.lightbox-nav-btn.next { right: 1.5rem; }

/* Lightbox Bottom Thumbnail Bar */
.lightbox-footer {
  padding: 0.75rem 1rem;
  background: rgba(10, 10, 14, 0.8);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.thumbnail-strip {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding: 0.25rem 0.5rem;
  max-width: 100%;
  scrollbar-width: thin;
  scrollbar-color: var(--accent-gold) transparent;
}

.thumbnail-strip::-webkit-scrollbar {
  height: 4px;
}
.thumbnail-strip::-webkit-scrollbar-thumb {
  background: var(--accent-gold);
  border-radius: 4px;
}

.thumb-item {
  width: 54px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 4px;
  overflow: hidden;
  cursor: pointer;
  opacity: 0.5;
  border: 2px solid transparent;
  transition: var(--transition);
}

.thumb-item:hover {
  opacity: 0.85;
}

.thumb-item.active {
  opacity: 1;
  border-color: var(--accent-gold);
  transform: scale(1.08);
}

.thumb-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Slideshow Progress Bar */
.slideshow-progress {
  position: absolute;
  top: 0;
  left: 0;
  height: 3px;
  background: var(--accent-gold);
  width: 0%;
  transition: width linear;
  z-index: 20;
}

/* Floating Actions */
.fab-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  z-index: 90;
}

.fab-btn {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  transition: var(--transition);
}

.fab-btn:hover {
  background: var(--accent-gold);
  color: #0a0a0c;
  transform: translateY(-4px);
  box-shadow: var(--shadow-gold);
}

.fab-btn.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
}

/* Footer */
footer {
  text-align: center;
  padding: 3rem 1.5rem;
  border-top: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 0.9rem;
}

footer .highlight {
  color: var(--accent-gold);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  header {
    padding: 3rem 1rem 2rem;
  }
  .toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .toolbar-left, .toolbar-right {
    justify-content: space-between;
    width: 100%;
  }
  .search-box input {
    width: 100%;
  }
  .search-box input:focus {
    width: 100%;
  }
  .lightbox-nav-btn {
    width: 42px;
    height: 42px;
  }
  .lightbox-nav-btn.prev { left: 0.5rem; }
  .lightbox-nav-btn.next { right: 0.5rem; }
  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 0.75rem;
  }
}
