:root {
  --page-bg: #f3eee7;
  --sidebar-bg: rgba(247, 242, 235, 0.92);
  --card-bg: rgba(255, 255, 255, 0.72);
  --border: rgba(90, 70, 55, 0.18);
  --text: #302a27;
  --muted: #746b65;
  --accent: #8a6755;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 2rem; }
body {
  margin: 0;
  color: var(--text);
  background: radial-gradient(circle at top right, #fff9f0 0, transparent 35%), var(--page-bg);
  font-family: "Noto Serif SC", "Microsoft YaHei", serif;
  line-height: 1.7;
}
a { color: inherit; text-decoration: none; }

.museum-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
}
.museum-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  padding: 2rem 1.5rem;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  backdrop-filter: blur(16px);
}
.museum-sidebar h1 { margin: 1.5rem 0; font-size: 1.5rem; }
.back-link { color: var(--muted); font-size: 0.9rem; }
.nav-group { display: grid; margin-bottom: 1.4rem; }
.nav-character { padding: 0.45rem 0; font-weight: 700; }
.nav-wardrobe {
  padding: 0.3rem 0 0.3rem 1rem;
  color: var(--muted);
  font-size: 0.9rem;
  border-left: 1px solid var(--border);
}
.nav-character:hover, .nav-wardrobe:hover { color: var(--accent); }

.museum-content { width: min(1180px, 100%); padding: 3rem clamp(1.25rem, 4vw, 4rem) 8rem; }
.character-section { padding-bottom: 7rem; }
.museum-card {
  padding: 1.5rem;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 12px 35px rgba(70, 50, 40, 0.06);
  backdrop-filter: blur(10px);
}
.character-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 42%);
  gap: 2rem;
  align-items: center;
  margin-bottom: 4rem;
}
.translation-label {
  margin: 0 0 0.6rem;
  color: var(--accent);
  font-size: 0.78rem;
  letter-spacing: 0.15em;
}
.translation-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
  align-items: start;
}
.fashion-translations {
  margin-top: 1.5rem;
  padding: 1rem;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
}
.translation-grid-single {
  grid-template-columns: minmax(0, 520px);
}
.translation-image {
  aspect-ratio: auto;
  object-fit: contain;
  background: white;
}
.museum-kicker { color: var(--accent); letter-spacing: 0.18em; font-size: 0.78rem; }
.character-title { margin: 0.3rem 0 1rem; font-size: clamp(2rem, 5vw, 4rem); line-height: 1.2; }
.character-summary, .museum-description { color: var(--muted); white-space: pre-wrap; }
.character-hero-image { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 12px; }
.wardrobe-section { margin-top: 4rem; }
.fashion-section { margin-top: 2rem; }
.museum-card-title { margin: 0; font-size: 1.35rem; }
.museum-description { margin: 0.6rem 0 0; }
.museum-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
  margin-top: 1.2rem;
}
.museum-image {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--border);
  cursor: zoom-in;
  box-shadow: 0 10px 28px rgba(70, 50, 40, 0.08);
}
.scroll-target { scroll-margin-top: 2rem; }
.loading-message { color: var(--muted); }

.image-viewer {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  place-items: center;
  padding: 3rem;
  background: rgba(20, 17, 15, 0.9);
}
.image-viewer.active { display: grid; }
.image-viewer img { max-width: 92vw; max-height: 88vh; border-radius: 10px; }
.viewer-close {
  position: absolute;
  top: 1rem;
  right: 1.5rem;
  color: white;
  border: 0;
  background: none;
  font-size: 2.5rem;
  cursor: pointer;
}

@media (max-width: 760px) {
  .museum-shell { display: block; }
  .museum-sidebar { position: sticky; z-index: 20; height: auto; padding: 0.8rem 1rem; border-right: 0; border-bottom: 1px solid var(--border); }
  .museum-sidebar h1, .back-link { display: none; }
  #museum-nav { display: flex; gap: 0.8rem; overflow-x: auto; }
  .nav-group { display: flex; flex: 0 0 auto; margin: 0; }
  .nav-wardrobe { display: none; }
  .nav-character { white-space: nowrap; font-size: 0.9rem; }
  .museum-content { padding: 2rem 1rem 5rem; }
  .character-hero { grid-template-columns: 1fr; }
  .museum-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.9rem; }
}
