:root {
  --paper: #F3EEE4;
  --paper-2: #E9E2D3;
  --paper-3: #FBF8F1;
  --ink: #2E2A24;
  --ink-2: #6B6255;
  --ink-3: #9A9081;
  --cinnabar: #B4472F;
  --moss: #5F7A5A;
  --indigo: #3D5A6C;
  --amber: #A8722A;
  --line: #DDD4C2;
  --line-2: #C9BEAA;
  --serif: "Source Han Serif SC", "Noto Serif SC", "Songti SC", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  --mono: ui-monospace, "JetBrains Mono", "Sarasa Mono SC", "Cascadia Mono", Consolas, monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 1000px; margin: 0 auto; padding: 0 24px; }

a { color: inherit; }
img { max-width: 100%; }

/* ---------- header ---------- */
header.site {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(243, 238, 228, .93);
  backdrop-filter: saturate(1.2) blur(6px);
  border-bottom: 1px solid var(--line);
}
.nav {
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 13px 0;
  font-family: var(--mono);
  font-size: 12.5px;
}
.nav .brand { font-weight: 500; color: var(--ink); letter-spacing: .02em; }
.nav .brand b { color: var(--cinnabar); font-weight: 500; }
.nav .sp { flex: 1; }
.nav a { color: var(--ink-2); text-decoration: none; }
.nav a:hover { color: var(--cinnabar); }

/* ---------- hero：左字右画 ---------- */
section.hero { position: relative; overflow: hidden; padding: 76px 0 56px; }
/* 两个同心的朱砂圆环，从右上角透出来——就是运行图里「换乘站」那个记号放大。
   纯装饰、不承载信息，所以描边压到很淡，不许它抢标题。 */
section.hero::before,
section.hero::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  border: 1.5px solid rgba(180, 71, 47, .13);
  pointer-events: none;
}
section.hero::before { width: 300px; height: 300px; right: 0;    top: -90px; border-color: rgba(180, 71, 47, .20); }
section.hero::after  { width: 180px; height: 180px; right: 60px; top: -30px; border-color: rgba(180, 71, 47, .32); }
.hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1.02fr;
  gap: 46px;
  align-items: center;
}
/* 图片的固有宽度是 1000px，grid 子项默认 min-width:auto 会被它撑破整页 */
.hero-grid > * { min-width: 0; }
.hero-title {
  font-family: var(--serif);
  font-size: 68px;
  line-height: 1.14;
  font-weight: 500;
  margin: 0 0 18px;
  letter-spacing: .01em;
}
.hero-sub {
  font-size: 19px;
  color: var(--ink-2);
  line-height: 1.85;
  margin: 0 0 30px;
}
.hero-sub b { color: var(--ink); font-weight: 500; }
.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 26px;
  padding-top: 20px;
  border-top: 1px dashed var(--line-2);
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--ink-2);
}
.hero-meta b { display: block; font-size: 22px; color: var(--ink); font-weight: 500; }
.hero-cta { margin: 24px 0 0; }
.hero-cta a {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--cinnabar);
  text-decoration: none;
  border-bottom: 1px solid rgba(180, 71, 47, .35);
  padding-bottom: 2px;
}
.hero-cta a:hover { border-bottom-color: var(--cinnabar); }

