/* =========================================================
   设置区：字体、字号、留白都在这里改。改完跑 python3 build.py
   ========================================================= */
:root {
  --font: system-ui, -apple-system, "Helvetica Neue", Helvetica, Arial, sans-serif;
  --text-size: 1.0625rem;      /* 正文字号，17px */
  --text-size-small: 0.9375rem;/* 图注、作品信息，15px */
  --line-height: 1.55;
  --color-text: #000;
  --color-bg: #fff;
  --color-muted: #666;
  --page-max-width: 1200px;    /* 页面最宽多少 */
  --text-max-width: 40rem;     /* 一段文字最宽多少，方便阅读 */
  --gutter: 1.25rem;           /* 页面左右留白（手机） */
  --gutter-wide: 3rem;         /* 页面左右留白（电脑） */
  --space: 1.5rem;             /* 基本间距 */
  --space-large: 3rem;         /* 大段落之间 */
  --list-gap: 4rem;            /* 首页作品和作品之间 */
  --slide-max-height: 72vh;    /* 作品页单张图最高占屏幕多少 */
  --thumb-height: 56px;        /* 作品页下面那排小缩略图的高度 */
}

/* ========================================================= */

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--text-size);
  line-height: var(--line-height);
  color: var(--color-text);
  background: var(--color-bg);
  padding: 0 var(--gutter);
}

@media (min-width: 720px) {
  body { padding: 0 var(--gutter-wide); }
}

a { color: inherit; text-decoration: none; }
a:hover, a:focus { text-decoration: underline; }

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

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

/* 顶部：名字 + 导航 */
.site-header {
  max-width: var(--page-max-width);
  margin: 0 auto;
  padding: var(--space) 0;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space);
}

.site-name { font-weight: 600; }

.site-nav {
  display: flex;
  gap: var(--space);
  align-items: baseline;
}

.site-nav a[aria-current="page"],
.site-nav summary[aria-current="page"] { text-decoration: underline; }

/* Works 菜单：点开显示年份 */
.nav-works { position: relative; }

.nav-works summary {
  list-style: none;
  cursor: pointer;
  user-select: none;
}
.nav-works summary::-webkit-details-marker { display: none; }
.nav-works summary::after { content: " ▾"; font-size: 0.8em; }
.nav-works[open] summary::after { content: " ▴"; }
.nav-works summary:hover { text-decoration: underline; }

.nav-years {
  list-style: none;
  margin: 0;
  padding: 0.5rem 0 0;
  position: absolute;
  left: 0;
  top: 100%;
  background: var(--color-bg);
  min-width: 100%;
  z-index: 10;
}

.nav-years li { padding: 0.15rem 0; }
.nav-years a[aria-current="page"] { text-decoration: underline; }

.site-main {
  max-width: var(--page-max-width);
  margin: 0 auto;
  padding: var(--space) 0 var(--space-large);
}

/* 首页：某一年的作品网格 */
.year-title {
  font-size: var(--text-size);
  font-weight: 400;
  color: var(--color-muted);
  margin: 0 0 var(--space);
}

.works-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--list-gap);
}

.works-item a { display: block; }
.works-item a:hover, .works-item a:focus { text-decoration: none; }
.works-item a:hover .works-item-label,
.works-item a:focus .works-item-label { text-decoration: underline; }

.works-item img { width: 100%; }

.works-item-label {
  display: block;
  margin-top: 0.75rem;
}

/* 作品页 */
.work-header { margin-bottom: var(--space); }

.work-title {
  font-size: 1.25rem;
  font-weight: 600;
  font-style: italic;
  margin: 0;
}

.work-year { font-style: normal; font-weight: 400; }

/* 翻图区 */
.slides-stage { position: relative; }

.slide { margin: 0 0 var(--space); }

.slide img {
  width: 100%;
  max-height: var(--slide-max-height);
  object-fit: contain;
  object-position: left top;
}

.slide figcaption {
  margin-top: 0.6rem;
  font-size: var(--text-size-small);
  color: var(--color-muted);
}

/* 有 JS 时：一次只显示一张，箭头出现 */
.slides.has-js .slide { display: none; margin: 0; }
.slides.has-js .slide.is-active { display: block; }

/* 缩略图条 + 小箭头（只在有 JS 时出现） */
.slides-strip {
  display: none;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
}
.slides.has-js .slides-strip { display: flex; }
.slides.has-js.is-single .slides-strip { display: none; }

.slides-arrow {
  flex: none;
  font-size: 1.5rem;
  line-height: 1;
  padding: 0.25rem 0.5rem;
  color: var(--color-muted);
}
.slides-arrow:hover, .slides-arrow:focus-visible { color: var(--color-text); }

.slides-thumbs {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  scrollbar-width: none;
}
.slides-thumbs::-webkit-scrollbar { display: none; }

.slides-thumb {
  display: block;
  opacity: 0.45;
  transition: opacity 0.15s;
}
.slides-thumb img {
  height: var(--thumb-height);
  width: auto;
}
.slides-thumb:hover, .slides-thumb:focus-visible, .slides-thumb.is-active { opacity: 1; }

.slides-counter {
  margin: 0.6rem 0 0;
  font-size: var(--text-size-small);
  color: var(--color-muted);
  min-height: 1.4em;
}
.slides.is-single .slides-counter { display: none; }

.work-body {
  margin-top: var(--space-large);
  max-width: var(--text-max-width);
}

.work-meta {
  margin: 0 0 var(--space);
  font-size: var(--text-size-small);
  color: var(--color-muted);
}

.work-text p { margin: 0 0 1em; }

.work-nav {
  margin-top: var(--space-large);
  display: flex;
  justify-content: space-between;
  gap: var(--space);
}

.work-nav-next { margin-left: auto; text-align: right; }

/* About 页 */
.about { max-width: var(--text-max-width); }

.about h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: var(--space-large) 0 var(--space);
}
.about h2:first-child { margin-top: 0; }

.about h3 {
  font-size: var(--text-size);
  font-weight: 600;
  margin: var(--space) 0 0.5rem;
}

.about p { margin: 0 0 1em; }

.about ul {
  list-style: none;
  margin: 0 0 1em;
  padding: 0;
}

.about li { margin: 0 0 0.35em; }

.about a { text-decoration: underline; }
