/* ============================================================
   location.css · 地点页面
   ------------------------------------------------------------
   地点页 / 立绘 / 物品栏 / 文字区 / 记录页 / 锁定 UI
   ============================================================ */

.location-page {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    background: #0f0a14;
    background-image:
        radial-gradient(circle at 15% 0%, rgba(168, 85, 247, 0.15), transparent 45%),
        radial-gradient(circle at 90% 100%, rgba(236, 72, 153, 0.10), transparent 50%);
    font-family: 'Segoe UI', 'Noto Sans', system-ui, sans-serif;
    color: var(--text);
    z-index: 1;
}

.location-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    flex-shrink: 0;
}

.location-title {
    font-size: 20px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.location-actions {
    display: flex;
    gap: 10px;
}

.location-icon-btn {
    width: 42px;
    height: 42px;
    background: rgba(30, 20, 45, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(192, 132, 252, 0.22);
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    color: var(--text);
    padding: 0;
    margin: 0;
}

.location-icon-btn:hover {
    background: rgba(192, 132, 252, 0.18);
    border-color: rgba(192, 132, 252, 0.5);
    box-shadow: 0 0 14px rgba(192, 132, 252, 0.4);
}

.location-stage {
    flex: 1;
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: background-color .25s ease;
    background: #0f0a14;
    touch-action: none;
    /* 阻止浏览器默认手势 */
    cursor: grab;
    -webkit-user-select: none;
    user-select: none;
}

.location-world {
    position: absolute;
    top: 0;
    left: 0;
    /* width / height 由 JS 按图片原始像素设置 */
    transform-origin: 0 0;
    will-change: transform;
    touch-action: none;
    -webkit-user-select: none;
    user-select: none;
    -webkit-user-drag: none;
}

.location-capsules {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    padding: 12px 20px 0;
    flex-shrink: 0;
}

.location-capsules {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    padding: 12px 20px 0;
    z-index: 2;
    pointer-events: none;
}

.location-capsules>* {
    pointer-events: auto;
}

.location-capsules-expanded {
    top: 48px;
}

.location-capsule:hover {
    background: rgba(192, 132, 252, 0.22);
    border-color: rgba(192, 132, 252, 0.6);
    box-shadow: 0 0 14px rgba(192, 132, 252, 0.35);
    transform: translateY(-1px);
}

.location-standees {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.standee {
    position: absolute;
    width: 50px;
    height: 90px;
    border-radius: 25px;
    background-color: rgba(255, 255, 255, 0.08);
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center bottom;
    border: 2px solid rgba(192, 132, 252, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text);
    font-size: 13px;
    font-weight: 600;
    writing-mode: vertical-rl;
    text-orientation: upright;
    letter-spacing: 3px;
    user-select: none;
    pointer-events: auto;
    cursor: grab;
    touch-action: none;
    transition: box-shadow .2s, border-color .2s;
}

.standee:hover {
    box-shadow: 0 0 0 2px rgba(192, 132, 252, 0.5), 0 0 16px rgba(192, 132, 252, 0.5);
    border-color: rgba(192, 132, 252, 0.8);
}

.standee.dragging {
    cursor: grabbing;
    z-index: 10;
    box-shadow: 0 0 0 2px #ec4899, 0 0 20px rgba(236, 72, 153, 0.6);
    border-color: #ec4899;
}

@keyframes standeeWobble {

    0%,
    100% {
        transform: translateX(0) rotate(0deg);
    }

    25% {
        transform: translateX(-4px) rotate(-1deg);
    }

    50% {
        transform: translateX(0) rotate(0deg);
    }

    75% {
        transform: translateX(4px) rotate(1deg);
    }
}

.standee-player {
    border-color: #ec4899;
    background-color: rgba(236, 72, 153, 0.12);
    box-shadow: 0 0 16px rgba(236, 72, 153, 0.35);
}

.location-card {
    width: 120px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: 0.2s;
    backdrop-filter: blur(4px);
}

.location-card:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: translateY(-2px);
}

.location-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 600;
}

.location-card-name {
    font-size: 13px;
    color: #ddd;
    text-align: center;
}

.location-empty-hint {
    color: #666;
    font-size: 14px;
}

.location-bottom {
    flex-shrink: 0;
    background: rgba(20, 12, 32, 0.85);
    backdrop-filter: blur(16px) saturate(160%);
    -webkit-backdrop-filter: blur(16px) saturate(160%);
    border-top: 1px solid rgba(192, 132, 252, 0.2);
    padding: 12px 20px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.char-avatar-row {
    display: flex;
    gap: 10px;
    align-items: center;
    min-height: 44px;
}

.char-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(192, 132, 252, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    flex-shrink: 0;
    background-size: cover;
    background-position: center;
}

.char-avatar.dim {
    opacity: 0.3;
}

.char-avatar.player-slot {
    background: transparent;
    border: 1px dashed rgba(192, 132, 252, 0.4);
}

.char-avatar.lit {
    opacity: 1 !important;
    box-shadow: 0 0 0 2px #ec4899, 0 0 14px rgba(236, 72, 153, 0.8);
    border-color: #ec4899;
    transition: opacity .15s, box-shadow .15s, border-color .15s;
}

.speaker-name {
    color: var(--accent);
    font-size: 14px;
    font-weight: 600;
    padding-left: 4px;
    text-shadow: 0 0 12px rgba(236, 72, 153, 0.5);
}

.input-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.input-history-btn {
    width: 40px;
    height: 40px;
    background: rgba(30, 20, 45, 0.7);
    border: 1px solid rgba(192, 132, 252, 0.22);
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    color: var(--text);
    flex-shrink: 0;
    padding: 0;
    transition: all .2s;
}

.input-history-btn:hover {
    background: rgba(192, 132, 252, 0.18);
    border-color: rgba(192, 132, 252, 0.5);
    box-shadow: 0 0 14px rgba(192, 132, 252, 0.4);
}

.location-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(192, 132, 252, 0.2);
    border-radius: 20px;
    padding: 11px 16px;
    color: var(--text);
    font-size: 14px;
    outline: none;
    box-sizing: border-box;
    font-family: inherit;
    transition: border-color .2s, box-shadow .2s;
}

.location-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(192, 132, 252, 0.18);
}

