/* 準心樣式 - 只在 mobile 顯示 */
#mobile-crosshair {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    z-index: 999;
    /* 略低於選單，但高於地圖 */
    pointer-events: none;
    /* 讓點擊穿透到地圖 */
    display: none;
    /* 預設隱藏，由 JS 或 Media Query 控制 */
}

/* 當不支援 hover 時 (行動裝置) 或寬度小於 768px 時顯示準心 */
@media (hover: none),
(max-width: 768px) {
    #mobile-crosshair {
        display: block;
    }
}

/* 準心的十字線 */
#mobile-crosshair::before,
#mobile-crosshair::after {
    content: '';
    position: absolute;
    background-color: rgba(255, 255, 255, 0.7);
    box-shadow: 0 0 2px rgba(0, 0, 0, 0.5);
}

/* 水平線 */
#mobile-crosshair::before {
    top: 50%;
    left: 0;
    width: 100%;
    height: 1.5px;
    transform: translateY(-50%);
}

/* 垂直線 */
#mobile-crosshair::after {
    left: 50%;
    top: 0;
    width: 1.5px;
    height: 100%;
    transform: translateX(-50%);
}

/* 中心點 */
#mobile-crosshair .center-dot {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    background-color: #ff3b30;
    /* 亮紅色 */
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 3px rgba(0, 0, 0, 0.5);
    border: 1px solid white;
}

/* 如果選單開啟，降低準心透明度以免干擾 */
body.menu-open #mobile-crosshair {
    opacity: 0.3;
}

/* 確保地圖容器在手機上不會觸發系統預設操作 (如放大、選取文字) */
@media (hover: none) and (pointer: coarse) {
    #map {
        -webkit-touch-callout: none;
        -webkit-user-select: none;
        user-select: none;
    }
}

/* 提示文字樣式 - 匹配電腦版美術風格 */
.crosshair-hint {
    position: absolute;
    top: 50px;
    /* 在準心下方 */
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    white-space: nowrap;
    background: rgba(20, 20, 20, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: rgba(255, 255, 255, 0.95);
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: normal;
    letter-spacing: normal;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    opacity: 0;
    visibility: hidden;
    z-index: 99999;
    /* 極高層級 */
    min-width: 120px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    transition: opacity 0.5s ease, transform 0.5s ease;
}

/* 彈跳動畫 */
@keyframes hintBounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateX(-50%) translateY(0);
    }

    40% {
        transform: translateX(-50%) translateY(-10px);
    }

    60% {
        transform: translateX(-50%) translateY(-5px);
    }
}

.crosshair-hint.show {
    opacity: 1;
    visibility: visible;
    /* 動畫會覆蓋初始的 transform，所以這裡要包含 translateX(-50%) */
    animation: hintBounce 2s cubic-bezier(0.28, 0.84, 0.42, 1) infinite;
}