/* 国土空间规划专题页（/map/guihua）补充样式
   公共布局复用 earthquakes.css / geography.css / cityclusters.css（eq-workspace、geo-layer-switch、cc-docs-*）；
   本文件仅声明 gh 前缀专属样式，色板全部取模板 CSS 变量（换主题色自动跟随）。 */

/* earthquakes.css 只声明了 #eqChart；本页用 #ghChart，不镜像会高度坍成 0 */
#ghChart {
    width: 100%;
    height: 100%;
    min-height: 0;
}

/* 详情卡：上方批复信息，下方关联文档独立滚动（对齐 theme/cityclusters 详情结构） */
#ghDetail.eq-detail {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    padding: 0;
    overflow: hidden;
}

#ghDetail.eq-detail.d-none {
    display: none !important;
}

/* ---- 批复卡 ---- */
.gh-pf {
    flex-shrink: 0;
    margin: 0.55rem 0.65rem 0;
    padding: 0.7rem 0.8rem 0.75rem;
    border: 1px solid rgba(var(--bs-primary-rgb, 33, 99, 232), 0.14);
    border-radius: 0.55rem;
    background:
        linear-gradient(180deg, rgba(var(--bs-primary-rgb, 33, 99, 232), 0.06) 0%, rgba(255, 255, 255, 0.92) 42%, #fff 100%);
}

.gh-pf-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
}

.gh-pf-title {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    min-width: 0;
    font-size: 0.98rem;
    font-weight: 650;
    color: #1f2a3d;
    line-height: 1.35;
}

.gh-pf-title i {
    flex: 0 0 auto;
    color: var(--bs-primary, #2163e8);
    font-size: 0.9rem;
}

.gh-pf-title span {
    min-width: 0;
    word-break: break-word;
}

.gh-pf .geo-detail-close {
    flex: 0 0 auto;
    margin: -0.15rem -0.2rem 0 0;
}

.gh-pf-plan {
    margin-top: 0.4rem;
    font-size: 0.82rem;
    font-weight: 500;
    color: #4a5562;
    line-height: 1.55;
    word-break: break-word;
}

.gh-pf-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    margin-top: 0.5rem;
}

.gh-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.12em 0.55em;
    border-radius: 0.3rem;
    font-size: 0.68rem;
    line-height: 1.45;
    white-space: nowrap;
}

