/* ==========================================================
   我的摄影集 · 样式
   风格参考 PicImpact：中性底色、衬线标题、细导航、瀑布流
   ========================================================== */

:root {
  --bg: #f5f5f5;
  --fg: #18181b;
  --muted: #71717a;
  --border: #dedee0;
  --card: #ffffff;
  --skeleton: #e8e8ea;
  --accent: #0485f7;
  --accent-soft: rgba(4, 133, 247, 0.1);
  --accent-soft-strong: rgba(4, 133, 247, 0.18);
  --header-bg: rgba(245, 245, 245, 0.82);
  --glow: rgba(4, 133, 247, 0.07);
  --shadow: 0 10px 30px rgba(24, 24, 27, 0.08);
  --header-h: 52px;
  --radius: 12px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --serif: "Source Serif 4", "Noto Serif SC", "Songti SC", "STSong", Georgia, serif;
  --sans: "Source Sans 3", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

[data-theme="dark"] {
  --bg: #060607;
  --fg: #f4f4f5;
  --muted: #9f9fa9;
  --border: #28282c;
  --card: #111113;
  --skeleton: #1c1c1f;
  --accent: #4da3ff;
  --accent-soft: rgba(77, 163, 255, 0.14);
  --accent-soft-strong: rgba(77, 163, 255, 0.24);
  --header-bg: rgba(6, 6, 7, 0.8);
  --glow: rgba(77, 163, 255, 0.1);
  --shadow: 0 14px 40px rgba(0, 0, 0, 0.45);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.3s ease, color 0.3s ease;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(720px 340px at 18% -5%, var(--glow), transparent 68%);
}

body.no-scroll {
  overflow: hidden;
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

h1,
h2,
h3,
p {
  margin: 0;
}

::selection {
  background: var(--accent-soft-strong);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- 顶栏 ---------- */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 60;
  height: var(--header-h);
  background: var(--header-bg);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  backdrop-filter: blur(18px) saturate(1.4);
  border-bottom: 1px solid color-mix(in srgb, var(--border) 60%, transparent);
}

.header-inner {
  max-width: 1320px;
  height: 100%;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 18px;
}

.brand {
  flex: none;
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
  transition: opacity 0.2s ease;
}

.brand:hover {
  opacity: 0.72;
}

.site-nav {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.site-nav::-webkit-scrollbar {
  display: none;
}

.site-nav a {
  flex: none;
  padding: 6px 13px;
  border-radius: 999px;
  font-size: 14px;
  color: var(--muted);
  white-space: nowrap;
  transition: color 0.2s ease, background-color 0.2s ease;
}

.site-nav a:hover {
  color: var(--fg);
}

.site-nav a.is-active {
  background: var(--accent-soft);
  color: var(--fg);
  font-weight: 500;
}

.header-actions {
  flex: none;
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.icon-btn {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  color: var(--muted);
  transition: color 0.2s ease, background-color 0.2s ease;
}

.icon-btn:hover {
  color: var(--fg);
  background: var(--accent-soft);
}

.icon-btn svg {
  width: 18px;
  height: 18px;
}

[data-theme="light"] .icon-sun,
[data-theme="dark"] .icon-moon {
  display: none;
}

main {
  flex: 1 0 auto;
  padding-top: var(--header-h);
}

.container {
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- 首页主视觉 ---------- */
.hero {
  padding: clamp(54px, 9vw, 104px) 0 clamp(30px, 4vw, 46px);
}

.eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
}

.hero h1 {
  margin-top: 18px;
  font-family: var(--serif);
  font-size: clamp(42px, 7.2vw, 76px);
  font-weight: 600;
  line-height: 1.03;
  letter-spacing: -0.025em;
}

.hero .lede {
  max-width: 620px;
  margin-top: 20px;
  font-size: 16px;
  line-height: 1.85;
  color: var(--muted);
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 42px;
  margin-top: 38px;
}

.stat b {
  display: block;
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 600;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}

.stat span {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--muted);
  text-transform: uppercase;
}

/* ---------- 区块 ---------- */
.section {
  padding: 34px 0 58px;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.section-head h2 {
  margin-top: 8px;
  font-family: var(--serif);
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.text-link {
  flex: none;
  font-size: 13px;
  color: var(--muted);
  border-bottom: 1px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.text-link:hover {
  color: var(--fg);
  border-color: var(--fg);
}

/* ---------- 瀑布流照片 ---------- */
.masonry {
  column-count: 3;
  column-gap: 14px;
}

.photo-card {
  position: relative;
  display: block;
  margin: 0 0 14px;
  break-inside: avoid;
  border-radius: 10px;
  overflow: hidden;
  background: var(--skeleton);
  cursor: zoom-in;
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.photo-card img {
  display: block;
  width: 100%;
  height: auto;
  background: var(--skeleton);
  transition: transform 0.7s var(--ease);
}

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

.photo-card:hover {
  box-shadow: var(--shadow);
}

.photo-card:focus-visible {
  outline-offset: 3px;
}

.card-meta {
  position: absolute;
  inset: auto 0 0 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 34px 13px 11px;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.58));
  color: #fff;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.28s ease, transform 0.28s ease;
  pointer-events: none;
}

.photo-card:hover .card-meta,
.photo-card:focus-visible .card-meta {
  opacity: 1;
  transform: translateY(0);
}

.card-title {
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-sub {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.72);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.photo-card.is-error::after {
  content: attr(data-title);
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  font-family: var(--serif);
  font-size: 14px;
  color: var(--muted);
  text-align: center;
  background: var(--skeleton);
}

.photo-card.is-error img {
  visibility: hidden;
}

/* ---------- 相册卡片 ---------- */
.album-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.album-card {
  position: relative;
  display: block;
  aspect-ratio: 4 / 3;
  border-radius: 12px;
  overflow: hidden;
  background: var(--skeleton);
}

.album-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.7s var(--ease);
}

.album-card:hover img {
  transform: scale(1.045);
}

.album-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 18px;
  color: #fff;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.04) 35%, rgba(0, 0, 0, 0.66));
}

.album-name {
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 600;
  line-height: 1.2;
}

.album-meta {
  margin-top: 4px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.76);
}

/* ---------- 内页标题 ---------- */
.page-head {
  padding: clamp(46px, 7vw, 76px) 0 28px;
}

.page-head h1 {
  margin-top: 16px;
  font-family: var(--serif);
  font-size: clamp(36px, 5.6vw, 58px);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.02em;
}

.page-head .lede {
  max-width: 640px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.8;
}

.page-head .page-meta {
  margin-top: 16px;
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--muted);
  text-transform: uppercase;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 22px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 13px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 13px;
  color: var(--muted);
  transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.chip:hover {
  color: var(--fg);
  border-color: var(--fg);
}

.chip.is-active {
  background: var(--accent-soft);
  border-color: transparent;
  color: var(--fg);
}

.chip span {
  font-size: 11px;
  opacity: 0.62;
  font-variant-numeric: tabular-nums;
}

/* ---------- 时光相册 ---------- */
.year-block {
  padding-bottom: 34px;
}

.year-head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.year-head .year {
  font-family: var(--serif);
  font-size: clamp(34px, 4vw, 46px);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.year-head .count {
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--muted);
  text-transform: uppercase;
}

/* ---------- 空状态 ---------- */
.empty {
  padding: 72px 16px;
  text-align: center;
  color: var(--muted);
}

.empty h3 {
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 600;
  color: var(--fg);
}

.empty p {
  margin-top: 10px;
  font-size: 14px;
}

.empty code {
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--skeleton);
  font-size: 13px;
  color: var(--fg);
}

/* ---------- 页脚 ---------- */
.site-footer {
  flex: none;
  margin-top: 40px;
  border-top: 1px solid var(--border);
  padding: 30px 0 36px;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 12.5px;
  color: var(--muted);
}

.footer-inner a:hover {
  color: var(--fg);
}

/* ---------- 灯箱 ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 220;
  display: grid;
  grid-template-rows: 58px minmax(0, 1fr);
  background: rgba(6, 6, 7, 0.97);
  color: #f4f4f5;
  --lb-line: rgba(255, 255, 255, 0.1);
}

.lightbox[hidden] {
  display: none;
}

.lb-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 14px 0 20px;
  border-bottom: 1px solid var(--lb-line);
}

.lb-top-left {
  display: flex;
  align-items: baseline;
  gap: 12px;
  min-width: 0;
}

.lb-title {
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 600;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.lb-counter {
  flex: none;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
  font-variant-numeric: tabular-nums;
}

.lb-actions {
  flex: none;
  display: flex;
  gap: 4px;
}

.lb-btn {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  color: rgba(255, 255, 255, 0.72);
  transition: background-color 0.2s ease, color 0.2s ease;
}

.lb-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.lb-btn svg {
  width: 18px;
  height: 18px;
}

.lb-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 336px;
  min-height: 0;
}

.lb-stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  padding: 26px 70px;
  overflow: hidden;
  background: #050506;
  touch-action: none;
}

.lb-stage img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
  transform-origin: center center;
  transition: transform 0.18s ease-out;
  cursor: zoom-in;
  will-change: transform;
}

.lb-stage img.dragging {
  transition: none;
  cursor: grabbing;
}

.lb-nav {
  position: absolute;
  top: 50%;
  z-index: 2;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translateY(-50%);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  transition: background-color 0.2s ease, opacity 0.2s ease;
}

.lb-nav:hover {
  background: rgba(255, 255, 255, 0.18);
}

.lb-nav svg {
  width: 20px;
  height: 20px;
}

.lb-prev {
  left: 18px;
}

.lb-next {
  right: 18px;
}

.zoom-hint {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.32);
  pointer-events: none;
  white-space: nowrap;
}

.lb-info {
  min-height: 0;
  overflow-y: auto;
  padding: 24px 24px 34px;
  background: #0b0b0d;
  border-left: 1px solid var(--lb-line);
}

.lb-info h2 {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 600;
  line-height: 1.3;
}

.lb-sub {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin-top: 8px;
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.56);
}

.lb-sub a {
  color: rgba(255, 255, 255, 0.82);
  border-bottom: 1px solid rgba(255, 255, 255, 0.25);
}

.lb-sub a:hover {
  border-color: #fff;
}

.lb-desc {
  margin-top: 16px;
  font-size: 13.5px;
  line-height: 1.85;
  color: rgba(255, 255, 255, 0.72);
}

.lb-section-title {
  margin: 26px 0 10px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.38);
}

.exif-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 16px;
}

.exif-item span {
  display: block;
  font-size: 10.5px;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.38);
}

.exif-item b {
  display: block;
  margin-top: 2px;
  font-size: 13px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.88);
  word-break: break-word;
}

.lb-none {
  font-size: 12.5px;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.42);
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.72);
}

.lb-coords {
  margin-top: 7px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.36);
  font-variant-numeric: tabular-nums;
}

.lb-download {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 26px;
  padding: 8px 15px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.82);
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.lb-download:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.4);
}

.lb-download svg {
  width: 15px;
  height: 15px;
}

/* ---------- 搜索面板 ---------- */
.palette {
  position: fixed;
  inset: 0;
  z-index: 240;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 11vh 16px 16px;
}

.palette[hidden] {
  display: none;
}

.palette-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(9, 9, 11, 0.48);
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
}

.palette-panel {
  position: relative;
  width: min(620px, 100%);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.28);
  overflow: hidden;
  animation: palette-in 0.18s var(--ease);
}

