:root {
  --red: #9f1d24;
  --red-bright: #c6403e;
  --red-dark: #31090e;
  --wine: #570f16;
  --gold: #e4bc79;
  --cream: #f5ede1;
  --white: #fff;
  --serif: 'Noto Serif SC', 'Songti SC', SimSun, serif;
  --sans: 'Noto Sans SC', 'Microsoft YaHei', sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { color: var(--white); background: var(--red-dark); font-family: var(--sans); -webkit-font-smoothing: antialiased; }
button, input { font: inherit; }
button { color: inherit; cursor: pointer; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
button, a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; }
::selection { color: var(--red-dark); background: var(--gold); }
[hidden] { display: none !important; }
.svg-defs { position: absolute; width: 0; height: 0; overflow: hidden; }

.hall-backdrop { position: fixed; inset: -20px; background: url('assets/red-hall-bg.png') center / cover no-repeat; filter: blur(5px) saturate(.75); transform: scale(1.035); }
.hall-overlay { position: fixed; inset: 0; background: linear-gradient(105deg, rgba(46,3,8,.94) 0%, rgba(91,8,16,.78) 42%, rgba(40,4,8,.64) 100%), linear-gradient(0deg, rgba(24,3,6,.94) 0%, rgba(76,8,14,.18) 65%, rgba(26,3,6,.72) 100%); }
.hall-overlay::after { content: ''; position: absolute; inset: 0; opacity: .17; background-image: repeating-linear-gradient(90deg, transparent 0, transparent calc(25% - 1px), rgba(255,255,255,.12) 25%); pointer-events: none; }
.hall-shell { position: relative; z-index: 1; min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; }
.hall-header { height: 100px; margin: 0 4.5vw; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid rgba(255,255,255,.2); }
.hall-brand { display: flex; align-items: center; gap: 13px; }
.brand-seal { width: 43px; height: 43px; color: var(--gold); }
.brand-seal svg { width: 100%; height: 100%; stroke-width: 1; }
.brand-seal .seal-star { fill: currentColor; stroke: none; }
.hall-brand > span:last-child { display: flex; flex-direction: column; gap: 4px; }
.hall-brand strong { font-family: var(--serif); font-size: 22px; letter-spacing: .22em; font-weight: 600; }
.hall-brand small { color: rgba(255,255,255,.57); font-size: 9px; letter-spacing: .16em; }
.header-right { display: flex; align-items: center; gap: 29px; }
.header-right > span { color: var(--gold); font-size: 11px; letter-spacing: .18em; }
.manage-button { display: flex; align-items: center; gap: 7px; padding: 9px 0; border: 0; background: transparent; color: rgba(255,255,255,.64); font-size: 11px; }
.manage-button svg { width: 17px; height: 17px; }
.manage-button:hover { color: var(--white); }

.hall-main { flex: 1; min-height: 700px; display: flex; flex-direction: column; justify-content: space-between; padding-top: clamp(55px, 8vh, 100px); }
.hall-intro { padding: 0 8vw; }
.hall-eyebrow { display: flex; align-items: center; gap: 12px; margin: 0 0 20px; color: var(--gold); font-size: 11px; letter-spacing: .2em; }
.hall-eyebrow span { width: 30px; height: 1px; background: var(--gold); }
.hall-intro h1 { margin: 0; font-family: var(--serif); font-size: 56px; font-size: clamp(43px, 4.4vw, 67px); font-weight: 600; line-height: 1.42; letter-spacing: .12em; text-shadow: 0 3px 25px rgba(0,0,0,.25); }
.hall-description { margin: 20px 0 0; color: rgba(255,255,255,.62); font-size: 13px; line-height: 1.9; letter-spacing: .06em; }

.scene-dock { margin-top: 60px; padding: 25px 4.5vw 19px; background: linear-gradient(90deg, rgba(29,3,7,.77), rgba(74,7,13,.73), rgba(29,3,7,.8)); border-top: 1px solid rgba(228,188,121,.26); border-bottom: 1px solid rgba(228,188,121,.15); backdrop-filter: blur(15px); }
.scene-toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 19px; }
.scene-heading { display: flex; align-items: baseline; gap: 17px; }
.scene-heading h2 { margin: 0; font-family: var(--serif); font-size: 18px; font-weight: 500; letter-spacing: .12em; }
.scene-heading > span { color: rgba(255,255,255,.43); font-size: 10px; }
.scene-heading b { color: var(--gold); font-weight: 500; }
.scene-controls { display: flex; align-items: center; gap: 8px; }
.scene-controls > span { margin-right: 9px; color: rgba(255,255,255,.48); font-size: 10px; }
.scene-controls button { width: 30px; height: 30px; display: grid; place-items: center; padding: 0; border: 1px solid rgba(255,255,255,.25); background: transparent; }
.scene-controls button:hover:not(:disabled) { border-color: var(--gold); color: var(--gold); }
.scene-controls button:disabled { opacity: .25; cursor: default; }
.scene-controls svg { width: 14px; height: 14px; }
.scene-controls .flip { transform: rotate(180deg); }
.scene-list { display: grid; grid-auto-flow: column; grid-auto-columns: 230px; grid-auto-columns: clamp(180px, 16.2vw, 250px); justify-content: center; gap: clamp(12px, 1.35vw, 22px); overflow-x: auto; padding: 3px 3px 10px; scroll-snap-type: x mandatory; scrollbar-width: thin; scrollbar-color: rgba(228,188,121,.4) transparent; }
.scene-list.is-scrollable { justify-content: start; }
.scene-card { position: relative; min-width: 0; display: block; overflow: hidden; border: 2px solid rgba(255,255,255,.88); background: #2b1113; scroll-snap-align: start; box-shadow: 0 8px 20px rgba(0,0,0,.2); transition: border-color .2s, transform .2s, box-shadow .2s; }
.scene-card:hover, .scene-card:focus-visible { border-color: var(--gold); transform: translateY(-4px); box-shadow: 0 11px 27px rgba(0,0,0,.35); }
.scene-photo { position: relative; aspect-ratio: 1.52 / 1; overflow: hidden; }
.scene-photo::after { content: ''; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(48,3,8,.46), transparent 55%); }
.scene-photo img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s, filter .3s; }
.scene-card:hover .scene-photo img { transform: scale(1.05); filter: saturate(1.15); }
.scene-number { position: absolute; z-index: 1; top: 9px; left: 10px; font-size: 9px; letter-spacing: .08em; text-shadow: 0 1px 4px #000; }
.scene-degree { position: absolute; z-index: 1; top: 8px; right: 8px; padding: 3px 5px; color: #fff4de; background: rgba(123,18,23,.82); font-size: 8px; letter-spacing: .04em; }
.scene-caption { min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 11px 12px; background: linear-gradient(100deg, rgba(88,10,16,.97), rgba(48,6,10,.98)); }
.scene-caption strong { font-family: var(--serif); font-size: clamp(12px, .95vw, 14px); line-height: 1.55; font-weight: 500; letter-spacing: .025em; }
.scene-caption svg { flex: none; width: 16px; height: 16px; color: var(--gold); }
.scene-footnote { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-top: 12px; color: rgba(255,255,255,.4); font-size: 9px; letter-spacing: .08em; }
.scene-footnote > span:first-child { display: flex; align-items: center; gap: 7px; color: rgba(255,255,255,.56); }
.scene-footnote i { width: 5px; height: 5px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 9px rgba(228,188,121,.55); }
.scene-footnote p { margin: 0; }
.empty-scenes { grid-column: 1 / -1; width: min(90vw, 600px); padding: 40px 20px; text-align: center; color: rgba(255,255,255,.65); font-size: 13px; }

body.viewer-open { overflow: hidden; }
.panorama-viewer { position: fixed; z-index: 50; inset: 0; display: flex; flex-direction: column; background: #160306; }
.viewer-header { position: absolute; z-index: 2; top: 0; left: 0; right: 0; height: 66px; display: flex; align-items: center; padding: 0 25px; background: transparent; text-shadow: 0 1px 5px rgba(0,0,0,.8); pointer-events: none; }
.viewer-logo { position: absolute; top: 7px; left: 20px; width: 52px; height: 52px; object-fit: contain; background: transparent; filter: drop-shadow(0 2px 4px rgba(0,0,0,.3)); pointer-events: none; }
.viewer-back { justify-self: start; display: inline-flex; margin-left: 64px; pointer-events: auto; align-items: center; gap: 10px; padding: 9px 14px 9px 10px; border: 0; background: transparent; color: white; font-size: 12px; }
.viewer-back:hover, .viewer-back:focus, .viewer-back:focus-visible, .viewer-back:active { color: #fff; border: 0; outline: none; background: transparent; }
.viewer-back svg { width: 16px; height: 16px; }
.viewer-back .flip { transform: rotate(180deg); }
#panorama-frame { position: relative; z-index: 0; flex: 1; width: 100%; height: 100vh; height: 100svh; border: 0; background: #140407; }
.viewer-loading { position: absolute; z-index: 1; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; color: rgba(255,255,255,.6); background: #23070b; }
.viewer-loading span { width: 37px; height: 37px; border: 2px solid rgba(228,188,121,.2); border-top-color: var(--gold); border-radius: 50%; animation: viewerSpin .9s linear infinite; }
.viewer-loading p { margin: 0; font-size: 12px; letter-spacing: .08em; }
@keyframes viewerSpin { to { transform: rotate(360deg); } }

.manager-dialog { width: min(800px, calc(100% - 32px)); max-height: min(740px, calc(100svh - 40px)); padding: 0; border: 0; color: #33282a; background: #f5f1eb; box-shadow: 0 30px 100px rgba(0,0,0,.4); }
dialog::backdrop { background: rgba(22,2,5,.8); backdrop-filter: blur(5px); }
.manager-shell { display: flex; flex-direction: column; max-height: min(740px, calc(100svh - 40px)); }
.manager-header { flex: none; display: flex; align-items: center; justify-content: space-between; padding: 26px 30px 22px; border-bottom: 1px solid #ded6cf; }
.manager-header p { margin: 0 0 6px; color: #9f1d24; font-size: 10px; letter-spacing: .16em; }
.manager-header h2 { margin: 0; font-family: var(--serif); font-size: 26px; }
.icon-button { width: 37px; height: 37px; display: grid; place-items: center; border: 1px solid #d8cec6; background: transparent; }
.icon-button:hover { background: #e9e1d9; }
.manager-body { overflow: auto; }
.manager-list-panel, .editor-panel { padding: 23px 30px 29px; }
.manager-list-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 15px; color: #817577; font-size: 12px; }
.manager-list-top b { color: var(--red); }
.small-button { display: inline-flex; align-items: center; gap: 7px; padding: 9px 13px; border: 0; background: var(--red); color: white; font-size: 11px; }
.small-button:hover { background: #bd2c32; }
.small-button svg { width: 14px; height: 14px; }
.manager-list { display: grid; gap: 8px; }
.manager-item { display: grid; grid-template-columns: 76px 1fr auto; align-items: center; gap: 15px; padding: 9px; background: #eae3dc; }
.manager-item img { width: 76px; height: 54px; object-fit: cover; background: #cabeb4; }
.manager-item-copy { min-width: 0; }
.manager-item-copy strong { display: block; margin-bottom: 5px; font-family: var(--serif); font-size: 14px; }
.manager-item-copy span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #8c7e7b; font-size: 9px; }
.manager-item-actions { display: flex; gap: 3px; }
.manager-item-actions button { width: 34px; height: 34px; display: grid; place-items: center; border: 0; background: transparent; color: #776a68; }
.manager-item-actions button:hover { color: var(--red); background: #dfd5cd; }
.manager-item-actions svg { width: 16px; height: 16px; }
.reset-button { display: block; margin: 19px auto 0; padding: 5px; border: 0; border-bottom: 1px solid #c9bdb5; background: transparent; color: #887a77; font-size: 10px; }
.reset-button:hover { color: var(--red); }
.editor-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 25px; }
.editor-heading h3 { margin: 0; font-family: var(--serif); font-size: 21px; }
.back-button { padding: 0; border: 0; background: transparent; color: #8d7c78; font-size: 11px; }
.back-button:hover { color: var(--red); }
#scene-form { display: grid; gap: 18px; }
#scene-form label { display: grid; gap: 8px; color: #655554; font-size: 11px; }
#scene-form input { width: 100%; height: 44px; padding: 0 12px; border: 1px solid #d4c8bf; border-radius: 0; outline: none; background: #fdfbf8; color: #33282a; font-size: 12px; }
#scene-form input:focus { border-color: var(--red); box-shadow: 0 0 0 1px var(--red); }
#scene-form label small { color: #998b86; font-size: 9px; }
.save-button { justify-self: start; min-height: 46px; display: inline-flex; align-items: center; gap: 25px; padding: 0 22px; border: 0; background: var(--red); color: white; font-size: 12px; }
.save-button:hover { background: #bd2c32; }
.save-button svg { width: 16px; height: 16px; }
.confirm-dialog { width: min(390px, calc(100% - 32px)); padding: 0; border: 0; background: #f5f1eb; color: #33282a; }
.confirm-content { padding: 35px; text-align: center; }
.confirm-icon { width: 48px; height: 48px; display: grid; place-items: center; margin: 0 auto 18px; color: var(--red); background: #ead7d3; border-radius: 50%; }
.confirm-content h2 { margin: 0 0 12px; font-family: var(--serif); font-size: 23px; }
.confirm-content p { margin: 0 0 25px; color: #8a7c78; font-size: 11px; line-height: 1.8; }
.confirm-content > div { display: flex; justify-content: center; gap: 10px; }
.cancel-button, .danger-button { padding: 11px 19px; font-size: 12px; }
.cancel-button { border: 1px solid #cbbfb7; background: transparent; }
.danger-button { border: 1px solid var(--red); background: var(--red); color: white; }
.toast { position: fixed; z-index: 100; left: 50%; bottom: 28px; padding: 12px 20px; color: white; background: #4d1117; border: 1px solid rgba(228,188,121,.35); box-shadow: 0 10px 35px rgba(0,0,0,.3); font-size: 12px; opacity: 0; pointer-events: none; transform: translate(-50%, 12px); transition: opacity .25s, transform .25s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (min-width: 1500px) {
  .hall-main { min-height: 790px; }
  .scene-list { grid-auto-columns: 240px; }
}

@media (max-width: 900px) {
  .hall-header { height: 86px; margin: 0 25px; }
  .hall-main { min-height: 680px; padding-top: 55px; }
  .hall-intro { padding: 0 40px; }
  .scene-dock { padding-left: 25px; padding-right: 25px; }
  .scene-list { grid-auto-columns: 210px; justify-content: start; }
}

@media (max-width: 600px) {
  .hall-backdrop { background-position: 43% center; filter: blur(4px) saturate(.8); }
  .hall-header { height: 77px; margin: 0 19px; }
  .hall-brand { gap: 9px; }
  .brand-seal { width: 35px; height: 35px; }
  .hall-brand strong { font-size: 17px; }
  .hall-brand small { font-size: 7px; }
  .header-right > span { display: none; }
  .manage-button span { display: none; }
  .manage-button svg { width: 20px; height: 20px; }
  .hall-main { min-height: calc(100svh - 77px); padding-top: 45px; }
  .hall-intro { padding: 0 25px; }
  .hall-eyebrow { margin-bottom: 16px; font-size: 9px; letter-spacing: .13em; }
  .hall-eyebrow span { width: 20px; }
  .hall-intro h1 { font-size: 42px; font-size: clamp(37px, 10.8vw, 49px); line-height: 1.45; }
  .hall-description { margin-top: 17px; font-size: 11px; }
  .scene-dock { margin-top: 45px; padding: 20px 18px 15px; }
  .scene-toolbar { margin-bottom: 15px; }
  .scene-heading { gap: 10px; }
  .scene-heading h2 { font-size: 16px; }
  .scene-heading > span { font-size: 9px; }
  .scene-controls > span { display: none; }
  .scene-controls button { width: 28px; height: 28px; }
  .scene-list { grid-auto-columns: 68vw; grid-auto-columns: min(68vw, 240px); gap: 13px; margin-right: -18px; padding-right: 25px; }
  .scene-caption { min-height: 65px; }
  .scene-caption strong { font-size: 13px; }
  .scene-footnote { justify-content: space-between; font-size: 8px; }
  .scene-footnote > span:last-child { display: none; }
  .viewer-header { height: 59px; padding: 0 12px; }
  .viewer-logo { top: 8px; left: 12px; width: 43px; height: 43px; }
  .viewer-back { gap: 5px; margin-left: 50px; padding: 8px; font-size: 11px; }
  #panorama-frame { height: 100svh; }
  .viewer-loading { inset: 0; }
  .manager-dialog { width: 100%; max-height: 92svh; margin: auto 0 0; }
  .manager-shell { max-height: 92svh; }
  .manager-header { padding: 21px 19px 18px; }
  .manager-header h2 { font-size: 23px; }
  .manager-list-panel, .editor-panel { padding: 19px; }
  .manager-item { grid-template-columns: 62px 1fr auto; gap: 10px; }
  .manager-item img { width: 62px; height: 49px; }
  .manager-item-actions { flex-direction: column; }
  .manager-item-actions button { width: 28px; height: 27px; }
  .toast { bottom: 20px; white-space: nowrap; }
}

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