:root {
  --scene-bg: #17130f;
  --scene-ink: #f1dfc6;
  --panel: rgba(20, 17, 14, .84);
  --line: rgba(255, 255, 255, .16);
}
* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; }
body {
  color: var(--scene-ink);
  font-family: "Noto Sans SC", "Microsoft YaHei", sans-serif;
  background: var(--scene-bg);
  transition: background-color .65s ease, color .65s ease;
}
button, a { font: inherit; }
.hidden { display: none !important; }
.viewer-top {
  position: fixed;
  inset: 0 0 auto;
  height: 76px;
  z-index: 20;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 18px;
  padding: 0 clamp(16px, 4vw, 54px);
  background: linear-gradient(180deg, rgba(0,0,0,.46), transparent);
}
.home-link { color: inherit; text-decoration: none; opacity: .84; }
.top-actions {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
  max-width: min(100%, 420px);
}
.gesture-tip {
  position: absolute;
  left: 50%;
  top: auto;
  bottom: clamp(72px, 11vh, 104px);
  transform: translateX(-50%);
  z-index: 5;
  display: flex;
  gap: 14px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(0,0,0,.28);
  backdrop-filter: blur(8px);
  font-size: 12px;
  opacity: .78;
  pointer-events: none;
  white-space: nowrap;
}
.top-btn {
  border: 1px solid currentColor;
  border-radius: 999px;
  padding: 8px 15px;
  background: rgba(0,0,0,.15);
  cursor: pointer;
  color: inherit;
  opacity: .84;
}
.autoplay-switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  opacity: .9;
  font-size: 12px;
  letter-spacing: 1px;
}
.autoplay-switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.autoplay-track {
  width: 36px;
  height: 20px;
  border-radius: 999px;
  border: 1px solid currentColor;
  background: rgba(0,0,0,.18);
  position: relative;
  flex: 0 0 auto;
  transition: background .2s ease;
}
.autoplay-track::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  left: 2px;
  top: 2px;
  background: currentColor;
  transition: transform .2s ease;
}
.autoplay-switch input:checked + .autoplay-track {
  background: rgba(255,255,255,.22);
}
.autoplay-switch input:checked + .autoplay-track::after {
  transform: translateX(16px);
}
.autoplay-text { white-space: nowrap; }
.title-wrap { display: grid; text-align: center; gap: 2px; }
.title-wrap span { font-size: 10px; letter-spacing: 3px; opacity: .62; }
.title-wrap strong { font-size: 18px; letter-spacing: 6px; }
.viewer { position: relative; width: 100%; height: 100%; touch-action: none; user-select: none; }
#liziCanvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.work-info { position: absolute; z-index: 4; left: clamp(18px, 5vw, 70px); bottom: clamp(118px, 16vh, 160px); max-width: min(420px, calc(100vw - 36px)); pointer-events: none; text-shadow: 0 2px 14px rgba(0,0,0,.48); }
.work-info h1 { margin: 6px 0 8px; font-family: "STKaiti", "KaiTi", serif; font-size: clamp(28px, 4vw, 54px); font-weight: 400; letter-spacing: 4px; }
.work-info p { margin: 0; line-height: 1.65; opacity: .78; font-size: 14px; }
.work-venue {
  display: grid;
  gap: 4px;
  margin: 0 0 10px;
}
.work-info .work-museum,
.work-info .work-address {
  display: block;
  color: inherit;
  text-decoration: none;
  pointer-events: auto;
  cursor: default;
  opacity: .88;
  font-size: 14px;
  line-height: 1.45;
  letter-spacing: 1px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.work-info .work-address { opacity: .72; font-size: 13px; letter-spacing: 0; }
.work-info .work-museum[href],
.work-info .work-address[href] {
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.work-info .view-label { display: inline-block; border: 1px solid currentColor; border-radius: 999px; padding: 4px 11px; font-size: 12px; letter-spacing: 2px; opacity: .7; }
.gesture-tip .tip-ico {
  display: inline-block;
  margin-right: 6px;
  font-style: normal;
  opacity: .9;
}
.view-controls { position: absolute; z-index: 5; right: clamp(16px, 4vw, 54px); bottom: clamp(24px, 5vh, 54px); display: flex; gap: 7px; }
.view-controls button { width: 48px; height: 48px; border: 1px solid var(--line); border-radius: 50%; color: inherit; background: rgba(0,0,0,.2); cursor: pointer; opacity: .68; }
.view-controls button.active { background: currentColor; color: var(--scene-bg); opacity: 1; }
.empty-state { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; z-index: 3; pointer-events: none; }
.empty-state h1 { font-family: "STKaiti", "KaiTi", serif; letter-spacing: 8px; font-weight: 400; margin: 12px 0 4px; }
.empty-state p { opacity: .65; }
.empty-mark { font-size: 42px; opacity: .7; animation: breathe 1.8s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scale(1.18) rotate(22deg); opacity: 1; } }
.works-panel { position: fixed; z-index: 30; right: 0; top: 0; width: min(390px, 92vw); height: 100%; padding: 22px; background: var(--panel); backdrop-filter: blur(22px); border-left: 1px solid var(--line); transform: translateX(105%); transition: transform .3s ease; overflow: auto; }
.works-panel.open { transform: translateX(0); }
.works-head { display: flex; justify-content: space-between; align-items: center; margin: 0 0 18px; }
.works-head h2 { margin: 0; font-size: 18px; letter-spacing: 3px; }
.works-head button { border: 0; color: inherit; background: transparent; font-size: 30px; cursor: pointer; }
.works-list { display: grid; gap: 12px; }
.work-card { display: grid; grid-template-columns: 90px 1fr; gap: 12px; width: 100%; padding: 8px; color: inherit; text-align: left; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.04); cursor: pointer; }
.work-card.active { border-color: currentColor; background: rgba(255,255,255,.12); }
.work-card canvas.front-thumb,
.work-card img.front-thumb {
  width: 90px;
  height: 70px;
  object-fit: contain;
  border-radius: 8px;
  background: rgba(255,255,255,.08);
  display: block;
}
.work-card img { width: 90px; height: 70px; object-fit: cover; border-radius: 8px; background: rgba(255,255,255,.08); }
.work-card strong { display: block; margin: 4px 0 6px; }
.work-card-text { min-width: 0; display: grid; align-content: center; gap: 2px; }
.work-card-museum,
.work-card-address {
  display: block;
  font-size: 12px;
  opacity: .62;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.work-card span { display: block; font-size: 12px; opacity: .62; line-height: 1.45; }
@media (max-width: 640px) {
  .viewer-top { height: 64px; grid-template-columns: 1fr auto; }
  .title-wrap { display: none; }
  .top-actions { gap: 8px; }
  .autoplay-text { font-size: 11px; }
  .gesture-tip { bottom: 68px; gap: 9px; font-size: 10px; padding: 7px 10px; }
  .work-info { bottom: clamp(118px, 18vh, 150px); }
  .work-info h1 { font-size: 30px; }
  .work-info #workIntro { max-height: 48px; overflow: hidden; }
  .view-controls { right: 16px; bottom: 20px; }
  .view-controls button { width: 42px; height: 42px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
