@charset "UTF-8";
/* ==========================================================================
   中华文明数字博物馆 — 主样式
   风格：简洁大方、留白克制、以墨色与青铜绿为主调
   ========================================================================== */

:root {
  /* 主色 */
  --ink:        #1f2328;
  --ink-2:      #3d4450;
  --ink-3:      #6b7280;
  --ink-4:      #9aa1ab;
  --line:       #e5e2dc;
  --line-2:     #f0ede8;
  --bg:         #f7f6f3;
  --surface:    #ffffff;
  --surface-2:  #fbfaf8;

  --accent:     #2f6b5f;   /* 青铜绿 */
  --accent-2:   #3d8577;
  --accent-soft:#eef4f2;
  --gold:       #a98545;
  --gold-soft:  #f7f1e4;

  --radius:     4px;
  --radius-lg:  8px;
  --shadow:     0 1px 2px rgba(31, 35, 40, .04), 0 4px 16px rgba(31, 35, 40, .05);
  --shadow-lg:  0 8px 32px rgba(31, 35, 40, .12);

  --banner-h:   168px;
  --sidebar-w:  236px;
  --maxw:       1560px;

  --serif: "Songti SC", "SimSun", "Noto Serif CJK SC", "Source Han Serif SC", Georgia, serif;
  --sans:  -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
           "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.65;
  color: var(--ink-2);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { margin: 0; font-weight: 600; color: var(--ink); line-height: 1.3; }
p  { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
a  { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; cursor: pointer; }

::selection { background: var(--accent); color: #fff; }

/* 滚动条 */
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: #d6d2ca; border-radius: 6px; border: 3px solid var(--bg); }
*::-webkit-scrollbar-thumb:hover { background: #bdb8ae; }

/* ==========================================================================
   顶部 Banner + 横向菜单
   ========================================================================== */
.banner {
  position: relative;
  background-color: #2a2f33;
  background-size: cover;
  background-position: center;
  color: #fff;
  isolation: isolate;
}
.banner--plain {
  background-image: linear-gradient(120deg, #2b3a36 0%, #1f2a2a 55%, #23282c 100%);
}
.banner__overlay {
  position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(18, 22, 24, .92) 0%, rgba(18, 22, 24, .55) 48%, rgba(18, 22, 24, .78) 100%);
  z-index: 0;
}
.banner__inner {
  position: relative; z-index: 1;
  max-width: var(--maxw);
  min-height: var(--banner-h);
  margin: 0 auto;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}

.brand { display: flex; align-items: center; gap: 16px; min-width: 0; }
.brand__logo { height: 46px; width: auto; flex: none; }
.brand__title {
  font-family: var(--serif);
  font-size: 27px;
  font-weight: 600;
  letter-spacing: 3px;
  color: #fff;
  line-height: 1.25;
}
.brand__en {
  font-size: 10.5px;
  letter-spacing: 2.4px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .55);
  margin-top: 3px;
}
.brand__slogan {
  font-size: 12.5px;
  color: rgba(255, 255, 255, .68);
  margin-top: 5px;
  letter-spacing: .4px;
}

.menu__list { display: flex; align-items: center; gap: 4px; }
.menu__link {
  position: relative;
  display: block;
  padding: 9px 17px;
  font-size: 14.5px;
  letter-spacing: 1px;
  color: rgba(255, 255, 255, .82);
  border-radius: var(--radius);
  transition: color .2s, background-color .2s;
  white-space: nowrap;
}
.menu__link:hover { color: #fff; background: rgba(255, 255, 255, .1); }
.menu__link.is-active { color: #fff; font-weight: 600; }
.menu__link.is-active::after {
  content: "";
  position: absolute;
  left: 50%; bottom: -1px;
  transform: translateX(-50%);
  width: 20px; height: 2px;
  background: var(--gold);
}

.menu-toggle { display: none; }

/* ==========================================================================
   主体布局：左导航 + 右内容
   ========================================================================== */
.layout {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 32px;
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  gap: 40px;
  align-items: start;
}
.layout--full { grid-template-columns: minmax(0, 1fr); }

.sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  max-height: 100vh;
  overflow-y: auto;
  padding: 34px 0 40px;
  scrollbar-width: thin;
}
.sidebar__inner { padding-right: 8px; }
.sidebar__title {
  font-family: var(--serif);
  font-size: 15px;
  letter-spacing: 2px;
  color: var(--ink);
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 16px;
}

.search { position: relative; margin-bottom: 20px; }
.search__input {
  width: 100%;
  padding: 9px 36px 9px 12px;
  font: inherit;
  font-size: 13.5px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.search__input::placeholder { color: var(--ink-4); }
.search__input:focus {
  border-color: var(--accent-2);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.search__btn {
  position: absolute; right: 1px; top: 1px;
  width: 34px; height: calc(100% - 2px);
  display: grid; place-items: center;
  background: none; border: 0;
  color: var(--ink-4);
  border-radius: var(--radius);
  transition: color .2s;
}
.search__btn:hover { color: var(--accent); }

.nav { border-top: 1px solid var(--line-2); }
.nav__item { border-bottom: 1px solid var(--line-2); }
.nav__item--sep { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.nav__link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  font-size: 14px;
  color: var(--ink-2);
  border-left: 2px solid transparent;
  border-radius: 0 var(--radius) var(--radius) 0;
  transition: color .18s, background-color .18s, border-color .18s;
}
.nav__link:hover { color: var(--accent); background: var(--accent-soft); }
.nav__link.is-active {
  color: var(--accent);
  font-weight: 600;
  background: var(--accent-soft);
  border-left-color: var(--accent);
}
.nav__count {
  flex: none;
  min-width: 22px;
  padding: 1px 6px;
  font-size: 11.5px;
  text-align: center;
  color: var(--ink-4);
  background: var(--line-2);
  border-radius: 20px;
}
.nav__link.is-active .nav__count { color: var(--accent); background: rgba(47, 107, 95, .12); }

.sidebar__stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  margin-top: 24px;
  padding: 16px 4px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-align: center;
}
.sidebar__stats div { display: flex; flex-direction: column; gap: 2px; }
.sidebar__stats b { font-size: 17px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.sidebar__stats span { font-size: 11px; color: var(--ink-4); }

.content { padding: 34px 0 64px; min-width: 0; }

.data-error {
  margin: 0 0 20px;
  padding: 12px 16px;
  font-size: 13.5px;
  color: #8a3b2f;
  background: #fdf2f0;
  border: 1px solid #f0d6d1;
  border-radius: var(--radius);
}

/* ==========================================================================
   页头信息条
   ========================================================================== */
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  padding-bottom: 18px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--line);
}
.page-head__title { font-family: var(--serif); font-size: 23px; letter-spacing: 1.5px; }
.page-head__sub { margin-top: 5px; font-size: 13.5px; color: var(--ink-3); }
.page-head__sub b { color: var(--accent); font-weight: 600; font-variant-numeric: tabular-nums; }

.crumb { font-size: 12.5px; color: var(--ink-4); margin-bottom: 14px; }
.crumb a:hover { color: var(--accent); }
.crumb span { margin: 0 6px; color: var(--ink-4); }

.tag-row { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  padding: 2px 9px;
  font-size: 11.5px;
  color: var(--ink-3);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 20px;
}

/* ==========================================================================
   Gallery 网格
   ========================================================================== */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(258px, 1fr));
  gap: 28px 24px;
}

.card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform .28s cubic-bezier(.2, .7, .3, 1), box-shadow .28s, border-color .28s;
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: #dcd7ce;
}

.card__media {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #eceae5;
}
/* 覆盖整块缩略图的详情链接（独立于角标链接，避免 <a> 嵌套） */
.card__link {
  position: absolute;
  inset: 0;
  z-index: 1;
}
.card__img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .5s cubic-bezier(.2, .7, .3, 1), opacity .3s;
}
.card:hover .card__img { transform: scale(1.055); }
.card__media::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0) 55%, rgba(0,0,0,.28) 100%);
  opacity: 0;
  transition: opacity .3s;
  pointer-events: none;
}
.card:hover .card__media::after { opacity: 1; }

