/************************
基础设置
************************/

* {
    box-sizing: border-box;
}


html,
body {
    width: 100%;
    height: 100%;

    margin: 0;
    padding: 0;

    overflow: hidden;

    font-family:
        -apple-system,
        BlinkMacSystemFont,
        "PingFang SC",
        "Microsoft YaHei",
        sans-serif;

    background: #e8eff0;
    color: #283d42;
}


button,
input {
    font-family: inherit;
}


button {
    -webkit-tap-highlight-color: transparent;
}


button,
input {
    outline: none;
}


.scenic-map-page {
    position: relative;

    width: 100%;
    max-width: 430px;
    height: 100vh;

    margin: 0 auto;

    overflow: hidden;

    background: #dce7e8;

    box-shadow:
        0 0 32px rgba(0, 0, 0, 0.1);
}


/************************
顶部导航
************************/

.page-header {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 80;

    width: 100%;
    height:
        calc(
            64px +
            env(safe-area-inset-top)
        );

    display: grid;
    grid-template-columns: 46px 1fr 46px;
    align-items: end;

    padding:
        env(safe-area-inset-top)
        14px
        9px;

    background: rgba(255, 255, 255, 0.94);

    box-shadow:
        0 5px 22px rgba(37, 65, 72, 0.09);

    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}


.header-button {
    width: 40px;
    height: 40px;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 0;

    border: 0;
    border-radius: 50%;

    background: #edf3f4;
    color: #30474c;

    cursor: pointer;

    transition:
        transform 0.18s ease,
        background 0.18s ease;
}


.header-button:active {
    transform: scale(0.92);
    background: #e2ebec;
}


.back-button {
    font-size: 34px;
    line-height: 1;
}


.locate-button {
    font-size: 22px;
}


.header-title {
    min-width: 0;

    padding-bottom: 4px;

    text-align: center;
}


.header-title h1 {
    margin: 0;

    color: #263c41;

    font-size: 17px;
    line-height: 1.2;
    font-weight: 650;
}


.header-title span {
    display: block;

    margin-top: 3px;

    color: #8ca0a4;

    font-size: 10px;
}


/************************
地图主体
************************/

.map-main {
    position: relative;

    width: 100%;
    height: 100%;
}


.map-container {
    width: 100%;
    height: 100%;

    background: #dfe8e9;
}


/************************
地图加载状态
************************/

.map-loading,
.map-error {
    position: absolute;
    inset: 0;
    z-index: 100;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    padding: 30px;

    background: #edf3f4;

    text-align: center;
}


.map-loading.is-hidden {
    display: none;
}


.loading-circle {
    width: 34px;
    height: 34px;

    border: 3px solid #d3e2e3;
    border-top-color: #28a5a4;
    border-radius: 50%;

    animation:
        loading-rotate
        0.8s
        linear
        infinite;
}


@keyframes loading-rotate {

    to {
        transform: rotate(360deg);
    }

}


.map-loading p {
    margin: 13px 0 0;

    color: #788e92;

    font-size: 13px;
}


.map-error > span {
    width: 44px;
    height: 44px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 50%;

    background: #ffe8e4;
    color: #d66c60;

    font-size: 21px;
    font-weight: 700;
}


.map-error h2 {
    margin: 15px 0 0;

    color: #344b50;

    font-size: 20px;
}


.map-error p {
    max-width: 280px;

    margin: 10px 0 0;

    color: #87999d;

    font-size: 13px;
    line-height: 1.65;
}


/************************
搜索区域
************************/

.search-panel {
    position: absolute;
    top:
        calc(
            76px +
            env(safe-area-inset-top)
        );
    left: 12px;
    right: 12px;
    z-index: 60;
}


.search-box {
    height: 48px;

    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) 34px;
    align-items: center;

    padding: 0 7px;

    border: 1px solid rgba(53, 102, 111, 0.08);
    border-radius: 24px;

    background: rgba(255, 255, 255, 0.96);

    box-shadow:
        0 9px 25px rgba(33, 70, 77, 0.13);

    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
}


.search-icon {
    color: #6d8589;

    font-size: 22px;
    text-align: center;
}


.search-box input {
    width: 100%;

    padding: 0;

    border: 0;

    background: transparent;
    color: #30464b;

    font-size: 14px;
}


.search-box input::placeholder {
    color: #99aaad;
}


.search-box button {
    width: 30px;
    height: 30px;

    padding: 0;

    border: 0;
    border-radius: 50%;

    background: #edf3f4;
    color: #71888c;

    font-size: 19px;

    cursor: pointer;
}


/************************
分类标签
************************/

.category-tabs {
    display: flex;
    gap: 8px;

    overflow-x: auto;

    margin-top: 10px;
    padding: 1px 1px 8px;

    scrollbar-width: none;

    -webkit-overflow-scrolling: touch;
}


