:root {
  color-scheme: light;
  --ink: #202020;
  --muted: #6c665d;
  --line: #d9d0c2;
  --paper: #fbfaf7;
  --panel: #ffffff;
  --wash: #f1eadf;
  --lacquer: #7e2f25;
  --jade: #2f5f55;
  --gold: #b3813c;
  --shadow: 0 18px 40px rgba(42, 32, 22, 0.11);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    linear-gradient(90deg, rgba(126, 47, 37, 0.05), transparent 32%),
    repeating-linear-gradient(90deg, rgba(126, 47, 37, 0.025) 0 1px, transparent 1px 110px),
    var(--paper);
  color: var(--ink);
  font-family:
    "Noto Serif TC", "Songti TC", "PingFang TC", "Microsoft JhengHei", Georgia,
    serif;
  letter-spacing: 0;
}

button,
input {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px clamp(18px, 4vw, 56px);
  border-bottom: 1px solid rgba(126, 47, 37, 0.18);
  background: rgba(251, 250, 247, 0.92);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--lacquer);
  background: var(--lacquer);
  color: #fff7ed;
  font-size: 22px;
  line-height: 1;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 18px;
  font-weight: 700;
}

.brand small,
.kicker,
.artifact-meta,
.status-line {
  color: var(--muted);
  font-family: "Inter", "PingFang TC", "Microsoft JhengHei", sans-serif;
}

.brand small {
  margin-top: 2px;
  font-size: 12px;
}

nav {
  display: flex;
  gap: 18px;
  font-family: "Inter", "PingFang TC", "Microsoft JhengHei", sans-serif;
}

.language-switch button {
  border: 0;
  border-bottom: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 15px;
  padding: 4px 0;
}

.language-switch button:hover,
.language-switch button[aria-pressed="true"] {
  border-bottom-color: var(--lacquer);
  color: var(--lacquer);
}

main {
  width: min(1420px, 100%);
  margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 56px) 56px;
}

.site-footer {
  border-top: 1px solid var(--line);
  padding: 26px clamp(18px, 4vw, 56px) 30px;
  color: var(--muted);
  font-family: "Inter", "PingFang TC", "Microsoft JhengHei", sans-serif;
  font-size: 15px;
}

.footer-inner {
  width: min(1308px, 100%);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 30px;
}

.site-footer p {
  margin: 0;
}

.site-footer strong,
.site-footer a {
  color: var(--ink);
  font-weight: 600;
}

.hero {
  padding: 54px 0 30px;
}

.kicker {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0;
  font-size: clamp(42px, 8vw, 88px);
  font-weight: 600;
  line-height: 1.03;
}

.hero p {
  max-width: 760px;
  margin: 20px 0 0;
  color: #4c463f;
  font-size: clamp(17px, 2vw, 21px);
  line-height: 1.75;
}

.layout {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  gap: 30px;
  align-items: start;
}

.sidebar {
  position: sticky;
  top: 86px;
  display: grid;
  gap: 20px;
}

.sidebar h2,
.toolbar h2 {
  margin: 0;
  font-size: 24px;
  font-weight: 600;
}

.category-list {
  display: grid;
  gap: 8px;
}

.category-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  cursor: pointer;
  padding: 11px 12px;
  text-align: left;
}

.category-button[aria-pressed="true"] {
  border-color: var(--lacquer);
  background: var(--lacquer);
  color: #fff7ed;
}

.category-button span:last-child {
  font-family: "Inter", sans-serif;
  font-size: 13px;
  opacity: 0.82;
}

.catalog-area {
  min-width: 0;
}

.toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 22px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 18px;
}

.featured-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.featured-card {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  min-height: 116px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--panel);
  text-align: left;
}

.featured-card img,
.artifact-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.featured-card div:last-child {
  padding: 13px;
}

.featured-card h3,
.artifact-card h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.45;
}

.featured-card p,
.artifact-card p {
  display: -webkit-box;
  margin: 7px 0 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.status-line {
  margin: 8px 0 14px;
  font-size: 14px;
}

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

.artifact-card {
  display: grid;
  overflow: hidden;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.86);
  cursor: pointer;
  text-align: left;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    border-color 160ms ease;
}

.artifact-card:hover {
  border-color: rgba(126, 47, 37, 0.45);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.artifact-card:focus-visible,
.category-button:focus-visible,
.featured-card:focus-visible,
.dialog-close:focus-visible {
  outline: 3px solid rgba(47, 95, 85, 0.26);
  outline-offset: 3px;
}

.artifact-image {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: var(--wash);
}

.artifact-image.missing {
  display: grid;
  place-items: center;
  padding: 20px;
  color: var(--muted);
  font-family: "Inter", "PingFang TC", sans-serif;
  font-size: 14px;
  text-align: center;
}

.artifact-content {
  display: grid;
  gap: 8px;
  padding: 15px;
}

.artifact-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
}

.badge {
  color: var(--jade);
  font-weight: 700;
}

.artifact-dialog {
  width: min(980px, calc(100vw - 28px));
  max-height: calc(100vh - 28px);
  padding: 0;
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.artifact-dialog::backdrop {
  background: rgba(32, 32, 32, 0.42);
}

.dialog-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 50%;
  background: rgba(32, 32, 32, 0.66);
  color: #fff;
  cursor: pointer;
  font-size: 28px;
  line-height: 1;
}

.dialog-body {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
}

.dialog-media {
  min-height: 560px;
  background: var(--wash);
}

.dialog-media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.dialog-copy {
  display: grid;
  align-content: center;
  gap: 18px;
  padding: 34px;
}

.dialog-copy h2 {
  margin: 0;
  font-size: clamp(27px, 4vw, 44px);
  font-weight: 600;
  line-height: 1.15;
}

.dialog-copy p {
  margin: 0;
  color: #4c463f;
  font-size: 17px;
  line-height: 1.75;
}

@media (max-width: 1100px) {
  .artifact-grid,
  .featured-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 840px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .hero,
  .layout,
  .dialog-body {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

  .category-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .dialog-media {
    min-height: 360px;
  }
}

@media (max-width: 620px) {
  main {
    padding-inline: 14px;
  }

  nav {
    width: 100%;
    justify-content: space-between;
  }

  .hero {
    padding-top: 34px;
  }

  .artifact-grid,
  .featured-strip,
  .category-list {
    grid-template-columns: 1fr;
  }

  .featured-card {
    grid-template-columns: 112px minmax(0, 1fr);
  }

  .dialog-copy {
    padding: 24px;
  }
}
