/* 中国国土地理地图 /map/dili：复用 earthquakes.css 工作区布局（eq-*），此处只写专题差异样式 */

/* 图表容器尺寸：earthquakes.css 的 #eqChart 规则不会命中本页的 #geoChart，必须镜像声明，
   否则容器高度坍塌为 0，ECharts 初始化为 792×0 的空画布（图层全部不可见） */
#geoChart {
    width: 100%;
    height: 100%;
    min-height: 0;
}

/* 头部状态行：静态图集图标（区别于地震页实时呼吸点） */
.geo-src-dot {
    color: var(--bs-primary, #2163e8);
    font-size: 0.8rem;
    flex-shrink: 0;
}

.eq-update-line .eq-live-label {
    color: var(--bs-primary, #2163e8);
}

/* 图层开关组：默认行顶部右侧，窄屏折行 */
.geo-layer-switch {
    flex-wrap: wrap;
}

.geo-layer-btn {
    --bs-btn-padding-y: 0.22rem;
    --bs-btn-padding-x: 0.55rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.28rem;
    font-size: 0.78rem;
    margin-bottom: 0;
}

.geo-layer-btn i {
    font-size: 0.72rem;
    opacity: 0.85;
    margin: 0;
}

.geo-layer-txt-short {
    display: none;
}

.geo-title-short {
    display: none;
}

/* 图例：河流分级色条 + 湖泊色块 */
.geo-legend-hint .geo-lg {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.geo-river-dot {
    display: inline-block;
    width: 16px;
    height: 0;
    border-top-style: solid;
    border-top-width: 2.4px;
    border-radius: 2px;
}

.geo-river-dot[data-grade="1"] { border-top-color: #1d6fd6; }
.geo-river-dot[data-grade="2"] { border-top-color: #4a93e0; border-top-width: 1.6px; }
.geo-river-dot[data-grade="3"] { border-top-color: #8fbcea; border-top-width: 1.2px; }

.geo-lg-lake {
    display: inline-block;
    width: 12px;
    height: 9px;
    border-radius: 3px;
    background: rgba(45, 120, 210, 0.72);
    border: 1px solid #2f7ac8;
}

.geo-lg-label {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 1px;
    background: #8a6d3b;
    transform: rotate(45deg);
}

.geo-lg-rail,
.geo-lg-road {
    display: inline-block;
    width: 16px;
    height: 0;
    border-top-style: solid;
    border-top-width: 2px;
    border-radius: 2px;
}

.geo-lg-rail { border-top-color: rgba(120, 113, 108, 0.85); }
.geo-lg-road { border-top-color: rgba(196, 143, 64, 0.9); }

/* 详情面板（河流/湖泊/标注属性） */
.geo-detail-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    font-weight: 700;
    font-size: 0.95rem;
    color: #2c3e50;
    padding: 0.55rem 0.55rem 0.55rem 0.75rem;
    border-bottom: 1px solid #e9eef3;
}

.geo-detail-title-main {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    min-width: 0;
}

.geo-detail-title-main i {
    color: var(--bs-primary, #2163e8);
    font-size: 0.85rem;
    flex-shrink: 0;
}

.geo-detail-close {
    flex-shrink: 0;
    width: 1.75rem;
    height: 1.75rem;
    padding: 0;
    border: 1px solid #dbe4ec;
    border-radius: 0.4rem;
    background: #fff;
    color: #6b7785;
    line-height: 1;
    cursor: pointer;
}

.geo-detail-close:hover {
    color: #1f2937;
    border-color: #c5d0db;
    background: #f8fafc;
}

.geo-detail-close i {
    font-size: 0.75rem;
}

.geo-detail-row {
    display: flex;
    gap: 0.6rem;
    padding: 0.3rem 0.75rem;
    font-size: 0.8rem;
    line-height: 1.55;
}

.geo-detail-row:nth-child(even) {
    background: rgba(0, 0, 0, 0.015);
}

.geo-detail-k {
    flex: 0 0 3.5em;
    color: #8a95a1;
}

.geo-detail-v {
    flex: 1;
    min-width: 0;
    color: #37424c;
    word-break: break-word;
    overflow-wrap: anywhere;
    white-space: normal;
}

/* 侧栏：标题 + 详情置顶固定，仅列表区域滚动（不影响地震页全局 .eq-side-panel） */
.geo-side-panel.eq-side-panel {
    overflow: hidden;
}

.geo-side-panel .eq-panel-head {
    flex-shrink: 0;
    z-index: 2;
}

/* 详情置顶：内容少，随高度自然撑开，不单独出滚动条
   （覆盖 earthquakes.css 里 .eq-detail 的 overflow-y:auto） */
#geoDetail.eq-detail {
    flex-shrink: 0;
    padding: 0;
    max-height: none !important;
    overflow: visible !important;
    border-bottom: 1px solid #e5e5e5;
    background: rgba(var(--bs-primary-rgb, 33, 99, 232), 0.04);
    z-index: 1;
}

#geoDetail.eq-detail.d-none {
    display: none !important;
    max-height: 0;
    border-bottom: 0;
    padding: 0;
}

.geo-side-panel .geo-list.eq-list {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* 要素列表按钮（河流/湖泊/标注统一结构） */
.geo-item {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    width: 100%;
    padding: 0.5rem 0.75rem 0.5rem 0.85rem;
    border: 0;
    border-bottom: 1px solid #eef1f5;
    background: transparent;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s ease, box-shadow 0.15s ease;
}

.geo-item:hover {
    background: #f2f6fb;
}

.geo-item.active {
    background: linear-gradient(90deg, rgba(33, 99, 232, 0.12) 0%, rgba(33, 99, 232, 0.05) 100%);
    box-shadow: inset 3px 0 0 var(--bs-primary, #2163e8);
}

.geo-item.active:hover {
    background: linear-gradient(90deg, rgba(33, 99, 232, 0.16) 0%, rgba(33, 99, 232, 0.07) 100%);
}

.geo-item-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    min-width: 0;
}

.geo-item-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: #2c3e50;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.geo-item.active .geo-item-name {
    color: var(--bs-primary, #2163e8);
    font-weight: 700;
}

.geo-item-tags {
    display: inline-flex;
    align-items: center;
    gap: 0.28rem;
    flex-shrink: 0;
}

.geo-item-tag {
    flex-shrink: 0;
    font-size: 0.64rem;
    font-weight: 600;
    line-height: 1;
    padding: 0.18rem 0.38rem;
    border-radius: 0.3rem;
    color: #5b6b7c;
    background: #eef2f6;
    letter-spacing: 0.01em;
}

.geo-item-tag[data-grade="1"] { color: #1d6fd6; background: rgba(29, 111, 214, 0.12); }
.geo-item-tag[data-grade="2"] { color: #3b7fc2; background: rgba(74, 147, 224, 0.14); }
.geo-item-tag[data-grade="3"] { color: #6a90b0; background: rgba(143, 188, 234, 0.2); }
.geo-item-tag[data-kind="railways"] { color: #57534e; background: rgba(120, 113, 108, 0.14); }
.geo-item-tag[data-kind="roads"] { color: #9a6700; background: rgba(196, 143, 64, 0.16); }
.geo-item-tag[data-kind="lakes"] { color: #2f7ac8; background: rgba(45, 120, 210, 0.12); }
.geo-item-tag[data-kind="labels"] { color: #8a6d3b; background: rgba(138, 109, 59, 0.14); }

.geo-item-badge {
    flex-shrink: 0;
    font-size: 0.65rem;
    font-weight: 600;
    line-height: 1;
    padding: 0.18rem 0.4rem;
    border-radius: 0.3rem;
    color: #fff;
    background: var(--bs-primary, #2163e8);
    letter-spacing: 0.02em;
}

.geo-item-sub {
    font-size: 0.72rem;
    color: #8a95a1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.geo-item.active .geo-item-sub {
    color: #6b7c93;
}

.geo-list-more {
    padding: 0.55rem 0.85rem 0.75rem;
    text-align: center;
    font-size: 0.72rem;
    color: #8a95a1;
}

/* 移动端窄屏：对齐地震图抽屉；文案与列表触控优化 */
@media (max-width: 991.98px) {
    .geo-layer-switch {
        width: 100%;
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        gap: 0;
    }

    .geo-layer-switch::-webkit-scrollbar {
        display: none;
    }

    .geo-layer-btn {
        flex: 1 1 0;
        min-width: 0;
        padding-left: 0.3rem;
        padding-right: 0.3rem;
        font-size: 0.74rem;
    }

    .geo-layer-btn i {
        display: none;
    }

    .eq-update-time {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        max-width: 58vw;
    }

    .geo-legend-hint {
        max-width: calc(100% - 5.5rem);
        flex-wrap: wrap;
        row-gap: 0.2rem;
    }

    .geo-item {
        padding: 0.62rem 0.85rem;
        gap: 0.22rem;
        min-height: 3rem;
    }

    .geo-item-name {
        white-space: normal;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        line-height: 1.35;
        font-size: 0.88rem;
    }

    .geo-item-sub {
        white-space: normal;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        line-height: 1.35;
        font-size: 0.74rem;
    }

    .geo-detail-row {
        flex-direction: column;
        align-items: stretch;
        gap: 0.12rem;
        padding: 0.45rem 0.85rem;
    }

    .geo-detail-k {
        flex: none;
        font-size: 0.72rem;
    }

    .geo-detail-v {
        font-size: 0.86rem;
        line-height: 1.5;
    }

    .geo-detail-title {
        padding: 0.65rem 0.85rem;
    }

    .geo-detail-title-main {
        font-size: 0.92rem;
        line-height: 1.35;
    }

    .eq-panel-head-actions {
        display: inline-flex;
        align-items: center;
        gap: 0.35rem;
        flex-shrink: 0;
    }

    .eq-mobile-close {
        width: 2rem;
        height: 2rem;
        padding: 0;
        line-height: 1;
        border: 1px solid #dbe4ec;
        border-radius: 0.45rem;
        color: #5f6b76;
        background: #fff;
    }

    /* 移动端改用底部浮动面板，不再使用侧栏遮罩 */
    .eq-list-backdrop {
        display: none !important;
    }
}

@media (max-width: 575.98px) {
    .geo-title-full {
        display: none;
    }

    .geo-title-short {
        display: inline;
    }

    .geo-layer-txt-full {
        display: none;
    }

    .geo-layer-txt-short {
        display: inline;
    }

    .geo-layer-btn {
        flex: 1 1 0;
        min-width: 2.4rem;
        padding-left: 0.2rem;
        padding-right: 0.2rem;
        font-size: 0.8rem;
        font-weight: 600;
    }

    .geo-layer-btn i {
        display: none;
    }

    .eq-panel-head-title {
        font-size: 0.84rem;
    }

    .geo-item-name {
        font-size: 0.9rem;
    }

    .geo-legend-hint .geo-lg {
        font-size: 0.66rem;
    }

    .eq-mobile-toggle {
        padding: 0.35rem 0.65rem;
        font-size: 0.78rem;
        border-radius: 999px;
        box-shadow: 0 2px 8px rgba(15, 23, 42, 0.12);
    }
}
