html,
body {
    width: 100%;
    height: 100%;
    margin: 0;
    overflow: hidden;
    background: #050505;
    color: #fff;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

#viewer {
    width: 100vw;
    height: 100vh;
    height: 100dvh;
}

.tour-status {
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 20;
    max-width: min(320px, calc(100vw - 32px));
    padding: 10px 14px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 8px;
    background: rgba(16, 18, 22, 0.72);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    pointer-events: none;
}

.tour-title {
    margin: 0 0 3px;
    font-size: 15px;
    font-weight: 600;
}

.tour-place {
    margin: 0;
    color: #d9e5ff;
    font-size: 13px;
}

.loader {
    position: fixed;
    inset: 0;
    z-index: 40;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: #050505;
    transition: opacity 240ms ease;
}

.loader.is-hidden {
    opacity: 0;
    pointer-events: none;
}

.loader-spinner {
    width: 38px;
    height: 38px;
    border: 3px solid rgba(255, 255, 255, 0.22);
    border-top-color: #73a8ff;
    border-radius: 50%;
    animation: spin 900ms linear infinite;
}

.loader-text {
    color: rgba(255, 255, 255, 0.74);
    font-size: 14px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.psv-navbar {
    background: rgba(24, 26, 30, 0.76) !important;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.tour-marker-dot {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: 2px solid rgba(255, 255, 255, 0.92);
    border-radius: 50% 50% 50% 0;
    background: #d93f36;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.34);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    transform: rotate(-45deg);
}

.tour-marker-dot > span {
    transform: rotate(45deg);
}

.tour-link-arrow {
    position: relative;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border: 2px solid rgba(255, 255, 255, 0.92);
    border-radius: 50%;
    background: rgba(29, 116, 245, 0.86);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.38);
}

.tour-link-arrow::before {
    content: "";
    position: absolute;
    inset: 7px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.34);
}

.tour-link-arrow > span {
    width: 14px;
    height: 14px;
    border-top: 4px solid #fff;
    border-right: 4px solid #fff;
    transform: rotate(45deg);
}

.marker-content {
    color: #f4f6fb;
    line-height: 1.65;
}

.marker-content h2 {
    margin: 0 0 10px;
    font-size: 18px;
    font-weight: 700;
}

.marker-content p {
    margin: 0 0 12px;
    color: rgba(244, 246, 251, 0.82);
    font-size: 14px;
}

.tour-picker {
    position: fixed;
    right: 16px;
    bottom: 72px;
    z-index: 30;
    width: min(380px, calc(100vw - 32px));
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 8px;
    background: rgba(16, 18, 22, 0.86);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.32);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.tour-picker.is-hidden {
    display: none;
}

.tour-picker h2 {
    margin: 0 0 8px;
    font-size: 15px;
    font-weight: 700;
}

.tour-picker p {
    margin: 0 0 10px;
    color: rgba(255, 255, 255, 0.72);
    font-size: 13px;
    line-height: 1.55;
}

.tour-picker-output {
    width: 100%;
    min-height: 132px;
    box-sizing: border-box;
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.35);
    color: #f4f6fb;
    font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    resize: vertical;
}

.tour-picker-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.tour-picker button {
    height: 34px;
    padding: 0 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    cursor: pointer;
}

.tour-picker button:hover {
    background: rgba(255, 255, 255, 0.14);
}

.tour-map {
    position: fixed;
    right: 16px;
    top: 16px;
    z-index: 18;
    width: min(360px, calc(100vw - 32px));
    height: 230px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 8px;
    background: #12161c;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.32);
    transition: width 180ms ease, height 180ms ease, box-shadow 180ms ease;
}

.tour-map[data-size="small"] {
    width: 190px;
    height: 132px;
}

.tour-map.is-large,
.tour-map[data-size="large"] {
    width: min(560px, calc(100vw - 32px));
    height: min(380px, calc(100dvh - 32px));
}

.tour-map.is-dragging {
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.42);
}

.tour-map[hidden] {
    display: none;
}

.tour-map-controls {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 1000;
    display: flex;
    gap: 6px;
    pointer-events: auto;
}

.tour-map-control {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 6px;
    background: rgba(17, 20, 26, 0.8);
    color: #fff;
    cursor: pointer;
}