.card__view {
  position: absolute;
  left: 50%; top: 50%;
  z-index: 2;
  transform: translate(-50%, -50%) scale(.9);
  display: flex; align-items: center; gap: 5px;
  padding: 6px 13px;
  font-size: 12.5px;
  letter-spacing: .5px;
  color: #fff;
  background: rgba(31, 35, 40, .74);
  border-radius: 20px;
  opacity: 0;
  transition: opacity .28s, transform .28s;
  pointer-events: none;
  backdrop-filter: blur(3px);
}
.card:hover .card__view { opacity: 1; transform: translate(-50%, -50%) scale(1); }

/* 缩略图左下角图标：360 / 3D（z-index 高于 .card__link，保证可点击） */
.badges {
  position: absolute;
  left: 9px; bottom: 9px;
  z-index: 3;
  display: flex;
  gap: 6px;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 26px;
  padding: 0 9px;
  font-size: 11.5px;
  letter-spacing: .3px;
  color: #fff;
  background: rgba(31, 35, 40, .62);
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 20px;
  backdrop-filter: blur(6px);
  transition: background-color .2s, transform .2s, border-color .2s;
}
.badge em { font-style: normal; }
.badge:hover { transform: translateY(-1px); }
.badge--pano:hover  { background: rgba(47, 107, 95, .9);  border-color: rgba(255,255,255,.4); }
.badge--model:hover { background: rgba(169, 133, 69, .92); border-color: rgba(255,255,255,.4); }
.badge .icon { flex: none; }