@keyframes palette-in {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(0.99);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.palette-input {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 15px 17px;
  border-bottom: 1px solid var(--border);
}

.palette-input svg {
  flex: none;
  width: 18px;
  height: 18px;
  color: var(--muted);
}

.palette-input input {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--fg);
  font: inherit;
  font-size: 16px;
}

.palette-input input::placeholder {
  color: var(--muted);
}

kbd {
  flex: none;
  padding: 2px 6px;
  border: 1px solid var(--border);
  border-radius: 5px;
  font-family: var(--sans);
  font-size: 10px;
  color: var(--muted);
}

.palette-results {
  max-height: 52vh;
  overflow-y: auto;
  padding: 7px;
}

.palette-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 7px;
  border-radius: 10px;
  text-align: left;
  transition: background-color 0.12s ease;
}

.palette-item:hover,
.palette-item.is-active {
  background: var(--accent-soft);
}

.palette-item img {
  flex: none;
  width: 46px;
  height: 46px;
  border-radius: 7px;
  object-fit: cover;
  background: var(--skeleton);
}

.pi-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pi-title {
  font-size: 13.5px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pi-meta {
  font-size: 11.5px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.palette-empty {
  padding: 42px 16px;
  text-align: center;
  font-size: 13.5px;
  color: var(--muted);
}

.palette-empty span {
  display: inline-block;
  margin-top: 6px;
  font-size: 12px;
  opacity: 0.7;
}

.palette-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 15px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--muted);
}

