/*
Theme Name: Lumière
Theme URI: https://github.com/lumiere-theme
Author: Senge
Author URI: https://github.com/lumiere-theme
Description: A dark, immersive photography gallery theme for Typecho
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: lumiere
Tags: photography, gallery, dark, minimalist, masonry
*/

/* ═══════════════════════════════════════════
   CSS Variables
   ═══════════════════════════════════════════ */

:root {
  --bg: #0a0a0a;
  --bg-elevated: #111111;
  --bg-surface: #161616;
  --accent: #c8a45e;
  --accent-dim: rgba(200,164,94,0.12);
  --text-primary: #e8e4dc;
  --text-secondary: #8a8580;
  --text-muted: #555250;
  --border: rgba(255,255,255,0.06);
  --border-accent: rgba(200,164,94,0.2);
  --radius: 2px;
  --radius-lg: 4px;
  --font-display: 'Cormorant Garamond', 'Noto Serif SC', serif;
  --font-body: 'Noto Serif SC', 'Cormorant Garamond', serif;
  --font-mono: 'DM Mono', monospace;
  --ease: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --header-bg: rgba(10,10,10,0.95);
  --header-scroll-bg: rgba(10,10,10,0.98);
  --card-bg: var(--bg-surface);
  --card-border: var(--border);
  --input-bg: var(--bg-surface);
  --overlay-bg: rgba(0,0,0,0.92);
  --card-overlay: linear-gradient(to top, rgba(10,10,10,0.85) 0%, transparent 60%);
  --shadow: 0 20px 80px rgba(0,0,0,0.6);
  --gallery-gap: #0a0a0a;
}

/* Light Mode */
html.light {
  --bg: #f0ece6;
  --bg-elevated: #e8e3dc;
  --bg-surface: #faf8f5;
  --accent: #8b6914;
  --accent-dim: rgba(139,105,20,0.1);
  --text-primary: #1a1816;
  --text-secondary: #5a5550;
  --text-muted: #8a8580;
  --border: rgba(0,0,0,0.08);
  --border-accent: rgba(139,105,20,0.3);
  --header-bg: rgba(240,236,230,0.92);
  --header-scroll-bg: rgba(240,236,230,0.98);
  --card-bg: #faf8f5;
  --card-border: rgba(0,0,0,0.06);
  --input-bg: #e8e3dc;
  --overlay-bg: rgba(240,236,230,0.96);
  --card-overlay: linear-gradient(to top, rgba(26,24,22,0.6) 0%, transparent 60%);
  --shadow: 0 8px 40px rgba(0,0,0,0.06);
  --gallery-gap: #e8e3dc;
}

/* ═══════════════════════════════════════════
   Reset & Base
   ═══════════════════════════════════════════ */

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.4s var(--ease), color 0.4s var(--ease);
}

body {
  background-color: var(--bg);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.9;
  min-height: 100vh;
  overflow-x: hidden;
  transition: background-color 0.4s var(--ease), color 0.4s var(--ease);
  animation: pageIn 0.5s var(--ease) both;
}

@keyframes pageIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0.03;
  pointer-events: none;
  z-index: 9999;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='1'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px 256px;
}

html.light body::before {
  opacity: 0;
}

html.light .search-overlay-close {
  color: var(--text-secondary);
}

/* Global transition for theme switching */
.site-header,
.site-footer,
.breadcrumb,
.comment-item,
.info-card,
.nav-card,
.about-wrap .gear-card,
.back-to-top,
.search-overlay,
.lightbox {
  transition: background 0.4s var(--ease), color 0.4s var(--ease), border-color 0.4s var(--ease);
}

::selection {
  background-color: var(--accent);
  color: var(--bg);
}

::-webkit-scrollbar {
  width: thin;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background-color: var(--text-muted);
  border-radius: 2px;
}

* {
  scrollbar-width: thin;
  scrollbar-color: var(--text-muted) transparent;
}

a {
  color: var(--text-primary);
  text-decoration: none;
  transition: color 0.3s var(--ease);
}

a:hover {
  color: var(--accent);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ═══════════════════════════════════════════
   Typography
   ═══════════════════════════════════════════ */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 300;
  line-height: 1.2;
}

/* ═══════════════════════════════════════════
   Header
   ═══════════════════════════════════════════ */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 64px;
  z-index: 1000;
  background: linear-gradient(180deg, var(--header-bg) 0%, transparent 100%);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 40px;
  transition: background 0.4s var(--ease);
}

.site-logo {
  font-family: var(--font-display);
  font-size: 24px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-primary);
  font-weight: 400;
}

.site-logo .logo-first {
  color: var(--accent);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 28px;
}

.site-nav a {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-secondary);
  position: relative;
  padding-bottom: 4px;
}

.site-nav a:hover,
.site-nav a.active {
  color: var(--accent);
}

.site-nav a.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background-color: var(--accent);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Hamburger Button - hidden on desktop */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  z-index: 1001;
}

.nav-backdrop {
  display: none;
}

@media (max-width: 768px) {
  .nav-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s var(--ease);
  }

  .nav-backdrop.open {
    opacity: 1;
    pointer-events: auto;
  }
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-primary);
  margin: 5px 0;
  transition: all 0.3s var(--ease);
  border-radius: 1px;
}

.nav-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.nav-toggle.active span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* ═══════════════════════════════════════════
   Hero Section
   ═══════════════════════════════════════════ */

.hero {
  position: relative;
  width: 100%;
  overflow: hidden;
  z-index: 0;
}

.hero-none {
  height: 64px;
}

.hero-single {
  height: 70vh;
  min-height: 400px;
  max-height: 700px;
  position: relative;
  overflow: hidden;
}

.hero-single .hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.4) saturate(0.8);
  animation: kenBurns 25s ease-in-out infinite alternate;
}

@keyframes kenBurns {
  0% { transform: scale(1); }
  100% { transform: scale(1.06); }
}

.hero-single::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 40%;
  background: linear-gradient(to top, var(--bg) 0%, transparent 100%);
  pointer-events: none;
}

.hero-single .hero-content {
  position: absolute;
  bottom: 12%;
  left: 40px;
  z-index: 2;
}

.hero-single .hero-title {
  font-family: var(--font-display);
  font-size: clamp(36px, 5vw, 72px);
  font-weight: 300;
  color: var(--text-primary);
  line-height: 1.1;
}

