/* ============================================================
   style.css —— 网站的全部样式（只有这一个样式文件）
   ------------------------------------------------------------
   想换配色？只改下面【1. 颜色和尺寸】这一段里的 # 号颜色就行。
   改完存盘，回到浏览器按 Command + R 刷新就能看到。
   ============================================================ */

/* ---------- 1. 设计变量（★ 换风格只改这一段） ----------
   数值来源：当代插画作品集的通行做法（留白 / 字号 / 动效节奏）
   —— 背景纯白、暖褐色文字、不用粗体、标题字距 -0.02em、正文 16px/行高 1.5、
      版心 1920px 左右留白 4vw、全局淡入 0.90s / ease。
   注：它的「次要色」#B9A590 在白底上只有 2.3:1（看不清），所以只用来做线/底色；
      真正写字用的次要色换成了同色系里够深的 #7E7365。                                    */
:root {
  /* — 颜色 — */
  --bg:        #FFFFFF;       /* 页面背景：纯白 */
  --surface:   #F4EFE8;   /* 浅色块、占位方块（暖米白） */
  --ink:       #574C3F;   /* 主要文字：暖褐 */
  --ink-soft:  #6E6355;    /* 次要文字（比正文浅一点，5.9:1） */
  --ink-faint: #7E7365;   /* 更浅的说明文字（13px 小字，4.6:1 仍合格） */
  --line:      #ECE4DA;   /* 细线、边框（米白） */
  --accent:    #1060A0;   /* 强调色：取自《开关》封面的蓝（悬停时那条细线用它；对白底 6.56:1） */

  /* — 字体（Helvetica Neue，Mac 自带；Windows 回退 Arial）— */
  --font-body: "Helvetica Neue", Helvetica, Arial, "PingFang SC", "Hiragino Sans GB", sans-serif;
  --font-display: var(--font-body);
  --font: var(--font-body);

  /* — 字号（"流体缩放"：屏幕越宽字越大，但有上下限）— */
  --size-name:    clamp(20px, calc(1rem + 0.6vw), 28px);   /* 站名 */
  --size-project:    clamp(28px, calc(1rem + 1.8vw), 52px);   /* 绘本页大标题 */
  --size-work:    clamp(26px, calc(1rem + 1.5vw), 46px);   /* 作品页大标题 */
  --size-group:   clamp(18px, calc(1rem + 0.5vw), 26px);   /* 板块小标题 */
  --size-nav:     16px;   /* 名字下面那一行板块链接（与正文字号相同） */
  --size-card:    17px;   /* 作品格子的标题 */
  --size-body:    16px;   /* 正文 */
  --size-meta-lg: 15px;
  --size-meta:    14px;
  --size-faint:   13px;

  /* — 字距与字重（全站不用粗体，标题字距略收）— */
  --track-name:   -0.02em;
  --weight-name:  600;                         /* 站名字重（原来 400；艺术家要求加粗） */
  --track-nav:    0em;
  --track-group:  -0.02em;
  --weight-title: 400;

  /* — 节奏与尺度（版心宽度、左右留白、卡片间距）— */
  --page-max:   1600px;   /* 版心最大宽度：想更满幅就调大，想更聚焦就调小 */
  --pad-x:      4vw;
  --pad-top:    clamp(14px, 1.4vw, 20px);  /* 页头上留白：窄导航栏（参考图实测约 17px） */
  --pad-head-b: clamp(14px, 1.4vw, 20px);  /* 页头下留白：与上留白对称，形成"窄条" */
  --gap:        40px;
  --gap-section: clamp(48px, 7vw, 96px);
  --stack-gap:  24px;

  /* — 线条 / 圆角 / 阴影 — */
  --line-w: 1px;
  --radius: 0px;
  --shadow: none;
  /* 绘本封面往外的柔和阴影（艺术家要用透明底 PNG 的封面；三档见下）
     用 drop-shadow 而不是 box-shadow：有透明底时会顺着书的形状走 */
  --cover-shadow: 0 14px 30px rgba(87, 76, 63, 0.16);

  /* — 动效（淡入 0.90s、ease；组内依次出现的小间隔见 script.js）— */
  --dur:    0.9s;
  --ease:   ease;
  --shift:  14px;
  --stagger: 0.12s;
}

