.i7tou-jtm,
.i7tou-jtm * {
    box-sizing: border-box;
}

.i7tou-jtm {
    width: 100%;
    margin: 28px auto;
    padding: 18px;
    border: 1px solid rgba(30, 41, 59, 0.10);
    border-radius: 24px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
    color: #1f2937;
    font-family: inherit;
}

.i7tou-jtm__header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 14px;
}

.i7tou-jtm__title-wrap {
    min-width: 0;
}

.i7tou-jtm__eyebrow {
    display: inline-flex;
    align-items: center;
    margin-bottom: 4px;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(14, 165, 233, 0.10);
    color: #0369a1;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.05em;
}

.i7tou-jtm__title {
    margin: 0 0 6px;
    color: #111827;
    font-size: clamp(24px, 3vw, 34px);
    font-weight: 900;
    line-height: 1.2;
}

.i7tou-jtm__subtitle {
    margin: 0;
    color: #64748b;
    font-size: 16px;
    line-height: 1.65;
}

.i7tou-jtm__map-toolbar {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 870;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 10px;
    max-width: calc(100% - 92px);
}

.i7tou-jtm__filter-group {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 6px;
    border: 1px solid rgba(100, 116, 139, 0.14);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.94);
}

.i7tou-jtm__filter,
.i7tou-jtm__reset,
.i7tou-jtm__load-more {
    appearance: none;
    border: 0;
    border-radius: 999px;
    cursor: pointer;
    font-family: inherit;
    font-weight: 850;
    line-height: 1;
    transition: transform .18s ease, box-shadow .18s ease, background .18s ease, color .18s ease, opacity .18s ease;
}

.i7tou-jtm__filter {
    padding: 11px 15px;
    background: transparent;
    color: #475569;
    font-size: 15px;
}

.i7tou-jtm__filter:hover,
.i7tou-jtm__reset:hover,
.i7tou-jtm__load-more:hover {
    transform: translateY(-1px);
}

.i7tou-jtm__filter.is-active {
    background: #0f172a;
    color: #ffffff;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.18);
}

.i7tou-jtm__reset {
    padding: 13px 16px;
    background: #e2e8f0;
    color: #0f172a;
    font-size: 15px;
}

.i7tou-jtm__status {
    position: absolute;
    left: 14px;
    bottom: 14px;
    z-index: 860;
    display: flex;
    align-items: center;
    max-width: min(680px, calc(100% - 28px));
    min-height: 38px;
    padding: 10px 14px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.94);
    color: #475569;
    font-size: 15px;
    font-weight: 800;
    line-height: 1.45;
    box-shadow: 0 14px 35px rgba(15, 23, 42, 0.14);
    backdrop-filter: blur(10px);
    pointer-events: none;
}

.i7tou-jtm__map-shell {
    position: relative;
    width: 100%;
}

.i7tou-jtm__map {
    position: relative;
    z-index: 1;
    width: 100%;
    aspect-ratio: 16 / 9;
    min-height: 460px;
    overflow: hidden;
    border: 1px solid rgba(15, 23, 42, 0.10);
    border-radius: 24px;
    background: #e2e8f0;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.35);
}

.i7tou-jtm__area-panel {
    position: absolute;
    top: 80px;
    right: 14px;
    z-index: 850;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    border: 1px solid rgba(15, 23, 42, 0.10);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 14px 35px rgba(15, 23, 42, 0.16);
    backdrop-filter: blur(10px);
}

.i7tou-jtm__select-label {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    color: #334155;
    font-size: 13px;
    font-weight: 900;
    line-height: 1;
    white-space: nowrap;
}

.i7tou-jtm__area-select {
    min-width: 128px;
    height: 38px;
    margin: 0;
    padding: 0 34px 0 12px;
    border: 1px solid rgba(100, 116, 139, 0.24);
    border-radius: 999px;
    background-color: #ffffff;
    color: #0f172a;
    font-family: inherit;
    font-size: 14px;
    font-weight: 850;
    line-height: 1;
    outline: none;
    cursor: pointer;
}

.i7tou-jtm__area-select:focus {
    border-color: rgba(14, 165, 233, 0.75);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.16);
}