/* ---------- 入场动画 ---------- */
.reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}

.reveal.is-in {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}

/* ---------- 响应式 ---------- */
@media (max-width: 1080px) {
  .masonry {
    column-count: 2;
  }

  .lb-body {
    grid-template-columns: minmax(0, 1fr) 300px;
  }

  .lb-stage {
    padding: 20px 58px;
  }
}

@media (max-width: 680px) {
  :root {
    --header-h: 100px;
  }

  .header-inner {
    flex-wrap: wrap;
    align-content: center;
    gap: 4px 10px;
    padding: 8px 14px;
  }

  .brand {
    font-size: 17px;
  }

  .site-nav {
    order: 3;
    flex: 0 0 100%;
    justify-content: flex-start;
    padding-bottom: 2px;
  }

  .site-nav a {
    padding: 5px 11px;
    font-size: 13px;
  }

  .icon-btn {
    width: 36px;
    height: 36px;
  }

  .container {
    padding: 0 14px;
  }

  .hero {
    padding-top: 38px;
  }

  .hero h1 {
    margin-top: 14px;
  }

  .hero-stats {
    gap: 28px;
    margin-top: 28px;
  }

  .stat b {
    font-size: 25px;
  }

  .section {
    padding: 24px 0 40px;
  }

  .masonry {
    column-gap: 10px;
  }

  .photo-card {
    margin-bottom: 10px;
    border-radius: 8px;
  }

  .card-meta {
    opacity: 1;
    transform: none;
    padding: 24px 9px 8px;
  }

  .card-title {
    font-size: 13px;
  }

  .card-sub {
    font-size: 10px;
  }

  .album-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .album-card {
    aspect-ratio: 1 / 1;
    border-radius: 9px;
  }

  .album-overlay {
    padding: 12px;
  }

  .album-name {
    font-size: 18px;
  }

  .album-meta {
    font-size: 10.5px;
  }

  .page-head {
    padding-top: 38px;
  }

  .footer-inner {
    font-size: 12px;
  }

  .lb-top {
    padding: 0 8px 0 14px;
  }

  .lb-title {
    font-size: 14px;
  }

  .lb-body {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) auto;
  }

  .lb-stage {
    padding: 8px 46px;
  }

  .lb-nav {
    width: 38px;
    height: 38px;
  }

  .lb-prev {
    left: 6px;
  }

  .lb-next {
    right: 6px;
  }

  .lb-info {
    max-height: 39vh;
    padding: 16px 18px 24px;
    border-left: 0;
    border-top: 1px solid var(--lb-line);
  }

  .lb-info h2 {
    font-size: 19px;
  }

  .zoom-hint {
    display: none;
  }

  .palette {
    padding: 7vh 8px 8px;
  }

  .palette-results {
    max-height: 60vh;
  }
}