.hero-shot {
  display: block;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--line-2);
  background: var(--paper-3);
  text-decoration: none;
  transition: transform .2s ease, box-shadow .2s ease;
}
.hero-shot:hover { transform: translateY(-3px); box-shadow: 0 14px 34px rgba(46, 42, 36, .13); }
.hero-shot img { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.hero-cap {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0 8px;
  padding: 13px 16px;
  font-size: 13.5px;
  color: var(--ink-2);
  background: var(--paper-3);
  border-top: 1px solid var(--line);
}
.hero-cap b { font-family: var(--serif); font-size: 16px; font-weight: 500; color: var(--ink); }
.hero-cap i { font-style: normal; margin-left: auto; color: var(--cinnabar); font-family: var(--mono); font-size: 12px; white-space: nowrap; }

/* ---------- section ---------- */
section.block { padding: 48px 0 8px; }
.sec-head {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ink-3);
  letter-spacing: .06em;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.sec-head::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.sec-note { font-size: 15px; color: var(--ink-2); max-width: 700px; margin: -8px 0 22px; }

/* ---------- 精选橱窗 ----------
   12 列网格：第 1 件满宽横排，第 2–3 件各半，第 4–6 件各三分之一。
   等大网格是「货架」，错落的才有节奏——这是冲着「没看的欲望」那句反馈改的。 */
.feat { display: grid; grid-template-columns: repeat(12, 1fr); gap: 18px; }
.feat > * { min-width: 0; }
.feat-card:nth-child(1) {
  grid-column: span 12;
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  min-height: 330px;
}
.feat-card:nth-child(2), .feat-card:nth-child(3) { grid-column: span 6; }
.feat-card:nth-child(4), .feat-card:nth-child(5), .feat-card:nth-child(6) { grid-column: span 4; }

/* 第一件横过来：图在左、字在右，字号也放大一档 */
.feat-card:nth-child(1) .fc-shot { height: 100%; }
.feat-card:nth-child(1) .fc-shot::before { padding-top: 0; }
.feat-card:nth-child(1) .fc-body {
  border-top: 0;
  border-left: 3px solid var(--acc, var(--line-2));
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 26px 28px;
}
.feat-card:nth-child(1) .fc-name { font-size: 30px; }
.feat-card:nth-child(1) .fc-desc { font-size: 15.5px; }

/* 看完六件，给一个去作品集页的口子 */
.more { display: flex; justify-content: center; margin-top: 28px; }
.feat-card {
  display: block;
  background: var(--paper-3);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.feat-card:hover {
  transform: translateY(-3px);
  border-color: var(--line-2);
  box-shadow: 0 10px 26px rgba(46, 42, 36, .09);
}
.fc-shot { display: block; position: relative; background: var(--paper-2); }
.fc-shot::before { content: ""; display: block; padding-top: 62.5%; }
.fc-shot img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.fc-shot:empty { display: none; }
.fc-body { display: block; padding: 16px 18px 18px; border-top: 3px solid var(--acc, var(--line-2)); }
.fc-cat { display: block; font-family: var(--mono); font-size: 11.5px; color: var(--ink-3); margin-bottom: 5px; }
.fc-name { display: block; font-family: var(--serif); font-size: 22px; font-weight: 500; line-height: 1.35; margin-bottom: 7px; }
.fc-desc { display: block; font-size: 14.5px; color: var(--ink-2); line-height: 1.72; }
.fc-go { display: block; margin-top: 13px; font-family: var(--mono); font-size: 12px; color: var(--acc, var(--cinnabar)); }

/* ---------- 四条线 ---------- */
.cat-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(196px, 1fr)); gap: 12px; margin-bottom: 20px; }
.cat {
  background: var(--paper-3);
  border: 1px solid var(--line);
  border-left: 3px solid var(--acc, var(--line-2));
  border-radius: 8px;
  padding: 13px 15px;
}
.cat-top { display: flex; align-items: baseline; gap: 8px; }
.cat-name { font-size: 14.5px; font-weight: 500; }
.cat-n { font-family: var(--mono); font-size: 12px; color: var(--ink-3); }
.cat-desc { font-size: 13px; color: var(--ink-2); margin-top: 3px; }

