/* ==========================================================================
   王博文 · 用 AI 创造产品 — bwbuilds.top
   古典出版物式个人主页。手写 CSS，无框架、无外部请求。
   ========================================================================== */

@font-face {
  font-family: "Noto Serif SC Web";
  src: url("/assets/fonts/noto-serif-sc-500.woff2") format("woff2");
  font-style: normal;
  font-weight: 500;
  font-display: swap;
}

:root {
  --paper: #e9e7df;
  --paper-2: #deded8;
  --paper-3: #f2f0e9;
  --line: #c8c8c2;
  --ink: #353c44;
  --muted: #5a6067;
  --navy: #23263b;
  --gold: #c2b599;
  --gold-ink: #8e7147;
  --gold-ink-strong: #7a5f3a;
  --wine: #7b303b;

  --bg: var(--paper);
  --fg: var(--ink);
  --dim: var(--muted);
  --hair: var(--line);
  --gold-text: var(--gold-ink);

  --serif: "Noto Serif SC Web", "Songti SC", "Noto Serif SC", "Source Han Serif SC", "STSong", "SimSun", serif;
  --sans: "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", -apple-system, "Segoe UI", Arial, sans-serif;
  --mono: "SF Mono", "JetBrains Mono", "IBM Plex Mono", Menlo, Consolas, "Courier New", monospace;

  --max: 1440px;
  --pad: clamp(20px, 4.4vw, 64px);
  --nav-h: 76px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

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

/* 极轻的纸张颗粒，避免纯色发闷 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 500;
  pointer-events: none;
  opacity: 0.4;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='.035'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}

::selection {
  background: var(--wine);
  color: var(--paper);
}

a {
  color: inherit;
}

img {
  max-width: 100%;
}

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

:focus-visible {
  outline: 1px solid var(--wine);
  outline-offset: 4px;
}

.night :focus-visible,
.nav.is-night :focus-visible,
body.is-night .progress:focus-visible {
  outline-color: var(--gold);
}

.wrap {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--pad);
}

.skip {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 900;
  padding: 10px 14px;
  background: var(--navy);
  color: var(--paper);
  font-family: var(--mono);
  font-size: 11px;
  text-decoration: none;
  transform: translateY(-200%);
  transition: transform 0.2s var(--ease);
}

.skip:focus-visible {
  transform: none;
}

/* ---------- 共用文字 ---------- */

.kicker {
  margin: 0;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--dim);
}

.kicker--gold {
  color: var(--gold-text);
}

/* ---------- 导航 ---------- */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 300;
  border-bottom: 1px solid transparent;
  transition: transform 0.45s var(--ease), background 0.45s var(--ease), border-color 0.45s var(--ease),
    color 0.45s var(--ease);
}

.nav.is-scrolled {
  background: rgba(233, 231, 223, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-color: var(--line);
}

.nav.is-night {
  color: var(--paper);
}

.nav.is-night.is-scrolled {
  background: rgba(35, 38, 59, 0.9);
  border-color: rgba(233, 231, 223, 0.16);
}

.nav.is-hidden {
  transform: translateY(-100%);
}

html:not(.js) .nav {
  background: rgba(233, 231, 223, 0.94);
  border-color: var(--line);
}

.nav__inner {
  display: flex;
  align-items: center;
  gap: clamp(16px, 3vw, 44px);
  height: var(--nav-h);
}

.nav__brand {
  display: inline-flex;
  align-items: baseline;
  gap: 12px;
  text-decoration: none;
  white-space: nowrap;
}

.nav__brand-zh {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 500;
  letter-spacing: 0.08em;
}

.nav__brand-sub {
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.22em;
  color: var(--dim);
}

.nav__links {
  display: flex;
  gap: clamp(18px, 2.4vw, 34px);
  margin-left: auto;
  font-size: 12.5px;
}

.nav__links a {
  position: relative;
  color: var(--dim);
  text-decoration: none;
  padding-block: 4px;
  transition: color 0.25s var(--ease);
}

.nav__links a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s var(--ease);
}

.nav__links a:hover {
  color: var(--fg);
}

.nav__links a:hover::after {
  transform: scaleX(1);
}

.nav__actions {
  display: flex;
  align-items: center;
  gap: clamp(10px, 1.4vw, 18px);
}

.nav__games {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 12px;
  border: 1px solid var(--hair);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--fg);
  transition: border-color 0.3s var(--ease), color 0.3s var(--ease);
}