.location-input::placeholder {
    color: var(--text-dim);
}

.input-send-btn {
    background: linear-gradient(135deg, #c084fc, #ec4899);
    color: #fff;
    border: none;
    border-radius: 20px;
    padding: 11px 18px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    flex-shrink: 0;
    font-family: inherit;
    box-shadow: 0 4px 14px rgba(192, 132, 252, 0.35);
    transition: all .2s;
}

.input-send-btn:hover {
    box-shadow: 0 4px 20px rgba(236, 72, 153, 0.55);
    transform: translateY(-1px);
}

/* ===== 地点文字区 · 视觉小说样式 ===== */
.text-display-area {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    min-height: 120px;
    max-height: 200px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(192, 132, 252, 0.15);
    border-radius: 14px;
    padding: 14px 16px;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    position: relative;
}

.vn-content {
    color: var(--text);
    font-size: 15px;
    line-height: 1.7;
    white-space: pre-wrap;
    word-break: break-word;
    flex: 1;
}

.vn-status {
    position: absolute;
    right: 14px;
    bottom: 10px;
    color: var(--accent);
    font-size: 13px;
    opacity: 0.85;
    pointer-events: none;
    text-shadow: 0 0 10px rgba(236, 72, 153, 0.6);
}

/* ===== 生成中锁定 UI ===== */
.scene-busy .location-icon-btn,
.scene-busy .location-capsule,
.scene-busy .standee,
.scene-busy .input-send-btn {
    pointer-events: none;
    opacity: 0.45;
    filter: saturate(0.6);
}

/* 记录按钮不锁 */
.scene-busy .input-history-btn {
    pointer-events: auto;
    opacity: 1;
}

/* ===== 地点记录页 ===== */
.scene-record-page {
    position: fixed;
    inset: 0;
    background: #0f0a14;
    background-image:
        radial-gradient(circle at 15% 0%, rgba(168, 85, 247, 0.15), transparent 45%),
        radial-gradient(circle at 90% 100%, rgba(236, 72, 153, 0.10), transparent 50%);
    color: var(--text);
    z-index: 100;
    display: none;
    flex-direction: column;
}

.scene-record-page.active {
    display: flex;
}

.scene-record-header {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.scene-record-back {
    font-size: 28px;
    cursor: pointer;
    color: var(--primary);
    padding: 0 12px 0 0;
    line-height: 1;
    transition: color .2s, text-shadow .2s;
}

.scene-record-back:hover {
    color: var(--accent);
    text-shadow: 0 0 12px rgba(236, 72, 153, 0.7);
}

.scene-record-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
}

.scene-record-list {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.scene-record-group {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px dashed rgba(192, 132, 252, 0.18);
}

.scene-record-group:last-child {
    border-bottom: none;
}

.scene-record-time {
    font-size: 12px;
    color: var(--text-dim);
    margin-bottom: 8px;
    letter-spacing: 0.3px;
}

.scene-record-line {
    font-size: 14px;
    line-height: 1.8;
    color: var(--text);
    margin-bottom: 2px;
    word-break: break-word;
}

.scene-record-role {
    color: var(--accent);
    font-weight: 600;
}

.scene-record-role.narration {
    color: var(--text-dim);
}

.scene-record-empty {
    text-align: center;
    color: var(--text-dim);
    padding: 60px 0;
    font-size: 14px;
}

/* ===== 记录页 · 分割线 & 事件条 ===== */
.scene-record-divider {
    display: flex;
    align-items: center;
    margin: 24px 0 16px;
    gap: 12px;
}

.scene-record-divider::before,
.scene-record-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    opacity: 0.55;
}

.scene-record-divider span {
    font-size: 12px;
    color: var(--accent);
    opacity: 0.9;
    white-space: nowrap;
    letter-spacing: 0.5px;
    text-shadow: 0 0 10px rgba(236, 72, 153, 0.5);
}

.scene-record-event {
    color: var(--text-dim) !important;
    font-style: italic;
    font-size: 13px !important;
}

.scene-record-summary-btn {
    background: rgba(192, 132, 252, 0.12);
    border: 1px solid rgba(192, 132, 252, 0.3);
    border-radius: 12px;
    color: var(--primary);
    font-size: 14px;
    cursor: pointer;
    padding: 4px 14px;
    font-family: inherit;
    transition: all .2s;
}

.scene-record-summary-btn:hover {
    background: rgba(192, 132, 252, 0.22);
    border-color: rgba(192, 132, 252, 0.5);
    box-shadow: 0 0 12px rgba(192, 132, 252, 0.4);
}

.scene-record-summary-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

/* ===== 可展开胶囊 & 展开行 ===== */
.location-capsule.expandable {
    border-style: dashed;
}

.location-capsule-arrow {
    margin-left: 4px;
    font-size: 10px;
    opacity: 0.85;
    display: inline-block;
}

.location-capsule.expanded {
    background: rgba(236, 72, 153, 0.25);
    border-color: rgba(236, 72, 153, 0.7);
    box-shadow: 0 0 14px rgba(236, 72, 153, 0.4);
}

.location-capsules-expanded {
    padding-top: 4px;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
}

.location-capsule-sub {
    font-size: 12px;
    padding: 4px 12px;
    background: rgba(15, 10, 20, 0.7);
    border: 1px solid rgba(192, 132, 252, 0.3);
}

.location-capsule-sub:hover {
    background: rgba(192, 132, 252, 0.22);
    border-color: rgba(192, 132, 252, 0.6);
}

/* ===== 地点物品栏 ===== */
.location-items-bar {
    padding: 8px 20px 0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    flex-shrink: 0;
}

.location-item {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(192, 132, 252, 0.22);
    color: var(--text);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.15s;
    user-select: none;
    -webkit-user-select: none;
}

.location-item:hover {
    background: rgba(192, 132, 252, 0.16);
    border-color: rgba(192, 132, 252, 0.5);
    transform: translateY(-1px);
}

.location-item-broken {
    color: var(--accent);
    border-color: rgba(236, 72, 153, 0.4);
}

.location-items-empty {
    color: var(--text-dim);
    font-size: 13px;
}

.location-item-vanished {
    color: var(--text-dim);
    border-color: rgba(255, 255, 255, 0.08);
    text-decoration: line-through;
    opacity: 0.6;
}

.scene-record-summarizing-tag {
    display: inline-block;
    margin-left: 8px;
    padding: 1px 8px;
    font-size: 11px;
    color: var(--primary);
    background: rgba(192, 132, 252, 0.15);
    border: 1px solid rgba(192, 132, 252, 0.35);
    border-radius: 8px;
    vertical-align: middle;
    animation: summTagPulse 1.5s ease-in-out infinite;
}

@keyframes summTagPulse {

    0%,
    100% {
        opacity: 0.7;
    }

    50% {
        opacity: 1;
    }
}

/* ============================================================
   底部场景面板
   ============================================================ */

.scene-bottom-panel {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    flex-direction: column;
    z-index: 10;
    overflow: visible;
}

.scene-text-area {
    position: relative;
    padding: 30px 20px 18px;
    display: flex;
    flex-direction: column;
    max-height: 55vh;
    overflow: visible;
    transition: max-height .35s ease, padding .3s ease, opacity .25s ease;
}

/* 玻璃层：见影线位置为实色，往下渐变过渡到透明 */
.scene-glass-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 0;

    background: rgba(15, 10, 20, 0.72);

    backdrop-filter: blur(18px) saturate(140%);
    -webkit-backdrop-filter: blur(18px) saturate(140%);
}