.hero-single .hero-title em {
  color: var(--accent);
  font-style: italic;
}

.hero-single .hero-desc {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-secondary);
  letter-spacing: 0.05em;
  margin-top: 16px;
}

/* Carousel Hero */
.hero-carousel {
  height: 70vh;
  position: relative;
  overflow: hidden;
}

.hero-carousel .carousel-track {
  display: flex;
  gap: 4px;
  height: 100%;
  animation: carouselScroll 40s linear infinite;
  width: max-content;
}

@keyframes carouselScroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.hero-carousel .carousel-slide {
  width: 40vw;
  height: 100%;
  position: relative;
  flex-shrink: 0;
}

.hero-carousel .carousel-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.5);
}

.hero-carousel .carousel-slide::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 40%;
  background: linear-gradient(to top, var(--bg) 0%, transparent 100%);
  pointer-events: none;
}

.hero-carousel .carousel-slide .slide-title {
  position: absolute;
  bottom: 24px;
  left: 24px;
  font-family: var(--font-display);
  font-size: 18px;
  color: var(--text-primary);
  z-index: 2;
}

/* Grid Hero */
.hero-grid {
  height: 55vh;
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 4px;
  overflow: hidden;
}

.hero-grid .grid-item {
  position: relative;
  overflow: hidden;
}

.hero-grid .grid-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: all 0.6s var(--ease);
}

.hero-grid .grid-item:hover img {
  filter: brightness(0.6);
  transform: scale(1.03);
}

.hero-grid .grid-item::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 40%;
  background: linear-gradient(to top, var(--bg) 0%, transparent 100%);
  pointer-events: none;
}

.hero-grid .grid-item .grid-label {
  position: absolute;
  bottom: 20px;
  left: 20px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-secondary);
  z-index: 2;
}

/* ═══════════════════════════════════════════
   Section Header
   ═══════════════════════════════════════════ */

.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 60px 40px 32px;
  max-width: 1600px;
  margin: 0 auto;
}

.section-header .section-label {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
}

.section-header .section-title {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 300;
  color: var(--text-primary);
}

.section-header .section-desc {
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 8px;
}

.section-header .category-tabs {
  display: flex;
  gap: 20px;
}

.section-header .category-tabs a {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  transition: color 0.3s var(--ease);
}

.section-header .category-tabs a:hover,
.section-header .category-tabs a.active {
  color: var(--accent);
}

/* ═══════════════════════════════════════════
   Masonry Gallery
   ═══════════════════════════════════════════ */

/* Gallery Section */
.gallery-section {
  position: relative;
  z-index: 1;
}

.gallery-masonry {
  padding: 0 40px 60px;
  max-width: 1600px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(var(--cols, 4), 1fr);
  gap: var(--gap, 12px);
}

.gallery-masonry .photo-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  animation: fadeInUp 0.6s var(--ease) both;
  aspect-ratio: 4/3;
}

.gallery-masonry .photo-card.is-sticky {
  outline: 1px solid var(--border-accent);
  outline-offset: -1px;
}

.gallery-masonry .sticky-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 3;
  padding: 2px 8px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--bg);
  background: var(--accent);
  border-radius: var(--radius);
}

.gallery-masonry .photo-card:nth-child(1) { animation-delay: 0.05s; }
.gallery-masonry .photo-card:nth-child(2) { animation-delay: 0.1s; }
.gallery-masonry .photo-card:nth-child(3) { animation-delay: 0.15s; }
.gallery-masonry .photo-card:nth-child(4) { animation-delay: 0.2s; }
.gallery-masonry .photo-card:nth-child(5) { animation-delay: 0.25s; }
.gallery-masonry .photo-card:nth-child(6) { animation-delay: 0.3s; }
.gallery-masonry .photo-card:nth-child(7) { animation-delay: 0.35s; }
.gallery-masonry .photo-card:nth-child(8) { animation-delay: 0.4s; }
.gallery-masonry .photo-card:nth-child(9) { animation-delay: 0.45s; }
.gallery-masonry .photo-card:nth-child(10) { animation-delay: 0.5s; }
.gallery-masonry .photo-card:nth-child(11) { animation-delay: 0.55s; }
.gallery-masonry .photo-card:nth-child(12) { animation-delay: 0.6s; }

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.gallery-masonry .photo-card .photo-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: all 0.6s var(--ease);
}

.gallery-masonry .photo-card:hover .photo-thumb {
  transform: scale(1.04);
  filter: brightness(0.7);
}

.gallery-masonry .photo-card .photo-overlay {
  position: absolute;
  inset: 0;
  background: var(--card-overlay);
  opacity: 0;
  transition: opacity 0.4s var(--ease);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 20px;
}

.gallery-masonry .photo-card:hover .photo-overlay {
  opacity: 1;
}

.gallery-masonry .photo-card .photo-overlay .photo-title {
  font-family: var(--font-display);
  font-size: 20px;
  color: var(--text-primary);
  transform: translateY(8px);
  transition: transform 0.4s var(--ease);
}

.gallery-masonry .photo-card:hover .photo-overlay .photo-title {
  transform: translateY(0);
}

.gallery-masonry .photo-card .photo-overlay .photo-meta {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-secondary);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-top: 6px;
  transform: translateY(8px);
  transition: transform 0.4s var(--ease) 0.05s;
}

.gallery-masonry .photo-card:hover .photo-overlay .photo-meta {
  transform: translateY(0);
}

.gallery-masonry .photo-card .card-link {
  position: absolute;
  inset: 0;
  z-index: 5;
}

.gallery-masonry .photo-card .photo-overlay .card-link-text {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-top: 10px;
  display: inline-block;
  transform: translateY(8px);
  transition: transform 0.4s var(--ease) 0.1s, color 0.3s var(--ease);
}

.gallery-masonry .photo-card:hover .photo-overlay .card-link-text {
  transform: translateY(0);
}

.gallery-masonry .photo-card .photo-overlay .card-link-text:hover {
  color: var(--text-primary);
}

/* ═══════════════════════════════════════════
   Pagination
   ═══════════════════════════════════════════ */

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  padding: 40px 0 80px;
}