/* ---------- filters ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; font-family: var(--mono); font-size: 12.5px; }
.filters button {
  font-family: var(--mono);
  font-size: 12.5px;
  padding: 5px 12px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: transparent;
  color: var(--ink-2);
  cursor: pointer;
  transition: all .15s;
}
.filters button:hover { border-color: var(--ink-3); color: var(--ink); }
.filters button.on { background: var(--ink); border-color: var(--ink); color: var(--paper); }

/* ---------- 档案卡片 ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(272px, 1fr)); gap: 16px; }
.grid > * { min-width: 0; }
.card {
  background: var(--paper-3);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.card:hover {
  transform: translateY(-2px);
  border-color: var(--line-2);
  box-shadow: 0 6px 18px rgba(46, 42, 36, .07);
}
.card-shot { display: block; position: relative; background: var(--paper-2); border-bottom: 1px solid var(--line); }
.card-shot::before { content: ""; display: block; padding-top: 56%; }
.card-shot img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.card-shot:empty { display: none; }
.card-txt { display: block; flex: 1; padding: 14px 16px 16px; border-left: 3px solid var(--acc, var(--line-2)); }
.card .meta {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--ink-3);
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 6px;
}
.card .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--acc, var(--ink-3)); }
.card .meta-date { margin-left: auto; }
.card h3 { font-family: var(--serif); font-size: 17.5px; font-weight: 500; margin: 0 0 7px; line-height: 1.4; }
.card p { margin: 0; font-size: 14px; color: var(--ink-2); line-height: 1.7; }

/* ---------- 做东西的规矩 ---------- */
.rules { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 26px 30px; }
.quote {
  border-left: 3px solid var(--cinnabar);
  padding: 4px 0 4px 16px;
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.8;
  color: var(--ink);
  margin: 0 0 14px;
}
.quote-src { font-family: var(--mono); font-size: 11.5px; color: var(--ink-3); }
.rule .quote { font-size: 17px; margin-bottom: 10px; }
.rule .why {
  font-size: 13.5px;
  color: var(--ink-2);
  line-height: 1.8;
  margin: 0 0 10px;
  padding-left: 16px;
  border-left: 1px solid var(--line-2);
}

/* ---------- 手记 ---------- */
.notes-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 14px; }
.panel { background: var(--paper-3); border: 1px solid var(--line); border-radius: 10px; padding: 20px 22px; }
.panel h3 { font-family: var(--serif); font-size: 18px; font-weight: 500; margin: 0 0 8px; }
.panel p { font-size: 14px; color: var(--ink-2); margin: 0 0 14px; }
.btn {
  display: inline-block;
  font-family: var(--mono);
  font-size: 12.5px;
  padding: 7px 15px;
  border: 1px solid var(--ink);
  border-radius: 6px;
  text-decoration: none;
  color: var(--ink);
}
.btn:hover { background: var(--ink); color: var(--paper); }
.btn.ghost { border-color: var(--line-2); color: var(--ink-2); }
.panel-wx { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; justify-content: space-between; }
.panel-wx .panel-txt { flex: 1 1 200px; min-width: 0; }
.wx-qr { margin: 0; flex: none; text-align: center; }
.wx-qr img { display: block; width: 92px; height: 92px; border: 1px solid var(--line-2); border-radius: 6px; background: #fff; }
.wx-qr figcaption { font-family: var(--mono); font-size: 11.5px; color: var(--ink-3); margin-top: 6px; }

/* ---------- 运行图 map ---------- */
#map-wrap {
  position: relative;
  background: var(--paper-3);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 6px;
}
#map svg { display: block; }
.stop { opacity: 0; transition: opacity .5s ease; transition-delay: calc(var(--i, 0) * 20ms); }
.stop.drawn { opacity: 1; }
.stop:hover text { fill: var(--cinnabar); }
.stop:hover circle.core { stroke-width: 3.5; }
.rail {
  stroke-dasharray: var(--len, 2400);
  stroke-dashoffset: var(--len, 2400);
  transition: stroke-dashoffset 1.8s cubic-bezier(.25, .8, .3, 1);
}
.rail.drawn { stroke-dashoffset: 0; }

#map-tip {
  position: absolute;
  z-index: 20;
  width: 288px;
  max-width: 88vw;
  background: var(--ink);
  color: var(--paper);
  border-radius: 8px;
  padding: 11px 13px;
  pointer-events: none;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity .14s ease, transform .14s ease;
  box-shadow: 0 8px 24px rgba(46, 42, 36, .18);
}
#map-tip.on { opacity: 1; transform: translateY(0); }
#map-tip b { display: block; font-family: var(--serif); font-size: 15px; font-weight: 500; margin-bottom: 2px; }
#map-tip span { display: block; font-family: var(--mono); font-size: 11px; color: #B7AFA0; margin-bottom: 6px; }
#map-tip i { display: block; font-style: normal; font-size: 12.5px; line-height: 1.65; color: #E4DED3; }