.tour-map-size-control {
    width: auto;
    min-width: 72px;
    gap: 6px;
    padding: 0 9px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.tour-map-control:hover {
    background: rgba(32, 38, 48, 0.92);
}

.tour-map-control:focus-visible {
    outline: 2px solid #73a8ff;
    outline-offset: 2px;
}

.tour-map-drag-handle {
    cursor: grab;
    touch-action: none;
}

.tour-map.is-dragging .tour-map-drag-handle {
    cursor: grabbing;
}

.tour-map-size-icon {
    position: relative;
    width: 14px;
    height: 14px;
    border: 2px solid currentColor;
    border-radius: 2px;
}

.tour-map-size-icon::after {
    content: "";
    position: absolute;
    right: -5px;
    bottom: -5px;
    width: 8px;
    height: 8px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
}

.tour-map[data-size="small"] .leaflet-control-zoom,
.tour-map[data-size="small"] .leaflet-control-layers,
.tour-map[data-size="small"] .leaflet-control-attribution {
    display: none;
}

.tour-map-drag-icon {
    width: 18px;
    height: 18px;
    background-image: radial-gradient(currentColor 1.8px, transparent 2px);
    background-position: 0 0;
    background-size: 6px 6px;
}

.tour-map .leaflet-control-attribution {
    font-size: 10px;
}

.tour-map-marker {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 18px !important;
    height: 18px !important;
    margin-left: -9px !important;
    margin-top: -9px !important;
    border: 2px solid rgba(255, 255, 255, 0.96);
    border-radius: 50%;
    background: #d93f36;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

.tour-map-marker.is-remote {
    background: #6b7280;
    opacity: 0.9;
}

.tour-map-marker.is-current {
    width: 24px !important;
    height: 24px !important;
    margin-left: -12px !important;
    margin-top: -12px !important;
    background: #1d74f5;
}

.tour-map-marker-arrow {
    width: 0;
    height: 0;
    border-right: 5px solid transparent;
    border-bottom: 12px solid #fff;
    border-left: 5px solid transparent;
    transform-origin: 50% 70%;
    transition: transform 80ms linear;
}

@media (max-width: 640px) {
    .tour-status {
        top: 10px;
        left: 10px;
        max-width: min(230px, calc(100vw - 20px));
    }

    .tour-map {
        top: 82px;
        right: 10px;
        width: min(230px, calc(100vw - 20px));
        height: 150px;
    }

    .tour-map[data-size="small"] {
        width: min(156px, calc(100vw - 20px));
        height: 108px;
    }

    .tour-map.is-large,
    .tour-map[data-size="large"] {
        width: calc(100vw - 20px);
        height: min(330px, calc(100dvh - 112px));
    }

    .tour-map-controls {
        top: 6px;
        left: 6px;
        gap: 5px;
    }

    .tour-map-control {
        height: 30px;
    }

    .tour-map-size-control {
        min-width: 68px;
        padding: 0 8px;
        font-size: 11px;
    }

    .tour-map-drag-handle {
        width: 30px;
    }

    .psv-navbar {
        min-height: 56px !important;
    }

    .psv-navbar .psv-zoom-button,
    .psv-navbar .psv-zoom-range,
    .psv-navbar .psv-move-button {
        display: none !important;
    }

    .psv-navbar .psv-autorotate-button,
    .psv-navbar .psv-gallery-button,
    .psv-navbar .psv-markers-button,
    .psv-navbar .psv-description-button,
    .psv-navbar .psv-gyroscope-button,
    .psv-navbar .psv-fullscreen-button {
        min-width: 48px !important;
        height: 54px !important;
        box-sizing: border-box;
        display: flex !important;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2px;
        padding: 3px 4px !important;
    }

    .psv-navbar .psv-button-svg {
        width: 22px !important;
        height: 22px !important;
        flex: 0 0 auto;
    }

    .psv-navbar .psv-autorotate-button::after,
    .psv-navbar .psv-gallery-button::after,
    .psv-navbar .psv-markers-button::after,
    .psv-navbar .psv-description-button::after,
    .psv-navbar .psv-gyroscope-button::after,
    .psv-navbar .psv-fullscreen-button::after {
        color: rgba(255, 255, 255, 0.86);
        font-size: 10px;
        font-weight: 600;
        line-height: 1;
        white-space: nowrap;
    }

    .psv-navbar .psv-autorotate-button::after {
        content: "旋转";
    }

    .psv-navbar .psv-gallery-button::after {
        content: "相册";
    }

    .psv-navbar .psv-markers-button::after {
        content: "点位";
    }

    .psv-navbar .psv-description-button::after {
        content: "介绍";
    }

    .psv-navbar .psv-gyroscope-button::after {
        content: "陀螺仪";
    }

    .psv-navbar .psv-fullscreen-button::after {
        content: "全屏";
    }

    .tour-picker {
        right: 10px;
        bottom: 62px;
        width: calc(100vw - 20px);
    }
}