/* 头像行：向上溢出，让头像中线正好落在面板顶边 = 见影线位置 */
.scene-top-bar {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 0;
    margin-bottom: 10px;
    min-height: 0;
    padding-left: 140px;
    /* 给绝对定位的头像让出左边空间（92 + 16） */
}

/* 头像：竖着的圆角矩形，92×120 */
.scene-avatar-wrap {
    position: absolute;
    left: 20px;
    top: -90px;
    /* 头像中心落在面板顶边（向上溢出 60px = 120/2） */
    width: 92px;
    height: 120px;
    border-radius: 30px;
    overflow: hidden;
    background: rgba(30, 20, 45, 0.9);
    border: 1.5px solid rgba(192, 132, 252, 0.22);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 8px rgba(192, 132, 252, 0.12);
    transition: border-color .3s, box-shadow .3s;
}

/* 当内部头像 active 时，外框跟着亮 */
.scene-avatar-wrap:has(.scene-avatar.active) {
    border-color: rgba(192, 132, 252, 0.85);
    box-shadow:
        0 0 20px rgba(192, 132, 252, 0.65),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.scene-avatar {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 42px;
    font-weight: 600;
    color: #fff;
    background-size: cover;
    background-position: center;
    font-family: 'WenJinMincho', 'Noto Serif SC', serif;
    /* 默认（旁白时）：暗 */
    filter: brightness(0.4) saturate(0.35);
    opacity: 0.65;
    transition: filter .3s, opacity .3s;
}

.scene-avatar.active {
    /* 亮 */
    filter: brightness(1) saturate(1);
    opacity: 1;
    box-shadow: inset 0 0 30px rgba(192, 132, 252, 0.45);
}

/* 名字：地图左上角"世界"同字体同发光 */
.scene-name {
    position: relative;
    z-index: 2;
    font-family: 'WenJinMincho', 'Noto Serif SC', serif;
    font-size: 22px;
    font-weight: 500;
    color: #fff;
    letter-spacing: 2px;
    line-height: 1;
    flex-shrink: 0;
    text-shadow:
        0 0 12px rgba(255, 255, 255, 0.55),
        0 0 28px rgba(192, 132, 252, 0.35);
}

/* 见影线：参考首页 Dream 旁边那条线 */
.scene-line {
    flex: 1;
    height: 1px;
    margin-left: 16px;
    margin-right: 40px;
    background: linear-gradient(90deg,
            transparent 0%,
            rgba(192, 132, 252, 0.85) 50%,
            transparent 100%);
    box-shadow: 0 0 6px rgba(192, 132, 252, 0.45);
}

/* 文本内容区：透明背景，靠玻璃层做底 */
.scene-bottom-panel .text-display-area {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    min-height: 80px;
    max-height: 200px;
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 4px 4px 0;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
}

.scene-bottom-panel .text-display-area::-webkit-scrollbar {
    width: 3px;
}

.scene-bottom-panel .text-display-area::-webkit-scrollbar-thumb {
    background: rgba(192, 132, 252, 0.3);
    border-radius: 4px;
}

/* 输入栏：只改布局与外层背景，子元素样式保持原样 */
.scene-input-bar {
    position: relative;
    z-index: 3;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px 16px;
    background: rgba(20, 12, 32, 0.85);
    backdrop-filter: blur(16px) saturate(160%);
    -webkit-backdrop-filter: blur(16px) saturate(160%);
    border-top: 1px solid rgba(192, 132, 252, 0.2);
    flex-shrink: 0;
}

/* ===== 折叠按钮 ===== */
.scene-fold-btn {
    position: absolute;
    right: 20px;
    top: 30px;
    z-index: 5;
    width: 26px;
    height: 26px;
    border: none;
    background: none;
    padding: 0;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: top .35s ease, color .2s, filter .2s;
}

.scene-fold-btn:hover {
    color: #fff;
    filter: drop-shadow(0 0 8px rgba(192, 132, 252, 0.9));
}

.scene-fold-btn .fold-svg {
    width: 20px;
    height: 20px;
    transition: transform .3s ease;
}

/* 折叠状态：文本区收起为 0，只留输入栏 */
.scene-bottom-panel.collapsed .scene-text-area {
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    opacity: 0;
    pointer-events: none;
    overflow: hidden;
}

/* 折叠时按钮移到输入栏上方 */
.scene-bottom-panel.collapsed .scene-fold-btn {
    top: -30px;
}

/* 折叠时箭头翻转，朝上 */
.scene-bottom-panel.collapsed .scene-fold-btn .fold-svg {
    transform: rotate(180deg) !important;
}

/* ===== 主项目：编辑器物品层 ===== */
.location-items-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.location-items-layer .location-item-img {
    position: absolute;
    background-size: 100% 100%;
    background-repeat: no-repeat;
    image-rendering: pixelated;
}

.location-items-layer .location-item-img.state-gone {
    opacity: 0.4;
}

/* ===== 拖动幽灵 ===== */
.standee-ghost {
    position: fixed !important;
    pointer-events: none !important;
    width: 50px;
    height: 90px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center bottom;
    border-radius: 25px;
    border: 2px solid #ec4899;
    box-shadow: 0 0 20px rgba(236, 72, 153, 0.7);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 600;
    color: #fff;
    opacity: 0.85;
}
.standee-ghost.invalid {
    border-color: #f87171;
    box-shadow: 0 0 20px rgba(248, 113, 113, 0.7);
}
/* ===== 立绘选中状态 ===== */
.standee.selected {
    box-shadow: 0 0 0 2px #ec4899, 0 0 20px rgba(236, 72, 153, 0.8);
    border-color: #ec4899;
    z-index: 20;
}

/* ===== 立绘 8 个手柄 ===== */
.standee .standee-handle {
    position: absolute;
    width: 10px;
    height: 10px;
    background: #fff;
    border: 1.5px solid #ec4899;
    border-radius: 50%;
    box-shadow: 0 0 6px rgba(236, 72, 153, 0.8);
    z-index: 30;
    box-sizing: border-box;
    pointer-events: auto;
}
.standee .standee-handle.h-tl { top: -5px; left: -5px; cursor: nwse-resize; }
.standee .standee-handle.h-tr { top: -5px; right: -5px; cursor: nesw-resize; }
.standee .standee-handle.h-bl { bottom: -5px; left: -5px; cursor: nesw-resize; }
.standee .standee-handle.h-br { bottom: -5px; right: -5px; cursor: nwse-resize; }
.standee .standee-handle.h-t { top: -5px; left: 50%; margin-left: -5px; cursor: ns-resize; }
.standee .standee-handle.h-b { bottom: -5px; left: 50%; margin-left: -5px; cursor: ns-resize; }
.standee .standee-handle.h-l { top: 50%; left: -5px; margin-top: -5px; cursor: ew-resize; }
.standee .standee-handle.h-r { top: 50%; right: -5px; margin-top: -5px; cursor: ew-resize; }

/* ===== 立绘右键菜单 ===== */
.standee-menu {
    position: fixed;
    background: rgba(30, 20, 45, 0.95);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(192, 132, 252, 0.3);
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6);
    z-index: 99999;
    padding: 4px 0;
    min-width: 140px;
    display: none;
}
.standee-menu.show { display: block; }
.standee-menu-item {
    display: block;
    width: 100%;
    padding: 10px 20px;
    background: none;
    border: none;
    color: var(--text);
    font-size: 14px;
    text-align: left;
    cursor: pointer;
    font-family: inherit;
    white-space: nowrap;
    transition: background .15s;
}
.standee-menu-item:hover {
    background: rgba(192, 132, 252, 0.15);
}
.standee-menu-item.danger {
    color: #fca5a5;
}
.standee-menu-item.danger:hover {
    background: rgba(239, 68, 68, 0.15);
}
/* ===== 立绘占地标注弹窗 ===== */
.footprint-hint {
    font-size: 12px;
    color: var(--text-dim);
    text-align: center;
    margin-bottom: 12px;
}
.footprint-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
    max-height: 55vh;
    overflow: auto;
    background: #1a1325;
    border-radius: 8px;
    padding: 10px;
}
.footprint-canvas {
    position: relative;
    background-color: #2a1f3a;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center bottom;
    cursor: crosshair;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
}
.footprint-select {
    position: absolute;
    border: 2px solid #34d399;
    background: rgba(52, 211, 153, 0.22);
    box-sizing: border-box;
    pointer-events: none;
    box-shadow: 0 0 10px rgba(52, 211, 153, 0.5);
}
/* ============================================================
   虚拟摇杆（move.js 用）
   ============================================================ */