.pagination ol {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.pagination li {
  display: inline-block;
}

.pagination a,
.pagination span {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all 0.3s var(--ease);
  text-decoration: none;
}

.pagination a:hover {
  color: var(--accent);
  border-color: var(--border-accent);
}

.pagination .current {
  color: var(--accent);
  border-color: var(--accent);
  background-color: var(--accent-dim);
}

.pagination .current span {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* ═══════════════════════════════════════════
   Post Detail - Viewer
   ═══════════════════════════════════════════ */

.viewer {
  position: relative;
  width: 100%;
  height: calc(100vh - 64px);
  margin-top: 64px;
  background-color: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  z-index: 0;
}

/* 当存在面包屑时，viewer 再减去面包屑高度（约 44px） */
.breadcrumb + .viewer {
  margin-top: 108px;
  height: calc(100vh - 108px);
}

.viewer .viewer-img {
  max-width: 90%;
  max-height: 85vh;
  object-fit: contain;
  box-shadow: var(--shadow);
  animation: viewerEnter 0.8s var(--ease) both;
}

.viewer .viewer-img.hidden {
  display: none;
}

@keyframes viewerEnter {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.viewer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 100px;
  background: linear-gradient(to bottom, var(--bg) 0%, transparent 100%);
  z-index: 2;
  pointer-events: none;
}

.viewer::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 120px;
  background: linear-gradient(to top, var(--bg) 0%, transparent 100%);
  z-index: 2;
  pointer-events: none;
}

.viewer .viewer-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
  font-size: 18px;
  cursor: pointer;
  opacity: 0;
  transition: all 0.3s var(--ease);
  z-index: 3;
}

.viewer:hover .viewer-nav {
  opacity: 1;
}

button.viewer-nav {
  opacity: 0.6;
}

.viewer .viewer-nav:hover {
  background-color: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
}

.viewer .viewer-prev {
  left: 24px;
}

.viewer .viewer-next {
  right: 24px;
}

.viewer .viewer-counter {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-secondary);
  letter-spacing: 0.1em;
  opacity: 0;
  transition: opacity 0.3s var(--ease);
  z-index: 3;
}

.viewer:hover .viewer-counter {
  opacity: 1;
}

.viewer .viewer-counter span {
  color: var(--accent);
}

/* Breadcrumb */
.breadcrumb {
  position: fixed;
  top: 64px;
  left: 0;
  right: 0;
  z-index: 999;
  padding: 12px 40px;
  background: var(--header-bg);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border);
  transition: background 0.4s var(--ease);
}

.breadcrumb a {
  color: var(--text-muted);
}

.breadcrumb a:hover {
  color: var(--accent);
}

.breadcrumb .breadcrumb-sep {
  margin: 0 8px;
  color: var(--text-muted);
  opacity: 0.4;
}

/* ═══════════════════════════════════════════
   Post Detail - Content
   ═══════════════════════════════════════════ */

.detail-wrap {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 48px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 64px 40px 80px;
  padding-top: 64px;
  position: relative;
  z-index: 1;
}

/* Mixed mode: no viewer, need extra space for header + breadcrumb */
.detail-mixed {
  padding-top: 148px;
}

/* 分类/标签页：gallery 直接跟在 header 后面，需要给 header 留出空间 */
.site-header + .gallery-section {
  padding-top: 96px;
}

.detail-mixed .detail-content img {
  width: 100%;
  border-radius: var(--radius-lg);
  margin: 24px 0;
  box-shadow: var(--shadow);
}

.detail-mixed .detail-content p img {
  margin: 24px 0;
}

/* Detail Header */
.detail-header {
  margin-bottom: 32px;
}

.detail-story .detail-title {
  font-family: var(--font-display);
  font-size: 42px;
  font-weight: 300;
  color: var(--text-primary);
  line-height: 1.15;
  margin-bottom: 12px;
}

.detail-story .detail-title em {
  color: var(--accent);
  font-style: italic;
}

.detail-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.detail-meta .meta-cat {
  color: var(--accent);
  text-transform: uppercase;
}

.detail-meta .meta-cat:hover {
  text-decoration: underline;
}

.detail-meta .meta-date {
  color: var(--text-muted);
}

.detail-meta .meta-count {
  color: var(--text-muted);
  background: var(--accent-dim);
  padding: 2px 8px;
  border-radius: var(--radius);
}

.detail-meta .meta-read {
  color: var(--text-muted);
}

/* Detail Content */
.detail-story .detail-content {
  font-size: 16px;
  line-height: 2;
  color: var(--text-secondary);
  margin-bottom: 32px;
}

.detail-story .detail-content p {
  margin-bottom: 1.5em;
}

/* Detail Tags */
.detail-story .detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 32px;
}

.detail-story .detail-tags a {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  background-color: var(--bg-surface);
  border: 1px solid var(--border);
  padding: 6px 14px;
  border-radius: var(--radius);
  transition: all 0.3s var(--ease);
}

.detail-story .detail-tags a:hover {
  color: var(--accent);
  border-color: var(--border-accent);
}

/* Detail Actions */
.detail-actions {
  display: flex;
  gap: 12px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.detail-actions .btn {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 10px 24px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.3s var(--ease);
  border: 1px solid transparent;
  text-decoration: none;
  display: inline-block;
}

.detail-actions .btn-primary {
  background-color: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
}

.detail-actions .btn-primary:hover {
  background-color: transparent;
  color: var(--accent);
}

.detail-actions .btn-outline {
  background-color: transparent;
  color: var(--text-primary);
  border-color: var(--border);
}

.detail-actions .btn-outline:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* ═══════════════════════════════════════════
   Sidebar Cards
   ═══════════════════════════════════════════ */

.detail-sidebar {
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: sticky;
  top: 80px;
  align-self: start;
}

.info-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.info-card .card-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
}

.info-card .exif-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.info-card .exif-item .exif-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.info-card .exif-item .exif-value {
  font-family: var(--font-display);
  font-size: 16px;
  color: var(--text-primary);
}

.location-name {
  font-family: var(--font-display);
  font-size: 16px;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.location-coord {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
}

/* Nav Card - Prev/Next */
.nav-card .nav-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--border);
  transition: all 0.3s var(--ease);
  text-decoration: none;
}

.nav-card .nav-row:first-of-type {
  border-top: none;
}

