:root {
  --bg: #f7f7f8;
  --surface: #fff;
  --text: #111;
  --muted: #8a8a8f;
  --line: #ebebed;
  --shadow: 0 8px 28px rgba(0, 0, 0, 0.08);
  --radius: 12px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

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

button {
  font-family: inherit;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding-left: clamp(1.25rem, 5vw, 3.5rem);
  padding-right: clamp(1.25rem, 5vw, 3.5rem);
}

.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 58px;
}

.logo {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 2px;
}

.logo-en {
  font-size: 0.65rem;
  font-weight: 400;
  letter-spacing: 2px;
  color: var(--muted);
}

.nav-links {
  display: flex;
  gap: 1.6rem;
  list-style: none;
  font-size: 0.9rem;
  font-weight: 500;
}

.nav-links a {
  opacity: 0.75;
  transition: opacity 0.2s;
}

.nav-links a:hover,
.nav-links a:focus {
  opacity: 1;
}

/* ---------- 首屏 ---------- */
.hero {
  min-height: calc(100vh - 58px);
  display: flex;
  align-items: center;
  padding: 4rem 0;
  background: var(--bg);
}

.hero-inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
  align-items: center;
  width: 100%;
}

.hero-tag {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 4px;
  color: var(--muted);
}

.hero-name {
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 500;
  letter-spacing: 6px;
  line-height: 1.2;
  margin-top: 0.35rem;
}

.hero-meta {
  font-size: 0.9rem;
  letter-spacing: 2px;
  color: var(--muted);
  margin-top: 0.35rem;
}

.hero-photo img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  object-position: center top;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hero-info .btn {
  margin-top: 2rem;
}

/* ---------- 相册集 ---------- */
.albums-section {
  padding: 4rem clamp(1.25rem, 5vw, 3.5rem) 3rem;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.75rem;
}

.section-head h2 {
  font-size: 1.35rem;
  font-weight: 600;
}

.section-head p {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 0.25rem;
}

.view-toggle {
  display: inline-flex;
  gap: 0.25rem;
  padding: 0.25rem;
  background: #efeff1;
  border-radius: 999px;
}

.toggle-btn {
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 0.82rem;
  padding: 0.45rem 1rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.toggle-btn:hover {
  color: var(--text);
}

.toggle-btn.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  font-weight: 500;
}

.album-grid[hidden],
.accordion[hidden] {
  display: none;
}

.album-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

.album-card {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--line);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.25s;
}

.album-card:hover,
.album-card:focus {
  transform: translateY(-3px);
}

.album-cover {
  position: relative;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: var(--line);
}

.album-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s;
}

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

.album-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.68) 0%, rgba(0, 0, 0, 0.1) 34%, rgba(0, 0, 0, 0) 60%);
}

.album-info {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.85rem 0.9rem;
  color: #fff;
}

.album-info h3 {
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 1px;
}

.album-info span {
  font-size: 0.75rem;
  opacity: 0.85;
  white-space: nowrap;
}

/* ---------- 折叠列表（风琴式） ---------- */
.accordion {
  border-top: 1px solid var(--line);
}

.accordion[hidden] {
  display: none;
}

.acc-item {
  border-bottom: 1px solid var(--line);
}

.acc-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: 100%;
  padding: 1.1rem 0;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  color: var(--text);
}

.acc-header h3 {
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 1px;
}

.acc-header .acc-count {
  font-size: 0.8rem;
  color: var(--muted);
}

.acc-header .acc-arrow {
  margin-left: auto;
  font-size: 0.8rem;
  color: var(--muted);
  transition: transform 0.25s;
}

.acc-item.open .acc-arrow {
  transform: rotate(90deg);
}

.acc-body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.45s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.acc-item.open .acc-body {
  grid-template-rows: 1fr;
}

.acc-body > .gallery {
  overflow: hidden;
  padding-bottom: 1.5rem;
}

/* ---------- 相册详情 ---------- */
.album-view {
  position: fixed;
  inset: 0;
  z-index: 150;
  background: var(--bg);
  overflow-y: auto;
  visibility: hidden;
  transform: translateY(100%);
  transition: transform 0.35s ease, visibility 0.35s;
}

.album-view.active {
  visibility: visible;
  transform: translateY(0);
}

.album-view-header {
  position: sticky;
  top: 0;
  z-index: 2;
  background: rgba(247, 247, 248, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.album-view-header-inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  height: 58px;
}

.back-btn {
  background: none;
  border: none;
  color: var(--text);
  font-size: 0.9rem;
  cursor: pointer;
  opacity: 0.8;
  transition: opacity 0.2s;
}

.back-btn:hover,
.back-btn:focus {
  opacity: 1;
}

#album-view-title {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 1px;
}

.album-view-count {
  margin-left: auto;
  font-size: 0.8rem;
  color: var(--muted);
}

.album-view-body {
  padding: 1.25rem 0 4rem;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.6rem;
}

.gallery-item {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  background: var(--line);
  aspect-ratio: 3 / 4;
  cursor: pointer;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s;
}

.gallery-item:hover img {
  transform: scale(1.04);
}