.category-tabs::-webkit-scrollbar {
    display: none;
}


.category-tab {
    flex: 0 0 auto;

    height: 36px;

    padding: 0 14px;

    border: 1px solid rgba(48, 105, 115, 0.09);
    border-radius: 19px;

    background: rgba(255, 255, 255, 0.95);
    color: #688085;

    font-size: 12px;

    box-shadow:
        0 6px 17px rgba(33, 67, 74, 0.09);

    cursor: pointer;

    transition:
        color 0.2s ease,
        background 0.2s ease,
        transform 0.18s ease;
}


.category-tab:active {
    transform: scale(0.95);
}


.category-tab.is-active {
    border-color: #2da9a6;

    background: #2da9a6;
    color: #fff;
}


/************************
景区数量
************************/

.result-badge {
    position: absolute;
    left: 13px;
    top:
        calc(
            190px +
            env(safe-area-inset-top)
        );
    z-index: 54;

    padding: 9px 12px;

    border-radius: 16px;

    background: rgba(255, 255, 255, 0.95);
    color: #5d7479;

    font-size: 11px;

    box-shadow:
        0 7px 18px rgba(31, 67, 74, 0.11);
}


/************************
地图控制按钮
************************/

.map-controls {
    position: absolute;
    right: 12px;
    top:
        calc(
            190px +
            env(safe-area-inset-top)
        );
    z-index: 55;

    display: flex;
    flex-direction: column;
    gap: 8px;
}


.map-controls button {
    width: 42px;
    height: 42px;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 0;

    border: 1px solid rgba(45, 91, 99, 0.08);
    border-radius: 14px;

    background: rgba(255, 255, 255, 0.95);
    color: #385157;

    font-size: 20px;

    box-shadow:
        0 7px 19px rgba(31, 66, 74, 0.12);

    cursor: pointer;

    transition:
        transform 0.18s ease,
        background 0.18s ease;
}


.map-controls button:active {
    transform: scale(0.92);
    background: #edf4f4;
}


/************************
底部景区抽屉
************************/

.scenic-drawer {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 65;

    height: 390px;

    padding:
        4px
        0
        calc(
            14px +
            env(safe-area-inset-bottom)
        );

    border-radius: 27px 27px 0 0;

    background: rgba(250, 253, 253, 0.97);

    box-shadow:
        0 -12px 30px rgba(27, 58, 64, 0.14);

    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);

    transform:
        translateY(
            calc(100% - 215px)
        );

    transition:
        transform 0.32s ease;
}


.scenic-drawer.is-expanded {
    transform: translateY(0);
}


.drawer-drag-area {
    width: 100%;
    height: 24px;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 0;

    border: 0;

    background: transparent;

    cursor: pointer;
}


.drawer-handle {
    width: 42px;
    height: 4px;

    border-radius: 3px;

    background: #d2dddd;
}


.drawer-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;

    padding: 4px 17px 13px;
}


.drawer-header p {
    margin: 0 0 4px;

    color: #2fa29e;

    font-size: 9px;
    font-weight: 700;
    letter-spacing: 1px;
}


.drawer-header h2 {
    margin: 0;

    color: #2c4247;

    font-size: 21px;
}


.drawer-header button {
    padding: 7px 10px;

    border: 0;
    border-radius: 10px;

    background: #e3f2f1;
    color: #278d89;

    font-size: 11px;

    cursor: pointer;
}


/************************
底部景区卡片
************************/

.scenic-card-scroll {
    display: flex;
    gap: 11px;

    overflow-x: auto;

    padding: 0 17px 14px;

    scrollbar-width: none;

    scroll-snap-type: x mandatory;

    -webkit-overflow-scrolling: touch;
}


.scenic-card-scroll::-webkit-scrollbar {
    display: none;
}


.map-scenic-card {
    flex: 0 0 230px;

    display: grid;
    grid-template-columns: 86px minmax(0, 1fr);
    gap: 11px;

    padding: 9px;

    border: 1px solid rgba(48, 107, 116, 0.07);
    border-radius: 19px;

    background: #fff;

    box-shadow:
        0 8px 20px rgba(36, 71, 77, 0.07);

    cursor: pointer;

    scroll-snap-align: start;

    transition:
        border-color 0.2s ease,
        transform 0.18s ease,
        box-shadow 0.2s ease;
}


.map-scenic-card:active {
    transform: scale(0.98);
}


.map-scenic-card.is-active {
    border-color: #35aaa5;

    box-shadow:
        0 9px 23px rgba(43, 158, 153, 0.17);
}


.map-scenic-card img {
    display: block;

    width: 86px;
    height: 96px;

    object-fit: cover;

    border-radius: 14px;
}


.map-scenic-card-content {
    min-width: 0;

    padding-top: 4px;

    text-align: left;
}


