:root {
  --ink: #191512;
  --ink-soft: #51483f;
  --muted: #7a7066;
  --paper: #f7f1e6;
  --paper-deep: #efe4d2;
  --porcelain: #fdfbf5;
  --celadon: #6e948a;
  --celadon-dark: #375d57;
  --cobalt: #1d4d73;
  --cinnabar: #9b3d2f;
  --gold: #b99a63;
  --line: rgba(25, 21, 18, 0.14);
  --shadow: 0 24px 70px rgba(36, 26, 15, 0.12);
  --radius: 8px;
  --font-song: "Songti SC", "STSong", "Noto Serif SC", "Source Han Serif SC", serif;
  --font-sans: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  color: var(--ink);
  background: var(--paper);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(185, 154, 99, 0.08) 1px, transparent 1px),
    linear-gradient(180deg, rgba(185, 154, 99, 0.06), transparent 38rem),
    var(--paper);
  background-size: 56px 56px, auto, auto;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.7;
}

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

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  color: var(--cinnabar);
}

button,
input,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

:focus-visible {
  outline: 3px solid rgba(155, 61, 47, 0.42);
  outline-offset: 4px;
}

.skip-link {
  position: fixed;
  left: 1rem;
  top: 1rem;
  z-index: 1000;
  transform: translateY(-160%);
  background: var(--ink);
  color: var(--porcelain);
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
}

.skip-link:focus {
  transform: translateY(0);
}

.shell {
  width: min(1120px, calc(100% - 40px));
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid rgba(25, 21, 18, 0.08);
  background: rgba(247, 241, 230, 0.88);
  backdrop-filter: blur(14px);
}

.header-inner {
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.brand {
  min-height: 54px;
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
}

.brand-mark {
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  display: block;
  object-fit: contain;
}

.brand-cn {
  display: block;
  font-family: var(--font-song);
  font-size: 1.16rem;
  font-weight: 700;
  line-height: 1.1;
}

.brand-en {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.4;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--ink-soft);
  font-size: 0.94rem;
}

.site-nav a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 0 0.86rem;
  border-radius: 999px;
}

.site-nav a:hover {
  background: rgba(55, 93, 87, 0.1);
  color: var(--celadon-dark);
}

.hero-section {
  min-height: calc(100dvh - 78px);
  display: flex;
  align-items: center;
  padding: clamp(2.5rem, 6vw, 5.5rem) 0;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.82fr) minmax(320px, 1.08fr);
  align-items: center;
  gap: clamp(2rem, 5vw, 5rem);
}

.hero-copy {
  padding: 1rem 0 2rem;
}

.eyebrow {
  margin: 0 0 1rem;
  color: var(--cinnabar);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--font-song);
  font-weight: 700;
  line-height: 1.12;
}

.hero-copy h1 {
  max-width: 9em;
  font-size: 7.2rem;
}

.hero-lede {
  max-width: 34rem;
  margin: 1.5rem 0 0;
  color: var(--ink-soft);
  font-size: 1.2rem;
}

.hero-actions,
.detail-actions,
.card-actions {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.hero-actions {
  margin-top: 2rem;
}

.btn {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.72rem 1.2rem;
  cursor: pointer;
  transition: background-color 180ms ease, color 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--ink);
  color: var(--porcelain);
  border-color: var(--ink);
}

.btn-primary:hover {
  background: var(--cinnabar);
  color: var(--porcelain);
  border-color: var(--cinnabar);
}

.btn-secondary,
.btn-quiet {
  color: var(--ink);
  background: rgba(253, 251, 245, 0.78);
  border-color: var(--line);
}

.btn-secondary:hover,
.btn-quiet:hover {
  color: var(--celadon-dark);
  border-color: rgba(55, 93, 87, 0.45);
}

.wide {
  width: 100%;
}

.hero-media {
  position: relative;
  margin: 0;
  box-shadow: var(--shadow);
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--porcelain);
}

.hero-media img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.hero-media figcaption {
  position: absolute;
  right: 1rem;
  bottom: 1rem;
  padding: 0.42rem 0.7rem;
  color: var(--porcelain);
  background: rgba(25, 21, 18, 0.62);
  border-radius: 999px;
  font-size: 0.82rem;
}

.section {
  padding: 6rem 0;
}

.compact {
  padding: 4rem 0;
}

.intro-band {
  background: var(--ink);
  color: var(--porcelain);
}

.intro-grid {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: clamp(2rem, 5vw, 5rem);
  align-items: start;
}

.intro-grid h2,
.section-heading h2,
.page-hero h1,
.detail-copy h1,
.info-panel h2,
.essay-panel h2,
.appointment-grid h2,
.contact-card h2,
.empty-panel h2,
.empty-panel h3 {
  font-size: 3.6rem;
}

.intro-grid p:last-child {
  margin: 0;
  color: rgba(253, 251, 245, 0.82);
  font-size: 1.1rem;
}

.section-heading {
  margin-bottom: 2rem;
}

.section-heading.split {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 1.5rem;
}

.section-heading p:not(.eyebrow) {
  max-width: 42rem;
  color: var(--ink-soft);
}