.nav.is-night .nav__links a,
.nav.is-night .nav__brand-sub,
.nav.is-night .nav__cv,
.nav.is-night .lang {
  color: rgba(233, 231, 223, 0.64);
}

.nav.is-night .nav__links a:hover,
.nav.is-night .nav__cv:hover {
  color: var(--paper);
}

.nav.is-night .nav__cv {
  border-color: rgba(233, 231, 223, 0.3);
}

.nav.is-night .nav__games {
  border-color: rgba(233, 231, 223, 0.32);
  color: var(--paper);
}

.nav__games:hover {
  border-color: var(--gold-text);
  color: var(--wine);
}

.nav.is-night .nav__games:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.nav__games-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--wine);
}

.nav.is-night .nav__games-dot {
  background: var(--gold);
}

.nav__cv {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--dim);
  padding-bottom: 2px;
  border-bottom: 1px solid var(--hair);
}

.nav__cv:hover {
  color: var(--wine);
  border-color: var(--wine);
}

.lang {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 44px;
  padding: 12px 8px;
  margin: -8px -2px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-decoration: none;
  color: var(--dim);
}

.lang__on {
  color: var(--fg);
}

.lang.is-night,
.nav.is-night .lang__on {
  color: var(--paper);
}

.nav.is-night .lang__on {
  color: var(--paper);
}

.lang__sep {
  opacity: 0.5;
}

.lang:hover .lang__off {
  color: var(--wine);
}

.nav.is-night .lang:hover .lang__off {
  color: var(--gold);
}

/* ---------- 滚动进度 ---------- */

.progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 400;
  height: 1px;
  pointer-events: none;
}

.progress span {
  display: block;
  height: 100%;
  width: 100%;
  background: var(--wine);
  transform: scaleX(0);
  transform-origin: left;
  transition: background 0.4s var(--ease);
}

body.is-night .progress span {
  background: var(--gold);
}

/* ---------- 首屏 ---------- */

.hero {
  padding: calc(var(--nav-h) + clamp(44px, 8vh, 96px)) 0 clamp(60px, 9vh, 110px);
}

section[id] {
  scroll-margin-top: var(--nav-h);
}

.hero__head {
  animation: page-in 0.8s var(--ease) both;
}

@keyframes page-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
}

.hero__role {
  margin-bottom: clamp(20px, 3vh, 32px);
}

.hero__title {
  max-width: 12em;
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(50px, 8.6vw, 122px);
  line-height: 1.08;
  letter-spacing: 0.015em;
  color: var(--fg);
  text-wrap: balance;
  word-break: keep-all;
  overflow-wrap: break-word;
}

.hero__en {
  margin: clamp(18px, 2.4vh, 28px) 0 0;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--dim);
}

/* ---------- 首屏：两件 AI 产品并置 ---------- */

.hero__plates {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(24px, 4.2vw, 64px);
  align-items: start;
  margin-top: clamp(40px, 7vh, 84px);
  animation: page-in 1s var(--ease) 0.16s both;
}

/* 第二张图版错落一点，像两幅挂在同一面墙上的画 */
@media (min-width: 1101px) {
  .hero__plates .plate:nth-child(2) {
    margin-top: clamp(24px, 4.2vw, 60px);
  }
}

/* ---------- 图版 ---------- */

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

.plate__frame {
  display: block;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  border: 1px solid var(--hair);
  background: var(--paper-2);
}

.plate__frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
  transition: transform 1.4s var(--ease);
}

.plate:hover .plate__frame {
  border-color: var(--gold);
}

.plate:hover .plate__frame img {
  transform: scale(1.012);
}

.plate__cap {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
  padding-top: 16px;
}

.plate__no {
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 500;
  line-height: 1;
  color: var(--gold-text);
  padding-top: 4px;
}

.plate__body {
  display: block;
  min-width: 0;
}

.plate__name {
  display: block;
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 500;
  line-height: 1.35;
  color: var(--fg);
}

.plate__essence {
  display: block;
  margin-top: 4px;
  font-size: 14px;
  line-height: 1.65;
  color: var(--fg);
}

.plate__meta {
  display: block;
  margin-top: 8px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--dim);
}

.plate__open {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--dim);
  padding-top: 6px;
  white-space: nowrap;
  transition: color 0.3s var(--ease);
}

.plate:hover .plate__open {
  color: var(--wine);
}

/* ---------- 作品：图录 · 索引 + 展台 ---------- */

.work {
  padding: clamp(64px, 9vh, 110px) 0 clamp(100px, 14vh, 170px);
  border-top: 1px solid var(--hair);
}