.i7tou-jtm__map-load-more-panel {
    position: absolute;
    top: 146px;
    right: 14px;
    z-index: 845;
    display: flex;
    justify-content: flex-end;
    pointer-events: auto;
}

.i7tou-jtm__map-load-more-panel .i7tou-jtm__load-more {
    min-width: 146px;
    padding: 13px 22px;
    border: 2px solid rgba(255, 255, 255, 0.85);
    background: #0ea5e9;
    color: #ffffff;
    font-size: 15px;
    box-shadow: 0 14px 35px rgba(14, 165, 233, 0.30);
    backdrop-filter: blur(10px);
}

.i7tou-jtm__footer {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 14px;
    flex-wrap: wrap;
    margin-top: 14px;
}

.i7tou-jtm__load-more {
    padding: 14px 24px;
    background: #0ea5e9;
    color: #ffffff;
    font-size: 16px;
    box-shadow: 0 12px 28px rgba(14, 165, 233, 0.26);
}

.i7tou-jtm__load-more:disabled,
.i7tou-jtm__filter:disabled,
.i7tou-jtm__reset:disabled {
    cursor: not-allowed;
    opacity: 0.58;
    transform: none;
    box-shadow: none;
}

.i7tou-jtm__count {
    display: none;
    color: #64748b;
    font-size: 15px;
    font-weight: 700;
}

.i7tou-jtm-div-icon {
    overflow: visible !important;
    background: transparent !important;
    border: 0 !important;
}

.i7tou-jtm-marker-wrap {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-direction: column;
    width: 136px;
    height: 82px;
    pointer-events: auto;
}

.i7tou-jtm-marker-wrap--top::before {
    content: none;
}

.i7tou-jtm-marker-wrap--top-ten::before {
    content: 'TOP';
    position: absolute;
    top: -12px;
    left: 50%;
    z-index: 4;
    transform: translateX(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 19px;
    padding: 0 8px;
    border: 2px solid #ffffff;
    border-radius: 999px;
    background: linear-gradient(135deg, #fff7cc 0%, #facc15 58%, #f59e0b 100%);
    color: #713f12;
    font-size: 10px;
    font-weight: 950;
    line-height: 1;
    letter-spacing: 0.05em;
    box-shadow:
        0 0 0 3px rgba(250, 204, 21, 0.22),
        0 8px 18px rgba(146, 64, 14, 0.24);
}

.i7tou-jtm-marker-wrap--top::after {
    content: '';
    position: absolute;
    top: -5px;
    left: 50%;
    z-index: 0;
    width: 58px;
    height: 58px;
    border-radius: 999px;
    transform: translateX(-50%);
    background: radial-gradient(circle, rgba(250, 204, 21, 0.34) 0%, rgba(250, 204, 21, 0.18) 46%, rgba(250, 204, 21, 0) 74%);
    pointer-events: none;
}

.i7tou-jtm-marker-wrap--top-ten::after {
    width: 66px;
    height: 66px;
    top: -9px;
    background: radial-gradient(circle, rgba(250, 204, 21, 0.48) 0%, rgba(250, 204, 21, 0.24) 44%, rgba(250, 204, 21, 0) 74%);
    animation: i7tou-jtm-top-ten-pulse 2.4s ease-in-out infinite;
}

@keyframes i7tou-jtm-top-ten-pulse {
    0%, 100% {
        opacity: .62;
        transform: translateX(-50%) scale(.94);
    }
    50% {
        opacity: .94;
        transform: translateX(-50%) scale(1.08);
    }
}

.i7tou-jtm-marker {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border: 3px solid #ffffff;
    border-radius: 50% 50% 50% 10px;
    box-shadow: 0 10px 20px rgba(15, 23, 42, 0.30);
    transform: rotate(-45deg);
}

.i7tou-jtm-marker::after {
    content: '';
    position: absolute;
    right: 5px;
    bottom: 5px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,.55);
}

.i7tou-jtm-marker--spot {
    background: #2563eb;
}

.i7tou-jtm-marker--food {
    background: #f97316;
}

.i7tou-jtm-marker--top {
    border-color: #fff7ed;
    outline: 4px solid rgba(250, 204, 21, 0.72);
    box-shadow:
        0 0 0 7px rgba(250, 204, 21, 0.18),
        0 16px 28px rgba(15, 23, 42, 0.34);
    transform: rotate(-45deg) scale(1.10);
}

.i7tou-jtm-marker--top::after {
    background: rgba(255,255,255,.82);
}


.i7tou-jtm-marker--top-ten {
    border-width: 4px;
    border-color: #ffffff;
    outline: 4px solid rgba(250, 204, 21, 0.62);
    box-shadow:
        0 0 0 7px rgba(250, 204, 21, 0.20),
        0 0 18px rgba(250, 204, 21, 0.45),
        0 16px 30px rgba(15, 23, 42, 0.36);
    transform: rotate(-45deg) scale(1.16);
}

.i7tou-jtm-marker--top-ten::after {
    width: 9px;
    height: 9px;
    background: rgba(255,255,255,.88);
}

.i7tou-jtm-marker__rank {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 28px;
    border-radius: 999px;
    color: #ffffff;
    font-size: 13px;
    font-weight: 950;
    line-height: 1;
    letter-spacing: -0.04em;
    text-align: center;
    text-shadow: 0 1px 2px rgba(0,0,0,.25);
    transform: rotate(45deg);
    white-space: nowrap;
}

.i7tou-jtm-marker__rank--three {
    font-size: 11px;
    letter-spacing: -0.08em;
}

.i7tou-jtm-marker__rank--long {
    font-size: 9px;
    letter-spacing: -0.10em;
}

.i7tou-jtm-marker__label {
    display: none;
    max-width: 126px;
    margin-top: 4px;
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.94);
    color: #0f172a;
    font-size: 12px;
    font-weight: 900;
    line-height: 1.15;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.18);
    pointer-events: none;
}