/* ---------- 关于 / 联系 ---------- */
.about-section {
  padding: 4rem clamp(1.25rem, 5vw, 3.5rem);
}

.about-text h2,
.contact h2 {
  font-size: 1.35rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
}

.about-text p {
  color: #555;
  margin-bottom: 2rem;
  max-width: 720px;
}

.stats {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  list-style: none;
  max-width: 420px;
  margin-top: 1.75rem;
}

.stats li {
  display: flex;
  align-items: baseline;
  justify-content: flex-start;
  gap: 1.75rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--line);
}

.stats strong {
  font-size: 0.9rem;
  letter-spacing: 1px;
  color: var(--muted);
  font-weight: 500;
}

.stats span {
  font-size: 1.05rem;
  font-weight: 500;
}

.contact {
  padding: 4rem clamp(1.25rem, 5vw, 3.5rem);
}

.contact p {
  color: var(--muted);
  margin-bottom: 1.5rem;
}

.btn {
  display: inline-block;
  padding: 0.75rem 2rem;
  background: var(--text);
  color: var(--bg);
  border: 1px solid var(--text);
  border-radius: 999px;
  font-size: 0.9rem;
  letter-spacing: 1px;
  transition: background 0.2s, color 0.2s;
}

.btn-outline {
  background: transparent;
  color: var(--text);
}

.btn-outline:hover,
.btn-outline:focus {
  background: var(--text);
  color: var(--bg);
}

.socials {
  display: flex;
  gap: 1.5rem;
  margin-top: 2rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.socials a:hover,
.socials a:focus {
  color: var(--text);
}

.site-footer {
  padding: 2rem 0;
  border-top: 1px solid var(--line);
  text-align: center;
  font-size: 0.8rem;
  color: var(--muted);
}

/* ---------- 灯箱 ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.94);
  padding: 1rem;
}

.lightbox.active {
  display: flex;
}

.lightbox img {
  max-height: 90vh;
  max-width: 92vw;
  object-fit: contain;
  border-radius: 6px;
}

.lightbox button {
  position: absolute;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 1.8rem;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s;
  padding: 1rem;
}

.lightbox button:hover,
.lightbox button:focus {
  opacity: 1;
}

.lightbox-close {
  top: 0;
  right: 0;
  font-size: 2.2rem;
}

.lightbox-prev {
  left: 0;
  top: 50%;
  transform: translateY(-50%);
}

.lightbox-next {
  right: 0;
  top: 50%;
  transform: translateY(-50%);
}

/* ---------- 响应式 ---------- */
@media (min-width: 900px) {
  .hero-inner {
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
  }
}

@media (min-width: 768px) {
  .album-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
  }

  /* --cols 由 albums.json 的 columns 字段设置，未设置时默认 3 列 */
  .gallery {
    grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr));
    gap: 0.85rem;
  }
}

@media (min-width: 1200px) {
  .album-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 1.15rem;
  }

  /* 未设置 columns 时默认 4 列，设置了则以设置为准（如相册 01 为 3 列） */
  .gallery {
    grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr));
    gap: 1rem;
  }
}

@media (max-width: 899px) {
  .hero-photo {
    order: -1;
  }

  .hero-photo img {
    max-width: 420px;
    margin: 0 auto;
  }
}

@media (max-width: 767px) {
  .logo-en {
    display: none;
  }

  .nav-links {
    gap: 1.1rem;
    font-size: 0.85rem;
  }
}

/* ---------- 动效 ---------- */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 0;
  background: linear-gradient(90deg, #111, #bfa07a);
  z-index: 300;
}

.site-header {
  transition: box-shadow 0.3s ease;
}

.site-header.scrolled {
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.07);
}

.nav-links a {
  position: relative;
}

.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 100%;
  height: 1px;
  background: var(--text);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.nav-links a:hover::after,
.nav-links a:focus::after {
  transform: scaleX(1);
  transform-origin: left;
}