.work__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--hair);
}

.work__hint {
  margin: 0;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.08em;
  color: var(--dim);
}

.work__grid {
  display: grid;
  grid-template-columns: minmax(0, 290px) minmax(0, 1fr);
  gap: clamp(36px, 5vw, 76px);
  margin-top: clamp(34px, 5.4vh, 64px);
  align-items: start;
}

.work__index {
  border-top: 1px solid var(--hair);
}

.work__item {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  width: 100%;
  margin: 0;
  padding: clamp(20px, 3vh, 28px) 2px;
  border: 0;
  border-bottom: 1px solid var(--hair);
  background: transparent;
  color: var(--fg);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.work__no {
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 500;
  line-height: 1;
  color: var(--gold-text);
}

.work__item-body {
  display: block;
  min-width: 0;
}

.work__item-name {
  display: block;
  font-family: var(--serif);
  font-size: 23px;
  font-weight: 500;
  line-height: 1.3;
  color: var(--fg);
  overflow-wrap: break-word;
  transition: color 0.3s var(--ease);
}

.work__item-latin {
  display: block;
  margin-top: 4px;
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--dim);
}

.work__item-arrow {
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1;
  color: var(--wine);
  opacity: 0;
  transform: translate(-3px, 3px);
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
}

.work__item.is-active .work__item-arrow {
  opacity: 1;
  transform: none;
}

.work__item:hover .work__item-name {
  color: var(--wine);
}

.work__item:hover .work__item-arrow {
  opacity: 0.45;
  transform: none;
}

.work__item.is-active:hover .work__item-arrow {
  opacity: 1;
}

.work__stage {
  min-width: 0;
}

.work__screen {
  display: block;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  border: 1px solid var(--hair);
  background: var(--paper-2);
  text-decoration: none;
  transition: border-color 0.3s var(--ease);
}

.work__screen img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
  transition: opacity 0.35s var(--ease), transform 1.4s var(--ease);
}

.work__screen:hover {
  border-color: var(--gold);
}

.work__screen:hover img {
  transform: scale(1.012);
}

.work__cap {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
  padding-top: 16px;
}

.work__cap-no {
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 500;
  line-height: 1;
  color: var(--gold-text);
  padding-top: 4px;
}

.work__cap-body {
  display: block;
  min-width: 0;
}

.work__cap-name {
  display: block;
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 500;
  line-height: 1.35;
  color: var(--fg);
}

.work__cap-essence {
  display: block;
  margin-top: 4px;
  font-size: 14px;
  line-height: 1.65;
  color: var(--fg);
}

.work__cap-meta {
  display: block;
  margin-top: 8px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--dim);
}

.work__cap-open {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--dim);
  padding-top: 6px;
  white-space: nowrap;
  text-decoration: none;
  transition: color 0.3s var(--ease);
}

.work__cap-open:hover {
  color: var(--wine);
}

/* ---------- 入夜 ---------- */

.dusk {
  position: relative;
  height: clamp(260px, 44vh, 480px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  overflow: hidden;
  background: linear-gradient(
    to bottom,
    #e9e7df 0%,
    #e5e1d6 14%,
    #d8cfbf 34%,
    #b3a596 52%,
    #7d7379 70%,
    #474456 85%,
    #23263b 100%
  );
}

.dusk__sun {
  position: absolute;
  top: 34%;
  right: 16%;
  width: clamp(56px, 6vw, 92px);
  height: clamp(56px, 6vw, 92px);
  border: 1px solid rgba(194, 181, 153, 0.6);
  border-radius: 50%;
  transform: translateY(-50%);
}

.dusk__horizon {
  position: absolute;
  left: 0;
  right: 0;
  top: 62%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(194, 181, 153, 0.75) 35%, rgba(194, 181, 153, 0.75) 65%, transparent);
}

.dusk__label {
  position: relative;
  z-index: 1;
  margin: 0 0 clamp(22px, 4vh, 38px);
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: rgba(233, 231, 223, 0.62);
}

/* ---------- 夜间区 ---------- */

.night {
  --fg: #e9e7df;
  --dim: rgba(233, 231, 223, 0.62);
  --hair: rgba(233, 231, 223, 0.16);
  --gold-text: var(--gold);
  background: var(--navy);
  color: var(--fg);
}

/* ---------- 其他作品 ---------- */

.appendix {
  padding: clamp(72px, 11vh, 140px) 0 clamp(56px, 8vh, 96px);
}