.nav-card .nav-row:hover {
  opacity: 0.8;
}

.nav-card .nav-row .nav-thumb {
  width: 56px;
  height: 42px;
  object-fit: cover;
  border-radius: var(--radius);
  flex-shrink: 0;
  opacity: 0.7;
  transition: opacity 0.3s var(--ease);
}

.nav-card .nav-row:hover .nav-thumb {
  opacity: 1;
}

.nav-card .nav-row .nav-info {
  flex: 1;
  min-width: 0;
}

.nav-card .nav-row .nav-dir {
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.nav-card .nav-row .nav-title {
  display: block;
  font-family: var(--font-display);
  font-size: 14px;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-card .nav-row:hover .nav-title {
  color: var(--accent);
}

/* ═══════════════════════════════════════════
   Related Photos
   ═══════════════════════════════════════════ */

.related-section {
  padding: 0 40px 80px;
  max-width: 1200px;
  margin: 0 auto;
}

.related-section .related-header {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 32px;
}

.related-section .related-header .related-title {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 300;
  color: var(--text-primary);
}

.related-section .related-header .related-collection {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.related-section .related-header .related-viewall {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-left: auto;
}

.related-section .related-header .related-viewall:hover {
  color: var(--accent);
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.related-grid .related-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  aspect-ratio: 4/3;
}

.related-grid .related-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: all 0.6s var(--ease);
}

.related-grid .related-card:hover img {
  transform: scale(1.04);
  filter: brightness(0.6);
}

.related-grid .related-card .related-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  padding: 16px;
  background: var(--card-overlay);
  opacity: 0;
  transition: opacity 0.4s var(--ease);
}

.related-grid .related-card:hover .related-overlay {
  opacity: 1;
}

.related-grid .related-card .related-overlay span {
  font-family: var(--font-display);
  font-size: 15px;
  color: var(--text-primary);
}

.related-grid .related-card .card-link {
  position: absolute;
  inset: 0;
  z-index: 2;
}

/* ═══════════════════════════════════════════
   Collections Page
   ═══════════════════════════════════════════ */

.collections-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  padding: 0 40px 80px;
  max-width: 1600px;
  margin: 0 auto;
}

.collection-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  aspect-ratio: 4/3;
}

.collection-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: all 0.6s var(--ease);
}

.collection-card:hover img {
  transform: scale(1.04);
  filter: brightness(0.5);
}

.collection-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--card-overlay);
  pointer-events: none;
}

.collection-card .collection-info {
  position: absolute;
  bottom: 24px;
  left: 24px;
  z-index: 2;
}

.collection-card .collection-name {
  font-family: var(--font-display);
  font-size: 24px;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.collection-card .collection-count {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-secondary);
  letter-spacing: 0.1em;
}

.collection-card .card-link {
  position: absolute;
  inset: 0;
  z-index: 3;
}

/* ═══════════════════════════════════════════
   About Page
   ═══════════════════════════════════════════ */

.about-wrap {
  max-width: 800px;
  margin: 0 auto;
  padding: 80px 40px;
  text-align: center;
}

.about-wrap .about-avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 24px;
  border: 2px solid var(--border);
}

.about-wrap .about-title {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 300;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.about-wrap .about-subtitle {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-secondary);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 32px;
}

.about-wrap .about-content {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 2;
  color: var(--text-secondary);
  text-align: left;
  margin-bottom: 48px;
}

.gear-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  text-align: left;
}

.gear-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.gear-card .gear-label {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.gear-card .gear-value {
  font-family: var(--font-display);
  font-size: 16px;
  color: var(--text-primary);
}

/* ═══════════════════════════════════════════
   Archive Page
   ═══════════════════════════════════════════ */

.archive-wrap {
  max-width: 800px;
  margin: 0 auto;
  padding: 40px 40px 80px;
}

.archive-year {
  margin-bottom: 48px;
}

.archive-year .year-label {
  font-family: var(--font-display);
  font-size: 48px;
  font-weight: 300;
  color: var(--accent);
  opacity: 0.7;
  margin-bottom: 24px;
}

.archive-year .archive-list {
  border-left: 1px solid var(--border);
  padding-left: 24px;
}

.archive-year .archive-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  transition: color 0.3s var(--ease);
}

.archive-year .archive-item:hover {
  color: var(--accent);
}

.archive-year .archive-item .archive-date {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  min-width: 60px;
  flex-shrink: 0;
}

.archive-year .archive-item .archive-thumb {
  width: 60px;
  height: 44px;
  object-fit: cover;
  border-radius: var(--radius);
  flex-shrink: 0;
}

.archive-year .archive-item .archive-title {
  font-family: var(--font-display);
  font-size: 18px;
  color: var(--text-primary);
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.archive-year .archive-item .archive-cat {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  flex-shrink: 0;
}

.archive-year .archive-item a {
  display: contents;
  color: inherit;
}

/* ═══════════════════════════════════════════
   Search Page
   ═══════════════════════════════════════════ */

.search-wrap {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 40px 80px;
}

.search-input-wrap {
  margin-bottom: 40px;
}

.search-input-wrap input[type="text"] {
  width: 100%;
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 300;
  color: var(--text-primary);
  background: transparent;
  border: none;
  border-bottom: 2px solid var(--border);
  padding: 20px 0;
  outline: none;
  transition: border-color 0.3s var(--ease);
}

.search-input-wrap input[type="text"]:focus {
  border-color: var(--accent);
}

.search-submit {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--accent);
  color: var(--bg);
  border: 1px solid var(--accent);
  padding: 10px 24px;
  border-radius: var(--radius);
  cursor: pointer;
  margin-top: 12px;
  transition: all 0.3s var(--ease);
}

.search-submit:hover {
  background: transparent;
  color: var(--accent);
}

.search-input-wrap input[type="text"]::placeholder {
  color: var(--text-muted);
}

.search-results .search-item {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
  transition: color 0.3s var(--ease);
}

.search-results .search-item:hover {
  color: var(--accent);
}

.search-results .search-item .search-thumb {
  width: 80px;
  height: 60px;
  object-fit: cover;
  border-radius: var(--radius);
  flex-shrink: 0;
}