/* ---------- 2. 基础 ---------- */
* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--size-body);
  line-height: 1.5;   /* 正文行高 */
  font-weight: 400;
}

a { color: inherit; }

a:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

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

/* ---------- 3. 顶部：名字 / 一句话 / 导航 ---------- */
.site-header {
  position: sticky;              /* 固定页头（jx 要求）：往下滚也留在顶部 */
  top: 0;
  z-index: 50;
  background: var(--bg);         /* 满宽白底，内容不会从两侧露出来 */
  padding: 0;                    /* 留白交给内层，背景才能整条铺满 */
}

.site-header-inner {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: var(--pad-top) var(--pad-x) var(--pad-head-b);
}

.site-name {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--size-name);
  line-height: 1.2;
  font-weight: var(--weight-name);
  letter-spacing: var(--track-name);
}

/* ---------- 4. 正文区域 ---------- */
main {
  width: 100%;              /* 关键：flex 容器里必须显式 100%，否则会收缩成内容宽 */
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 0 24px 96px;
}

/* ---------- 5. 首页的作品网格 ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--gap);
}

/* 竖构图板块（比如 sketchbook）：方框改成 3:4 竖版，竖着的画不会被裁 */
.grid--portrait .thumb { aspect-ratio: 3 / 4; }

/* 竖版方框里的图：整张完整放进框里，不裁切；空出来的地方就是方框底色 */
.grid--portrait .thumb img { object-fit: contain; }

/* 正方形格子：给绘本列表用（绘本封面大多接近方形，放竖框里会上下留一大片）
   图照样完整显示，不裁切 */
.grid--square .thumb { aspect-ratio: 1 / 1; }
.grid--square .thumb img { object-fit: contain; }

/* 白底单张插画：让图铺满方框（上下会裁掉一点空白边），比留白边干净 */
.grid--crop .thumb img { object-fit: cover; }

.card a {
  display: block;
  text-decoration: none;
  color: inherit;
}

/* 图片框：有真图时里面放 <img>，没图时里面放占位方块 */
.thumb {
  position: relative;
  aspect-ratio: 4 / 3;
  background: var(--bg);   /* 原来是暖米色 --surface，会显得发黄；改成纯白，和页面统一（LJ 2026-09-28） */
  border: var(--line-w) solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform 0.35s ease, filter 0.35s ease;
}

.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;      /* 统一裁切，绝不拉伸变形 */
}

/* ---------- 悬停动效（艺术家选定的 ④ 号）----------
   ① 图片轻微放大  ② 标题轻轻右移  ③ 标题底下长出一道细线
   想调幅度：改 1.04（放大）/ 4px（位移）/ 42px（细线长度）
   想换细线颜色：改 --accent                                          */
.card a .thumb {
  transition: transform 0.5s var(--ease), filter 0.5s ease;
}

.card-text { padding-top: 14px; }

.card-title {
  position: relative;
  display: inline-block;
  margin: 0;
  font-size: var(--size-card);
  font-weight: var(--weight-title);
  line-height: 1.5;
  transition: transform 0.45s var(--ease);
}

/* 标题底下那道细线：平时长度 0，鼠标放上去长到 42px */
.card-title::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -3px;
  height: var(--line-w);
  width: 0;
  background: var(--accent);
  transition: width 0.45s var(--ease);
}

/* 悬停效果只在「真的有鼠标」的设备上生效：
   手机/平板点一下不会卡在"悬停"状态；系统开了「减少动态效果」的人也不会看到（见文件末尾） */
@media (hover: hover) and (pointer: fine) {
  .card a:hover .thumb {
    transform: scale(1.04);
    filter: brightness(0.96);
  }

  .card a:hover .card-title { transform: translateX(4px); }
  .card a:hover .card-title::after { width: 42px; }
}

.card-meta {
  margin: 4px 0 0;
  font-size: var(--size-meta);
  color: var(--ink-soft);
}