.appendix__lead {
  margin: 18px 0 0;
  font-family: var(--serif);
  font-size: clamp(24px, 2.8vw, 36px);
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0.01em;
}

.appendix__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(20px, 3.2vw, 42px);
  margin-top: clamp(32px, 5vh, 60px);
}

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

.game__frame {
  display: block;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  border: 1px solid var(--hair);
  background: #1a1d2e;
}

.game__frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
  opacity: 0.9;
  transition: transform 1.2s var(--ease), opacity 0.4s var(--ease);
}

.game:hover .game__frame {
  border-color: var(--gold);
}

.game:hover .game__frame img {
  transform: scale(1.02);
  opacity: 1;
}

.game__cap {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: start;
  margin-top: 14px;
}

.game__name {
  display: block;
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 500;
  line-height: 1.45;
}

.game__kind {
  display: block;
  margin-top: 3px;
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--dim);
}

.game__play {
  flex: none;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  padding-top: 5px;
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease);
}

.game:hover .game__play {
  border-color: var(--gold);
}

/* ---------- 关于 ---------- */

.about {
  padding: clamp(64px, 9vh, 120px) 0 clamp(80px, 11vh, 140px);
  border-top: 1px solid var(--hair);
}

.about__head {
  display: block;
}

.about__head .about__title {
  margin-top: 14px;
}

.about__title {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(34px, 4.6vw, 58px);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: 0.02em;
}

.about__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  gap: clamp(30px, 6vw, 96px);
  margin-top: clamp(32px, 5vh, 56px);
}

.about__bio p {
  margin: 0 0 18px;
  max-width: 34em;
  font-size: clamp(15px, 1.3vw, 17px);
  line-height: 1.95;
  color: rgba(233, 231, 223, 0.86);
}

.about__bio p:last-of-type {
  color: var(--dim);
}

.about__colophon {
  margin-top: 28px !important;
  font-family: var(--mono);
  font-size: 9px !important;
  letter-spacing: 0.1em;
  line-height: 1.8 !important;
  color: var(--dim) !important;
}

.about__facts {
  margin: 0;
  border-top: 1px solid var(--hair);
}

.about__facts div {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--hair);
}

.about__facts dt {
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--dim);
  padding-top: 3px;
}

.about__facts dd {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.7;
}

/* 关于页底部的简明履历：教育 / 联系方式，克制地补全简历信息 */
.about__record {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: clamp(26px, 5vw, 80px);
  margin-top: clamp(34px, 5.6vh, 64px);
  padding-top: 22px;
  border-top: 1px solid var(--hair);
}

.about__record-label {
  margin: 0 0 10px;
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold-text);
}

.about__record-item {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 14px;
  font-size: 13px;
  line-height: 1.8;
  color: rgba(233, 231, 223, 0.82);
}

.about__record-item + .about__record-item {
  margin-top: 2px;
}

.about__record-meta {
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.1em;
  color: var(--dim);
}

.about__record a {
  color: var(--fg);
  text-decoration: underline;
  text-decoration-color: var(--hair);
  text-underline-offset: 3px;
  transition: color 0.3s var(--ease);
}

.about__record a {
  padding-block: 2px;
}

.about__record a:hover {
  color: var(--gold);
}

/* ---------- 页脚 ---------- */

.footer {
  border-top: 1px solid var(--hair);
  padding: 26px 0;
}

.footer__inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px 28px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--dim);
}

.footer__links {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px 18px;
}

.footer__links a[href^="mailto:"] {
  text-transform: none;
  letter-spacing: 0.04em;
}

.footer__links a {
  padding-block: 4px;
}

.footer__links a:hover {
  color: var(--gold);
}

.footer__availability {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--gold);
  letter-spacing: 0.12em;
}

.footer__dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--gold);
}

/* ---------- 读图室 ---------- */

.room {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
}

.room::backdrop {
  background: rgba(20, 22, 34, 0.8);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.room[open] {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(12px, 4vh, 44px) 0;
  animation: room-fade 0.4s var(--ease) both;
}

@keyframes room-fade {
  from {
    opacity: 0;
  }
}

.room__card {
  width: min(1420px, 94vw);
  height: min(88vh, 920px);
  margin: 0;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  border: 1px solid rgba(35, 38, 59, 0.22);
  animation: room-rise 0.5s var(--ease) both;
}

@keyframes room-rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

.room__top {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 22px;
  border-bottom: 1px solid var(--line);
}

.room__kicker {
  margin: 0;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

.room__kicker-no {
  margin-right: 12px;
  font-family: var(--serif);
  font-size: 14px;
  color: var(--gold-ink-strong);
  letter-spacing: 0.04em;
}

.room__close {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 2px;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink);
  transition: color 0.25s var(--ease);
}

.room__close:hover {
  color: var(--wine);
}

.room__x {
  font-size: 13px;
}

.room__body {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 356px;
}

.room__stage {
  position: relative;
  min-height: 0;
  overflow: hidden;
  background: var(--paper-2);
  border-right: 1px solid var(--line);
}

.room__viewer {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--gold) transparent;
}