.i7tou-jtm--show-labels .i7tou-jtm-marker__label {
    display: block;
}


/* Popup pane 層級固定高於所有 marker / top marker，避免小視窗被圖標蓋住。 */
.i7tou-jtm .i7tou-jtm-popup-pane {
    z-index: 840 !important;
}

.i7tou-jtm .leaflet-popup {
    z-index: 1;
}

.i7tou-jtm-leaflet-popup .leaflet-popup-content-wrapper {
    overflow: hidden;
    padding: 0;
    border-radius: 20px;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.23);
}

.i7tou-jtm-leaflet-popup .leaflet-popup-content {
    width: 300px !important;
    margin: 0;
}

.i7tou-jtm-leaflet-popup .leaflet-popup-tip {
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.18);
}

.i7tou-jtm-popup {
    overflow: hidden;
    background: #ffffff;
}

.i7tou-jtm-popup__image-wrap {
    width: 100%;
    height: 145px;
    overflow: hidden;
    background: #e2e8f0;
}

.i7tou-jtm-popup__image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.i7tou-jtm-popup__body {
    padding: 13px 14px 14px;
}

.i7tou-jtm-popup__badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}

.i7tou-jtm-popup__badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 999px;
    background: #f1f5f9;
    color: #475569;
    font-size: 12px;
    font-weight: 850;
    line-height: 1;
}

.i7tou-jtm-popup__badge--spot {
    background: rgba(37, 99, 235, 0.10);
    color: #1d4ed8;
}

.i7tou-jtm-popup__badge--food {
    background: rgba(249, 115, 22, 0.12);
    color: #c2410c;
}

.i7tou-jtm-popup__badge--top {
    background: rgba(250, 204, 21, 0.24);
    color: #854d0e;
}


.i7tou-jtm-popup__badge--top-ten {
    background: rgba(250, 204, 21, 0.26);
    color: #854d0e;
    box-shadow: inset 0 0 0 1px rgba(250, 204, 21, 0.42);
}

.i7tou-jtm-popup__place {
    margin-bottom: 3px;
    color: #0f172a;
    font-size: 18px;
    font-weight: 950;
    line-height: 1.25;
}

