:root {
    --temple-red: #7e0c0c;
    --temple-dark-red: #430505;
    --gold: #d8b15d;
    --gold-light: #f2d992;
}

* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; }
body { color: #fff; background: #160b08; font-family: "Noto Serif TC", "Microsoft JhengHei", serif; }
button, a { font: inherit; }
a { color: inherit; text-decoration: none; }

.tour-shell, #panorama { position: relative; width: 100%; height: 100%; }
#panorama { background: #160b08; }

.tour-header {
    position: fixed;
    z-index: 20;
    top: 0;
    right: 0;
    left: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 82px;
    padding: 12px clamp(18px, 4vw, 64px);
    pointer-events: none;
    background: linear-gradient(180deg, rgba(24, 7, 3, .88), rgba(24, 7, 3, .38), transparent);
}
.tour-header a { pointer-events: auto; }
.tour-brand { display: flex; align-items: center; gap: 10px; }
.logo-seal {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 27px;
    height: 45px;
    border-radius: 12px;
    background: #b31317;
    font-size: 11px;
    line-height: 14px;
    text-align: center;
    box-shadow: 0 0 20px rgba(214, 29, 24, .4);
}
.logo-text { display: flex; flex-direction: column; }
.logo-text strong { color: var(--gold-light); font-size: 27px; font-weight: 900; letter-spacing: .9rem; line-height: 1.1; text-shadow: 0 2px 8px #000; }
.logo-text small { margin-top: 5px; color: rgba(255,255,255,.62); font-size: 8px; letter-spacing: 2px; }
.tour-exit {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 10px 15px;
    border: 1px solid rgba(242,217,146,.5);
    color: var(--gold-light);
    background: rgba(34,7,5,.58);
    font-size: 12px;
    letter-spacing: 2px;
    backdrop-filter: blur(8px);
    transition: background .25s, border-color .25s;
}
.tour-exit:hover { border-color: var(--gold-light); background: rgba(126,12,12,.9); }

.location-card {
    position: fixed;
    z-index: 18;
    top: 105px;
    left: clamp(18px, 4vw, 64px);
    min-width: 170px;
    padding: 15px 20px 16px;
    border-left: 3px solid var(--gold);
    background: linear-gradient(110deg, rgba(45,5,3,.9), rgba(30,7,5,.62));
    box-shadow: 0 12px 35px rgba(0,0,0,.28);
    pointer-events: none;
    backdrop-filter: blur(10px);
}
.location-kicker { display: block; margin-bottom: 7px; color: var(--gold-light); font-size: 9px; letter-spacing: 3px; }
.location-row { display: flex; align-items: center; gap: 10px; }
.location-row i { color: var(--gold); font-size: 15px; }
.location-row h1 { margin: 0; font-size: 25px; font-weight: 800; letter-spacing: 5px; }

.tour-hint {
    position: fixed;
    z-index: 18;
    bottom: max(22px, env(safe-area-inset-bottom));
    left: 50%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 12px 11px 16px;
    color: rgba(255,255,255,.9);
    background: rgba(31,8,5,.7);
    border: 1px solid rgba(216,177,93,.3);
    font-size: 12px;
    letter-spacing: 2px;
    transform: translateX(-50%);
    backdrop-filter: blur(8px);
    transition: opacity .35s, transform .35s;
}
.tour-hint.is-hidden { opacity: 0; transform: translate(-50%, 15px); pointer-events: none; }
.tour-hint > i { color: var(--gold-light); }
.tour-hint button { display: grid; place-items: center; width: 25px; height: 25px; padding: 0; border: 0; color: #fff; background: transparent; font-size: 17px; cursor: pointer; }
.mobile-hint { display: none; }

.loading-screen { position: fixed; z-index: 40; inset: 0; display: grid; place-content: center; justify-items: center; background: radial-gradient(circle, #67100c, #250302 70%); transition: opacity .55s, visibility .55s; }
.loading-screen.is-hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.loading-emblem { display: grid; place-items: center; width: 105px; height: 105px; border: 1px solid var(--gold); border-radius: 50%; color: var(--gold-light); font-size: 20px; font-weight: 800; letter-spacing: 5px; box-shadow: 0 0 0 8px rgba(216,177,93,.08); }
.loading-line { width: 140px; height: 1px; margin-top: 35px; overflow: hidden; background: rgba(242,217,146,.2); }
.loading-line span { display: block; width: 45%; height: 100%; background: var(--gold-light); animation: loading 1.2s ease-in-out infinite; }
.loading-screen p { margin-top: 13px; color: rgba(255,255,255,.65); font-size: 11px; letter-spacing: 4px; }
.loading-screen.is-error .loading-line { display: none; }
.loading-screen.is-error p { max-width: 300px; color: #fff; font-size: 14px; line-height: 1.8; letter-spacing: 2px; text-align: center; }
@keyframes loading { from { transform: translateX(-110%); } to { transform: translateX(330%); } }

/* Pannellum 控制按鈕：延續網站深紅與金色配色 */
.pnlm-controls-container { z-index: 17; }
.pnlm-controls { border: 1px solid rgba(216,177,93,.42) !important; border-radius: 0 !important; background-color: rgba(49,8,5,.82) !important; box-shadow: 0 8px 25px rgba(0,0,0,.25) !important; }
.pnlm-control { border-bottom-color: rgba(216,177,93,.3) !important; filter: sepia(1) saturate(.75) brightness(1.6); }
.pnlm-zoom-controls { left: clamp(18px, 4vw, 64px) !important; bottom: 24px !important; }
.pnlm-fullscreen-toggle-button { right: clamp(18px, 4vw, 64px) !important; bottom: 24px !important; left: auto !important; }
.pnlm-load-box, .pnlm-about-msg, .pnlm-title-box { display: none !important; }

/* 場景箭頭熱點 */
[class*="scene-hotspot-"] { width: 66px !important; height: 66px !important; margin: -33px 0 0 -33px !important; border: 1px solid rgba(242,217,146,.9); border-radius: 50%; background: rgba(88,10,7,.78); box-shadow: 0 0 0 8px rgba(126,12,12,.28), 0 8px 28px rgba(0,0,0,.48); transition: transform .2s, background .2s; }
[class*="scene-hotspot-"]::before { content: ""; position: absolute; top: 21px; left: 19px; width: 25px; height: 17px; background: var(--gold-light); clip-path: polygon(50% 0, 100% 55%, 67% 55%, 67% 100%, 33% 100%, 33% 55%, 0 55%); }
.scene-hotspot-left::before { transform: rotate(-90deg); }
.scene-hotspot-right::before { transform: rotate(90deg); }
.scene-hotspot-down::before { transform: rotate(180deg); }
[class*="scene-hotspot-"]:hover, [class*="scene-hotspot-"]:focus { transform: scale(1.1); background: rgba(126,12,12,.96); }
.pnlm-tooltip span { min-width: 100px; margin-bottom: 8px !important; padding: 8px 12px !important; border-radius: 0 !important; color: var(--gold-light) !important; background: rgba(36,6,4,.9) !important; font-family: "Noto Serif TC", "Microsoft JhengHei", serif !important; font-size: 13px !important; letter-spacing: 2px; white-space: nowrap; }
.pnlm-tooltip span::after { border-top-color: rgba(36,6,4,.9) !important; }

@media (max-width: 767px) {
    .tour-header { min-height: 70px; padding: 10px 16px; }
    .logo-text strong { font-size: 21px; letter-spacing: .55rem; }
    .logo-text small { font-size: 7px; letter-spacing: 1.3px; }
    .tour-exit { width: 42px; height: 42px; justify-content: center; padding: 0; }
    .tour-exit span { display: none; }
    .location-card { top: 86px; left: 16px; min-width: 145px; padding: 11px 15px 12px; }
    .location-kicker { margin-bottom: 5px; font-size: 8px; }
    .location-row h1 { font-size: 21px; }
    .desktop-hint { display: none; }
    .mobile-hint { display: inline; }
    .tour-hint { bottom: max(17px, env(safe-area-inset-bottom)); max-width: calc(100% - 150px); white-space: nowrap; font-size: 10px; letter-spacing: 1px; }
    .pnlm-zoom-controls { left: 16px !important; bottom: 17px !important; }
    .pnlm-fullscreen-toggle-button { right: 16px !important; bottom: 17px !important; }
    [class*="scene-hotspot-"] { width: 58px !important; height: 58px !important; margin: -29px 0 0 -29px !important; }
    [class*="scene-hotspot-"]::before { top: 18px; left: 17px; width: 22px; height: 16px; }
}

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