@media (max-width: 380px) {
  .masonry {
    column-count: 1;
  }

  .album-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================
   宝丽来相册（甘坑古镇）
   ========================================================== */
body.polaroid-mode {
  --bg: #f4ecdf;
  --fg: #2c2419;
  --muted: #7b6a55;
  --border: #ddcdb8;
  --card: #fbf7ef;
  --skeleton: #e7dccb;
  --accent: #b06a3b;
  --accent-soft: rgba(176, 106, 59, 0.12);
  --accent-soft-strong: rgba(176, 106, 59, 0.22);
  --header-bg: rgba(244, 236, 223, 0.82);
  --glow: rgba(176, 106, 59, 0.09);
  background-color: var(--bg);
  background-image: radial-gradient(rgba(90, 64, 38, 0.035) 1px, transparent 1px);
  background-size: 4px 4px;
  overflow-x: hidden;
}

[data-theme="dark"] body.polaroid-mode {
  --bg: #17130e;
  --fg: #f3e9da;
  --muted: #b9a78f;
  --border: #3a2f24;
  --card: #211b14;
  --skeleton: #2b241b;
  --accent: #d08a55;
  --accent-soft: rgba(208, 138, 85, 0.16);
  --accent-soft-strong: rgba(208, 138, 85, 0.26);
  --header-bg: rgba(23, 19, 14, 0.82);
  --glow: rgba(208, 138, 85, 0.08);
}

body.polaroid-mode::before {
  background:
    radial-gradient(900px 420px at 12% 0%, rgba(176, 106, 59, 0.1), transparent 65%),
    radial-gradient(760px 420px at 88% 12%, rgba(214, 166, 122, 0.12), transparent 62%);
}

body.polaroid-mode .page-head .eyebrow {
  color: var(--accent);
}

body.polaroid-mode .page-head h1 {
  letter-spacing: -0.015em;
}

.polaroid-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 270px;
  align-items: center;
  gap: 26px;
  min-height: 440px;
  padding: 6px 0 46px;
}