.i7tou-jtm-popup__title {
    color: #334155;
    font-size: 14px;
    font-weight: 800;
    line-height: 1.45;
}

.i7tou-jtm-popup__desc {
    display: -webkit-box;
    margin: 8px 0 0;
    overflow: hidden;
    color: #64748b;
    font-size: 13px;
    line-height: 1.55;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

.i7tou-jtm-popup__meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 9px;
    color: #475569;
    font-size: 12px;
    font-weight: 750;
}

.i7tou-jtm-popup__link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin-top: 12px;
    padding: 11px 12px;
    border-radius: 14px;
    background: #0f172a;
    color: #ffffff !important;
    font-size: 14px;
    font-weight: 900;
    line-height: 1;
    text-decoration: none !important;
}

.i7tou-jtm-popup__link:hover {
    background: #1e293b;
    color: #ffffff !important;
}

.i7tou-jtm .leaflet-control-zoom a {
    text-decoration: none !important;
}

@media (max-width: 900px) {
    .i7tou-jtm__map-toolbar {
        left: 56px;
        right: 14px;
        max-width: none;
    }

    .i7tou-jtm__area-panel {
        left: 14px;
        right: 14px;
        top: 82px;
        justify-content: flex-end;
        flex-wrap: wrap;
    }

    .i7tou-jtm__map-load-more-panel {
        top: 152px;
        right: 14px;
    }
}

@media (max-width: 782px) {
    .i7tou-jtm {
        margin: 18px auto;
        padding: 12px;
        border-radius: 20px;
    }

    .i7tou-jtm__header {
        align-items: stretch;
        flex-direction: column;
    }

    .i7tou-jtm__map-toolbar {
        top: 12px;
        left: 56px;
        right: 12px;
        justify-content: flex-end;
        gap: 8px;
    }

    .i7tou-jtm__filter-group {
        flex: 1 1 auto;
        min-width: 0;
    }

    .i7tou-jtm__filter {
        flex: 1 1 auto;
    }

    .i7tou-jtm__reset {
        flex: 0 0 auto;
    }

    .i7tou-jtm__map {
        aspect-ratio: 4 / 5;
        min-height: 520px;
        border-radius: 18px;
    }

    .i7tou-jtm__area-panel {
        top: 96px;
        left: 12px;
        right: 12px;
        gap: 6px;
        padding: 7px;
        border-radius: 16px;
    }

    .i7tou-jtm__map-load-more-panel {
        top: 170px;
        right: 12px;
    }

    .i7tou-jtm__map-load-more-panel .i7tou-jtm__load-more {
        min-width: 128px;
        padding: 12px 18px;
        font-size: 14px;
    }

    .i7tou-jtm__select-label {
        flex: 1 1 145px;
        justify-content: space-between;
        font-size: 12px;
    }

    .i7tou-jtm__area-select {
        min-width: 0;
        width: 100%;
        height: 36px;
        font-size: 13px;
    }

    .i7tou-jtm__status {
        left: 12px;
        right: 12px;
        bottom: 12px;
        max-width: none;
        font-size: 13px;
        padding: 9px 12px;
    }

    .i7tou-jtm-leaflet-popup .leaflet-popup-content {
        width: 280px !important;
    }
}