.gh-badge-year {
    color: var(--sc-deep-primary, #1f4ead);
    background: rgba(var(--bs-primary-rgb, 33, 99, 232), 0.10);
}

.gh-badge-role {
    color: #fff;
    background: var(--sc-deep-primary, #1f4ead);
}

.gh-badge-role.is-sed {
    background: var(--sc-deep-gold, #8f7d24);
}

.gh-badge-role.is-key {
    color: var(--sc-deep-primary, #1f4ead);
    background: rgba(var(--bs-primary-rgb, 33, 99, 232), 0.06);
    border: 1px solid rgba(var(--bs-primary-rgb, 33, 99, 232), 0.28);
}

.gh-pf-docno {
    display: inline-flex;
    align-items: center;
    padding: 0.12em 0.5em;
    border-radius: 0.3rem;
    font-size: 0.68rem;
    line-height: 1.45;
    color: #5f6b76;
    background: #f3f5f8;
    letter-spacing: 0.01em;
}

.gh-pf-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.65rem;
}

.gh-pf-btn,
.gh-pf-official {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.32rem 0.72rem;
    border-radius: 0.4rem;
    font-size: 0.76rem;
    font-weight: 500;
    line-height: 1.3;
    text-decoration: none;
}

.gh-pf-btn {
    background: var(--bs-primary, #2163e8);
    color: #fff !important;
    border: 1px solid transparent;
}

.gh-pf-btn:hover {
    background: var(--sc-deep-primary, #1f4ead);
    color: #fff !important;
}

.gh-pf-official {
    color: var(--sc-deep-primary, #1f4ead);
    background: #fff;
    border: 1px solid rgba(var(--bs-primary-rgb, 33, 99, 232), 0.28);
}

.gh-pf-official:hover {
    color: var(--bs-primary, #2163e8);
    background: rgba(var(--bs-primary-rgb, 33, 99, 232), 0.06);
    border-color: rgba(var(--bs-primary-rgb, 33, 99, 232), 0.45);
}

/* 下辖国务院批复城市（省详情卡内） */
.gh-children {
    flex-shrink: 0;
    padding: 0.5rem 0.75rem 0.6rem;
    border-bottom: 1px solid #e3e9f0;
}

.gh-children-title {
    font-size: 0.72rem;
    color: #8a95a1;
    margin-bottom: 0.35rem;
}

.gh-children-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.gh-child-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.74rem;
    text-decoration: none;
    color: var(--sc-deep-primary, #1f4ead);
    background: rgba(var(--bs-primary-rgb, 33, 99, 232), 0.08);
    border: 1px solid rgba(var(--bs-primary-rgb, 33, 99, 232), 0.25);
}

.gh-child-btn:hover {
    background: rgba(var(--bs-primary-rgb, 33, 99, 232), 0.18);
}

.gh-child-btn.is-current {
    color: #fff;
    background: var(--bs-primary, #2163e8);
    border-color: var(--bs-primary, #2163e8);
    font-weight: 600;
}

.gh-child-btn.is-current:hover {
    background: var(--sc-deep-primary, #1f4ead);
    border-color: var(--sc-deep-primary, #1f4ead);
    color: #fff;
}

/* ---- 文档区（三栏目 Tab） ---- */
.gh-docs-tabs {
    display: flex;
    flex-shrink: 0;
    gap: 0.25rem;
    padding: 0.45rem 0.75rem 0;
}

.gh-docs-tab {
    border: none;
    background: transparent;
    padding: 0.24rem 0.55rem;
    border-radius: 0.35rem 0.35rem 0 0;
    font-size: 0.74rem;
    color: #5f6b76;
    border-bottom: 2px solid transparent;
}

.gh-docs-tab .cnt {
    font-size: 0.66rem;
    color: #8a95a1;
    margin-left: 0.2rem;
}

.gh-docs-tab.active {
    color: var(--bs-primary, #2163e8);
    border-bottom-color: var(--bs-primary, #2163e8);
    font-weight: 600;
}

.gh-docs-tab.active .cnt {
    color: var(--bs-primary, #2163e8);
}

#ghDocsList {
    flex: 1 1 auto;
    min-height: 0;
    padding: 0 0.75rem 0.5rem;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* ---- 列表行（全国视图侧栏） ---- */
.gh-list-tabs {
    display: flex;
    gap: 0.15rem;
    padding: 0.4rem 0.5rem 0;
    border-bottom: 1px solid #e3e9f0;
    background: #fff;
    position: sticky;
    top: 0;
    z-index: 2;
}

.gh-list-tab {
    flex: 1 1 0;
    border: none;
    background: transparent;
    padding: 0.4rem 0.15rem 0.45rem;
    border-radius: 0.35rem 0.35rem 0 0;
    font-size: 0.74rem;
    color: #5f6b76;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    line-height: 1.2;
    white-space: nowrap;
}

.gh-list-tab .cnt {
    font-size: 0.66rem;
    color: #8a95a1;
    margin-left: 0.15rem;
}

.gh-list-tab.active {
    color: var(--bs-primary, #2163e8);
    border-bottom-color: var(--bs-primary, #2163e8);
    font-weight: 600;
}

.gh-list-tab.active .cnt {
    color: var(--bs-primary, #2163e8);
}

.gh-group-head {
    padding: 0.45rem 0.75rem 0.25rem;
    font-size: 0.7rem;
    color: #8a95a1;
    letter-spacing: 0.02em;
}

.gh-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.42rem 0.75rem;
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
    border-bottom: 1px solid #eef2f6;
    cursor: pointer;
}

.gh-item:hover {
    background: rgba(var(--bs-primary-rgb, 33, 99, 232), 0.05);
}

.gh-item.active {
    background: rgba(var(--bs-primary-rgb, 33, 99, 232), 0.10);
}

.gh-item-mark {
    flex: 0 0 0.62rem;
    height: 0.62rem;
    border-radius: 50%;
    border: 1.5px solid #fff;
    box-shadow: 0 0 0 1px rgba(31, 42, 61, 0.25);
}

.gh-item-mark.role-capital {
    background: var(--bs-primary, #2163e8);
}

.gh-item-mark.role-sed {
    background: var(--sc-solid-gold, #a58e1d);
    border-radius: 2px;
    transform: rotate(45deg);
}

.gh-item-mark.role-key {
    background: #fff;
    border: 1.5px solid var(--bs-primary, #2163e8);
}

.gh-item-mark.role-prov {
    background: rgba(var(--bs-primary-rgb, 33, 99, 232), 0.30);
    border-radius: 2px;
}

.gh-item-name {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 0.82rem;
    color: #37424c;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gh-item-name small {
    color: #98a2ad;
    font-size: 0.7rem;
}

.gh-item-year {
    flex-shrink: 0;
    font-size: 0.7rem;
    color: #98a2ad;
}

/* ---- 顶部统计条（复用 .eq-stat 卡片，本页微调） ---- */
#ghWorkspace .eq-stats-row {
    gap: 0.45rem;
    min-width: 0;
}

#ghWorkspace .eq-stat {
    background: linear-gradient(180deg, #fff 0%, #fbfcfe 100%);
}

#ghWorkspace .eq-stat-body b {
    display: inline-flex;
    align-items: baseline;
    gap: 0.15rem;
    color: var(--sc-deep-primary, #1f4ead);
}

#ghWorkspace .gh-stat-suffix {
    font-size: 0.68rem;
    font-weight: 500;
    color: #8a95a1;
}

#ghWorkspace .eq-toolbar-controls {
    flex: 1 1 160px;
    min-width: 140px;
    justify-content: flex-end;
}

#ghWorkspace .eq-toolbar-controls .eq-search {
    margin-left: auto;
    border-radius: 0.5rem;
    border-color: rgba(var(--bs-primary-rgb, 33, 99, 232), 0.18);
    background: #fff;
}

#ghWorkspace .eq-toolbar-controls .eq-search:focus {
    border-color: rgba(var(--bs-primary-rgb, 33, 99, 232), 0.45);
    box-shadow: 0 0 0 0.15rem rgba(var(--bs-primary-rgb, 33, 99, 232), 0.12);
}

@media (max-width: 991.98px) {
    #ghWorkspace .eq-toolbar {
        --eq-ctl-h: 40px;
        gap: 0.45rem;
    }

    #ghWorkspace .eq-stats-row {
        width: 100%;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding-bottom: 0.1rem;
    }

    #ghWorkspace .eq-stats-row::-webkit-scrollbar {
        display: none;
    }

    #ghWorkspace .eq-stats-row .eq-stat {
        flex: 0 0 auto;
        min-width: 4.6rem;
    }

    #ghWorkspace .eq-toolbar-divider {
        display: none;
    }

    #ghWorkspace .eq-toolbar-controls {
        width: 100%;
        min-width: 0;
        flex: 1 1 100%;
        justify-content: stretch;
    }

    #ghWorkspace .eq-toolbar-controls .eq-search {
        max-width: none;
        width: 100%;
        margin-left: 0;
    }
}

@media (max-width: 575.98px) {
    #ghWorkspace .eq-toolbar {
        --eq-ctl-h: 36px;
    }

    #ghWorkspace .eq-stat {
        padding: 0.28rem 0.4rem;
        gap: 0.32rem;
    }

    #ghWorkspace .eq-stat-icon {
        width: 26px;
        height: 26px;
        font-size: 0.95rem;
    }

    #ghWorkspace .eq-stat-body b {
        font-size: 0.88rem;
    }

    #ghWorkspace .eq-stats-row .eq-stat {
        min-width: 4.2rem;
    }
}

/* 点选市县后的文档区提示 */
.gh-sub-pick-hint {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin: 0.35rem 0 0.15rem;
    padding: 0.35rem 0.55rem;
    border-radius: 0.4rem;
    background: rgba(var(--bs-primary-rgb, 33, 99, 232), 0.08);
    color: var(--sc-deep-primary, #1f4ead);
    font-size: 0.75rem;
    line-height: 1.35;
}

.gh-sub-pick-hint i {
    opacity: 0.85;
}

/* 省下钻：市县名称注记（Leaflet permanent tooltip） */
.gh-sub-label {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    color: #5f6b76;
    font-size: 0.68rem;
    font-weight: 500;
    padding: 0 !important;
    margin: 0 !important;
    white-space: nowrap;
    pointer-events: none;
    text-shadow:
        0 0 2px #fff,
        0 0 3px #fff,
        1px 0 0 #fff,
        -1px 0 0 #fff,
        0 1px 0 #fff,
        0 -1px 0 #fff;
}

.gh-sub-label.has-docs {
    color: var(--sc-deep-primary, #1f4ead);
    font-weight: 650;
    font-size: 0.72rem;
}

.leaflet-tooltip-top.gh-sub-label::before,
.leaflet-tooltip-bottom.gh-sub-label::before,
.leaflet-tooltip-left.gh-sub-label::before,
.leaflet-tooltip-right.gh-sub-label::before {
    display: none !important;
}

/* ---- 地图图例 ---- */
.gh-legend {
    position: absolute;
    left: 0.75rem;
    bottom: 0.75rem;
    z-index: 5;
    display: flex;
    flex-direction: column;
    gap: 0.28rem;
    padding: 0.5rem 0.65rem;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid #dbe4ec;
    border-radius: 0.5rem;
    backdrop-filter: blur(4px);
    font-size: 0.72rem;
    color: #37424c;
    pointer-events: none;
}

.gh-legend-row {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    white-space: nowrap;
}

.gh-legend-mark {
    flex: 0 0 0.72rem;
    height: 0.72rem;
    border-radius: 50%;
    border: 1.5px solid #fff;
    box-shadow: 0 0 0 1px rgba(31, 42, 61, 0.25);
}

.gh-legend-mark.role-capital {
    background: var(--bs-primary, #2163e8);
}

.gh-legend-mark.role-sed {
    background: var(--sc-solid-gold, #a58e1d);
    border-radius: 2px;
    transform: rotate(45deg);
}

.gh-legend-mark.role-key {
    background: #fff;
    border: 1.5px solid var(--bs-primary, #2163e8);
}

.gh-legend-swatch {
    flex: 0 0 0.85rem;
    height: 0.55rem;
    border-radius: 2px;
}

.gh-legend-swatch.prov {
    background: rgba(var(--bs-primary-rgb, 33, 99, 232), 0.16);
    border: 1px solid rgba(var(--bs-primary-rgb, 33, 99, 232), 0.3);
}

/* 移动端：图例缩小并允许两列换行 */
@media (max-width: 767.98px) {
    .gh-legend {
        left: 0.5rem;
        bottom: 0.5rem;
        padding: 0.35rem 0.5rem;
        font-size: 0.66rem;
        gap: 0.2rem;
        max-width: 60%;
    }

    .gh-legend-row {
        gap: 0.3rem;
    }
}

/* —— 顶栏图层/视图按钮：图标字号与高度统一 —— */
#ghWorkspace .eq-top-actions {
    --gh-ctrl-h: 1.875rem;
}

#ghWorkspace .eq-top-actions .geo-layer-btn,
#ghWorkspace .eq-top-actions .eq-view-switch .btn {
    box-sizing: border-box;
    height: var(--gh-ctrl-h);
    min-height: var(--gh-ctrl-h);
    margin-bottom: 0;
    padding-top: 0;
    padding-bottom: 0;
    --bs-btn-padding-y: 0;
    --bs-btn-padding-x: 0.55rem;
    font-size: 0.78rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.28rem;
}

#ghWorkspace .eq-top-actions .geo-layer-btn i,
#ghWorkspace .eq-top-actions .eq-view-switch .btn i {
    font-size: 0.78rem;
    line-height: 1;
    width: 1em;
    height: 1em;
    margin: 0;
    opacity: 0.9;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

#ghWorkspace .eq-top-actions .geo-layer-txt-full,
#ghWorkspace .eq-top-actions .geo-layer-txt-short {
    margin: 0;
}

@media (max-width: 991.98px) {
    #ghWorkspace .eq-top-actions {
        --gh-ctrl-h: 1.75rem;
        flex-wrap: nowrap;
        justify-content: flex-end;
        width: auto;
        flex: 0 1 auto;
        min-width: 0;
        gap: 0.3rem;
    }

    #ghWorkspace .eq-top-actions .geo-layer-txt-full {
        display: none !important;
    }

    #ghWorkspace .eq-top-actions .geo-layer-txt-short {
        display: inline !important;
    }

    #ghWorkspace .eq-top-actions .eq-view-switch {
        order: 2;
        flex: 0 0 auto;
    }

    #ghWorkspace #ghLayerSwitch.geo-layer-switch {
        order: 1;
        flex: 0 1 auto !important;
        width: auto !important;
        max-width: calc(100% - 5.5rem);
        min-width: 0;
        display: inline-flex !important;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        gap: 0;
        margin-left: 0;
    }

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

    #ghWorkspace .eq-top-actions .geo-layer-btn,
    #ghWorkspace .eq-top-actions .eq-view-switch .btn {
        font-size: 0.74rem;
        --bs-btn-padding-x: 0.4rem;
        white-space: nowrap;
    }

    #ghWorkspace .eq-top-actions .geo-layer-btn {
        flex: 0 0 auto !important;
        width: auto !important;
        min-width: 0;
    }

    #ghWorkspace .eq-top-actions .geo-layer-btn i,
    #ghWorkspace .eq-top-actions .eq-view-switch .btn i {
        font-size: 0.74rem;
    }

    #ghWorkspace #ghUpdateLine {
        flex: 0 1 auto;
        min-width: 0;
        max-width: 40%;
    }

    #ghWorkspace #ghUpdateTime {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        min-width: 0;
    }
}

@media (max-width: 575.98px) {
    #ghWorkspace .eq-top-actions {
        --gh-ctrl-h: 1.7rem;
    }

    #ghWorkspace .eq-top-actions .geo-layer-btn,
    #ghWorkspace .eq-top-actions .eq-view-switch .btn {
        font-size: 0.72rem;
        font-weight: 600;
        --bs-btn-padding-x: 0.34rem;
    }

    /* 手机：状态行只留标签，时间进 title 可看（updateTime 仍写文案） */
    #ghWorkspace .eq-update-sep,
    #ghWorkspace #ghUpdateTime {
        display: none;
    }
}