.search-results .search-item .search-title {
  font-family: var(--font-display);
  font-size: 20px;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.search-results .search-item .search-excerpt {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}

.search-empty {
  text-align: center;
  padding: 80px 0;
}

.search-empty .empty-title {
  font-family: var(--font-display);
  font-size: 24px;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.search-empty .empty-desc {
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--text-muted);
}

/* ═══════════════════════════════════════════
   404 Page
   ═══════════════════════════════════════════ */

.error-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px;
}

.error-page .error-code {
  font-family: var(--font-display);
  font-size: clamp(100px, 15vw, 180px);
  font-weight: 300;
  color: var(--text-muted);
  opacity: 0.15;
  line-height: 1;
  margin-bottom: 16px;
}

.error-page .error-title {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 300;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.error-page .error-desc {
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 32px;
}

.error-page .error-link {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid var(--accent);
  padding: 12px 28px;
  border-radius: var(--radius);
  transition: all 0.3s var(--ease);
  display: inline-block;
}

.error-page .error-link:hover {
  background-color: var(--accent-dim);
}

/* ═══════════════════════════════════════════
   Comments
   ═══════════════════════════════════════════ */

.comments-section {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 40px 80px;
}

.comments-section .comments-title {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 300;
  color: var(--text-primary);
  margin-bottom: 32px;
}

.comments-section .comment-list {
  list-style: none;
  padding: 0;
  margin: 0 0 40px;
}

.comments-section .comment-wrap {
  margin-bottom: 16px;
}

.comments-section .comment-item {
  background-color: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
}

.comments-section .comment-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.comments-section .comment-author {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.comments-section .comment-date {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.comments-section .comment-content {
  font-size: 15px;
  line-height: 1.8;
  color: var(--text-secondary);
}

.comments-section .comment-content {
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.8;
  color: var(--text-secondary);
}

.comments-section .comment-form .form-row {
  margin-bottom: 16px;
}

.comments-section .comment-form .form-row-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
}

.comments-section .comment-form label {
  display: block;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.comments-section .comment-form input[type="text"],
.comments-section .comment-form input[type="email"],
.comments-section .comment-form input[type="url"],
.comments-section .comment-form textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--text-primary);
  background-color: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  outline: none;
  transition: border-color 0.3s var(--ease);
}

.comments-section .comment-form input:focus,
.comments-section .comment-form textarea:focus {
  border-color: var(--accent);
}

.comments-section .comment-form textarea {
  min-height: 120px;
  resize: vertical;
}

.comments-section .comment-form .btn-submit {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background-color: var(--accent);
  color: var(--bg);
  border: 1px solid var(--accent);
  padding: 12px 32px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.3s var(--ease);
}

.comments-section .comment-form .btn-submit:hover {
  background-color: transparent;
  color: var(--accent);
}

.comments-section .comment-logged {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.comments-section .comment-logged a {
  color: var(--accent);
}

.comment-closed {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
  padding: 24px 0;
}

/* ═══════════════════════════════════════════
   Footer
   ═══════════════════════════════════════════ */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 12px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.site-footer .footer-left {
  display: flex;
  align-items: center;
  gap: 20px;
}

.site-footer .footer-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.site-footer .footer-logo {
  font-family: var(--font-display);
  font-size: 14px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.site-footer .footer-logo .logo-first {
  color: var(--accent);
}

.site-footer .footer-social {
  display: flex;
  gap: 14px;
}

.site-footer .footer-social a {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  transition: color 0.3s var(--ease);
}

.site-footer .footer-social a:hover {
  color: var(--accent);
}

.site-footer .footer-copy {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.site-footer .footer-extra {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.site-header.sticky {
  position: fixed;
}

/* ═══════════════════════════════════════════
   Page Layout
   ═══════════════════════════════════════════ */

.page-content {
  max-width: 800px;
  margin: 0 auto;
  padding: 80px 40px;
}

.page-content .page-title {
  font-family: var(--font-display);
  font-size: 42px;
  font-weight: 300;
  color: var(--text-primary);
  margin-bottom: 32px;
}

.page-content .page-body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 2;
  color: var(--text-secondary);
}

/* ═══════════════════════════════════════════
   Responsive
   ═══════════════════════════════════════════ */

@media (max-width: 1024px) {
  .gallery-masonry,
  .related-section {
    padding: 0 30px 40px;
  }

  .section-header {
    padding: 40px 30px 24px;
  }

  .detail-wrap {
    grid-template-columns: 1fr;
    gap: 40px;
    padding: 60px 30px;
  }

  .detail-sidebar {
    order: -1;
    position: static;
  }

  .collections-grid {
    grid-template-columns: repeat(2, 1fr);
    padding: 0 30px 60px;
  }

  .related-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .hero-grid {
    grid-template-columns: 1fr 1fr;
  }

  .hero-grid .grid-item:first-child {
    grid-column: span 2;
  }
}

@media (max-width: 768px) {
  .site-header {
    padding: 0 20px;
  }

  /* Hamburger */
  .nav-toggle {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
  }

  /* Mobile Nav */
  .site-nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: 70%;
    max-width: 280px;
    height: 100vh;
    background: var(--bg);
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    padding: 80px 32px 32px;
    gap: 0;
    transition: right 0.35s var(--ease);
    z-index: 1001;
    box-shadow: -4px 0 20px rgba(0,0,0,0.3);
    overflow-y: auto;
  }

  html.light .site-nav {
    box-shadow: -4px 0 20px rgba(0,0,0,0.1);
  }

  html.light .nav-backdrop.open {
    background: rgba(0,0,0,0.3);
  }

  .site-nav.open {
    right: 0;
  }

  .site-nav a {
    font-size: 15px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
    width: 100%;
  }

  .site-nav a.active::after {
    display: none;
  }

  .nav-actions {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    width: 100%;
    gap: 16px;
  }

  .search-form {
    width: 100%;
  }

  .search-input {
    width: 100%;
    box-sizing: border-box;
  }

  /* Hero */
  .hero-single {
    height: 40vh;
    min-height: 260px;
    max-height: none;
  }

  .hero-single .hero-bg {
    filter: brightness(0.35) saturate(0.8);
  }

  .hero-single .hero-content {
    left: 20px;
    right: 20px;
  }

  .hero-single .hero-title {
    font-size: clamp(28px, 8vw, 48px);
  }

  .gallery-masonry,
  .related-section,
  .collections-grid,
  .search-wrap,
  .archive-wrap,
  .comments-section,
  .about-wrap,
  .page-content {
    padding-left: 20px;
    padding-right: 20px;
  }

  .gallery-masonry {
    grid-template-columns: repeat(var(--cols-m, 2), 1fr);
  }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    padding: 30px 20px 20px;
  }

  .section-header .category-tabs {
    flex-wrap: wrap;
    gap: 12px;
  }

  .detail-wrap {
    padding: 80px 20px;
  }

  .detail-story .detail-title {
    font-size: 32px;
  }

  .collections-grid {
    grid-template-columns: 1fr;
  }

  .related-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .gear-grid {
    grid-template-columns: 1fr;
  }

  .comment-form .form-row-3 {
    grid-template-columns: 1fr;
  }

  .breadcrumb {
    display: none;
  }

  .site-footer {
    padding: 0 20px;
  }

  .hero-carousel .carousel-slide {
    width: 80vw;
  }

  .hero-grid {
    grid-template-columns: 1fr;
    height: auto;
  }

  .hero-grid .grid-item {
    height: 30vh;
  }

  .hero-grid .grid-item:first-child {
    grid-column: span 1;
  }

  .viewer .viewer-nav {
    width: 40px;
    height: 40px;
    font-size: 14px;
  }

  .viewer {
    margin-top: 64px;
    height: calc(50vh - 32px);
  }

  .breadcrumb + .viewer {
    margin-top: 108px;
    height: calc(50vh - 52px);
  }

  .viewer .viewer-img {
    max-width: 95%;
    max-height: calc(50vh - 40px);
  }

  .detail-wrap {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .detail-sidebar {
    position: static;
  }

  .viewer .viewer-prev {
    left: 12px;
  }

  .viewer .viewer-next {
    right: 12px;
  }

  .archive-year .year-label {
    font-size: 36px;
  }

  .archive-year .archive-item {
    flex-wrap: wrap;
    gap: 8px;
  }

  .archive-year .archive-item .archive-cat {
    width: 100%;
    text-align: right;
  }
}

/* ═══════════════════════════════════════════
   Search Form
   ═══════════════════════════════════════════ */

.search-form {
  display: flex;
  align-items: center;
  gap: 6px;
}

.search-input {
  width: 120px;
  padding: 4px 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-primary);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  outline: none;
  transition: border-color 0.3s var(--ease), width 0.3s var(--ease);
}

.search-input:focus {
  border-color: var(--accent);
  width: 180px;
}

.search-btn {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 4px 12px;
  cursor: pointer;
  transition: all 0.3s var(--ease);
}

.search-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* ═══════════════════════════════════════════
   Theme Toggle Switch
   ═══════════════════════════════════════════ */

.theme-switch {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  margin: 0 4px;
}

.switch-track {
  position: relative;
  width: 48px;
  height: 26px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 13px;
  display: flex;
  align-items: center;
  transition: background 0.3s var(--ease), border-color 0.3s var(--ease);
}

.switch-thumb {
  position: absolute;
  left: 3px;
  width: 20px;
  height: 20px;
  background: var(--accent);
  border-radius: 50%;
  transition: transform 0.35s var(--ease);
  z-index: 2;
}

html.light .switch-thumb {
  transform: translateX(22px);
}

.switch-icon {
  position: absolute;
  font-size: 12px;
  line-height: 1;
  transition: opacity 0.3s var(--ease);
  z-index: 1;
}

.switch-icon-sun {
  left: 6px;
  color: var(--text-muted);
  opacity: 0;
}

.switch-icon-moon {
  right: 6px;
  color: var(--text-muted);
  opacity: 1;
}

html.light .switch-icon-sun {
  opacity: 1;
  color: var(--accent);
}

html.light .switch-icon-moon {
  opacity: 0;
}

.theme-switch:hover .switch-track {
  border-color: var(--border-accent);
}

.theme-switch:hover .switch-thumb {
  box-shadow: 0 0 8px var(--accent-dim);
}

/* ═══════════════════════════════════════════
   Search Overlay
   ═══════════════════════════════════════════ */

.search-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 12px 6px 10px;
  cursor: pointer;
  transition: all 0.3s var(--ease);
  white-space: nowrap;
}

.search-toggle .search-icon {
  flex-shrink: 0;
  opacity: 0.7;
  transition: opacity 0.3s var(--ease);
}

.search-toggle .search-label {
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0.08em;
}

.search-toggle .search-kbd {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 6px;
  line-height: 1.6;
  margin-left: 2px;
}

.search-toggle:hover {
  color: var(--accent);
  border-color: var(--border-accent);
  background: var(--accent-dim);
}

.search-toggle:hover .search-icon {
  opacity: 1;
}

.search-toggle:hover .search-kbd {
  color: var(--accent);
  border-color: var(--border-accent);
}

@media (max-width: 768px) {
  .search-toggle {
    border: none;
    padding: 8px;
    gap: 0;
  }

  .search-toggle .search-label,
  .search-toggle .search-kbd {
    display: none;
  }

  .search-toggle .search-icon {
    width: 20px;
    height: 20px;
  }
}

.search-overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s var(--ease), background 0.4s var(--ease);
}