.category-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.8rem;
}

.category-chip {
  min-height: 116px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(253, 251, 245, 0.62);
}

.category-chip span {
  font-family: var(--font-song);
  font-size: 1.28rem;
  font-weight: 700;
}

.category-chip small {
  color: var(--muted);
  line-height: 1.5;
}

.category-chip:hover {
  border-color: rgba(55, 93, 87, 0.45);
  background: var(--porcelain);
}

.featured-section {
  background: rgba(253, 251, 245, 0.56);
}

.artifact-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.2rem;
}

.artifact-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.artifact-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--porcelain);
  box-shadow: 0 18px 44px rgba(36, 26, 15, 0.08);
}

.artifact-image {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--paper-deep);
}

.artifact-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 180ms ease;
}

.artifact-card:hover .artifact-image img {
  opacity: 0.92;
}

.artifact-card-body {
  padding: 1.05rem;
}

.artifact-meta {
  margin: 0 0 0.5rem;
  color: var(--cinnabar);
  font-size: 0.82rem;
}

.artifact-card h3 {
  font-size: 1.32rem;
}

.artifact-card-body p:not(.artifact-meta) {
  color: var(--ink-soft);
  margin: 0.7rem 0 1rem;
}

.text-link {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  color: var(--ink);
  font-weight: 700;
}

.text-link::after {
  content: "";
  width: 1.8rem;
  height: 1px;
  margin-left: 0.5rem;
  background: currentColor;
}

.text-link.muted {
  color: var(--muted);
}

.empty-panel {
  grid-column: 1 / -1;
  padding: 3rem;
  border: 1px dashed rgba(25, 21, 18, 0.24);
  border-radius: var(--radius);
  background: rgba(253, 251, 245, 0.58);
}

.empty-note {
  color: var(--muted);
}

.page-hero {
  padding: 6rem 0 3.5rem;
  background: linear-gradient(180deg, rgba(25, 21, 18, 0.08), transparent);
}

.page-hero .shell {
  max-width: 960px;
}

.page-hero h1 {
  margin-bottom: 1rem;
}

.page-hero p:not(.eyebrow) {
  max-width: 48rem;
  color: var(--ink-soft);
  font-size: 1.1rem;
}

.filter-panel {
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) 1.1fr;
  gap: 1.5rem;
  align-items: end;
  padding: 1.2rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(253, 251, 245, 0.72);
}

.search-form label,
.appointment-form label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--ink-soft);
  font-weight: 700;
}

.search-row,
.code-row {
  display: flex;
  gap: 0.7rem;
}

input,
textarea {
  width: 100%;
  min-height: 46px;
  border: 1px solid rgba(25, 21, 18, 0.22);
  border-radius: var(--radius);
  padding: 0.78rem 0.9rem;
  color: var(--ink);
  background: rgba(255, 253, 248, 0.9);
}

textarea {
  min-height: 110px;
  resize: vertical;
}

.category-filter {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5rem;
}

.category-filter a {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.55rem 0.9rem;
  background: var(--porcelain);
  color: var(--ink-soft);
}

.category-filter a.active {
  color: var(--porcelain);
  background: var(--celadon-dark);
  border-color: var(--celadon-dark);
}

.detail-hero {
  padding: 5rem 0;
}

.detail-grid {
  display: grid;
  grid-template-columns: minmax(320px, 1.08fr) minmax(280px, 0.92fr);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: center;
}

.detail-media {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--paper-deep);
  box-shadow: var(--shadow);
}

.detail-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-copy blockquote {
  margin: 1.2rem 0;
  padding-left: 1rem;
  border-left: 3px solid var(--gold);
  color: var(--cinnabar);
  font-family: var(--font-song);
  font-size: 1.2rem;
}

.detail-intro {
  color: var(--ink-soft);
  font-size: 1.08rem;
}

.detail-actions {
  margin-top: 1.6rem;
}

.artifact-info-grid,
.appointment-grid,
.contact-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 1.4rem;
  align-items: start;
}

.info-panel,
.essay-panel,
.appointment-form,
.contact-card,
.contact-list,
.qr-card,
.quiet-note {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(253, 251, 245, 0.78);
  padding: 1.8rem;
}

.archive-list {
  margin: 1.5rem 0 0;
}

.archive-list div,
.contact-list div {
  display: grid;
  grid-template-columns: 5rem 1fr;
  gap: 1rem;
  padding: 1rem 0;
  border-top: 1px solid var(--line);
}

.archive-list dt,
.contact-list span {
  color: var(--muted);
}

.archive-list dd {
  margin: 0;
}

.essay-panel p {
  color: var(--ink-soft);
}

.image-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.image-strip figure,
.qr-card {
  margin: 0;
}

.detail-image-frame {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--paper-deep);
}