/* ---------- 6. 作品详情页 ---------- */
.back {
  margin: 0;
  font-size: 15px;
}

.site-header .back { margin-top: 22px; }

.back a {
  text-decoration: none;
  color: var(--ink-soft);
}

.back a:hover { color: var(--ink); }

/* ---------- 7. 「关于我」页 ---------- */
.about { max-width: 940px; }

/* 「关于我」页：大图在上、文字在下（这样自画像能放大，又不会把文字挤窄）
   想改图的大小：改下面 .about-photo 的 max-width */
.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 40px;
  justify-items: start;
}

.about-photo {
  margin: 0;
  max-width: 640px;   /* ← 自画像的显示宽度（现在是 640px） */
  width: 100%;
}

.about-photo img {
  display: block;
  width: 100%;
  height: auto;
  border: var(--line-w) solid var(--line);
  border-radius: var(--radius);
}

.about-photo figcaption {
  margin-top: 8px;
  font-size: var(--size-faint);
  color: var(--ink-faint);
}

.about-text { max-width: 640px; }

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

.about .lead {
  font-size: 19px;
  color: var(--ink);
}

/* ---------- 8. 页脚（联系方式） ---------- */
.site-footer {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 40px 24px 72px;
  border-top: 1px solid var(--line);
  font-size: 15px;
  color: var(--ink-soft);
}

.site-footer p { margin: 0 0 6px; }
.site-footer a { color: var(--ink); }

.site-footer .small {
  font-size: var(--size-faint);
  color: var(--ink-faint);
  margin-top: 10px;
}

/* 首页：标题以下全是图 —— 页头不留底部空隙，图片紧贴标题一张接一张 */
.page-home .site-header {
  padding-bottom: 0;
}

.page-home .site-footer { display: none; }   /* 首页没有页脚 */

/* ---------- 首页：一块满幅大图 + 悬停时缓慢换图（不滚动） ----------
   大图全宽、约 3:2 横幅构图；这里是"整页一屏"的做法：
   页头下面就是一块大图，鼠标放上去每 1.8 秒慢慢淡换下一张。 */

.page-home {
  display: flex;
  flex-direction: column;
  min-height: 100vh;        /* 首页刚好一屏，不需要往下滚 */
}

.page-home main {
  width: 100%;
  max-width: none;          /* 不受 1600px 版心限制 → 真正满幅 */
  margin: 0;                /* 关键：必须清掉基础规则的 margin:0 auto */
  padding: 0;
}

.home-hero {
  position: relative;
  flex: 1 1 auto;
  min-height: 55vh;         /* 屏幕特别矮时也别把图压没了 */
  overflow: hidden;
}

.home-hero img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;      /* 完整显示（按原始比例适应屏幕，不放大裁切） */
  opacity: 0;
  /* 全屏幻灯片的淡入淡出：400ms cubic-bezier(.2,.6,.3,1) */
  transition: opacity 400ms cubic-bezier(.2, .6, .3, 1);
}

.home-hero img.on { opacity: 1; }

/* 首页封面首图：仅在切回 object-fit: cover 时生效（contain 模式下不裁切、无需设置） */
.home-hero img.hero-cover { object-position: center top; }

/* 底部进度条：5 段细条（**不是**圆点 —— 主动做出区分）
   白色 + 很淡的深色描影，所以在浅色图上也看得见；点一段跳到那张 */
.home-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 22px;
  z-index: 2;
  display: flex;
  justify-content: center;
  gap: 8px;
}

.home-progress button {
  width: 22px;
  height: 3px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: rgba(255, 255, 255, .55);
  box-shadow: 0 0 4px rgba(0, 0, 0, .4);
  cursor: pointer;
  transition: background-color 400ms cubic-bezier(.2, .6, .3, 1), transform 400ms cubic-bezier(.2, .6, .3, 1);
}

.home-progress button.on {
  background: #fff;
  transform: scaleY(1.7);   /* 当前那张的细条略粗一点 */
}

@media (prefers-reduced-motion: reduce) {
  .home-hero img { transition: none; }
}