.map-scenic-card-content span {
    color: #2d9c97;

    font-size: 9px;
}


.map-scenic-card-content h3 {
    margin: 7px 0 0;

    color: #30464b;

    font-size: 15px;
    line-height: 1.35;
}


.map-scenic-card-content p {
    margin: 6px 0 0;

    overflow: hidden;

    color: #83969a;

    font-size: 10px;
    line-height: 1.5;

    white-space: nowrap;
    text-overflow: ellipsis;
}


.map-scenic-card-content small {
    display: block;

    margin-top: 9px;

    color: #6f898d;

    font-size: 9px;
}


/************************
景区详情弹层
************************/

.place-detail {
    position: absolute;
    left: 12px;
    right: 12px;
    bottom:
        calc(
            15px +
            env(safe-area-inset-bottom)
        );
    z-index: 90;

    max-height:
        calc(
            100vh -
            105px -
            env(safe-area-inset-top)
        );

    overflow-y: auto;

    border-radius: 25px;

    background: #fff;

    box-shadow:
        0 18px 45px rgba(25, 54, 61, 0.26);

    scrollbar-width: none;

    animation:
        detail-enter
        0.28s
        ease;
}


.place-detail::-webkit-scrollbar {
    display: none;
}


@keyframes detail-enter {

    from {
        opacity: 0;
        transform: translateY(25px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }

}


.place-detail > img {
    display: block;

    width: 100%;
    height: 155px;

    object-fit: cover;
}


.detail-close {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 3;

    width: 32px;
    height: 32px;

    padding: 0;

    border: 0;
    border-radius: 50%;

    background: rgba(15, 39, 45, 0.68);
    color: #fff;

    font-size: 20px;

    cursor: pointer;
}


.detail-content {
    padding: 17px;
}


.detail-category {
    display: inline-flex;

    padding: 5px 8px;

    border-radius: 7px;

    background: #e1f2f1;
    color: #2d9691;

    font-size: 9px;
}


.detail-content h2 {
    margin: 9px 0 0;

    color: #2b4146;

    font-size: 22px;
}


.detail-address {
    margin: 7px 0 0;

    color: #6f878b;

    font-size: 11px;
}


.detail-description {
    margin: 10px 0 0;

    color: #819499;

    font-size: 12px;
    line-height: 1.65;
}


.detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;

    margin-top: 13px;
}


.detail-meta span {
    padding: 6px 8px;

    border-radius: 8px;

    background: #f0f5f5;
    color: #6f868a;

    font-size: 9px;
}


.detail-actions {
    display: grid;
    grid-template-columns: 1fr 1.35fr;
    gap: 9px;

    margin-top: 16px;
}


.detail-actions button {
    height: 44px;

    border-radius: 22px;

    font-size: 13px;

    cursor: pointer;
}


.detail-focus-button {
    border: 1px solid #cfe4e3;

    background: #f4f9f8;
    color: #428986;
}


.detail-navigation-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;

    border: 0;

    background:
        linear-gradient(
            90deg,
            #2da6a2,
            #5bc7c1
        );

    color: #fff;
}


/************************
Toast
************************/

.toast {
    position: fixed;
    left: 50%;
    bottom:
        calc(
            235px +
            env(safe-area-inset-bottom)
        );
    z-index: 120;

    padding: 10px 16px;

    border-radius: 20px;

    background: rgba(22, 53, 59, 0.92);
    color: #fff;

    font-size: 12px;

    opacity: 0;
    pointer-events: none;

    transform:
        translate(-50%, 15px);

    transition:
        opacity 0.23s ease,
        transform 0.23s ease;
}


.toast.is-visible {
    opacity: 1;

    transform:
        translate(-50%, 0);
}


/************************
高德地图信息窗体
************************/

.amap-info-content {
    padding: 12px !important;

    border-radius: 14px !important;
}


.amap-info-close {
    top: 7px !important;
    right: 8px !important;
}


.map-info-window {
    min-width: 145px;

    padding: 2px 5px;
}


.map-info-window strong {
    display: block;

    padding-right: 15px;

    color: #2f464b;

    font-size: 14px;
}


.map-info-window span {
    display: block;

    margin-top: 5px;

    color: #788e92;

    font-size: 10px;
}


/************************
小屏适配
************************/

@media (max-width: 360px) {

    .search-panel {
        right: 10px;
        left: 10px;
    }


    .map-controls {
        right: 10px;
    }


    .result-badge {
        left: 10px;
    }


    .map-scenic-card {
        flex-basis: 215px;

        grid-template-columns:
            80px
            minmax(0, 1fr);
    }


    .map-scenic-card img {
        width: 80px;
        height: 92px;
    }


    .place-detail {
        right: 10px;
        left: 10px;
    }

}


/************************
减少动画
************************/

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

}