/* 2.3.0：手機版把篩選、重置、載入更多按鈕移到地圖外，避免蓋住地圖圖標。 */
@media (max-width: 782px) {
    .i7tou-jtm__map-shell {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .i7tou-jtm__map-toolbar,
    .i7tou-jtm__area-panel,
    .i7tou-jtm__map-load-more-panel {
        position: static;
        top: auto;
        right: auto;
        bottom: auto;
        left: auto;
        z-index: auto;
        width: 100%;
        max-width: none;
        box-shadow: none;
        backdrop-filter: none;
    }

    .i7tou-jtm__map-toolbar {
        order: 1;
        display: flex;
        align-items: stretch;
        justify-content: space-between;
        flex-wrap: nowrap;
        gap: 8px;
        margin: 0;
    }

    .i7tou-jtm__filter-group {
        flex: 1 1 auto;
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 6px;
        min-width: 0;
        padding: 5px;
        border-radius: 18px;
        background: rgba(255, 255, 255, 0.98);
        box-shadow: 0 8px 22px rgba(15, 23, 42, 0.08);
    }

    .i7tou-jtm__filter {
        width: 100%;
        min-width: 0;
        padding: 12px 8px;
        font-size: 14px;
        white-space: nowrap;
    }

    .i7tou-jtm__reset {
        flex: 0 0 78px;
        padding: 12px 10px;
        font-size: 14px;
        background: #e2e8f0;
        box-shadow: 0 8px 22px rgba(15, 23, 42, 0.08);
    }

    .i7tou-jtm__area-panel {
        order: 2;
        display: flex;
        align-items: center;
        justify-content: space-between;
        flex-wrap: nowrap;
        gap: 8px;
        margin: 0;
        padding: 8px;
        border-radius: 18px;
        background: rgba(255, 255, 255, 0.98);
        box-shadow: 0 8px 22px rgba(15, 23, 42, 0.08);
    }

    .i7tou-jtm__select-label {
        flex: 1 1 0;
        min-width: 0;
        justify-content: flex-start;
        gap: 7px;
    }

    .i7tou-jtm__select-label > span {
        flex: 0 0 auto;
    }

    .i7tou-jtm__area-select {
        flex: 1 1 auto;
        min-width: 0;
        width: 100%;
        height: 40px;
        font-size: 14px;
    }

    .i7tou-jtm__map-load-more-panel {
        order: 3;
        display: flex;
        justify-content: stretch;
        margin: 0 0 2px;
        pointer-events: auto;
    }

    .i7tou-jtm__map-load-more-panel .i7tou-jtm__load-more {
        width: 100%;
        min-width: 0;
        padding: 14px 18px;
        font-size: 16px;
        box-shadow: 0 10px 24px rgba(14, 165, 233, 0.22);
    }

    .i7tou-jtm__map {
        order: 4;
    }
}

@media (max-width: 480px) {
    .i7tou-jtm__map-toolbar {
        flex-wrap: wrap;
    }

    .i7tou-jtm__filter-group {
        flex: 1 1 100%;
    }

    .i7tou-jtm__reset {
        flex: 1 1 100%;
    }

    .i7tou-jtm__area-panel {
        flex-direction: column;
        align-items: stretch;
    }

    .i7tou-jtm__select-label {
        width: 100%;
    }
}

/* v2.5：marker cluster 樣式，縮小地圖時先聚合 marker，避免一次渲染大量 DOM。 */
.i7tou-jtm .marker-cluster-small,
.i7tou-jtm .marker-cluster-medium,
.i7tou-jtm .marker-cluster-large {
    background: rgba(15, 23, 42, 0.16);
}

.i7tou-jtm .marker-cluster-small div,
.i7tou-jtm .marker-cluster-medium div,
.i7tou-jtm .marker-cluster-large div {
    background: rgba(255, 255, 255, 0.94);
    color: #0f172a;
    font-weight: 950;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.22);
}

.i7tou-jtm .leaflet-marker-icon,
.i7tou-jtm .leaflet-marker-shadow {
    will-change: transform;
}

/* v2.6：低縮放層級未被聚合的單一 marker，也顯示成聚合數字 1；前 10 名維持原本圖標不聚合。 */
.i7tou-jtm-single-cluster-icon {
    overflow: visible !important;
    background: transparent !important;
    border: 0 !important;
}

.i7tou-jtm-single-cluster {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.16);
    box-sizing: border-box;
}

.i7tou-jtm-single-cluster span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.94);
    color: #0f172a;
    font-size: 14px;
    font-weight: 950;
    line-height: 1;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.22);
}

.i7tou-jtm-single-cluster--spot span {
    box-shadow:
        0 10px 24px rgba(15, 23, 42, 0.22),
        inset 0 -3px 0 rgba(37, 99, 235, 0.22);
}

.i7tou-jtm-single-cluster--food span {
    box-shadow:
        0 10px 24px rgba(15, 23, 42, 0.22),
        inset 0 -3px 0 rgba(249, 115, 22, 0.24);
}