.polaroid-hero[hidden],
.polaroid-wall[hidden],
#album-grid[hidden] {
  display: none !important;
}

.pile-stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: clamp(360px, 42vw, 520px);
}

.polaroid-pile {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: inherit;
}

.pile-card {
  position: absolute;
  left: 50%;
  top: 50%;
  width: clamp(200px, 24vw, 292px);
  padding: 10px 10px 0;
  border: 0;
  border-radius: 2px;
  background: #fffdf8;
  color: #2c2419;
  text-align: center;
  box-shadow: 0 20px 38px rgba(75, 48, 24, 0.19), 0 2px 5px rgba(0, 0, 0, 0.08);
  transform-origin: 50% 60%;
  transition: transform 0.55s cubic-bezier(0.22, 0.61, 0.36, 1), box-shadow 0.3s ease;
  cursor: zoom-in;
  will-change: transform;
}

.pile-card img {
  display: block;
  width: 100%;
  height: auto;
  background: #e9dfd1;
}

.pile-card .pile-caption {
  display: block;
  padding: 10px 8px 13px;
  font-family: var(--serif);
  font-size: 14px;
  line-height: 1.35;
  color: #3b3023;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.pile-card:first-child .pile-caption {
  opacity: 1;
}

.pile-card:nth-child(1) {
  transform: translate(-50%, -50%) rotate(-3deg);
  z-index: 5;
}

.pile-card:nth-child(2) {
  transform: translate(calc(-50% + 22px), calc(-50% - 16px)) rotate(3deg);
  z-index: 4;
}

.pile-card:nth-child(3) {
  transform: translate(calc(-50% + 44px), calc(-50% - 32px)) rotate(-4.5deg);
  z-index: 3;
}

.pile-card:nth-child(4) {
  transform: translate(calc(-50% + 66px), calc(-50% - 48px)) rotate(4deg);
  z-index: 2;
}

.pile-card:nth-child(5) {
  transform: translate(calc(-50% + 88px), calc(-50% - 64px)) rotate(-5deg);
  z-index: 1;
}

.polaroid-pile:hover .pile-card {
  transform: translate(-50%, -50%) translate(var(--fx, 0%), var(--fy, 0px)) rotate(var(--fr, 0deg));
}

.polaroid-pile:hover .pile-card .pile-caption {
  opacity: 1;
}

.polaroid-pile:hover .pile-card {
  box-shadow: 0 26px 50px rgba(75, 48, 24, 0.24), 0 3px 6px rgba(0, 0, 0, 0.08);
}