.search-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.search-overlay-form {
  display: flex;
  align-items: center;
  width: 80%;
  max-width: 700px;
}

.search-overlay-form input {
  flex: 1;
  background: transparent;
  border: none;
  border-bottom: 2px solid var(--border);
  font-family: var(--font-display);
  font-size: clamp(28px, 5vw, 48px);
  font-weight: 300;
  color: var(--text-primary);
  padding: 16px 0;
  outline: none;
  transition: border-color 0.3s var(--ease);
}

.search-overlay-form input:focus {
  border-color: var(--accent);
}

.search-overlay-form input::placeholder {
  color: var(--text-muted);
}

.search-overlay-form button {
  background: transparent;
  border: none;
  color: var(--accent);
  font-size: 40px;
  cursor: pointer;
  padding: 0 20px;
  transition: transform 0.3s var(--ease);
}

.search-overlay-form button:hover {
  transform: translateX(4px);
}

.search-overlay-close {
  position: absolute;
  top: 24px;
  right: 32px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 48px;
  cursor: pointer;
  transition: color 0.3s var(--ease);
  line-height: 1;
}

.search-overlay-close:hover {
  color: var(--accent);
}

.search-overlay-hint {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.search-overlay-hint kbd {
  display: inline-block;
  padding: 2px 6px;
  margin: 0 2px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-primary);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 3px;
}

