:root {
  --ink: #2b2924;
  --muted: #746f63;
  --soft: #f8f2e7;
  --paper: #fffaf0;
  --panel: rgba(255, 253, 247, 0.82);
  --line: rgba(43, 41, 36, 0.13);
  --line-strong: rgba(43, 41, 36, 0.24);
  --sun: #e5ae54;
  --leaf: #8aa178;
  --sky: #9ab7c8;
  --rose: #d79686;
  --shadow: rgba(83, 67, 42, 0.18);
  --cn: KaiTi, STKaiti, "楷体", "华文楷体", serif;
  font-family: var(--cn);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(120deg, rgba(154, 183, 200, 0.18), transparent 34rem),
    radial-gradient(circle at 86% 8%, rgba(229, 174, 84, 0.22), transparent 26rem),
    radial-gradient(circle at 12% 62%, rgba(138, 161, 120, 0.14), transparent 24rem),
    linear-gradient(180deg, #fffdf7 0%, var(--soft) 48%, #f4eadc 100%);
}

img {
  display: block;
  max-width: 100%;
}

button,
a {
  color: inherit;
  font: inherit;
}

button {
  cursor: pointer;
}

.site {
  width: min(1460px, calc(100% - 40px));
  margin: 0 auto;
}

.topbar {
  position: fixed;
  top: 18px;
  left: 50%;
  z-index: 10;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  width: min(560px, calc(100% - 28px));
  padding: 6px;
  border: 1px solid var(--line);
  background: rgba(255, 253, 247, 0.78);
  box-shadow: 0 16px 40px rgba(83, 67, 42, 0.12);
  backdrop-filter: blur(18px);
  transform: translateX(-50%);
}

.topbar a {
  min-height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid transparent;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
}

.topbar a:hover {
  border-color: var(--sun);
  color: var(--ink);
}

.stage {
  min-height: 100vh;
  padding: 112px 0 70px;
  opacity: 0;
  transform: translateY(34px);
  transition: opacity 760ms ease, transform 760ms cubic-bezier(0.2, 0.8, 0.18, 1);
}

.stage.in-view,
.intro-section {
  opacity: 1;
  transform: translateY(0);
}

.intro-section {
  min-height: 88vh;
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(280px, 0.62fr);
  gap: clamp(24px, 5vw, 72px);
  align-items: center;
}

.section-mark {
  margin: 0 0 18px;
  color: #876536;
  font-size: 18px;
  letter-spacing: 0.08em;
}

h1,
h2,
p,
figure,
dl,
dd {
  margin: 0;
}

h1 {
  font-size: clamp(42px, 6vw, 76px);
  font-weight: 400;
  line-height: 1.08;
  white-space: nowrap;
}

h2 {
  font-size: clamp(34px, 5vw, 62px);
  font-weight: 400;
  line-height: 1.12;
}

.intro-text {
  max-width: 44rem;
  margin-top: 28px;
  color: var(--muted);
  font-size: clamp(18px, 1.55vw, 24px);
  line-height: 1.95;
  text-align: justify;
}

.intro-text p + p {
  margin-top: 0.9em;
}

.cover-frame {
  align-self: center;
  padding: 12px;
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: 0 28px 70px var(--shadow);
  transform: rotate(1.2deg);
  animation: imageIn 900ms cubic-bezier(0.2, 0.8, 0.18, 1) both;
}

.cover-frame img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
}

figcaption {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-top: 10px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

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

.album-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.album-card {
  position: relative;
  min-height: 360px;
  padding: 10px;
  border: 1px solid var(--line);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.78), rgba(255, 250, 240, 0.42)),
    rgba(255, 253, 247, 0.72);
  overflow: hidden;
  text-align: left;
  box-shadow:
    0 18px 46px rgba(83, 67, 42, 0.12),
    0 0 0 8px rgba(255, 255, 255, 0.28) inset;
  backdrop-filter: blur(18px);
  opacity: 0;
  transform: translateX(28px);
  animation: cardIn 650ms cubic-bezier(0.2, 0.8, 0.18, 1) var(--delay) both;
}

.album-card::before {
  position: absolute;
  inset: -18px;
  z-index: 0;
  content: "";
  border-radius: 22px;
  background:
    linear-gradient(135deg, rgba(229, 174, 84, 0.26), rgba(154, 183, 200, 0.18)),
    rgba(255, 255, 255, 0.2);
  filter: blur(18px);
  opacity: 0.78;
}

.album-card img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: calc(100% - 20px);
  min-height: 340px;
  object-fit: cover;
  transition: transform 560ms ease, filter 560ms ease;
}

.album-card::after {
  position: absolute;
  inset: 0;
  z-index: 2;
  content: "";
  background: linear-gradient(180deg, rgba(255, 250, 240, 0.02), rgba(34, 30, 24, 0.58));
}

.album-card span,
.album-card strong,
.album-card em {
  position: absolute;
  z-index: 3;
  left: 20px;
  right: 20px;
}