.detail-image-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-strip figcaption,
.qr-card figcaption {
  margin-top: 0.6rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.appointment-grid > div:first-child {
  padding: 1.8rem 0;
}

.appointment-grid p {
  color: var(--ink-soft);
}

.appointment-form {
  display: grid;
  gap: 0.8rem;
}

.form-message {
  min-height: 1.6rem;
  margin: 0;
  color: var(--ink-soft);
}

.form-message.success {
  color: var(--celadon-dark);
}

.form-message.error {
  color: var(--cinnabar);
}

.contact-grid {
  grid-template-columns: 0.8fr 1fr 240px;
}

.contact-list strong {
  font-size: 1.04rem;
}

.qr-card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  background: var(--porcelain);
  border-radius: var(--radius);
}

.quiet-note {
  max-width: 760px;
  color: var(--ink-soft);
}

.site-footer {
  padding: 4.5rem 0;
  color: var(--paper);
  background: var(--ink);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr 0.8fr;
  gap: 2rem;
}

.site-footer h2 {
  margin-bottom: 0.8rem;
  font-size: 3.2rem;
}

.site-footer p {
  color: rgba(247, 241, 230, 0.78);
}

.footer-contact p {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  border-bottom: 1px solid rgba(247, 241, 230, 0.18);
  padding: 0.7rem 0;
  margin: 0;
}

.footer-contact span {
  color: rgba(247, 241, 230, 0.58);
}

.footer-filing {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(247, 241, 230, 0.14);
  text-align: center;
  font-size: 0.82rem;
  color: rgba(247, 241, 230, 0.6);
}

.footer-filing a {
  color: inherit;
}

.footer-filing a:hover {
  color: var(--paper);
}

@media (max-width: 900px) {
  .hero-copy h1 {
    font-size: 5rem;
  }

  .intro-grid h2,
  .section-heading h2,
  .page-hero h1,
  .detail-copy h1,
  .info-panel h2,
  .essay-panel h2,
  .appointment-grid h2,
  .contact-card h2,
  .empty-panel h2,
  .empty-panel h3 {
    font-size: 3rem;
  }

  .section {
    padding: 4.5rem 0;
  }

  .compact {
    padding: 3rem 0;
  }

  .hero-grid,
  .intro-grid,
  .detail-grid,
  .artifact-info-grid,
  .appointment-grid,
  .contact-grid,
  .footer-grid,
  .filter-panel {
    grid-template-columns: 1fr;
  }

  .hero-section {
    min-height: auto;
  }

  .detail-media img {
    width: 100%;
    max-height: none;
  }

  .category-row,
  .artifact-grid,
  .artifact-grid.three,
  .image-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .category-filter {
    justify-content: flex-start;
  }

  .section-heading.split {
    align-items: start;
    flex-direction: column;
  }
}

@media (max-width: 640px) {
  .shell {
    width: min(100% - 28px, 1120px);
  }

  body {
    font-size: 15px;
    background-size: 44px 44px, auto, auto;
  }

  .header-inner {
    min-height: auto;
    align-items: center;
    flex-direction: row;
    padding: 0.75rem 0;
    gap: 0.6rem;
  }

  .brand {
    min-width: 0;
    gap: 0.6rem;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
  }

  .brand-cn {
    font-size: 1rem;
  }

  .brand-en {
    display: none;
  }

  .site-nav {
    flex: 0 0 auto;
    gap: 0.2rem;
    font-size: 0.88rem;
    overflow: visible;
    padding-bottom: 0;
  }

  .site-nav a {
    min-height: 40px;
    padding: 0 0.52rem;
  }

  .hero-copy h1 {
    font-size: 3.6rem;
  }

  .hero-lede,
  .page-hero p:not(.eyebrow),
  .detail-intro {
    font-size: 1rem;
  }

  .intro-grid h2,
  .section-heading h2,
  .page-hero h1,
  .detail-copy h1,
  .info-panel h2,
  .essay-panel h2,
  .appointment-grid h2,
  .contact-card h2,
  .empty-panel h2,
  .empty-panel h3 {
    font-size: 2.35rem;
  }

  .category-row,
  .artifact-grid,
  .artifact-grid.three,
  .image-strip {
    grid-template-columns: 1fr;
  }

  .artifact-card-body {
    padding: 1rem;
  }

  .artifact-card h3 {
    font-size: 1.22rem;
  }

  .artifact-card-body p:not(.artifact-meta) {
    margin-bottom: 0.8rem;
  }

  .card-actions {
    align-items: flex-start;
    gap: 0.35rem 0.7rem;
  }

  .text-link::after {
    width: 1.1rem;
  }

  .page-hero {
    padding: 3.5rem 0 2rem;
  }

  .detail-hero {
    padding: 2.5rem 0;
  }

  .info-panel,
  .essay-panel,
  .appointment-form,
  .contact-card,
  .contact-list,
  .qr-card,
  .quiet-note,
  .filter-panel,
  .empty-panel {
    padding: 1rem;
  }

  .search-row,
  .code-row {
    flex-direction: column;
  }

  .code-row .btn {
    width: 100%;
  }

  .archive-list div,
  .contact-list div {
    grid-template-columns: 1fr;
    gap: 0.2rem;
  }

  .hero-media figcaption {
    position: static;
    color: var(--ink-soft);
    background: transparent;
    border-radius: 0;
  }

  .site-footer {
    padding: 3rem 0;
  }

  .site-footer h2 {
    font-size: 2.35rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }
}