/* ═══════════════════════════════════════════
   Comment Nesting
   ═══════════════════════════════════════════ */

.comment-children {
  list-style: none;
  padding-left: 24px;
  margin: 12px 0 0;
}

.comment-child {
  margin-top: 0;
}

.comment-child > .comment-item {
  background: transparent;
  border: none;
  border-left: 2px solid var(--border);
  border-radius: 0;
  padding: 12px 16px;
}

.comment-child:first-child > .comment-item {
  border-top: none;
}

.comment-actions {
  margin-top: 8px;
}

.comment-actions a {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: color 0.3s var(--ease);
  cursor: pointer;
}

.comment-actions a:hover {
  color: var(--accent);
}

.cancel-reply {
  background: var(--accent-dim);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius);
  padding: 10px 16px;
  margin-bottom: 16px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-secondary);
}

.cancel-reply a {
  color: var(--accent);
  margin-left: 12px;
}

.cancel-reply a:hover {
  text-decoration: underline;
}

/* ═══════════════════════════════════════════
   Lightbox
   ═══════════════════════════════════════════ */

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.95);
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s var(--ease);
}

.lightbox.open {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-img {
  max-width: 92vw;
  max-height: 88vh;
  object-fit: contain;
  box-shadow: 0 20px 80px rgba(0,0,0,0.5);
  transform: scale(0.95);
  transition: transform 0.4s var(--ease);
}

.lightbox.open .lightbox-img {
  transform: scale(1);
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 28px;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 40px;
  cursor: pointer;
  transition: color 0.3s var(--ease);
  line-height: 1;
}

.lightbox-close:hover { color: var(--accent); }

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-size: 22px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s var(--ease);
}

.lightbox-nav:hover {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
}

.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }

.lightbox-info {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 0.08em;
}

.lightbox-title {
  position: absolute;
  bottom: 48px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-display);
  font-size: 20px;
  color: var(--text-primary);
  text-align: center;
  max-width: 80%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ═══════════════════════════════════════════
   Back to Top
   ═══════════════════════════════════════════ */

.back-to-top {
  position: fixed;
  bottom: 32px;
  right: 32px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s var(--ease);
  z-index: 100;
}

.back-to-top.show {
  opacity: 1;
  pointer-events: auto;
}

.back-to-top:hover {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
}

/* ═══════════════════════════════════════════
   Image Fade-in Load
   ═══════════════════════════════════════════ */

.fade-img {
  opacity: 0;
  transition: opacity 0.6s var(--ease);
}

.fade-img.loaded {
  opacity: 1;
}

/* ═══════════════════════════════════════════
   Reading Progress Bar
   ═══════════════════════════════════════════ */

.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: var(--accent);
  z-index: 9999;
  width: 0%;
  transition: width 0.1s linear;
}

/* ═══════════════════════════════════════════
   Header Scroll Effect
   ═══════════════════════════════════════════ */

.site-header.scrolled {
  background: var(--header-scroll-bg);
  box-shadow: 0 1px 0 var(--border);
}

/* ═══════════════════════════════════════════
   Light Mode Component Overrides
   ═══════════════════════════════════════════ */

html.light .viewer .viewer-nav {
  background: rgba(0,0,0,0.06);
  border-color: rgba(0,0,0,0.1);
}

html.light .viewer .viewer-nav:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

html.light .lightbox {
  background: rgba(255,255,255,0.96);
}

html.light .lightbox-nav {
  background: rgba(0,0,0,0.06);
  border-color: rgba(0,0,0,0.1);
}

html.light .lightbox-nav:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

html.light .lightbox-close {
  color: var(--text-secondary);
}

html.light .comment-child > .comment-item {
  border-left-color: var(--border);
}

html.light .site-nav a.active {
  color: var(--accent);
  font-weight: 600;
}

html.light .site-nav a.active::after {
  background: var(--accent);
  height: 2px;
}

html.light .section-header .category-tabs a.active {
  color: #fff;
  background: var(--accent);
  padding: 4px 12px;
  border-radius: var(--radius);
}

html.light .gallery-masonry .photo-card {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  transition: box-shadow 0.4s var(--ease), transform 0.4s var(--ease);
}

html.light .gallery-masonry .photo-card:hover {
  box-shadow: 0 8px 30px rgba(0,0,0,0.12);
  transform: translateY(-2px);
}

html.light .gallery-masonry .photo-card .photo-overlay {
  background: linear-gradient(to top, rgba(26,24,22,0.7) 0%, transparent 60%);
}

html.light .gallery-masonry .photo-card .photo-title {
  color: #fff;
}

html.light .gallery-masonry .photo-card .photo-meta {
  color: rgba(255,255,255,0.7);
}

html.light .gallery-masonry .photo-card .card-link {
  color: inherit;
}

html.light .gallery-masonry .photo-card .card-link:hover {
  color: inherit;
}