.pile-card:hover {
  z-index: 9;
}

.pile-side {
  padding-right: 8px;
}

.pile-side .eyebrow {
  color: var(--muted);
}

.pile-text {
  margin-top: 14px;
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.7;
  color: var(--fg);
}

.pile-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 22px;
}

.pile-next {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 15px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--card);
  color: var(--fg);
  font-size: 13px;
  transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.pile-next:hover {
  background: var(--accent-soft);
  border-color: transparent;
  transform: translateY(-1px);
}

.pile-count {
  font-size: 11.5px;
  letter-spacing: 0.05em;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.pile-hint {
  margin-top: 14px;
  font-size: 11.5px;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.polaroid-wall {
  column-count: 3;
  column-gap: 30px;
  padding: 8px 6px 12px;
}

.polaroid-wall-item {
  display: block;
  width: 100%;
  break-inside: avoid;
  margin: 0 0 34px;
  padding: 10px 10px 0;
  border: 0;
  border-radius: 2px;
  background: #fffdf8;
  color: #2c2419;
  text-align: center;
  box-shadow: 0 14px 26px rgba(75, 48, 24, 0.16), 0 2px 4px rgba(0, 0, 0, 0.07);
  transform: rotate(var(--r, 0deg));
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: zoom-in;
}

.polaroid-wall-item img {
  display: block;
  width: 100%;
  height: auto;
  background: #e9dfd1;
}

.polaroid-wall-item:hover,
.polaroid-wall-item:focus-visible {
  position: relative;
  z-index: 2;
  transform: rotate(0deg) translateY(-6px);
  box-shadow: 0 24px 40px rgba(75, 48, 24, 0.22), 0 3px 6px rgba(0, 0, 0, 0.08);
}

.polaroid-wall-caption {
  display: block;
  padding: 12px 8px 15px;
  font-family: var(--serif);
  font-size: 15px;
  line-height: 1.4;
}

.polaroid-wall-caption small {
  display: block;
  margin-top: 3px;
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: 0.05em;
  color: #9b8972;
}

@media (max-width: 1080px) {
  .polaroid-hero {
    grid-template-columns: 1fr;
  }

  .pile-side {
    max-width: 560px;
    margin: 0 auto;
    padding-right: 0;
    text-align: center;
  }

  .pile-actions {
    justify-content: center;
  }

  .pile-stage {
    min-height: 420px;
  }

  .polaroid-wall {
    column-count: 2;
  }
}

@media (max-width: 680px) {
  .polaroid-hero {
    min-height: 0;
    padding-bottom: 26px;
  }

  .pile-stage {
    min-height: 330px;
  }

  .pile-card {
    width: 190px;
    padding: 8px 8px 0;
  }

  .pile-card .pile-caption {
    padding: 8px 6px 10px;
    font-size: 12px;
  }

  .pile-text {
    font-size: 16px;
  }

  .polaroid-pile:hover .pile-card:nth-child(1) {
    transform: translate(-50%, -50%) rotate(-3deg);
  }

  .polaroid-pile:hover .pile-card:nth-child(2) {
    transform: translate(calc(-50% + 22px), calc(-50% - 16px)) rotate(3deg);
  }

  .polaroid-pile:hover .pile-card:nth-child(3) {
    transform: translate(calc(-50% + 44px), calc(-50% - 32px)) rotate(-4.5deg);
  }

  .polaroid-wall {
    column-count: 2;
    column-gap: 16px;
  }

  .polaroid-wall-item {
    margin-bottom: 18px;
    padding: 7px 7px 0;
  }

  .polaroid-wall-caption {
    padding: 9px 4px 12px;
    font-size: 12px;
  }

  .polaroid-wall-caption small {
    font-size: 9px;
  }
}

@media (max-width: 380px) {
  .polaroid-wall {
    column-count: 1;
  }
}

/* ==========================================================
   相册索引：宝丽来相册卡
   ========================================================== */
.album-polaroid-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: start;
  gap: 44px 28px;
  padding: 16px 4px 10px;
}

.album-polaroid {
  display: block;
  padding: 10px 10px 0;
  border-radius: 2px;
  background: #fffdf8;
  color: #2c2419;
  text-align: center;
  box-shadow: 0 16px 30px rgba(75, 48, 24, 0.17), 0 2px 4px rgba(0, 0, 0, 0.07);
  transform: rotate(var(--r, 0deg));
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.album-polaroid img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: #e9dfd1;
}

.album-polaroid-caption {
  display: block;
  padding: 14px 8px 17px;
}

.album-polaroid-name {
  display: block;
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 600;
  line-height: 1.3;
}

.album-polaroid-caption small {
  display: -webkit-box;
  margin-top: 4px;
  overflow: hidden;
  font-family: var(--sans);
  font-size: 10.5px;
  line-height: 1.55;
  letter-spacing: 0.02em;
  color: #9b8972;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.album-polaroid:hover,
.album-polaroid:focus-visible {
  position: relative;
  z-index: 2;
  transform: rotate(0deg) translateY(-6px);
  box-shadow: 0 26px 44px rgba(75, 48, 24, 0.24), 0 3px 6px rgba(0, 0, 0, 0.08);
}

/* ==========================================================
   朝暮流年：时间轴 + 宝丽来照片墙
   ========================================================== */
#timeline {
  padding-bottom: 36px;
}

.tl-year {
  position: relative;
  padding-left: 56px;
  padding-bottom: 46px;
}

.tl-year::before {
  content: "";
  position: absolute;
  left: 17px;
  top: 12px;
  bottom: 0;
  width: 1px;
  background: var(--border);
}

.tl-year:last-child::before {
  bottom: 12px;
}

.tl-year-head {
  position: relative;
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 4px 0 18px;
}

.tl-year-head::before {
  content: "";
  position: absolute;
  left: -45px;
  top: 50%;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 5px var(--bg);
  transform: translateY(-50%);
}

.tl-year-label {
  font-family: var(--serif);
  font-size: clamp(38px, 4.6vw, 54px);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.tl-count {
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--muted);
  text-transform: uppercase;
}

.tl-month {
  margin: 0 0 34px;
}

.tl-month-title {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 0 0 14px;
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 600;
  line-height: 1.3;
}

.tl-month-title span {
  font-family: var(--sans);
  font-size: 10.5px;
  font-weight: 400;
  letter-spacing: 0.1em;
  color: var(--muted);
  text-transform: uppercase;
}

.polaroid-wall--timeline {
  column-count: 3;
  column-gap: 26px;
  padding: 0 2px;
}

.polaroid-wall--timeline .polaroid-wall-item {
  margin-bottom: 27px;
}

@media (max-width: 1080px) {
  .album-polaroid-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 36px 24px;
  }

  .polaroid-wall--timeline {
    column-count: 2;
  }
}

@media (max-width: 680px) {
  .album-polaroid-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 26px 16px;
    padding: 10px 0;
  }

  .album-polaroid {
    padding: 7px 7px 0;
  }

  .album-polaroid-caption {
    padding: 9px 5px 12px;
  }

  .album-polaroid-name {
    font-size: 17px;
  }

  .album-polaroid-caption small {
    font-size: 9px;
  }

  .tl-year {
    padding-left: 38px;
    padding-bottom: 34px;
  }

  .tl-year::before {
    left: 10px;
  }

  .tl-year-head::before {
    left: -34px;
    box-shadow: 0 0 0 4px var(--bg);
  }

  .tl-year-label {
    font-size: 38px;
  }

  .tl-month {
    margin-bottom: 26px;
  }

  .tl-month-title {
    font-size: 18px;
  }

  .polaroid-wall--timeline {
    column-count: 2;
    column-gap: 16px;
    padding: 0;
  }

  .polaroid-wall--timeline .polaroid-wall-item {
    margin-bottom: 18px;
  }
}

@media (max-width: 380px) {
  .album-polaroid-grid {
    grid-template-columns: 1fr;
  }

  .polaroid-wall--timeline {
    column-count: 1;
  }
}