.virtual-joystick {
    position: fixed;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: radial-gradient(circle,
        rgba(192, 132, 252, 0.14) 0%,
        rgba(192, 132, 252, 0.06) 100%);
    border: 1.5px solid rgba(192, 132, 252, 0.45);
    box-shadow: 0 0 20px rgba(192, 132, 252, 0.3);
    pointer-events: none;
    z-index: 100;
    transform: translate(-50%, -50%);
}

.virtual-joystick-knob {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: radial-gradient(circle,
        rgba(236, 72, 153, 0.7) 0%,
        rgba(192, 132, 252, 0.55) 100%);
    border: 1.5px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 0 16px rgba(236, 72, 153, 0.55);
    transform: translate(-50%, -50%);
}

/* 走路时立绘上下浮动 */
.standee.walking {
    animation: standeeWalk 0.5s ease-in-out infinite;
}
@keyframes standeeWalk {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-3px); }
}
/* ===== 地点名旁边的编辑按钮 ===== */
.location-title-group {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}
.location-edit-btn {
    width: 34px;
    height: 34px;
    flex-shrink: 0;
}
.location-edit-btn .icon {
    width: 16px;
    height: 16px;
}
/* ===== 有立绘的角色：裸显示（无边框、无底色、无圆角）===== */
.standee.standee-has-img,
.standee.standee-has-img.selected {
    border: none !important;
    border-radius: 0 !important;
    background-color: transparent !important;
    box-shadow: none !important;
}
/* ===== 候选区（兜底）===== */
.location-candidate-area {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    transform: translateY(100%);
    background: rgba(20, 12, 32, 0.85);
    border-top: 1px solid rgba(192, 132, 252, 0.25);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    padding: 10px 12px;
    gap: 10px;
    overflow: hidden;
    min-height: 0;
    box-sizing: border-box;
}
.candidate-list {
    display: flex;
    gap: 10px;
    align-items: center;
    flex: 1;
    min-height: 0;
    min-width: 0;
    overflow: hidden;
}
.candidate-item {
    width: 50px;
    height: 90px;
    flex-shrink: 0;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center bottom;
    background-color: transparent;
    border-radius: 25px;
    border: 2px solid rgba(192, 132, 252, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 600;
    color: var(--text);
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
    transition: transform .15s, border-color .15s, box-shadow .15s;
    box-sizing: border-box;
}
.candidate-item:hover {
    transform: scale(1.06);
    border-color: var(--primary);
    box-shadow: 0 0 14px rgba(192, 132, 252, 0.5);
}
.candidate-item:active {
    cursor: grabbing;
}