/* ---------- 8b. 名字下面那一行板块链接（首页 / 板块页 / 关于我 都一样） ---------- */
/* 页头那一行：名字在左、门类靠右 */
.site-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px 40px;
  flex-wrap: wrap;
}

.site-name {
  flex: 1 1 auto;            /* 名字占住左侧，把门类顶到右边 */
  text-align: left;          /* 明确左对齐（防止以后被其他样式覆盖） */
  font-weight: var(--weight-name);
}

/* 窄屏：名字一行、门类下一行，都靠左 */
.section-line {
  margin-top: 0;
  justify-content: flex-end;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px 26px;
  font-size: var(--size-nav);
  letter-spacing: var(--track-nav);
}

.section-line a {
  text-decoration: none;
  color: var(--ink-soft);
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
}

.section-line a:hover,
.section-line a[aria-current="page"] {
  color: var(--ink);
  border-bottom-color: var(--ink);
}

.section-line .sep { color: var(--line); }

/* 窄屏：名字一行、门类下一行，都靠左。
   ⚠️ 这一段必须放在上面那些 .section-line 基础规则【之后】，否则会被它们覆盖（这里踩过一次坑） */
@media (max-width: 820px) {
  .site-head-row { flex-direction: column; align-items: flex-start; gap: 0; }
  .section-line { margin-top: 18px; justify-content: flex-start; }
}

/* 板块页里，站名点一下回首页 */
.site-name a { text-decoration: none; color: inherit; }

/* 绘本封面：往外的柔和阴影。三档强度挑一个换上去即可 ——
   轻：0 10px 22px rgba(87, 76, 63, 0.12)
   中：0 14px 30px rgba(87, 76, 63, 0.16)   ← 现在用的
   重：0 20px 44px rgba(87, 76, 63, 0.24) */
.cover-shadow { filter: drop-shadow(var(--cover-shadow)); }

/* ---------- 6b. 项目页（一个项目一页，纵向可排多张图：绘本 / 系列插画 / 漫画 / 工作坊都通用） ---------- */
.project { max-width: 1000px; }

.project-title {
  margin: 0;
  font-size: var(--size-project);
  font-weight: var(--weight-title);
  line-height: 1.2;
}

.project-sub {
  margin: 10px 0 0;
  color: var(--ink-soft);
}

.project-meta {
  margin: 24px 0 0;
  padding: 20px 0 0;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: 4.5em minmax(0, 1fr);
  gap: 6px 16px;
  font-size: var(--size-meta-lg);
}

.project-meta dt { color: var(--ink-soft); }
.project-meta dd { margin: 0; }

.project-desc { margin: 22px 0 0; }

/* 内页：一张一张往下排，图片之间留小间距 */
.project-images {
  margin-top: 44px;
  display: grid;
  gap: var(--stack-gap);
}

.project-images img {
  display: block;
  width: 100%;
  height: auto;
  border: var(--line-w) solid var(--line);
  border-radius: var(--radius);
}

/* 想给某张图加一行小字说明：填进 <figcaption> 就有了 */
.project-images figcaption {
  margin-top: 6px;
  font-size: 14px;
  color: var(--ink-soft);
}

/* ---------- 3b. 首页那一句自我介绍 / 板块页说明 / 空板块说明 ---------- */
.site-intro {
  margin: 14px 0 0;
  max-width: 32em;
  color: var(--ink-soft);
  font-size: var(--size-body);
}

.section-desc {
  margin: 0 0 34px;
  color: var(--ink-soft);
  font-size: var(--size-meta-lg);
}

.empty-note {
  margin: 0;
  padding: 36px 0;
  border-top: var(--line-w) solid var(--line);
  border-bottom: var(--line-w) solid var(--line);
  color: var(--ink-soft);
  font-size: var(--size-meta-lg);
}

/* ---------- 9. 窄屏适配（手机 / 小窗口） ---------- */
@media (max-width: 860px) {
  
  
}

@media (max-width: 820px) {
  .about-grid { grid-template-columns: 1fr; gap: 26px; }
  .about-photo { max-width: 100%; }   /* 手机上整张图占满一栏 */
}