.map-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed var(--line-2);
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--ink-2);
}
.map-foot b { font-size: 18px; color: var(--ink); font-weight: 500; }
.map-foot .mono-note { margin-left: auto; color: var(--ink-3); }

/* ---------- terminal（关于这里） ---------- */
.term { border: 1px solid var(--line-2); border-radius: 10px; background: var(--paper-3); overflow: hidden; max-width: 640px; }
.term-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--paper-2);
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-2);
}
.term-dot { width: 9px; height: 9px; border-radius: 2px; }
.term-body { padding: 18px 18px 20px; font-family: var(--mono); font-size: 13.5px; line-height: 1.9; }
.prompt { color: var(--cinnabar); }
.hit { color: var(--moss); }

/* ---------- 桌宠 ---------- */
#pet { position: fixed; left: 0; top: 0; z-index: 60; pointer-events: none; will-change: transform; }
#pet .pet-body {
  height: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  pointer-events: auto;
  cursor: pointer;
  transform-origin: 50% 100%;
  transition: filter .2s;
}
#pet .pet-body:hover { filter: brightness(1.04); }
#pet .pet-sprite { display: block; height: 100%; width: auto; }

#pet .pet-hide {
  position: absolute;
  right: -7px; top: -7px;
  width: 18px; height: 18px;
  padding: 0;
  line-height: 15px;
  font-size: 12px;
  font-family: var(--mono);
  color: var(--ink-3);
  background: var(--paper-3);
  border: 1px solid var(--line-2);
  border-radius: 50%;
  cursor: pointer;
  opacity: 0;
  pointer-events: auto;
  transition: opacity .18s;
}
#pet:hover .pet-hide, #pet .pet-hide:focus { opacity: 1; }
#pet .pet-hide:hover { color: var(--cinnabar); border-color: var(--cinnabar); }

#pet .pet-mute {
  position: absolute;
  right: 21px; top: -9px;
  padding: 2px 7px;
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.3;
  color: var(--ink-3);
  background: var(--paper-3);
  border: 1px solid var(--line-2);
  border-radius: 9px;
  cursor: pointer;
  white-space: nowrap;
  opacity: 0;
  pointer-events: auto;
  transition: opacity .18s;
}
#pet:hover .pet-mute, #pet .pet-mute:focus { opacity: 1; }
#pet .pet-mute:hover { color: var(--cinnabar); border-color: var(--cinnabar); }

.pet-bubble {
  position: absolute;
  bottom: calc(100% + 8px); left: 50%;
  transform: translateX(-50%) translateY(5px);
  max-width: 220px;
  padding: 6px 11px;
  font-family: var(--serif);
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 9px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
}
.pet-bubble.on { opacity: 1; transform: translateX(-50%) translateY(0); }
.pet-bubble.right { left: auto; right: 0; transform: translateY(5px); }
.pet-bubble.right.on { transform: translateY(0); }
.pet-bubble.left { left: 0; right: auto; transform: translateX(0) translateY(5px); }
.pet-bubble.left.on { transform: translateX(0) translateY(0); }
.pet-bubble.below,
.pet-bubble.below.right,
.pet-bubble.below.left {
  top: calc(100% + 8px); bottom: auto; left: 50%; right: auto;
  transform: translateX(-50%) translateY(-5px);
}
.pet-bubble.below.on { transform: translateX(-50%) translateY(0); }

.pet-back {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--ink-3);
  cursor: pointer;
  text-decoration: underline dotted;
  text-underline-offset: 3px;
}
.pet-back:hover { color: var(--cinnabar); }

/* ---------- 作品集页 works.html ----------
   一行一件。有图的给图，没图的给一个字当「书脊」，两种都是同尺寸方块，
   所以整列看下来图与字是齐的——没有哪一件矮一截。 */
