:root {
  --bg: #f5f3ed;
  --text: #1a1a1a;
  --muted: #6b665c;
  --line: rgba(26, 26, 26, 0.12);
  --overlay: rgba(245, 243, 237, 0.96);
  --serif: "Cormorant Garamond", "Songti SC", "SimSun", Georgia, serif;
  --sans: Inter, "PingFang SC", "Microsoft YaHei", sans-serif;
  --max-width: 1080px;
  --gap: 28px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.5;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  cursor: pointer;
}

.top-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  pointer-events: none;
}

.top-bar > * {
  pointer-events: auto;
}

.icon-btn,
.text-btn,
.menu-close,
.lightbox-close,
.lightbox-nav {
  border: 0;
  background: transparent;
  color: var(--text);
}

.icon-btn {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  padding: 0;
}

.hamburger,
.hamburger::before,
.hamburger::after {
  display: block;
  width: 22px;
  height: 1px;
  background: currentColor;
  position: relative;
}

.hamburger::before,
.hamburger::after {
  content: "";
  position: absolute;
  left: 0;
}

.hamburger::before {
  top: -7px;
}

.hamburger::after {
  top: 7px;
}

.text-btn {
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  padding: 8px 4px;
}

.site-menu {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: var(--overlay);
  backdrop-filter: blur(6px);
  padding: 72px 32px 32px;
}

.site-menu[hidden] {
  display: none;
}

.menu-close {
  position: absolute;
  top: 16px;
  right: 20px;
  font-size: 2rem;
  line-height: 1;
}

.site-menu ul {
  list-style: none;
  margin: 48px 0 0;
  padding: 0;
}

.site-menu li + li {
  margin-top: 18px;
}

.site-menu a {
  font-family: var(--serif);
  font-size: clamp(1.8rem, 5vw, 2.4rem);
  letter-spacing: 0.04em;
}

.site-header {
  text-align: center;
  padding: 88px 20px 36px;
}

.site-header h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(2.4rem, 7vw, 3.4rem);
  font-weight: 500;
  letter-spacing: 0.12em;
}

.site-subtitle {
  margin: 10px 0 0;
  font-size: 0.78rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--muted);
}

.app {
  width: min(var(--max-width), calc(100% - 40px));
  margin: 0 auto 80px;
}

.loading,
.empty,
.about-page {
  text-align: center;
  color: var(--muted);
  padding: 48px 0;
}

.series-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--gap);
}

.series-card {
  display: block;
  border: 0;
  padding: 0;
  background: transparent;
  text-align: left;
  color: inherit;
  cursor: pointer;
}

.series-cover {
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.04);
}

.series-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.45s ease;
}

.series-card:hover .series-cover img {
  transform: scale(1.03);
}

.series-title {
  margin: 12px 0 0;
  font-family: var(--serif);
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.series-meta {
  margin: 4px 0 0;
  font-size: 0.75rem;
  color: var(--muted);
}

.series-page {
  animation: fadeIn 0.35s ease;
}

.series-page-header {
  margin-bottom: 28px;
}

.back-link {
  display: inline-block;
  margin-bottom: 18px;
  font-size: 0.82rem;
  color: var(--muted);
  letter-spacing: 0.06em;
}

.back-link:hover {
  color: var(--text);
}

.series-page-title {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  font-weight: 500;
  letter-spacing: 0.06em;
}

.gallery {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.gallery-item {
  border: 0;
  padding: 0;
  background: transparent;
  cursor: zoom-in;
}

.gallery-item img {
  width: 100%;
  height: auto;
  display: block;
}

.site-footer {
  text-align: center;
  padding: 0 20px 32px;
  font-size: 0.72rem;
  color: var(--muted);
  letter-spacing: 0.08em;
}

.lightbox {
  width: min(96vw, 1200px);
  max-height: 96vh;
  border: 0;
  padding: 0;
  background: rgba(245, 243, 237, 0.98);
  color: var(--text);
}

.lightbox::backdrop {
  background: rgba(20, 18, 14, 0.72);
}

.lightbox-body {
  margin: 0;
  padding: 48px 56px 24px;
}

.lightbox-body img {
  max-width: 100%;
  max-height: calc(96vh - 140px);
  width: auto;
  height: auto;
  display: block;
  margin: 0 auto;
}

.lightbox-body figcaption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 14px;
  font-size: 0.82rem;
  color: var(--muted);
}

.lightbox-body a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.lightbox-close {
  position: absolute;
  top: 10px;
  right: 14px;
  font-size: 2rem;
  line-height: 1;
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 2.4rem;
  line-height: 1;
  padding: 8px 12px;
  opacity: 0.7;
}

.lightbox-nav:hover {
  opacity: 1;
}

.lightbox-nav.prev {
  left: 8px;
}

.lightbox-nav.next {
  right: 8px;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 900px) {
  .series-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
  }
}

@media (max-width: 560px) {
  .series-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .top-bar {
    padding: 14px 16px;
  }

  .site-header {
    padding-top: 72px;
  }

  .lightbox-body {
    padding: 44px 16px 16px;
  }

  .lightbox-nav {
    display: none;
  }
}
