:root {
  color-scheme: dark;
  --page-night: #0a1421;
  --page-deep: #080f19;
  --ink: #e6dbc7;
  --copy: #aeb7c2;
  --quiet: #8f9bab;
  --gold: #c1a57c;
  --rule: rgba(199, 213, 230, 0.14);
  --reading-width: min(1560px, calc(100% - 17.2vw));
  --display-font: Baskerville, "Times New Roman", serif;
  --chinese-display: "Songti SC", STSong, "Noto Serif CJK SC", serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scrollbar-gutter: stable; }
body {
  margin: 0;
  background: var(--page-night);
  color: var(--ink);
  font-family: "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", Arial, sans-serif;
  line-height: 1.65;
}
body.has-dialog { overflow: hidden; }
h1, h2, h3, p { margin: 0; }
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; }
button, a { -webkit-tap-highlight-color: transparent; }
img { display: block; }
[hidden] { display: none !important; }
main { position: relative; }

.siteHeader {
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.siteHeader__brand { display: inline-flex; text-decoration: none; white-space: nowrap; }
.siteHeader__nav { display: flex; align-items: center; }
.siteHeader__nav a {
  display: inline-flex;
  align-items: center;
  border-bottom: 1px solid transparent;
  text-decoration: none;
  transition: color 160ms ease, border-color 160ms ease;
}
.siteHeader__nav a:hover,
.siteHeader__nav a[aria-current] { border-bottom-color: var(--gold); color: #f3e7ce; }
.hero { position: relative; isolation: isolate; z-index: 1; overflow: hidden; }
.hero__inner { position: relative; z-index: 2; }
.hero__content { position: relative; }
.hero__summary { white-space: pre-line; }

.reading-surface { background: var(--page-night); }
.page-section { width: var(--reading-width); margin: 0 auto; padding: clamp(84px, 8.4vw, 136px) 0; }
.section-heading { display: block; }
.section-kicker {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 19px;
  color: var(--gold);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.19em;
  line-height: 1.5;
}
.page-section h2 { font-family: var(--chinese-display); font-size: clamp(34px, 3.25vw, 52px); font-weight: 400; line-height: 1.35; letter-spacing: 0.06em; }
.page-section.works-section { padding-block: clamp(36px, 4.6vw, 64px) clamp(54px, 6vw, 90px); }
.works-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.works-heading__note { margin-inline-start: 0.35em; color: var(--quiet); font-size: 0.42em; white-space: nowrap; }
.works-controls { display: flex; gap: 8px; }
.works-controls button {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  padding: 0;
  border: 1px solid var(--rule);
  border-radius: 50%;
  background: transparent;
}
.works-controls button[aria-disabled="false"]:hover { border-color: var(--gold); background: rgba(193, 165, 124, 0.08); }
.works-controls button[aria-disabled="true"] { opacity: 0.4; cursor: default; }
.works-controls img, .work-card__title > img { filter: invert(81%) sepia(13%) saturate(582%) hue-rotate(355deg) brightness(87%) contrast(88%); transform: rotate(-90deg); }
#works-prev img { transform: rotate(90deg); }
.works-grid {
  --works-visible: 3;
  --works-gap: clamp(14px, 1.55vw, 24px);
  --works-peek: clamp(32px, 4vw, 60px);
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: calc((100% - var(--works-visible) * var(--works-gap) - var(--works-peek)) / var(--works-visible));
  gap: var(--works-gap);
  margin: 23px 0 0;
  padding: 0 0 12px;
  list-style: none;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
  scrollbar-color: #3a4a5c transparent;
}
.works-grid > li { min-width: 0; scroll-snap-align: start; }
.works-grid:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; }
.work-card { height: 100%; }
.work-card__link {
  display: flex;
  flex-direction: column;
  height: 100%;
  border: 1px solid var(--rule);
  border-radius: 4px;
  background: #0d1826;
  overflow: hidden;
  text-decoration: none;
  transition: border-color 160ms ease, background 160ms ease;
}
.work-card__link:is(:hover, :focus-visible) { border-color: rgba(193, 165, 124, 0.6); background: #122031; }
.work-card__link:focus-visible { outline-offset: -3px; }
.work-cover { overflow: hidden; aspect-ratio: 16 / 9; background: #101e2e; }
.work-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform 250ms ease; }
.work-card__link:hover .work-cover img { transform: scale(1.025); }
.work-card__body { padding: 14px 15px 16px; }
.work-card__top { display: flex; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.work-year { flex-shrink: 0; color: var(--quiet); font-family: var(--display-font); font-size: 15px; line-height: 1; }
.work-category { min-width: 0; margin-left: auto; overflow: hidden; color: var(--gold); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.work-card__title { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.work-card__title > img { flex: none; margin-top: 5px; opacity: 0.75; }
.work-card h3 { color: var(--ink); font-family: var(--display-font), var(--chinese-display); font-size: clamp(17px, 1.55vw, 23px); font-weight: 400; line-height: 1.3; overflow-wrap: anywhere; }
.work-summary { margin-top: 8px; color: var(--copy); font-size: 12px; line-height: 1.65; }
.work-card h3, .work-summary { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.entry-link {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  align-self: flex-start;
  min-height: 44px;
  padding: 8px 0;
  margin-top: auto;
  border: 0;
  border-bottom: 1px solid rgba(193, 165, 124, 0.4);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font-size: 13px;
  text-decoration: none;
  transition: color 160ms ease, border-color 160ms ease;
}
.entry-link img,
.note-open > img,
.contact-link > img { flex-shrink: 0; transform: rotate(-90deg); filter: invert(81%) sepia(13%) saturate(582%) hue-rotate(355deg) brightness(87%) contrast(88%); opacity: 0.75; }
.entry-link:hover { color: #fff0d2; border-bottom-color: var(--gold); }
.page-section.inspiration-section,
.page-section.contact-section { padding-block: clamp(32px, 4vw, 60px); border-top: 1px solid var(--rule); }
.inspiration-section:has(.notes-list:empty) { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 20px; }
.inspiration-section:has(.notes-list:empty) .load-state { margin-top: 0; }
.notes-list { padding: 0; margin: 34px 0 0; list-style: none; }
.notes-list:empty { display: none; }
.note-row { border-top: 1px solid var(--rule); }
.note-row:last-child { border-bottom: 1px solid var(--rule); }
.note-open { display: grid; grid-template-columns: minmax(140px, 0.65fr) minmax(0, 2.2fr) 24px; align-items: center; gap: 36px; width: 100%; min-height: 142px; padding: 30px 0; border: 0; background: transparent; text-align: left; }
.note-category { display: flex; gap: 24px; align-items: center; color: var(--gold); font-size: 12px; }
.note-number { color: var(--quiet); font-family: var(--display-font); font-size: 18px; }
.note-main { display: flex; flex-direction: column; gap: 12px; }
.note-main strong { color: var(--ink); font-family: var(--chinese-display); font-size: 25px; font-weight: 400; line-height: 1.45; letter-spacing: 0.03em; }
.note-main > span { max-width: 620px; color: var(--copy); font-size: 14px; line-height: 1.85; }
.note-open:hover .note-main strong { color: #fff0d2; }
.note-open:hover > img, .contact-link:hover > img { opacity: 1; }
.load-state { margin-top: 24px; color: var(--quiet); font-size: 14px; }
.retry-button { margin-top: 12px; }
.contact-section { display: grid; grid-template-columns: 1fr minmax(270px, 0.8fr); align-items: start; gap: clamp(32px, 6vw, 96px); }
.contact-link { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 54px; padding: 10px 0; border-bottom: 1px solid var(--rule); text-decoration: none; }
.contact-link:first-child { border-top: 1px solid var(--rule); }
.contact-link > span { display: flex; flex-direction: column; gap: 6px; }
.contact-link strong { font-family: var(--display-font), var(--chinese-display); font-size: 20px; font-weight: 400; line-height: 1.4; }
.contact-link:hover strong { color: #fff0d2; }
.page-footer { padding: 50px max(24px, 8.6vw) 26px; border-top: 1px solid var(--rule); background: var(--page-deep); }
.footer-top { display: flex; align-items: center; gap: 36px; }
.footer-brand { font-family: var(--display-font); font-size: 27px; font-weight: 400; letter-spacing: -0.02em; text-decoration: none; }
.footer-top > p { color: var(--quiet); font-size: 12px; }
.back-to-star { display: inline-flex; align-items: center; gap: 14px; min-height: 44px; margin-left: auto; color: var(--copy); font-size: 12px; text-decoration: none; }
.back-to-star img { transform: rotate(180deg); filter: invert(81%) sepia(13%) saturate(582%) hue-rotate(355deg) brightness(87%) contrast(88%); }
.footer-bottom { display: flex; justify-content: space-between; gap: 24px; margin-top: 30px; color: var(--quiet); font-size: 11px; }
.footer-bottom a { text-decoration: none; }
.footer-bottom a:hover, .back-to-star:hover { color: var(--ink); }
a:focus-visible, button:focus-visible { outline: 2px solid var(--gold); outline-offset: 6px; }

.entry-dialog { width: min(620px, calc(100% - 40px)); max-height: calc(100svh - 48px); padding: 58px 48px 42px; overflow-y: auto; border: 1px solid rgba(193, 165, 124, 0.3); border-radius: 2px; background: #101d2d; color: var(--ink); }
.entry-dialog::backdrop { background: rgba(3, 8, 15, 0.8); backdrop-filter: blur(8px); }
.dialog-close-form { position: absolute; top: 14px; right: 20px; }
.dialog-close { min-width: 44px; min-height: 44px; padding: 0; border: 0; background: transparent; color: var(--copy); font-size: 12px; }
.entry-dialog h2 { font-family: var(--chinese-display); font-size: 34px; font-weight: 400; line-height: 1.45; }
.entry-description { margin-top: 25px; color: #c2cad2; font-size: 15px; line-height: 2; }
.entry-keywords { margin-top: 32px; padding-top: 23px; border-top: 1px solid var(--rule); }
.entry-keywords > span { color: var(--gold); font-size: 11px; }
.entry-keywords > p { margin-top: 8px; color: var(--copy); font-size: 13px; line-height: 1.9; }
.entry-status { margin: 26px 0 30px; color: var(--quiet); font-size: 12px; line-height: 1.9; }
.entry-external { display: inline-flex; margin-bottom: 20px; color: var(--gold); font-size: 14px; }
.noscript-message { margin: 24px; color: var(--copy); font-size: 14px; }

@media (min-width: 1440px) {
  .works-grid { --works-visible: 4; }
}
@media (max-width: 1020px) {
  .works-grid { --works-visible: 2; }
  .note-open { grid-template-columns: 130px 1fr 20px; gap: 22px; }
  .note-category { gap: 15px; }
}
@media (max-width: 760px) {
  :root { --reading-width: calc(100% - 48px); }
  .page-section { padding: 72px 0; }
  .section-kicker { margin-bottom: 16px; font-size: 10px; }
  .page-section h2 { font-size: 33px; }
  .entry-link { gap: 28px; }
  .notes-list { margin-top: 34px; }
  .note-open { grid-template-columns: 1fr 20px; gap: 16px; padding: 24px 0; }
  .note-category { grid-column: 1; font-size: 11px; }
  .note-main { grid-column: 1; grid-row: 2; gap: 10px; }
  .note-main strong { font-size: 22px; }
  .note-open > img { grid-column: 2; grid-row: 2; }
  .note-main > span { font-size: 13px; }
  .contact-section { grid-template-columns: 1fr; gap: 16px; }
  .page-footer { padding: 36px 24px 24px; }
  .footer-top { flex-wrap: wrap; gap: 18px; }
  .footer-top > p { order: 3; flex-basis: 100%; font-size: 11px; }
  .back-to-star { font-size: 11px; }
  .footer-bottom { flex-wrap: wrap; gap: 10px 20px; margin-top: 24px; font-size: 10px; }
  .entry-dialog { padding: 56px 26px 30px; }
  .entry-dialog h2 { font-size: 29px; }
}
@media (max-width: 559px) {
  .works-grid { --works-visible: 1; margin-top: 18px; }
  .work-card h3 { font-size: 20px; }
}
@media (max-width: 370px) {
  :root { --reading-width: calc(100% - 40px); }
  .page-section h2 { font-size: 29px; }
  .page-footer { padding-right: 20px; padding-left: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