@media (max-width: 600px) {
  :root { --gap: 22px; }

  body { font-size: 16px; }

  .site-header { padding: 48px 18px 28px; }
  main { padding: 0 18px 64px; }
  .site-footer { padding: 32px 18px 56px; }

  /* 手机上排成 2 列。
     算式：375px 屏幕 - 左右各 18px = 339px 可用；2 列需要 2×148 + 22(间距) = 318px ✅
     （原来是 160px：2×160+22 = 342px > 339px，所以 375px 上只能排 1 列） */
  .grid { grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); }
  .section-line { gap: 10px 18px; font-size: 15px; }
  .section-line a { padding: 5px 0; }   /* 手指更容易点中 */
}

@media (max-width: 420px) {
  .section-line { gap: 8px 14px; font-size: 14px; }

  .project-images { gap: 12px; }
}

/* 系统里开了「减少动态效果」就不做动画 */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* ---------- 动效：滚动到才淡入（时长 0.9s、缓动 ease） ----------
   时长 0.9s、缓动 ease；同一组里依次出现的小间隔见 script.js。
   ⚠️ 只有 <html> 上带 js-motion 类时才生效 —— 那个类由每个页面 <head> 里的一行小脚本加上，
      所以万一脚本没跑起来，内容照样全部可见（不会白屏）。 */
.js-motion .reveal {
  opacity: 0;
  transform: translateY(var(--shift));
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
}

.js-motion .reveal.in {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .js-motion .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
}

/* ---------- 一屏索引：板块页与 comics 页（不上下滚动） ----------
   艺术家要求："简洁一目了然；现在的人没耐心上下滚动"。
   做法：页面撑满一屏，页头与说明占固定高度，剩下全给作品格；
   行列数由 script.js 按"作品数量 + 屏幕比例"算出（让每格尽可能大），
   行数少时整体垂直居中，所以永远是一屏看完。
   ⚠️ 只有"索引页"（板块页 / comics）这样做；项目详情页仍可纵向浏览。 */
.page-fit {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.page-fit main {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.page-fit .site-header-inner { padding-bottom: 12px; }

.page-fit .section-desc {
  flex: 0 0 auto;
  order: 9;                  /* 排在网格之后（万一 HTML 顺序被改回去也仍然在底部） */
  text-align: center;        /* 居中对齐 */
  font-size: 13px;
  line-height: 1.5;
  max-width: 74ch;
  margin: 16px auto 18px;    /* 上留给网格一点间隙，下方不贴屏幕底 */
}

.page-fit .site-footer { display: none; }

.screen-fit {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  gap: 16px 24px;
  align-content: center;      /* 行少时整体居中，不贴顶 */
  /* 下面是"没跑 JS"时的兜底排法 */
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
  grid-auto-rows: minmax(0, 1fr);
}

.screen-fit .card,
.screen-fit .card a {
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.screen-fit .thumb {
  border: 0;                 /* 去掉 1px 暖米色边框（LJ：漫画四周那条细线） */
  flex: 1 1 auto;
  min-height: 0;
  aspect-ratio: auto;         /* 格子大小交给屏幕决定 */
  display: flex;
  align-items: center;
  justify-content: center;
}

.screen-fit .thumb img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;       /* 一屏索引里完整显示，不裁切 */
}

.screen-fit .card-text { flex: 0 0 auto; }

@media (max-width: 700px) {
  .screen-fit { gap: 10px 12px; }
  .screen-fit .card-text { padding-top: 8px; }
  .screen-fit .card-title { font-size: 13px; }
  .screen-fit .card-meta { font-size: 12px; }
}

/* ---------- 404 页 ---------- */
.page-404 main {
  text-align: center;
  padding-top: 14vh;
}

.page-404 .notfound-title {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-size: clamp(56px, 10vw, 120px);
  font-weight: var(--weight-name);
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--line);
}

.page-404 .section-desc { margin-inline: auto; }


/* 项目详情页：说明文字挪到图片之后、居中（与索引页一致） */
.project > .project-desc {
  text-align: center;
  max-width: 74ch;
  margin: 22px auto 0;
}