html.light .info-card,
html.light .nav-card {
  background: var(--bg-surface);
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

html.light .about-wrap .gear-card {
  background: var(--bg-surface);
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

html.light .search-input-wrap input[type="text"] {
  border-bottom-width: 2px;
}

html.light .collection-card {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

html.light .collection-card:hover {
  box-shadow: 0 8px 30px rgba(0,0,0,0.12);
}

html.light .related-card {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

html.light .pagination a,
html.light .pagination span {
  background: var(--bg-surface);
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

html.light .pagination .current {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

html.light .hero-single .hero-bg {
  filter: brightness(0.7) saturate(0.9);
}

html.light .hero-carousel .carousel-slide img {
  filter: brightness(0.7);
}

html.light .hero-grid .grid-item img {
  filter: brightness(0.85);
}

html.light .hero-grid .grid-item:hover img {
  filter: brightness(0.6);
}

html.light .hero-single .hero-content {
  text-shadow: 0 1px 8px rgba(0,0,0,0.15);
}

html.light .gallery-masonry .photo-card .photo-overlay .card-link-text {
  color: var(--accent);
}

html.light .gallery-masonry .photo-card .photo-overlay .card-link-text:hover {
  color: #fff;
}

html.light .comments-section .comment-item {
  background: var(--bg-surface);
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

html.light .detail-story .detail-tags a {
  background: var(--bg-elevated);
  border-color: var(--border);
}

html.light .detail-story .detail-tags a:hover {
  border-color: var(--border-accent);
}

html.light .breadcrumb a {
  color: var(--text-muted);
}

html.light .breadcrumb a:hover {
  color: var(--accent);
}

html.light .back-to-top {
  background: var(--bg-surface);
  border-color: var(--border);
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

html.light .back-to-top:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  box-shadow: 0 4px 12px rgba(139,105,20,0.2);
}

html.light .search-overlay {
  background: rgba(240,236,230,0.97);
}

html.light .search-overlay-form input {
  border-bottom-color: var(--border);
}

html.light .search-overlay-form input:focus {
  border-bottom-color: var(--accent);
}

html.light .search-overlay-form button {
  color: var(--accent);
}

html.light .viewer {
  background: var(--bg);
}

html.light .viewer-img {
  box-shadow: var(--shadow);
}

/* ═══════════════════════════════════════════
   Mobile Gallery Overlay
@media (max-width: 768px) {
    .gallery-masonry .photo-card .photo-overlay {
        opacity: 1;
        padding: 14px;
        background: linear-gradient(to top, rgba(10,10,10,0.85) 0%, rgba(10,10,10,0.5) 60%, transparent 100%);
    }

    html.light .gallery-masonry .photo-card .photo-overlay {
        background: linear-gradient(to top, rgba(26,24,22,0.8) 0%, rgba(26,24,22,0.4) 60%, transparent 100%);
    }

    /* 标题：缩小字号 + 最多两行省略 */
    .gallery-masonry .photo-card .photo-overlay .photo-title {
        font-size: 14px;
        line-height: 1.3;
        margin-bottom: 4px;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        text-overflow: ellipsis;
        transform: translateY(0);
    }

    /* 元信息：缩小字号 */
    .gallery-masonry .photo-card .photo-overlay .photo-meta {
        font-size: 10px;
        letter-spacing: 0.03em;
        margin-top: 0;
        transform: translateY(0);
    }

    /* 移动端隐藏冗余的"查看详情"链接 */
    .gallery-masonry .photo-card .photo-overlay .card-link-text {
        display: none;
    }

    /* 移动端图片始终保持亮色，不在悬浮时再变暗 */
    .gallery-masonry .photo-card:hover .photo-thumb {
        filter: none;
    }
}

/* ═══════════════════════════════════════════
   Tags Index Page
   ═══════════════════════════════════════════ */

.tags-wrap {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 40px 80px;
}

.tags-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 16px 20px;
    align-items: baseline;
    line-height: 1.4;
}

.tag-item {
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
    font-family: var(--font-display);
    color: var(--text-secondary);
    padding: 4px 10px;
    border-radius: var(--radius);
    transition: color 0.3s var(--ease), background 0.3s var(--ease);
}

.tag-item:hover {
    color: var(--accent);
    background: var(--accent-dim);
}

.tag-item .tag-count {
    font-family: var(--font-mono);
    font-size: 0.55em;
    color: var(--text-muted);
    font-weight: 400;
}

.tags-empty,
.archive-empty,
.links-empty {
    text-align: center;
    padding: 80px 0;
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 13px;
    letter-spacing: 0.05em;
}

.links-empty code,
.tags-empty code {
    font-family: var(--font-mono);
    padding: 2px 6px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 3px;
    color: var(--accent);
    font-size: 12px;
}

/* ═══════════════════════════════════════════
   Archive - Monthly Grouping
   ═══════════════════════════════════════════ */

.archive-month {
    margin-bottom: 24px;
}

.archive-month .month-label {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
    padding: 8px 0 4px 24px;
    border-bottom: 1px dashed var(--border);
    margin-bottom: 4px;
}

/* ═══════════════════════════════════════════
   Links Page
   ═══════════════════════════════════════════ */

.links-wrap,
.guestbook-wrap {
    max-width: 900px;
    margin: 0 auto;
    padding: 96px 40px 80px;
}

.links-title,
.guestbook-title {
    font-family: var(--font-display);
    font-size: 42px;
    font-weight: 300;
    color: var(--text-primary);
    margin-bottom: 16px;
    text-align: center;
}

.links-intro,
.guestbook-intro {
    text-align: center;
    color: var(--text-secondary);
    line-height: 1.9;
    margin-bottom: 48px;
    max-width: 640px;
    margin-left: auto;
    margin-right: auto;
}

.links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 12px;
}

.link-card {
    display: block;
    padding: 20px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    text-decoration: none;
    transition: all 0.3s var(--ease);
    position: relative;
}

html.light .link-card {
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.link-card:hover {
    border-color: var(--border-accent);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}

html.light .link-card:hover {
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}

.link-card .link-name {
    font-family: var(--font-display);
    font-size: 18px;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.link-card:hover .link-name {
    color: var(--accent);
}

.link-card .link-desc {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 8px;
    min-height: 20px;
}

.link-card .link-url {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-muted);
    letter-spacing: 0.03em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ═══════════════════════════════════════════
   Guestbook Page
   ═══════════════════════════════════════════ */

.guestbook-comments {
    max-width: 800px;
    margin: 0 auto;
    padding: 32px 0 0;
}

/* ═══════════════════════════════════════════
   Footer RSS
   ═══════════════════════════════════════════ */

.footer-rss {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    padding: 4px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: all 0.3s var(--ease);
}

.footer-rss:hover {
    color: var(--accent);
    border-color: var(--accent);
}

@media (max-width: 768px) {
    .links-title,
    .guestbook-title {
        font-size: 32px;
    }
    .links-wrap,
    .guestbook-wrap {
        padding: 80px 20px 60px;
    }
    .links-grid {
        grid-template-columns: 1fr;
    }
    .tags-wrap {
        padding: 0 20px 60px;
    }
    .site-footer {
        flex-wrap: wrap;
        gap: 8px;
    }
    .site-footer .footer-right {
        width: 100%;
        justify-content: flex-start;
    }
}