.wk-title { font-family: var(--serif); font-size: 46px; font-weight: 500; line-height: 1.2; margin: 0 0 14px; }
.wk-lead { font-size: 16.5px; color: var(--ink-2); max-width: 660px; line-height: 1.85; margin: 0 0 32px; }
.wk { border-top: 1px solid var(--line); }
.wk-row {
  display: grid;
  grid-template-columns: 120px 1fr 18px;
  gap: 22px;
  align-items: center;
  padding: 16px 10px;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  transition: background .15s ease;
}
.wk-row:hover { background: var(--paper-3); }
.wk-thumb {
  position: relative;
  display: block;
  aspect-ratio: 8 / 5;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
}
.wk-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.wk-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--serif);
  font-size: 30px;
  line-height: 1;
  color: var(--paper-3);
  background: var(--acc, var(--ink-3));
  border-color: transparent;
}
.wk-txt { display: block; min-width: 0; }
.wk-top { display: flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 11.5px; color: var(--ink-3); }
.wk-dot { flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--acc, var(--ink-3)); }
.wk-date { margin-left: auto; }
.wk-name { display: block; font-family: var(--serif); font-size: 20px; font-weight: 500; line-height: 1.4; margin: 4px 0 5px; }
.wk-desc {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 14px;
  color: var(--ink-2);
  line-height: 1.7;
}
.wk-go { font-family: var(--mono); font-size: 13px; color: var(--ink-3); text-align: right; }
.wk-row:hover .wk-name, .wk-row:hover .wk-go { color: var(--cinnabar); }
.wk-row:hover .wk-thumb { border-color: var(--line-2); }
.wk-foot { margin: 26px 0 0; font-family: var(--mono); font-size: 12.5px; color: var(--ink-3); }

/* ---------- footer ---------- */
footer { margin-top: 64px; padding: 30px 0 44px; border-top: 1px solid var(--line); }
.foot { display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between; font-family: var(--mono); font-size: 12px; color: var(--ink-3); }
.foot a { color: var(--ink-2); text-decoration: none; }
.foot a:hover { color: var(--cinnabar); }
.foot-end { width: 100%; margin-top: 18px; font-family: var(--serif); font-size: 14px; color: var(--ink-2); }

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; gap: 34px; }
  .hero-title { font-size: 46px; }
  section.hero::before { width: 220px; height: 220px; right: 0;    top: -70px; }
  section.hero::after  { width: 130px; height: 130px; right: 45px; top: -20px; }

  /* 第一件从横排改回图上字下 */
  .feat-card:nth-child(1) { grid-template-columns: 1fr; min-height: 0; }
  .feat-card:nth-child(1) .fc-shot { height: auto; }
  .feat-card:nth-child(1) .fc-shot::before { padding-top: 56%; }
  .feat-card:nth-child(1) .fc-body {
    border-left: 0;
    border-top: 3px solid var(--acc, var(--line-2));
    padding: 18px 20px 20px;
  }
  .feat-card:nth-child(1) .fc-name { font-size: 24px; }
  .feat-card:nth-child(1) .fc-desc { font-size: 14.5px; }
  /* 剩下的两列排，不再三列挤 */
  .feat-card:nth-child(2), .feat-card:nth-child(3),
  .feat-card:nth-child(4), .feat-card:nth-child(5), .feat-card:nth-child(6) { grid-column: span 6; }
}
@media (max-width: 640px) {
  .wrap { padding: 0 18px; }
  section.hero { padding: 44px 0 34px; }
  .hero-title { font-size: 38px; }
  .hero-sub { font-size: 16.5px; }
  .hero-meta { gap: 18px; }
  .hero-meta b { font-size: 20px; }
  .feat-card:nth-child(n) { grid-column: span 12; }
  .fc-name { font-size: 20px; }
  .nav { gap: 14px; font-size: 12px; }
  /* 作品集页：缩略图收窄，箭头让位给文字 */
  .wk-title { font-size: 34px; }
  .wk-lead { font-size: 15px; }
  .wk-row { grid-template-columns: 88px 1fr; gap: 14px; padding: 13px 4px; }
  .wk-go { display: none; }
  .wk-name { font-size: 17px; }
  .wk-desc { font-size: 13px; -webkit-line-clamp: 3; }
  .wk-mark { font-size: 24px; }
}