.room__viewer:focus-visible {
  outline-offset: -4px;
}

.room__scroll {
  padding: 0;
}

.room__img {
  width: 100%;
  height: auto;
  display: block;
}

.room__rail {
  position: absolute;
  z-index: 2;
  top: 18px;
  bottom: 18px;
  right: 12px;
  width: 1px;
  background: rgba(53, 60, 68, 0.14);
  pointer-events: none;
}

.room__rail span {
  display: block;
  width: 100%;
  height: 0;
  background: var(--gold);
  transition: height 0.15s linear;
}

.room__hint {
  position: absolute;
  z-index: 2;
  left: 18px;
  bottom: 16px;
  margin: 0;
  padding: 6px 10px;
  background: rgba(233, 231, 223, 0.9);
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  transition: opacity 0.4s var(--ease);
  pointer-events: none;
}

.room__hint.is-hidden {
  opacity: 0;
}

.room__side {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  background: var(--paper);
}

.room__side-body {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.room__side-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 24px 26px 18px;
  scrollbar-width: thin;
  scrollbar-color: var(--gold) transparent;
}

.room__side-hint {
  flex: 1 1 auto;
  margin: 0;
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  transition: opacity 0.4s var(--ease);
}

.room__side-hint.is-hidden {
  opacity: 0;
}

.room__label {
  margin: 0;
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold-ink-strong);
}

.room__title {
  margin: 10px 0 4px;
  font-family: var(--serif);
  font-size: clamp(30px, 3vw, 42px);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: 0.02em;
  overflow-wrap: break-word;
}

html[lang="en"] .room__title {
  font-size: clamp(28px, 2.7vw, 38px);
  letter-spacing: 0.01em;
}