.album-card span {
  top: 18px;
  color: #fffaf0;
  font-size: 20px;
}

.album-card strong {
  bottom: 58px;
  color: #fffaf0;
  font-size: 32px;
  font-weight: 400;
}

.album-card em {
  bottom: 26px;
  color: rgba(255, 250, 240, 0.82);
  font-size: 17px;
  font-style: normal;
}

.album-card:hover,
.album-card.active {
  border-color: var(--sun);
}

.album-card:hover img,
.album-card.active img {
  filter: saturate(1.08) brightness(1.03);
  transform: scale(1.045);
}

.selected-head {
  align-items: end;
}

.album-date {
  color: var(--muted);
  font-size: 20px;
}

.selected-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 18px;
  align-items: stretch;
}

.selected-frame {
  padding: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 253, 247, 0.86);
  box-shadow: 0 24px 70px var(--shadow);
  cursor: zoom-in;
}

.selected-frame img {
  width: 100%;
  height: min(68vh, 680px);
  object-fit: contain;
  background: #fffaf0;
}

.params-panel {
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 26px 24px;
  box-shadow: 0 18px 48px rgba(83, 67, 42, 0.1);
  backdrop-filter: blur(16px);
}

.params-list {
  margin-top: 20px;
}

.params-list div {
  display: grid;
  grid-template-columns: 78px 1fr;
  gap: 16px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

dt {
  color: #876536;
  font-size: 17px;
}

dd {
  color: var(--ink);
  font-size: 19px;
  line-height: 1.45;
}

.thumb-strip {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 112px;
  gap: 10px;
  margin-top: 18px;
  overflow-x: auto;
  padding-bottom: 14px;
}

.thumb {
  position: relative;
  height: 132px;
  padding: 0;
  border: 1px solid var(--line);
  background: #fffaf0;
  overflow: hidden;
  opacity: 0;
  transform: translateX(20px);
  animation: cardIn 520ms ease var(--delay) both;
}

.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 320ms ease, filter 320ms ease;
}

.thumb span {
  position: absolute;
  left: 8px;
  bottom: 6px;
  display: grid;
  place-items: center;
  width: 28px;
  height: 22px;
  background: rgba(255, 250, 240, 0.82);
  color: var(--ink);
}

.thumb:hover,
.thumb.active {
  border-color: var(--sun);
}

.thumb:hover img,
.thumb.active img {
  filter: saturate(1.08);
  transform: scale(1.05);
}

.contact-section {
  min-height: 48vh;
}

.contact-line {
  color: var(--muted);
  font-size: 16px;
  line-height: 1.8;
}

.contact-line a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--line-strong);
}

.contact-line a:hover {
  color: #876536;
  border-bottom-color: var(--sun);
}

.slide-out {
  opacity: 0;
  transform: translateX(-24px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.slide-in {
  opacity: 1;
  transform: translateX(0);
  transition: opacity 520ms ease, transform 520ms cubic-bezier(0.2, 0.8, 0.18, 1);
}

.viewer {
  width: min(1280px, calc(100% - 28px));
  height: min(860px, calc(100% - 28px));
  padding: 18px;
  border: 1px solid var(--line-strong);
  background: #fffaf0;
}

.viewer::backdrop {
  background: rgba(43, 41, 36, 0.58);
  backdrop-filter: blur(12px);
}

.viewer[open] {
  display: grid;
  place-items: center;
  animation: dialogIn 320ms ease both;
}

.viewer img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.close-button {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  background: rgba(255, 250, 240, 0.88);
  color: var(--ink);
  font-size: 26px;
}

.load-error {
  padding: 80px 0;
  color: #876536;
  font-size: 28px;
}

@keyframes imageIn {
  from {
    opacity: 0;
    transform: translateX(40px) rotate(1.2deg);
  }
  to {
    opacity: 1;
    transform: translateX(0) rotate(1.2deg);
  }
}

@keyframes cardIn {
  from {
    opacity: 0;
    transform: translateX(28px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes dialogIn {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 1ms !important;
    transition-duration: 1ms !important;
  }
}

@media (max-width: 1020px) {
  .intro-section,
  .selected-workspace {
    grid-template-columns: 1fr;
  }

  .album-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .cover-frame {
    max-width: 460px;
  }
}

@media (max-width: 680px) {
  .site {
    width: min(100% - 24px, 1460px);
  }

  .topbar {
    top: 10px;
    width: calc(100% - 20px);
  }

  .stage {
    padding-top: 92px;
  }

  h1 {
    font-size: 40px;
  }

  .intro-text {
    font-size: 20px;
  }

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

  .album-card,
  .album-card img {
    min-height: 310px;
  }

  .section-head {
    display: block;
  }

  .album-date {
    margin-top: 12px;
  }

  .selected-frame img {
    height: 58vh;
  }

  .params-panel {
    padding: 22px 18px;
  }

  .thumb-strip {
    grid-auto-columns: 96px;
  }

  .thumb {
    height: 116px;
  }

  .contact-line {
    font-size: 15px;
  }
}
