/* jacktreehouse.com — 共享设计系统 */
:root {
  --paper: #F7F5EF;
  --card: #FDFCF7;
  --ink: #1E221C;
  --mist: #5F6754;
  --pine: #3E6B50;
  --pine-soft: #E4EBE2;
  --sun: #A9663A;
  --sun-soft: #F4E4D0;
  --line: #DBDDD0;
  --line-strong: #B7BBA8;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #131511;
    --card: #1B1E17;
    --ink: #E6E8DE;
    --mist: #9AA18A;
    --pine: #85BA97;
    --pine-soft: #223028;
    --sun: #E0A374;
    --sun-soft: #33261B;
    --line: #292C24;
    --line-strong: #3F4437;
  }
}
:root[data-theme="dark"] {
  --paper: #131511; --card: #1B1E17; --ink: #E6E8DE; --mist: #9AA18A;
  --pine: #85BA97; --pine-soft: #223028; --sun: #E0A374; --sun-soft: #33261B;
  --line: #292C24; --line-strong: #3F4437;
}
:root[data-theme="light"] {
  --paper: #F7F5EF; --card: #FDFCF7; --ink: #1E221C; --mist: #5F6754;
  --pine: #3E6B50; --pine-soft: #E4EBE2; --sun: #A9663A; --sun-soft: #F4E4D0;
  --line: #DBDDD0; --line-strong: #B7BBA8;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
.display {
  font-family: Georgia, "Noto Serif SC", "Source Han Serif SC", SimSun, serif;
  font-weight: 500;
}
img { max-width: 100%; display: block; }
a { color: var(--pine); text-decoration: none; }
a:hover { color: var(--sun); }

/* ---------- 顶部导航 ---------- */
.topnav {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.topnav-inner {
  max-width: 1180px; margin: 0 auto; padding: 18px 32px;
  display: flex; align-items: baseline; gap: 32px;
}
.topnav .brand {
  font-family: Georgia, "Noto Serif SC", SimSun, serif;
  font-size: 20px; font-weight: 600; color: var(--ink);
  letter-spacing: 0.02em;
}
.topnav .brand:hover { color: var(--pine); }
.topnav nav { margin-left: auto; display: flex; gap: 30px; font-size: 17px; }
.topnav nav a { color: var(--mist); }
.topnav nav a:hover, .topnav nav a.cur { color: var(--ink); }

/* ---------- 通用容器 ---------- */
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 26px; }
.page { padding: 60px 26px 100px; }
.page-head { margin-bottom: 40px; }
.page-eyebrow {
  font-size: 12px; letter-spacing: 0.24em; text-transform: uppercase;
  color: var(--pine); font-weight: 600; margin-bottom: 12px;
}
h1.page-title {
  font-size: clamp(30px, 5vw, 40px); line-height: 1.2; font-weight: 500;
  text-wrap: balance;
}
.page-sub { color: var(--mist); font-size: 15px; margin-top: 12px; max-width: 42em; }

/* ---------- 页脚 ---------- */
.footer {
  border-top: 1px solid var(--line);
  margin-top: 80px; padding: 30px 26px;
  color: var(--mist); font-size: 13px;
}
.footer-inner {
  max-width: 1180px; margin: 0 auto;
  display: flex; justify-content: space-between; align-items: baseline; gap: 20px; flex-wrap: wrap;
}
.footer a { color: var(--mist); }
.footer a:hover { color: var(--ink); }

/* ---------- 系列页 · 定向网格(横图=½ 宽,竖图=⅓ 宽,全景=通栏) ---------- */
.series-masonry {
  max-width: 1320px; margin: 0 auto; padding: 0 22px 100px;
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px;
  grid-auto-flow: dense;
}
.series-masonry figure {
  margin: 0; position: relative; overflow: hidden;
  border-radius: 2px; background: var(--card);
  grid-column: span 2; /* 竖图默认 */
}
.series-masonry figure.horizontal { grid-column: span 3; }
.series-masonry figure.panorama { grid-column: span 6; }
.series-masonry img { width: 100%; height: auto; display: block; transition: transform .55s ease; }
.series-masonry figure:hover img { transform: scale(1.02); }
.series-masonry figcaption {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 30px 16px 14px; color: #F5F1E6;
  font-size: 15px; font-weight: 500; letter-spacing: 0.06em;
  background: linear-gradient(transparent, rgba(0,0,0,.72));
  opacity: 0; transition: opacity .3s;
}
.series-masonry figure:hover figcaption { opacity: 1; }
@media (max-width: 900px) {
  .series-masonry { grid-template-columns: repeat(4, 1fr); }
  .series-masonry figure { grid-column: span 2; }
  .series-masonry figure.horizontal { grid-column: span 4; }
  .series-masonry figure.panorama { grid-column: span 4; }
}
@media (max-width: 560px) {
  .series-masonry { grid-template-columns: 1fr; gap: 8px; }
  .series-masonry figure, .series-masonry figure.horizontal,
  .series-masonry figure.panorama { grid-column: span 1; }
}
.series-back {
  max-width: 1280px; margin: 0 auto 22px; padding: 0 22px;
  color: var(--mist); font-size: 13px;
}
.series-back a { color: var(--mist); border-bottom: 1px solid var(--line); padding-bottom: 1px; }
.series-back a:hover { color: var(--ink); border-color: var(--pine); }
.series-head { max-width: 1280px; margin: 0 auto; padding: 0 22px; }

/* ---------- 灯箱 ---------- */
body.lb-open { overflow: hidden; }
.lightbox {
  display: none; position: fixed; inset: 0; z-index: 100;
  background: rgba(6, 8, 6, .96);
  align-items: center; justify-content: center;
  animation: lb-fade .18s ease-out;
}
@media (prefers-reduced-motion: reduce) { .lightbox { animation: none; } }
@keyframes lb-fade { from { opacity: 0; } to { opacity: 1; } }
.lightbox.on { display: flex; }
.lb-img {
  max-width: 92vw; max-height: 88vh; width: auto; height: auto;
  border-radius: 2px; cursor: zoom-out;
  box-shadow: 0 30px 80px rgba(0,0,0,.4);
}
.lb-nav {
  position: fixed; top: 50%; transform: translateY(-50%);
  width: 52px; height: 52px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.08); color: rgba(255,255,255,.85);
  border: none; cursor: pointer; user-select: none;
  transition: background .2s, color .2s;
  z-index: 3;
}
.lb-nav:hover, .lb-nav:focus-visible {
  background: rgba(255,255,255,.2); color: #fff; outline: none;
}
.lb-nav span { font-size: 32px; line-height: 1; font-family: Georgia, serif; }
.lb-prev { left: 28px; }
.lb-next { right: 28px; }
.lb-close {
  position: fixed; top: 22px; right: 26px;
  width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: transparent; color: rgba(255,255,255,.7);
  border: none; cursor: pointer; font-size: 16px; z-index: 3;
  transition: background .2s, color .2s;
}
.lb-close:hover, .lb-close:focus-visible {
  background: rgba(255,255,255,.12); color: #fff; outline: none;
}
.lb-meta {
  position: fixed; left: 0; right: 0; bottom: 22px; z-index: 3;
  display: flex; justify-content: center; gap: 20px; pointer-events: none;
  color: rgba(255,255,255,.7); font-size: 13px; letter-spacing: 0.08em;
}
.lb-count { color: rgba(255,255,255,.42); font-variant-numeric: tabular-nums; }
@media (max-width: 700px) {
  .lb-prev { left: 8px; } .lb-next { right: 8px; }
  .lb-nav { width: 44px; height: 44px; } .lb-nav span { font-size: 28px; }
}
.series-masonry figure { cursor: zoom-in; }