.room__latin {
  margin: 0;
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

.room__essence {
  margin: 16px 0 20px;
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
}

.room__meta {
  margin: 0 0 20px;
  border-top: 1px solid var(--line);
}

.room__meta div {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.room__meta dt {
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  padding-top: 2px;
}

.room__meta dd {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.6;
}

.room__tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 22px;
}

.room__tab {
  padding: 6px 10px;
  border: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  transition: border-color 0.25s var(--ease), color 0.25s var(--ease);
}

.room__tab:hover {
  border-color: var(--gold-ink);
  color: var(--ink);
}

.room__tab.is-active {
  border-color: var(--wine);
  color: var(--wine);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 13px 18px;
  border: 1px solid var(--line);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.03em;
  line-height: 1;
  text-decoration: none;
  color: var(--ink);
  transition: background 0.3s var(--ease), color 0.3s var(--ease), border-color 0.3s var(--ease);
}

.btn--wine {
  background: var(--wine);
  border-color: var(--wine);
  color: var(--paper);
}

.btn--wine:hover {
  background: transparent;
  color: var(--wine);
}

.room__cta {
  align-self: flex-start;
}

.room__newtab {
  margin: 10px 0 0;
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.room__pager {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0;
  padding: 12px 26px 16px;
  border-top: 1px solid var(--line);
  background: var(--paper);
}

.room__pager-btn {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  padding: 4px 0;
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
  transition: color 0.25s var(--ease), border-color 0.25s var(--ease);
}

.room__pager-btn span {
  font-family: var(--serif);
  font-size: 13px;
  color: var(--gold-ink-strong);
  letter-spacing: 0.04em;
}

.room__pager-btn:hover {
  color: var(--wine);
  border-color: var(--wine);
}

/* ---------- 404 ---------- */

.notfound {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 var(--pad);
  max-width: 720px;
  margin-inline: auto;
}

.notfound__title {
  margin: 16px 0 0;
  font-family: var(--serif);
  font-size: clamp(34px, 5vw, 56px);
  font-weight: 500;
  line-height: 1.2;
}

.notfound__body {
  margin: 12px 0 32px;
  color: var(--muted);
  font-size: 14px;
}

.notfound__title--en {
  margin-top: 40px;
  font-size: clamp(24px, 3vw, 34px);
}

.notfound__links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 28px 0 0;
}

/* ---------- 响应式 ---------- */

@media (max-width: 1100px) {
  .work__grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .work__index {
    display: flex;
    border-top: 1px solid var(--hair);
  }

  .work__item {
    flex: 1 1 0;
    grid-template-columns: 38px minmax(0, 1fr) auto;
    padding: 16px 18px;
    border-bottom: 1px solid var(--hair);
    border-right: 1px solid var(--hair);
  }

  .work__item:last-child {
    border-right: 0;
  }

  .room__body {
    grid-template-columns: minmax(0, 1fr) 320px;
  }

  .about__grid {
    grid-template-columns: 1fr;
    gap: 34px;
  }

  .about__record {
    grid-template-columns: 1fr;
    gap: 22px;
  }
}

@media (max-width: 820px) {
  .hero__plates {
    grid-template-columns: 1fr;
    gap: 44px;
  }

  .hero__plates .plate:nth-child(2) {
    margin-top: 0;
  }
}

@media (max-width: 760px) {
  :root {
    --nav-h: 62px;
  }

  .nav__brand-sub {
    display: none;
  }

  .nav__links {
    display: none;
  }

  .nav__actions {
    margin-left: auto;
  }

  .nav__cv {
    display: none;
  }

  .nav__games {
    padding: 7px 10px;
    font-size: 9px;
  }

  .hero {
    padding-top: calc(var(--nav-h) + 40px);
  }

  .hero__title {
    font-size: clamp(38px, 11.2vw, 56px);
    letter-spacing: 0.01em;
  }

  .work {
    padding-top: 52px;
  }

  .work__hint {
    display: none;
  }

  .work__grid {
    margin-top: 26px;
  }

  .work__item {
    grid-template-columns: 28px minmax(0, 1fr) auto;
    gap: 10px;
    padding: 14px 12px;
  }

  .work__no {
    font-size: 22px;
  }

  .work__item-name {
    font-size: 18px;
  }

  .work__item-latin {
    display: none;
  }

  .work__item-arrow {
    font-size: 10px;
  }

  .work__cap {
    grid-template-columns: 30px minmax(0, 1fr);
  }

  .work__cap-no {
    font-size: 22px;
  }

  .work__cap-name {
    font-size: 19px;
  }

  .work__cap-open {
    display: none;
  }

  .work__cap-meta {
    font-size: 8px;
    letter-spacing: 0.06em;
  }

  .plate__cap {
    grid-template-columns: 30px minmax(0, 1fr);
  }

  .plate__no {
    font-size: 22px;
  }

  .plate__name {
    font-size: 19px;
  }

  .plate__open {
    display: none;
  }

  .plate__meta {
    font-size: 8px;
    letter-spacing: 0.06em;
  }

  .dusk {
    height: 220px;
  }

  .appendix__grid {
    grid-template-columns: 1fr;
  }

  .about__head {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .about__facts div {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .footer__inner {
    flex-direction: column;
    gap: 8px;
  }

  /* 读图室：移动端全屏 */
  .room[open] {
    padding: 0;
  }

  .room__card {
    width: 100%;
    height: 100dvh;
    margin: 0;
    border: 0;
  }

  .room__top {
    padding: 12px 16px;
  }

  .room__body {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 48%) minmax(0, 52%);
  }

  .room__stage {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .room__side {
    padding: 0;
  }

  .room__side-scroll {
    padding: 16px 18px 14px;
  }

  .room__side-hint {
    font-size: 8px;
    letter-spacing: 0.1em;
  }

  .room__pager {
    margin-top: 0;
    padding: 8px 18px 10px;
  }

  .room__title {
    font-size: 26px;
  }

  .room__essence {
    margin: 12px 0 14px;
    font-size: 15px;
  }

  .room__meta {
    margin-bottom: 16px;
  }

  .room__tabs {
    margin-bottom: 16px;
  }
}

@media (max-width: 520px) {
  /* 英文作品名较长，手机上把图录索引改成整行，避免两栏互相挤压 */
  .work__index {
    display: block;
  }

  .work__item {
    border-right: 0;
  }

  .work__item-latin {
    display: block;
  }
}

@media (max-width: 760px) and (max-height: 720px) {
  .room__meta {
    display: none;
  }

  .room__title {
    margin-top: 6px;
  }

  .room__essence {
    margin: 10px 0 12px;
  }

  .room__newtab {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