.card__body {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 15px 16px 17px;
  border-top: 1px solid var(--line-2);
}
.card__name {
  font-family: var(--serif);
  font-size: 16px;
  letter-spacing: .8px;
  color: var(--ink);
  transition: color .2s;
}
.card:hover .card__name { color: var(--accent); }
.card__meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 8px;
  font-size: 12.5px;
  color: var(--ink-4);
}
.card__era { color: var(--ink-3); }
.card__dot { width: 3px; height: 3px; border-radius: 50%; background: var(--ink-4); opacity: .6; }
.card__sum {
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--ink-3);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 占位块（图片缺失时） */
.ph {
  display: block;
  width: 100%; height: 100%;
  background:
    linear-gradient(135deg, #e8e5df 0%, #f2f0eb 100%);
  position: relative;
}
.ph::after {
  content: "暂无图片";
  position: absolute; inset: 0;
  display: grid; place-items: center;
  font-size: 12px;
  color: var(--ink-4);
  letter-spacing: 1px;
}

/* ==========================================================================
   分页
   ========================================================================== */
.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}
.pager__link {
  min-width: 34px; height: 34px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13.5px;
  color: var(--ink-2);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-variant-numeric: tabular-nums;
  transition: all .2s;
}
.pager__link:hover { border-color: var(--accent-2); color: var(--accent); }
.pager__link.is-active {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
  font-weight: 600;
}
.pager__link.is-disabled { opacity: .4; pointer-events: none; }
.pager__ellipsis { color: var(--ink-4); padding: 0 2px; }

/* 空状态 */
.empty {
  padding: 90px 20px;
  text-align: center;
  color: var(--ink-4);
  background: var(--surface);
  border: 1px dashed var(--line);
  border-radius: var(--radius-lg);
}
.empty__title { font-family: var(--serif); font-size: 17px; color: var(--ink-2); margin-bottom: 8px; }
.empty__hint { font-size: 13.5px; margin-bottom: 20px; }
.empty__btn {
  display: inline-block;
  padding: 8px 20px;
  font-size: 13.5px;
  color: #fff;
  background: var(--accent);
  border-radius: var(--radius);
  transition: background-color .2s;
}
.empty__btn:hover { background: var(--accent-2); }

/* ==========================================================================
   文物详情页
   ========================================================================== */
.relic { display: grid; grid-template-columns: minmax(0, 1fr) 316px; gap: 40px; align-items: start; }

.relic__title {
  font-family: var(--serif);
  font-size: 28px;
  letter-spacing: 2px;
  margin-bottom: 8px;
}
.relic__sub { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13.5px; color: var(--ink-3); margin-bottom: 22px; }
.relic__sub span { position: relative; }
.relic__sub span + span::before {
  content: "";
  position: absolute; left: -8px; top: 50%;
  width: 1px; height: 11px;
  margin-top: -5.5px;
  background: var(--line);
}