@keyframes photoReveal {
  from {
    clip-path: inset(100% 0 0 0);
    transform: scale(1.08);
  }
  to {
    clip-path: inset(0 0 0 0);
    transform: scale(1);
  }
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(22px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes cardIn {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes lbFade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes lbZoom {
  from {
    opacity: 0;
    transform: scale(0.92);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.hero-photo img {
  animation: photoReveal 1.1s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.hero-photo {
  will-change: transform;
}

.hero-info > * {
  animation: fadeUp 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.hero-info > *:nth-child(1) {
  animation-delay: 0.15s;
}
.hero-info > *:nth-child(2) {
  animation-delay: 0.25s;
}
.hero-info > *:nth-child(3) {
  animation-delay: 0.35s;
}
.hero-info > *:nth-child(4) {
  animation-delay: 0.45s;
}
.hero-info > *:nth-child(5) {
  animation-delay: 0.55s;
}

.stats li {
  animation: fadeUp 0.55s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.stats li:nth-child(1) { animation-delay: 0.50s; }
.stats li:nth-child(2) { animation-delay: 0.56s; }
.stats li:nth-child(3) { animation-delay: 0.62s; }
.stats li:nth-child(4) { animation-delay: 0.68s; }
.stats li:nth-child(5) { animation-delay: 0.74s; }
.stats li:nth-child(6) { animation-delay: 0.80s; }
.stats li:nth-child(7) { animation-delay: 0.86s; }
.stats li:nth-child(8) { animation-delay: 0.92s; }

.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.2, 0.8, 0.2, 1);
  transition-delay: calc(var(--i, 0) * 70ms);
}

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

.album-grid.animating .album-card,
.accordion.animating .acc-item {
  animation: cardIn 0.55s cubic-bezier(0.2, 0.8, 0.2, 1) both;
  animation-delay: calc(var(--i, 0) * 70ms);
}

.album-cover::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(115deg, transparent 35%, rgba(255, 255, 255, 0.4) 50%, transparent 65%);
  transform: translateX(-130%);
  transition: transform 0.85s ease;
}

.album-card:hover .album-cover::before,
.album-card:focus .album-cover::before {
  transform: translateX(130%);
}

.gallery-item::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0);
  transition: background 0.3s ease;
}

.gallery-item:hover::after {
  background: rgba(0, 0, 0, 0.12);
}

.album-view.active .gallery-item {
  animation: cardIn 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) both;
  animation-delay: calc(var(--i, 0) * 45ms);
}

.album-view.active .album-view-header {
  animation: fadeUp 0.35s ease both;
}

.lightbox.active {
  animation: lbFade 0.25s ease both;
}

.lightbox.active img {
  animation: lbZoom 0.35s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.btn {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  transition: color 0.3s ease;
}

.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--text);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.btn:hover::before,
.btn:focus::before {
  transform: scaleX(1);
}

.btn:hover,
.btn:focus {
  color: var(--bg);
}

/* ---------- 访问门槛 ---------- */
body.gated {
  overflow: hidden;
}

.gate {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  text-align: center;
  padding: 1.5rem;
  transition: opacity 0.7s ease, visibility 0.7s;
}

.gate.unlocked {
  opacity: 0;
  visibility: hidden;
}

.gate-inner {
  width: 100%;
  max-width: 420px;
  color: #fff;
  animation: fadeUp 0.9s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.gate-brand {
  font-size: 1.6rem;
  letter-spacing: 10px;
  font-weight: 500;
}

.gate-sub {
  margin-top: 0.6rem;
  font-size: 0.7rem;
  letter-spacing: 4px;
  color: rgba(255, 255, 255, 0.45);
}

.gate-form {
  margin-top: 2.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
}

.gate-input {
  width: 100%;
  max-width: 300px;
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff;
  font-size: 1rem;
  text-align: center;
  letter-spacing: 2px;
  padding: 0.6rem 0;
  outline: none;
  transition: border-color 0.3s;
}

.gate-input:focus {
  border-color: #fff;
}

.gate-input::placeholder {
  color: rgba(255, 255, 255, 0.3);
  letter-spacing: 1px;
}

.gate-btn {
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: #fff;
  padding: 0.6rem 2.4rem;
  border-radius: 999px;
  font-size: 0.85rem;
  letter-spacing: 3px;
  cursor: pointer;
  transition: background 0.3s, color 0.3s, border-color 0.3s;
}

.gate-btn:hover,
.gate-btn:focus {
  background: #fff;
  color: #000;
  border-color: #fff;
}

.gate-msg {
  min-height: 1.2rem;
  margin-top: 1rem;
  font-size: 0.8rem;
  color: #ff6b6b;
  opacity: 0;
  transition: opacity 0.3s;
}

.gate-msg.show {
  opacity: 1;
}

.gate-verify {
  display: inline-block;
  margin-top: 2rem;
  font-size: 0.72rem;
  letter-spacing: 2px;
  color: rgba(255, 255, 255, 0.35);
}

.gate-verify:hover,
.gate-verify:focus {
  color: rgba(255, 255, 255, 0.8);
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  20% {
    transform: translateX(-8px);
  }
  40% {
    transform: translateX(8px);
  }
  60% {
    transform: translateX(-5px);
  }
  80% {
    transform: translateX(5px);
  }
}

.gate-input.shake {
  animation: shake 0.45s ease;
  border-color: #ff6b6b;
}

/* ---------- 整幅展示（模卡等需要看清细节的相册） ---------- */
.gallery-full {
  display: block !important;
}

.gallery-full .gallery-item {
  aspect-ratio: auto !important;
  margin-bottom: 0.9rem;
}

.gallery-full .gallery-item:last-child {
  margin-bottom: 0;
}

.gallery-full .gallery-item img {
  width: 100% !important;
  height: auto !important;
  object-fit: fill !important;
}

/* ---------- 独立相册页（dogs.html） ---------- */
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.75rem;
}

.page-head h1 {
  font-size: 1.35rem;
  font-weight: 600;
}

.page-head p {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 0.25rem;
}

.back-link {
  font-size: 0.85rem;
  color: var(--muted);
  transition: color 0.2s;
}

.back-link:hover,
.back-link:focus {
  color: var(--text);
}

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

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