/* 标签页 */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 20px; }
.tab {
  position: relative;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 18px;
  font-size: 14px;
  color: var(--ink-3);
  background: none;
  border: 0;
  transition: color .2s;
}
.tab:hover { color: var(--accent); }
.tab.is-active { color: var(--ink); font-weight: 600; }
.tab.is-active::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: -1px;
  height: 2px; background: var(--accent);
}
.tab__badge {
  min-width: 17px; height: 17px;
  padding: 0 4px;
  display: inline-grid; place-items: center;
  font-size: 10.5px; font-weight: 500;
  color: var(--ink-4);
  background: var(--line-2);
  border-radius: 20px;
}
.tab.is-active .tab__badge { color: #fff; background: var(--accent); }
.tabpanel { display: none; }
.tabpanel.is-active { display: block; animation: fadeUp .3s ease; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* 图片 slider */
.slider { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.slider__stage {
  position: relative;
  aspect-ratio: 4 / 3;
  background: #eceae5;
  overflow: hidden;
  cursor: zoom-in;
}
.slider__img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: contain;
  opacity: 0;
  transition: opacity .35s ease;
  pointer-events: none;
}
.slider__img.is-active { opacity: 1; }
.slider__nav {
  position: absolute; top: 50%;
  transform: translateY(-50%);
  width: 40px; height: 40px;
  display: grid; place-items: center;
  color: #fff;
  background: rgba(31, 35, 40, .5);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 50%;
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity .25s, background-color .25s;
}
.slider:hover .slider__nav { opacity: 1; }
.slider__nav:hover { background: rgba(31, 35, 40, .78); }
.slider__nav--prev { left: 14px; }
.slider__nav--next { right: 14px; }
/* 箭头朝向由各自的 SVG 图形决定（chevron-left / chevron-right），此处不再做旋转 */

.slider__caption {
  padding: 11px 16px;
  font-size: 13px;
  color: var(--ink-3);
  background: var(--surface-2);
  border-top: 1px solid var(--line-2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.slider__count { flex: none; font-size: 12.5px; color: var(--ink-4); font-variant-numeric: tabular-nums; }
.slider__hint { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--ink-4); }

.slider__thumbs {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  overflow-x: auto;
  border-top: 1px solid var(--line-2);
  scrollbar-width: thin;
}
.slider__thumb {
  flex: none;
  width: 74px; height: 56px;
  padding: 0;
  overflow: hidden;
  background: #eceae5;
  border: 2px solid transparent;
  border-radius: var(--radius);
  transition: border-color .2s, opacity .2s;
  opacity: .62;
}
.slider__thumb img { width: 100%; height: 100%; object-fit: cover; }
.slider__thumb:hover { opacity: .85; }
.slider__thumb.is-active { border-color: var(--accent); opacity: 1; }

/* 灯箱（点击放大） */
.lightbox {
  position: fixed; inset: 0;
  z-index: 999;
  display: none;
  place-items: center;
  background: rgba(16, 18, 20, .93);
  backdrop-filter: blur(6px);
}
.lightbox.is-open { display: grid; animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.lightbox__img {
  max-width: 92vw; max-height: 84vh;
  object-fit: contain;
  cursor: grab;
  transition: transform .18s ease;
}
.lightbox__img.is-zoom { cursor: grabbing; }
.lightbox__close, .lightbox__nav {
  position: absolute;
  display: grid; place-items: center;
  color: #fff;
  background: rgba(255, 255, 255, .1);
  border: 0;
  border-radius: 50%;
  transition: background-color .2s;
}
.lightbox__close:hover, .lightbox__nav:hover { background: rgba(255, 255, 255, .24); }
.lightbox__close { top: 22px; right: 22px; width: 42px; height: 42px; }
.lightbox__nav { top: 50%; transform: translateY(-50%); width: 48px; height: 48px; }
.lightbox__nav--prev { left: 24px; }
.lightbox__nav--next { right: 24px; }
/* 箭头朝向由各自的 SVG 图形决定（尖角朝向即方向），此处不再做旋转 */
.lightbox__bar {
  position: absolute;
  left: 50%; bottom: 24px;
  transform: translateX(-50%);
  display: flex; align-items: center; gap: 14px;
  padding: 8px 18px;
  font-size: 13px;
  color: rgba(255, 255, 255, .85);
  background: rgba(255, 255, 255, .1);
  border-radius: 30px;
  backdrop-filter: blur(8px);
  white-space: nowrap;
}

/* 侧栏信息卡 */
.relic__side { position: sticky; top: 24px; display: flex; flex-direction: column; gap: 20px; }
.info-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.info-card__head { padding: 15px 18px; background: var(--surface-2); border-bottom: 1px solid var(--line-2); }
.info-card__title { font-family: var(--serif); font-size: 14.5px; letter-spacing: 1.5px; }
.info-table { padding: 6px 18px 16px; }
.info-row { display: flex; gap: 14px; padding: 9px 0; border-bottom: 1px dashed var(--line-2); font-size: 13.5px; }
.info-row:last-child { border-bottom: 0; }
.info-row__k { flex: none; width: 60px; color: var(--ink-4); }
.info-row__v { color: var(--ink); word-break: break-word; }

.desc-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 18px; }
.desc-card__title { font-family: var(--serif); font-size: 14.5px; letter-spacing: 1.5px; margin-bottom: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--line-2); }
.desc-card__text { font-size: 13.5px; line-height: 1.85; color: var(--ink-2); white-space: pre-line; }

.act-list { padding: 6px 18px 16px; }
.act {
  display: flex; align-items: center; gap: 11px;
  padding: 12px 14px;
  margin-bottom: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: all .2s;
}
.act:last-child { margin-bottom: 0; }
.act:hover { transform: translateX(2px); }
.act__icon {
  flex: none;
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: 50%;
}
.act__t { font-size: 14px; color: var(--ink); font-weight: 500; }
.act__d { font-size: 12px; color: var(--ink-4); }
.act--pano:hover  { border-color: var(--accent-2); background: var(--accent-soft); }
.act--pano .act__icon { color: #fff; background: var(--accent); }
.act--model:hover { border-color: #c9a962; background: var(--gold-soft); }
.act--model .act__icon { color: #fff; background: var(--gold); }

.nav-row { display: flex; gap: 10px; }
.nav-row a {
  flex: 1;
  padding: 9px 12px;
  font-size: 13px;
  color: var(--ink-2);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-align: center;
  transition: all .2s;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nav-row a:hover { border-color: var(--accent-2); color: var(--accent); }

/* ==========================================================================
   查看器通用（360 / 3D）
   ========================================================================== */
.viewer-page { display: flex; flex-direction: column; gap: 18px; }
.viewer-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.viewer-head__title { font-family: var(--serif); font-size: 21px; letter-spacing: 1.5px; }

.viewer {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #16181a;
  border-radius: var(--radius-lg);
  overflow: hidden;
  user-select: none;
}
.viewer--tall { aspect-ratio: 4 / 3; }

/* 序列环视：容器随图片比例自适应，避免固定 16:9 裁切或留黑边
   —— 用 CSS 变量 --seq-pad（由 JS 按首帧真实比例写入）驱动 padding-top。
   写成变量而非内联 padding-top，是为了让 :fullscreen 规则能干净地覆盖它。 */
.viewer[data-seq] {
  aspect-ratio: auto;
  height: 0;
  padding-top: var(--seq-pad, 66.6%);
}
.viewer[data-seq].is-fitted { height: auto; padding-top: var(--seq-pad, 66.6%); }
.viewer canvas { display: block; width: 100%; height: 100%; }

.viewer__loading {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  gap: 12px;
  color: rgba(255, 255, 255, .8);
  background: #16181a;
  font-size: 13.5px;
  letter-spacing: 1px;
  transition: opacity .4s;
  z-index: 5;
}
.viewer__loading.is-hidden { opacity: 0; pointer-events: none; }
.spinner {
  width: 34px; height: 34px;
  border: 2px solid rgba(255, 255, 255, .18);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin .9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.viewer__progress { width: 190px; height: 2px; background: rgba(255,255,255,.16); border-radius: 2px; overflow: hidden; margin: 0 auto; }
.viewer__progress i { display: block; height: 100%; width: 0; background: var(--gold); transition: width .25s; }

.viewer__error {
  position: absolute; inset: 0;
  z-index: 6;
  display: none;
  flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  padding: 30px;
  text-align: center;
  color: rgba(255, 255, 255, .82);
  background: #16181a;
  font-size: 14px;
}
.viewer__error.is-show { display: flex; }
.viewer__error h3 { color: #fff; font-size: 16px; }
.viewer__error code { font-size: 12px; color: var(--gold); word-break: break-all; opacity: .85; }

.viewer__ctrl {
  position: absolute;
  z-index: 4;
  display: flex;
  gap: 6px;
  padding: 6px;
  background: rgba(20, 22, 24, .58);
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 30px;
  backdrop-filter: blur(10px);
}
.viewer__ctrl--tl { top: 14px; left: 14px; }
.viewer__ctrl--tr { top: 14px; right: 14px; }
.viewer__ctrl--bl { left: 14px; bottom: 14px; }
.vbtn {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  color: rgba(255, 255, 255, .8);
  background: none;
  border: 0;
  border-radius: 50%;
  transition: background-color .2s, color .2s;
}
.vbtn:hover { color: #fff; background: rgba(255, 255, 255, .16); }
.vbtn.is-on { color: #1f2328; background: var(--gold); }
.vbtn svg { pointer-events: none; }

.viewer__hint {
  position: absolute;
  left: 50%; bottom: 16px;
  transform: translateX(-50%);
  z-index: 4;
  padding: 6px 14px;
  font-size: 12px;
  color: rgba(255, 255, 255, .68);
  background: rgba(20, 22, 24, .5);
  border-radius: 20px;
  backdrop-filter: blur(6px);
  white-space: nowrap;
  pointer-events: none;
  transition: opacity .3s;
}
.viewer__hint.is-hidden { opacity: 0; }

/* ==========================================================
   3D 动态展示控制条（viewer3d.js）
   ========================================================== */
.dyn {
  position: absolute;
  left: 50%; bottom: 16px;
  transform: translateX(-50%);
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(520px, 84%);
  padding: 7px 12px;
  background: rgba(20, 22, 24, .62);
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 30px;
  backdrop-filter: blur(10px);
}

.dyn__play {
  flex: none;
  width: 30px; height: 30px;
  display: grid; place-items: center;
  color: #1f2328;
  background: var(--gold);
  border: 0;
  border-radius: 50%;
  transition: transform .15s, background-color .2s;
}
.dyn__play:hover { transform: scale(1.06); }
.dyn__play.is-paused { background: rgba(255, 255, 255, .82); }
.dyn__play svg { pointer-events: none; }

.dyn__time {
  flex: none;
  min-width: 84px;
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
  color: rgba(255, 255, 255, .74);
  letter-spacing: .3px;
}

.dyn__bar {
  flex: 1;
  height: 3px;
  background: rgba(255, 255, 255, .2);
  border-radius: 3px;
  cursor: pointer;
  transition: height .18s;
}
.dyn__bar:hover { height: 6px; }
.dyn__bar i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--gold);
  border-radius: 3px;
}

.dyn__spd {
  flex: none;
  width: 26px; height: 26px;
  display: grid; place-items: center;
  color: rgba(255, 255, 255, .74);
  background: none;
  border: 0;
  border-radius: 50%;
  transition: background-color .2s, color .2s;
}
.dyn__spd:hover { color: #fff; background: rgba(255, 255, 255, .16); }
.dyn__spd svg { pointer-events: none; }

.dyn__spdv {
  flex: none;
  min-width: 34px;
  text-align: right;
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
  color: var(--gold);
}

/* 环绕模式：进度条无实际意义，弱化显示 */
.dyn:not(.is-clip) .dyn__bar { cursor: default; opacity: .55; }
.dyn:not(.is-clip) .dyn__bar:hover { height: 3px; }

@media (max-width: 720px) {
  .dyn { gap: 7px; padding: 6px 9px; width: 92%; bottom: 12px; }
  .dyn__play { width: 27px; height: 27px; }
  .dyn__time { min-width: 0; font-size: 10.5px; }
  .dyn__time .dyn__dur { display: none; }
  .dyn__spdv { display: none; }
}

/* 全屏 */
/* 全屏时容器已有明确视口高度，padding-top 撑高会溢出屏幕，必须清零。
   序列模式下由 .seq__stage 撑满并让图片 contain 居中。 */
.viewer:fullscreen, .viewer:-webkit-full-screen { aspect-ratio: auto; width: 100%; height: 100%; border-radius: 0; }
.viewer[data-seq]:fullscreen,
.viewer[data-seq]:-webkit-full-screen {
  height: 100%;
  padding-top: 0;
  aspect-ratio: auto;
}

/* ==========================================================
   序列环视（panoseq.js）—— 一组环拍照片
   ========================================================== */
.viewer:focus { outline: none; }
.viewer:focus-visible { box-shadow: 0 0 0 2px var(--gold); }

.seq__stage {
  position: absolute; inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #16181a;
  cursor: grab;
  touch-action: pan-y;
}
.viewer.is-grabbing .seq__stage { cursor: grabbing; }

/* 图片自适应：显式用 min() 双约束，保证任意比例都完整可见且不变形 */
.seq__img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  opacity: 0;
  transition: opacity .22s ease;
  will-change: transform;
  -webkit-user-drag: none;
  user-select: none;
}
.seq__img.is-ready { opacity: 1; }

.seq__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 4;
  width: 46px; height: 46px;
  display: grid; place-items: center;
  color: rgba(255, 255, 255, .86);
  background: rgba(20, 22, 24, .5);
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 50%;
  backdrop-filter: blur(8px);
  transition: background-color .2s, color .2s, opacity .2s;
}
.seq__arrow:hover { color: #1f2328; background: var(--gold); border-color: var(--gold); }
.seq__arrow:active { transform: translateY(-50%) scale(.94); }
.seq__arrow svg { pointer-events: none; }
.seq__arrow--l { left: 16px; }
.seq__arrow--r { right: 16px; }

.seq__bar {
  position: absolute;
  left: 50%; bottom: 18px;
  transform: translateX(-50%);
  z-index: 4;
  width: min(460px, 62%);
  height: 3px;
  background: rgba(255, 255, 255, .18);
  border-radius: 3px;
  cursor: pointer;
  transition: height .18s;
}
.seq__bar:hover { height: 6px; }
.seq__bar i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--gold);
  border-radius: 3px;
}

.seq__counter {
  position: absolute;
  right: 18px; bottom: 14px;
  z-index: 4;
  padding: 4px 10px;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  letter-spacing: .5px;
  color: rgba(255, 255, 255, .8);
  background: rgba(20, 22, 24, .55);
  border-radius: 20px;
  pointer-events: none;
}

@media (max-width: 720px) {
  .seq__arrow { width: 38px; height: 38px; }
  .seq__arrow--l { left: 9px; }
  .seq__arrow--r { right: 9px; }
  .seq__bar { width: 78%; bottom: 14px; }
  .seq__counter { right: 10px; bottom: 10px; font-size: 11px; }
  /* 底部控件与进度条避让 */
  .viewer__ctrl--tr { top: 10px; right: 10px; padding: 5px; }
  .vbtn { width: 30px; height: 30px; }
}

/* 查看器下方图例 */
.viewer-legend { display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: 13px; color: var(--ink-3); }
.viewer-legend b { color: var(--ink); font-weight: 600; }

/* 选择器（多文物切换） */
.picker { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: thin; }
.picker__item {
  flex: none;
  width: 128px;
  padding: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  text-align: left;
  transition: border-color .2s, transform .2s;
}
.picker__item:hover { transform: translateY(-2px); border-color: var(--accent-2); }
.picker__item.is-active { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.picker__thumb { width: 100%; aspect-ratio: 4/3; object-fit: cover; background: #eceae5; }
.picker__name {
  display: block;
  padding: 7px 9px;
  font-size: 12px;
  color: var(--ink-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border-top: 1px solid var(--line-2);
}
.picker__item.is-active .picker__name { color: var(--accent); font-weight: 600; }

/* ==========================================================================
   关于页
   ========================================================================== */
.prose { max-width: 780px; }
.prose h2 { font-family: var(--serif); font-size: 19px; letter-spacing: 1.2px; margin: 32px 0 12px; }
.prose h2:first-child { margin-top: 0; }
.prose p { font-size: 14.5px; line-height: 1.9; color: var(--ink-2); margin-bottom: 12px; }
.prose ul { margin: 0 0 14px; padding-left: 4px; }
.prose li { position: relative; padding-left: 18px; font-size: 14px; line-height: 1.9; color: var(--ink-2); }
.prose li::before {
  content: "";
  position: absolute; left: 3px; top: 12px;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--accent-2);
}
.prose code {
  padding: 2px 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 3px;
}
.doc-table { width: 100%; border-collapse: collapse; margin-bottom: 20px; font-size: 13.5px; }
.doc-table th, .doc-table td { padding: 9px 12px; text-align: left; border: 1px solid var(--line); vertical-align: top; }
.doc-table th { width: 168px; background: var(--surface-2); color: var(--ink); font-weight: 600; }
.doc-table td { color: var(--ink-2); }
.doc-table td code { font-size: 12.5px; color: #8a5a2f; background: var(--gold-soft); }

/* ==========================================================================
   页脚
   ========================================================================== */
.footer { border-top: 1px solid var(--line); background: var(--surface); }
.footer__inner { max-width: var(--maxw); margin: 0 auto; padding: 26px 32px; text-align: center; }
.footer__text { font-size: 13px; color: var(--ink-3); margin-bottom: 6px; }
.footer__copy { font-size: 12px; color: var(--ink-4); letter-spacing: .5px; }

/* ==========================================================================
   响应式
   ========================================================================== */
@media (max-width: 1200px) {
  .relic { grid-template-columns: minmax(0, 1fr); }
  .relic__side { position: static; }
}
@media (max-width: 1024px) {
  :root { --banner-h: auto; }
  .banner__inner { flex-direction: column; align-items: flex-start; gap: 14px; padding: 20px 22px; }
  .brand__title { font-size: 22px; letter-spacing: 2px; }
  .menu { width: 100%; }
  .menu__list { flex-wrap: wrap; gap: 2px; }
  .menu__link { padding: 7px 12px; font-size: 13.5px; }
  .layout { grid-template-columns: minmax(0, 1fr); gap: 0; padding: 0 22px; }
  .sidebar {
    position: static;
    max-height: none;
    padding: 22px 0 0;
  }
  .sidebar__inner {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 16px 18px;
  }
  .sidebar__title { margin-bottom: 12px; }
  .nav { display: flex; flex-wrap: wrap; gap: 6px; border-top: 0; }
  .nav__item { border-bottom: 0; }
  .nav__item--sep { margin-top: 0; padding-top: 0; border-top: 0; }
  .nav__link {
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 6px 13px;
    font-size: 13px;
  }
  .nav__link.is-active { border-color: var(--accent); border-left-color: var(--accent); }
  .sidebar__stats { margin-top: 16px; }
  .content { padding: 24px 0 48px; }
  .gallery { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 22px 18px; }
}
@media (max-width: 720px) {
  .layout { padding: 0 16px; }
  .banner__inner { padding: 16px; }
  .brand__slogan { display: none; }
  .gallery { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px 12px; }
  .card__body { padding: 12px 12px 14px; }
  .card__name { font-size: 14.5px; }
  .card__sum { display: none; }
  /* 窄屏下角标只显示图标，避免文字换行 */
  .badge { padding: 0 7px; }
  .badge em { display: none; }
  .badges { left: 7px; bottom: 7px; gap: 5px; }
  .relic__title { font-size: 22px; }
  .viewer:not([data-seq]) { aspect-ratio: 4 / 3; }
  .viewer__hint { display: none; }
  .page-head__title { font-size: 19px; }
  .info-row__k { width: 52px; }
  .doc-table th { width: 108px; }
  .slider__nav { width: 34px; height: 34px; }
  .slider__nav--prev { left: 8px; }
  .slider__nav--next { right: 8px; }
  .slider__hint { display: none; }
  .picker__item { width: 108px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
